diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000..d7fdc4a75ee5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +node_modules/ +built/ +bin/wrapped_tsc.js +tests/cases/*.js +tests/cases/*/*.js +tests/cases/*/*/*.js +tests/cases/*/*/*/*.js +tests/cases/*/*/*/*/*.js +tests/cases/*.js.map +tests/cases/*/*.js.map +tests/cases/*/*/*.js.map +tests/cases/*/*/*/*.js.map +tests/cases/*/*/*/*/*.js.map +tests/cases/rwc/* +tests/cases/perf/* +!tests/cases/webharness/compilerToString.js +tests/runners/*.js +tests/runners/*/*.js +tests/runners/rwc/* +!tests/runners/rwc/rwcRunner.ts +!tests/runners/rwc/loggedIO.ts +diff-*.html +test-args.txt +*.suo +~*.docx +tests/baselines/local/* +tests/baselines/reference/projectOutput/ +tests/services/baselines/local/* +tests/baselines/prototyping/local/* +tests/baselines/rwc/* +tests/services/baselines/prototyping/local/* +tests/services/browser/typescriptServices.js +scripts/processDiagnosticMessages.d.ts +scripts/processDiagnosticMessages.js +src/compiler/*.js +src/compiler/syntax/wrapped_SyntaxGenerator.js +src/compiler/syntax/SyntaxGenerator.js +src/compiler/syntax/SyntaxGenerator.d.ts +src/compiler/prototype/*.js +src/services/*.js +src/services/*/*.js +src/harness/*.js +src/prototype/*.js +src/prototype/*/*.js +baseline-report.html +fidelity-report.html +rwc-report.html +*.swp +build.json +monaco.editor.json +samples/win8/encyclopedia/Encyclopedia/js/*.js +samples/win8/encyclopedia/Encyclopedia/js/*.js.map +samples/win8/encyclopedia/Encyclopedia/bin/ +samples/win8/encyclopedia/Encyclopedia/bld/ +samples/win8/encyclopedia/Encyclopedia/Encyclopedia.jsproj.user +*.actual +tests/Fidelity/*.d.ts +tests/Fidelity/*.js +tests/cases/webharness/*.d.ts +tests/webhost/*.d.ts +tests/webhost/webtsc.js +tests/*.js +tests/*.d.ts +*.config +scripts/debug.bat +scripts/run.bat \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000000..fd2663ae5b48e --- /dev/null +++ b/.npmignore @@ -0,0 +1,12 @@ +built +doc +samples +src +tests +typings +bin/winjs.d.ts +bin/winrt.d.ts +bin/*.bat +bin/jquery.d.ts +bin/typescriptServices.js +Jakefile diff --git a/CopyrightNotice.txt b/CopyrightNotice.txt new file mode 100644 index 0000000000000..0f6db1f75f714 --- /dev/null +++ b/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + diff --git a/Jakefile b/Jakefile new file mode 100644 index 0000000000000..62fd6c878d08a --- /dev/null +++ b/Jakefile @@ -0,0 +1,443 @@ +// This file contains the build logic for the public repo + +var fs = require("fs"); +var path = require("path"); + +// Variables +var compilerDirectory = "src/compiler/"; +var servicesDirectory = "src/services/"; +var harnessDirectory = "src/harness/"; +var libraryDirectory = "src/lib/"; +var scriptsDirectory = "scripts/" + +var builtDirectory = "built/"; +var builtLocalDirectory = "built/local/"; +var LKGDirectory = "bin/"; + +var copyright = "CopyrightNotice.txt"; +var thirdParty = "ThirdPartyNoticeText.txt"; + +var compilerSources = [ + "core.ts", + "sys.ts", + "types.ts", + "scanner.ts", + "parser.ts", + "binder.ts", + "checker.ts", + "emitter.ts", + "commandLineParser.ts", + "tc.ts", + "diagnosticInformationMap.generated.ts" +].map(function (f) { + return path.join(compilerDirectory, f); +}); + +var servicesSources = [ + "core.ts", + "sys.ts", + "types.ts", + "scanner.ts", + "parser.ts", + "binder.ts", + "checker.ts", + "emitter.ts" +].map(function (f) { + return path.join(compilerDirectory, f); +}).concat([ + "services.ts", + "shims.ts", +].map(function (f) { + return path.join(servicesDirectory, f); +})); + +var harnessSources = [ + "harness.ts", + "sourceMapRecorder.ts", +// TODO Re-enable +// "harnessLanguageService.ts", +// "fourslash.ts", + "runner.ts", + "external/json2.ts", + "runnerbase.ts", + "compilerRunner.ts", + "typeWriter.ts", +// TODO Re-enable fourslash and project tests +// "fourslashRunner.ts", + "projectsRunner.ts", + "unittestrunner.ts", + "rwcRunner.ts", +].map(function (f) { + return path.join(harnessDirectory, f); +}); + +var librarySourceMap = [ + { target: "lib.core.d.ts", sources: ["core.d.ts"] }, + { target: "lib.dom.d.ts", sources: ["importcore.d.ts", "extensions.d.ts", "dom.generated.d.ts"], }, + { target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "extensions.d.ts", "webworker.generated.d.ts"], }, + { target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], }, + { target: "lib.d.ts", sources: ["core.d.ts", "extensions.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], }, +]; + +var libraryTargets = librarySourceMap.map(function (f) { + return path.join(builtLocalDirectory, f.target); +}); + +// Prepends the contents of prefixFile to destinationFile +function prependFile(prefixFile, destinationFile) { + if (!fs.existsSync(prefixFile)) { + fail(prefixFile + " does not exist!"); + } + if (!fs.existsSync(destinationFile)) { + fail(destinationFile + " failed to be created!"); + } + var temp = "temptemp"; + jake.cpR(prefixFile, temp, {silent: true}); + fs.appendFileSync(temp, fs.readFileSync(destinationFile)); + fs.renameSync(temp, destinationFile); +} + +// concatenate a list of sourceFiles to a destinationFile +function concatenateFiles(destinationFile, sourceFiles) { + var temp = "temptemp"; + // Copy the first file to temp + if (!fs.existsSync(sourceFiles[0])) { + fail(sourceFiles[0] + " does not exist!"); + } + jake.cpR(sourceFiles[0], temp, {silent: true}); + // append all files in sequence + for (var i = 1; i < sourceFiles.length; i++) { + if (!fs.existsSync(sourceFiles[i])) { + fail(sourceFiles[i] + " does not exist!"); + } + fs.appendFileSync(temp, fs.readFileSync(sourceFiles[i])); + } + // Move the file to the final destination + fs.renameSync(temp, destinationFile); +} + +var useDebugMode = false; +/* Compiles a file from a list of sources + * @param outFile: the target file name + * @param sources: an array of the names of the source files + * @param prereqs: prerequisite tasks to compiling the file + * @param prefixes: a list of files to prepend to the target file + * @param useBuiltCompiler: true to use the built compiler, false to use the LKG + * @param noOutFile: true to compile without using --out + */ +function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) { + file(outFile, prereqs, function() { + var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; + var compilerFilename = "tc.js"; + var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants " + + var cmd = (process.env.host || process.env.TYPESCRIPT_HOST || "node") + " " + dir + compilerFilename + " " + options + " "; + if (useDebugMode) { + cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " "; + } + cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : ""); + if (useDebugMode) { + cmd = cmd + " -sourcemap -mapRoot file:///" + path.resolve(path.dirname(outFile)); + } + console.log(cmd + "\n"); + var ex = jake.createExec([cmd]); + // Add listeners for output and error + ex.addListener("stdout", function(output) { + process.stdout.write(output); + }); + ex.addListener("stderr", function(error) { + process.stderr.write(error); + }); + ex.addListener("cmdEnd", function() { + if (!useDebugMode && prefixes && fs.existsSync(outFile)) { + for (var i in prefixes) { + prependFile(prefixes[i], outFile); + } + } + complete(); + }); + ex.addListener("error", function() { + fs.unlinkSync(outFile); + console.log("Compilation of " + outFile + " unsuccessful"); + }); + ex.run(); + }, {async: true}); +} + +// Prerequisite task for built directory and library typings +directory(builtLocalDirectory); + +for (var i in libraryTargets) { + (function (i) { + var entry = librarySourceMap[i]; + var target = libraryTargets[i]; + var sources = [copyright].concat(entry.sources.map(function (s) { + return path.join(libraryDirectory, s); + })); + file(target, [builtLocalDirectory].concat(sources), function() { + concatenateFiles(target, sources); + }); + })(i); +} + +// Lib target to build the library files +desc("Builds the library targets"); +task("lib", libraryTargets); + + +// Generate diagnostics +var processDiagnosticMessagesJs = path.join(scriptsDirectory, "processDiagnosticMessages.js"); +var processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnosticMessages.ts"); +var diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json"); +var diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts"); + +// processDiagnosticMessages script +compileFile(processDiagnosticMessagesJs, + [processDiagnosticMessagesTs], + [processDiagnosticMessagesTs], + [], + false); + +// The generated diagnostics map; built for the compiler and for the 'generate-diagnostics' task +file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson], function () { + var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson; + console.log(cmd); + var ex = jake.createExec([cmd]); + // Add listeners for output and error + ex.addListener("stdout", function(output) { + process.stdout.write(output); + }); + ex.addListener("stderr", function(error) { + process.stderr.write(error); + }); + ex.addListener("cmdEnd", function() { + complete(); + }); + ex.run(); +}, {async: true}) + + +desc("Generates a diagnostic file in TypeScript based on an input JSON file"); +task("generate-diagnostics", [diagnosticInfoMapTs]) + + +// Local target to build the compiler and services +var tcFile = path.join(builtLocalDirectory, "tc.js"); +compileFile(tcFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false); + +var tcServicesFile = path.join(builtLocalDirectory, "services.js"); +compileFile(tcServicesFile, servicesSources, [builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler:*/ true); + +// Local target to build the compiler and services +desc("Builds the full compiler and services"); +task("local", ["generate-diagnostics", "lib", tcFile, tcServicesFile]); + + +// Local target to build the compiler and services +desc("Emit debug mode files with sourcemaps"); +task("debug", function() { + useDebugMode = true; +}); + + +// Set the default task to "local" +task("default", ["local"]); + + +// Cleans the built directory +desc("Cleans the compiler output, declare files, and tests"); +task("clean", function() { + jake.rmRf(builtDirectory); +}); + +// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory +desc("Makes a new LKG out of the built js files"); +task("LKG", libraryTargets, function() { + var expectedFiles = [tcFile, tcServicesFile].concat(libraryTargets); + var missingFiles = expectedFiles.filter(function (f) { + return !fs.existsSync(f); + }); + if (missingFiles.length > 0) { + fail("Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory + + ". The following files are missing:\n" + missingFiles.join("\n")); + } + // Copy all the targets into the LKG directory + jake.mkdirP(LKGDirectory); + for (i in expectedFiles) { + jake.cpR(expectedFiles[i], LKGDirectory); + } + //var resourceDirectories = fs.readdirSync(builtLocalResourcesDirectory).map(function(p) { return path.join(builtLocalResourcesDirectory, p); }); + //resourceDirectories.map(function(d) { + // jake.cpR(d, LKGResourcesDirectory); + //}); +}); + +// Test directory +directory(builtLocalDirectory); + +// Task to build the tests infrastructure using the built compiler +var run = path.join(builtLocalDirectory, "run.js"); +compileFile(run, harnessSources, [builtLocalDirectory, tcFile].concat(libraryTargets).concat(harnessSources), [], /*useBuiltCompiler:*/ true); + +var localBaseline = "tests/baselines/local/"; +var refBaseline = "tests/baselines/reference/"; + +var localRwcBaseline = "tests/baselines/rwc/local/"; +var refRwcBaseline = "tests/baselines/rwc/reference/"; + +desc("Builds the test infrastructure using the built compiler"); +task("tests", ["local", run].concat(libraryTargets)); + +function exec(cmd) { + var ex = jake.createExec([cmd]); + // Add listeners for output and error + ex.addListener("stdout", function(output) { + process.stdout.write(output); + }); + ex.addListener("stderr", function(error) { + process.stderr.write(error); + }); + ex.addListener("cmdEnd", function() { + complete(); + }); + try{ + ex.run(); + } catch(e) { + console.log('Exception: ' + e) + } +} + +function cleanTestDirs() { + // Clean the local baselines directory + if (fs.existsSync(localBaseline)) { + jake.rmRf(localBaseline); + } + + // Clean the local Rwc baselines directory + if (fs.existsSync(localRwcBaseline)) { + jake.rmRf(localRwcBaseline); + } + + jake.mkdirP(localBaseline); +} + +// used to pass data from jake command line directly to run.js +function writeTestConfigFile(tests, testConfigFile) { + console.log('Running test(s): ' + tests); + var testConfigContents = '{\n' + '\ttest: [\'' + tests + '\']\n}'; + fs.writeFileSync('test.config', testConfigContents); +} + +desc("Runs the tests using the built run.js file. Syntax is jake runtests. Optional parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'."); +task("runtests", ["tests", builtLocalDirectory], function() { + cleanTestDirs(); + host = "mocha" + tests = process.env.test || process.env.tests; + var testConfigFile = 'test.config'; + if(fs.existsSync(testConfigFile)) { + fs.unlinkSync(testConfigFile); + } + if(tests) { + writeTestConfigFile(tests, testConfigFile); + } + + colors = process.env.colors || process.env.color + colors = colors ? ' --no-colors ' : '' + tests = tests ? ' -g ' + tests : ''; + reporter = process.env.reporter || process.env.r || 'dot'; + var cmd = host + " -R " + reporter + tests + colors + ' ' + run; + console.log(cmd); + exec(cmd) +}, {async: true}); + +// Browser tests +var nodeServerOutFile = 'tests/webTestServer.js' +var nodeServerInFile = 'tests/webTestServer.ts' +compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tcFile], [], true, true); + +desc("Runs browserify on run.js to produce a file suitable for running tests in the browser"); +task("browserify", ["tests", builtLocalDirectory, nodeServerOutFile], function() { + var cmd = 'browserify built/local/run.js -o built/local/bundle.js'; + exec(cmd); +}, {async: true}); + +desc("Runs the tests using the built run.js file like 'jake runtests'. Syntax is jake runtests-browser. Additional optional parameters tests=[regex], port=, browser=[chrome|IE]"); +task("runtests-browser", ["tests", "browserify", builtLocalDirectory], function() { + cleanTestDirs(); + host = "node" + port = process.env.port || '8888'; + browser = process.env.browser || "IE"; + tests = process.env.test || process.env.tests; + var testConfigFile = 'test.config'; + if(fs.existsSync(testConfigFile)) { + fs.unlinkSync(testConfigFile); + } + if(tests) { + writeTestConfigFile(tests, testConfigFile); + } + + tests = tests ? tests : ''; + var cmd = host + " tests/webTestServer.js " + port + " " + browser + " " + tests + console.log(cmd); + exec(cmd); +}, {async: true}); + + +// Baseline Diff +desc("Diffs the compiler baselines using the diff tool specified by the %DIFF% environment variable"); +task('diff', function () { + var cmd = "%DIFF% " + refBaseline + ' ' + localBaseline; + console.log(cmd) + exec(cmd); +}, {async: true}); + +desc("Diffs the RWC baselines using the diff tool specified by the %DIFF% environment variable"); +task('diff-rwc', function () { + var cmd = "%DIFF% " + refRwcBaseline + ' ' + localRwcBaseline; + console.log(cmd) + exec(cmd); +}, {async: true}); + +desc("Builds the test sources and automation in debug mode"); +task("tests-debug", ["setDebugMode", "tests"]); + + +// Makes the test results the new baseline +desc("Makes the most recent test results the new baseline, overwriting the old baseline"); +task("baseline-accept", function(hardOrSoft) { + if (!hardOrSoft || hardOrSoft == "hard") { + jake.rmRf(refBaseline); + fs.renameSync(localBaseline, refBaseline); + } + else if (hardOrSoft == "soft") { + var files = jake.readdirR(localBaseline); + for (var i in files) { + jake.cpR(files[i], refBaseline); + } + jake.rmRf(path.join(refBaseline, "local")); + } +}); + +desc("Makes the most recent rwc test results the new baseline, overwriting the old baseline"); +task("baseline-accept-rwc", function() { + jake.rmRf(refRwcBaseline); + fs.renameSync(localRwcBaseline, refRwcBaseline); +}); + + +// Webhost +var webhostPath = "tests/webhost/webtsc.ts"; +var webhostJsPath = "tests/webhost/webtsc.js"; +compileFile(webhostJsPath, [webhostPath], [tcFile, webhostPath].concat(libraryTargets), [], true); + +desc("Builds the tsc web host"); +task("webhost", [webhostJsPath], function() { + jake.cpR(path.join(builtLocalDirectory, "lib.d.ts"), "tests/webhost/", {silent: true}); +}); + +// Perf compiler +var perftcPath = "tests/perftc.ts"; +var perftcJsPath = "built/local/perftc.js"; +compileFile(perftcJsPath, [perftcPath], [tcFile, perftcPath, "tests/perfsys.ts"].concat(libraryTargets), [], true); +desc("Builds augmented version of the compiler for perf tests"); +task("perftc", [perftcJsPath]); \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000..8746124b27791 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/ThirdPartyNoticeText.txt b/ThirdPartyNoticeText.txt new file mode 100644 index 0000000000000..93c3e4fcb3f99 --- /dev/null +++ b/ThirdPartyNoticeText.txt @@ -0,0 +1,96 @@ +/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- + +The TypeScript software is based on or incorporates material and code from the projects listed below +(collectively "Third Party Code"). Microsoft is not the original author of the +Third Party Code. The original copyright notice and the license, under which +Microsoft received such Third Party Code, are set forth below. Such license and +notices are provided for informational purposes only. Microsoft licenses the Third +Party Code to you under the terms of the Apache 2.0 License. +All Third Party Code licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you +may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR +CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions and +limitations under the License. +--------------------------------------------- +Third Party Code Components +-------------------------------------------- +---- Mozilla Developer Code--------- +The following Mozilla Developer Code is under Public Domain as updated after Aug. 20, 2012, see, https://developer.mozilla.org/en-US/docs/Project:Copyrights +1. Array filter Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter +Any copyright is dedicated to the Public Domain. + +2. Array forEach Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach +Any copyright is dedicated to the Public Domain. + +3. Array indexOf Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf +Any copyright is dedicated to the Public Domain. + +4. Array map Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map +Any copyright is dedicated to the Public Domain. + +5. Array Reduce Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce +Any copyright is dedicated to the Public Domain. + +6. String Trim Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim +Any copyright is dedicated to the Public Domain. + +7. Date now Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now +Any copyright is dedicated to the Public Domain. + +------------JSON2 Script------------------------ +json2.js 2012-10-08 +Public Domain. +NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. +See, http://www.JSON.org/js.html + +--------------r.js---------------------- +Copyright (c) 2010-2011 Dojo Foundation. All Rights Reserved. +Originally License under MIT License +------------------------------------------------------------------------- +Provided for Informational Purposes Only +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------- DefinitelyTyped -------------------- +This file is based on or incorporates material from the projects listed below (collectively ?Third Party Code?). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. +DefinitelyTyped +This project is licensed under the MIT license. +Copyrights are respective of each contributor listed at the beginning of each definition file. +Provided for Informational Purposes Only + +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------------- +------------- End of ThirdPartyNotices --------------------------------------------------- */ diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts new file mode 100644 index 0000000000000..3decae55c8c40 --- /dev/null +++ b/bin/lib.core.d.ts @@ -0,0 +1,1143 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: any, properties?: PropertyDescriptorMap): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: any): any; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: any): any; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: any): any; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(thisArg: any, ...argArray: any[]): any; + + prototype: any; + length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +declare var Function: { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + prototype: Function; +} + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string): string[]; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. + */ + match(regexp: RegExp): string[]; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: string, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string): number; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string, limit?: number): string[]; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + [index: number]: string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: { + new (value?: any): String; + (value?: any): string; + prototype: String; + fromCharCode(...codes: number[]): string; +} + +interface Boolean { +} +declare var Boolean: { + new (value?: any): Boolean; + (value?: any): boolean; + prototype: Boolean; +} + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: { + new (value?: any): Number; + (value?: any): number; + prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + POSITIVE_INFINITY: number; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + E: number; + /** The natural logarithm of 10. */ + LN10: number; + /** The natural logarithm of 2. */ + LN2: number; + /** The base-2 logarithm of e. */ + LOG2E: number; + /** The base-10 logarithm of e. */ + LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + SQRT1_2: number; + /** The square root of 2. */ + SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point (y,x). + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +declare var Date: { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +interface RegExpExecArray { + [index: number]: string; + length: number; + + index: number; + input: string; + + toString(): string; + toLocaleString(): string; + concat(...items: string[][]): string[]; + join(separator?: string): string; + pop(): string; + push(...items: string[]): number; + reverse(): string[]; + shift(): string; + slice(start?: number, end?: number): string[]; + sort(compareFn?: (a: string, b: string) => number): string[]; + splice(start: number): string[]; + splice(start: number, deleteCount: number, ...items: string[]): string[]; + unshift(...items: string[]): number; + + indexOf(searchElement: string, fromIndex?: number): number; + lastIndexOf(searchElement: string, fromIndex?: number): number; + every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void; + map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; + filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; + reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; + reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; +} + + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): RegExp; +} +declare var RegExp: { + new (pattern: string, flags?: string): RegExp; + (pattern: string, flags?: string): RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +interface Error { + name: string; + message: string; +} +declare var Error: { + new (message?: string): Error; + (message?: string): Error; + prototype: Error; +} + +interface EvalError extends Error { +} +declare var EvalError: { + new (message?: string): EvalError; + (message?: string): EvalError; + prototype: EvalError; +} + +interface RangeError extends Error { +} +declare var RangeError: { + new (message?: string): RangeError; + (message?: string): RangeError; + prototype: RangeError; +} + +interface ReferenceError extends Error { +} +declare var ReferenceError: { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + prototype: ReferenceError; +} + +interface SyntaxError extends Error { +} +declare var SyntaxError: { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + prototype: SyntaxError; +} + +interface TypeError extends Error { +} +declare var TypeError: { + new (message?: string): TypeError; + (message?: string): TypeError; + prototype: TypeError; +} + +interface URIError extends Error { +} +declare var URIError: { + new (message?: string): URIError; + (message?: string): URIError; + prototype: URIError; +} + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + */ + stringify(value: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + */ + stringify(value: any, replacer: (key: string, value: any) => any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + */ + stringify(value: any, replacer: any[]): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: any[], space: any): string; +} +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface Array { + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + */ + splice(start: number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + + [n: number]: T; +} +declare var Array: { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): boolean; + prototype: Array; +} diff --git a/bin/lib.d.ts b/bin/lib.d.ts new file mode 100644 index 0000000000000..605738614c939 --- /dev/null +++ b/bin/lib.d.ts @@ -0,0 +1,14182 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: any, properties?: PropertyDescriptorMap): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: any): any; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: any): any; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: any): any; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(thisArg: any, ...argArray: any[]): any; + + prototype: any; + length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +declare var Function: { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + prototype: Function; +} + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string): string[]; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. + */ + match(regexp: RegExp): string[]; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: string, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string): number; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string, limit?: number): string[]; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + [index: number]: string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: { + new (value?: any): String; + (value?: any): string; + prototype: String; + fromCharCode(...codes: number[]): string; +} + +interface Boolean { +} +declare var Boolean: { + new (value?: any): Boolean; + (value?: any): boolean; + prototype: Boolean; +} + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: { + new (value?: any): Number; + (value?: any): number; + prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + POSITIVE_INFINITY: number; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + E: number; + /** The natural logarithm of 10. */ + LN10: number; + /** The natural logarithm of 2. */ + LN2: number; + /** The base-2 logarithm of e. */ + LOG2E: number; + /** The base-10 logarithm of e. */ + LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + SQRT1_2: number; + /** The square root of 2. */ + SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point (y,x). + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +declare var Date: { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +interface RegExpExecArray { + [index: number]: string; + length: number; + + index: number; + input: string; + + toString(): string; + toLocaleString(): string; + concat(...items: string[][]): string[]; + join(separator?: string): string; + pop(): string; + push(...items: string[]): number; + reverse(): string[]; + shift(): string; + slice(start?: number, end?: number): string[]; + sort(compareFn?: (a: string, b: string) => number): string[]; + splice(start: number): string[]; + splice(start: number, deleteCount: number, ...items: string[]): string[]; + unshift(...items: string[]): number; + + indexOf(searchElement: string, fromIndex?: number): number; + lastIndexOf(searchElement: string, fromIndex?: number): number; + every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void; + map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; + filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; + reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; + reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; +} + + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): RegExp; +} +declare var RegExp: { + new (pattern: string, flags?: string): RegExp; + (pattern: string, flags?: string): RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +interface Error { + name: string; + message: string; +} +declare var Error: { + new (message?: string): Error; + (message?: string): Error; + prototype: Error; +} + +interface EvalError extends Error { +} +declare var EvalError: { + new (message?: string): EvalError; + (message?: string): EvalError; + prototype: EvalError; +} + +interface RangeError extends Error { +} +declare var RangeError: { + new (message?: string): RangeError; + (message?: string): RangeError; + prototype: RangeError; +} + +interface ReferenceError extends Error { +} +declare var ReferenceError: { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + prototype: ReferenceError; +} + +interface SyntaxError extends Error { +} +declare var SyntaxError: { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + prototype: SyntaxError; +} + +interface TypeError extends Error { +} +declare var TypeError: { + new (message?: string): TypeError; + (message?: string): TypeError; + prototype: TypeError; +} + +interface URIError extends Error { +} +declare var URIError: { + new (message?: string): URIError; + (message?: string): URIError; + prototype: URIError; +} + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + */ + stringify(value: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + */ + stringify(value: any, replacer: (key: string, value: any) => any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + */ + stringify(value: any, replacer: any[]): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: any[], space: any): string; +} +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface Array { + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + */ + splice(start: number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + + [n: number]: T; +} +declare var Array: { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): boolean; + prototype: Array; +} + +///////////////////////////// +/// IE10 ECMAScript Extensions +///////////////////////////// + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + byteLength: number; +} + +declare var ArrayBuffer: { + prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; +} + +interface ArrayBufferView { + buffer: ArrayBuffer; + byteOffset: number; + byteLength: number; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; +} +declare var Int8Array: { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; +} +declare var Uint8Array: { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; +} +declare var Int16Array: { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; +} +declare var Uint16Array: { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; +} +declare var Int32Array: { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; +} +declare var Uint32Array: { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; +} +declare var Float32Array: { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float64Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float64Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; +} +declare var Float64Array: { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + BYTES_PER_ELEMENT: number; +} + +/** + * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. + */ +interface DataView extends ArrayBufferView { + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; +} +declare var DataView: { + prototype: DataView; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; +} + +///////////////////////////// +/// IE11 ECMAScript Extensions +///////////////////////////// + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): Map; + size: number; +} +declare var Map: { + new (): Map; +} + +interface WeakMap { + clear(): void; + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): WeakMap; +} +declare var WeakMap: { + new (): WeakMap; +} + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; +} +declare var Set: { + new (): Set; +} + +declare module Intl { + + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string[], options?: CollatorOptions): Collator; + new (locale?: string, options?: CollatorOptions): Collator; + (locales?: string[], options?: CollatorOptions): Collator; + (locale?: string, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; + supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + } + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumintegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string[], options?: NumberFormatOptions): Collator; + new (locale?: string, options?: NumberFormatOptions): Collator; + (locales?: string[], options?: NumberFormatOptions): Collator; + (locale?: string, options?: NumberFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + } + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12: boolean; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date: number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string[], options?: DateTimeFormatOptions): Collator; + new (locale?: string, options?: DateTimeFormatOptions): Collator; + (locales?: string[], options?: DateTimeFormatOptions): Collator; + (locale?: string, options?: DateTimeFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + } +} + +interface String { + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; + + /** + * Converts a number to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a date to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; +} + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface AlgorithmParameters { +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface Algorithm { + name?: string; + params?: AlgorithmParameters; +} + +interface MouseEventInit { + bubbles?: boolean; + cancelable?: boolean; + view?: Window; + detail?: number; + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface WebGLContextAttributes { + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { + hidden: any; + readyState: any; + onmouseleave: (ev: MouseEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + onmove: (ev: MSEventObj) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onhelp: (ev: Event) => any; + ondragleave: (ev: DragEvent) => any; + className: string; + onfocusin: (ev: FocusEvent) => any; + onseeked: (ev: Event) => any; + recordNumber: any; + title: string; + parentTextEdit: Element; + outerHTML: string; + ondurationchange: (ev: Event) => any; + offsetHeight: number; + all: HTMLCollection; + onblur: (ev: FocusEvent) => any; + dir: string; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + ondeactivate: (ev: UIEvent) => any; + ondatasetchanged: (ev: MSEventObj) => any; + onrowsdelete: (ev: MSEventObj) => any; + sourceIndex: number; + onloadstart: (ev: Event) => any; + onlosecapture: (ev: MSEventObj) => any; + ondragenter: (ev: DragEvent) => any; + oncontrolselect: (ev: MSEventObj) => any; + onsubmit: (ev: Event) => any; + behaviorUrns: MSBehaviorUrnsCollection; + scopeName: string; + onchange: (ev: Event) => any; + id: string; + onlayoutcomplete: (ev: MSEventObj) => any; + uniqueID: string; + onbeforeactivate: (ev: UIEvent) => any; + oncanplaythrough: (ev: Event) => any; + onbeforeupdate: (ev: MSEventObj) => any; + onfilterchange: (ev: MSEventObj) => any; + offsetParent: Element; + ondatasetcomplete: (ev: MSEventObj) => any; + onsuspend: (ev: Event) => any; + onmouseenter: (ev: MouseEvent) => any; + innerText: string; + onerrorupdate: (ev: MSEventObj) => any; + onmouseout: (ev: MouseEvent) => any; + parentElement: HTMLElement; + onmousewheel: (ev: MouseWheelEvent) => any; + onvolumechange: (ev: Event) => any; + oncellchange: (ev: MSEventObj) => any; + onrowexit: (ev: MSEventObj) => any; + onrowsinserted: (ev: MSEventObj) => any; + onpropertychange: (ev: MSEventObj) => any; + filters: any; + children: HTMLCollection; + ondragend: (ev: DragEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + offsetTop: number; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + innerHTML: string; + onmouseover: (ev: MouseEvent) => any; + lang: string; + uniqueNumber: number; + onpause: (ev: Event) => any; + tagUrn: string; + onmousedown: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + onwaiting: (ev: Event) => any; + onresizestart: (ev: MSEventObj) => any; + offsetLeft: number; + isTextEdit: boolean; + isDisabled: boolean; + onpaste: (ev: DragEvent) => any; + canHaveHTML: boolean; + onmoveend: (ev: MSEventObj) => any; + language: string; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + style: MSStyleCSSProperties; + isContentEditable: boolean; + onbeforeeditfocus: (ev: MSEventObj) => any; + onratechange: (ev: Event) => any; + contentEditable: string; + tabIndex: number; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: MouseEvent) => any; + onloadedmetadata: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + onerror: (ev: ErrorEvent) => any; + onplay: (ev: Event) => any; + onresizeend: (ev: MSEventObj) => any; + onplaying: (ev: Event) => any; + isMultiLine: boolean; + onfocusout: (ev: FocusEvent) => any; + onabort: (ev: UIEvent) => any; + ondataavailable: (ev: MSEventObj) => any; + hideFocus: boolean; + onreadystatechange: (ev: Event) => any; + onkeypress: (ev: KeyboardEvent) => any; + onloadeddata: (ev: Event) => any; + onbeforedeactivate: (ev: UIEvent) => any; + outerText: string; + disabled: boolean; + onactivate: (ev: UIEvent) => any; + accessKey: string; + onmovestart: (ev: MSEventObj) => any; + onselectstart: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + oncut: (ev: DragEvent) => any; + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + offsetWidth: number; + oncopy: (ev: DragEvent) => any; + onended: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onrowenter: (ev: MSEventObj) => any; + onload: (ev: Event) => any; + canHaveChildren: boolean; + oninput: (ev: Event) => any; + onmscontentzoom: (ev: MSEventObj) => any; + oncuechange: (ev: Event) => any; + spellcheck: boolean; + classList: DOMTokenList; + onmsmanipulationstatechanged: (ev: any) => any; + draggable: boolean; + dataset: DOMStringMap; + dragDrop(): boolean; + scrollIntoView(top?: boolean): void; + addFilter(filter: any): void; + setCapture(containerCapture?: boolean): void; + focus(): void; + getAdjacentText(where: string): string; + insertAdjacentText(where: string, text: string): void; + getElementsByClassName(classNames: string): NodeList; + setActive(): void; + removeFilter(filter: any): void; + blur(): void; + clearAttributes(): void; + releaseCapture(): void; + createControlRange(): ControlRangeCollection; + removeBehavior(cookie: number): boolean; + contains(child: HTMLElement): boolean; + click(): void; + insertAdjacentElement(position: string, insertedElement: Element): Element; + mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; + replaceAdjacentText(where: string, newText: string): string; + applyElement(apply: Element, where?: string): Element; + addBehavior(bstrUrl: string, factory?: any): number; + insertAdjacentHTML(where: string, html: string): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + */ + compatible: MSCompatibleInfoCollection; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollection; + /** + * Fires when the user presses the F1 key while the browser is the active window. + * @param ev The event. + */ + onhelp: (ev: Event) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Fires for an element just prior to setting focus on that element. + * @param ev The focus event + */ + onfocusin: (ev: FocusEvent) => any; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + security: string; + /** + * Contains the title of the document. + */ + title: string; + /** + * Retrieves a collection of namespace objects. + */ + namespaces: MSNamespaceInfoCollection; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + styleSheets: StyleSheetList; + /** + * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. + */ + frames: Window; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Returns a reference to the collection of elements contained by the object. + */ + all: HTMLCollection; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollection; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (ev: Event) => any; + /** + * Fires when the data set exposed by a data source object changes. + * @param ev The event. + */ + ondatasetchanged: (ev: MSEventObj) => any; + /** + * Fires when rows are about to be deleted from the recordset. + * @param ev The event + */ + onrowsdelete: (ev: MSEventObj) => any; + Script: MSScriptHost; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + URLUnencoded: string; + defaultView: Window; + /** + * Fires when the user is about to make a control selection of the object. + * @param ev The event. + */ + oncontrolselect: (ev: MSEventObj) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + activeElement: Element; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (ev: Event) => any; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Retrieves an autogenerated, unique identifier for the object. + */ + uniqueID: string; + /** + * Sets or gets the URL for the current document. + */ + URL: string; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + head: HTMLHeadElement; + cookie: string; + xmlEncoding: string; + oncanplaythrough: (ev: Event) => any; + /** + * Retrieves the document compatibility mode of the document. + */ + documentMode: number; + characterSet: string; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + onbeforeupdate: (ev: MSEventObj) => any; + /** + * Fires to indicate that all data is available from the data source object. + * @param ev The event. + */ + ondatasetcomplete: (ev: MSEventObj) => any; + plugins: HTMLCollection; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (ev: Event) => any; + /** + * Gets the root svg element in the document hierarchy. + */ + rootElement: SVGSVGElement; + /** + * Retrieves a value that indicates the current state of the object. + */ + readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + referrer: string; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Fires on a databound object when an error occurs while updating the associated data in the data source object. + * @param ev The event. + */ + onerrorupdate: (ev: MSEventObj) => any; + /** + * Gets a reference to the container object of the window. + */ + parentWindow: Window; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Fires when data changes in the data provider. + * @param ev The event. + */ + oncellchange: (ev: MSEventObj) => any; + /** + * Fires just before the data source control changes the current row in the object. + * @param ev The event. + */ + onrowexit: (ev: MSEventObj) => any; + /** + * Fires just after new rows are inserted in the current recordset. + * @param ev The event. + */ + onrowsinserted: (ev: MSEventObj) => any; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string; + msCapsLockWarningOff: boolean; + /** + * Fires when a property changes on the object. + * @param ev The event. + */ + onpropertychange: (ev: MSEventObj) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (ev: DragEvent) => any; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (ev: DragEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (ev: MouseEvent) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + xmlStandalone: boolean; + /** + * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. + */ + selection: MSSelection; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. + * @param ev The event. + */ + onbeforeeditfocus: (ev: MSEventObj) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (ev: MouseEvent) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + media: string; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: ErrorEvent) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: UIEvent) => any; + /** + * Fires for the current element with focus immediately after moving focus to another element. + * @param ev The event. + */ + onfocusout: (ev: FocusEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (ev: Event) => any; + /** + * Fires when a local DOM Storage area is written to disk. + * @param ev The event. + */ + onstoragecommit: (ev: StorageEvent) => any; + /** + * Fires periodically as data arrives from data source objects that asynchronously transmit their data. + * @param ev The event. + */ + ondataavailable: (ev: MSEventObj) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: Event) => any; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Fires to indicate that the current row has changed in the data source and new data values are available on the object. + * @param ev The event. + */ + onrowenter: (ev: MSEventObj) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + oninput: (ev: Event) => any; + onmspointerdown: (ev: any) => any; + msHidden: boolean; + msVisibilityState: string; + onmsgesturedoubletap: (ev: any) => any; + visibilityState: string; + onmsmanipulationstatechanged: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmscontentzoom: (ev: MSEventObj) => any; + onmspointermove: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + msCSSOMElementFloatMetrics: boolean; + onmspointerover: (ev: any) => any; + hidden: boolean; + onmspointerup: (ev: any) => any; + msFullscreenEnabled: boolean; + onmsfullscreenerror: (ev: any) => any; + onmspointerenter: (ev: any) => any; + msFullscreenElement: Element; + onmsfullscreenchange: (ev: any) => any; + onmspointerleave: (ev: any) => any; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + adoptNode(source: Node): Node; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + createCDATASection(data: string): CDATASection; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: "a"): HTMLAnchorElement; + createElement(tagName: "abbr"): HTMLPhraseElement; + createElement(tagName: "acronym"): HTMLPhraseElement; + createElement(tagName: "address"): HTMLBlockElement; + createElement(tagName: "applet"): HTMLAppletElement; + createElement(tagName: "area"): HTMLAreaElement; + createElement(tagName: "article"): HTMLElement; + createElement(tagName: "aside"): HTMLElement; + createElement(tagName: "audio"): HTMLAudioElement; + createElement(tagName: "b"): HTMLPhraseElement; + createElement(tagName: "base"): HTMLBaseElement; + createElement(tagName: "basefont"): HTMLBaseFontElement; + createElement(tagName: "bdo"): HTMLPhraseElement; + createElement(tagName: "bgsound"): HTMLBGSoundElement; + createElement(tagName: "big"): HTMLPhraseElement; + createElement(tagName: "blockquote"): HTMLBlockElement; + createElement(tagName: "body"): HTMLBodyElement; + createElement(tagName: "br"): HTMLBRElement; + createElement(tagName: "button"): HTMLButtonElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: "caption"): HTMLTableCaptionElement; + createElement(tagName: "center"): HTMLBlockElement; + createElement(tagName: "cite"): HTMLPhraseElement; + createElement(tagName: "code"): HTMLPhraseElement; + createElement(tagName: "col"): HTMLTableColElement; + createElement(tagName: "colgroup"): HTMLTableColElement; + createElement(tagName: "datalist"): HTMLDataListElement; + createElement(tagName: "dd"): HTMLDDElement; + createElement(tagName: "del"): HTMLModElement; + createElement(tagName: "dfn"): HTMLPhraseElement; + createElement(tagName: "dir"): HTMLDirectoryElement; + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "dl"): HTMLDListElement; + createElement(tagName: "dt"): HTMLDTElement; + createElement(tagName: "em"): HTMLPhraseElement; + createElement(tagName: "embed"): HTMLEmbedElement; + createElement(tagName: "fieldset"): HTMLFieldSetElement; + createElement(tagName: "figcaption"): HTMLElement; + createElement(tagName: "figure"): HTMLElement; + createElement(tagName: "font"): HTMLFontElement; + createElement(tagName: "footer"): HTMLElement; + createElement(tagName: "form"): HTMLFormElement; + createElement(tagName: "frame"): HTMLFrameElement; + createElement(tagName: "frameset"): HTMLFrameSetElement; + createElement(tagName: "h1"): HTMLHeadingElement; + createElement(tagName: "h2"): HTMLHeadingElement; + createElement(tagName: "h3"): HTMLHeadingElement; + createElement(tagName: "h4"): HTMLHeadingElement; + createElement(tagName: "h5"): HTMLHeadingElement; + createElement(tagName: "h6"): HTMLHeadingElement; + createElement(tagName: "head"): HTMLHeadElement; + createElement(tagName: "header"): HTMLElement; + createElement(tagName: "hgroup"): HTMLElement; + createElement(tagName: "hr"): HTMLHRElement; + createElement(tagName: "html"): HTMLHtmlElement; + createElement(tagName: "i"): HTMLPhraseElement; + createElement(tagName: "iframe"): HTMLIFrameElement; + createElement(tagName: "img"): HTMLImageElement; + createElement(tagName: "input"): HTMLInputElement; + createElement(tagName: "ins"): HTMLModElement; + createElement(tagName: "isindex"): HTMLIsIndexElement; + createElement(tagName: "kbd"): HTMLPhraseElement; + createElement(tagName: "keygen"): HTMLBlockElement; + createElement(tagName: "label"): HTMLLabelElement; + createElement(tagName: "legend"): HTMLLegendElement; + createElement(tagName: "li"): HTMLLIElement; + createElement(tagName: "link"): HTMLLinkElement; + createElement(tagName: "listing"): HTMLBlockElement; + createElement(tagName: "map"): HTMLMapElement; + createElement(tagName: "mark"): HTMLElement; + createElement(tagName: "marquee"): HTMLMarqueeElement; + createElement(tagName: "menu"): HTMLMenuElement; + createElement(tagName: "meta"): HTMLMetaElement; + createElement(tagName: "nav"): HTMLElement; + createElement(tagName: "nextid"): HTMLNextIdElement; + createElement(tagName: "nobr"): HTMLPhraseElement; + createElement(tagName: "noframes"): HTMLElement; + createElement(tagName: "noscript"): HTMLElement; + createElement(tagName: "object"): HTMLObjectElement; + createElement(tagName: "ol"): HTMLOListElement; + createElement(tagName: "optgroup"): HTMLOptGroupElement; + createElement(tagName: "option"): HTMLOptionElement; + createElement(tagName: "p"): HTMLParagraphElement; + createElement(tagName: "param"): HTMLParamElement; + createElement(tagName: "plaintext"): HTMLBlockElement; + createElement(tagName: "pre"): HTMLPreElement; + createElement(tagName: "progress"): HTMLProgressElement; + createElement(tagName: "q"): HTMLQuoteElement; + createElement(tagName: "rt"): HTMLPhraseElement; + createElement(tagName: "ruby"): HTMLPhraseElement; + createElement(tagName: "s"): HTMLPhraseElement; + createElement(tagName: "samp"): HTMLPhraseElement; + createElement(tagName: "script"): HTMLScriptElement; + createElement(tagName: "section"): HTMLElement; + createElement(tagName: "select"): HTMLSelectElement; + createElement(tagName: "small"): HTMLPhraseElement; + createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "strike"): HTMLPhraseElement; + createElement(tagName: "strong"): HTMLPhraseElement; + createElement(tagName: "style"): HTMLStyleElement; + createElement(tagName: "sub"): HTMLPhraseElement; + createElement(tagName: "sup"): HTMLPhraseElement; + createElement(tagName: "table"): HTMLTableElement; + createElement(tagName: "tbody"): HTMLTableSectionElement; + createElement(tagName: "td"): HTMLTableDataCellElement; + createElement(tagName: "textarea"): HTMLTextAreaElement; + createElement(tagName: "tfoot"): HTMLTableSectionElement; + createElement(tagName: "th"): HTMLTableHeaderCellElement; + createElement(tagName: "thead"): HTMLTableSectionElement; + createElement(tagName: "title"): HTMLTitleElement; + createElement(tagName: "tr"): HTMLTableRowElement; + createElement(tagName: "track"): HTMLTrackElement; + createElement(tagName: "tt"): HTMLPhraseElement; + createElement(tagName: "u"): HTMLPhraseElement; + createElement(tagName: "ul"): HTMLUListElement; + createElement(tagName: "var"): HTMLPhraseElement; + createElement(tagName: "video"): HTMLVideoElement; + createElement(tagName: "wbr"): HTMLElement; + createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; + createElement(tagName: "xmp"): HTMLBlockElement; + createElement(tagName: string): HTMLElement; + /** + * Removes mouse capture from the object in the current document. + */ + releaseCapture(): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + createElementNS(namespaceURI: string, qualifiedName: string): Element; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): any; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + getElementsByClassName(classNames: string): NodeList; + importNode(importedNode: Node, deep: boolean): Node; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Fires a specified event on the object. + * @param eventName Specifies the name of the event to fire. + * @param eventObj Object that specifies the event object from which to obtain event object properties. + */ + fireEvent(eventName: string, eventObj?: any): boolean; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates a style sheet for the document. + * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. + * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. + */ + createStyleSheet(href?: string, index?: number): CSSStyleSheet; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; + /** + * Generates an event object to pass event context information when you use the fireEvent method. + * @param eventObj An object that specifies an existing event object on which to base the new object. + */ + createEventObject(eventObj?: any): MSEventObj; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + clear(): void; + msExitFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Document: { + prototype: Document; + new(): Document; +} + +interface Console { + info(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + profile(reportName?: string): void; + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + clear(): void; + dir(value?: any, ...optionalParams: any[]): void; + profileEnd(): void; + count(countTitle?: string): void; + groupEnd(): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + group(groupTitle?: string): void; + dirxml(value: any): void; + debug(message?: string, ...optionalParams: any[]): void; + groupCollapsed(groupTitle?: string): void; + select(element: Element): void; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface MSEventObj extends Event { + nextPage: string; + keyCode: number; + toElement: Element; + returnValue: any; + dataFld: string; + y: number; + dataTransfer: DataTransfer; + propertyName: string; + url: string; + offsetX: number; + recordset: any; + screenX: number; + buttonID: number; + wheelDelta: number; + reason: number; + origin: string; + data: string; + srcFilter: any; + boundElements: HTMLCollection; + cancelBubble: boolean; + altLeft: boolean; + behaviorCookie: number; + bookmarks: BookmarkCollection; + type: string; + repeat: boolean; + srcElement: Element; + source: Window; + fromElement: Element; + offsetY: number; + x: number; + behaviorPart: number; + qualifier: string; + altKey: boolean; + ctrlKey: boolean; + clientY: number; + shiftKey: boolean; + shiftLeft: boolean; + contentOverflow: boolean; + screenY: number; + ctrlLeft: boolean; + button: number; + srcUrn: string; + clientX: number; + actionURL: string; + getAttribute(strAttributeName: string, lFlags?: number): any; + setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; + removeAttribute(strAttributeName: string, lFlags?: number): boolean; +} +declare var MSEventObj: { + prototype: MSEventObj; + new(): MSEventObj; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: string, ...args: any[]): any; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; +} +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { + ondragend: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + ondragover: (ev: DragEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + screenX: number; + onmouseover: (ev: MouseEvent) => any; + ondragleave: (ev: DragEvent) => any; + history: History; + pageXOffset: number; + name: string; + onafterprint: (ev: Event) => any; + onpause: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + top: Window; + onmousedown: (ev: MouseEvent) => any; + onseeked: (ev: Event) => any; + opener: Window; + onclick: (ev: MouseEvent) => any; + innerHeight: number; + onwaiting: (ev: Event) => any; + ononline: (ev: Event) => any; + ondurationchange: (ev: Event) => any; + frames: Window; + onblur: (ev: FocusEvent) => any; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + outerWidth: number; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + innerWidth: number; + onoffline: (ev: Event) => any; + length: number; + screen: Screen; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onratechange: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onloadstart: (ev: Event) => any; + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + self: Window; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + pageYOffset: number; + oncontextmenu: (ev: MouseEvent) => any; + onchange: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onplay: (ev: Event) => any; + onerror: ErrorEventHandler; + onplaying: (ev: Event) => any; + parent: Window; + location: Location; + oncanplaythrough: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onreadystatechange: (ev: Event) => any; + outerHeight: number; + onkeypress: (ev: KeyboardEvent) => any; + frameElement: Element; + onloadeddata: (ev: Event) => any; + onsuspend: (ev: Event) => any; + window: Window; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onselect: (ev: UIEvent) => any; + navigator: Navigator; + styleMedia: StyleMedia; + ondrop: (ev: DragEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onended: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onunload: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + screenY: number; + onmousewheel: (ev: MouseWheelEvent) => any; + onload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + oninput: (ev: Event) => any; + performance: Performance; + onmspointerdown: (ev: any) => any; + animationStartTime: number; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + msAnimationStartTime: number; + applicationCache: ApplicationCache; + onmsinertiastart: (ev: any) => any; + onmspointerover: (ev: any) => any; + onpopstate: (ev: PopStateEvent) => any; + onmspointerup: (ev: any) => any; + onpageshow: (ev: PageTransitionEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + devicePixelRatio: number; + msCrypto: Crypto; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + doNotTrack: string; + onmspointerenter: (ev: any) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onmspointerleave: (ev: any) => any; + alert(message?: any): void; + scroll(x?: number, y?: number): void; + focus(): void; + scrollTo(x?: number, y?: number): void; + print(): void; + prompt(message?: string, _default?: string): string; + toString(): string; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + scrollBy(x?: number, y?: number): void; + confirm(message?: string): boolean; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; + showModalDialog(url?: string, argument?: any, options?: any): any; + blur(): void; + getSelection(): Selection; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + msCancelRequestAnimationFrame(handle: number): void; + matchMedia(mediaQuery: string): MediaQueryList; + cancelAnimationFrame(handle: number): void; + msIsStaticHTML(html: string): boolean; + msMatchMedia(mediaQuery: string): MediaQueryList; + requestAnimationFrame(callback: FrameRequestCallback): number; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Window: { + prototype: Window; + new(): Window; +} + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; + product: string; + vendor: string; +} + +interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Retrieves a collection of all cells in the table row or in the entire table. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; +} +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface TreeWalker { + whatToShow: number; + filter: NodeFilter; + root: Node; + currentNode: Node; + expandEntityReferences: boolean; + previousSibling(): Node; + lastChild(): Node; + nextSibling(): Node; + nextNode(): Node; + parentNode(): Node; + firstChild(): Node; + previousNode(): Node; +} +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + getEntriesByType(entryType: string): any; + toJSON(): any; + getMeasures(measureName?: string): any; + clearMarks(markName?: string): void; + getMarks(markName?: string): any; + clearResourceTimings(): void; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + getEntriesByName(name: string, entryType?: string): any; + getEntries(): any; + clearMeasures(measureName?: string): void; + setResourceTimingBufferSize(maxSize: number): void; + now(): number; +} +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface MSDataBindingTableExtensions { + dataPageSize: number; + nextPage(): void; + firstPage(): void; + refresh(): void; + previousPage(): void; + lastPage(): void; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} +declare var CompositionEvent: { + prototype: CompositionEvent; + new(): CompositionEvent; +} + +interface WindowTimers extends WindowTimersExtension { + clearTimeout(handle: number): void; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; + clearInterval(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { + orientType: SVGAnimatedEnumeration; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + markerHeight: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + refY: SVGAnimatedLength; + refX: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} + +interface CSSStyleDeclaration { + backgroundAttachment: string; + visibility: string; + textAlignLast: string; + borderRightStyle: string; + counterIncrement: string; + orphans: string; + cssText: string; + borderStyle: string; + pointerEvents: string; + borderTopColor: string; + markerEnd: string; + textIndent: string; + listStyleImage: string; + cursor: string; + listStylePosition: string; + wordWrap: string; + borderTopStyle: string; + alignmentBaseline: string; + opacity: string; + direction: string; + strokeMiterlimit: string; + maxWidth: string; + color: string; + clip: string; + borderRightWidth: string; + verticalAlign: string; + overflow: string; + mask: string; + borderLeftStyle: string; + emptyCells: string; + stopOpacity: string; + paddingRight: string; + parentRule: CSSRule; + background: string; + boxSizing: string; + textJustify: string; + height: string; + paddingTop: string; + length: number; + right: string; + baselineShift: string; + borderLeft: string; + widows: string; + lineHeight: string; + left: string; + textUnderlinePosition: string; + glyphOrientationHorizontal: string; + display: string; + textAnchor: string; + cssFloat: string; + strokeDasharray: string; + rubyAlign: string; + fontSizeAdjust: string; + borderLeftColor: string; + backgroundImage: string; + listStyleType: string; + strokeWidth: string; + textOverflow: string; + fillRule: string; + borderBottomColor: string; + zIndex: string; + position: string; + listStyle: string; + msTransformOrigin: string; + dominantBaseline: string; + overflowY: string; + fill: string; + captionSide: string; + borderCollapse: string; + boxShadow: string; + quotes: string; + tableLayout: string; + unicodeBidi: string; + borderBottomWidth: string; + backgroundSize: string; + textDecoration: string; + strokeDashoffset: string; + fontSize: string; + border: string; + pageBreakBefore: string; + borderTopRightRadius: string; + msTransform: string; + borderBottomLeftRadius: string; + textTransform: string; + rubyPosition: string; + strokeLinejoin: string; + clipPath: string; + borderRightColor: string; + fontFamily: string; + clear: string; + content: string; + backgroundClip: string; + marginBottom: string; + counterReset: string; + outlineWidth: string; + marginRight: string; + paddingLeft: string; + borderBottom: string; + wordBreak: string; + marginTop: string; + top: string; + fontWeight: string; + borderRight: string; + width: string; + kerning: string; + pageBreakAfter: string; + borderBottomStyle: string; + fontStretch: string; + padding: string; + strokeOpacity: string; + markerStart: string; + bottom: string; + borderLeftWidth: string; + clipRule: string; + backgroundPosition: string; + backgroundColor: string; + pageBreakInside: string; + backgroundOrigin: string; + strokeLinecap: string; + borderTopWidth: string; + outlineStyle: string; + borderTop: string; + outlineColor: string; + paddingBottom: string; + marginLeft: string; + font: string; + outline: string; + wordSpacing: string; + maxHeight: string; + fillOpacity: string; + letterSpacing: string; + borderSpacing: string; + backgroundRepeat: string; + borderRadius: string; + borderWidth: string; + borderBottomRightRadius: string; + whiteSpace: string; + fontStyle: string; + minWidth: string; + stopColor: string; + borderTopLeftRadius: string; + borderColor: string; + marker: string; + glyphOrientationVertical: string; + markerMid: string; + fontVariant: string; + minHeight: string; + stroke: string; + rubyOverhang: string; + overflowX: string; + textAlign: string; + margin: string; + animationFillMode: string; + floodColor: string; + animationIterationCount: string; + textShadow: string; + backfaceVisibility: string; + msAnimationIterationCount: string; + animationDelay: string; + animationTimingFunction: string; + columnWidth: any; + msScrollSnapX: string; + columnRuleColor: any; + columnRuleWidth: any; + transitionDelay: string; + transition: string; + msFlowFrom: string; + msScrollSnapType: string; + msContentZoomSnapType: string; + msGridColumns: string; + msAnimationName: string; + msGridRowAlign: string; + msContentZoomChaining: string; + msGridColumn: any; + msHyphenateLimitZone: any; + msScrollRails: string; + msAnimationDelay: string; + enableBackground: string; + msWrapThrough: string; + columnRuleStyle: string; + msAnimation: string; + msFlexFlow: string; + msScrollSnapY: string; + msHyphenateLimitLines: any; + msTouchAction: string; + msScrollLimit: string; + animation: string; + transform: string; + filter: string; + colorInterpolationFilters: string; + transitionTimingFunction: string; + msBackfaceVisibility: string; + animationPlayState: string; + transformOrigin: string; + msScrollLimitYMin: any; + msFontFeatureSettings: string; + msContentZoomLimitMin: any; + columnGap: any; + transitionProperty: string; + msAnimationDuration: string; + msAnimationFillMode: string; + msFlexDirection: string; + msTransitionDuration: string; + fontFeatureSettings: string; + breakBefore: string; + msFlexWrap: string; + perspective: string; + msFlowInto: string; + msTransformStyle: string; + msScrollTranslation: string; + msTransitionProperty: string; + msUserSelect: string; + msOverflowStyle: string; + msScrollSnapPointsY: string; + animationDirection: string; + animationDuration: string; + msFlex: string; + msTransitionTimingFunction: string; + animationName: string; + columnRule: string; + msGridColumnSpan: any; + msFlexNegative: string; + columnFill: string; + msGridRow: any; + msFlexOrder: string; + msFlexItemAlign: string; + msFlexPositive: string; + msContentZoomLimitMax: any; + msScrollLimitYMax: any; + msGridColumnAlign: string; + perspectiveOrigin: string; + lightingColor: string; + columns: string; + msScrollChaining: string; + msHyphenateLimitChars: string; + msTouchSelect: string; + floodOpacity: string; + msAnimationDirection: string; + msAnimationPlayState: string; + columnSpan: string; + msContentZooming: string; + msPerspective: string; + msFlexPack: string; + msScrollSnapPointsX: string; + msContentZoomSnapPoints: string; + msGridRowSpan: any; + msContentZoomSnap: string; + msScrollLimitXMin: any; + breakInside: string; + msHighContrastAdjust: string; + msFlexLinePack: string; + msGridRows: string; + transitionDuration: string; + msHyphens: string; + breakAfter: string; + msTransition: string; + msPerspectiveOrigin: string; + msContentZoomLimit: string; + msScrollLimitXMax: any; + msFlexAlign: string; + msWrapMargin: any; + columnCount: any; + msAnimationTimingFunction: string; + msTransitionDelay: string; + transformStyle: string; + msWrapFlow: string; + msFlexPreferredSize: string; + alignItems: string; + borderImageSource: string; + flexBasis: string; + borderImageWidth: string; + borderImageRepeat: string; + order: string; + flex: string; + alignContent: string; + msImeAlign: string; + flexShrink: string; + flexGrow: string; + borderImageSlice: string; + flexWrap: string; + borderImageOutset: string; + flexDirection: string; + touchAction: string; + flexFlow: string; + borderImage: string; + justifyContent: string; + alignSelf: string; + msTextCombineHorizontal: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + removeProperty(propertyName: string): string; + item(index: number): string; + [index: number]: string; + setProperty(propertyName: string, value: string, priority?: string): void; +} +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface MSStyleCSSProperties extends MSCSSProperties { + pixelWidth: number; + posHeight: number; + posLeft: number; + pixelTop: number; + pixelBottom: number; + textDecorationNone: boolean; + pixelLeft: number; + posTop: number; + posBottom: number; + textDecorationOverline: boolean; + posWidth: number; + textDecorationLineThrough: boolean; + pixelHeight: number; + textDecorationBlink: boolean; + posRight: number; + pixelRight: number; + textDecorationUnderline: boolean; +} +declare var MSStyleCSSProperties: { + prototype: MSStyleCSSProperties; + new(): MSStyleCSSProperties; +} + +interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { + msMaxTouchPoints: number; + msPointerEnabled: boolean; + msManipulationViewsEnabled: boolean; + pointerEnabled: boolean; + maxTouchPoints: number; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; +} +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGZoomEvent extends UIEvent { + zoomRectScreen: SVGRect; + previousScale: number; + newScale: number; + previousTranslate: SVGPoint; + newTranslate: SVGPoint; +} +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface NodeSelector { + querySelectorAll(selectors: string): NodeList; + querySelector(selectors: string): Element; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; +} +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface ClientRect { + left: number; + width: number; + right: number; + top: number; + bottom: number; + height: number; +} +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface PositionErrorCallback { + (error: PositionError): void; +} + +interface DOMImplementation { + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + hasFeature(feature: string, version?: string): boolean; + createHTMLDocument(title: string): Document; +} +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { + scrollTop: number; + clientLeft: number; + scrollLeft: number; + tagName: string; + clientWidth: number; + scrollWidth: number; + clientHeight: number; + clientTop: number; + scrollHeight: number; + msRegionOverflow: string; + onmspointerdown: (ev: any) => any; + onmsgotpointercapture: (ev: any) => any; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + onmslostpointercapture: (ev: any) => any; + onmspointerover: (ev: any) => any; + msContentZoomFactor: number; + onmspointerup: (ev: any) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmspointerenter: (ev: any) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onmspointerleave: (ev: any) => any; + getAttribute(name?: string): string; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + getBoundingClientRect(): ClientRect; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + msMatchesSelector(selectors: string): boolean; + hasAttribute(name: string): boolean; + removeAttribute(name?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + getAttributeNode(name: string): Attr; + fireEvent(eventName: string, eventObj?: any): boolean; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + getClientRects(): ClientRectList; + setAttributeNode(newAttr: Attr): Attr; + removeAttributeNode(oldAttr: Attr): Attr; + setAttribute(name?: string, value?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + msGetRegionContent(): MSRangeCollection; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + setPointerCapture(pointerId: number): void; + msGetUntransformedBounds(): ClientRect; + releasePointerCapture(pointerId: number): void; + msRequestFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Element: { + prototype: Element; + new(): Element; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; +} +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Removes an element from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: any): void; +} +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface Node extends EventTarget { + nodeType: number; + previousSibling: Node; + localName: string; + namespaceURI: string; + textContent: string; + parentNode: Node; + nextSibling: Node; + nodeValue: string; + lastChild: Node; + childNodes: NodeList; + nodeName: string; + ownerDocument: Document; + attributes: NamedNodeMap; + firstChild: Node; + prefix: string; + removeChild(oldChild: Node): Node; + appendChild(newChild: Node): Node; + isSupported(feature: string, version: string): boolean; + isEqualNode(arg: Node): boolean; + lookupPrefix(namespaceURI: string): string; + isDefaultNamespace(namespaceURI: string): boolean; + compareDocumentPosition(other: Node): number; + normalize(): void; + isSameNode(other: Node): boolean; + hasAttributes(): boolean; + lookupNamespaceURI(prefix: string): string; + cloneNode(deep?: boolean): Node; + hasChildNodes(): boolean; + replaceChild(newChild: Node, oldChild: Node): Node; + insertBefore(newChild: Node, refChild?: Node): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} +declare var Node: { + prototype: Node; + new(): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface DOML2DeprecatedListSpaceReduction { + compact: boolean; +} + +interface MSScriptHost { +} +declare var MSScriptHost: { + prototype: MSScriptHost; + new(): MSScriptHost; +} + +interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + clipPathUnits: SVGAnimatedEnumeration; +} +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface MouseEvent extends UIEvent { + toElement: Element; + layerY: number; + fromElement: Element; + which: number; + pageX: number; + offsetY: number; + x: number; + y: number; + metaKey: boolean; + altKey: boolean; + ctrlKey: boolean; + offsetX: number; + screenX: number; + clientY: number; + shiftKey: boolean; + layerX: number; + screenY: number; + relatedTarget: EventTarget; + button: number; + pageY: number; + buttons: number; + clientX: number; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; + getModifierState(keyArg: string): boolean; +} +declare var MouseEvent: { + prototype: MouseEvent; + new(): MouseEvent; +} + +interface RangeException { + code: number; + message: string; + name: string; + toString(): string; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} +declare var RangeException: { + prototype: RangeException; + new(): RangeException; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + y: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + dy: SVGAnimatedLengthList; + x: SVGAnimatedLengthList; + dx: SVGAnimatedLengthList; +} +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + width: number; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + object: string; + form: HTMLFormElement; + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; +} +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface TextMetrics { + width: number; +} +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface DocumentEvent { + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "HTMLEvents"): Event; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface: "NavigationEvent"): NavigationEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PointerEvent"): MSPointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface: "TextEvent"): TextEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * The starting number. + */ + start: number; +} +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface CDATASection extends Text { +} +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface StyleMedia { + type: string; + matchMedium(mediaquery: string): boolean; +} +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { + options: HTMLSelectElement; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: any): void; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface TextRange { + boundingLeft: number; + htmlText: string; + offsetLeft: number; + boundingWidth: number; + boundingHeight: number; + boundingTop: number; + text: string; + offsetTop: number; + moveToPoint(x: number, y: number): void; + queryCommandValue(cmdID: string): any; + getBookmark(): string; + move(unit: string, count?: number): number; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(fStart?: boolean): void; + findText(string: string, count?: number, flags?: number): boolean; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + getBoundingClientRect(): ClientRect; + moveToBookmark(bookmark: string): boolean; + isEqual(range: TextRange): boolean; + duplicate(): TextRange; + collapse(start?: boolean): void; + queryCommandText(cmdID: string): string; + select(): void; + pasteHTML(html: string): void; + inRange(range: TextRange): boolean; + moveEnd(unit: string, count?: number): number; + getClientRects(): ClientRectList; + moveStart(unit: string, count?: number): number; + parentElement(): Element; + queryCommandState(cmdID: string): boolean; + compareEndPoints(how: string, sourceRange: TextRange): number; + execCommandShowHelp(cmdID: string): boolean; + moveToElementText(element: Element): void; + expand(Unit: string): boolean; + queryCommandSupported(cmdID: string): boolean; + setEndPoint(how: string, SourceRange: TextRange): void; + queryCommandEnabled(cmdID: string): boolean; +} +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface SVGTests { + requiredFeatures: SVGStringList; + requiredExtensions: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface CSSStyleSheet extends StyleSheet { + owningElement: Element; + imports: StyleSheetList; + isAlternate: boolean; + rules: MSCSSRuleList; + isPrefAlternate: boolean; + readOnly: boolean; + cssText: string; + ownerRule: CSSRule; + href: string; + cssRules: CSSRuleList; + id: string; + pages: StyleSheetPageList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + insertRule(rule: string, index?: number): number; + removeRule(lIndex: number): void; + deleteRule(index?: number): void; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + removeImport(lIndex: number): void; +} +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface MSSelection { + type: string; + typeDetail: string; + createRange(): TextRange; + clear(): void; + createRangeCollection(): TextRangeCollection; + empty(): void; +} +declare var MSSelection: { + prototype: MSSelection; + new(): MSSelection; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; +} +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { + patternUnits: SVGAnimatedEnumeration; + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + height: SVGAnimatedLength; +} +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface Selection { + isCollapsed: boolean; + anchorNode: Node; + focusNode: Node; + anchorOffset: number; + focusOffset: number; + rangeCount: number; + addRange(range: Range): void; + collapseToEnd(): void; + toString(): string; + selectAllChildren(parentNode: Node): void; + getRangeAt(index: number): Range; + collapse(parentNode: Node, offset: number): void; + removeAllRanges(): void; + collapseToStart(): void; + deleteFromDocument(): void; + removeRange(range: Range): void; +} +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; +} +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; +} + +interface MSDataBindingRecordSetReadonlyExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface CSSStyleRule extends CSSRule { + selectorText: string; + style: MSStyleCSSProperties; + readOnly: boolean; +} +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface NodeIterator { + whatToShow: number; + filter: NodeFilter; + root: Node; + expandEntityReferences: boolean; + nextNode(): Node; + detach(): void; + previousNode(): Node; +} +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { + viewTarget: SVGStringList; +} +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; +} +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getTransformToElement(element: SVGElement): SVGMatrix; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; +} +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface ControlRangeCollection { + length: number; + queryCommandValue(cmdID: string): any; + remove(index: number): void; + add(item: Element): void; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(varargStart?: any): void; + item(index: number): Element; + [index: number]: Element; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + addElement(item: Element): void; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandEnabled(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + select(): void; +} +declare var ControlRangeCollection: { + prototype: ControlRangeCollection; + new(): ControlRangeCollection; +} + +interface MSNamespaceInfo extends MSEventAttachmentTarget { + urn: string; + onreadystatechange: (ev: Event) => any; + name: string; + readyState: string; + doImport(implementationUrl: string): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSNamespaceInfo: { + prototype: MSNamespaceInfo; + new(): MSNamespaceInfo; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; +} +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; +} +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { + type: string; +} +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface SVGFitToViewBox { + viewBox: SVGAnimatedRect; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} + +interface SVGPointList { + numberOfItems: number; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; + getItem(index: number): SVGPoint; + clear(): void; + appendItem(newItem: SVGPoint): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + removeItem(index: number): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; +} +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface MSSiteModeEvent extends Event { + buttonID: number; + actionURL: string; +} +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface DOML2DeprecatedTextFlowControl { + clear: string; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface MSCSSProperties extends CSSStyleDeclaration { + scrollbarShadowColor: string; + scrollbarHighlightColor: string; + layoutGridChar: string; + layoutGridType: string; + textAutospace: string; + textKashidaSpace: string; + writingMode: string; + scrollbarFaceColor: string; + backgroundPositionY: string; + lineBreak: string; + imeMode: string; + msBlockProgression: string; + layoutGridLine: string; + scrollbarBaseColor: string; + layoutGrid: string; + layoutFlow: string; + textKashida: string; + filter: string; + zoom: string; + scrollbarArrowColor: string; + behavior: string; + backgroundPositionX: string; + accelerator: string; + layoutGridMode: string; + textJustifyTrim: string; + scrollbar3dLightColor: string; + msInterpolationMode: string; + scrollbarTrackColor: string; + scrollbarDarkShadowColor: string; + styleFloat: string; + getAttribute(attributeName: string, flags?: number): any; + setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; + removeAttribute(attributeName: string, flags?: number): boolean; +} +declare var MSCSSProperties: { + prototype: MSCSSProperties; + new(): MSCSSProperties; +} + +interface HTMLCollection extends MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Contains the hypertext reference (HREF) of the URL. + */ + href: string; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + crossOrigin: string; + msPlayToPreferredSourceUri: string; +} +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface SVGAngle { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} + +interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + msKeySystem: string; +} +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface KeyboardEvent extends UIEvent { + location: number; + keyCode: number; + shiftKey: boolean; + which: number; + locale: string; + key: string; + altKey: boolean; + metaKey: boolean; + char: string; + ctrlKey: boolean; + repeat: boolean; + charCode: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(): KeyboardEvent; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} + +interface MessageEvent extends Event { + source: Window; + origin: string; + data: any; + ports: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface SVGElement extends Element { + onmouseover: (ev: MouseEvent) => any; + viewportElement: SVGElement; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onfocusin: (ev: FocusEvent) => any; + xmlbase: string; + onmousedown: (ev: MouseEvent) => any; + onload: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + id: string; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface HTMLScriptElement extends HTMLElement { + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + async: boolean; +} +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLElement; +} +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface CanvasRenderingContext2D { + miterLimit: number; + font: string; + globalCompositeOperation: string; + msFillRule: string; + lineCap: string; + msImageSmoothingEnabled: boolean; + lineDashOffset: number; + shadowColor: string; + lineJoin: string; + shadowOffsetX: number; + lineWidth: number; + canvas: HTMLCanvasElement; + strokeStyle: any; + globalAlpha: number; + shadowOffsetY: number; + fillStyle: any; + shadowBlur: number; + textAlign: string; + textBaseline: string; + restore(): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + save(): void; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + measureText(text: string): TextMetrics; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + rotate(angle: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + translate(x: number, y: number): void; + scale(x: number, y: number): void; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + lineTo(x: number, y: number): void; + getLineDash(): number[]; + fill(fillRule?: string): void; + createImageData(imageDataOrSw: any, sh?: number): ImageData; + createPattern(image: HTMLElement, repetition: string): CanvasPattern; + closePath(): void; + rect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + clearRect(x: number, y: number, w: number, h: number): void; + moveTo(x: number, y: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + fillRect(x: number, y: number, w: number, h: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + setLineDash(segments: number[]): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + beginPath(): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; +} +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface MSCSSRuleList { + length: number; + item(index?: number): CSSStyleRule; + [index: number]: CSSStyleRule; +} +declare var MSCSSRuleList: { + prototype: MSCSSRuleList; + new(): MSCSSRuleList; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGTransformList { + numberOfItems: number; + getItem(index: number): SVGTransform; + consolidate(): SVGTransform; + clear(): void; + appendItem(newItem: SVGTransform): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + removeItem(index: number): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; +} +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedPoints { + points: SVGPointList; + animatedPoints: SVGPointList; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface CSSMediaRule extends CSSRule { + media: MediaList; + cssRules: CSSRuleList; + insertRule(rule: string, index?: number): number; + deleteRule(index?: number): void; +} +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface WindowModal { + dialogArguments: any; + returnValue: any; +} + +interface XMLHttpRequest extends EventTarget { + responseBody: any; + status: number; + readyState: number; + responseText: string; + responseXML: any; + ontimeout: (ev: Event) => any; + statusText: string; + onreadystatechange: (ev: Event) => any; + timeout: number; + onload: (ev: Event) => any; + response: any; + withCredentials: boolean; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + onloadstart: (ev: Event) => any; + msCaching: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + overrideMimeType(mime: string): void; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + create(): XMLHttpRequest; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { +} +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface MSDataBindingExtensions { + dataSrc: string; + dataFormatAs: string; + dataFld: string; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + ry: SVGAnimatedLength; + cx: SVGAnimatedLength; + rx: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; +} +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface HTMLFrameSetElement extends HTMLElement { + ononline: (ev: Event) => any; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + onerror: (ev: ErrorEvent) => any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + onresize: (ev: UIEvent) => any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + border: string; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onstorage: (ev: StorageEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface Screen extends EventTarget { + width: number; + deviceXDPI: number; + fontSmoothingEnabled: boolean; + bufferDepth: number; + logicalXDPI: number; + systemXDPI: number; + availHeight: number; + height: number; + logicalYDPI: number; + systemYDPI: number; + updateInterval: number; + colorDepth: number; + availWidth: number; + deviceYDPI: number; + pixelDepth: number; + msOrientation: string; + onmsorientationchange: (ev: any) => any; + msLockOrientation(orientation: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface Coordinates { + altitudeAccuracy: number; + longitude: number; + latitude: number; + speed: number; + heading: number; + altitude: number; + accuracy: number; +} +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorContentUtils { +} + +interface EventListener { + (evt: Event): void; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface DataTransfer { + effectAllowed: string; + dropEffect: string; + types: DOMStringList; + files: FileList; + clearData(format?: string): boolean; + setData(format: string, data: string): boolean; + getData(format: string): string; +} +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} +declare var FocusEvent: { + prototype: FocusEvent; + new(): FocusEvent; +} + +interface Range { + startOffset: number; + collapsed: boolean; + endOffset: number; + startContainer: Node; + endContainer: Node; + commonAncestorContainer: Node; + setStart(refNode: Node, offset: number): void; + setEndBefore(refNode: Node): void; + setStartBefore(refNode: Node): void; + selectNode(refNode: Node): void; + detach(): void; + getBoundingClientRect(): ClientRect; + toString(): string; + compareBoundaryPoints(how: number, sourceRange: Range): number; + insertNode(newNode: Node): void; + collapse(toStart: boolean): void; + selectNodeContents(refNode: Node): void; + cloneContents(): DocumentFragment; + setEnd(refNode: Node, offset: number): void; + cloneRange(): Range; + getClientRects(): ClientRectList; + surroundContents(newParent: Node): void; + deleteContents(): void; + setStartAfter(refNode: Node): void; + extractContents(): DocumentFragment; + setEndAfter(refNode: Node): void; + createContextualFragment(fragment: string): DocumentFragment; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} + +interface SVGPoint { + y: number; + x: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { + width: SVGAnimatedLength; + x: SVGAnimatedLength; + contentStyleType: string; + onzoom: (ev: any) => any; + y: SVGAnimatedLength; + viewport: SVGRect; + onerror: (ev: ErrorEvent) => any; + pixelUnitToMillimeterY: number; + onresize: (ev: UIEvent) => any; + screenPixelToMillimeterY: number; + height: SVGAnimatedLength; + onabort: (ev: UIEvent) => any; + contentScriptType: string; + pixelUnitToMillimeterX: number; + currentTranslate: SVGPoint; + onunload: (ev: Event) => any; + currentScale: number; + onscroll: (ev: UIEvent) => any; + screenPixelToMillimeterX: number; + setCurrentTime(seconds: number): void; + createSVGLength(): SVGLength; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + unpauseAnimations(): void; + createSVGRect(): SVGRect; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + unsuspendRedrawAll(): void; + pauseAnimations(): void; + suspendRedraw(maxWaitMilliseconds: number): number; + deselectAll(): void; + createSVGAngle(): SVGAngle; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + createSVGTransform(): SVGTransform; + unsuspendRedraw(suspendHandleID: number): void; + forceRedraw(): void; + getCurrentTime(): number; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + createSVGMatrix(): SVGMatrix; + createSVGPoint(): SVGPoint; + createSVGNumber(): SVGNumber; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getElementById(elementId: string): Element; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface MSResourceMetadata { + protocol: string; + fileSize: string; + fileUpdatedDate: string; + nameProp: string; + fileCreatedDate: string; + fileModifiedDate: string; + mimeType: string; +} + +interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { +} +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface MSStorageExtensions { + remainingSpace: number; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + type: string; + title: string; +} +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface MSCurrentStyleCSSProperties extends MSCSSProperties { + blockDirection: string; + clipBottom: string; + clipLeft: string; + clipRight: string; + clipTop: string; + hasLayout: string; +} +declare var MSCurrentStyleCSSProperties: { + prototype: MSCurrentStyleCSSProperties; + new(): MSCurrentStyleCSSProperties; +} + +interface MSHTMLCollectionExtensions { + urns(urn: any): any; + tags(tagName: any): any; +} + +interface Storage extends MSStorageExtensions { + length: number; + getItem(key: string): any; + [key: string]: any; + setItem(key: string, data: string): void; + clear(): void; + removeItem(key: string): void; + key(index: number): string; + [index: number]: string; +} +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + scroll: string; + ononline: (ev: Event) => any; + onblur: (ev: FocusEvent) => any; + noWrap: boolean; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + text: any; + onerror: (ev: ErrorEvent) => any; + bgProperties: string; + onresize: (ev: UIEvent) => any; + link: any; + aLink: any; + bottomMargin: any; + topMargin: any; + onafterprint: (ev: Event) => any; + vLink: any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + rightMargin: any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + leftMargin: any; + onstorage: (ev: StorageEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + createTextRange(): TextRange; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface DocumentType extends Node { + name: string; + notations: NamedNodeMap; + systemId: string; + internalSubset: string; + entities: NamedNodeMap; + publicId: string; +} +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; +} +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface MutationEvent extends Event { + newValue: string; + attrChange: number; + attrName: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface DOML2DeprecatedListNumberingAndBulletStyle { + type: string; +} + +interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + status: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + indeterminate: boolean; + readOnly: boolean; + size: number; + loop: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. + */ + vrml: string; + /** + * Sets or retrieves a lower resolution image to display. + */ + lowsrc: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + dynsrc: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + start: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + Methods: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + protocolLong: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + nameProp: string; + urn: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + type: string; + mimeType: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface PerformanceTiming { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + msFirstPaint: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + toJSON(): any; +} +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; +} +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface EventException { + code: number; + message: string; + name: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface MSNavigatorDoNotTrack { + msDoNotTrack: string; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface SVGMetadataElement extends SVGElement { +} +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGStringList { + numberOfItems: number; + replaceItem(newItem: string, index: number): string; + getItem(index: number): string; + clear(): void; + appendItem(newItem: string): string; + initialize(newItem: string): string; + removeItem(index: number): string; + insertItemBefore(newItem: string, index: number): string; +} +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface XDomainRequest { + timeout: number; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: Event) => any; + responseText: string; + contentType: string; + open(method: string, url: string): void; + abort(): void; + send(data?: any): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XDomainRequest: { + prototype: XDomainRequest; + new(): XDomainRequest; + create(): XDomainRequest; +} + +interface DOML2DeprecatedBackgroundColorStyle { + bgColor: any; +} + +interface ElementTraversal { + childElementCount: number; + previousElementSibling: Element; + lastElementChild: Element; + nextElementSibling: Element; + firstElementChild: Element; +} + +interface SVGLength { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface NavigatorStorageUtils { +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + textLength: SVGAnimatedLength; + lengthAdjust: SVGAnimatedEnumeration; + getCharNumAtPosition(point: SVGPoint): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getComputedTextLength(): number; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getEndPositionOfChar(charnum: number): SVGPoint; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface Location { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + reload(flag?: boolean): void; + replace(url: string): void; + assign(url: string): void; + toString(): string; +} +declare var Location: { + prototype: Location; + new(): Location; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; +} +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; +} +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface PerformanceEntry { + name: string; + startTime: number; + duration: number; + entryType: string; +} +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface SVGTransform { + type: number; + angle: number; + matrix: SVGMatrix; + setTranslate(tx: number, ty: number): void; + setScale(sx: number, sy: number): void; + setMatrix(matrix: SVGMatrix): void; + setSkewY(angle: number): void; + setRotate(angle: number, cx: number, cy: number): void; + setSkewX(angle: number): void; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} +declare var UIEvent: { + prototype: UIEvent; + new(): UIEvent; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} + +interface WheelEvent extends MouseEvent { + deltaZ: number; + deltaX: number; + deltaMode: number; + deltaY: number; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + getCurrentPoint(element: Element): void; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} +declare var WheelEvent: { + prototype: WheelEvent; + new(): WheelEvent; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} + +interface MSEventAttachmentTarget { + attachEvent(event: string, listener: EventListener): boolean; + detachEvent(event: string, listener: EventListener): void; +} + +interface SVGNumber { + value: number; +} +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + getTotalLength(): number; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; +} +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface MSCompatibleInfo { + version: string; + userAgent: string; +} +declare var MSCompatibleInfo: { + prototype: MSCompatibleInfo; + new(): MSCompatibleInfo; +} + +interface Text extends CharacterData, MSNodeExtensions { + wholeText: string; + splitText(offset: number): Text; + replaceWholeText(content: string): Text; +} +declare var Text: { + prototype: Text; + new(): Text; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface SVGPathSegList { + numberOfItems: number; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; + getItem(index: number): SVGPathSeg; + clear(): void; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; +} +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { +} +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface MSImageResourceExtensions { + dynsrc: string; + vrml: string; + lowsrc: string; + start: string; + loop: number; +} + +interface PositionError { + code: number; + message: string; + toString(): string; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + cellIndex: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; +} +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface SVGElementInstance extends EventTarget { + previousSibling: SVGElementInstance; + parentNode: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + childNodes: SVGElementInstanceList; + correspondingUseElement: SVGUseElement; + correspondingElement: SVGElement; + firstChild: SVGElementInstance; +} +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface MSNamespaceInfoCollection { + length: number; + add(namespace?: string, urn?: string, implementationUrl?: any): any; + item(index: any): any; + // [index: any]: any; +} +declare var MSNamespaceInfoCollection: { + prototype: MSNamespaceInfoCollection; + new(): MSNamespaceInfoCollection; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface CSSImportRule extends CSSRule { + styleSheet: CSSStyleSheet; + href: string; + media: MediaList; +} +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} +declare var CustomEvent: { + prototype: CustomEvent; + new(): CustomEvent; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; +} +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface DOML2DeprecatedMarginStyle { + vspace: number; + hspace: number; +} + +interface MSWindowModeless { + dialogTop: any; + dialogLeft: any; + dialogWidth: any; + dialogHeight: any; + menuArguments: any; +} + +interface DOML2DeprecatedAlignmentStyle { + align: string; +} + +interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { + width: string; + onbounce: (ev: Event) => any; + vspace: number; + trueSpeed: boolean; + scrollAmount: number; + scrollDelay: number; + behavior: string; + height: string; + loop: number; + direction: string; + hspace: number; + onstart: (ev: Event) => any; + onfinish: (ev: Event) => any; + stop(): void; + start(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface SVGRect { + y: number; + width: number; + x: number; + height: number; +} +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface MSNodeExtensions { + swapNode(otherNode: Node): Node; + removeNode(deep?: boolean): Node; + replaceNode(replacement: Node): Node; +} + +interface History { + length: number; + state: any; + back(distance?: any): void; + forward(distance?: any): void; + go(delta?: any): void; + replaceState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title: string, url?: string): void; +} +declare var History: { + prototype: History; + new(): History; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface TimeRanges { + length: number; + start(index: number): number; + end(index: number): number; +} +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface CSSRule { + cssText: string; + parentStyleSheet: CSSStyleSheet; + parentRule: CSSRule; + type: number; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface SVGMatrix { + e: number; + c: number; + a: number; + b: number; + d: number; + f: number; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + flipY(): SVGMatrix; + skewY(angle: number): SVGMatrix; + inverse(): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + rotate(angle: number): SVGMatrix; + flipX(): SVGMatrix; + translate(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + skewX(angle: number): SVGMatrix; +} +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface MSPopupWindow { + document: Document; + isOpen: boolean; + show(x: number, y: number, w: number, h: number, element?: any): void; + hide(): void; +} +declare var MSPopupWindow: { + prototype: MSPopupWindow; + new(): MSPopupWindow; +} + +interface BeforeUnloadEvent extends Event { + returnValue: string; +} +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + animatedInstanceRoot: SVGElementInstance; + instanceRoot: SVGElementInstance; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface Event { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + cancelBubble: boolean; + target: EventTarget; + eventPhase: number; + cancelable: boolean; + type: string; + srcElement: Element; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; +} +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface SVGException { + code: number; + message: string; + name: string; + toString(): string; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} +declare var SVGException: { + prototype: SVGException; + new(): SVGException; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + ry: SVGAnimatedLength; + rx: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface ErrorEventHandler { + (event: Event, source: string, fileno: number, columnNumber: number): void; +} + +interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface DOML2DeprecatedBorderStyle { + border: string; +} + +interface NamedNodeMap { + length: number; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + [index: number]: Attr; + removeNamedItem(name: string): Attr; + getNamedItem(name: string): Attr; + // [name: string]: Attr; + setNamedItem(arg: Attr): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItemNS(arg: Attr): Attr; +} +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface MediaList { + length: number; + mediaText: string; + deleteMedium(oldMedium: string): void; + appendMedium(newMedium: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGLengthList { + numberOfItems: number; + replaceItem(newItem: SVGLength, index: number): SVGLength; + getItem(index: number): SVGLength; + clear(): void; + appendItem(newItem: SVGLength): SVGLength; + initialize(newItem: SVGLength): SVGLength; + removeItem(index: number): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; +} +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface ProcessingInstruction extends Node { + target: string; + data: string; +} +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface MSWindowExtensions { + status: string; + onmouseleave: (ev: MouseEvent) => any; + screenLeft: number; + offscreenBuffering: any; + maxConnectionsPerServer: number; + onmouseenter: (ev: MouseEvent) => any; + clipboardData: DataTransfer; + defaultStatus: string; + clientInformation: Navigator; + closed: boolean; + onhelp: (ev: Event) => any; + external: External; + event: MSEventObj; + onfocusout: (ev: FocusEvent) => any; + screenTop: number; + onfocusin: (ev: FocusEvent) => any; + showModelessDialog(url?: string, argument?: any, options?: any): Window; + navigate(url: string): void; + resizeBy(x?: number, y?: number): void; + item(index: any): any; + resizeTo(x?: number, y?: number): void; + createPopup(arguments?: any): MSPopupWindow; + toStaticHTML(html: string): string; + execScript(code: string, language?: string): any; + msWriteProfilerMark(profilerMarkName: string): void; + moveTo(x?: number, y?: number): void; + moveBy(x?: number, y?: number): void; + showHelp(url: string, helpArg?: any, features?: string): void; + captureEvents(): void; + releaseEvents(): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSBehaviorUrnsCollection { + length: number; + item(index: number): string; +} +declare var MSBehaviorUrnsCollection: { + prototype: MSBehaviorUrnsCollection; + new(): MSBehaviorUrnsCollection; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface DOML2DeprecatedBackgroundStyle { + background: string; +} + +interface TextEvent extends UIEvent { + inputMethod: number; + data: string; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} + +interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { +} +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface Position { + timestamp: Date; + coords: Coordinates; +} +declare var Position: { + prototype: Position; + new(): Position; +} + +interface BookmarkCollection { + length: number; + item(index: number): any; + [index: number]: any; +} +declare var BookmarkCollection: { + prototype: BookmarkCollection; + new(): BookmarkCollection; +} + +interface PerformanceMark extends PerformanceEntry { +} +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selectorText: string; + selector: string; + style: CSSStyleDeclaration; +} +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface MSNavigatorExtensions { + userLanguage: string; + plugins: MSPluginsCollection; + cookieEnabled: boolean; + appCodeName: string; + cpuClass: string; + appMinorVersion: string; + connectionSpeed: number; + browserLanguage: string; + mimeTypes: MSMimeTypesCollection; + systemLanguage: string; + language: string; + javaEnabled(): boolean; + taintEnabled(): boolean; +} + +interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { +} +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; +} +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; +} +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface SVGZoomAndPan { + zoomAndPan: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; + SVG_ZOOMANDPAN_DISABLE: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface HTMLMediaElement extends HTMLElement { + /** + * Gets the earliest possible position, in seconds, that the playback can begin. + */ + initialTime: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + readyState: any; + /** + * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. + */ + autobuffer: boolean; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + /** + * Gets the current network activity for the element. + */ + networkState: number; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + textTracks: TextTrackList; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; +} + +interface ElementCSSInlineStyle { + runtimeStyle: MSStyleCSSProperties; + currentStyle: MSCurrentStyleCSSProperties; + doScroll(component?: any): void; + componentFromPoint(x: number, y: number): string; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface MSMimeTypesCollection { + length: number; +} +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface StyleSheet { + disabled: boolean; + ownerNode: Node; + parentStyleSheet: StyleSheet; + href: string; + media: MediaList; + type: string; + title: string; +} +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + startOffset: SVGAnimatedLength; + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} + +interface HTMLDTElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface PerformanceMeasure extends PerformanceEntry { +} +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { + spreadMethod: SVGAnimatedEnumeration; + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_ENTITY: number; + SHOW_DOCUMENT: number; + SHOW_PROCESSING_INSTRUCTION: number; + FILTER_REJECT: number; + SHOW_CDATA_SECTION: number; + FILTER_ACCEPT: number; + SHOW_ALL: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_TEXT: number; + SHOW_ELEMENT: number; + SHOW_COMMENT: number; + FILTER_SKIP: number; + SHOW_ATTRIBUTE: number; + SHOW_DOCUMENT_FRAGMENT: number; +} +declare var NodeFilter: NodeFilter; + +interface SVGNumberList { + numberOfItems: number; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; + getItem(index: number): SVGNumber; + clear(): void; + appendItem(newItem: SVGNumber): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + removeItem(index: number): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; +} +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLBGSoundElement extends HTMLElement { + /** + * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. + */ + balance: any; + /** + * Sets or gets the volume setting for the sound. + */ + volume: any; + /** + * Sets or gets the URL of a sound to play. + */ + src: string; + /** + * Sets or retrieves the number of times a sound or video clip will loop when activated. + */ + loop: number; +} +declare var HTMLBGSoundElement: { + prototype: HTMLBGSoundElement; + new(): HTMLBGSoundElement; +} + +interface Comment extends CharacterData { + text: string; +} +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + redirectStart: number; + redirectEnd: number; + domainLookupEnd: number; + responseStart: number; + domainLookupStart: number; + fetchStart: number; + requestStart: number; + connectEnd: number; + connectStart: number; + initiatorType: string; + responseEnd: number; +} +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface CanvasPattern { +} +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; +} +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the contained object. + */ + object: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + declare: boolean; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: number; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Retrieves the palette used for the embedded document. + */ + palette: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + hidden: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: string; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; +} +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface StorageEvent extends Event { + oldValue: any; + newValue: any; + url: string; + storageArea: Storage; + key: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface CharacterData extends Node { + length: number; + data: string; + deleteData(offset: number, count: number): void; + replaceData(offset: number, count: number, arg: string): void; + appendData(arg: string): void; + insertData(offset: number, arg: string): void; + substringData(offset: number, count: number): string; +} +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + prompt: string; +} +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface MSCompatibleInfoCollection { + length: number; + item(index: number): MSCompatibleInfo; +} +declare var MSCompatibleInfoCollection: { + prototype: MSCompatibleInfoCollection; + new(): MSCompatibleInfoCollection; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} + +interface Attr extends Node { + expando: boolean; + specified: boolean; + ownerElement: Element; + value: string; + name: string; +} +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; +} +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface PositionCallback { + (position: Position): void; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { +} +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface MSDataBindingRecordSetExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface LinkStyle { + styleSheet: StyleSheet; + sheet: StyleSheet; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the width of the video element. + */ + width: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets or sets the height of the video element. + */ + height: number; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + onMSVideoOptimalLayoutChanged: (ev: any) => any; + onMSVideoFrameStepCompleted: (ev: any) => any; + msStereo3DRenderMode: string; + msIsLayoutOptimalForPlayback: boolean; + msHorizontalMirror: boolean; + onMSVideoFormatChanged: (ev: any) => any; + msZoom: boolean; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + msFrameStep(forward: boolean): void; + getVideoPlaybackQuality(): VideoPlaybackQuality; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + maskUnits: SVGAnimatedEnumeration; + maskContentUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface External { +} +declare var External: { + prototype: External; + new(): External; +} + +interface MSGestureEvent extends UIEvent { + offsetY: number; + translationY: number; + velocityExpansion: number; + velocityY: number; + velocityAngular: number; + translationX: number; + velocityX: number; + hwTimestamp: number; + offsetX: number; + screenX: number; + rotation: number; + expansion: number; + clientY: number; + screenY: number; + scale: number; + gestureObject: any; + clientX: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + error: any; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + filterResX: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + primitiveUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + filterResY: SVGAnimatedInteger; + setFilterRes(filterResX: number, filterResY: number): void; +} +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface TrackEvent extends Event { + track: any; +} +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface TextTrackCue extends EventTarget { + onenter: (ev: Event) => any; + track: TextTrack; + endTime: number; + text: string; + pauseOnExit: boolean; + id: string; + startTime: number; + onexit: (ev: Event) => any; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface DOMTokenList { + length: number; + contains(token: string): boolean; + remove(token: string): void; + toggle(token: string): boolean; + add(token: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface TransitionEvent extends Event { + propertyName: string; + elapsedTime: number; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface MediaQueryList { + matches: boolean; + media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + extensions: string; + onmessage: (ev: MessageEvent) => any; + onclose: (ev: CloseEvent) => any; + onerror: (ev: ErrorEvent) => any; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface SVGFEPointLightElement extends SVGElement { + y: SVGAnimatedNumber; + x: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + stdDeviationX: SVGAnimatedNumber; + in1: SVGAnimatedString; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; +} +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + result: SVGAnimatedString; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; +} +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface URL { + revokeObjectURL(url: string): void; + createObjectURL(object: any, options?: ObjectURLOptions): string; +} +declare var URL: URL; + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + ontimeout: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onloadstart: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface IDBEnvironment { + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; +} + +interface AudioTrackList extends EventTarget { + length: number; + onchange: (ev: Event) => any; + onaddtrack: (ev: TrackEvent) => any; + onremovetrack: (ev: any /*PluginArray*/) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + [index: number]: AudioTrack; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + readyState: number; + onabort: (ev: UIEvent) => any; + onloadend: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onloadstart: (ev: Event) => any; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface WindowTimersExtension { + msSetImmediate(expression: any, ...args: any[]): number; + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + setImmediate(expression: any, ...args: any[]): number; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + scale: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + tableValues: SVGAnimatedNumberList; + slope: SVGAnimatedNumber; + type: SVGAnimatedEnumeration; + exponent: SVGAnimatedNumber; + amplitude: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; +} + +interface AudioTrack { + kind: string; + language: string; + id: string; + label: string; + enabled: boolean; + sourceBuffer: SourceBuffer; +} +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + orderY: SVGAnimatedInteger; + kernelUnitLengthY: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + kernelMatrix: SVGAnimatedNumberList; + edgeMode: SVGAnimatedEnumeration; + kernelUnitLengthX: SVGAnimatedNumber; + bias: SVGAnimatedNumber; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + divisor: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} + +interface TextTrackCueList { + length: number; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; + getCueById(id: string): TextTrackCue; +} +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface CSSKeyframesRule extends CSSRule { + name: string; + cssRules: CSSRuleList; + findRule(rule: string): CSSKeyframeRule; + deleteRule(rule: string): void; + appendRule(rule: string): void; +} +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + type: SVGAnimatedEnumeration; + baseFrequencyY: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + seed: SVGAnimatedNumber; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} + +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + [index: number]: TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} + +interface SVGFESpotLightElement extends SVGElement { + pointsAtY: SVGAnimatedNumber; + y: SVGAnimatedNumber; + limitingConeAngle: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + z: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; +} +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + onblocked: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface MSLaunchUriCallback { + (): void; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + dx: SVGAnimatedNumber; +} +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface TextTrack extends EventTarget { + language: string; + mode: any; + readyState: number; + activeCues: TextTrackCueList; + cues: TextTrackCueList; + oncuechange: (ev: Event) => any; + kind: string; + onload: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + label: string; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; +} + +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + readyState: string; + result: any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new(): Blob; +} + +interface ApplicationCache extends EventTarget { + status: number; + ondownloading: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onupdateready: (ev: Event) => any; + oncached: (ev: Event) => any; + onobsolete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onchecking: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + swapCache(): void; + abort(): void; + update(): void; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; +} + +interface FrameRequestCallback { + (time: number): void; +} + +interface PopStateEvent extends Event { + state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} +declare var PopStateEvent: { + prototype: PopStateEvent; + new(): PopStateEvent; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface MSPointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(): MSPointerEvent; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} + +interface MSManipulationEvent extends UIEvent { + lastState: number; + currentState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; +} +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + in2: SVGAnimatedString; + k2: SVGAnimatedNumber; + k1: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + in1: SVGAnimatedString; + k4: SVGAnimatedNumber; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} + +interface ValidityState { + customError: boolean; + valueMissing: boolean; + stepMismatch: boolean; + rangeUnderflow: boolean; + rangeOverflow: boolean; + typeMismatch: boolean; + patternMismatch: boolean; + tooLong: boolean; + valid: boolean; +} +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface HTMLTrackElement extends HTMLElement { + kind: string; + src: string; + srclang: string; + track: TextTrack; + label: string; + default: boolean; + readyState: number; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; + getViewOpener(): MSAppView; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + createNewView(uri: string): MSAppView; + getCurrentPriority(): string; + NORMAL: string; + HIGH: string; + IDLE: string; + CURRENT: string; +} +declare var MSApp: MSApp; + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + diffuseConstant: SVGAnimatedNumber; +} +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface MSCSSMatrix { + m24: number; + m34: number; + a: number; + d: number; + m32: number; + m41: number; + m11: number; + f: number; + e: number; + m23: number; + m14: number; + m33: number; + m22: number; + m21: number; + c: number; + m12: number; + b: number; + m42: number; + m31: number; + m43: number; + m13: number; + m44: number; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + setMatrixValue(value: string): void; + inverse(): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + toString(): string; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + translate(x: number, y: number, z?: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + skewX(angle: number): MSCSSMatrix; +} +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; +} + +interface Worker extends AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} + +interface MSGraphicsTrust { + status: string; + constrictionActive: boolean; +} +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface SubtleCrypto { + unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; + encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; + verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; + deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; + exportKey(format: string, key: Key): KeyOperation; + generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; +} +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Crypto extends RandomSource { + subtle: SubtleCrypto; +} +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface VideoPlaybackQuality { + totalFrameDelay: number; + creationTime: number; + totalVideoFrames: number; + droppedVideoFrames: number; +} +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface GlobalEventHandlers { + onpointerenter: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onpointercancel: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface Key { + algorithm: Algorithm; + type: string; + extractable: boolean; + keyUsage: string[]; +} +declare var Key: { + prototype: Key; + new(): Key; +} + +interface DeviceAcceleration { + y: number; + x: number; + z: number; +} +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface AesGcmEncryptResult { + ciphertext: ArrayBuffer; + tag: ArrayBuffer; +} +declare var AesGcmEncryptResult: { + prototype: AesGcmEncryptResult; + new(): AesGcmEncryptResult; +} + +interface NavigationCompletedEvent extends NavigationEvent { + webErrorStatus: number; + isSuccess: boolean; +} +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface MutationRecord { + oldValue: string; + previousSibling: Node; + addedNodes: NodeList; + attributeName: string; + removedNodes: NodeList; + target: Node; + nextSibling: Node; + attributeNamespace: string; + type: string; +} +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(type: string): Plugin; + // [type: string]: Plugin; +} +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface KeyOperation extends EventTarget { + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + result: any; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var KeyOperation: { + prototype: KeyOperation; + new(): KeyOperation; +} + +interface DOMStringMap { +} +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DeviceOrientationEvent extends Event { + gamma: number; + alpha: number; + absolute: boolean; + beta: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSHTMLWebViewElement extends HTMLElement { + documentTitle: string; + width: number; + src: string; + canGoForward: boolean; + height: number; + canGoBack: boolean; + navigateWithHttpRequestMessage(requestMessage: any): void; + goBack(): void; + navigate(uri: string): void; + stop(): void; + navigateToString(contents: string): void; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + refresh(): void; + goForward(): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; +} +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface NavigationEvent extends Event { + uri: string; +} +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SourceBuffer extends EventTarget { + updating: boolean; + appendWindowStart: number; + appendWindowEnd: number; + buffered: TimeRanges; + timestampOffset: number; + audioTracks: AudioTrackList; + appendBuffer(data: ArrayBuffer): void; + remove(start: number, end: number): void; + abort(): void; + appendStream(stream: MSStream, maxSize?: number): void; +} +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface MSInputMethodContext extends EventTarget { + oncandidatewindowshow: (ev: any) => any; + target: HTMLElement; + compositionStartOffset: number; + oncandidatewindowhide: (ev: any) => any; + oncandidatewindowupdate: (ev: any) => any; + compositionEndOffset: number; + getCompositionAlternatives(): string[]; + getCandidateWindowClientRect(): ClientRect; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface DeviceRotationRate { + gamma: number; + alpha: number; + beta: number; +} +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface PluginArray { + length: number; + refresh(reload?: boolean): void; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(name: string): Plugin; + // [name: string]: Plugin; +} +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface MSMediaKeyError { + systemCode: number; + code: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} + +interface Plugin { + length: number; + filename: string; + version: string; + name: string; + description: string; + item(index: number): MimeType; + [index: number]: MimeType; + namedItem(type: string): MimeType; + // [type: string]: MimeType; +} +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface MediaSource extends EventTarget { + sourceBuffers: SourceBufferList; + duration: number; + readyState: string; + activeSourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface SourceBufferList extends EventTarget { + length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface XMLDocument extends Document { +} +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface DeviceMotionEvent extends Event { + rotationRate: DeviceRotationRate; + acceleration: DeviceAcceleration; + interval: number; + accelerationIncludingGravity: DeviceAcceleration; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface MimeType { + enabledPlugin: Plugin; + suffixes: string; + type: string; + description: string; +} +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface PointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; +} +declare var PointerEvent: { + prototype: PointerEvent; + new(): PointerEvent; +} + +interface MSDocumentExtensions { + captureEvents(): void; + releaseEvents(): void; +} + +interface MutationObserver { + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; + disconnect(): void; +} +declare var MutationObserver: { + prototype: MutationObserver; + new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +} + +interface MSWebViewAsyncOperation extends EventTarget { + target: MSHTMLWebViewElement; + oncomplete: (ev: Event) => any; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + readyState: number; + type: number; + result: any; + start(): void; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; +} + +interface ScriptNotifyEvent extends Event { + value: string; + callingUri: string; +} +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + redirectCount: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + type: string; +} +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface LongRunningScriptDetectedEvent extends Event { + stopPageScriptExecution: boolean; + executionTime: number; +} +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSAppView { + viewId: number; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; +} +declare var MSAppView: { + prototype: MSAppView; + new(): MSAppView; +} + +interface PerfWidgetExternal { + maxCpuSpeed: number; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + performanceCounter: number; + averagePaintTime: number; + activeNetworkRequestCount: number; + paintRequestsPerSecond: number; + extraInformationEnabled: boolean; + performanceCounterFrequency: number; + averageFrameTime: number; + repositionWindow(x: number, y: number): void; + getRecentMemoryUsage(last: number): any; + getMemoryUsage(): number; + resizeWindow(width: number, height: number): void; + getProcessCpuUsage(): number; + removeEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentCpuUsage(last: number): any; + addEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentFrames(last: number): any; + getRecentPaintRequests(last: number): any; +} +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} + +interface HTMLDocument extends Document { +} +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface KeyPair { + privateKey: Key; + publicKey: Key; +} +declare var KeyPair: { + prototype: KeyPair; + new(): KeyPair; +} + +interface MSMediaKeySession extends EventTarget { + sessionId: string; + error: MSMediaKeyError; + keySystem: string; + close(): void; + update(key: Uint8Array): void; +} +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEvent { + referrer: string; +} +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface CryptoOperation extends EventTarget { + algorithm: Algorithm; + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + key: Key; + result: any; + abort(): void; + finish(): void; + process(buffer: ArrayBufferView): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var CryptoOperation: { + prototype: CryptoOperation; + new(): CryptoOperation; +} + +interface WebGLTexture extends WebGLObject { +} +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface OES_texture_float { +} +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface WebGLContextEvent extends Event { + statusMessage: string; +} +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLRenderbuffer extends WebGLObject { +} +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLUniformLocation { +} +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebGLActiveInfo { + name: string; + type: number; + size: number; +} +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WebGLRenderingContext { + drawingBufferWidth: number; + drawingBufferHeight: number; + canvas: HTMLCanvasElement; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + bindTexture(target: number, texture: WebGLTexture): void; + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferData(target: number, data: ArrayBuffer, usage: number): void; + bufferData(target: number, size: number, usage: number): void; + depthMask(flag: boolean): void; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + vertexAttrib3fv(indx: number, values: number[]): void; + vertexAttrib3fv(indx: number, values: Float32Array): void; + linkProgram(program: WebGLProgram): void; + getSupportedExtensions(): string[]; + bufferSubData(target: number, offset: number, data: ArrayBuffer): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + polygonOffset(factor: number, units: number): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + createTexture(): WebGLTexture; + hint(target: number, mode: number): void; + getVertexAttrib(index: number, pname: number): any; + enableVertexAttribArray(index: number): void; + depthRange(zNear: number, zFar: number): void; + cullFace(mode: number): void; + createFramebuffer(): WebGLFramebuffer; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + getExtension(name: string): any; + createProgram(): WebGLProgram; + deleteShader(shader: WebGLShader): void; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + enable(cap: number): void; + blendEquation(mode: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + createBuffer(): WebGLBuffer; + deleteTexture(texture: WebGLTexture): void; + useProgram(program: WebGLProgram): void; + vertexAttrib2fv(indx: number, values: number[]): void; + vertexAttrib2fv(indx: number, values: Float32Array): void; + checkFramebufferStatus(target: number): number; + frontFace(mode: number): void; + getBufferParameter(target: number, pname: number): any; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + getVertexAttribOffset(index: number, pname: number): number; + disableVertexAttribArray(index: number): void; + blendFunc(sfactor: number, dfactor: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + uniform3iv(location: WebGLUniformLocation, v: number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + lineWidth(width: number): void; + getShaderInfoLog(shader: WebGLShader): string; + getTexParameter(target: number, pname: number): any; + getParameter(pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getContextAttributes(): WebGLContextAttributes; + vertexAttrib1f(indx: number, x: number): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + isContextLost(): boolean; + uniform1iv(location: WebGLUniformLocation, v: number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + getRenderbufferParameter(target: number, pname: number): any; + uniform2fv(location: WebGLUniformLocation, v: number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; + isTexture(texture: WebGLTexture): boolean; + getError(): number; + shaderSource(shader: WebGLShader, source: string): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + stencilMask(mask: number): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + getAttribLocation(program: WebGLProgram, name: string): number; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + clear(mask: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + scissor(x: number, y: number, width: number, height: number): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getShaderSource(shader: WebGLShader): string; + generateMipmap(target: number): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + uniform1fv(location: WebGLUniformLocation, v: number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; + uniform2iv(location: WebGLUniformLocation, v: number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + uniform4fv(location: WebGLUniformLocation, v: number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; + vertexAttrib1fv(indx: number, values: number[]): void; + vertexAttrib1fv(indx: number, values: Float32Array): void; + flush(): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + deleteProgram(program: WebGLProgram): void; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + uniform1i(location: WebGLUniformLocation, x: number): void; + getProgramParameter(program: WebGLProgram, pname: number): any; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + stencilFunc(func: number, ref: number, mask: number): void; + pixelStorei(pname: number, param: number): void; + disable(cap: number): void; + vertexAttrib4fv(indx: number, values: number[]): void; + vertexAttrib4fv(indx: number, values: Float32Array): void; + createRenderbuffer(): WebGLRenderbuffer; + isBuffer(buffer: WebGLBuffer): boolean; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + sampleCoverage(value: number, invert: boolean): void; + depthFunc(func: number): void; + texParameterf(target: number, pname: number, param: number): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + drawArrays(mode: number, first: number, count: number): void; + texParameteri(target: number, pname: number, param: number): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + getShaderParameter(shader: WebGLShader, pname: number): any; + clearDepth(depth: number): void; + activeTexture(texture: number): void; + viewport(x: number, y: number, width: number, height: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + deleteBuffer(buffer: WebGLBuffer): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + uniform3fv(location: WebGLUniformLocation, v: number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; + stencilMaskSeparate(face: number, mask: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + compileShader(shader: WebGLShader): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + isShader(shader: WebGLShader): boolean; + clearStencil(s: number): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + finish(): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + getProgramInfoLog(program: WebGLProgram): string; + validateProgram(program: WebGLProgram): void; + isEnabled(cap: number): boolean; + vertexAttrib2f(indx: number, x: number, y: number): void; + isProgram(program: WebGLProgram): boolean; + createShader(type: number): WebGLShader; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + uniform4iv(location: WebGLUniformLocation, v: number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} + +interface WebGLProgram extends WebGLObject { +} +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface WebGLFramebuffer extends WebGLObject { +} +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLShader extends WebGLObject { +} +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface OES_texture_float_linear { +} +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface WebGLObject { +} +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLBuffer extends WebGLObject { +} +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLShaderPrecisionFormat { + rangeMin: number; + rangeMax: number; + precision: number; +} +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface EXT_texture_filter_anisotropic { + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; +declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; +declare var Audio: { new(src?: string): HTMLAudioElement; }; + +declare var ondragend: (ev: DragEvent) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var screenX: number; +declare var onmouseover: (ev: MouseEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var history: History; +declare var pageXOffset: number; +declare var name: string; +declare var onafterprint: (ev: Event) => any; +declare var onpause: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var top: Window; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var opener: Window; +declare var onclick: (ev: MouseEvent) => any; +declare var innerHeight: number; +declare var onwaiting: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var ondurationchange: (ev: Event) => any; +declare var frames: Window; +declare var onblur: (ev: FocusEvent) => any; +declare var onemptied: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var oncanplay: (ev: Event) => any; +declare var outerWidth: number; +declare var onstalled: (ev: Event) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var innerWidth: number; +declare var onoffline: (ev: Event) => any; +declare var length: number; +declare var screen: Screen; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onloadstart: (ev: Event) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var self: Window; +declare var document: Document; +declare var onprogress: (ev: ProgressEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var pageYOffset: number; +declare var oncontextmenu: (ev: MouseEvent) => any; +declare var onchange: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onplaying: (ev: Event) => any; +declare var parent: Window; +declare var location: Location; +declare var oncanplaythrough: (ev: Event) => any; +declare var onabort: (ev: UIEvent) => any; +declare var onreadystatechange: (ev: Event) => any; +declare var outerHeight: number; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var frameElement: Element; +declare var onloadeddata: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var window: Window; +declare var onfocus: (ev: FocusEvent) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onselect: (ev: UIEvent) => any; +declare var navigator: Navigator; +declare var styleMedia: StyleMedia; +declare var ondrop: (ev: DragEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onended: (ev: Event) => any; +declare var onhashchange: (ev: Event) => any; +declare var onunload: (ev: Event) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var screenY: number; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var oninput: (ev: Event) => any; +declare var performance: Performance; +declare var onmspointerdown: (ev: any) => any; +declare var animationStartTime: number; +declare var onmsgesturedoubletap: (ev: any) => any; +declare var onmspointerhover: (ev: any) => any; +declare var onmsgesturehold: (ev: any) => any; +declare var onmspointermove: (ev: any) => any; +declare var onmsgesturechange: (ev: any) => any; +declare var onmsgesturestart: (ev: any) => any; +declare var onmspointercancel: (ev: any) => any; +declare var onmsgestureend: (ev: any) => any; +declare var onmsgesturetap: (ev: any) => any; +declare var onmspointerout: (ev: any) => any; +declare var msAnimationStartTime: number; +declare var applicationCache: ApplicationCache; +declare var onmsinertiastart: (ev: any) => any; +declare var onmspointerover: (ev: any) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onmspointerup: (ev: any) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var devicePixelRatio: number; +declare var msCrypto: Crypto; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var doNotTrack: string; +declare var onmspointerenter: (ev: any) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onmspointerleave: (ev: any) => any; +declare function alert(message?: any): void; +declare function scroll(x?: number, y?: number): void; +declare function focus(): void; +declare function scrollTo(x?: number, y?: number): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; +declare function toString(): string; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function scrollBy(x?: number, y?: number): void; +declare function confirm(message?: string): boolean; +declare function close(): void; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function showModalDialog(url?: string, argument?: any, options?: any): any; +declare function blur(): void; +declare function getSelection(): Selection; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function cancelAnimationFrame(handle: number): void; +declare function msIsStaticHTML(html: string): boolean; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function attachEvent(event: string, listener: EventListener): boolean; +declare function detachEvent(event: string, listener: EventListener): void; +declare var localStorage: Storage; +declare var status: string; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var screenLeft: number; +declare var offscreenBuffering: any; +declare var maxConnectionsPerServer: number; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var clipboardData: DataTransfer; +declare var defaultStatus: string; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var onhelp: (ev: Event) => any; +declare var external: External; +declare var event: MSEventObj; +declare var onfocusout: (ev: FocusEvent) => any; +declare var screenTop: number; +declare var onfocusin: (ev: FocusEvent) => any; +declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; +declare function navigate(url: string): void; +declare function resizeBy(x?: number, y?: number): void; +declare function item(index: any): any; +declare function resizeTo(x?: number, y?: number): void; +declare function createPopup(arguments?: any): MSPopupWindow; +declare function toStaticHTML(html: string): string; +declare function execScript(code: string, language?: string): any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function moveTo(x?: number, y?: number): void; +declare function moveBy(x?: number, y?: number): void; +declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare function captureEvents(): void; +declare function releaseEvents(): void; +declare var sessionStorage: Storage; +declare function clearTimeout(handle: number): void; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearInterval(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function msClearImmediate(handle: number): void; +declare function setImmediate(expression: any, ...args: any[]): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare var console: Console; +declare var onpointerenter: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onpointercancel: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerleave: (ev: PointerEvent) => any; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + +declare var ActiveXObject: { new (s: string): any; }; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +declare var WScript: { + Echo(s: any): void; + StdErr: ITextWriter; + StdOut: ITextWriter; + Arguments: { length: number; Item(n: number): string; }; + ScriptFullName: string; + Quit(exitCode?: number): number; +} diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts new file mode 100644 index 0000000000000..ff05bbf6b8de7 --- /dev/null +++ b/bin/lib.dom.d.ts @@ -0,0 +1,13027 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +///////////////////////////// +/// IE10 ECMAScript Extensions +///////////////////////////// + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + byteLength: number; +} + +declare var ArrayBuffer: { + prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; +} + +interface ArrayBufferView { + buffer: ArrayBuffer; + byteOffset: number; + byteLength: number; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; +} +declare var Int8Array: { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; +} +declare var Uint8Array: { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; +} +declare var Int16Array: { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; +} +declare var Uint16Array: { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; +} +declare var Int32Array: { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; +} +declare var Uint32Array: { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; +} +declare var Float32Array: { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float64Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float64Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; +} +declare var Float64Array: { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + BYTES_PER_ELEMENT: number; +} + +/** + * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. + */ +interface DataView extends ArrayBufferView { + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; +} +declare var DataView: { + prototype: DataView; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; +} + +///////////////////////////// +/// IE11 ECMAScript Extensions +///////////////////////////// + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): Map; + size: number; +} +declare var Map: { + new (): Map; +} + +interface WeakMap { + clear(): void; + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): WeakMap; +} +declare var WeakMap: { + new (): WeakMap; +} + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; +} +declare var Set: { + new (): Set; +} + +declare module Intl { + + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string[], options?: CollatorOptions): Collator; + new (locale?: string, options?: CollatorOptions): Collator; + (locales?: string[], options?: CollatorOptions): Collator; + (locale?: string, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; + supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + } + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumintegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string[], options?: NumberFormatOptions): Collator; + new (locale?: string, options?: NumberFormatOptions): Collator; + (locales?: string[], options?: NumberFormatOptions): Collator; + (locale?: string, options?: NumberFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + } + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12: boolean; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date: number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string[], options?: DateTimeFormatOptions): Collator; + new (locale?: string, options?: DateTimeFormatOptions): Collator; + (locales?: string[], options?: DateTimeFormatOptions): Collator; + (locale?: string, options?: DateTimeFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + } +} + +interface String { + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; + + /** + * Converts a number to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a date to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; +} + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface AlgorithmParameters { +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface Algorithm { + name?: string; + params?: AlgorithmParameters; +} + +interface MouseEventInit { + bubbles?: boolean; + cancelable?: boolean; + view?: Window; + detail?: number; + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface WebGLContextAttributes { + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { + hidden: any; + readyState: any; + onmouseleave: (ev: MouseEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + onmove: (ev: MSEventObj) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onhelp: (ev: Event) => any; + ondragleave: (ev: DragEvent) => any; + className: string; + onfocusin: (ev: FocusEvent) => any; + onseeked: (ev: Event) => any; + recordNumber: any; + title: string; + parentTextEdit: Element; + outerHTML: string; + ondurationchange: (ev: Event) => any; + offsetHeight: number; + all: HTMLCollection; + onblur: (ev: FocusEvent) => any; + dir: string; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + ondeactivate: (ev: UIEvent) => any; + ondatasetchanged: (ev: MSEventObj) => any; + onrowsdelete: (ev: MSEventObj) => any; + sourceIndex: number; + onloadstart: (ev: Event) => any; + onlosecapture: (ev: MSEventObj) => any; + ondragenter: (ev: DragEvent) => any; + oncontrolselect: (ev: MSEventObj) => any; + onsubmit: (ev: Event) => any; + behaviorUrns: MSBehaviorUrnsCollection; + scopeName: string; + onchange: (ev: Event) => any; + id: string; + onlayoutcomplete: (ev: MSEventObj) => any; + uniqueID: string; + onbeforeactivate: (ev: UIEvent) => any; + oncanplaythrough: (ev: Event) => any; + onbeforeupdate: (ev: MSEventObj) => any; + onfilterchange: (ev: MSEventObj) => any; + offsetParent: Element; + ondatasetcomplete: (ev: MSEventObj) => any; + onsuspend: (ev: Event) => any; + onmouseenter: (ev: MouseEvent) => any; + innerText: string; + onerrorupdate: (ev: MSEventObj) => any; + onmouseout: (ev: MouseEvent) => any; + parentElement: HTMLElement; + onmousewheel: (ev: MouseWheelEvent) => any; + onvolumechange: (ev: Event) => any; + oncellchange: (ev: MSEventObj) => any; + onrowexit: (ev: MSEventObj) => any; + onrowsinserted: (ev: MSEventObj) => any; + onpropertychange: (ev: MSEventObj) => any; + filters: any; + children: HTMLCollection; + ondragend: (ev: DragEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + offsetTop: number; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + innerHTML: string; + onmouseover: (ev: MouseEvent) => any; + lang: string; + uniqueNumber: number; + onpause: (ev: Event) => any; + tagUrn: string; + onmousedown: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + onwaiting: (ev: Event) => any; + onresizestart: (ev: MSEventObj) => any; + offsetLeft: number; + isTextEdit: boolean; + isDisabled: boolean; + onpaste: (ev: DragEvent) => any; + canHaveHTML: boolean; + onmoveend: (ev: MSEventObj) => any; + language: string; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + style: MSStyleCSSProperties; + isContentEditable: boolean; + onbeforeeditfocus: (ev: MSEventObj) => any; + onratechange: (ev: Event) => any; + contentEditable: string; + tabIndex: number; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: MouseEvent) => any; + onloadedmetadata: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + onerror: (ev: ErrorEvent) => any; + onplay: (ev: Event) => any; + onresizeend: (ev: MSEventObj) => any; + onplaying: (ev: Event) => any; + isMultiLine: boolean; + onfocusout: (ev: FocusEvent) => any; + onabort: (ev: UIEvent) => any; + ondataavailable: (ev: MSEventObj) => any; + hideFocus: boolean; + onreadystatechange: (ev: Event) => any; + onkeypress: (ev: KeyboardEvent) => any; + onloadeddata: (ev: Event) => any; + onbeforedeactivate: (ev: UIEvent) => any; + outerText: string; + disabled: boolean; + onactivate: (ev: UIEvent) => any; + accessKey: string; + onmovestart: (ev: MSEventObj) => any; + onselectstart: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + oncut: (ev: DragEvent) => any; + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + offsetWidth: number; + oncopy: (ev: DragEvent) => any; + onended: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onrowenter: (ev: MSEventObj) => any; + onload: (ev: Event) => any; + canHaveChildren: boolean; + oninput: (ev: Event) => any; + onmscontentzoom: (ev: MSEventObj) => any; + oncuechange: (ev: Event) => any; + spellcheck: boolean; + classList: DOMTokenList; + onmsmanipulationstatechanged: (ev: any) => any; + draggable: boolean; + dataset: DOMStringMap; + dragDrop(): boolean; + scrollIntoView(top?: boolean): void; + addFilter(filter: any): void; + setCapture(containerCapture?: boolean): void; + focus(): void; + getAdjacentText(where: string): string; + insertAdjacentText(where: string, text: string): void; + getElementsByClassName(classNames: string): NodeList; + setActive(): void; + removeFilter(filter: any): void; + blur(): void; + clearAttributes(): void; + releaseCapture(): void; + createControlRange(): ControlRangeCollection; + removeBehavior(cookie: number): boolean; + contains(child: HTMLElement): boolean; + click(): void; + insertAdjacentElement(position: string, insertedElement: Element): Element; + mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; + replaceAdjacentText(where: string, newText: string): string; + applyElement(apply: Element, where?: string): Element; + addBehavior(bstrUrl: string, factory?: any): number; + insertAdjacentHTML(where: string, html: string): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + */ + compatible: MSCompatibleInfoCollection; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollection; + /** + * Fires when the user presses the F1 key while the browser is the active window. + * @param ev The event. + */ + onhelp: (ev: Event) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Fires for an element just prior to setting focus on that element. + * @param ev The focus event + */ + onfocusin: (ev: FocusEvent) => any; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + security: string; + /** + * Contains the title of the document. + */ + title: string; + /** + * Retrieves a collection of namespace objects. + */ + namespaces: MSNamespaceInfoCollection; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + styleSheets: StyleSheetList; + /** + * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. + */ + frames: Window; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Returns a reference to the collection of elements contained by the object. + */ + all: HTMLCollection; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollection; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (ev: Event) => any; + /** + * Fires when the data set exposed by a data source object changes. + * @param ev The event. + */ + ondatasetchanged: (ev: MSEventObj) => any; + /** + * Fires when rows are about to be deleted from the recordset. + * @param ev The event + */ + onrowsdelete: (ev: MSEventObj) => any; + Script: MSScriptHost; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + URLUnencoded: string; + defaultView: Window; + /** + * Fires when the user is about to make a control selection of the object. + * @param ev The event. + */ + oncontrolselect: (ev: MSEventObj) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + activeElement: Element; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (ev: Event) => any; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Retrieves an autogenerated, unique identifier for the object. + */ + uniqueID: string; + /** + * Sets or gets the URL for the current document. + */ + URL: string; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + head: HTMLHeadElement; + cookie: string; + xmlEncoding: string; + oncanplaythrough: (ev: Event) => any; + /** + * Retrieves the document compatibility mode of the document. + */ + documentMode: number; + characterSet: string; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + onbeforeupdate: (ev: MSEventObj) => any; + /** + * Fires to indicate that all data is available from the data source object. + * @param ev The event. + */ + ondatasetcomplete: (ev: MSEventObj) => any; + plugins: HTMLCollection; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (ev: Event) => any; + /** + * Gets the root svg element in the document hierarchy. + */ + rootElement: SVGSVGElement; + /** + * Retrieves a value that indicates the current state of the object. + */ + readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + referrer: string; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Fires on a databound object when an error occurs while updating the associated data in the data source object. + * @param ev The event. + */ + onerrorupdate: (ev: MSEventObj) => any; + /** + * Gets a reference to the container object of the window. + */ + parentWindow: Window; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Fires when data changes in the data provider. + * @param ev The event. + */ + oncellchange: (ev: MSEventObj) => any; + /** + * Fires just before the data source control changes the current row in the object. + * @param ev The event. + */ + onrowexit: (ev: MSEventObj) => any; + /** + * Fires just after new rows are inserted in the current recordset. + * @param ev The event. + */ + onrowsinserted: (ev: MSEventObj) => any; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string; + msCapsLockWarningOff: boolean; + /** + * Fires when a property changes on the object. + * @param ev The event. + */ + onpropertychange: (ev: MSEventObj) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (ev: DragEvent) => any; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (ev: DragEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (ev: MouseEvent) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + xmlStandalone: boolean; + /** + * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. + */ + selection: MSSelection; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. + * @param ev The event. + */ + onbeforeeditfocus: (ev: MSEventObj) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (ev: MouseEvent) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + media: string; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: ErrorEvent) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: UIEvent) => any; + /** + * Fires for the current element with focus immediately after moving focus to another element. + * @param ev The event. + */ + onfocusout: (ev: FocusEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (ev: Event) => any; + /** + * Fires when a local DOM Storage area is written to disk. + * @param ev The event. + */ + onstoragecommit: (ev: StorageEvent) => any; + /** + * Fires periodically as data arrives from data source objects that asynchronously transmit their data. + * @param ev The event. + */ + ondataavailable: (ev: MSEventObj) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: Event) => any; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Fires to indicate that the current row has changed in the data source and new data values are available on the object. + * @param ev The event. + */ + onrowenter: (ev: MSEventObj) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + oninput: (ev: Event) => any; + onmspointerdown: (ev: any) => any; + msHidden: boolean; + msVisibilityState: string; + onmsgesturedoubletap: (ev: any) => any; + visibilityState: string; + onmsmanipulationstatechanged: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmscontentzoom: (ev: MSEventObj) => any; + onmspointermove: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + msCSSOMElementFloatMetrics: boolean; + onmspointerover: (ev: any) => any; + hidden: boolean; + onmspointerup: (ev: any) => any; + msFullscreenEnabled: boolean; + onmsfullscreenerror: (ev: any) => any; + onmspointerenter: (ev: any) => any; + msFullscreenElement: Element; + onmsfullscreenchange: (ev: any) => any; + onmspointerleave: (ev: any) => any; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + adoptNode(source: Node): Node; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + createCDATASection(data: string): CDATASection; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: "a"): HTMLAnchorElement; + createElement(tagName: "abbr"): HTMLPhraseElement; + createElement(tagName: "acronym"): HTMLPhraseElement; + createElement(tagName: "address"): HTMLBlockElement; + createElement(tagName: "applet"): HTMLAppletElement; + createElement(tagName: "area"): HTMLAreaElement; + createElement(tagName: "article"): HTMLElement; + createElement(tagName: "aside"): HTMLElement; + createElement(tagName: "audio"): HTMLAudioElement; + createElement(tagName: "b"): HTMLPhraseElement; + createElement(tagName: "base"): HTMLBaseElement; + createElement(tagName: "basefont"): HTMLBaseFontElement; + createElement(tagName: "bdo"): HTMLPhraseElement; + createElement(tagName: "bgsound"): HTMLBGSoundElement; + createElement(tagName: "big"): HTMLPhraseElement; + createElement(tagName: "blockquote"): HTMLBlockElement; + createElement(tagName: "body"): HTMLBodyElement; + createElement(tagName: "br"): HTMLBRElement; + createElement(tagName: "button"): HTMLButtonElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: "caption"): HTMLTableCaptionElement; + createElement(tagName: "center"): HTMLBlockElement; + createElement(tagName: "cite"): HTMLPhraseElement; + createElement(tagName: "code"): HTMLPhraseElement; + createElement(tagName: "col"): HTMLTableColElement; + createElement(tagName: "colgroup"): HTMLTableColElement; + createElement(tagName: "datalist"): HTMLDataListElement; + createElement(tagName: "dd"): HTMLDDElement; + createElement(tagName: "del"): HTMLModElement; + createElement(tagName: "dfn"): HTMLPhraseElement; + createElement(tagName: "dir"): HTMLDirectoryElement; + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "dl"): HTMLDListElement; + createElement(tagName: "dt"): HTMLDTElement; + createElement(tagName: "em"): HTMLPhraseElement; + createElement(tagName: "embed"): HTMLEmbedElement; + createElement(tagName: "fieldset"): HTMLFieldSetElement; + createElement(tagName: "figcaption"): HTMLElement; + createElement(tagName: "figure"): HTMLElement; + createElement(tagName: "font"): HTMLFontElement; + createElement(tagName: "footer"): HTMLElement; + createElement(tagName: "form"): HTMLFormElement; + createElement(tagName: "frame"): HTMLFrameElement; + createElement(tagName: "frameset"): HTMLFrameSetElement; + createElement(tagName: "h1"): HTMLHeadingElement; + createElement(tagName: "h2"): HTMLHeadingElement; + createElement(tagName: "h3"): HTMLHeadingElement; + createElement(tagName: "h4"): HTMLHeadingElement; + createElement(tagName: "h5"): HTMLHeadingElement; + createElement(tagName: "h6"): HTMLHeadingElement; + createElement(tagName: "head"): HTMLHeadElement; + createElement(tagName: "header"): HTMLElement; + createElement(tagName: "hgroup"): HTMLElement; + createElement(tagName: "hr"): HTMLHRElement; + createElement(tagName: "html"): HTMLHtmlElement; + createElement(tagName: "i"): HTMLPhraseElement; + createElement(tagName: "iframe"): HTMLIFrameElement; + createElement(tagName: "img"): HTMLImageElement; + createElement(tagName: "input"): HTMLInputElement; + createElement(tagName: "ins"): HTMLModElement; + createElement(tagName: "isindex"): HTMLIsIndexElement; + createElement(tagName: "kbd"): HTMLPhraseElement; + createElement(tagName: "keygen"): HTMLBlockElement; + createElement(tagName: "label"): HTMLLabelElement; + createElement(tagName: "legend"): HTMLLegendElement; + createElement(tagName: "li"): HTMLLIElement; + createElement(tagName: "link"): HTMLLinkElement; + createElement(tagName: "listing"): HTMLBlockElement; + createElement(tagName: "map"): HTMLMapElement; + createElement(tagName: "mark"): HTMLElement; + createElement(tagName: "marquee"): HTMLMarqueeElement; + createElement(tagName: "menu"): HTMLMenuElement; + createElement(tagName: "meta"): HTMLMetaElement; + createElement(tagName: "nav"): HTMLElement; + createElement(tagName: "nextid"): HTMLNextIdElement; + createElement(tagName: "nobr"): HTMLPhraseElement; + createElement(tagName: "noframes"): HTMLElement; + createElement(tagName: "noscript"): HTMLElement; + createElement(tagName: "object"): HTMLObjectElement; + createElement(tagName: "ol"): HTMLOListElement; + createElement(tagName: "optgroup"): HTMLOptGroupElement; + createElement(tagName: "option"): HTMLOptionElement; + createElement(tagName: "p"): HTMLParagraphElement; + createElement(tagName: "param"): HTMLParamElement; + createElement(tagName: "plaintext"): HTMLBlockElement; + createElement(tagName: "pre"): HTMLPreElement; + createElement(tagName: "progress"): HTMLProgressElement; + createElement(tagName: "q"): HTMLQuoteElement; + createElement(tagName: "rt"): HTMLPhraseElement; + createElement(tagName: "ruby"): HTMLPhraseElement; + createElement(tagName: "s"): HTMLPhraseElement; + createElement(tagName: "samp"): HTMLPhraseElement; + createElement(tagName: "script"): HTMLScriptElement; + createElement(tagName: "section"): HTMLElement; + createElement(tagName: "select"): HTMLSelectElement; + createElement(tagName: "small"): HTMLPhraseElement; + createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "strike"): HTMLPhraseElement; + createElement(tagName: "strong"): HTMLPhraseElement; + createElement(tagName: "style"): HTMLStyleElement; + createElement(tagName: "sub"): HTMLPhraseElement; + createElement(tagName: "sup"): HTMLPhraseElement; + createElement(tagName: "table"): HTMLTableElement; + createElement(tagName: "tbody"): HTMLTableSectionElement; + createElement(tagName: "td"): HTMLTableDataCellElement; + createElement(tagName: "textarea"): HTMLTextAreaElement; + createElement(tagName: "tfoot"): HTMLTableSectionElement; + createElement(tagName: "th"): HTMLTableHeaderCellElement; + createElement(tagName: "thead"): HTMLTableSectionElement; + createElement(tagName: "title"): HTMLTitleElement; + createElement(tagName: "tr"): HTMLTableRowElement; + createElement(tagName: "track"): HTMLTrackElement; + createElement(tagName: "tt"): HTMLPhraseElement; + createElement(tagName: "u"): HTMLPhraseElement; + createElement(tagName: "ul"): HTMLUListElement; + createElement(tagName: "var"): HTMLPhraseElement; + createElement(tagName: "video"): HTMLVideoElement; + createElement(tagName: "wbr"): HTMLElement; + createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; + createElement(tagName: "xmp"): HTMLBlockElement; + createElement(tagName: string): HTMLElement; + /** + * Removes mouse capture from the object in the current document. + */ + releaseCapture(): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + createElementNS(namespaceURI: string, qualifiedName: string): Element; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): any; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + getElementsByClassName(classNames: string): NodeList; + importNode(importedNode: Node, deep: boolean): Node; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Fires a specified event on the object. + * @param eventName Specifies the name of the event to fire. + * @param eventObj Object that specifies the event object from which to obtain event object properties. + */ + fireEvent(eventName: string, eventObj?: any): boolean; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates a style sheet for the document. + * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. + * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. + */ + createStyleSheet(href?: string, index?: number): CSSStyleSheet; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; + /** + * Generates an event object to pass event context information when you use the fireEvent method. + * @param eventObj An object that specifies an existing event object on which to base the new object. + */ + createEventObject(eventObj?: any): MSEventObj; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + clear(): void; + msExitFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Document: { + prototype: Document; + new(): Document; +} + +interface Console { + info(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + profile(reportName?: string): void; + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + clear(): void; + dir(value?: any, ...optionalParams: any[]): void; + profileEnd(): void; + count(countTitle?: string): void; + groupEnd(): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + group(groupTitle?: string): void; + dirxml(value: any): void; + debug(message?: string, ...optionalParams: any[]): void; + groupCollapsed(groupTitle?: string): void; + select(element: Element): void; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface MSEventObj extends Event { + nextPage: string; + keyCode: number; + toElement: Element; + returnValue: any; + dataFld: string; + y: number; + dataTransfer: DataTransfer; + propertyName: string; + url: string; + offsetX: number; + recordset: any; + screenX: number; + buttonID: number; + wheelDelta: number; + reason: number; + origin: string; + data: string; + srcFilter: any; + boundElements: HTMLCollection; + cancelBubble: boolean; + altLeft: boolean; + behaviorCookie: number; + bookmarks: BookmarkCollection; + type: string; + repeat: boolean; + srcElement: Element; + source: Window; + fromElement: Element; + offsetY: number; + x: number; + behaviorPart: number; + qualifier: string; + altKey: boolean; + ctrlKey: boolean; + clientY: number; + shiftKey: boolean; + shiftLeft: boolean; + contentOverflow: boolean; + screenY: number; + ctrlLeft: boolean; + button: number; + srcUrn: string; + clientX: number; + actionURL: string; + getAttribute(strAttributeName: string, lFlags?: number): any; + setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; + removeAttribute(strAttributeName: string, lFlags?: number): boolean; +} +declare var MSEventObj: { + prototype: MSEventObj; + new(): MSEventObj; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: string, ...args: any[]): any; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; +} +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { + ondragend: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + ondragover: (ev: DragEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + screenX: number; + onmouseover: (ev: MouseEvent) => any; + ondragleave: (ev: DragEvent) => any; + history: History; + pageXOffset: number; + name: string; + onafterprint: (ev: Event) => any; + onpause: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + top: Window; + onmousedown: (ev: MouseEvent) => any; + onseeked: (ev: Event) => any; + opener: Window; + onclick: (ev: MouseEvent) => any; + innerHeight: number; + onwaiting: (ev: Event) => any; + ononline: (ev: Event) => any; + ondurationchange: (ev: Event) => any; + frames: Window; + onblur: (ev: FocusEvent) => any; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + outerWidth: number; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + innerWidth: number; + onoffline: (ev: Event) => any; + length: number; + screen: Screen; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onratechange: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onloadstart: (ev: Event) => any; + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + self: Window; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + pageYOffset: number; + oncontextmenu: (ev: MouseEvent) => any; + onchange: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onplay: (ev: Event) => any; + onerror: ErrorEventHandler; + onplaying: (ev: Event) => any; + parent: Window; + location: Location; + oncanplaythrough: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onreadystatechange: (ev: Event) => any; + outerHeight: number; + onkeypress: (ev: KeyboardEvent) => any; + frameElement: Element; + onloadeddata: (ev: Event) => any; + onsuspend: (ev: Event) => any; + window: Window; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onselect: (ev: UIEvent) => any; + navigator: Navigator; + styleMedia: StyleMedia; + ondrop: (ev: DragEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onended: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onunload: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + screenY: number; + onmousewheel: (ev: MouseWheelEvent) => any; + onload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + oninput: (ev: Event) => any; + performance: Performance; + onmspointerdown: (ev: any) => any; + animationStartTime: number; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + msAnimationStartTime: number; + applicationCache: ApplicationCache; + onmsinertiastart: (ev: any) => any; + onmspointerover: (ev: any) => any; + onpopstate: (ev: PopStateEvent) => any; + onmspointerup: (ev: any) => any; + onpageshow: (ev: PageTransitionEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + devicePixelRatio: number; + msCrypto: Crypto; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + doNotTrack: string; + onmspointerenter: (ev: any) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onmspointerleave: (ev: any) => any; + alert(message?: any): void; + scroll(x?: number, y?: number): void; + focus(): void; + scrollTo(x?: number, y?: number): void; + print(): void; + prompt(message?: string, _default?: string): string; + toString(): string; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + scrollBy(x?: number, y?: number): void; + confirm(message?: string): boolean; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; + showModalDialog(url?: string, argument?: any, options?: any): any; + blur(): void; + getSelection(): Selection; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + msCancelRequestAnimationFrame(handle: number): void; + matchMedia(mediaQuery: string): MediaQueryList; + cancelAnimationFrame(handle: number): void; + msIsStaticHTML(html: string): boolean; + msMatchMedia(mediaQuery: string): MediaQueryList; + requestAnimationFrame(callback: FrameRequestCallback): number; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Window: { + prototype: Window; + new(): Window; +} + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; + product: string; + vendor: string; +} + +interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Retrieves a collection of all cells in the table row or in the entire table. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; +} +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface TreeWalker { + whatToShow: number; + filter: NodeFilter; + root: Node; + currentNode: Node; + expandEntityReferences: boolean; + previousSibling(): Node; + lastChild(): Node; + nextSibling(): Node; + nextNode(): Node; + parentNode(): Node; + firstChild(): Node; + previousNode(): Node; +} +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + getEntriesByType(entryType: string): any; + toJSON(): any; + getMeasures(measureName?: string): any; + clearMarks(markName?: string): void; + getMarks(markName?: string): any; + clearResourceTimings(): void; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + getEntriesByName(name: string, entryType?: string): any; + getEntries(): any; + clearMeasures(measureName?: string): void; + setResourceTimingBufferSize(maxSize: number): void; + now(): number; +} +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface MSDataBindingTableExtensions { + dataPageSize: number; + nextPage(): void; + firstPage(): void; + refresh(): void; + previousPage(): void; + lastPage(): void; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} +declare var CompositionEvent: { + prototype: CompositionEvent; + new(): CompositionEvent; +} + +interface WindowTimers extends WindowTimersExtension { + clearTimeout(handle: number): void; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; + clearInterval(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { + orientType: SVGAnimatedEnumeration; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + markerHeight: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + refY: SVGAnimatedLength; + refX: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} + +interface CSSStyleDeclaration { + backgroundAttachment: string; + visibility: string; + textAlignLast: string; + borderRightStyle: string; + counterIncrement: string; + orphans: string; + cssText: string; + borderStyle: string; + pointerEvents: string; + borderTopColor: string; + markerEnd: string; + textIndent: string; + listStyleImage: string; + cursor: string; + listStylePosition: string; + wordWrap: string; + borderTopStyle: string; + alignmentBaseline: string; + opacity: string; + direction: string; + strokeMiterlimit: string; + maxWidth: string; + color: string; + clip: string; + borderRightWidth: string; + verticalAlign: string; + overflow: string; + mask: string; + borderLeftStyle: string; + emptyCells: string; + stopOpacity: string; + paddingRight: string; + parentRule: CSSRule; + background: string; + boxSizing: string; + textJustify: string; + height: string; + paddingTop: string; + length: number; + right: string; + baselineShift: string; + borderLeft: string; + widows: string; + lineHeight: string; + left: string; + textUnderlinePosition: string; + glyphOrientationHorizontal: string; + display: string; + textAnchor: string; + cssFloat: string; + strokeDasharray: string; + rubyAlign: string; + fontSizeAdjust: string; + borderLeftColor: string; + backgroundImage: string; + listStyleType: string; + strokeWidth: string; + textOverflow: string; + fillRule: string; + borderBottomColor: string; + zIndex: string; + position: string; + listStyle: string; + msTransformOrigin: string; + dominantBaseline: string; + overflowY: string; + fill: string; + captionSide: string; + borderCollapse: string; + boxShadow: string; + quotes: string; + tableLayout: string; + unicodeBidi: string; + borderBottomWidth: string; + backgroundSize: string; + textDecoration: string; + strokeDashoffset: string; + fontSize: string; + border: string; + pageBreakBefore: string; + borderTopRightRadius: string; + msTransform: string; + borderBottomLeftRadius: string; + textTransform: string; + rubyPosition: string; + strokeLinejoin: string; + clipPath: string; + borderRightColor: string; + fontFamily: string; + clear: string; + content: string; + backgroundClip: string; + marginBottom: string; + counterReset: string; + outlineWidth: string; + marginRight: string; + paddingLeft: string; + borderBottom: string; + wordBreak: string; + marginTop: string; + top: string; + fontWeight: string; + borderRight: string; + width: string; + kerning: string; + pageBreakAfter: string; + borderBottomStyle: string; + fontStretch: string; + padding: string; + strokeOpacity: string; + markerStart: string; + bottom: string; + borderLeftWidth: string; + clipRule: string; + backgroundPosition: string; + backgroundColor: string; + pageBreakInside: string; + backgroundOrigin: string; + strokeLinecap: string; + borderTopWidth: string; + outlineStyle: string; + borderTop: string; + outlineColor: string; + paddingBottom: string; + marginLeft: string; + font: string; + outline: string; + wordSpacing: string; + maxHeight: string; + fillOpacity: string; + letterSpacing: string; + borderSpacing: string; + backgroundRepeat: string; + borderRadius: string; + borderWidth: string; + borderBottomRightRadius: string; + whiteSpace: string; + fontStyle: string; + minWidth: string; + stopColor: string; + borderTopLeftRadius: string; + borderColor: string; + marker: string; + glyphOrientationVertical: string; + markerMid: string; + fontVariant: string; + minHeight: string; + stroke: string; + rubyOverhang: string; + overflowX: string; + textAlign: string; + margin: string; + animationFillMode: string; + floodColor: string; + animationIterationCount: string; + textShadow: string; + backfaceVisibility: string; + msAnimationIterationCount: string; + animationDelay: string; + animationTimingFunction: string; + columnWidth: any; + msScrollSnapX: string; + columnRuleColor: any; + columnRuleWidth: any; + transitionDelay: string; + transition: string; + msFlowFrom: string; + msScrollSnapType: string; + msContentZoomSnapType: string; + msGridColumns: string; + msAnimationName: string; + msGridRowAlign: string; + msContentZoomChaining: string; + msGridColumn: any; + msHyphenateLimitZone: any; + msScrollRails: string; + msAnimationDelay: string; + enableBackground: string; + msWrapThrough: string; + columnRuleStyle: string; + msAnimation: string; + msFlexFlow: string; + msScrollSnapY: string; + msHyphenateLimitLines: any; + msTouchAction: string; + msScrollLimit: string; + animation: string; + transform: string; + filter: string; + colorInterpolationFilters: string; + transitionTimingFunction: string; + msBackfaceVisibility: string; + animationPlayState: string; + transformOrigin: string; + msScrollLimitYMin: any; + msFontFeatureSettings: string; + msContentZoomLimitMin: any; + columnGap: any; + transitionProperty: string; + msAnimationDuration: string; + msAnimationFillMode: string; + msFlexDirection: string; + msTransitionDuration: string; + fontFeatureSettings: string; + breakBefore: string; + msFlexWrap: string; + perspective: string; + msFlowInto: string; + msTransformStyle: string; + msScrollTranslation: string; + msTransitionProperty: string; + msUserSelect: string; + msOverflowStyle: string; + msScrollSnapPointsY: string; + animationDirection: string; + animationDuration: string; + msFlex: string; + msTransitionTimingFunction: string; + animationName: string; + columnRule: string; + msGridColumnSpan: any; + msFlexNegative: string; + columnFill: string; + msGridRow: any; + msFlexOrder: string; + msFlexItemAlign: string; + msFlexPositive: string; + msContentZoomLimitMax: any; + msScrollLimitYMax: any; + msGridColumnAlign: string; + perspectiveOrigin: string; + lightingColor: string; + columns: string; + msScrollChaining: string; + msHyphenateLimitChars: string; + msTouchSelect: string; + floodOpacity: string; + msAnimationDirection: string; + msAnimationPlayState: string; + columnSpan: string; + msContentZooming: string; + msPerspective: string; + msFlexPack: string; + msScrollSnapPointsX: string; + msContentZoomSnapPoints: string; + msGridRowSpan: any; + msContentZoomSnap: string; + msScrollLimitXMin: any; + breakInside: string; + msHighContrastAdjust: string; + msFlexLinePack: string; + msGridRows: string; + transitionDuration: string; + msHyphens: string; + breakAfter: string; + msTransition: string; + msPerspectiveOrigin: string; + msContentZoomLimit: string; + msScrollLimitXMax: any; + msFlexAlign: string; + msWrapMargin: any; + columnCount: any; + msAnimationTimingFunction: string; + msTransitionDelay: string; + transformStyle: string; + msWrapFlow: string; + msFlexPreferredSize: string; + alignItems: string; + borderImageSource: string; + flexBasis: string; + borderImageWidth: string; + borderImageRepeat: string; + order: string; + flex: string; + alignContent: string; + msImeAlign: string; + flexShrink: string; + flexGrow: string; + borderImageSlice: string; + flexWrap: string; + borderImageOutset: string; + flexDirection: string; + touchAction: string; + flexFlow: string; + borderImage: string; + justifyContent: string; + alignSelf: string; + msTextCombineHorizontal: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + removeProperty(propertyName: string): string; + item(index: number): string; + [index: number]: string; + setProperty(propertyName: string, value: string, priority?: string): void; +} +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface MSStyleCSSProperties extends MSCSSProperties { + pixelWidth: number; + posHeight: number; + posLeft: number; + pixelTop: number; + pixelBottom: number; + textDecorationNone: boolean; + pixelLeft: number; + posTop: number; + posBottom: number; + textDecorationOverline: boolean; + posWidth: number; + textDecorationLineThrough: boolean; + pixelHeight: number; + textDecorationBlink: boolean; + posRight: number; + pixelRight: number; + textDecorationUnderline: boolean; +} +declare var MSStyleCSSProperties: { + prototype: MSStyleCSSProperties; + new(): MSStyleCSSProperties; +} + +interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { + msMaxTouchPoints: number; + msPointerEnabled: boolean; + msManipulationViewsEnabled: boolean; + pointerEnabled: boolean; + maxTouchPoints: number; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; +} +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGZoomEvent extends UIEvent { + zoomRectScreen: SVGRect; + previousScale: number; + newScale: number; + previousTranslate: SVGPoint; + newTranslate: SVGPoint; +} +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface NodeSelector { + querySelectorAll(selectors: string): NodeList; + querySelector(selectors: string): Element; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; +} +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface ClientRect { + left: number; + width: number; + right: number; + top: number; + bottom: number; + height: number; +} +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface PositionErrorCallback { + (error: PositionError): void; +} + +interface DOMImplementation { + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + hasFeature(feature: string, version?: string): boolean; + createHTMLDocument(title: string): Document; +} +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { + scrollTop: number; + clientLeft: number; + scrollLeft: number; + tagName: string; + clientWidth: number; + scrollWidth: number; + clientHeight: number; + clientTop: number; + scrollHeight: number; + msRegionOverflow: string; + onmspointerdown: (ev: any) => any; + onmsgotpointercapture: (ev: any) => any; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + onmslostpointercapture: (ev: any) => any; + onmspointerover: (ev: any) => any; + msContentZoomFactor: number; + onmspointerup: (ev: any) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmspointerenter: (ev: any) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onmspointerleave: (ev: any) => any; + getAttribute(name?: string): string; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + getBoundingClientRect(): ClientRect; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + msMatchesSelector(selectors: string): boolean; + hasAttribute(name: string): boolean; + removeAttribute(name?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + getAttributeNode(name: string): Attr; + fireEvent(eventName: string, eventObj?: any): boolean; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + getClientRects(): ClientRectList; + setAttributeNode(newAttr: Attr): Attr; + removeAttributeNode(oldAttr: Attr): Attr; + setAttribute(name?: string, value?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + msGetRegionContent(): MSRangeCollection; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + setPointerCapture(pointerId: number): void; + msGetUntransformedBounds(): ClientRect; + releasePointerCapture(pointerId: number): void; + msRequestFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Element: { + prototype: Element; + new(): Element; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; +} +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Removes an element from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: any): void; +} +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface Node extends EventTarget { + nodeType: number; + previousSibling: Node; + localName: string; + namespaceURI: string; + textContent: string; + parentNode: Node; + nextSibling: Node; + nodeValue: string; + lastChild: Node; + childNodes: NodeList; + nodeName: string; + ownerDocument: Document; + attributes: NamedNodeMap; + firstChild: Node; + prefix: string; + removeChild(oldChild: Node): Node; + appendChild(newChild: Node): Node; + isSupported(feature: string, version: string): boolean; + isEqualNode(arg: Node): boolean; + lookupPrefix(namespaceURI: string): string; + isDefaultNamespace(namespaceURI: string): boolean; + compareDocumentPosition(other: Node): number; + normalize(): void; + isSameNode(other: Node): boolean; + hasAttributes(): boolean; + lookupNamespaceURI(prefix: string): string; + cloneNode(deep?: boolean): Node; + hasChildNodes(): boolean; + replaceChild(newChild: Node, oldChild: Node): Node; + insertBefore(newChild: Node, refChild?: Node): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} +declare var Node: { + prototype: Node; + new(): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface DOML2DeprecatedListSpaceReduction { + compact: boolean; +} + +interface MSScriptHost { +} +declare var MSScriptHost: { + prototype: MSScriptHost; + new(): MSScriptHost; +} + +interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + clipPathUnits: SVGAnimatedEnumeration; +} +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface MouseEvent extends UIEvent { + toElement: Element; + layerY: number; + fromElement: Element; + which: number; + pageX: number; + offsetY: number; + x: number; + y: number; + metaKey: boolean; + altKey: boolean; + ctrlKey: boolean; + offsetX: number; + screenX: number; + clientY: number; + shiftKey: boolean; + layerX: number; + screenY: number; + relatedTarget: EventTarget; + button: number; + pageY: number; + buttons: number; + clientX: number; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; + getModifierState(keyArg: string): boolean; +} +declare var MouseEvent: { + prototype: MouseEvent; + new(): MouseEvent; +} + +interface RangeException { + code: number; + message: string; + name: string; + toString(): string; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} +declare var RangeException: { + prototype: RangeException; + new(): RangeException; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + y: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + dy: SVGAnimatedLengthList; + x: SVGAnimatedLengthList; + dx: SVGAnimatedLengthList; +} +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + width: number; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + object: string; + form: HTMLFormElement; + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; +} +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface TextMetrics { + width: number; +} +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface DocumentEvent { + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "HTMLEvents"): Event; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface: "NavigationEvent"): NavigationEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PointerEvent"): MSPointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface: "TextEvent"): TextEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * The starting number. + */ + start: number; +} +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface CDATASection extends Text { +} +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface StyleMedia { + type: string; + matchMedium(mediaquery: string): boolean; +} +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { + options: HTMLSelectElement; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: any): void; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface TextRange { + boundingLeft: number; + htmlText: string; + offsetLeft: number; + boundingWidth: number; + boundingHeight: number; + boundingTop: number; + text: string; + offsetTop: number; + moveToPoint(x: number, y: number): void; + queryCommandValue(cmdID: string): any; + getBookmark(): string; + move(unit: string, count?: number): number; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(fStart?: boolean): void; + findText(string: string, count?: number, flags?: number): boolean; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + getBoundingClientRect(): ClientRect; + moveToBookmark(bookmark: string): boolean; + isEqual(range: TextRange): boolean; + duplicate(): TextRange; + collapse(start?: boolean): void; + queryCommandText(cmdID: string): string; + select(): void; + pasteHTML(html: string): void; + inRange(range: TextRange): boolean; + moveEnd(unit: string, count?: number): number; + getClientRects(): ClientRectList; + moveStart(unit: string, count?: number): number; + parentElement(): Element; + queryCommandState(cmdID: string): boolean; + compareEndPoints(how: string, sourceRange: TextRange): number; + execCommandShowHelp(cmdID: string): boolean; + moveToElementText(element: Element): void; + expand(Unit: string): boolean; + queryCommandSupported(cmdID: string): boolean; + setEndPoint(how: string, SourceRange: TextRange): void; + queryCommandEnabled(cmdID: string): boolean; +} +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface SVGTests { + requiredFeatures: SVGStringList; + requiredExtensions: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface CSSStyleSheet extends StyleSheet { + owningElement: Element; + imports: StyleSheetList; + isAlternate: boolean; + rules: MSCSSRuleList; + isPrefAlternate: boolean; + readOnly: boolean; + cssText: string; + ownerRule: CSSRule; + href: string; + cssRules: CSSRuleList; + id: string; + pages: StyleSheetPageList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + insertRule(rule: string, index?: number): number; + removeRule(lIndex: number): void; + deleteRule(index?: number): void; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + removeImport(lIndex: number): void; +} +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface MSSelection { + type: string; + typeDetail: string; + createRange(): TextRange; + clear(): void; + createRangeCollection(): TextRangeCollection; + empty(): void; +} +declare var MSSelection: { + prototype: MSSelection; + new(): MSSelection; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; +} +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { + patternUnits: SVGAnimatedEnumeration; + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + height: SVGAnimatedLength; +} +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface Selection { + isCollapsed: boolean; + anchorNode: Node; + focusNode: Node; + anchorOffset: number; + focusOffset: number; + rangeCount: number; + addRange(range: Range): void; + collapseToEnd(): void; + toString(): string; + selectAllChildren(parentNode: Node): void; + getRangeAt(index: number): Range; + collapse(parentNode: Node, offset: number): void; + removeAllRanges(): void; + collapseToStart(): void; + deleteFromDocument(): void; + removeRange(range: Range): void; +} +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; +} +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; +} + +interface MSDataBindingRecordSetReadonlyExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface CSSStyleRule extends CSSRule { + selectorText: string; + style: MSStyleCSSProperties; + readOnly: boolean; +} +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface NodeIterator { + whatToShow: number; + filter: NodeFilter; + root: Node; + expandEntityReferences: boolean; + nextNode(): Node; + detach(): void; + previousNode(): Node; +} +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { + viewTarget: SVGStringList; +} +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; +} +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getTransformToElement(element: SVGElement): SVGMatrix; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; +} +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface ControlRangeCollection { + length: number; + queryCommandValue(cmdID: string): any; + remove(index: number): void; + add(item: Element): void; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(varargStart?: any): void; + item(index: number): Element; + [index: number]: Element; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + addElement(item: Element): void; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandEnabled(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + select(): void; +} +declare var ControlRangeCollection: { + prototype: ControlRangeCollection; + new(): ControlRangeCollection; +} + +interface MSNamespaceInfo extends MSEventAttachmentTarget { + urn: string; + onreadystatechange: (ev: Event) => any; + name: string; + readyState: string; + doImport(implementationUrl: string): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSNamespaceInfo: { + prototype: MSNamespaceInfo; + new(): MSNamespaceInfo; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; +} +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; +} +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { + type: string; +} +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface SVGFitToViewBox { + viewBox: SVGAnimatedRect; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} + +interface SVGPointList { + numberOfItems: number; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; + getItem(index: number): SVGPoint; + clear(): void; + appendItem(newItem: SVGPoint): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + removeItem(index: number): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; +} +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface MSSiteModeEvent extends Event { + buttonID: number; + actionURL: string; +} +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface DOML2DeprecatedTextFlowControl { + clear: string; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface MSCSSProperties extends CSSStyleDeclaration { + scrollbarShadowColor: string; + scrollbarHighlightColor: string; + layoutGridChar: string; + layoutGridType: string; + textAutospace: string; + textKashidaSpace: string; + writingMode: string; + scrollbarFaceColor: string; + backgroundPositionY: string; + lineBreak: string; + imeMode: string; + msBlockProgression: string; + layoutGridLine: string; + scrollbarBaseColor: string; + layoutGrid: string; + layoutFlow: string; + textKashida: string; + filter: string; + zoom: string; + scrollbarArrowColor: string; + behavior: string; + backgroundPositionX: string; + accelerator: string; + layoutGridMode: string; + textJustifyTrim: string; + scrollbar3dLightColor: string; + msInterpolationMode: string; + scrollbarTrackColor: string; + scrollbarDarkShadowColor: string; + styleFloat: string; + getAttribute(attributeName: string, flags?: number): any; + setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; + removeAttribute(attributeName: string, flags?: number): boolean; +} +declare var MSCSSProperties: { + prototype: MSCSSProperties; + new(): MSCSSProperties; +} + +interface HTMLCollection extends MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Contains the hypertext reference (HREF) of the URL. + */ + href: string; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + crossOrigin: string; + msPlayToPreferredSourceUri: string; +} +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface SVGAngle { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} + +interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + msKeySystem: string; +} +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface KeyboardEvent extends UIEvent { + location: number; + keyCode: number; + shiftKey: boolean; + which: number; + locale: string; + key: string; + altKey: boolean; + metaKey: boolean; + char: string; + ctrlKey: boolean; + repeat: boolean; + charCode: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(): KeyboardEvent; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} + +interface MessageEvent extends Event { + source: Window; + origin: string; + data: any; + ports: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface SVGElement extends Element { + onmouseover: (ev: MouseEvent) => any; + viewportElement: SVGElement; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onfocusin: (ev: FocusEvent) => any; + xmlbase: string; + onmousedown: (ev: MouseEvent) => any; + onload: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + id: string; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface HTMLScriptElement extends HTMLElement { + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + async: boolean; +} +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLElement; +} +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface CanvasRenderingContext2D { + miterLimit: number; + font: string; + globalCompositeOperation: string; + msFillRule: string; + lineCap: string; + msImageSmoothingEnabled: boolean; + lineDashOffset: number; + shadowColor: string; + lineJoin: string; + shadowOffsetX: number; + lineWidth: number; + canvas: HTMLCanvasElement; + strokeStyle: any; + globalAlpha: number; + shadowOffsetY: number; + fillStyle: any; + shadowBlur: number; + textAlign: string; + textBaseline: string; + restore(): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + save(): void; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + measureText(text: string): TextMetrics; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + rotate(angle: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + translate(x: number, y: number): void; + scale(x: number, y: number): void; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + lineTo(x: number, y: number): void; + getLineDash(): number[]; + fill(fillRule?: string): void; + createImageData(imageDataOrSw: any, sh?: number): ImageData; + createPattern(image: HTMLElement, repetition: string): CanvasPattern; + closePath(): void; + rect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + clearRect(x: number, y: number, w: number, h: number): void; + moveTo(x: number, y: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + fillRect(x: number, y: number, w: number, h: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + setLineDash(segments: number[]): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + beginPath(): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; +} +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface MSCSSRuleList { + length: number; + item(index?: number): CSSStyleRule; + [index: number]: CSSStyleRule; +} +declare var MSCSSRuleList: { + prototype: MSCSSRuleList; + new(): MSCSSRuleList; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGTransformList { + numberOfItems: number; + getItem(index: number): SVGTransform; + consolidate(): SVGTransform; + clear(): void; + appendItem(newItem: SVGTransform): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + removeItem(index: number): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; +} +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedPoints { + points: SVGPointList; + animatedPoints: SVGPointList; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface CSSMediaRule extends CSSRule { + media: MediaList; + cssRules: CSSRuleList; + insertRule(rule: string, index?: number): number; + deleteRule(index?: number): void; +} +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface WindowModal { + dialogArguments: any; + returnValue: any; +} + +interface XMLHttpRequest extends EventTarget { + responseBody: any; + status: number; + readyState: number; + responseText: string; + responseXML: any; + ontimeout: (ev: Event) => any; + statusText: string; + onreadystatechange: (ev: Event) => any; + timeout: number; + onload: (ev: Event) => any; + response: any; + withCredentials: boolean; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + onloadstart: (ev: Event) => any; + msCaching: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + overrideMimeType(mime: string): void; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + create(): XMLHttpRequest; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { +} +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface MSDataBindingExtensions { + dataSrc: string; + dataFormatAs: string; + dataFld: string; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + ry: SVGAnimatedLength; + cx: SVGAnimatedLength; + rx: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; +} +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface HTMLFrameSetElement extends HTMLElement { + ononline: (ev: Event) => any; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + onerror: (ev: ErrorEvent) => any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + onresize: (ev: UIEvent) => any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + border: string; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onstorage: (ev: StorageEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface Screen extends EventTarget { + width: number; + deviceXDPI: number; + fontSmoothingEnabled: boolean; + bufferDepth: number; + logicalXDPI: number; + systemXDPI: number; + availHeight: number; + height: number; + logicalYDPI: number; + systemYDPI: number; + updateInterval: number; + colorDepth: number; + availWidth: number; + deviceYDPI: number; + pixelDepth: number; + msOrientation: string; + onmsorientationchange: (ev: any) => any; + msLockOrientation(orientation: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface Coordinates { + altitudeAccuracy: number; + longitude: number; + latitude: number; + speed: number; + heading: number; + altitude: number; + accuracy: number; +} +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorContentUtils { +} + +interface EventListener { + (evt: Event): void; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface DataTransfer { + effectAllowed: string; + dropEffect: string; + types: DOMStringList; + files: FileList; + clearData(format?: string): boolean; + setData(format: string, data: string): boolean; + getData(format: string): string; +} +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} +declare var FocusEvent: { + prototype: FocusEvent; + new(): FocusEvent; +} + +interface Range { + startOffset: number; + collapsed: boolean; + endOffset: number; + startContainer: Node; + endContainer: Node; + commonAncestorContainer: Node; + setStart(refNode: Node, offset: number): void; + setEndBefore(refNode: Node): void; + setStartBefore(refNode: Node): void; + selectNode(refNode: Node): void; + detach(): void; + getBoundingClientRect(): ClientRect; + toString(): string; + compareBoundaryPoints(how: number, sourceRange: Range): number; + insertNode(newNode: Node): void; + collapse(toStart: boolean): void; + selectNodeContents(refNode: Node): void; + cloneContents(): DocumentFragment; + setEnd(refNode: Node, offset: number): void; + cloneRange(): Range; + getClientRects(): ClientRectList; + surroundContents(newParent: Node): void; + deleteContents(): void; + setStartAfter(refNode: Node): void; + extractContents(): DocumentFragment; + setEndAfter(refNode: Node): void; + createContextualFragment(fragment: string): DocumentFragment; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} + +interface SVGPoint { + y: number; + x: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { + width: SVGAnimatedLength; + x: SVGAnimatedLength; + contentStyleType: string; + onzoom: (ev: any) => any; + y: SVGAnimatedLength; + viewport: SVGRect; + onerror: (ev: ErrorEvent) => any; + pixelUnitToMillimeterY: number; + onresize: (ev: UIEvent) => any; + screenPixelToMillimeterY: number; + height: SVGAnimatedLength; + onabort: (ev: UIEvent) => any; + contentScriptType: string; + pixelUnitToMillimeterX: number; + currentTranslate: SVGPoint; + onunload: (ev: Event) => any; + currentScale: number; + onscroll: (ev: UIEvent) => any; + screenPixelToMillimeterX: number; + setCurrentTime(seconds: number): void; + createSVGLength(): SVGLength; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + unpauseAnimations(): void; + createSVGRect(): SVGRect; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + unsuspendRedrawAll(): void; + pauseAnimations(): void; + suspendRedraw(maxWaitMilliseconds: number): number; + deselectAll(): void; + createSVGAngle(): SVGAngle; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + createSVGTransform(): SVGTransform; + unsuspendRedraw(suspendHandleID: number): void; + forceRedraw(): void; + getCurrentTime(): number; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + createSVGMatrix(): SVGMatrix; + createSVGPoint(): SVGPoint; + createSVGNumber(): SVGNumber; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getElementById(elementId: string): Element; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface MSResourceMetadata { + protocol: string; + fileSize: string; + fileUpdatedDate: string; + nameProp: string; + fileCreatedDate: string; + fileModifiedDate: string; + mimeType: string; +} + +interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { +} +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface MSStorageExtensions { + remainingSpace: number; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + type: string; + title: string; +} +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface MSCurrentStyleCSSProperties extends MSCSSProperties { + blockDirection: string; + clipBottom: string; + clipLeft: string; + clipRight: string; + clipTop: string; + hasLayout: string; +} +declare var MSCurrentStyleCSSProperties: { + prototype: MSCurrentStyleCSSProperties; + new(): MSCurrentStyleCSSProperties; +} + +interface MSHTMLCollectionExtensions { + urns(urn: any): any; + tags(tagName: any): any; +} + +interface Storage extends MSStorageExtensions { + length: number; + getItem(key: string): any; + [key: string]: any; + setItem(key: string, data: string): void; + clear(): void; + removeItem(key: string): void; + key(index: number): string; + [index: number]: string; +} +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + scroll: string; + ononline: (ev: Event) => any; + onblur: (ev: FocusEvent) => any; + noWrap: boolean; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + text: any; + onerror: (ev: ErrorEvent) => any; + bgProperties: string; + onresize: (ev: UIEvent) => any; + link: any; + aLink: any; + bottomMargin: any; + topMargin: any; + onafterprint: (ev: Event) => any; + vLink: any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + rightMargin: any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + leftMargin: any; + onstorage: (ev: StorageEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + createTextRange(): TextRange; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface DocumentType extends Node { + name: string; + notations: NamedNodeMap; + systemId: string; + internalSubset: string; + entities: NamedNodeMap; + publicId: string; +} +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; +} +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface MutationEvent extends Event { + newValue: string; + attrChange: number; + attrName: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface DOML2DeprecatedListNumberingAndBulletStyle { + type: string; +} + +interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + status: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + indeterminate: boolean; + readOnly: boolean; + size: number; + loop: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. + */ + vrml: string; + /** + * Sets or retrieves a lower resolution image to display. + */ + lowsrc: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + dynsrc: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + start: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + Methods: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + protocolLong: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + nameProp: string; + urn: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + type: string; + mimeType: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface PerformanceTiming { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + msFirstPaint: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + toJSON(): any; +} +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; +} +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface EventException { + code: number; + message: string; + name: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface MSNavigatorDoNotTrack { + msDoNotTrack: string; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface SVGMetadataElement extends SVGElement { +} +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGStringList { + numberOfItems: number; + replaceItem(newItem: string, index: number): string; + getItem(index: number): string; + clear(): void; + appendItem(newItem: string): string; + initialize(newItem: string): string; + removeItem(index: number): string; + insertItemBefore(newItem: string, index: number): string; +} +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface XDomainRequest { + timeout: number; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: Event) => any; + responseText: string; + contentType: string; + open(method: string, url: string): void; + abort(): void; + send(data?: any): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XDomainRequest: { + prototype: XDomainRequest; + new(): XDomainRequest; + create(): XDomainRequest; +} + +interface DOML2DeprecatedBackgroundColorStyle { + bgColor: any; +} + +interface ElementTraversal { + childElementCount: number; + previousElementSibling: Element; + lastElementChild: Element; + nextElementSibling: Element; + firstElementChild: Element; +} + +interface SVGLength { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface NavigatorStorageUtils { +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + textLength: SVGAnimatedLength; + lengthAdjust: SVGAnimatedEnumeration; + getCharNumAtPosition(point: SVGPoint): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getComputedTextLength(): number; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getEndPositionOfChar(charnum: number): SVGPoint; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface Location { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + reload(flag?: boolean): void; + replace(url: string): void; + assign(url: string): void; + toString(): string; +} +declare var Location: { + prototype: Location; + new(): Location; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; +} +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; +} +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface PerformanceEntry { + name: string; + startTime: number; + duration: number; + entryType: string; +} +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface SVGTransform { + type: number; + angle: number; + matrix: SVGMatrix; + setTranslate(tx: number, ty: number): void; + setScale(sx: number, sy: number): void; + setMatrix(matrix: SVGMatrix): void; + setSkewY(angle: number): void; + setRotate(angle: number, cx: number, cy: number): void; + setSkewX(angle: number): void; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} +declare var UIEvent: { + prototype: UIEvent; + new(): UIEvent; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} + +interface WheelEvent extends MouseEvent { + deltaZ: number; + deltaX: number; + deltaMode: number; + deltaY: number; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + getCurrentPoint(element: Element): void; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} +declare var WheelEvent: { + prototype: WheelEvent; + new(): WheelEvent; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} + +interface MSEventAttachmentTarget { + attachEvent(event: string, listener: EventListener): boolean; + detachEvent(event: string, listener: EventListener): void; +} + +interface SVGNumber { + value: number; +} +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + getTotalLength(): number; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; +} +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface MSCompatibleInfo { + version: string; + userAgent: string; +} +declare var MSCompatibleInfo: { + prototype: MSCompatibleInfo; + new(): MSCompatibleInfo; +} + +interface Text extends CharacterData, MSNodeExtensions { + wholeText: string; + splitText(offset: number): Text; + replaceWholeText(content: string): Text; +} +declare var Text: { + prototype: Text; + new(): Text; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface SVGPathSegList { + numberOfItems: number; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; + getItem(index: number): SVGPathSeg; + clear(): void; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; +} +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { +} +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface MSImageResourceExtensions { + dynsrc: string; + vrml: string; + lowsrc: string; + start: string; + loop: number; +} + +interface PositionError { + code: number; + message: string; + toString(): string; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + cellIndex: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; +} +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface SVGElementInstance extends EventTarget { + previousSibling: SVGElementInstance; + parentNode: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + childNodes: SVGElementInstanceList; + correspondingUseElement: SVGUseElement; + correspondingElement: SVGElement; + firstChild: SVGElementInstance; +} +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface MSNamespaceInfoCollection { + length: number; + add(namespace?: string, urn?: string, implementationUrl?: any): any; + item(index: any): any; + // [index: any]: any; +} +declare var MSNamespaceInfoCollection: { + prototype: MSNamespaceInfoCollection; + new(): MSNamespaceInfoCollection; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface CSSImportRule extends CSSRule { + styleSheet: CSSStyleSheet; + href: string; + media: MediaList; +} +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} +declare var CustomEvent: { + prototype: CustomEvent; + new(): CustomEvent; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; +} +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface DOML2DeprecatedMarginStyle { + vspace: number; + hspace: number; +} + +interface MSWindowModeless { + dialogTop: any; + dialogLeft: any; + dialogWidth: any; + dialogHeight: any; + menuArguments: any; +} + +interface DOML2DeprecatedAlignmentStyle { + align: string; +} + +interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { + width: string; + onbounce: (ev: Event) => any; + vspace: number; + trueSpeed: boolean; + scrollAmount: number; + scrollDelay: number; + behavior: string; + height: string; + loop: number; + direction: string; + hspace: number; + onstart: (ev: Event) => any; + onfinish: (ev: Event) => any; + stop(): void; + start(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface SVGRect { + y: number; + width: number; + x: number; + height: number; +} +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface MSNodeExtensions { + swapNode(otherNode: Node): Node; + removeNode(deep?: boolean): Node; + replaceNode(replacement: Node): Node; +} + +interface History { + length: number; + state: any; + back(distance?: any): void; + forward(distance?: any): void; + go(delta?: any): void; + replaceState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title: string, url?: string): void; +} +declare var History: { + prototype: History; + new(): History; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface TimeRanges { + length: number; + start(index: number): number; + end(index: number): number; +} +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface CSSRule { + cssText: string; + parentStyleSheet: CSSStyleSheet; + parentRule: CSSRule; + type: number; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface SVGMatrix { + e: number; + c: number; + a: number; + b: number; + d: number; + f: number; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + flipY(): SVGMatrix; + skewY(angle: number): SVGMatrix; + inverse(): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + rotate(angle: number): SVGMatrix; + flipX(): SVGMatrix; + translate(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + skewX(angle: number): SVGMatrix; +} +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface MSPopupWindow { + document: Document; + isOpen: boolean; + show(x: number, y: number, w: number, h: number, element?: any): void; + hide(): void; +} +declare var MSPopupWindow: { + prototype: MSPopupWindow; + new(): MSPopupWindow; +} + +interface BeforeUnloadEvent extends Event { + returnValue: string; +} +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + animatedInstanceRoot: SVGElementInstance; + instanceRoot: SVGElementInstance; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface Event { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + cancelBubble: boolean; + target: EventTarget; + eventPhase: number; + cancelable: boolean; + type: string; + srcElement: Element; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; +} +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface SVGException { + code: number; + message: string; + name: string; + toString(): string; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} +declare var SVGException: { + prototype: SVGException; + new(): SVGException; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + ry: SVGAnimatedLength; + rx: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface ErrorEventHandler { + (event: Event, source: string, fileno: number, columnNumber: number): void; +} + +interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface DOML2DeprecatedBorderStyle { + border: string; +} + +interface NamedNodeMap { + length: number; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + [index: number]: Attr; + removeNamedItem(name: string): Attr; + getNamedItem(name: string): Attr; + // [name: string]: Attr; + setNamedItem(arg: Attr): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItemNS(arg: Attr): Attr; +} +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface MediaList { + length: number; + mediaText: string; + deleteMedium(oldMedium: string): void; + appendMedium(newMedium: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGLengthList { + numberOfItems: number; + replaceItem(newItem: SVGLength, index: number): SVGLength; + getItem(index: number): SVGLength; + clear(): void; + appendItem(newItem: SVGLength): SVGLength; + initialize(newItem: SVGLength): SVGLength; + removeItem(index: number): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; +} +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface ProcessingInstruction extends Node { + target: string; + data: string; +} +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface MSWindowExtensions { + status: string; + onmouseleave: (ev: MouseEvent) => any; + screenLeft: number; + offscreenBuffering: any; + maxConnectionsPerServer: number; + onmouseenter: (ev: MouseEvent) => any; + clipboardData: DataTransfer; + defaultStatus: string; + clientInformation: Navigator; + closed: boolean; + onhelp: (ev: Event) => any; + external: External; + event: MSEventObj; + onfocusout: (ev: FocusEvent) => any; + screenTop: number; + onfocusin: (ev: FocusEvent) => any; + showModelessDialog(url?: string, argument?: any, options?: any): Window; + navigate(url: string): void; + resizeBy(x?: number, y?: number): void; + item(index: any): any; + resizeTo(x?: number, y?: number): void; + createPopup(arguments?: any): MSPopupWindow; + toStaticHTML(html: string): string; + execScript(code: string, language?: string): any; + msWriteProfilerMark(profilerMarkName: string): void; + moveTo(x?: number, y?: number): void; + moveBy(x?: number, y?: number): void; + showHelp(url: string, helpArg?: any, features?: string): void; + captureEvents(): void; + releaseEvents(): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSBehaviorUrnsCollection { + length: number; + item(index: number): string; +} +declare var MSBehaviorUrnsCollection: { + prototype: MSBehaviorUrnsCollection; + new(): MSBehaviorUrnsCollection; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface DOML2DeprecatedBackgroundStyle { + background: string; +} + +interface TextEvent extends UIEvent { + inputMethod: number; + data: string; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} + +interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { +} +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface Position { + timestamp: Date; + coords: Coordinates; +} +declare var Position: { + prototype: Position; + new(): Position; +} + +interface BookmarkCollection { + length: number; + item(index: number): any; + [index: number]: any; +} +declare var BookmarkCollection: { + prototype: BookmarkCollection; + new(): BookmarkCollection; +} + +interface PerformanceMark extends PerformanceEntry { +} +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selectorText: string; + selector: string; + style: CSSStyleDeclaration; +} +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface MSNavigatorExtensions { + userLanguage: string; + plugins: MSPluginsCollection; + cookieEnabled: boolean; + appCodeName: string; + cpuClass: string; + appMinorVersion: string; + connectionSpeed: number; + browserLanguage: string; + mimeTypes: MSMimeTypesCollection; + systemLanguage: string; + language: string; + javaEnabled(): boolean; + taintEnabled(): boolean; +} + +interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { +} +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; +} +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; +} +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface SVGZoomAndPan { + zoomAndPan: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; + SVG_ZOOMANDPAN_DISABLE: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface HTMLMediaElement extends HTMLElement { + /** + * Gets the earliest possible position, in seconds, that the playback can begin. + */ + initialTime: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + readyState: any; + /** + * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. + */ + autobuffer: boolean; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + /** + * Gets the current network activity for the element. + */ + networkState: number; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + textTracks: TextTrackList; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; +} + +interface ElementCSSInlineStyle { + runtimeStyle: MSStyleCSSProperties; + currentStyle: MSCurrentStyleCSSProperties; + doScroll(component?: any): void; + componentFromPoint(x: number, y: number): string; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface MSMimeTypesCollection { + length: number; +} +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface StyleSheet { + disabled: boolean; + ownerNode: Node; + parentStyleSheet: StyleSheet; + href: string; + media: MediaList; + type: string; + title: string; +} +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + startOffset: SVGAnimatedLength; + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} + +interface HTMLDTElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface PerformanceMeasure extends PerformanceEntry { +} +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { + spreadMethod: SVGAnimatedEnumeration; + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_ENTITY: number; + SHOW_DOCUMENT: number; + SHOW_PROCESSING_INSTRUCTION: number; + FILTER_REJECT: number; + SHOW_CDATA_SECTION: number; + FILTER_ACCEPT: number; + SHOW_ALL: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_TEXT: number; + SHOW_ELEMENT: number; + SHOW_COMMENT: number; + FILTER_SKIP: number; + SHOW_ATTRIBUTE: number; + SHOW_DOCUMENT_FRAGMENT: number; +} +declare var NodeFilter: NodeFilter; + +interface SVGNumberList { + numberOfItems: number; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; + getItem(index: number): SVGNumber; + clear(): void; + appendItem(newItem: SVGNumber): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + removeItem(index: number): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; +} +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLBGSoundElement extends HTMLElement { + /** + * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. + */ + balance: any; + /** + * Sets or gets the volume setting for the sound. + */ + volume: any; + /** + * Sets or gets the URL of a sound to play. + */ + src: string; + /** + * Sets or retrieves the number of times a sound or video clip will loop when activated. + */ + loop: number; +} +declare var HTMLBGSoundElement: { + prototype: HTMLBGSoundElement; + new(): HTMLBGSoundElement; +} + +interface Comment extends CharacterData { + text: string; +} +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + redirectStart: number; + redirectEnd: number; + domainLookupEnd: number; + responseStart: number; + domainLookupStart: number; + fetchStart: number; + requestStart: number; + connectEnd: number; + connectStart: number; + initiatorType: string; + responseEnd: number; +} +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface CanvasPattern { +} +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; +} +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the contained object. + */ + object: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + declare: boolean; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: number; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Retrieves the palette used for the embedded document. + */ + palette: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + hidden: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: string; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; +} +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface StorageEvent extends Event { + oldValue: any; + newValue: any; + url: string; + storageArea: Storage; + key: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface CharacterData extends Node { + length: number; + data: string; + deleteData(offset: number, count: number): void; + replaceData(offset: number, count: number, arg: string): void; + appendData(arg: string): void; + insertData(offset: number, arg: string): void; + substringData(offset: number, count: number): string; +} +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + prompt: string; +} +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface MSCompatibleInfoCollection { + length: number; + item(index: number): MSCompatibleInfo; +} +declare var MSCompatibleInfoCollection: { + prototype: MSCompatibleInfoCollection; + new(): MSCompatibleInfoCollection; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} + +interface Attr extends Node { + expando: boolean; + specified: boolean; + ownerElement: Element; + value: string; + name: string; +} +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; +} +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface PositionCallback { + (position: Position): void; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { +} +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface MSDataBindingRecordSetExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface LinkStyle { + styleSheet: StyleSheet; + sheet: StyleSheet; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the width of the video element. + */ + width: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets or sets the height of the video element. + */ + height: number; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + onMSVideoOptimalLayoutChanged: (ev: any) => any; + onMSVideoFrameStepCompleted: (ev: any) => any; + msStereo3DRenderMode: string; + msIsLayoutOptimalForPlayback: boolean; + msHorizontalMirror: boolean; + onMSVideoFormatChanged: (ev: any) => any; + msZoom: boolean; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + msFrameStep(forward: boolean): void; + getVideoPlaybackQuality(): VideoPlaybackQuality; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + maskUnits: SVGAnimatedEnumeration; + maskContentUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface External { +} +declare var External: { + prototype: External; + new(): External; +} + +interface MSGestureEvent extends UIEvent { + offsetY: number; + translationY: number; + velocityExpansion: number; + velocityY: number; + velocityAngular: number; + translationX: number; + velocityX: number; + hwTimestamp: number; + offsetX: number; + screenX: number; + rotation: number; + expansion: number; + clientY: number; + screenY: number; + scale: number; + gestureObject: any; + clientX: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + error: any; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + filterResX: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + primitiveUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + filterResY: SVGAnimatedInteger; + setFilterRes(filterResX: number, filterResY: number): void; +} +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface TrackEvent extends Event { + track: any; +} +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface TextTrackCue extends EventTarget { + onenter: (ev: Event) => any; + track: TextTrack; + endTime: number; + text: string; + pauseOnExit: boolean; + id: string; + startTime: number; + onexit: (ev: Event) => any; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface DOMTokenList { + length: number; + contains(token: string): boolean; + remove(token: string): void; + toggle(token: string): boolean; + add(token: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface TransitionEvent extends Event { + propertyName: string; + elapsedTime: number; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface MediaQueryList { + matches: boolean; + media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + extensions: string; + onmessage: (ev: MessageEvent) => any; + onclose: (ev: CloseEvent) => any; + onerror: (ev: ErrorEvent) => any; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface SVGFEPointLightElement extends SVGElement { + y: SVGAnimatedNumber; + x: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + stdDeviationX: SVGAnimatedNumber; + in1: SVGAnimatedString; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; +} +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + result: SVGAnimatedString; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; +} +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface URL { + revokeObjectURL(url: string): void; + createObjectURL(object: any, options?: ObjectURLOptions): string; +} +declare var URL: URL; + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + ontimeout: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onloadstart: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface IDBEnvironment { + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; +} + +interface AudioTrackList extends EventTarget { + length: number; + onchange: (ev: Event) => any; + onaddtrack: (ev: TrackEvent) => any; + onremovetrack: (ev: any /*PluginArray*/) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + [index: number]: AudioTrack; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + readyState: number; + onabort: (ev: UIEvent) => any; + onloadend: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onloadstart: (ev: Event) => any; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface WindowTimersExtension { + msSetImmediate(expression: any, ...args: any[]): number; + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + setImmediate(expression: any, ...args: any[]): number; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + scale: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + tableValues: SVGAnimatedNumberList; + slope: SVGAnimatedNumber; + type: SVGAnimatedEnumeration; + exponent: SVGAnimatedNumber; + amplitude: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; +} + +interface AudioTrack { + kind: string; + language: string; + id: string; + label: string; + enabled: boolean; + sourceBuffer: SourceBuffer; +} +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + orderY: SVGAnimatedInteger; + kernelUnitLengthY: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + kernelMatrix: SVGAnimatedNumberList; + edgeMode: SVGAnimatedEnumeration; + kernelUnitLengthX: SVGAnimatedNumber; + bias: SVGAnimatedNumber; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + divisor: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} + +interface TextTrackCueList { + length: number; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; + getCueById(id: string): TextTrackCue; +} +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface CSSKeyframesRule extends CSSRule { + name: string; + cssRules: CSSRuleList; + findRule(rule: string): CSSKeyframeRule; + deleteRule(rule: string): void; + appendRule(rule: string): void; +} +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + type: SVGAnimatedEnumeration; + baseFrequencyY: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + seed: SVGAnimatedNumber; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} + +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + [index: number]: TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} + +interface SVGFESpotLightElement extends SVGElement { + pointsAtY: SVGAnimatedNumber; + y: SVGAnimatedNumber; + limitingConeAngle: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + z: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; +} +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + onblocked: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface MSLaunchUriCallback { + (): void; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + dx: SVGAnimatedNumber; +} +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface TextTrack extends EventTarget { + language: string; + mode: any; + readyState: number; + activeCues: TextTrackCueList; + cues: TextTrackCueList; + oncuechange: (ev: Event) => any; + kind: string; + onload: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + label: string; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; +} + +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + readyState: string; + result: any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new(): Blob; +} + +interface ApplicationCache extends EventTarget { + status: number; + ondownloading: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onupdateready: (ev: Event) => any; + oncached: (ev: Event) => any; + onobsolete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onchecking: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + swapCache(): void; + abort(): void; + update(): void; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; +} + +interface FrameRequestCallback { + (time: number): void; +} + +interface PopStateEvent extends Event { + state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} +declare var PopStateEvent: { + prototype: PopStateEvent; + new(): PopStateEvent; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface MSPointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(): MSPointerEvent; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} + +interface MSManipulationEvent extends UIEvent { + lastState: number; + currentState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; +} +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + in2: SVGAnimatedString; + k2: SVGAnimatedNumber; + k1: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + in1: SVGAnimatedString; + k4: SVGAnimatedNumber; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} + +interface ValidityState { + customError: boolean; + valueMissing: boolean; + stepMismatch: boolean; + rangeUnderflow: boolean; + rangeOverflow: boolean; + typeMismatch: boolean; + patternMismatch: boolean; + tooLong: boolean; + valid: boolean; +} +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface HTMLTrackElement extends HTMLElement { + kind: string; + src: string; + srclang: string; + track: TextTrack; + label: string; + default: boolean; + readyState: number; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; + getViewOpener(): MSAppView; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + createNewView(uri: string): MSAppView; + getCurrentPriority(): string; + NORMAL: string; + HIGH: string; + IDLE: string; + CURRENT: string; +} +declare var MSApp: MSApp; + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + diffuseConstant: SVGAnimatedNumber; +} +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface MSCSSMatrix { + m24: number; + m34: number; + a: number; + d: number; + m32: number; + m41: number; + m11: number; + f: number; + e: number; + m23: number; + m14: number; + m33: number; + m22: number; + m21: number; + c: number; + m12: number; + b: number; + m42: number; + m31: number; + m43: number; + m13: number; + m44: number; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + setMatrixValue(value: string): void; + inverse(): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + toString(): string; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + translate(x: number, y: number, z?: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + skewX(angle: number): MSCSSMatrix; +} +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; +} + +interface Worker extends AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} + +interface MSGraphicsTrust { + status: string; + constrictionActive: boolean; +} +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface SubtleCrypto { + unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; + encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; + verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; + deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; + exportKey(format: string, key: Key): KeyOperation; + generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; +} +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Crypto extends RandomSource { + subtle: SubtleCrypto; +} +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface VideoPlaybackQuality { + totalFrameDelay: number; + creationTime: number; + totalVideoFrames: number; + droppedVideoFrames: number; +} +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface GlobalEventHandlers { + onpointerenter: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onpointercancel: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface Key { + algorithm: Algorithm; + type: string; + extractable: boolean; + keyUsage: string[]; +} +declare var Key: { + prototype: Key; + new(): Key; +} + +interface DeviceAcceleration { + y: number; + x: number; + z: number; +} +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface AesGcmEncryptResult { + ciphertext: ArrayBuffer; + tag: ArrayBuffer; +} +declare var AesGcmEncryptResult: { + prototype: AesGcmEncryptResult; + new(): AesGcmEncryptResult; +} + +interface NavigationCompletedEvent extends NavigationEvent { + webErrorStatus: number; + isSuccess: boolean; +} +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface MutationRecord { + oldValue: string; + previousSibling: Node; + addedNodes: NodeList; + attributeName: string; + removedNodes: NodeList; + target: Node; + nextSibling: Node; + attributeNamespace: string; + type: string; +} +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(type: string): Plugin; + // [type: string]: Plugin; +} +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface KeyOperation extends EventTarget { + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + result: any; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var KeyOperation: { + prototype: KeyOperation; + new(): KeyOperation; +} + +interface DOMStringMap { +} +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DeviceOrientationEvent extends Event { + gamma: number; + alpha: number; + absolute: boolean; + beta: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSHTMLWebViewElement extends HTMLElement { + documentTitle: string; + width: number; + src: string; + canGoForward: boolean; + height: number; + canGoBack: boolean; + navigateWithHttpRequestMessage(requestMessage: any): void; + goBack(): void; + navigate(uri: string): void; + stop(): void; + navigateToString(contents: string): void; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + refresh(): void; + goForward(): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; +} +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface NavigationEvent extends Event { + uri: string; +} +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SourceBuffer extends EventTarget { + updating: boolean; + appendWindowStart: number; + appendWindowEnd: number; + buffered: TimeRanges; + timestampOffset: number; + audioTracks: AudioTrackList; + appendBuffer(data: ArrayBuffer): void; + remove(start: number, end: number): void; + abort(): void; + appendStream(stream: MSStream, maxSize?: number): void; +} +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface MSInputMethodContext extends EventTarget { + oncandidatewindowshow: (ev: any) => any; + target: HTMLElement; + compositionStartOffset: number; + oncandidatewindowhide: (ev: any) => any; + oncandidatewindowupdate: (ev: any) => any; + compositionEndOffset: number; + getCompositionAlternatives(): string[]; + getCandidateWindowClientRect(): ClientRect; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface DeviceRotationRate { + gamma: number; + alpha: number; + beta: number; +} +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface PluginArray { + length: number; + refresh(reload?: boolean): void; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(name: string): Plugin; + // [name: string]: Plugin; +} +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface MSMediaKeyError { + systemCode: number; + code: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} + +interface Plugin { + length: number; + filename: string; + version: string; + name: string; + description: string; + item(index: number): MimeType; + [index: number]: MimeType; + namedItem(type: string): MimeType; + // [type: string]: MimeType; +} +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface MediaSource extends EventTarget { + sourceBuffers: SourceBufferList; + duration: number; + readyState: string; + activeSourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface SourceBufferList extends EventTarget { + length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface XMLDocument extends Document { +} +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface DeviceMotionEvent extends Event { + rotationRate: DeviceRotationRate; + acceleration: DeviceAcceleration; + interval: number; + accelerationIncludingGravity: DeviceAcceleration; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface MimeType { + enabledPlugin: Plugin; + suffixes: string; + type: string; + description: string; +} +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface PointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; +} +declare var PointerEvent: { + prototype: PointerEvent; + new(): PointerEvent; +} + +interface MSDocumentExtensions { + captureEvents(): void; + releaseEvents(): void; +} + +interface MutationObserver { + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; + disconnect(): void; +} +declare var MutationObserver: { + prototype: MutationObserver; + new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +} + +interface MSWebViewAsyncOperation extends EventTarget { + target: MSHTMLWebViewElement; + oncomplete: (ev: Event) => any; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + readyState: number; + type: number; + result: any; + start(): void; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; +} + +interface ScriptNotifyEvent extends Event { + value: string; + callingUri: string; +} +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + redirectCount: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + type: string; +} +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface LongRunningScriptDetectedEvent extends Event { + stopPageScriptExecution: boolean; + executionTime: number; +} +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSAppView { + viewId: number; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; +} +declare var MSAppView: { + prototype: MSAppView; + new(): MSAppView; +} + +interface PerfWidgetExternal { + maxCpuSpeed: number; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + performanceCounter: number; + averagePaintTime: number; + activeNetworkRequestCount: number; + paintRequestsPerSecond: number; + extraInformationEnabled: boolean; + performanceCounterFrequency: number; + averageFrameTime: number; + repositionWindow(x: number, y: number): void; + getRecentMemoryUsage(last: number): any; + getMemoryUsage(): number; + resizeWindow(width: number, height: number): void; + getProcessCpuUsage(): number; + removeEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentCpuUsage(last: number): any; + addEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentFrames(last: number): any; + getRecentPaintRequests(last: number): any; +} +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} + +interface HTMLDocument extends Document { +} +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface KeyPair { + privateKey: Key; + publicKey: Key; +} +declare var KeyPair: { + prototype: KeyPair; + new(): KeyPair; +} + +interface MSMediaKeySession extends EventTarget { + sessionId: string; + error: MSMediaKeyError; + keySystem: string; + close(): void; + update(key: Uint8Array): void; +} +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEvent { + referrer: string; +} +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface CryptoOperation extends EventTarget { + algorithm: Algorithm; + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + key: Key; + result: any; + abort(): void; + finish(): void; + process(buffer: ArrayBufferView): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var CryptoOperation: { + prototype: CryptoOperation; + new(): CryptoOperation; +} + +interface WebGLTexture extends WebGLObject { +} +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface OES_texture_float { +} +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface WebGLContextEvent extends Event { + statusMessage: string; +} +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLRenderbuffer extends WebGLObject { +} +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLUniformLocation { +} +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebGLActiveInfo { + name: string; + type: number; + size: number; +} +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WebGLRenderingContext { + drawingBufferWidth: number; + drawingBufferHeight: number; + canvas: HTMLCanvasElement; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + bindTexture(target: number, texture: WebGLTexture): void; + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferData(target: number, data: ArrayBuffer, usage: number): void; + bufferData(target: number, size: number, usage: number): void; + depthMask(flag: boolean): void; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + vertexAttrib3fv(indx: number, values: number[]): void; + vertexAttrib3fv(indx: number, values: Float32Array): void; + linkProgram(program: WebGLProgram): void; + getSupportedExtensions(): string[]; + bufferSubData(target: number, offset: number, data: ArrayBuffer): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + polygonOffset(factor: number, units: number): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + createTexture(): WebGLTexture; + hint(target: number, mode: number): void; + getVertexAttrib(index: number, pname: number): any; + enableVertexAttribArray(index: number): void; + depthRange(zNear: number, zFar: number): void; + cullFace(mode: number): void; + createFramebuffer(): WebGLFramebuffer; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + getExtension(name: string): any; + createProgram(): WebGLProgram; + deleteShader(shader: WebGLShader): void; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + enable(cap: number): void; + blendEquation(mode: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + createBuffer(): WebGLBuffer; + deleteTexture(texture: WebGLTexture): void; + useProgram(program: WebGLProgram): void; + vertexAttrib2fv(indx: number, values: number[]): void; + vertexAttrib2fv(indx: number, values: Float32Array): void; + checkFramebufferStatus(target: number): number; + frontFace(mode: number): void; + getBufferParameter(target: number, pname: number): any; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + getVertexAttribOffset(index: number, pname: number): number; + disableVertexAttribArray(index: number): void; + blendFunc(sfactor: number, dfactor: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + uniform3iv(location: WebGLUniformLocation, v: number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + lineWidth(width: number): void; + getShaderInfoLog(shader: WebGLShader): string; + getTexParameter(target: number, pname: number): any; + getParameter(pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getContextAttributes(): WebGLContextAttributes; + vertexAttrib1f(indx: number, x: number): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + isContextLost(): boolean; + uniform1iv(location: WebGLUniformLocation, v: number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + getRenderbufferParameter(target: number, pname: number): any; + uniform2fv(location: WebGLUniformLocation, v: number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; + isTexture(texture: WebGLTexture): boolean; + getError(): number; + shaderSource(shader: WebGLShader, source: string): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + stencilMask(mask: number): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + getAttribLocation(program: WebGLProgram, name: string): number; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + clear(mask: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + scissor(x: number, y: number, width: number, height: number): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getShaderSource(shader: WebGLShader): string; + generateMipmap(target: number): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + uniform1fv(location: WebGLUniformLocation, v: number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; + uniform2iv(location: WebGLUniformLocation, v: number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + uniform4fv(location: WebGLUniformLocation, v: number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; + vertexAttrib1fv(indx: number, values: number[]): void; + vertexAttrib1fv(indx: number, values: Float32Array): void; + flush(): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + deleteProgram(program: WebGLProgram): void; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + uniform1i(location: WebGLUniformLocation, x: number): void; + getProgramParameter(program: WebGLProgram, pname: number): any; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + stencilFunc(func: number, ref: number, mask: number): void; + pixelStorei(pname: number, param: number): void; + disable(cap: number): void; + vertexAttrib4fv(indx: number, values: number[]): void; + vertexAttrib4fv(indx: number, values: Float32Array): void; + createRenderbuffer(): WebGLRenderbuffer; + isBuffer(buffer: WebGLBuffer): boolean; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + sampleCoverage(value: number, invert: boolean): void; + depthFunc(func: number): void; + texParameterf(target: number, pname: number, param: number): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + drawArrays(mode: number, first: number, count: number): void; + texParameteri(target: number, pname: number, param: number): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + getShaderParameter(shader: WebGLShader, pname: number): any; + clearDepth(depth: number): void; + activeTexture(texture: number): void; + viewport(x: number, y: number, width: number, height: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + deleteBuffer(buffer: WebGLBuffer): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + uniform3fv(location: WebGLUniformLocation, v: number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; + stencilMaskSeparate(face: number, mask: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + compileShader(shader: WebGLShader): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + isShader(shader: WebGLShader): boolean; + clearStencil(s: number): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + finish(): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + getProgramInfoLog(program: WebGLProgram): string; + validateProgram(program: WebGLProgram): void; + isEnabled(cap: number): boolean; + vertexAttrib2f(indx: number, x: number, y: number): void; + isProgram(program: WebGLProgram): boolean; + createShader(type: number): WebGLShader; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + uniform4iv(location: WebGLUniformLocation, v: number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} + +interface WebGLProgram extends WebGLObject { +} +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface WebGLFramebuffer extends WebGLObject { +} +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLShader extends WebGLObject { +} +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface OES_texture_float_linear { +} +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface WebGLObject { +} +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLBuffer extends WebGLObject { +} +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLShaderPrecisionFormat { + rangeMin: number; + rangeMax: number; + precision: number; +} +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface EXT_texture_filter_anisotropic { + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; +declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; +declare var Audio: { new(src?: string): HTMLAudioElement; }; + +declare var ondragend: (ev: DragEvent) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var screenX: number; +declare var onmouseover: (ev: MouseEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var history: History; +declare var pageXOffset: number; +declare var name: string; +declare var onafterprint: (ev: Event) => any; +declare var onpause: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var top: Window; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var opener: Window; +declare var onclick: (ev: MouseEvent) => any; +declare var innerHeight: number; +declare var onwaiting: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var ondurationchange: (ev: Event) => any; +declare var frames: Window; +declare var onblur: (ev: FocusEvent) => any; +declare var onemptied: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var oncanplay: (ev: Event) => any; +declare var outerWidth: number; +declare var onstalled: (ev: Event) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var innerWidth: number; +declare var onoffline: (ev: Event) => any; +declare var length: number; +declare var screen: Screen; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onloadstart: (ev: Event) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var self: Window; +declare var document: Document; +declare var onprogress: (ev: ProgressEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var pageYOffset: number; +declare var oncontextmenu: (ev: MouseEvent) => any; +declare var onchange: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onplaying: (ev: Event) => any; +declare var parent: Window; +declare var location: Location; +declare var oncanplaythrough: (ev: Event) => any; +declare var onabort: (ev: UIEvent) => any; +declare var onreadystatechange: (ev: Event) => any; +declare var outerHeight: number; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var frameElement: Element; +declare var onloadeddata: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var window: Window; +declare var onfocus: (ev: FocusEvent) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onselect: (ev: UIEvent) => any; +declare var navigator: Navigator; +declare var styleMedia: StyleMedia; +declare var ondrop: (ev: DragEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onended: (ev: Event) => any; +declare var onhashchange: (ev: Event) => any; +declare var onunload: (ev: Event) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var screenY: number; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var oninput: (ev: Event) => any; +declare var performance: Performance; +declare var onmspointerdown: (ev: any) => any; +declare var animationStartTime: number; +declare var onmsgesturedoubletap: (ev: any) => any; +declare var onmspointerhover: (ev: any) => any; +declare var onmsgesturehold: (ev: any) => any; +declare var onmspointermove: (ev: any) => any; +declare var onmsgesturechange: (ev: any) => any; +declare var onmsgesturestart: (ev: any) => any; +declare var onmspointercancel: (ev: any) => any; +declare var onmsgestureend: (ev: any) => any; +declare var onmsgesturetap: (ev: any) => any; +declare var onmspointerout: (ev: any) => any; +declare var msAnimationStartTime: number; +declare var applicationCache: ApplicationCache; +declare var onmsinertiastart: (ev: any) => any; +declare var onmspointerover: (ev: any) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onmspointerup: (ev: any) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var devicePixelRatio: number; +declare var msCrypto: Crypto; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var doNotTrack: string; +declare var onmspointerenter: (ev: any) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onmspointerleave: (ev: any) => any; +declare function alert(message?: any): void; +declare function scroll(x?: number, y?: number): void; +declare function focus(): void; +declare function scrollTo(x?: number, y?: number): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; +declare function toString(): string; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function scrollBy(x?: number, y?: number): void; +declare function confirm(message?: string): boolean; +declare function close(): void; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function showModalDialog(url?: string, argument?: any, options?: any): any; +declare function blur(): void; +declare function getSelection(): Selection; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function cancelAnimationFrame(handle: number): void; +declare function msIsStaticHTML(html: string): boolean; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function attachEvent(event: string, listener: EventListener): boolean; +declare function detachEvent(event: string, listener: EventListener): void; +declare var localStorage: Storage; +declare var status: string; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var screenLeft: number; +declare var offscreenBuffering: any; +declare var maxConnectionsPerServer: number; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var clipboardData: DataTransfer; +declare var defaultStatus: string; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var onhelp: (ev: Event) => any; +declare var external: External; +declare var event: MSEventObj; +declare var onfocusout: (ev: FocusEvent) => any; +declare var screenTop: number; +declare var onfocusin: (ev: FocusEvent) => any; +declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; +declare function navigate(url: string): void; +declare function resizeBy(x?: number, y?: number): void; +declare function item(index: any): any; +declare function resizeTo(x?: number, y?: number): void; +declare function createPopup(arguments?: any): MSPopupWindow; +declare function toStaticHTML(html: string): string; +declare function execScript(code: string, language?: string): any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function moveTo(x?: number, y?: number): void; +declare function moveBy(x?: number, y?: number): void; +declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare function captureEvents(): void; +declare function releaseEvents(): void; +declare var sessionStorage: Storage; +declare function clearTimeout(handle: number): void; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearInterval(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function msClearImmediate(handle: number): void; +declare function setImmediate(expression: any, ...args: any[]): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare var console: Console; +declare var onpointerenter: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onpointercancel: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerleave: (ev: PointerEvent) => any; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; diff --git a/bin/lib.scripthost.d.ts b/bin/lib.scripthost.d.ts new file mode 100644 index 0000000000000..1498aeea63aa8 --- /dev/null +++ b/bin/lib.scripthost.d.ts @@ -0,0 +1,38 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + +declare var ActiveXObject: { new (s: string): any; }; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +declare var WScript: { + Echo(s: any): void; + StdErr: ITextWriter; + StdOut: ITextWriter; + Arguments: { length: number; Item(n: number): string; }; + ScriptFullName: string; + Quit(exitCode?: number): number; +} diff --git a/bin/lib.webworker.d.ts b/bin/lib.webworker.d.ts new file mode 100644 index 0000000000000..a524443368bb0 --- /dev/null +++ b/bin/lib.webworker.d.ts @@ -0,0 +1,1637 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +///////////////////////////// +/// IE10 ECMAScript Extensions +///////////////////////////// + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + byteLength: number; +} + +declare var ArrayBuffer: { + prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; +} + +interface ArrayBufferView { + buffer: ArrayBuffer; + byteOffset: number; + byteLength: number; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; +} +declare var Int8Array: { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; +} +declare var Uint8Array: { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; +} +declare var Int16Array: { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; +} +declare var Uint16Array: { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; +} +declare var Int32Array: { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; +} +declare var Uint32Array: { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; +} +declare var Float32Array: { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float64Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float64Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; +} +declare var Float64Array: { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + BYTES_PER_ELEMENT: number; +} + +/** + * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. + */ +interface DataView extends ArrayBufferView { + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; +} +declare var DataView: { + prototype: DataView; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; +} + +///////////////////////////// +/// IE11 ECMAScript Extensions +///////////////////////////// + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): Map; + size: number; +} +declare var Map: { + new (): Map; +} + +interface WeakMap { + clear(): void; + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): WeakMap; +} +declare var WeakMap: { + new (): WeakMap; +} + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; +} +declare var Set: { + new (): Set; +} + +declare module Intl { + + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string[], options?: CollatorOptions): Collator; + new (locale?: string, options?: CollatorOptions): Collator; + (locales?: string[], options?: CollatorOptions): Collator; + (locale?: string, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; + supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + } + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumintegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string[], options?: NumberFormatOptions): Collator; + new (locale?: string, options?: NumberFormatOptions): Collator; + (locales?: string[], options?: NumberFormatOptions): Collator; + (locale?: string, options?: NumberFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + } + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12: boolean; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date: number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string[], options?: DateTimeFormatOptions): Collator; + new (locale?: string, options?: DateTimeFormatOptions): Collator; + (locales?: string[], options?: DateTimeFormatOptions): Collator; + (locale?: string, options?: DateTimeFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + } +} + +interface String { + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; + + /** + * Converts a number to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a date to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; +} + +///////////////////////////// +/// IE Worker APIs +///////////////////////////// + + +interface Console { + info(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + profile(reportName?: string): void; + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: any): boolean; + clear(): void; + dir(value?: any, ...optionalParams: any[]): void; + profileEnd(): void; + count(countTitle?: string): void; + groupEnd(): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + group(groupTitle?: string): void; + dirxml(value: any): void; + debug(message?: string, ...optionalParams: any[]): void; + groupCollapsed(groupTitle?: string): void; + select(element: any): void; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; + product: string; + vendor: string; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface MessageEvent extends Event { + source: any; + origin: string; + data: any; + ports: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface XMLHttpRequest extends EventTarget { + responseBody: any; + status: number; + readyState: number; + responseText: string; + responseXML: any; + ontimeout: (ev: Event) => any; + statusText: string; + onreadystatechange: (ev: Event) => any; + timeout: number; + onload: (ev: Event) => any; + response: any; + withCredentials: boolean; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: any) => any; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + onloadstart: (ev: Event) => any; + msCaching: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + overrideMimeType(mime: string): void; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + create(): XMLHttpRequest; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventException { + code: number; + message: string; + name: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface Event { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + cancelBubble: boolean; + target: EventTarget; + eventPhase: number; + cancelable: boolean; + type: string; + srcElement: any; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + error: any; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + extensions: string; + onmessage: (ev: MessageEvent) => any; + onclose: (ev: CloseEvent) => any; + onerror: (ev: ErrorEvent) => any; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + ontimeout: (ev: Event) => any; + onabort: (ev: any) => any; + onloadstart: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + readyState: number; + onabort: (ev: any) => any; + onloadend: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onloadstart: (ev: Event) => any; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: any) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: any) => any; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + onblocked: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + readyState: string; + result: any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new(): Blob; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; + getViewOpener(): MSAppView; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + createNewView(uri: string): MSAppView; + getCurrentPriority(): string; + NORMAL: string; + HIGH: string; + IDLE: string; + CURRENT: string; +} +declare var MSApp: MSApp; + +interface Worker extends AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} + +interface MSAppView { + viewId: number; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; +} +declare var MSAppView: { + prototype: MSAppView; + new(): MSAppView; +} + +interface WorkerLocation { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + toString(): string; +} +declare var WorkerLocation: { + prototype: WorkerLocation; + new(): WorkerLocation; +} + +interface FileReaderSync { + readAsArrayBuffer(blob: Blob): any; + readAsDataURL(blob: Blob): string; + readAsText(blob: Blob, encoding?: string): string; +} +declare var FileReaderSync: { + prototype: FileReaderSync; + new(): FileReaderSync; +} + +interface WorkerGlobalScope extends EventTarget, DedicatedWorkerGlobalScope, WindowConsole, WorkerUtils { + location: WorkerLocation; + self: WorkerGlobalScope; + onerror: (ev: ErrorEvent) => any; + msWriteProfilerMark(profilerMarkName: string): void; + close(): void; + toString(): string; +} +declare var WorkerGlobalScope: { + prototype: WorkerGlobalScope; + new(): WorkerGlobalScope; +} + +interface DedicatedWorkerGlobalScope { + onmessage: (ev: MessageEvent) => any; + postMessage(data: any): void; +} + +interface WorkerNavigator extends NavigatorID, NavigatorOnLine { +} +declare var WorkerNavigator: { + prototype: WorkerNavigator; + new(): WorkerNavigator; +} + +interface WorkerUtils extends WindowBase64 { + navigator: WorkerNavigator; + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; + clearImmediate(handle: number): void; + importScripts(...urls: string[]): void; + clearTimeout(handle: number): void; + setImmediate(handler: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; + clearInterval(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; +} + + +declare var location: WorkerLocation; +declare var self: WorkerGlobalScope; +declare var onerror: (ev: ErrorEvent) => any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function close(): void; +declare function toString(): string; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare var onmessage: (ev: MessageEvent) => any; +declare function postMessage(data: any): void; +declare var console: Console; +declare var navigator: WorkerNavigator; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare function clearImmediate(handle: number): void; +declare function importScripts(...urls: string[]): void; +declare function clearTimeout(handle: number): void; +declare function setImmediate(handler: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearInterval(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; diff --git a/bin/services.js b/bin/services.js new file mode 100644 index 0000000000000..b6dd64e590def --- /dev/null +++ b/bin/services.js @@ -0,0 +1,11536 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +var ts; +(function (ts) { + ts.Diagnostics = { + Unknown_compiler_option_0: { code: 6001, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, + File_0_not_found: { code: 6002, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Unrecognized_escape_sequence: { code: 1000, category: 1 /* Error */, key: "Unrecognized escape sequence." }, + Unexpected_character_0: { code: 1001, category: 1 /* Error */, key: "Unexpected character {0}." }, + Missing_close_quote_character: { code: 1002, category: 1 /* Error */, key: "Missing close quote character." }, + Identifier_expected: { code: -9999999, category: 1 /* Error */, key: "Identifier expected." }, + _0_keyword_expected: { code: 1004, category: 1 /* Error */, key: "'{0}' keyword expected." }, + _0_expected: { code: -9999999, category: 1 /* Error */, key: "'{0}' expected." }, + Identifier_expected_0_is_a_keyword: { code: 1006, category: 1 /* Error */, key: "Identifier expected; '{0}' is a keyword." }, + Automatic_semicolon_insertion_not_allowed: { code: 1007, category: 1 /* Error */, key: "Automatic semicolon insertion not allowed." }, + Unexpected_token_0_expected: { code: 1008, category: 1 /* Error */, key: "Unexpected token; '{0}' expected." }, + Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, + public_or_private_modifier_must_precede_static: { code: 1011, category: 1 /* Error */, key: "'public' or 'private' modifier must precede 'static'." }, + Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, + extends_clause_already_seen: { code: 1024, category: 1 /* Error */, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1025, category: 1 /* Error */, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1027, category: 1 /* Error */, key: "'implements' clause already seen." }, + Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, + Interface_declaration_cannot_have_implements_clause: { code: 1032, category: 1 /* Error */, key: "Interface declaration cannot have 'implements' clause." }, + super_invocation_cannot_have_type_arguments: { code: 1034, category: 1 /* Error */, key: "'super' invocation cannot have type arguments." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, + Modifiers_cannot_appear_here: { code: 1055, category: 1 /* Error */, key: "Modifiers cannot appear here." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: -9999999, category: 1 /* Error */, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, + module_class_interface_enum_import_or_statement: { code: 1067, category: 3 /* NoPrefix */, key: "module, class, interface, enum, import or statement" }, + constructor_function_accessor_or_variable: { code: 1068, category: 3 /* NoPrefix */, key: "constructor, function, accessor or variable" }, + statement: { code: 1069, category: 3 /* NoPrefix */, key: "statement" }, + case_or_default_clause: { code: 1070, category: 3 /* NoPrefix */, key: "case or default clause" }, + identifier: { code: 1071, category: 3 /* NoPrefix */, key: "identifier" }, + call_construct_index_property_or_function_signature: { code: 1072, category: 3 /* NoPrefix */, key: "call, construct, index, property or function signature" }, + expression: { code: 1073, category: 3 /* NoPrefix */, key: "expression" }, + type_name: { code: 1074, category: 3 /* NoPrefix */, key: "type name" }, + property_or_accessor: { code: 1075, category: 3 /* NoPrefix */, key: "property or accessor" }, + parameter: { code: 1076, category: 3 /* NoPrefix */, key: "parameter" }, + type: { code: 1077, category: 3 /* NoPrefix */, key: "type" }, + type_parameter: { code: 1078, category: 3 /* NoPrefix */, key: "type parameter" }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, + Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "'continue' statement can only be used within an enclosing iteration statement." }, + break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_not_found: { code: 1106, category: 1 /* Error */, key: "Jump target not found." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, + return_statement_must_be_contained_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "'return' statement must be contained within a function body." }, + Expression_expected: { code: -9999999, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: -9999999, category: 1 /* Error */, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, + Duplicate_identifier_0: { code: 2000, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + A_class_may_only_implement_another_class_or_interface: { code: 2074, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + get_and_set_accessor_must_have_the_same_type: { code: 2096, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + Static_members_cannot_reference_class_type_parameters: { code: 2099, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: 1 /* Error */, key: "Variable declarations of a 'for' statement cannot use a type annotation." }, + Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: { code: 2116, category: 1 /* Error */, key: "Variable declarations of a 'for' statement must be of types 'string' or 'any'." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + Getters_must_return_a_value: { code: 2126, category: 1 /* Error */, key: "Getters must return a value." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + Setters_cannot_return_a_value: { code: 2122, category: 1 /* Error */, key: "Setters cannot return a value." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + Overload_signatures_must_all_be_public_or_private: { code: 2150, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Duplicate_string_index_signature: { code: 2232, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2233, category: 1 /* Error */, key: "Duplicate number index signature." }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Constructor_implementation_expected: { code: 2240, category: 1 /* Error */, key: "Constructor implementation expected." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + Circular_definition_of_import_alias_0: { code: 3000, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 3001, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 3002, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + Cannot_find_external_module_0: { code: 3003, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 3006, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Generic_type_0_requires_1_type_argument_s: { code: 3008, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 3009, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Cannot_find_global_type_0: { code: 3010, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + this_cannot_be_referenced_in_a_module_body: { code: 3013, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + this_cannot_be_referenced_in_current_location: { code: -9999999, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + Property_0_does_not_exist_on_type_1: { code: 3017, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 3027, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 3029, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Duplicate_function_implementation: { code: 3034, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Index_signature_is_missing_in_type_0: { code: 4003, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 4004, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, + Could_not_write_file_0: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}'." }, + Could_not_create_directory_0: { code: 5035, category: 1 /* Error */, key: "Could not create directory '{0}'." }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, + Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, + Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: 1 /* Error */, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Array_literal_implicitly_has_an_0_type: { code: 7015, category: 1 /* Error */, key: "Array literal implicitly has an '{0}' type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + variable_declaration_list_cannot_be_empty: { code: -9999999, category: 1 /* Error */, key: "variable declaration list cannot be empty." }, + Digit_expected: { code: -9999999, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: -9999999, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: -9999999, category: 1 /* Error */, key: "Unexpected end of text." }, + Unterminated_string_constant: { code: -9999999, category: 1 /* Error */, key: "Unterminated string constant." }, + Invalid_character: { code: -9999999, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: -9999999, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: -9999999, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: -9999999, category: 1 /* Error */, key: "Property or signature expected." }, + Property_or_method_expected: { code: -9999999, category: 1 /* Error */, key: "Property or method expected." }, + Enum_member_expected: { code: -9999999, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: -9999999, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: -9999999, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: -9999999, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: -9999999, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: -9999999, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: -9999999, category: 1 /* Error */, key: "String literal expected." }, + not_preceded_by_parameter_list: { code: -9999999, category: 1 /* Error */, key: "'=>' not preceded by parameter list." }, + Invalid_assignment_target: { code: -9999999, category: 1 /* Error */, key: "Invalid assignment target." }, + super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: 1 /* Error */, key: "'super' must be followed by argument list or member access." }, + Line_break_not_permitted_here: { code: -9999999, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: -9999999, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: -9999999, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Class_member_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Class member declaration expected." }, + Declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration expected." }, + Invalid_reference_comment: { code: -9999999, category: 1 /* Error */, key: "Invalid reference comment." }, + File_0_is_not_an_external_module: { code: -9999999, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: -9999999, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + Import_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Unknown_identifier_0: { code: -9999999, category: 1 /* Error */, key: "Unknown identifier '{0}'." }, + Property_0_is_inaccessible: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, + Function_implementation_expected: { code: -9999999, category: 1 /* Error */, key: "Function implementation expected." }, + Statements_are_not_allowed_in_declaration_contexts: { code: -9999999, category: 1 /* Error */, key: "Statements are not allowed in declaration contexts." }, + Initializers_are_not_allowed_in_declaration_contexts: { code: -9999999, category: 1 /* Error */, key: "Initializers are not allowed in declaration contexts." }, + return_statement_has_no_containing_function: { code: -9999999, category: 1 /* Error */, key: "'return' statement has no containing function." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, + Class_0_incorrectly_implements_interface_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + In_an_enum_declaration_context_initializer_must_be_a_number_literal: { code: -9999999, category: 1 /* Error */, key: "In an enum declaration context initializer must be a number literal." }, + Ambient_external_modules_require_a_declare_modifier: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules require a 'declare' modifier." }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: -9999999, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: -9999999, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Compiler_option_0_expects_an_argument: { code: -9999999, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: -9999999, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: -9999999, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: -9999999, category: 1 /* Error */, key: "Unsupported locale {0}." }, + Unable_to_open_file_0: { code: -9999999, category: 1 /* Error */, key: "Unable to open file {0}." }, + Corrupted_locale_file_0: { code: -9999999, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + No_input_files_specified: { code: -9999999, category: 1 /* Error */, key: "No input files specified." } + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var textToToken = { + "any": 101 /* AnyKeyword */, + "boolean": 102 /* BooleanKeyword */, + "break": 56 /* BreakKeyword */, + "case": 57 /* CaseKeyword */, + "catch": 58 /* CatchKeyword */, + "class": 59 /* ClassKeyword */, + "continue": 61 /* ContinueKeyword */, + "const": 60 /* ConstKeyword */, + "constructor": 103 /* ConstructorKeyword */, + "debugger": 62 /* DebuggerKeyword */, + "declare": 104 /* DeclareKeyword */, + "default": 63 /* DefaultKeyword */, + "delete": 64 /* DeleteKeyword */, + "do": 65 /* DoKeyword */, + "else": 66 /* ElseKeyword */, + "enum": 67 /* EnumKeyword */, + "export": 68 /* ExportKeyword */, + "extends": 69 /* ExtendsKeyword */, + "false": 70 /* FalseKeyword */, + "finally": 71 /* FinallyKeyword */, + "for": 72 /* ForKeyword */, + "function": 73 /* FunctionKeyword */, + "get": 105 /* GetKeyword */, + "if": 74 /* IfKeyword */, + "implements": 92 /* ImplementsKeyword */, + "import": 75 /* ImportKeyword */, + "in": 76 /* InKeyword */, + "instanceof": 77 /* InstanceOfKeyword */, + "interface": 93 /* InterfaceKeyword */, + "let": 94 /* LetKeyword */, + "module": 106 /* ModuleKeyword */, + "new": 78 /* NewKeyword */, + "null": 79 /* NullKeyword */, + "number": 108 /* NumberKeyword */, + "package": 95 /* PackageKeyword */, + "private": 96 /* PrivateKeyword */, + "protected": 97 /* ProtectedKeyword */, + "public": 98 /* PublicKeyword */, + "require": 107 /* RequireKeyword */, + "return": 80 /* ReturnKeyword */, + "set": 109 /* SetKeyword */, + "static": 99 /* StaticKeyword */, + "string": 110 /* StringKeyword */, + "super": 81 /* SuperKeyword */, + "switch": 82 /* SwitchKeyword */, + "this": 83 /* ThisKeyword */, + "throw": 84 /* ThrowKeyword */, + "true": 85 /* TrueKeyword */, + "try": 86 /* TryKeyword */, + "typeof": 87 /* TypeOfKeyword */, + "var": 88 /* VarKeyword */, + "void": 89 /* VoidKeyword */, + "while": 90 /* WhileKeyword */, + "with": 91 /* WithKeyword */, + "yield": 100 /* YieldKeyword */, + "{": 5 /* OpenBraceToken */, + "}": 6 /* CloseBraceToken */, + "(": 7 /* OpenParenToken */, + ")": 8 /* CloseParenToken */, + "[": 9 /* OpenBracketToken */, + "]": 10 /* CloseBracketToken */, + ".": 11 /* DotToken */, + "...": 12 /* DotDotDotToken */, + ";": 13 /* SemicolonToken */, + ",": 14 /* CommaToken */, + "<": 15 /* LessThanToken */, + ">": 16 /* GreaterThanToken */, + "<=": 17 /* LessThanEqualsToken */, + ">=": 18 /* GreaterThanEqualsToken */, + "==": 19 /* EqualsEqualsToken */, + "!=": 20 /* ExclamationEqualsToken */, + "===": 21 /* EqualsEqualsEqualsToken */, + "!==": 22 /* ExclamationEqualsEqualsToken */, + "=>": 23 /* EqualsGreaterThanToken */, + "+": 24 /* PlusToken */, + "-": 25 /* MinusToken */, + "*": 26 /* AsteriskToken */, + "/": 27 /* SlashToken */, + "%": 28 /* PercentToken */, + "++": 29 /* PlusPlusToken */, + "--": 30 /* MinusMinusToken */, + "<<": 31 /* LessThanLessThanToken */, + ">>": 32 /* GreaterThanGreaterThanToken */, + ">>>": 33 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 34 /* AmpersandToken */, + "|": 35 /* BarToken */, + "^": 36 /* CaretToken */, + "!": 37 /* ExclamationToken */, + "~": 38 /* TildeToken */, + "&&": 39 /* AmpersandAmpersandToken */, + "||": 40 /* BarBarToken */, + "?": 41 /* QuestionToken */, + ":": 42 /* ColonToken */, + "=": 43 /* EqualsToken */, + "+=": 44 /* PlusEqualsToken */, + "-=": 45 /* MinusEqualsToken */, + "*=": 46 /* AsteriskEqualsToken */, + "/=": 47 /* SlashEqualsToken */, + "%=": 48 /* PercentEqualsToken */, + "<<=": 49 /* LessThanLessThanEqualsToken */, + ">>=": 50 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 52 /* AmpersandEqualsToken */, + "|=": 53 /* BarEqualsToken */, + "^=": 54 /* CaretEqualsToken */ + }; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + function lookupInUnicodeMap(code, map) { + if (code < map[0]) { + return false; + } + var lo = 0; + var hi = map.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + function makeReverseMap(source) { + var result = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t) { + return tokenStrings[t]; + } + ts.tokenToString = tokenToString; + function getLineStarts(text) { + var result = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + switch (text.charCodeAt(pos++)) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + result.push(lineStart); + lineStart = pos; + break; + } + } + result.push(lineStart); + return result; + } + ts.getLineStarts = getLineStarts; + function getLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = ts.binarySearch(lineStarts, position); + if (lineNumber < 0) { + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function positionToLineAndCharacter(text, pos) { + var lineStarts = getLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + ts.positionToLineAndCharacter = positionToLineAndCharacter; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; + } + function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; + } + function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; + } + function isHexDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */; + } + function skipTrivia(text, pos, stopAfterLineBreak) { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (stopAfterLineBreak) + return pos; + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (isWhiteSpace(ch) || isLineBreak(ch)) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts.skipTrivia = skipTrivia; + function createScanner(languageVersion, text, onError, onComment) { + var pos; + var len; + var startPos; + var tokenPos; + var token; + var precedingLineBreak; + var hasUnicodeEscapeSequence; + function error(message) { + if (onError) + onError(message); + } + function isIdentifierStart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + function scanNumber() { + token = 2 /* NumericLiteral */; + while (isDigit(text.charCodeAt(pos))) + pos++; + if (text.charCodeAt(pos) === 46 /* dot */) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + } + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { + pos++; + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) + pos++; + if (!isDigit(text.charCodeAt(pos))) { + error(ts.Diagnostics.Digit_expected); + } + else { + do { + pos++; + } while (isDigit(text.charCodeAt(pos))); + } + } + return token; + } + function scanHexDigits(count, exact, ignoreErrors) { + var n = 0; + while ((n < count || !exact) && isHexDigit(text.charCodeAt(pos))) { + pos++; + n++; + } + if (n < count && !ignoreErrors) + error(ts.Diagnostics.Hexadecimal_digit_expected); + } + function scanHexNumber() { + token = 2 /* NumericLiteral */; + pos += 2; + scanHexDigits(1, false); + return token; + } + function scanString() { + token = 3 /* StringLiteral */; + var quote = text.charCodeAt(pos++); + while (true) { + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + pos++; + break; + } + if (isLineBreak(ch)) { + error(ts.Diagnostics.Unterminated_string_constant); + break; + } + pos++; + if (ch === 92 /* backslash */) { + switch (text.charCodeAt(pos)) { + case 13 /* carriageReturn */: + pos++; + if (text.charCodeAt(pos) === 10 /* lineFeed */) + pos++; + break; + case 120 /* x */: + pos++; + scanHexDigits(2, true); + break; + case 117 /* u */: + pos++; + scanHexDigits(4, true); + break; + default: + if (pos < len) + pos++; + } + } + } + return token; + } + function scanUnicodeIdentifierOrKeyword() { + var startPos = pos; + do { + scanCharOrUnicodeEscape(); + } while (isIdentifierPart(peekCharOrUnicodeEscape())); + var id = convertUnicodeEscapes(startPos, pos); + if (hasOwnProperty.call(textToToken, id)) { + return token = textToToken[id]; + } + return 55 /* Identifier */; + } + function peekCharOrUnicodeEscape() { + var ch; + tryScan(function () { + ch = scanCharOrUnicodeEscape(true); + }); + return ch; + } + function scanCharOrUnicodeEscape(ignoreErrors) { + var ch = text.charCodeAt(pos++); + if (ch === 92 /* backslash */ && text.charCodeAt(pos) === 117 /* u */) { + pos++; + hasUnicodeEscapeSequence = true; + return scanUnicodeEscape(ignoreErrors); + } + return ch; + } + function hexValue(start, length) { + var value = 0; + for (var i = 0; i < length; i++) { + var ch = text.charCodeAt(start + i); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) + value = (value << 4) + ch - 48 /* _0 */; + else if (ch >= 97 /* a */ && ch <= 102 /* f */) + value = (value << 4) + ch - 97 /* a */ + 10; + else if (ch >= 65 /* A */ && ch <= 70 /* F */) + value = (value << 4) + ch - 65 /* A */ + 10; + else + break; + } + return value; + } + function scanUnicodeEscape(ignoreErrors) { + var startPos = pos; + scanHexDigits(4, true, ignoreErrors); + return hexValue(startPos, 4); + } + var characterArray = []; + function convertUnicodeEscapes(pos, end) { + characterArray.length = 0; + var i = pos; + while (i < end) { + var ch = text.charCodeAt(i++); + if (ch === 92 /* backslash */ && text.charCodeAt(i) === 117 /* u */) { + i++; + var j = 0; + while (j < 4 && isHexDigit(text.charCodeAt(i + j))) + j++; + characterArray.push(hexValue(i, j)); + i += j; + } + else { + characterArray.push(ch); + } + } + ts.Debug.assert(characterArray.length, "Could not unescape a unicode sequence"); + return String.fromCharCode.apply(null, characterArray); + } + function scan() { + startPos = pos; + precedingLineBreak = false; + hasUnicodeEscapeSequence = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = 1 /* EndOfFileToken */; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case 10 /* lineFeed */: + case 13 /* carriageReturn */: + precedingLineBreak = true; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 22 /* ExclamationEqualsEqualsToken */; + } + return pos += 2, token = 20 /* ExclamationEqualsToken */; + } + return pos++, token = 37 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: + return scanString(); + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 48 /* PercentEqualsToken */; + } + return pos++, token = 28 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 39 /* AmpersandAmpersandToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 52 /* AmpersandEqualsToken */; + } + return pos++, token = 34 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 7 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 8 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 46 /* AsteriskEqualsToken */; + } + return pos++, token = 26 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 29 /* PlusPlusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 44 /* PlusEqualsToken */; + } + return pos++, token = 24 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 14 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 30 /* MinusMinusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 45 /* MinusEqualsToken */; + } + return pos++, token = 25 /* MinusToken */; + case 46 /* dot */: + if (isDigit(text.charCodeAt(pos + 1))) { + return scanNumber(); + } + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 12 /* DotDotDotToken */; + } + return pos++, token = 11 /* DotToken */; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + continue; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 47 /* SlashEqualsToken */; + } + return pos++, token = 27 /* SlashToken */; + case 48 /* _0 */: + if (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */) { + return scanHexNumber(); + } + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + return scanNumber(); + case 58 /* colon */: + return pos++, token = 42 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 13 /* SemicolonToken */; + case 60 /* lessThan */: + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 49 /* LessThanLessThanEqualsToken */; + } + return pos += 2, token = 31 /* LessThanLessThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 17 /* LessThanEqualsToken */; + } + return pos++, token = 15 /* LessThanToken */; + case 61 /* equals */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 21 /* EqualsEqualsEqualsToken */; + } + return pos += 2, token = 19 /* EqualsEqualsToken */; + } + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 23 /* EqualsGreaterThanToken */; + } + return pos++, token = 43 /* EqualsToken */; + case 62 /* greaterThan */: + return pos++, token = 16 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 41 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 9 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 10 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* CaretEqualsToken */; + } + return pos++, token = 36 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 5 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 40 /* BarBarToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 53 /* BarEqualsToken */; + } + return pos++, token = 35 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 6 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 38 /* TildeToken */; + default: + if (isIdentifierStart(ch)) { + var lastCh; + do { + lastCh = text.charCodeAt(++pos); + } while (isIdentifierPart(lastCh)); + if (lastCh !== 92 /* backslash */) { + if (ch >= 97 /* a */ && ch <= 122 /* z */ && pos - tokenPos >= 2) { + var id = text.substring(tokenPos, pos); + if (hasOwnProperty.call(textToToken, id)) { + return token = textToToken[id]; + } + } + return token = 55 /* Identifier */; + } + else { + pos = tokenPos; + } + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + if (isIdentifierStart(peekCharOrUnicodeEscape())) { + return scanUnicodeIdentifierOrKeyword(); + } + if (pos < len) { + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + } + } + } + } + function reScanGreaterToken() { + if (token === 16 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + } + return pos += 2, token = 33 /* GreaterThanGreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 50 /* GreaterThanGreaterThanEqualsToken */; + } + return pos++, token = 32 /* GreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 18 /* GreaterThanEqualsToken */; + } + } + return token; + } + function reScanSlashToken() { + if (token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) { + var p = tokenPos + 1; + var inEscape = false; + var inClass = false; + while (true) { + if (p >= len) { + return token; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + return token; + } + if (inEscape) { + inEscape = false; + } + else if (ch === 47 /* slash */) { + break; + } + else if (ch === 91 /* openBracket */) { + inClass = true; + } + else if (ch === 92 /* backslash */) { + inEscape = true; + } + else if (ch === 93 /* closeBracket */) { + inClass = false; + } + p++; + } + p++; + while (isIdentifierPart(text.charCodeAt(p))) + p++; + token = 4 /* RegularExpressionLiteral */; + pos = p; + } + return token; + } + function tryScan(callback) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var savePrecedingLineBreak = precedingLineBreak; + var savehasUnicodeEscapeSequence = hasUnicodeEscapeSequence; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + precedingLineBreak = savePrecedingLineBreak; + hasUnicodeEscapeSequence = savehasUnicodeEscapeSequence; + } + return result; + } + function setText(newText) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + function setTextPos(textPos) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0 /* Unknown */; + precedingLineBreak = false; + } + setText(text); + return { + getStartPos: function () { return startPos; }, + getTextPos: function () { return pos; }, + getToken: function () { return token; }, + getTokenPos: function () { return tokenPos; }, + getTokenText: function () { return text.substring(tokenPos, pos); }, + getIdentifierText: function () { return hasUnicodeEscapeSequence ? convertUnicodeEscapes(tokenPos, pos) : text.substring(tokenPos, pos); }, + hasPrecedingLineBreak: function () { return precedingLineBreak; }, + isIdentifier: function () { return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, + isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } + ts.createScanner = createScanner; +})(ts || (ts = {})); +var ts; +(function (ts) { + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 2] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 3] = "StringLiteral"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 4] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 5] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 6] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 7] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 8] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 9] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 10] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 11] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 12] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 13] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 14] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 15] = "LessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 16] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 17] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 18] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 19] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 20] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 21] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 22] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 23] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 24] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 25] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 26] = "AsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 27] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 28] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 29] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 30] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 31] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 32] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 33] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 34] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 35] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 36] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 37] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 38] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 39] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 40] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 41] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 42] = "ColonToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 43] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 44] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 45] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 46] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 47] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 48] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 49] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 50] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 51] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 52] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 53] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 54] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 55] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 56] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 57] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 58] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 59] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 60] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 61] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 62] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 63] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 64] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 65] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 66] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 67] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 68] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 69] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 70] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 71] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 72] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 73] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 74] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 75] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 76] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 77] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 78] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 79] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 80] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 81] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 82] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 83] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 84] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 85] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 86] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 87] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 88] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 89] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 90] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 91] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 92] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 93] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 94] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 95] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 96] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 97] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 98] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 99] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 100] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 101] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 102] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 103] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 104] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 105] = "GetKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 106] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 107] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 108] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 109] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 110] = "StringKeyword"; + SyntaxKind[SyntaxKind["Missing"] = 111] = "Missing"; + SyntaxKind[SyntaxKind["QualifiedName"] = 112] = "QualifiedName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 113] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 114] = "Parameter"; + SyntaxKind[SyntaxKind["Property"] = 115] = "Property"; + SyntaxKind[SyntaxKind["Method"] = 116] = "Method"; + SyntaxKind[SyntaxKind["Constructor"] = 117] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 118] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 119] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 120] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 121] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 122] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypeReference"] = 123] = "TypeReference"; + SyntaxKind[SyntaxKind["TypeQuery"] = 124] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 125] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; + SyntaxKind[SyntaxKind["ArrayLiteral"] = 127] = "ArrayLiteral"; + SyntaxKind[SyntaxKind["ObjectLiteral"] = 128] = "ObjectLiteral"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 129] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAccess"] = 130] = "PropertyAccess"; + SyntaxKind[SyntaxKind["IndexedAccess"] = 131] = "IndexedAccess"; + SyntaxKind[SyntaxKind["CallExpression"] = 132] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 133] = "NewExpression"; + SyntaxKind[SyntaxKind["TypeAssertion"] = 134] = "TypeAssertion"; + SyntaxKind[SyntaxKind["ParenExpression"] = 135] = "ParenExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 136] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 137] = "ArrowFunction"; + SyntaxKind[SyntaxKind["PrefixOperator"] = 138] = "PrefixOperator"; + SyntaxKind[SyntaxKind["PostfixOperator"] = 139] = "PostfixOperator"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 140] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 141] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 142] = "OmittedExpression"; + SyntaxKind[SyntaxKind["Block"] = 143] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 144] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 145] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 146] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 148] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 149] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 150] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 151] = "ForInStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 152] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 154] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 155] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; + SyntaxKind[SyntaxKind["CaseClause"] = 157] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 158] = "DefaultClause"; + SyntaxKind[SyntaxKind["LabelledStatement"] = 159] = "LabelledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 160] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 161] = "TryStatement"; + SyntaxKind[SyntaxKind["TryBlock"] = 162] = "TryBlock"; + SyntaxKind[SyntaxKind["CatchBlock"] = 163] = "CatchBlock"; + SyntaxKind[SyntaxKind["FinallyBlock"] = 164] = "FinallyBlock"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 165] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 166] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 167] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["FunctionBlock"] = 168] = "FunctionBlock"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 169] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 170] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 171] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 172] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 173] = "ModuleBlock"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 174] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 175] = "ExportAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 176] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 177] = "SourceFile"; + SyntaxKind[SyntaxKind["Program"] = 178] = "Program"; + SyntaxKind[SyntaxKind["SyntaxList"] = 179] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 180] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; + })(ts.SyntaxKind || (ts.SyntaxKind = {})); + var SyntaxKind = ts.SyntaxKind; + (function (NodeFlags) { + NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; + NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; + NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; + NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; + NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; + NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; + NodeFlags[NodeFlags["Static"] = 0x00000040] = "Static"; + NodeFlags[NodeFlags["MultiLine"] = 0x00000080] = "MultiLine"; + NodeFlags[NodeFlags["Synthetic"] = 0x00000100] = "Synthetic"; + NodeFlags[NodeFlags["DeclarationFile"] = 0x00000200] = "DeclarationFile"; + NodeFlags[NodeFlags["ExternalModule"] = 0x00000400] = "ExternalModule"; + NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Static] = "Modifier"; + })(ts.NodeFlags || (ts.NodeFlags = {})); + var NodeFlags = ts.NodeFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; + SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; + SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; + SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; + SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; + SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; + SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; + SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; + SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; + SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; + SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; + SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; + SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; + SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; + SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; + SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; + SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; + })(ts.SymbolFlags || (ts.SymbolFlags = {})); + var SymbolFlags = ts.SymbolFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; + })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var NodeCheckFlags = ts.NodeCheckFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; + TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; + TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; + TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; + TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; + TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; + TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; + TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; + TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; + TypeFlags[TypeFlags["Anonymous"] = 0x00002000] = "Anonymous"; + TypeFlags[TypeFlags["FromSignature"] = 0x00004000] = "FromSignature"; + TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; + TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; + TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Anonymous] = "ObjectType"; + })(ts.TypeFlags || (ts.TypeFlags = {})); + var TypeFlags = ts.TypeFlags; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(ts.SignatureKind || (ts.SignatureKind = {})); + var SignatureKind = ts.SignatureKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(ts.IndexKind || (ts.IndexKind = {})); + var IndexKind = ts.IndexKind; + (function (DiagnosticCategory) { + DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; + DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; + DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; + DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; + })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); + var DiagnosticCategory = ts.DiagnosticCategory; + (function (ModuleKind) { + ModuleKind[ModuleKind["None"] = 0] = "None"; + ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; + ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; + })(ts.ModuleKind || (ts.ModuleKind = {})); + var ModuleKind = ts.ModuleKind; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + })(ts.ScriptTarget || (ts.ScriptTarget = {})); + var ScriptTarget = ts.ScriptTarget; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; + CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; + CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; + CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; + CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; + CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; + CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; + CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; + CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; + CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; + CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; + CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; + CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; + CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; + CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; + CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; + CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; + CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; + CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; + CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; + CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; + CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; + CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; + CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; + CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; + CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; + CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; + CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; + CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; + CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; + CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; + CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; + CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; + CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; + CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; + CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; + CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; + CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; + CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; + CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; + CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; + CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; + CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; + CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; + CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; + CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; + CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; + CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; + CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; + CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; + CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; + CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; + CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; + CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; + CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; + CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; + CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; + })(ts.CharacterCodes || (ts.CharacterCodes = {})); + var CharacterCodes = ts.CharacterCodes; +})(ts || (ts = {})); +var ts; +(function (ts) { + function forEach(array, callback) { + var result; + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (result = callback(array[i])) + break; + } + } + return result; + } + ts.forEach = forEach; + function contains(array, value) { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) + return true; + } + } + return false; + } + ts.contains = contains; + function indexOf(array, value) { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) + return i; + } + } + return -1; + } + ts.indexOf = indexOf; + function filter(array, f) { + var result; + if (array) { + result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (f(item)) + result.push(item); + } + } + return result; + } + ts.filter = filter; + function map(array, f) { + var result; + if (array) { + result = []; + var len = array.length; + for (var i = 0; i < len; i++) { + result.push(f(array[i])); + } + } + return result; + } + ts.map = map; + function concatenate(array1, array2) { + if (!array2.length) + return array1; + if (!array1.length) + return array2; + return array1.concat(array2); + } + ts.concatenate = concatenate; + function sum(array, prop) { + var result = 0; + for (var i = 0; i < array.length; i++) { + result += array[i][prop]; + } + return result; + } + ts.sum = sum; + function binarySearch(array, value) { + var low = 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + return ~low; + } + ts.binarySearch = binarySearch; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasProperty(map, key) { + return hasOwnProperty.call(map, key); + } + ts.hasProperty = hasProperty; + function getProperty(map, key) { + return hasOwnProperty.call(map, key) ? map[key] : undefined; + } + ts.getProperty = getProperty; + function isEmpty(map) { + for (var id in map) + return false; + return true; + } + ts.isEmpty = isEmpty; + function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; + } + ts.clone = clone; + function forEachValue(map, callback) { + var result; + for (var id in map) { + if (result = callback(map[id])) + break; + } + return result; + } + ts.forEachValue = forEachValue; + function mapToArray(map) { + var result = []; + for (var id in map) + result.push(map[id]); + return result; + } + ts.mapToArray = mapToArray; + function formatStringFromArgs(text, args, baseIndex) { + baseIndex = baseIndex || 0; + return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + } + ts.localizedDiagnosticMessages = undefined; + function getLocaleSpecificMessage(message) { + if (ts.localizedDiagnosticMessages) { + message = ts.localizedDiagnosticMessages[message]; + } + Debug.assert(message, "Diagnostic message does not exist in locale map."); + return message; + } + function createFileDiagnostic(file, start, length, message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + return { + file: file, + start: start, + length: length, + messageText: text, + category: message.category, + code: message.code + }; + } + ts.createFileDiagnostic = createFileDiagnostic; + function createCompilerDiagnostic(message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + return { + file: undefined, + start: undefined, + length: undefined, + messageText: text, + category: message.category, + code: message.code + }; + } + ts.createCompilerDiagnostic = createCompilerDiagnostic; + function chainDiagnosticMessages(details, message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + return { + messageText: text, + category: message.category, + code: message.code, + next: details + }; + } + ts.chainDiagnosticMessages = chainDiagnosticMessages; + function flattenDiagnosticChain(file, start, length, diagnosticChain) { + var code = diagnosticChain.code; + var category = diagnosticChain.category; + var messageText = ""; + var indent = 0; + while (diagnosticChain) { + if (indent) { + messageText += sys.newLine; + for (var i = 0; i < indent; i++) { + messageText += " "; + } + } + messageText += diagnosticChain.messageText; + indent++; + diagnosticChain = diagnosticChain.next; + } + return { + file: file, + start: start, + length: length, + code: code, + category: category, + messageText: messageText + }; + } + ts.flattenDiagnosticChain = flattenDiagnosticChain; + function compareValues(a, b) { + if (a === b) + return 0; + if (a === undefined) + return -1; + if (b === undefined) + return 1; + return a < b ? -1 : 1; + } + function getDiagnosticFilename(diagnostic) { + return diagnostic.file ? diagnostic.file.filename : undefined; + } + function compareDiagnostics(d1, d2) { + return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; + } + ts.compareDiagnostics = compareDiagnostics; + function deduplicateSortedDiagnostics(diagnostics) { + if (diagnostics.length < 2) { + return diagnostics; + } + var newDiagnostics = [diagnostics[0]]; + var previousDiagnostic = diagnostics[0]; + for (var i = 1; i < diagnostics.length; i++) { + var currentDiagnostic = diagnostics[i]; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + if (!isDupe) { + newDiagnostics.push(currentDiagnostic); + previousDiagnostic = currentDiagnostic; + } + } + return newDiagnostics; + } + ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; + function normalizeSlashes(path) { + return path.replace(/\\/g, "/"); + } + ts.normalizeSlashes = normalizeSlashes; + function getRootLength(path) { + if (path.charCodeAt(0) === 47 /* slash */) { + if (path.charCodeAt(1) !== 47 /* slash */) + return 1; + var p1 = path.indexOf("/", 2); + if (p1 < 0) + return 2; + var p2 = path.indexOf("/", p1 + 1); + if (p2 < 0) + return p1 + 1; + return p2 + 1; + } + if (path.charCodeAt(1) === 58 /* colon */) { + if (path.charCodeAt(2) === 47 /* slash */) + return 3; + return 2; + } + return 0; + } + ts.directorySeparator = "/"; + function getNormalizedParts(normalizedSlashedPath, rootLength) { + var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); + var normalized = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part !== ".") { + if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + normalized.pop(); + } + else { + normalized.push(part); + } + } + } + return normalized; + } + function normalizePath(path) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + var normalized = getNormalizedParts(path, rootLength); + return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); + } + ts.normalizePath = normalizePath; + function getDirectoryPath(path) { + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function isUrl(path) { + return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; + } + ts.isUrl = isUrl; + function isRootedDiskPath(path) { + return getRootLength(path) !== 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + function normalizedPathComponents(path, rootLength) { + var normalizedParts = getNormalizedParts(path, rootLength); + return [path.substr(0, rootLength)].concat(normalizedParts); + } + function getNormalizedPathComponents(path, currentDirectory) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength == 0) { + path = combinePaths(normalizeSlashes(currentDirectory), path); + rootLength = getRootLength(path); + } + return normalizedPathComponents(path, rootLength); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedPathFromPathCompoments(pathComponents) { + if (pathComponents && pathComponents.length) { + return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); + } + } + ts.getNormalizedPathFromPathCompoments = getNormalizedPathFromPathCompoments; + function getNormalizedPathComponentsOfUrl(url) { + var urlLength = url.length; + var rootLength = url.indexOf("://") + "://".length; + while (rootLength < urlLength) { + if (url.charCodeAt(rootLength) === 47 /* slash */) { + rootLength++; + } + else { + break; + } + } + if (rootLength === urlLength) { + return [url]; + } + var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); + if (indexOfNextSlash !== -1) { + rootLength = indexOfNextSlash + 1; + return normalizedPathComponents(url, rootLength); + } + else { + return [url + ts.directorySeparator]; + } + } + function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { + if (isUrl(pathOrUrl)) { + return getNormalizedPathComponentsOfUrl(pathOrUrl); + } + else { + return getNormalizedPathComponents(pathOrUrl, currentDirectory); + } + } + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, isAbsolutePathAnUrl) { + var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); + var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); + if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + directoryComponents.length--; + } + for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { + break; + } + } + if (joinStartIndex) { + var relativePath = ""; + var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); + for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== "") { + relativePath = relativePath + ".." + ts.directorySeparator; + } + } + return relativePath + relativePathComponents.join(ts.directorySeparator); + } + var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); + if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { + absolutePath = "file:///" + absolutePath; + } + return absolutePath; + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function getBaseFilename(path) { + var i = path.lastIndexOf(ts.directorySeparator); + return i < 0 ? path : path.substring(i + 1); + } + ts.getBaseFilename = getBaseFilename; + function combinePaths(path1, path2) { + if (!(path1 && path1.length)) + return path2; + if (!(path2 && path2.length)) + return path1; + if (path2.charAt(0) === ts.directorySeparator) + return path2; + if (path1.charAt(path1.length - 1) === ts.directorySeparator) + return path1 + path2; + return path1 + ts.directorySeparator + path2; + } + ts.combinePaths = combinePaths; + function fileExtensionIs(path, extension) { + var pathLen = path.length; + var extLen = extension.length; + return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; + } + ts.fileExtensionIs = fileExtensionIs; + function Symbol(flags, name) { + this.flags = flags; + this.name = name; + this.declarations = undefined; + } + function Type(checker, flags) { + this.flags = flags; + } + function Signature(checker) { + } + ts.objectAllocator = { + getNodeConstructor: function (kind) { + function Node() { + } + Node.prototype = { + kind: kind, + pos: 0, + end: 0, + flags: 0, + parent: undefined + }; + return Node; + }, + getSymbolConstructor: function () { return Symbol; }, + getTypeConstructor: function () { return Type; }, + getSignatureConstructor: function () { return Signature; } + }; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(ts.AssertionLevel || (ts.AssertionLevel = {})); + var AssertionLevel = ts.AssertionLevel; + (function (Debug) { + var currentAssertionLevel = 0 /* None */; + function shouldAssert(level) { + return this.currentAssertionLevel >= level; + } + Debug.shouldAssert = shouldAssert; + function assert(expression, message, verboseDebugInfo) { + if (!expression) { + var verboseDebugString = ""; + if (verboseDebugInfo) { + verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); + } + throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); + } + } + Debug.assert = assert; + function fail(message) { + Debug.assert(false, message); + } + Debug.fail = fail; + })(ts.Debug || (ts.Debug = {})); + var Debug = ts.Debug; +})(ts || (ts = {})); +var sys = (function () { + function getWScriptSystem() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + return { + args: args, + newLine: "\r\n", + write: function write(s) { + WScript.StdOut.Write(s); + }, + writeErr: function writeErr(s) { + WScript.StdErr.Write(s); + }, + readFile: function readFile(fileName) { + try { + var f = fso.OpenTextFile(fileName, 1); + var s = f.AtEndOfStream ? "" : f.ReadAll(); + if (s.length >= 3 && s.charCodeAt(0) === 0xEF && s.charCodeAt(1) === 0xBB && s.charCodeAt(2) === 0xBF) { + s = s.slice(3); + } + f.Close(); + } + catch (e) { + } + return s; + }, + writeFile: function writeFile(fileName, data) { + var f = fso.CreateTextFile(fileName, true); + f.Write(data); + f.Close(); + }, + resolvePath: function resolvePath(path) { + return fso.GetAbsolutePathName(path); + }, + fileExists: function fileExists(path) { + return fso.FileExists(path); + }, + directoryExists: function directoryExists(path) { + return fso.FolderExists(path); + }, + createDirectory: function createDirectory(directoryName) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath: function getExecutingFilePath() { + return WScript.ScriptFullName; + }, + getCurrentDirectory: function getCurrentDirectory() { + return new ActiveXObject("WScript.Shell").CurrentDirectory; + }, + getMemoryUsage: function getMemoryUsage() { + return 0; + }, + exit: function exit(exitCode) { + WScript.Quit(exitCode); + } + }; + } + function getNodeSystem() { + var _fs = require("fs"); + var _path = require("path"); + var _os = require('os'); + return { + args: process.argv.slice(2), + newLine: _os.EOL, + write: function write(s) { + process.stdout.write(s); + }, + writeErr: function writeErr(s) { + process.stderr.write(s); + }, + readFile: function readFile(fileName) { + try { + var s = _fs.readFileSync(fileName, "utf8"); + } + catch (e) { + } + return s; + }, + writeFile: function writeFile(fileName, data) { + _fs.writeFileSync(fileName, data, "utf8"); + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + fileExists: function fileExists(path) { + return _fs.existsSync(path); + }, + directoryExists: function directoryExists(path) { + return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); + }, + createDirectory: function createDirectory(directoryName) { + if (!this.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function getExecutingFilePath() { + return process.mainModule.filename; + }, + getCurrentDirectory: function getCurrentDirectory() { + return process.cwd(); + }, + getMemoryUsage: function getMemoryUsage() { + global.gc(); + return process.memoryUsage().heapUsed; + }, + exit: function exit(exitCode) { + process.exit(exitCode); + } + }; + } + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return getWScriptSystem(); + } + else if (typeof module !== "undefined" && module.exports) { + return getNodeSystem(); + } + else { + return undefined; + } +})(); +var ts; +(function (ts) { + var nodeConstructors = new Array(180 /* Count */); + function getNodeConstructor(kind) { + return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); + } + ts.getNodeConstructor = getNodeConstructor; + function createRootNode(kind, pos, end, flags) { + var node = new (getNodeConstructor(kind))(); + node.pos = pos; + node.end = end; + node.flags = flags; + return node; + } + var moduleExtensions = [".d.ts", ".ts", ".js"]; + function getModuleNameFromFilename(filename) { + for (var i = 0; i < moduleExtensions.length; i++) { + var ext = moduleExtensions[i]; + var len = filename.length - ext.length; + if (len > 0 && filename.substr(len) === ext) + return filename.substr(0, len); + } + return filename; + } + ts.getModuleNameFromFilename = getModuleNameFromFilename; + function getSourceFileOfNode(node) { + while (node && node.kind !== 177 /* SourceFile */) + node = node.parent; + return node; + } + ts.getSourceFileOfNode = getSourceFileOfNode; + function nodePosToString(node) { + var file = getSourceFileOfNode(node); + var loc = file.getLineAndCharacterFromPosition(node.pos); + return file.filename + "(" + loc.line + "," + loc.character + ")"; + } + ts.nodePosToString = nodePosToString; + function getStartPosOfNode(node) { + return node.pos; + } + ts.getStartPosOfNode = getStartPosOfNode; + function getTokenPosOfNode(node) { + return ts.skipTrivia(getSourceFileOfNode(node).text, node.pos); + } + ts.getTokenPosOfNode = getTokenPosOfNode; + function getSourceTextOfNode(node) { + var text = getSourceFileOfNode(node).text; + return text.substring(ts.skipTrivia(text, node.pos), node.end); + } + ts.getSourceTextOfNode = getSourceTextOfNode; + function getTextOfLiteral(node) { + switch (node.kind) { + case 55 /* Identifier */: + return node.text; + case 3 /* StringLiteral */: + return node.text.substr(1, node.text.length - 2); + case 2 /* NumericLiteral */: + return "" + (+node.text); + } + } + ts.getTextOfLiteral = getTextOfLiteral; + function escapeIdentifier(identifier) { + return identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; + } + ts.escapeIdentifier = escapeIdentifier; + function identifierToString(identifier) { + switch (identifier.kind) { + case 55 /* Identifier */: + return getSourceTextOfNode(identifier); + case 3 /* StringLiteral */: + return identifier.text; + case 2 /* NumericLiteral */: + return "" + (+identifier.text); + } + return "(Missing)"; + } + ts.identifierToString = identifierToString; + function createDiagnosticForNode(node, message, arg0, arg1, arg2) { + var file = getSourceFileOfNode(node); + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + } + ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeFromMessageChain(node, messageChain) { + var file = getSourceFileOfNode(node); + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + return ts.flattenDiagnosticChain(file, start, length, messageChain); + } + ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function forEachChild(node, cbNode, cbNodes) { + function child(node) { + if (node) + return cbNode(node); + } + function children(nodes) { + if (nodes) { + if (cbNodes) + return cbNodes(nodes); + var result; + for (var i = 0, len = nodes.length; i < len; i++) { + if (result = cbNode(nodes[i])) + break; + } + return result; + } + } + if (!node) + return; + switch (node.kind) { + case 112 /* QualifiedName */: + return child(node.left) || child(node.right); + case 113 /* TypeParameter */: + return child(node.name) || child(node.constraint); + case 114 /* Parameter */: + return child(node.name) || child(node.type) || child(node.initializer); + case 115 /* Property */: + case 129 /* PropertyAssignment */: + return child(node.name) || child(node.type) || child(node.initializer); + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + return children(node.typeParameters) || children(node.parameters) || child(node.type); + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); + case 123 /* TypeReference */: + return child(node.typeName) || children(node.typeArguments); + case 124 /* TypeQuery */: + return child(node.exprName); + case 125 /* TypeLiteral */: + return children(node.members); + case 126 /* ArrayType */: + return child(node.elementType); + case 127 /* ArrayLiteral */: + return children(node.elements); + case 128 /* ObjectLiteral */: + return children(node.properties); + case 130 /* PropertyAccess */: + return child(node.left) || child(node.right); + case 131 /* IndexedAccess */: + return child(node.object) || child(node.index); + case 132 /* CallExpression */: + case 133 /* NewExpression */: + return child(node.func) || children(node.typeArguments) || children(node.arguments); + case 134 /* TypeAssertion */: + return child(node.type) || child(node.operand); + case 135 /* ParenExpression */: + return child(node.expression); + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + return child(node.operand); + case 140 /* BinaryExpression */: + return child(node.left) || child(node.right); + case 141 /* ConditionalExpression */: + return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); + case 143 /* Block */: + case 162 /* TryBlock */: + case 164 /* FinallyBlock */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + case 177 /* SourceFile */: + return children(node.statements); + case 144 /* VariableStatement */: + return children(node.declarations); + case 146 /* ExpressionStatement */: + return child(node.expression); + case 147 /* IfStatement */: + return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); + case 148 /* DoStatement */: + return child(node.statement) || child(node.expression); + case 149 /* WhileStatement */: + return child(node.expression) || child(node.statement); + case 150 /* ForStatement */: + return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); + case 151 /* ForInStatement */: + return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return child(node.label); + case 154 /* ReturnStatement */: + return child(node.expression); + case 155 /* WithStatement */: + return child(node.expression) || child(node.statement); + case 156 /* SwitchStatement */: + return child(node.expression) || children(node.clauses); + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + return child(node.expression) || children(node.statements); + case 159 /* LabelledStatement */: + return child(node.label) || child(node.statement); + case 160 /* ThrowStatement */: + return child(node.expression); + case 161 /* TryStatement */: + return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); + case 163 /* CatchBlock */: + return child(node.variable) || children(node.statements); + case 166 /* VariableDeclaration */: + return child(node.name) || child(node.type) || child(node.initializer); + case 169 /* ClassDeclaration */: + return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); + case 170 /* InterfaceDeclaration */: + return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); + case 171 /* EnumDeclaration */: + return child(node.name) || children(node.members); + case 176 /* EnumMember */: + return child(node.name) || child(node.initializer); + case 172 /* ModuleDeclaration */: + return child(node.name) || child(node.body); + case 174 /* ImportDeclaration */: + return child(node.name) || child(node.entityName) || child(node.externalModuleName); + case 175 /* ExportAssignment */: + return child(node.exportName); + } + } + ts.forEachChild = forEachChild; + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; + ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; + ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; + ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; + ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; + ParsingContext[ParsingContext["Count"] = 16] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var parsingContextErrors = [ + ts.Diagnostics.Declaration_or_statement_expected, + ts.Diagnostics.Declaration_or_statement_expected, + ts.Diagnostics.Statement_expected, + ts.Diagnostics.case_or_default_expected, + ts.Diagnostics.Statement_expected, + ts.Diagnostics.Property_or_signature_expected, + ts.Diagnostics.Property_or_method_expected, + ts.Diagnostics.Enum_member_expected, + ts.Diagnostics.Type_reference_expected, + ts.Diagnostics.Variable_declaration_expected, + ts.Diagnostics.Argument_expression_expected, + ts.Diagnostics.Property_assignment_expected, + ts.Diagnostics.Expression_or_comma_expected, + ts.Diagnostics.Parameter_declaration_expected, + ts.Diagnostics.Type_parameter_declaration_expected, + ts.Diagnostics.Type_argument_expected + ]; + var LookAheadMode; + (function (LookAheadMode) { + LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; + LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; + LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; + })(LookAheadMode || (LookAheadMode = {})); + var ModifierContext; + (function (ModifierContext) { + ModifierContext[ModifierContext["ModuleElements"] = 0] = "ModuleElements"; + ModifierContext[ModifierContext["ClassMembers"] = 1] = "ClassMembers"; + ModifierContext[ModifierContext["Parameters"] = 2] = "Parameters"; + })(ModifierContext || (ModifierContext = {})); + function createSourceFile(filename, sourceText, languageVersion) { + var file; + var scanner; + var token; + var parsingContext; + var commentRanges; + var identifiers = {}; + var identifierCount = 0; + var nodeCount = 0; + var lineStarts; + var lookAheadMode = 0 /* NotLookingAhead */; + var inAmbientContext = false; + function getLineAndCharacterlFromSourcePosition(position) { + if (!lineStarts) { + lineStarts = ts.getLineStarts(sourceText); + } + return ts.getLineAndCharacterOfPosition(lineStarts, position); + } + function error(message, arg0, arg1, arg2) { + var start = scanner.getTokenPos(); + var length = scanner.getTextPos() - start; + errorAtPos(start, length, message, arg0, arg1, arg2); + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + function errorAtPos(start, length, message, arg0, arg1, arg2) { + var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + if (start !== lastErrorPos) { + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + if (lookAheadMode === 1 /* NoErrorYet */) { + lookAheadMode = 2 /* Error */; + } + } + function scanError(message) { + var pos = scanner.getTextPos(); + errorAtPos(pos, 0, message); + } + function onComment(pos, end) { + if (commentRanges) + commentRanges.push({ pos: pos, end: end }); + } + function getNodePos() { + return scanner.getStartPos(); + } + function getNodeEnd() { + return scanner.getStartPos(); + } + function nextToken() { + return token = scanner.scan(); + } + function getTokenPos(pos) { + return ts.skipTrivia(sourceText, pos); + } + function reScanGreaterToken() { + return token = scanner.reScanGreaterToken(); + } + function reScanSlashToken() { + return token = scanner.reScanSlashToken(); + } + function lookAheadHelper(callback, alwaysResetState) { + var saveToken = token; + var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveLookAheadMode = lookAheadMode; + lookAheadMode = 1 /* NoErrorYet */; + var result = callback(); + ts.Debug.assert(lookAheadMode === 2 /* Error */ || lookAheadMode === 1 /* NoErrorYet */); + if (lookAheadMode === 2 /* Error */) { + result = undefined; + } + lookAheadMode = saveLookAheadMode; + if (!result || alwaysResetState) { + token = saveToken; + file.syntacticErrors.length = saveSyntacticErrorsLength; + } + return result; + } + function lookAhead(callback) { + var result; + scanner.tryScan(function () { + result = lookAheadHelper(callback, true); + return false; + }); + return result; + } + function tryParse(callback) { + return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); + } + function isIdentifier() { + return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; + } + function isSemicolon() { + return token === 13 /* SemicolonToken */ || token === 6 /* CloseBraceToken */ || scanner.hasPrecedingLineBreak(); + } + function parseExpected(t) { + if (token === t) { + nextToken(); + return true; + } + error(ts.Diagnostics._0_expected, ts.tokenToString(t)); + return false; + } + function parseOptional(t) { + if (token === t) { + nextToken(); + return true; + } + return false; + } + function canParseSemicolon() { + if (token === 13 /* SemicolonToken */) { + return true; + } + return token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + } + function parseSemicolon() { + if (canParseSemicolon()) { + if (token === 13 /* SemicolonToken */) { + nextToken(); + } + } + else { + error(ts.Diagnostics._0_expected, ";"); + } + } + function createNode(kind, pos) { + nodeCount++; + var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); + if (!(pos >= 0)) + pos = scanner.getStartPos(); + node.pos = pos; + node.end = pos; + return node; + } + function finishNode(node) { + node.end = scanner.getStartPos(); + return node; + } + function createMissingNode() { + return createNode(111 /* Missing */); + } + function createIdentifier(isIdentifier) { + identifierCount++; + if (isIdentifier) { + var node = createNode(55 /* Identifier */); + var text = escapeIdentifier(scanner.getIdentifierText()); + node.text = ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); + nextToken(); + return finishNode(node); + } + error(ts.Diagnostics.Identifier_expected); + return createMissingNode(); + } + function parseIdentifier() { + return createIdentifier(isIdentifier()); + } + function parseIdentifierName() { + return createIdentifier(token >= 55 /* Identifier */); + } + function isPropertyName() { + return token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */; + } + function parsePropertyName() { + if (token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { + return parsePrimaryExpression(); + } + return parseIdentifierName(); + } + function isModifier(token) { + switch (token) { + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + case 68 /* ExportKeyword */: + case 104 /* DeclareKeyword */: + return true; + } + return false; + } + function parseContextualModifier(t) { + return token === t && tryParse(function () { + nextToken(); + return token === 9 /* OpenBracketToken */ || isPropertyName(); + }); + } + function parseAnyContextualModifier() { + return isModifier(token) && tryParse(function () { + nextToken(); + return token === 9 /* OpenBracketToken */ || isPropertyName(); + }); + } + function isListElement(kind) { + switch (kind) { + case 0 /* SourceElements */: + case 1 /* ModuleElements */: + return isSourceElement(); + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: + return isStatement(); + case 3 /* SwitchClauses */: + return token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + case 5 /* TypeMembers */: + return isTypeMember(); + case 6 /* ClassMembers */: + return isClassMemberDeclaration(); + case 7 /* EnumMembers */: + case 11 /* ObjectLiteralMembers */: + return isPropertyName(); + case 8 /* BaseTypeReferences */: + return isIdentifier() && ((token !== 69 /* ExtendsKeyword */ && token !== 92 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + case 9 /* VariableDeclarations */: + case 14 /* TypeParameters */: + return isIdentifier(); + case 10 /* ArgumentExpressions */: + return isExpression(); + case 12 /* ArrayLiteralMembers */: + return token === 14 /* CommaToken */ || isExpression(); + case 13 /* Parameters */: + return isParameter(); + case 15 /* TypeArguments */: + return isType(); + } + } + function isListTerminator(kind) { + if (token === 1 /* EndOfFileToken */) { + return true; + } + switch (kind) { + case 1 /* ModuleElements */: + case 2 /* BlockStatements */: + case 3 /* SwitchClauses */: + case 5 /* TypeMembers */: + case 6 /* ClassMembers */: + case 7 /* EnumMembers */: + case 11 /* ObjectLiteralMembers */: + return token === 6 /* CloseBraceToken */; + case 4 /* SwitchClauseStatements */: + return token === 6 /* CloseBraceToken */ || token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + case 8 /* BaseTypeReferences */: + return token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + case 9 /* VariableDeclarations */: + return isVariableDeclaratorListTerminator(); + case 14 /* TypeParameters */: + return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */ || token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + case 10 /* ArgumentExpressions */: + return token === 8 /* CloseParenToken */ || token === 13 /* SemicolonToken */; + case 12 /* ArrayLiteralMembers */: + return token === 10 /* CloseBracketToken */; + case 13 /* Parameters */: + return token === 8 /* CloseParenToken */ || token === 10 /* CloseBracketToken */ || token === 5 /* OpenBraceToken */; + case 15 /* TypeArguments */: + return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */; + } + } + function isVariableDeclaratorListTerminator() { + if (canParseSemicolon()) { + return true; + } + if (token === 76 /* InKeyword */) { + return true; + } + if (token === 23 /* EqualsGreaterThanToken */) { + return true; + } + return false; + } + function isInParsingContext() { + for (var kind = 0; kind < 16 /* Count */; kind++) { + if (parsingContext & (1 << kind)) { + if (isListElement(kind) || isListTerminator(kind)) + return true; + } + } + } + function parseList(kind, parseElement) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = []; + result.pos = getNodePos(); + while (!isListTerminator(kind)) { + if (isListElement(kind)) { + result.push(parseElement()); + } + else { + error(parsingContextErrors[kind]); + if (isInParsingContext()) + break; + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + function parseDelimitedList(kind, parseElement, allowTrailingComma) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = []; + result.pos = getNodePos(); + var errorCountBeforeParsingList = file.syntacticErrors.length; + var commaStart = -1; + while (true) { + if (isListElement(kind)) { + result.push(parseElement()); + commaStart = scanner.getTokenPos(); + if (parseOptional(14 /* CommaToken */)) { + continue; + } + commaStart = -1; + if (isListTerminator(kind)) { + break; + } + error(ts.Diagnostics._0_expected, ","); + } + else if (isListTerminator(kind)) { + if (!allowTrailingComma && commaStart >= 0) { + if (file.syntacticErrors.length === errorCountBeforeParsingList) { + grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + break; + } + else { + error(parsingContextErrors[kind]); + if (token !== 14 /* CommaToken */ && isInParsingContext()) + break; + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + function createMissingList() { + var pos = getNodePos(); + var result = []; + result.pos = pos; + result.end = pos; + return result; + } + function createNodeArray(node) { + var result = [node]; + result.pos = node.pos; + result.end = node.end; + return result; + } + function parseBracketedList(kind, parseElement, startToken, endToken, allowTrailingSeparator) { + if (parseExpected(startToken)) { + var result = parseDelimitedList(kind, parseElement, allowTrailingSeparator); + parseExpected(endToken); + return result; + } + return createMissingList(); + } + function parseEntityName() { + var entity = parseIdentifier(); + while (parseOptional(11 /* DotToken */)) { + var node = createNode(112 /* QualifiedName */, entity.pos); + node.left = entity; + node.right = parseIdentifier(); + entity = finishNode(node); + } + return entity; + } + function parseTokenNode() { + var node = createNode(token); + nextToken(); + return finishNode(node); + } + function parseLiteralNode() { + var node = createNode(token); + node.text = scanner.getTokenText(); + nextToken(); + return finishNode(node); + } + function parseStringLiteral() { + if (token === 3 /* StringLiteral */) + return parseLiteralNode(); + error(ts.Diagnostics.String_literal_expected); + return createMissingNode(); + } + function parseTypeReference() { + var node = createNode(123 /* TypeReference */); + node.typeName = parseEntityName(); + if (!scanner.hasPrecedingLineBreak() && token === 15 /* LessThanToken */) { + node.typeArguments = parseTypeArguments(); + } + return finishNode(node); + } + function parseTypeQuery() { + var node = createNode(124 /* TypeQuery */); + parseExpected(87 /* TypeOfKeyword */); + node.exprName = parseEntityName(); + return finishNode(node); + } + function parseTypeParameter() { + var node = createNode(113 /* TypeParameter */); + node.name = parseIdentifier(); + if (parseOptional(69 /* ExtendsKeyword */)) { + if (isType() || !isExpression()) { + node.constraint = parseType(); + } + else { + var expr = parseUnaryExpression(); + grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + } + } + return finishNode(node); + } + function parseTypeParameters() { + if (token === 15 /* LessThanToken */) { + var pos = getNodePos(); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 15 /* LessThanToken */, 16 /* GreaterThanToken */, false); + if (!result.length) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + return result; + } + } + function parseParameterType() { + return parseOptional(42 /* ColonToken */) ? token === 3 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + } + function isParameter() { + return token === 12 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + } + function parseParameter(flags) { + if (flags === void 0) { flags = 0; } + var node = createNode(114 /* Parameter */); + node.flags |= parseAndCheckModifiers(2 /* Parameters */); + if (parseOptional(12 /* DotDotDotToken */)) { + node.flags |= 8 /* Rest */; + } + node.name = parseIdentifier(); + if (parseOptional(41 /* QuestionToken */)) { + node.flags |= 4 /* QuestionMark */; + } + node.type = parseParameterType(); + node.initializer = parseInitializer(true); + return finishNode(node); + } + function parseSignature(kind, returnToken) { + if (kind === 121 /* ConstructSignature */) { + parseExpected(78 /* NewKeyword */); + } + var typeParameters = parseTypeParameters(); + var parameters = parseParameterList(7 /* OpenParenToken */, 8 /* CloseParenToken */); + checkParameterList(parameters); + var type = parseOptional(returnToken) ? parseType() : undefined; + return { + typeParameters: typeParameters, + parameters: parameters, + type: type + }; + } + function parseParameterList(startDelimiter, endDelimiter) { + return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter, false); + } + function checkParameterList(parameters) { + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + return; + } + if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + return; + } + if (parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + return; + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + return; + } + } + else { + if (seenOptionalParameter) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + return; + } + } + } + } + function parseSignatureMember(kind, returnToken) { + var node = createNode(kind); + var sig = parseSignature(kind, returnToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + parseSemicolon(); + return finishNode(node); + } + function parseIndexSignatureMember() { + var node = createNode(122 /* IndexSignature */); + var errorCountBeforeIndexSignature = file.syntacticErrors.length; + var indexerStart = scanner.getTokenPos(); + node.parameters = parseParameterList(9 /* OpenBracketToken */, 10 /* CloseBracketToken */); + var indexerLength = scanner.getStartPos() - indexerStart; + node.type = parseTypeAnnotation(); + parseSemicolon(); + if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { + checkIndexSignature(node, indexerStart, indexerLength); + } + return finishNode(node); + } + function checkIndexSignature(node, indexerStart, indexerLength) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; + if (parameter) { + grammarErrorOnNode(parameter.name, arityDiagnostic); + } + else { + grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); + } + return; + } + else if (parameter.flags & 8 /* Rest */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + return; + } + else if (parameter.flags & ts.NodeFlags.Modifier) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + return; + } + else if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + return; + } + else if (parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + return; + } + else if (!parameter.type) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + return; + } + else if (parameter.type.kind !== 110 /* StringKeyword */ && parameter.type.kind !== 108 /* NumberKeyword */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + return; + } + else if (!node.type) { + grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + return; + } + } + function parsePropertyOrMethod() { + var node = createNode(0 /* Unknown */); + node.name = parsePropertyName(); + if (parseOptional(41 /* QuestionToken */)) { + node.flags |= 4 /* QuestionMark */; + } + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + node.kind = 116 /* Method */; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + } + else { + node.kind = 115 /* Property */; + node.type = parseTypeAnnotation(); + } + parseSemicolon(); + return finishNode(node); + } + function isTypeMember() { + switch (token) { + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + case 9 /* OpenBracketToken */: + return true; + default: + return isPropertyName() && lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 41 /* QuestionToken */ || token === 42 /* ColonToken */ || canParseSemicolon(); }); + } + } + function parseTypeMember() { + switch (token) { + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + return parseSignatureMember(120 /* CallSignature */, 42 /* ColonToken */); + case 9 /* OpenBracketToken */: + return parseIndexSignatureMember(); + case 78 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */; })) { + return parseSignatureMember(121 /* ConstructSignature */, 42 /* ColonToken */); + } + case 3 /* StringLiteral */: + case 2 /* NumericLiteral */: + return parsePropertyOrMethod(); + default: + if (token >= 55 /* Identifier */) { + return parsePropertyOrMethod(); + } + } + } + function parseTypeLiteral() { + var node = createNode(125 /* TypeLiteral */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseList(5 /* TypeMembers */, parseTypeMember); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + function parseFunctionType(signatureKind) { + var node = createNode(125 /* TypeLiteral */); + var member = createNode(signatureKind); + var sig = parseSignature(signatureKind, 23 /* EqualsGreaterThanToken */); + member.typeParameters = sig.typeParameters; + member.parameters = sig.parameters; + member.type = sig.type; + finishNode(member); + node.members = createNodeArray(member); + return finishNode(node); + } + function parseKeywordAndNoDot() { + var node = parseTokenNode(); + return token === 11 /* DotToken */ ? undefined : node; + } + function parseNonArrayType() { + switch (token) { + case 101 /* AnyKeyword */: + case 110 /* StringKeyword */: + case 108 /* NumberKeyword */: + case 102 /* BooleanKeyword */: + case 89 /* VoidKeyword */: + var node = tryParse(parseKeywordAndNoDot); + return node || parseTypeReference(); + case 87 /* TypeOfKeyword */: + return parseTypeQuery(); + case 5 /* OpenBraceToken */: + return parseTypeLiteral(); + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + return parseFunctionType(120 /* CallSignature */); + case 78 /* NewKeyword */: + return parseFunctionType(121 /* ConstructSignature */); + default: + if (isIdentifier()) { + return parseTypeReference(); + } + } + error(ts.Diagnostics.Type_expected); + return createMissingNode(); + } + function isType() { + switch (token) { + case 101 /* AnyKeyword */: + case 110 /* StringKeyword */: + case 108 /* NumberKeyword */: + case 102 /* BooleanKeyword */: + case 89 /* VoidKeyword */: + case 87 /* TypeOfKeyword */: + case 5 /* OpenBraceToken */: + case 15 /* LessThanToken */: + case 78 /* NewKeyword */: + return true; + case 7 /* OpenParenToken */: + return lookAhead(function () { + nextToken(); + return token === 8 /* CloseParenToken */ || isParameter(); + }); + default: + return isIdentifier(); + } + } + function parseType() { + var type = parseNonArrayType(); + while (type && !scanner.hasPrecedingLineBreak() && parseOptional(9 /* OpenBracketToken */)) { + parseExpected(10 /* CloseBracketToken */); + var node = createNode(126 /* ArrayType */, type.pos); + node.elementType = type; + type = finishNode(node); + } + return type; + } + function parseTypeAnnotation() { + return parseOptional(42 /* ColonToken */) ? parseType() : undefined; + } + function isExpression() { + switch (token) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 7 /* OpenParenToken */: + case 9 /* OpenBracketToken */: + case 5 /* OpenBraceToken */: + case 73 /* FunctionKeyword */: + case 78 /* NewKeyword */: + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + case 87 /* TypeOfKeyword */: + case 89 /* VoidKeyword */: + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + case 15 /* LessThanToken */: + case 55 /* Identifier */: + return true; + default: + return isIdentifier(); + } + } + function parseExpression(noIn) { + var expr = parseAssignmentExpression(noIn); + while (parseOptional(14 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 14 /* CommaToken */, parseAssignmentExpression(noIn)); + } + return expr; + } + function parseInitializer(inParameter, noIn) { + if (token !== 43 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 5 /* OpenBraceToken */) || !isExpression()) { + return undefined; + } + } + parseExpected(43 /* EqualsToken */); + return parseAssignmentExpression(noIn); + } + function parseAssignmentExpression(noIn) { + var arrowExpression = tryParseArrowFunctionExpression(); + if (arrowExpression) { + return arrowExpression; + } + var expr = parseConditionalExpression(noIn); + if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { + var operator = token; + nextToken(); + return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); + } + return expr; + } + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 130 /* PropertyAccess */: + case 131 /* IndexedAccess */: + case 133 /* NewExpression */: + case 132 /* CallExpression */: + case 127 /* ArrayLiteral */: + case 135 /* ParenExpression */: + case 128 /* ObjectLiteral */: + case 136 /* FunctionExpression */: + case 55 /* Identifier */: + case 111 /* Missing */: + case 4 /* RegularExpressionLiteral */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 70 /* FalseKeyword */: + case 79 /* NullKeyword */: + case 83 /* ThisKeyword */: + case 85 /* TrueKeyword */: + case 81 /* SuperKeyword */: + return true; + } + } + return false; + } + function tryParseArrowFunctionExpression() { + return isSimpleArrowFunctionExpression() ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); + } + function isSimpleArrowFunctionExpression() { + if (token === 23 /* EqualsGreaterThanToken */) { + return true; + } + if (token === 55 /* Identifier */) { + return lookAhead(function () { + return nextToken() === 23 /* EqualsGreaterThanToken */; + }); + } + return false; + } + function parseSimpleArrowFunctionExpression() { + ts.Debug.assert(token === 55 /* Identifier */ || token === 23 /* EqualsGreaterThanToken */); + var identifier = parseIdentifier(); + ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(23 /* EqualsGreaterThanToken */); + var parameter = createNode(114 /* Parameter */, identifier.pos); + parameter.name = identifier; + finishNode(parameter); + var signature = { parameters: [parameter] }; + return parseArrowExpressionTail(identifier.pos, signature, false); + } + function tryParseParenthesizedArrowFunctionExpression() { + var pos = getNodePos(); + var triState = isParenthesizedArrowFunctionExpression(); + if (triState !== false) { + var sig = triState === true ? parseSignatureAndArrow() : tryParse(parseSignatureAndArrow); + if (sig) { + return parseArrowExpressionTail(pos, sig, false); + } + } + return undefined; + } + function isParenthesizedArrowFunctionExpression() { + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + return lookAhead(function () { + var first = token; + nextToken(); + if (first === 7 /* OpenParenToken */) { + if (token === 8 /* CloseParenToken */ || token === 12 /* DotDotDotToken */) { + return true; + } + if (!isIdentifier()) { + return false; + } + return undefined; + } + else { + ts.Debug.assert(first === 15 /* LessThanToken */); + if (!isIdentifier()) { + return false; + } + return undefined; + } + }); + } + return false; + } + function parseSignatureAndArrow() { + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + parseExpected(23 /* EqualsGreaterThanToken */); + return sig; + } + function parseArrowExpressionTail(pos, sig, noIn) { + var body = token === 5 /* OpenBraceToken */ ? parseBody() : parseAssignmentExpression(noIn); + return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, body); + } + function isAssignmentOperator() { + return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + } + function parseConditionalExpression(noIn) { + var expr = parseBinaryExpression(noIn); + while (parseOptional(41 /* QuestionToken */)) { + var node = createNode(141 /* ConditionalExpression */, expr.pos); + node.condition = expr; + node.whenTrue = parseAssignmentExpression(false); + parseExpected(42 /* ColonToken */); + node.whenFalse = parseAssignmentExpression(noIn); + expr = finishNode(node); + } + return expr; + } + function parseBinaryExpression(noIn) { + return parseBinaryOperators(parseUnaryExpression(), 0, noIn); + } + function parseBinaryOperators(expr, minPrecedence, noIn) { + while (true) { + reScanGreaterToken(); + var precedence = getOperatorPrecedence(); + if (precedence && precedence > minPrecedence && (!noIn || token !== 76 /* InKeyword */)) { + var operator = token; + nextToken(); + expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); + continue; + } + return expr; + } + } + function getOperatorPrecedence() { + switch (token) { + case 40 /* BarBarToken */: + return 1; + case 39 /* AmpersandAmpersandToken */: + return 2; + case 35 /* BarToken */: + return 3; + case 36 /* CaretToken */: + return 4; + case 34 /* AmpersandToken */: + return 5; + case 19 /* EqualsEqualsToken */: + case 20 /* ExclamationEqualsToken */: + case 21 /* EqualsEqualsEqualsToken */: + case 22 /* ExclamationEqualsEqualsToken */: + return 6; + case 15 /* LessThanToken */: + case 16 /* GreaterThanToken */: + case 17 /* LessThanEqualsToken */: + case 18 /* GreaterThanEqualsToken */: + case 77 /* InstanceOfKeyword */: + case 76 /* InKeyword */: + return 7; + case 31 /* LessThanLessThanToken */: + case 32 /* GreaterThanGreaterThanToken */: + case 33 /* GreaterThanGreaterThanGreaterThanToken */: + return 8; + case 24 /* PlusToken */: + case 25 /* MinusToken */: + return 9; + case 26 /* AsteriskToken */: + case 27 /* SlashToken */: + case 28 /* PercentToken */: + return 10; + } + return undefined; + } + function makeBinaryExpression(left, operator, right) { + var node = createNode(140 /* BinaryExpression */, left.pos); + node.left = left; + node.operator = operator; + node.right = right; + return finishNode(node); + } + function parseUnaryExpression() { + var pos = getNodePos(); + switch (token) { + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + case 87 /* TypeOfKeyword */: + case 89 /* VoidKeyword */: + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + var operator = token; + nextToken(); + var operand = parseUnaryExpression(); + return makeUnaryExpression(138 /* PrefixOperator */, pos, operator, operand); + case 15 /* LessThanToken */: + return parseTypeAssertion(); + } + var primaryExpression = parsePrimaryExpression(); + var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; + if (illegalUsageOfSuperKeyword) { + error(ts.Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + } + var expr = parseCallAndAccess(primaryExpression, false); + ts.Debug.assert(isLeftHandSideExpression(expr)); + if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + var operator = token; + nextToken(); + expr = makeUnaryExpression(139 /* PostfixOperator */, expr.pos, operator, expr); + } + return expr; + } + function parseTypeAssertion() { + var node = createNode(134 /* TypeAssertion */); + parseExpected(15 /* LessThanToken */); + node.type = parseType(); + parseExpected(16 /* GreaterThanToken */); + node.operand = parseUnaryExpression(); + return finishNode(node); + } + function makeUnaryExpression(kind, pos, operator, operand) { + var node = createNode(kind, pos); + node.operator = operator; + node.operand = operand; + return finishNode(node); + } + function parseCallAndAccess(expr, inNewExpression) { + while (true) { + if (parseOptional(11 /* DotToken */)) { + var propertyAccess = createNode(130 /* PropertyAccess */, expr.pos); + propertyAccess.left = expr; + propertyAccess.right = parseIdentifierName(); + expr = finishNode(propertyAccess); + continue; + } + var bracketStart = scanner.getTokenPos(); + if (parseOptional(9 /* OpenBracketToken */)) { + var indexedAccess = createNode(131 /* IndexedAccess */, expr.pos); + indexedAccess.object = expr; + if (inNewExpression && parseOptional(10 /* CloseBracketToken */)) { + indexedAccess.index = createMissingNode(); + grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + else { + indexedAccess.index = parseExpression(); + parseExpected(10 /* CloseBracketToken */); + } + expr = finishNode(indexedAccess); + continue; + } + if ((token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(132 /* CallExpression */, expr.pos); + callExpr.func = expr; + if (token === 15 /* LessThanToken */) { + if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) + return expr; + } + else { + parseExpected(7 /* OpenParenToken */); + } + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, false); + parseExpected(8 /* CloseParenToken */); + expr = finishNode(callExpr); + continue; + } + return expr; + } + } + function parseTypeArgumentsAndOpenParen() { + var result = parseTypeArguments(); + parseExpected(7 /* OpenParenToken */); + return result; + } + function parseTypeArguments() { + var typeArgumentListStart = scanner.getTokenPos(); + var errorCountBeforeTypeParameterList = file.syntacticErrors.length; + var result = parseBracketedList(15 /* TypeArguments */, parseType, 15 /* LessThanToken */, 16 /* GreaterThanToken */, false); + if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { + grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + return result; + } + function parsePrimaryExpression() { + switch (token) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + return parseTokenNode(); + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + return parseLiteralNode(); + case 7 /* OpenParenToken */: + return parseParenExpression(); + case 9 /* OpenBracketToken */: + return parseArrayLiteral(); + case 5 /* OpenBraceToken */: + return parseObjectLiteral(); + case 73 /* FunctionKeyword */: + return parseFunctionExpression(); + case 78 /* NewKeyword */: + return parseNewExpression(); + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + if (reScanSlashToken() === 4 /* RegularExpressionLiteral */) { + return parseLiteralNode(); + } + break; + default: + if (isIdentifier()) { + return parseIdentifier(); + } + } + error(ts.Diagnostics.Expression_expected); + return createMissingNode(); + } + function parseParenExpression() { + var node = createNode(135 /* ParenExpression */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + return finishNode(node); + } + function parseArrayLiteralElement() { + return token === 14 /* CommaToken */ ? createNode(142 /* OmittedExpression */) : parseAssignmentExpression(); + } + function parseArrayLiteral() { + var node = createNode(127 /* ArrayLiteral */); + parseExpected(9 /* OpenBracketToken */); + if (scanner.hasPrecedingLineBreak()) + node.flags |= 128 /* MultiLine */; + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); + parseExpected(10 /* CloseBracketToken */); + return finishNode(node); + } + function parsePropertyAssignment() { + var node = createNode(129 /* PropertyAssignment */); + node.name = parsePropertyName(); + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var body = parseBody(); + node.initializer = makeFunctionExpression(136 /* FunctionExpression */, node.pos, node.name, sig, body); + } + else { + parseExpected(42 /* ColonToken */); + node.initializer = parseAssignmentExpression(false); + } + return finishNode(node); + } + function parseObjectLiteralMember() { + var initialPos = getNodePos(); + var initialToken = token; + if (parseContextualModifier(105 /* GetKeyword */) || parseContextualModifier(109 /* SetKeyword */)) { + var kind = initialToken === 105 /* GetKeyword */ ? 118 /* GetAccessor */ : 119 /* SetAccessor */; + return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + } + return parsePropertyAssignment(); + } + function parseObjectLiteral() { + var node = createNode(128 /* ObjectLiteral */); + parseExpected(5 /* OpenBraceToken */); + if (scanner.hasPrecedingLineBreak()) + node.flags |= 128 /* MultiLine */; + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); + parseExpected(6 /* CloseBraceToken */); + return finishNode(node); + } + function parseFunctionExpression() { + var pos = getNodePos(); + parseExpected(73 /* FunctionKeyword */); + var name = isIdentifier() ? parseIdentifier() : undefined; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var body = parseBody(); + return makeFunctionExpression(136 /* FunctionExpression */, pos, name, sig, body); + } + function makeFunctionExpression(kind, pos, name, sig, body) { + var node = createNode(kind, pos); + node.name = name; + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = body; + return finishNode(node); + } + function parseNewExpression() { + var node = createNode(133 /* NewExpression */); + parseExpected(78 /* NewKeyword */); + node.func = parseCallAndAccess(parsePrimaryExpression(), true); + if (parseOptional(7 /* OpenParenToken */) || token === 15 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, false); + parseExpected(8 /* CloseParenToken */); + } + return finishNode(node); + } + function parseBlock() { + var node = createNode(143 /* Block */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.statements = parseList(2 /* BlockStatements */, parseStatement); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + function parseBody() { + var block = parseBlock(); + block.kind = 168 /* FunctionBlock */; + return block; + } + function parseEmptyStatement() { + var node = createNode(145 /* EmptyStatement */); + parseExpected(13 /* SemicolonToken */); + return finishNode(node); + } + function parseIfStatement() { + var node = createNode(147 /* IfStatement */); + parseExpected(74 /* IfKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(66 /* ElseKeyword */) ? parseStatement() : undefined; + return finishNode(node); + } + function parseDoStatement() { + var node = createNode(148 /* DoStatement */); + parseExpected(65 /* DoKeyword */); + node.statement = parseStatement(); + parseExpected(90 /* WhileKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + parseOptional(13 /* SemicolonToken */); + return finishNode(node); + } + function parseWhileStatement() { + var node = createNode(149 /* WhileStatement */); + parseExpected(90 /* WhileKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseForOrForInStatement() { + var pos = getNodePos(); + parseExpected(72 /* ForKeyword */); + parseExpected(7 /* OpenParenToken */); + if (token !== 13 /* SemicolonToken */) { + if (parseOptional(88 /* VarKeyword */)) { + var declarations = parseVariableDeclarationList(0, true); + if (!declarations.length) { + error(ts.Diagnostics.variable_declaration_list_cannot_be_empty); + } + } + else { + var varOrInit = parseExpression(true); + } + } + if (parseOptional(76 /* InKeyword */)) { + var forInStat = createNode(151 /* ForInStatement */, pos); + if (declarations) { + if (declarations.length > 1) { + error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + forInStat.declaration = declarations[0]; + } + else { + forInStat.variable = varOrInit; + } + forInStat.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + forInStat.statement = parseStatement(); + return finishNode(forInStat); + } + else { + var forStat = createNode(150 /* ForStatement */, pos); + if (declarations) + forStat.declarations = declarations; + if (varOrInit) + forStat.initializer = varOrInit; + parseExpected(13 /* SemicolonToken */); + if (token !== 13 /* SemicolonToken */ && token !== 8 /* CloseParenToken */) { + forStat.condition = parseExpression(); + } + parseExpected(13 /* SemicolonToken */); + if (token !== 8 /* CloseParenToken */) { + forStat.iterator = parseExpression(); + } + parseExpected(8 /* CloseParenToken */); + forStat.statement = parseStatement(); + return finishNode(forStat); + } + } + function parseBreakOrContinueStatement(kind) { + var node = createNode(kind); + parseExpected(kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */); + if (!isSemicolon()) + node.label = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + function parseReturnStatement() { + var node = createNode(154 /* ReturnStatement */); + parseExpected(80 /* ReturnKeyword */); + if (!isSemicolon()) + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function parseWithStatement() { + var node = createNode(155 /* WithStatement */); + parseExpected(91 /* WithKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseCaseClause() { + var node = createNode(157 /* CaseClause */); + parseExpected(57 /* CaseKeyword */); + node.expression = parseExpression(); + parseExpected(42 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, parseStatement); + return finishNode(node); + } + function parseDefaultClause() { + var node = createNode(158 /* DefaultClause */); + parseExpected(63 /* DefaultKeyword */); + parseExpected(42 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, parseStatement); + return finishNode(node); + } + function parseCaseOrDefaultClause() { + return token === 57 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + } + function parseSwitchStatement() { + var node = createNode(156 /* SwitchStatement */); + parseExpected(82 /* SwitchKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + parseExpected(5 /* OpenBraceToken */); + node.clauses = parseList(3 /* SwitchClauses */, parseCaseOrDefaultClause); + parseExpected(6 /* CloseBraceToken */); + return finishNode(node); + } + function parseThrowStatement() { + var node = createNode(160 /* ThrowStatement */); + parseExpected(84 /* ThrowKeyword */); + if (scanner.hasPrecedingLineBreak()) { + error(ts.Diagnostics.Line_break_not_permitted_here); + } + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function parseTryStatement() { + var node = createNode(161 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(86 /* TryKeyword */, 162 /* TryBlock */); + if (token === 58 /* CatchKeyword */) { + node.catchBlock = parseCatchBlock(); + } + if (token === 71 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(71 /* FinallyKeyword */, 164 /* FinallyBlock */); + } + if (!(node.catchBlock || node.finallyBlock)) { + error(ts.Diagnostics.catch_or_finally_expected); + } + return finishNode(node); + } + function parseTokenAndBlock(token, kind) { + var pos = getNodePos(); + parseExpected(token); + var result = parseBlock(); + result.kind = kind; + result.pos = pos; + return result; + } + function parseCatchBlock() { + var pos = getNodePos(); + parseExpected(58 /* CatchKeyword */); + parseExpected(7 /* OpenParenToken */); + var variable = parseIdentifier(); + var typeAnnotationColonStart = scanner.getTokenPos(); + var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; + var typeAnnotation = parseTypeAnnotation(); + parseExpected(8 /* CloseParenToken */); + var result = parseBlock(); + result.kind = 163 /* CatchBlock */; + result.pos = pos; + result.variable = variable; + if (typeAnnotation) { + errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + return result; + } + function parseDebuggerStatement() { + var node = createNode(165 /* DebuggerStatement */); + parseExpected(62 /* DebuggerKeyword */); + parseSemicolon(); + return finishNode(node); + } + function parseLabelledStatement() { + var node = createNode(159 /* LabelledStatement */); + node.label = parseIdentifier(); + parseExpected(42 /* ColonToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseExpressionStatement() { + var node = createNode(146 /* ExpressionStatement */); + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function isStatement() { + switch (token) { + case 5 /* OpenBraceToken */: + case 88 /* VarKeyword */: + case 73 /* FunctionKeyword */: + case 13 /* SemicolonToken */: + case 74 /* IfKeyword */: + case 65 /* DoKeyword */: + case 90 /* WhileKeyword */: + case 72 /* ForKeyword */: + case 61 /* ContinueKeyword */: + case 56 /* BreakKeyword */: + case 80 /* ReturnKeyword */: + case 91 /* WithKeyword */: + case 82 /* SwitchKeyword */: + case 84 /* ThrowKeyword */: + case 86 /* TryKeyword */: + case 62 /* DebuggerKeyword */: + return true; + case 93 /* InterfaceKeyword */: + case 59 /* ClassKeyword */: + case 106 /* ModuleKeyword */: + case 67 /* EnumKeyword */: + if (isDeclaration()) + return false; + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 55 /* Identifier */; })) + return false; + default: + return isExpression(); + } + } + function isStatementOrFunction() { + return token === 73 /* FunctionKeyword */ || isStatement(); + } + function parseStatement() { + switch (token) { + case 5 /* OpenBraceToken */: + return parseBlock(); + case 88 /* VarKeyword */: + return parseVariableStatement(); + case 73 /* FunctionKeyword */: + return parseFunctionDeclaration(); + case 13 /* SemicolonToken */: + return parseEmptyStatement(); + case 74 /* IfKeyword */: + return parseIfStatement(); + case 65 /* DoKeyword */: + return parseDoStatement(); + case 90 /* WhileKeyword */: + return parseWhileStatement(); + case 72 /* ForKeyword */: + return parseForOrForInStatement(); + case 61 /* ContinueKeyword */: + return parseBreakOrContinueStatement(152 /* ContinueStatement */); + case 56 /* BreakKeyword */: + return parseBreakOrContinueStatement(153 /* BreakStatement */); + case 80 /* ReturnKeyword */: + return parseReturnStatement(); + case 91 /* WithKeyword */: + return parseWithStatement(); + case 82 /* SwitchKeyword */: + return parseSwitchStatement(); + case 84 /* ThrowKeyword */: + return parseThrowStatement(); + case 86 /* TryKeyword */: + return parseTryStatement(); + case 62 /* DebuggerKeyword */: + return parseDebuggerStatement(); + default: + if (isIdentifier() && lookAhead(function () { return nextToken() === 42 /* ColonToken */; })) { + return parseLabelledStatement(); + } + return parseExpressionStatement(); + } + } + function parseStatementOrFunction() { + return token === 73 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); + } + function parseAndCheckFunctionBody(isConstructor) { + var initialPosition = scanner.getTokenPos(); + var errorCountBeforeBody = file.syntacticErrors.length; + if (token === 5 /* OpenBraceToken */) { + var body = parseBody(); + if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + grammarErrorAtPos(initialPosition, 1, diagnostic); + } + return body; + } + if (isSemicolon()) { + parseSemicolon(); + return undefined; + } + error(ts.Diagnostics.Block_or_expected); + } + function parseVariableDeclaration(flags, noIn) { + var node = createNode(166 /* VariableDeclaration */); + node.flags = flags; + node.name = parseIdentifier(); + node.type = parseTypeAnnotation(); + node.initializer = parseInitializer(false, noIn); + return finishNode(node); + } + function parseVariableDeclarationList(flags, noIn) { + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); + } + function parseVariableStatement(pos, flags) { + var node = createNode(144 /* VariableStatement */, pos); + if (flags) + node.flags = flags; + var errorCountBeforeVarStatement = file.syntacticErrors.length; + parseExpected(88 /* VarKeyword */); + node.declarations = parseVariableDeclarationList(flags, false); + parseSemicolon(); + if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { + grammarErrorOnNode(node, ts.Diagnostics.variable_declaration_list_cannot_be_empty); + } + return finishNode(node); + } + function parseFunctionDeclaration(pos, flags) { + var node = createNode(167 /* FunctionDeclaration */, pos); + if (flags) + node.flags = flags; + parseExpected(73 /* FunctionKeyword */); + node.name = parseIdentifier(); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(false); + return finishNode(node); + } + function parseConstructorDeclaration(pos, flags) { + var node = createNode(117 /* Constructor */, pos); + node.flags = flags; + parseExpected(103 /* ConstructorKeyword */); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(true); + if (node.typeParameters) { + grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + if (node.type) { + grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + return finishNode(node); + } + function parsePropertyMemberDeclaration(pos, flags) { + var name = parsePropertyName(); + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + var method = createNode(116 /* Method */, pos); + method.flags = flags; + method.name = name; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + method.typeParameters = sig.typeParameters; + method.parameters = sig.parameters; + method.type = sig.type; + method.body = parseAndCheckFunctionBody(false); + return finishNode(method); + } + else { + var property = createNode(115 /* Property */, pos); + property.flags = flags; + property.name = name; + property.type = parseTypeAnnotation(); + property.initializer = parseInitializer(false); + parseSemicolon(); + return finishNode(property); + } + } + function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { + var errorCountBeforeAccessor = file.syntacticErrors.length; + var accessor = parseMemberAccessorDeclaration(kind, pos, flags); + if (errorCountBeforeAccessor === file.syntacticErrors.length) { + if (languageVersion < 1 /* ES5 */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.typeParameters) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 118 /* GetAccessor */ && accessor.parameters.length) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 119 /* SetAccessor */) { + if (accessor.type) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & ts.NodeFlags.Modifier) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + return accessor; + } + function parseMemberAccessorDeclaration(kind, pos, flags) { + var node = createNode(kind, pos); + node.flags = flags; + node.name = parsePropertyName(); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseBody(); + return finishNode(node); + } + function isClassMemberStart() { + var idToken; + while (isModifier(token)) { + idToken = token; + nextToken(); + } + if (isPropertyName()) { + idToken = token; + nextToken(); + } + return idToken && (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 42 /* ColonToken */ || token === 43 /* EqualsToken */ || token === 13 /* SemicolonToken */ || token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || (isPropertyName() && (idToken === 105 /* GetKeyword */ || idToken === 109 /* SetKeyword */))) || (isModifier(idToken) && token === 9 /* OpenBracketToken */); + } + function isClassMemberDeclaration() { + return token === 9 /* OpenBracketToken */ || lookAhead(isClassMemberStart); + } + function parseAndCheckModifiers(context) { + var flags = 0; + var lastStaticModifierStart; + var lastStaticModifierLength; + var lastDeclareModifierStart; + var lastDeclareModifierLength; + var lastPrivateModifierStart; + var lastPrivateModifierLength; + while (true) { + var modifierStart = scanner.getTokenPos(); + var modifierToken = token; + if (!parseAnyContextualModifier()) + break; + var modifierLength = scanner.getStartPos() - modifierStart; + switch (modifierToken) { + case 98 /* PublicKeyword */: + if (flags & 32 /* Private */ || flags & 16 /* Public */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); + } + flags |= 16 /* Public */; + break; + case 96 /* PrivateKeyword */: + if (flags & 32 /* Private */ || flags & 16 /* Public */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); + } + lastPrivateModifierStart = modifierStart; + lastPrivateModifierLength = modifierLength; + flags |= 32 /* Private */; + break; + case 99 /* StaticKeyword */: + if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + lastStaticModifierStart = modifierStart; + lastStaticModifierLength = modifierLength; + flags |= 64 /* Static */; + break; + case 68 /* ExportKeyword */: + if (flags & 1 /* Export */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (context === 1 /* ClassMembers */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 104 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (context === 1 /* ClassMembers */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + lastDeclareModifierStart = modifierStart; + lastDeclareModifierLength = modifierLength; + flags |= 2 /* Ambient */; + break; + } + } + if (token === 103 /* ConstructorKeyword */ && flags & 64 /* Static */) { + grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (token === 103 /* ConstructorKeyword */ && flags & 32 /* Private */) { + grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + else if (token === 75 /* ImportKeyword */ && flags & 2 /* Ambient */) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (token === 93 /* InterfaceKeyword */ && flags & 2 /* Ambient */) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + return flags; + } + function parseClassMemberDeclaration() { + var pos = getNodePos(); + var flags = parseAndCheckModifiers(1 /* ClassMembers */); + if (parseContextualModifier(105 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(118 /* GetAccessor */, pos, flags); + } + if (parseContextualModifier(109 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(119 /* SetAccessor */, pos, flags); + } + if (token === 103 /* ConstructorKeyword */) { + return parseConstructorDeclaration(pos, flags); + } + if (token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { + return parsePropertyMemberDeclaration(pos, flags); + } + if (token === 9 /* OpenBracketToken */) { + if (flags) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + return parseIndexSignatureMember(); + } + error(ts.Diagnostics.Class_member_declaration_expected); + } + function parseClassDeclaration(pos, flags) { + var node = createNode(169 /* ClassDeclaration */, pos); + node.flags = flags; + var errorCountBeforeClassDeclaration = file.syntacticErrors.length; + parseExpected(59 /* ClassKeyword */); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + node.baseType = parseOptional(69 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + var implementsKeywordStart = scanner.getTokenPos(); + var implementsKeywordLength; + if (parseOptional(92 /* ImplementsKeyword */)) { + implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + } + var errorCountBeforeClassBody = file.syntacticErrors.length; + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseList(6 /* ClassMembers */, parseClassMemberDeclaration); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { + grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); + } + return finishNode(node); + } + function parseInterfaceDeclaration(pos, flags) { + var node = createNode(170 /* InterfaceDeclaration */, pos); + node.flags = flags; + var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; + parseExpected(93 /* InterfaceKeyword */); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + var extendsKeywordStart = scanner.getTokenPos(); + var extendsKeywordLength; + if (parseOptional(69 /* ExtendsKeyword */)) { + extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + } + var errorCountBeforeInterfaceBody = file.syntacticErrors.length; + node.members = parseTypeLiteral().members; + if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { + grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); + } + return finishNode(node); + } + function parseEnumMember() { + var node = createNode(176 /* EnumMember */); + node.name = parsePropertyName(); + node.initializer = parseInitializer(false); + return finishNode(node); + } + function parseEnumDeclaration(pos, flags) { + var node = createNode(171 /* EnumDeclaration */, pos); + node.flags = flags; + parseExpected(67 /* EnumKeyword */); + node.name = parseIdentifier(); + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember, true); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + function parseModuleBody() { + var node = createNode(173 /* ModuleBlock */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.statements = parseList(1 /* ModuleElements */, parseSourceElement); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + function parseInternalModuleTail(pos, flags) { + var node = createNode(172 /* ModuleDeclaration */, pos); + node.flags = flags; + node.name = parseIdentifier(); + if (parseOptional(11 /* DotToken */)) { + node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); + } + else { + node.body = parseModuleBody(); + ts.forEach(node.body.statements, function (s) { + if (s.kind === 175 /* ExportAssignment */) { + grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (s.kind === 174 /* ImportDeclaration */ && s.externalModuleName) { + grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + }); + } + return finishNode(node); + } + function parseAmbientExternalModuleDeclaration(pos, flags) { + var node = createNode(172 /* ModuleDeclaration */, pos); + node.flags = flags; + node.name = parseStringLiteral(); + var saveInAmbientContext = inAmbientContext; + inAmbientContext = true; + node.body = parseModuleBody(); + inAmbientContext = saveInAmbientContext; + return finishNode(node); + } + function parseModuleDeclaration(pos, flags) { + parseExpected(106 /* ModuleKeyword */); + return token === 3 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + } + function parseImportDeclaration(pos, flags) { + var node = createNode(174 /* ImportDeclaration */, pos); + node.flags = flags; + parseExpected(75 /* ImportKeyword */); + node.name = parseIdentifier(); + parseExpected(43 /* EqualsToken */); + var entityName = parseEntityName(); + if (entityName.kind === 55 /* Identifier */ && entityName.text === "require" && parseOptional(7 /* OpenParenToken */)) { + node.externalModuleName = parseStringLiteral(); + parseExpected(8 /* CloseParenToken */); + } + else { + node.entityName = entityName; + } + parseSemicolon(); + return finishNode(node); + } + function parseExportAssignmentTail(pos) { + var node = createNode(175 /* ExportAssignment */, pos); + node.exportName = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + function isDeclaration() { + switch (token) { + case 88 /* VarKeyword */: + case 73 /* FunctionKeyword */: + return true; + case 59 /* ClassKeyword */: + case 93 /* InterfaceKeyword */: + case 67 /* EnumKeyword */: + case 75 /* ImportKeyword */: + return lookAhead(function () { return nextToken() >= 55 /* Identifier */; }); + case 106 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 55 /* Identifier */ || token === 3 /* StringLiteral */; }); + case 68 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 43 /* EqualsToken */ || isDeclaration(); }); + case 104 /* DeclareKeyword */: + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + return lookAhead(function () { + nextToken(); + return isDeclaration(); + }); + } + } + function parseDeclaration() { + var pos = getNodePos(); + var flags = parseAndCheckModifiers(0 /* ModuleElements */); + if (token === 68 /* ExportKeyword */) { + nextToken(); + if (parseOptional(43 /* EqualsToken */)) { + return parseExportAssignmentTail(pos); + } + } + var saveInAmbientContext = inAmbientContext; + if (flags & 2 /* Ambient */) { + inAmbientContext = true; + } + var result; + switch (token) { + case 88 /* VarKeyword */: + result = parseVariableStatement(pos, flags); + break; + case 73 /* FunctionKeyword */: + result = parseFunctionDeclaration(pos, flags); + break; + case 59 /* ClassKeyword */: + result = parseClassDeclaration(pos, flags); + break; + case 93 /* InterfaceKeyword */: + result = parseInterfaceDeclaration(pos, flags); + break; + case 67 /* EnumKeyword */: + result = parseEnumDeclaration(pos, flags); + break; + case 106 /* ModuleKeyword */: + result = parseModuleDeclaration(pos, flags); + break; + case 75 /* ImportKeyword */: + result = parseImportDeclaration(pos, flags); + break; + default: + error(ts.Diagnostics.Declaration_expected); + } + inAmbientContext = saveInAmbientContext; + return result; + } + function isSourceElement() { + return isDeclaration() || isStatement(); + } + function parseSourceElement() { + return isDeclaration() ? parseDeclaration() : parseStatement(); + } + function processReferenceComments() { + var referencedFiles = []; + var amdDependencies = []; + commentRanges = []; + token = scanner.scan(); + for (var i = 0; i < commentRanges.length; i++) { + var range = commentRanges[i]; + var comment = sourceText.substring(range.pos, range.end); + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (isNoDefaultLibRegEx.exec(comment)) { + file.hasNoDefaultLib = true; + } + else { + var fullReferenceRegEx = /^(\/\/\/\s*/; + var matchResult = fullReferenceRegEx.exec(comment); + if (!matchResult) { + var start = range.pos; + var length = range.end - start; + errorAtPos(start, length, ts.Diagnostics.Invalid_reference_comment); + } + else { + referencedFiles.push({ + pos: range.pos, + end: range.end, + filename: matchResult[3] + }); + } + } + } + else { + var amdDependencyRegEx = /^\/\/\/\s*= 0 ? filename : filename + extension; + } + function processRootFile(filename, isDefaultLib) { + processSourceFile(ts.normalizePath(addExtension(filename, ".ts")), isDefaultLib); + } + function processSourceFile(filename, isDefaultLib, refFile, refPos, refEnd) { + if (refEnd !== undefined && refPos !== undefined) { + var start = refPos; + var length = refEnd - refPos; + } + if (!ts.fileExtensionIs(filename, ".ts")) { + errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + } + else if (!findSourceFile(filename, isDefaultLib)) { + errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename)); + } + } + function findSourceFile(filename, isDefaultLib) { + var file = getSourceFile(filename); + if (!file) { + file = host.getSourceFile(filename, options.target); + if (file) { + filesByName[filename] = file; + seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + if (!options.noResolve) { + var basePath = ts.getDirectoryPath(filename); + processReferencedFiles(file, basePath); + if (file.flags & 1024 /* ExternalModule */) { + processImportedModules(file, basePath); + } + } + if (isDefaultLib) { + files.unshift(file); + } + else { + files.push(file); + } + ts.forEach(file.syntacticErrors, function (e) { + errors.push(e); + }); + } + } + return file; + } + function processReferencedFiles(file, basePath) { + ts.forEach(file.referencedFiles, function (ref) { + processSourceFile(ts.normalizePath(ts.combinePaths(basePath, ref.filename)), false, file, ref.pos, ref.end); + }); + } + function processImportedModules(file, basePath) { + ts.forEach(file.statements, function (node) { + if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + var moduleName = getTextOfLiteral(node.externalModuleName); + if (moduleName) { + var isRelative = moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../"; + var searchPath = basePath; + while (true) { + var searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); + if (findSourceFile(searchName + ".ts", false) || findSourceFile(searchName + ".d.ts", false)) + break; + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) + break; + searchPath = parentPath; + } + } + } + }); + } + function verifyCompilerOptions() { + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { + if (options.mapRoot) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + if (options.sourceRoot) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + return; + } + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || !!ts.filter(files, function (sourceFile) { return !!(sourceFile.flags & 1024 /* ExternalModule */); }).length))) { + var commonPathComponents; + ts.forEach(files, function (sourceFile) { + if (!(sourceFile.flags & 512 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + var sourcePathCompoments = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathCompoments.pop(); + if (commonPathComponents) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { + if (commonPathComponents[i] !== sourcePathCompoments[i]) { + if (i === 0) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + commonPathComponents.length = i; + break; + } + } + if (sourcePathCompoments.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathCompoments.length; + } + } + else { + commonPathComponents = sourcePathCompoments; + } + } + }); + commonSourceDirectory = ts.getNormalizedPathFromPathCompoments(commonPathComponents); + if (commonSourceDirectory) { + commonSourceDirectory += ts.directorySeparator; + } + } + } + } + ts.createProgram = createProgram; +})(ts || (ts = {})); +var ts; +(function (ts) { + function isInstantiated(node) { + if (node.kind === 170 /* InterfaceDeclaration */) { + return false; + } + else if (node.kind === 174 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return false; + } + else if (node.kind === 173 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { + return false; + } + else if (node.kind === 172 /* ModuleDeclaration */ && !isInstantiated(node.body)) { + return false; + } + else { + return true; + } + } + ts.isInstantiated = isInstantiated; + function bindSourceFile(file) { + var parent; + var container; + var symbolCount = 0; + var Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + file.locals = {}; + container = file; + bind(file); + file.symbolCount = symbolCount; + } + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function addDeclarationToSymbol(symbol, node, symbolKind) { + symbol.flags |= symbolKind; + if (!symbol.declarations) + symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + symbol.exports = {}; + if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + symbol.members = {}; + node.symbol = symbol; + if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + symbol.valueDeclaration = node; + } + function getDeclarationName(node) { + if (node.name) { + if (node.name.kind === 55 /* Identifier */) + return node.name.text; + if (node.kind === 172 /* ModuleDeclaration */) + return '"' + ts.getTextOfLiteral(node.name) + '"'; + return ts.getTextOfLiteral(node.name); + } + switch (node.kind) { + case 117 /* Constructor */: + return "__constructor"; + case 120 /* CallSignature */: + return "__call"; + case 121 /* ConstructSignature */: + return "__new"; + case 122 /* IndexSignature */: + return "__index"; + } + } + function getDisplayName(node) { + return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbols, parent, node, includes, excludes) { + var name = getDeclarationName(node); + if (name !== undefined) { + var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(ts.createDiagnosticForNode(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + if (node.kind === 169 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + return symbol; + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2 /* Ambient */) + return true; + node = node.parent; + } + return false; + } + function declareModuleMember(node, symbolKind, symbolExcludes) { + var exportKind = 0; + var exportExcludes = 0; + if (symbolKind & ts.SymbolFlags.Value) { + exportKind |= 524288 /* ExportValue */; + exportExcludes |= ts.SymbolFlags.Value; + } + if (symbolKind & ts.SymbolFlags.Type) { + exportKind |= 1048576 /* ExportType */; + exportExcludes |= ts.SymbolFlags.Type; + } + if (symbolKind & ts.SymbolFlags.Namespace) { + exportKind |= 2097152 /* ExportNamespace */; + exportExcludes |= ts.SymbolFlags.Namespace; + } + if (node.flags & 1 /* Export */ || (node.kind !== 174 /* ImportDeclaration */ && isAmbientContext(container))) { + if (exportKind) { + var local = declareSymbol(container.locals, undefined, node, exportKind, exportExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes | exportKind); + } + } + function bindDeclaration(node, symbolKind, symbolExcludes) { + switch (container.kind) { + case 172 /* ModuleDeclaration */: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case 177 /* SourceFile */: + if (container.flags & 1024 /* ExternalModule */) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case 169 /* ClassDeclaration */: + if (node.flags & 64 /* Static */) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case 125 /* TypeLiteral */: + case 128 /* ObjectLiteral */: + case 170 /* InterfaceDeclaration */: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case 171 /* EnumDeclaration */: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + if (symbolKind & ts.SymbolFlags.HasLocals) + node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + if (symbolKind & ts.SymbolFlags.IsContainer) + container = node; + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + function bindConstructorDeclaration(node) { + bindDeclaration(node, 4096 /* Constructor */, 0); + ts.forEach(node.parameters, function (p) { + if (p.flags & (16 /* Public */ | 32 /* Private */)) { + bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + } + }); + } + function bindModuleDeclaration(node) { + if (node.name.kind === 3 /* StringLiteral */) { + bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + } + else if (isInstantiated(node)) { + bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + } + else { + bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + } + } + function bindAnonymousDeclaration(node, symbolKind, name) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + if (symbolKind & ts.SymbolFlags.HasLocals) + node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + container = node; + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + function bindCatchVariableDeclaration(node) { + var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node.variable, 1 /* Variable */); + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + function bind(node) { + node.parent = parent; + switch (node.kind) { + case 113 /* TypeParameter */: + bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + break; + case 114 /* Parameter */: + bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + break; + case 166 /* VariableDeclaration */: + bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + break; + case 115 /* Property */: + case 129 /* PropertyAssignment */: + bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + break; + case 176 /* EnumMember */: + bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + break; + case 120 /* CallSignature */: + bindDeclaration(node, 32768 /* CallSignature */, 0); + break; + case 116 /* Method */: + bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + break; + case 121 /* ConstructSignature */: + bindDeclaration(node, 65536 /* ConstructSignature */, 0); + break; + case 122 /* IndexSignature */: + bindDeclaration(node, 131072 /* IndexSignature */, 0); + break; + case 167 /* FunctionDeclaration */: + bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + break; + case 117 /* Constructor */: + bindConstructorDeclaration(node); + break; + case 118 /* GetAccessor */: + bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + break; + case 119 /* SetAccessor */: + bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + break; + case 125 /* TypeLiteral */: + bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + break; + case 128 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + break; + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + break; + case 163 /* CatchBlock */: + bindCatchVariableDeclaration(node); + break; + case 169 /* ClassDeclaration */: + bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + break; + case 170 /* InterfaceDeclaration */: + bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + break; + case 171 /* EnumDeclaration */: + bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + break; + case 172 /* ModuleDeclaration */: + bindModuleDeclaration(node); + break; + case 174 /* ImportDeclaration */: + bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + break; + case 177 /* SourceFile */: + if (node.flags & 1024 /* ExternalModule */) { + bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.getModuleNameFromFilename(node.filename) + '"'); + break; + } + default: + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + } + } + ts.bindSourceFile = bindSourceFile; +})(ts || (ts = {})); +var ts; +(function (ts) { + function getSourceFilePathInNewDir(newDirPath, sourceFile, program, compilerHost) { + var sourceFilePath = ts.getNormalizedPathFromPathCompoments(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); + sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + function emitFiles(resolver) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (!(sourceFile.flags & 512 /* DeclarationFile */)) { + if ((sourceFile.flags & 1024 /* ExternalModule */ || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + emitJavaScript(resolver, (ts.getModuleNameFromFilename(compilerOptions.outDir ? getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile, program, compilerHost) : sourceFile.filename)) + ".js", sourceMapDataList, sourceFile); + } + } + }); + if (compilerOptions.out) { + emitJavaScript(resolver, compilerOptions.out, sourceMapDataList); + } + return sourceMapDataList; + } + ts.emitFiles = emitFiles; + function emitJavaScript(resolver, jsFilePath, sourceMapDataList, root) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + var output = ""; + var indent = 0; + var lineStart = true; + var extendsEmitted = false; + var currentSourceFile; + var write; + var writeEmittedFiles; + var emitStart; + var emitEnd; + var emitToken; + var emitNewSourceFileStart; + var scopeEmitStart; + var scopeEmitEnd; + var sourceMapData; + function initializeEmitterWithoutSourceMaps() { + write = writeToOutput; + writeEmittedFiles = writeJavaScriptFile; + emitStart = function () { + }; + emitEnd = emitStart; + emitToken = emitTokenText; + emitNewSourceFileStart = emitStart; + scopeEmitStart = emitStart; + scopeEmitEnd = emitStart; + } + function initializeEmitterWithSourceMaps() { + var sourceMapDir; + var sourceMapCurrentSourceFile; + var sourceMapSourceIndex = -1; + var sourceMapNameIndexMap = {}; + var sourceMapNameIndices = []; + function getSourceMapNameIndex() { + return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + } + var emittedLine = 1; + var emittedColumn = 1; + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + var lastEncodedNameIndex = 0; + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + function base64VLQFormatEncode(inValue) { + function base64FormatEncode(inValue) { + if (inValue < 64) { + return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + var encodedStr = ""; + do { + var currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } + } + function recordSourceMapSpan(pos) { + emitIndent(); + var sourceLinePos = sourceMapCurrentSourceFile.getLineAndCharacterFromPosition(pos); + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)) { + encodeLastRecordedSourceMapSpan(); + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + nameIndex: getSourceMapNameIndex(), + sourceIndex: sourceMapSourceIndex + }; + } + else { + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + } + } + function recordEmitNodeStartSpan(node) { + recordSourceMapSpan(ts.getTokenPosOfNode(node)); + } + function recordEmitNodeEndSpan(node) { + recordSourceMapSpan(node.end); + } + function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(sourceMapCurrentSourceFile.text, startPos); + recordSourceMapSpan(tokenStartPos); + var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); + recordSourceMapSpan(tokenEndPos); + return tokenEndPos; + } + function recordNewSourceFileStart(node) { + sourceMapCurrentSourceFile = node; + var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, sourceMapCurrentSourceFile.filename, compilerHost.getCurrentDirectory(), true)); + sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; + sourceMapData.inputSourceFileNames.push(sourceMapCurrentSourceFile.filename); + } + function recordScopeNameOfNode(node, scopeName) { + function recordScopeNameIndex(scopeNameIndex) { + sourceMapNameIndices.push(scopeNameIndex); + } + function recordScopeNameStart(scopeName) { + var scopeNameIndex = -1; + if (scopeName) { + var parentIndex = getSourceMapNameIndex(); + if (parentIndex !== -1) { + scopeName = sourceMapData.sourceMapNames[parentIndex] + "." + scopeName; + } + scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); + if (scopeNameIndex === undefined) { + scopeNameIndex = sourceMapData.sourceMapNames.length; + sourceMapData.sourceMapNames.push(scopeName); + sourceMapNameIndexMap[scopeName] = scopeNameIndex; + } + } + recordScopeNameIndex(scopeNameIndex); + } + if (scopeName) { + recordScopeNameStart(scopeName); + } + else if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */ || node.kind === 172 /* ModuleDeclaration */ || node.kind === 169 /* ClassDeclaration */ || node.kind === 171 /* EnumDeclaration */) { + if (node.name) { + scopeName = node.name.text; + } + recordScopeNameStart(scopeName); + } + else { + recordScopeNameIndex(getSourceMapNameIndex()); + } + } + function recordScopeNameEnd() { + sourceMapNameIndices.pop(); + } + ; + function writeWithLineColumnTracking(s) { + writeToOutput(s); + if (s && s.length) { + var lineCol = ts.positionToLineAndCharacter(s, s.length); + if (lineCol.line == 1) { + emittedColumn += lineCol.character - 1; + } + else { + emittedLine += lineCol.line - 1; + emittedColumn = lineCol.character; + } + } + } + function writeJavaScriptAndSourceMapFile() { + encodeLastRecordedSourceMapSpan(); + output += "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + compilerHost.writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings + })); + sourceMapDataList.push(sourceMapData); + writeJavaScriptFile(); + } + var sourceMapJsFile = ts.getBaseFilename(ts.normalizeSlashes(jsFilePath)); + sourceMapData = { + sourceMapFilePath: jsFilePath + ".map", + jsSourceMappingURL: sourceMapJsFile + ".map", + sourceMapFile: sourceMapJsFile, + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapDecodedMappings: [] + }; + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (root) { + sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(sourceMapDir, root, program, compilerHost)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); + } + write = writeWithLineColumnTracking; + writeEmittedFiles = writeJavaScriptAndSourceMapFile; + emitStart = recordEmitNodeStartSpan; + emitEnd = recordEmitNodeEndSpan; + emitToken = writeTextWithSpanRecord; + emitNewSourceFileStart = recordNewSourceFileStart; + scopeEmitStart = recordScopeNameOfNode; + scopeEmitEnd = recordScopeNameEnd; + } + function emitTokenText(tokenKind, startPos, emitFn) { + var tokenString = ts.tokenToString(tokenKind); + if (emitFn) { + emitFn(); + } + else { + write(tokenString); + } + return startPos + tokenString.length; + } + function writeJavaScriptFile() { + compilerHost.writeFile(jsFilePath, output); + } + function emit(node) { + if (node && node.kind != 177 /* SourceFile */) { + emitStart(node); + emitNode(node); + emitEnd(node); + } + else { + emitNewSourceFileStart(node); + emitNode(node); + } + } + function emitIndent() { + if (lineStart) { + lineStart = false; + if (output.length) { + write("\r\n"); + } + for (var i = 0; i < indent; i++) { + write(" "); + } + } + } + function writeToOutput(s) { + if (s && s.length) { + emitIndent(); + output += s; + } + } + function writeLine() { + lineStart = true; + } + function emitOptional(prefix, node) { + if (node) { + write(prefix); + emit(node); + } + } + function emitCommaList(nodes, count) { + if (!(count >= 0)) + count = nodes.length; + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) + write(", "); + emit(nodes[i]); + } + } + } + function emitMultiLineList(nodes) { + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (i) + write(","); + writeLine(); + emit(nodes[i]); + } + } + } + function emitLines(nodes) { + for (var i = 0; i < nodes.length; i++) { + writeLine(); + emit(nodes[i]); + } + } + function emitIdentifierValue(node) { + if (node.kind === 3 /* StringLiteral */ || node.kind === 2 /* NumericLiteral */) { + write(node.text); + } + else { + write("\""); + write(ts.getSourceTextOfNode(node)); + write("\""); + } + } + function isNonExpressionIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 114 /* Parameter */: + case 166 /* VariableDeclaration */: + case 115 /* Property */: + case 129 /* PropertyAssignment */: + case 176 /* EnumMember */: + case 116 /* Method */: + case 167 /* FunctionDeclaration */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return parent.name === node; + case 153 /* BreakStatement */: + case 152 /* ContinueStatement */: + case 175 /* ExportAssignment */: + return false; + case 159 /* LabelledStatement */: + return node.parent.label === node; + case 163 /* CatchBlock */: + return node.parent.variable === node; + } + } + function emitIdentifier(node) { + if (!isNonExpressionIdentifier(node)) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); + } + } + write(ts.getSourceTextOfNode(node)); + } + function emitThis(node) { + if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { + write("_this"); + } + else { + write("this"); + } + } + function emitSuper(node) { + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16 /* SuperInstance */) { + write("_super.prototype"); + } + else if (flags & 32 /* SuperStatic */) { + write("_super"); + } + else { + write("super"); + } + } + function emitArrayLiteral(node) { + if (node.flags & 128 /* MultiLine */) { + write("["); + indent++; + emitMultiLineList(node.elements); + indent--; + writeLine(); + write("]"); + } + else { + write("["); + emitCommaList(node.elements); + write("]"); + } + } + function emitObjectLiteral(node) { + if (!node.properties.length) { + write("{}"); + } + else if (node.flags & 128 /* MultiLine */) { + write("{"); + indent++; + emitMultiLineList(node.properties); + indent--; + writeLine(); + write("}"); + } + else { + write("{ "); + emitCommaList(node.properties); + write(" }"); + } + } + function emitPropertyAssignment(node) { + emit(node.name); + write(": "); + emit(node.initializer); + } + function emitPropertyAccess(node) { + var text = resolver.getPropertyAccessSubstitution(node); + if (text) { + write(text); + return; + } + emit(node.left); + write("."); + emit(node.right); + } + function emitIndexedAccess(node) { + emit(node.object); + write("["); + emit(node.index); + write("]"); + } + function emitCallExpression(node) { + var superCall = false; + if (node.func.kind === 81 /* SuperKeyword */) { + write("_super"); + superCall = true; + } + else { + emit(node.func); + superCall = node.func.kind === 130 /* PropertyAccess */ && node.func.left.kind === 81 /* SuperKeyword */; + } + if (superCall) { + write(".call("); + emitThis(node.func); + if (node.arguments.length) { + write(", "); + emitCommaList(node.arguments); + } + write(")"); + } + else { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + function emitNewExpression(node) { + write("new "); + emit(node.func); + if (node.arguments) { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + function emitParenExpression(node) { + if (node.expression.kind === 134 /* TypeAssertion */) { + var operand = node.expression.operand; + while (operand.kind == 134 /* TypeAssertion */) { + operand = operand.operand; + } + if (operand.kind !== 138 /* PrefixOperator */ && operand.kind !== 139 /* PostfixOperator */ && operand.kind !== 133 /* NewExpression */ && !(operand.kind === 132 /* CallExpression */ && node.parent.kind === 133 /* NewExpression */) && !(operand.kind === 136 /* FunctionExpression */ && node.parent.kind === 132 /* CallExpression */)) { + emit(operand); + return; + } + } + write("("); + emit(node.expression); + write(")"); + } + function emitUnaryExpression(node) { + if (node.kind === 138 /* PrefixOperator */) { + write(ts.tokenToString(node.operator)); + } + if (node.operator >= 55 /* Identifier */) { + write(" "); + } + else if (node.kind === 138 /* PrefixOperator */ && node.operand.kind === 138 /* PrefixOperator */) { + var operand = node.operand; + if (node.operator === 24 /* PlusToken */ && (operand.operator === 24 /* PlusToken */ || operand.operator === 29 /* PlusPlusToken */)) { + write(" "); + } + else if (node.operator === 25 /* MinusToken */ && (operand.operator === 25 /* MinusToken */ || operand.operator === 30 /* MinusMinusToken */)) { + write(" "); + } + } + emit(node.operand); + if (node.kind === 139 /* PostfixOperator */) { + write(ts.tokenToString(node.operator)); + } + } + function emitBinaryExpression(node) { + emit(node.left); + if (node.operator !== 14 /* CommaToken */) + write(" "); + write(ts.tokenToString(node.operator)); + write(" "); + emit(node.right); + } + function emitConditionalExpression(node) { + emit(node.condition); + write(" ? "); + emit(node.whenTrue); + write(" : "); + emit(node.whenFalse); + } + function emitBlock(node) { + emitToken(5 /* OpenBraceToken */, node.pos); + indent++; + scopeEmitStart(node.parent); + if (node.kind === 173 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 172 /* ModuleDeclaration */); + emitCaptureThisForNodeIfNecessary(node.parent); + } + emitLines(node.statements); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.statements.end); + scopeEmitEnd(); + } + function emitEmbeddedStatement(node) { + if (node.kind === 143 /* Block */) { + write(" "); + emit(node); + } + else { + indent++; + writeLine(); + emit(node); + indent--; + } + } + function emitExpressionStatement(node) { + var isArrowExpression = node.expression.kind === 137 /* ArrowFunction */; + if (isArrowExpression) + write("("); + emit(node.expression); + if (isArrowExpression) + write(")"); + write(";"); + } + function emitIfStatement(node) { + var endPos = emitToken(74 /* IfKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + emit(node.expression); + emitToken(8 /* CloseParenToken */, node.expression.end); + emitEmbeddedStatement(node.thenStatement); + if (node.elseStatement) { + writeLine(); + emitToken(66 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 147 /* IfStatement */) { + write(" "); + emit(node.elseStatement); + } + else { + emitEmbeddedStatement(node.elseStatement); + } + } + } + function emitDoStatement(node) { + write("do"); + emitEmbeddedStatement(node.statement); + if (node.statement.kind === 143 /* Block */) { + write(" "); + } + else { + writeLine(); + } + write("while ("); + emit(node.expression); + write(");"); + } + function emitWhileStatement(node) { + write("while ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitForStatement(node) { + var endPos = emitToken(72 /* ForKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + if (node.declarations) { + emitToken(88 /* VarKeyword */, endPos); + write(" "); + emitCommaList(node.declarations); + } + if (node.initializer) { + emit(node.initializer); + } + write(";"); + emitOptional(" ", node.condition); + write(";"); + emitOptional(" ", node.iterator); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitForInStatement(node) { + var endPos = emitToken(72 /* ForKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + if (node.declaration) { + emitToken(88 /* VarKeyword */, endPos); + write(" "); + emit(node.declaration); + } + else { + emit(node.variable); + } + write(" in "); + emit(node.expression); + emitToken(8 /* CloseParenToken */, node.expression.end); + emitEmbeddedStatement(node.statement); + } + function emitBreakOrContinueStatement(node) { + emitToken(node.kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */, node.pos); + emitOptional(" ", node.label); + write(";"); + } + function emitReturnStatement(node) { + emitToken(80 /* ReturnKeyword */, node.pos); + emitOptional(" ", node.expression); + write(";"); + } + function emitWithStatement(node) { + write("with ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitSwitchStatement(node) { + var endPos = emitToken(82 /* SwitchKeyword */, node.pos); + write(" "); + emitToken(7 /* OpenParenToken */, endPos); + emit(node.expression); + endPos = emitToken(8 /* CloseParenToken */, node.expression.end); + write(" "); + emitToken(5 /* OpenBraceToken */, endPos); + indent++; + emitLines(node.clauses); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.clauses.end); + } + function emitCaseOrDefaultClause(node) { + if (node.kind === 157 /* CaseClause */) { + write("case "); + emit(node.expression); + write(":"); + } + else { + write("default:"); + } + indent++; + emitLines(node.statements); + indent--; + } + function emitThrowStatement(node) { + write("throw "); + emit(node.expression); + write(";"); + } + function emitTryStatement(node) { + write("try "); + emit(node.tryBlock); + emit(node.catchBlock); + if (node.finallyBlock) { + writeLine(); + write("finally "); + emit(node.finallyBlock); + } + } + function emitCatchBlock(node) { + writeLine(); + var endPos = emitToken(58 /* CatchKeyword */, node.pos); + write(" "); + emitToken(7 /* OpenParenToken */, endPos); + emit(node.variable); + emitToken(8 /* CloseParenToken */, node.variable.end); + write(" "); + emitBlock(node); + } + function emitDebuggerStatement(node) { + emitToken(62 /* DebuggerKeyword */, node.pos); + write(";"); + } + function emitLabelledStatement(node) { + emit(node.label); + write(": "); + emit(node.statement); + } + function getContainingModule(node) { + do { + node = node.parent; + } while (node && node.kind !== 172 /* ModuleDeclaration */); + return node; + } + function emitModuleMemberName(node) { + emitStart(node.name); + if (node.flags & 1 /* Export */) { + var container = getContainingModule(node); + write(container ? resolver.getModuleObjectName(container) : "exports"); + write("."); + } + emitNode(node.name); + emitEnd(node.name); + } + function emitVariableDeclaration(node) { + emitModuleMemberName(node); + emitOptional(" = ", node.initializer); + } + function emitVariableStatement(node) { + if (!(node.flags & 1 /* Export */)) + write("var "); + emitCommaList(node.declarations); + write(";"); + } + function emitParameter(node) { + emit(node.name); + } + function emitDefaultValueAssignments(node) { + ts.forEach(node.parameters, function (param) { + if (param.initializer) { + writeLine(); + emitStart(param); + write("if ("); + emitNode(param.name); + write(" === void 0)"); + emitEnd(param); + write(" { "); + emitStart(param); + emitNode(param.name); + write(" = "); + emitNode(param.initializer); + emitEnd(param); + write("; }"); + } + }); + } + function emitRestParameter(node) { + if (node.parameters.length && (node.parameters[node.parameters.length - 1].flags & 8 /* Rest */) !== 0) { + var restIndex = node.parameters.length - 1; + var restParam = node.parameters[restIndex]; + writeLine(); + emitStart(restParam); + write("var "); + emitNode(restParam.name); + write(" = [];"); + emitEnd(restParam); + writeLine(); + write("for ("); + emitStart(restParam); + write("var _i = " + restIndex + ";"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i < arguments.length;"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i++"); + emitEnd(restParam); + write(") {"); + indent++; + writeLine(); + emitStart(restParam); + emitNode(restParam.name); + write("[_i - " + restIndex + "] = arguments[_i];"); + emitEnd(restParam); + indent--; + writeLine(); + write("}"); + } + } + function emitAccessor(node) { + write(node.kind === 118 /* GetAccessor */ ? "get " : "set "); + emit(node.name); + emitSignatureAndBody(node); + } + function emitFunctionDeclaration(node) { + if (!node.body) + return; + write("function "); + if (node.kind === 167 /* FunctionDeclaration */ || (node.kind === 136 /* FunctionExpression */ && node.name)) { + emit(node.name); + } + emitSignatureAndBody(node); + } + function emitCaptureThisForNodeIfNecessary(node) { + if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { + writeLine(); + emitStart(node); + write("var _this = this;"); + emitEnd(node); + } + } + function emitSignatureAndBody(node) { + var hasRestParameter = node.parameters.length && (node.parameters[node.parameters.length - 1].flags & 8 /* Rest */) !== 0; + write("("); + emitCommaList(node.parameters, node.parameters.length - (hasRestParameter ? 1 : 0)); + write(") {"); + scopeEmitStart(node); + indent++; + var outPos = output.length; + emitCaptureThisForNodeIfNecessary(node); + emitDefaultValueAssignments(node); + emitRestParameter(node); + if (node.body.kind !== 168 /* FunctionBlock */ && outPos === output.length) { + indent--; + write(" "); + emitStart(node.body); + write("return "); + emitNode(node.body); + emitEnd(node.body); + write("; "); + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + else { + if (node.body.kind === 168 /* FunctionBlock */) { + emitLines(node.body.statements); + } + else { + writeLine(); + write("return "); + emit(node.body); + write(";"); + } + indent--; + writeLine(); + if (node.body.kind === 168 /* FunctionBlock */) { + emitToken(6 /* CloseBraceToken */, node.body.statements.end); + } + else { + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + } + scopeEmitEnd(); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + function findConstructor(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 117 /* Constructor */ && member.body) { + return member; + } + }); + } + function findInitialSuperCall(ctor) { + if (ctor.body) { + var statement = ctor.body.statements[0]; + if (statement && statement.kind === 146 /* ExpressionStatement */) { + var expr = statement.expression; + if (expr && expr.kind === 132 /* CallExpression */) { + var func = expr.func; + if (func && func.kind === 81 /* SuperKeyword */) { + return statement; + } + } + } + } + } + function emitParameterPropertyAssignments(node) { + ts.forEach(node.parameters, function (param) { + if (param.flags & (16 /* Public */ | 32 /* Private */)) { + writeLine(); + emitStart(param); + emitStart(param.name); + write("this."); + emitNode(param.name); + emitEnd(param.name); + write(" = "); + emit(param.name); + write(";"); + emitEnd(param); + } + }); + } + function emitMemberAccess(memberName) { + if (memberName.kind === 3 /* StringLiteral */ || memberName.kind === 2 /* NumericLiteral */) { + write("["); + emitNode(memberName); + write("]"); + } + else { + write("."); + emitNode(memberName); + } + } + function emitMemberAssignments(node, staticFlag) { + ts.forEach(node.members, function (member) { + if (member.kind === 115 /* Property */ && (member.flags & 64 /* Static */) === staticFlag && member.initializer) { + writeLine(); + emitStart(member); + emitStart(member.name); + if (staticFlag) { + emitNode(node.name); + } + else { + write("this"); + } + emitMemberAccess(member.name); + emitEnd(member.name); + write(" = "); + emit(member.initializer); + write(";"); + emitEnd(member); + } + }); + } + function getAccessorDeclarations(node, name, staticFlag) { + var firstAccessor; + var getAccessor; + var setAccessor; + ts.forEach(node.members, function (member) { + if ((member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) && member.name.text === name && (member.flags & 64 /* Static */) === staticFlag) { + if (!firstAccessor) + firstAccessor = member; + if (member.kind === 118 /* GetAccessor */ && !getAccessor) + getAccessor = member; + if (member.kind === 119 /* SetAccessor */ && !setAccessor) + setAccessor = member; + } + }); + return { + firstAccessor: firstAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + function emitMemberFunctions(node) { + ts.forEach(node.members, function (member) { + if (member.kind === 116 /* Method */) { + if (!member.body) + return; + writeLine(); + emitStart(member); + emitStart(member.name); + emitNode(node.name); + if (!(member.flags & 64 /* Static */)) { + write(".prototype"); + } + emitMemberAccess(member.name); + emitEnd(member.name); + write(" = "); + emitStart(member); + emitFunctionDeclaration(member); + emitEnd(member); + emitEnd(member); + write(";"); + } + else if (member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) { + var accessors = getAccessorDeclarations(node, member.name.text, member.flags & 64 /* Static */); + if (member === accessors.firstAccessor) { + writeLine(); + emitStart(member); + write("Object.defineProperty("); + emitStart(member.name); + emitNode(node.name); + if (!(member.flags & 64 /* Static */)) { + write(".prototype"); + } + write(", "); + emitIdentifierValue(member.name); + emitEnd(member.name); + write(", {"); + indent++; + if (accessors.getAccessor) { + writeLine(); + write("get: "); + emitStart(accessors.getAccessor); + write("function "); + emitSignatureAndBody(accessors.getAccessor); + emitEnd(accessors.getAccessor); + write(","); + } + if (accessors.setAccessor) { + writeLine(); + write("set: "); + emitStart(accessors.setAccessor); + write("function "); + emitSignatureAndBody(accessors.setAccessor); + emitEnd(accessors.setAccessor); + write(","); + } + writeLine(); + write("enumerable: true,"); + writeLine(); + write("configurable: true"); + indent--; + writeLine(); + write("});"); + emitEnd(member); + } + } + }); + } + function emitClassDeclaration(node) { + var ctor = findConstructor(node); + write("var "); + emit(node.name); + write(" = (function ("); + if (node.baseType) + write("_super"); + write(") {"); + indent++; + scopeEmitStart(node); + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("__extends("); + emit(node.name); + write(", _super);"); + emitEnd(node.baseType); + } + writeLine(); + emitStart(ctor || node); + write("function "); + emit(node.name); + write("("); + if (ctor) { + emitCommaList(ctor.parameters); + } + write(") {"); + scopeEmitStart(node, "constructor"); + indent++; + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (node.baseType) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("_super.apply(this, arguments);"); + emitEnd(node.baseType); + } + } + emitCaptureThisForNodeIfNecessary(node); + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) + statements = statements.slice(1); + emitLines(statements); + } + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + emitMemberFunctions(node); + emitMemberAssignments(node, 64 /* Static */); + writeLine(); + function emitClassReturnStatement() { + write("return "); + emitNode(node.name); + } + emitToken(6 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + write(";"); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.members.end); + scopeEmitEnd(); + emitStart(node); + write(")("); + if (node.baseType) { + emit(node.baseType.typeName); + } + write(");"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + function emitEnumDeclaration(node) { + if (!(node.flags & 1 /* Export */)) { + emitStart(node); + write("var "); + emit(node.name); + emitEnd(node); + write(";"); + } + writeLine(); + emitStart(node); + write("(function ("); + emit(node.name); + write(") {"); + indent++; + scopeEmitStart(node); + ts.forEach(node.members, function (member) { + writeLine(); + emitStart(member); + emitNode(node.name); + write("["); + emitNode(node.name); + write("["); + emitIdentifierValue(member.name); + write("] = "); + if (member.initializer) { + emit(member.initializer); + } + else { + write(resolver.getEnumMemberValue(member).toString()); + } + write("] = "); + emitIdentifierValue(member.name); + emitEnd(member); + write(";"); + }); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.members.end); + scopeEmitEnd(); + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { + if (moduleDeclaration.body.kind === 172 /* ModuleDeclaration */) { + var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); + return recursiveInnerModule || moduleDeclaration.body; + } + } + function emitModuleDeclaration(node) { + if (!ts.isInstantiated(node)) + return; + if (!(node.flags & 1 /* Export */)) { + emitStart(node); + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); + } + emitStart(node); + write("(function ("); + emit(node.name); + write(") "); + if (node.body.kind === 173 /* ModuleBlock */) { + emit(node.body); + } + else { + write("{"); + indent++; + scopeEmitStart(node); + emitCaptureThisForNodeIfNecessary(node); + writeLine(); + emit(node.body); + indent--; + writeLine(); + var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; + emitToken(6 /* CloseBraceToken */, moduleBlock.statements.end); + scopeEmitEnd(); + } + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + function emitImportDeclaration(node) { + var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); + if (!emitImportDeclaration) { + emitImportDeclaration = !(currentSourceFile.flags & 1024 /* ExternalModule */) && resolver.isTopLevelValueImportedViaEntityName(node); + } + if (emitImportDeclaration) { + if (node.externalModuleName && node.parent.kind === 177 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + write(";"); + emitEnd(node); + } + } + else { + writeLine(); + emitStart(node); + if (!(node.flags & 1 /* Export */)) + write("var "); + emitModuleMemberName(node); + write(" = "); + if (node.entityName) { + emit(node.entityName); + } + else { + write("require("); + emitStart(node.externalModuleName); + write(node.externalModuleName.text); + emitEnd(node.externalModuleName); + emitToken(8 /* CloseParenToken */, node.externalModuleName.end); + } + write(";"); + emitEnd(node); + } + } + } + function getExternalImportDeclarations(node) { + var result = []; + ts.forEach(node.statements, function (stat) { + if (stat.kind === 174 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); + } + }); + return result; + } + function getFirstExportAssignment(sourceFile) { + return ts.forEach(sourceFile.statements, function (node) { + if (node.kind === 175 /* ExportAssignment */) { + return node; + } + }); + } + function emitAMDModule(node) { + var imports = getExternalImportDeclarations(node); + writeLine(); + write("define([\"require\", \"exports\""); + ts.forEach(imports, function (imp) { + write(", "); + write(imp.externalModuleName.text); + }); + ts.forEach(node.amdDependencies, function (amdDependency) { + var text = "\"" + amdDependency + "\""; + write(", "); + write(text); + }); + write("], function (require, exports"); + ts.forEach(imports, function (imp) { + write(", "); + emit(imp.name); + }); + write(") {"); + indent++; + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("return "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + indent--; + writeLine(); + write("});"); + } + function emitCommonJSModule(node) { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("module.exports = "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + } + function emitSourceFile(node) { + currentSourceFile = node; + if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */) { + writeLine(); + write("var __extends = this.__extends || function (d, b) {"); + indent++; + writeLine(); + write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); + writeLine(); + write("function __() { this.constructor = d; }"); + writeLine(); + write("__.prototype = b.prototype;"); + writeLine(); + write("d.prototype = new __();"); + indent--; + writeLine(); + write("};"); + extendsEmitted = true; + } + if (node.flags & 1024 /* ExternalModule */) { + if (compilerOptions.module === 2 /* AMD */) { + emitAMDModule(node); + } + else { + emitCommonJSModule(node); + } + } + else { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + } + } + function emitNode(node) { + if (!node || node.flags & 2 /* Ambient */) + return; + switch (node.kind) { + case 55 /* Identifier */: + return emitIdentifier(node); + case 114 /* Parameter */: + return emitParameter(node); + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return emitAccessor(node); + case 83 /* ThisKeyword */: + return emitThis(node); + case 81 /* SuperKeyword */: + return emitSuper(node); + case 79 /* NullKeyword */: + return write("null"); + case 85 /* TrueKeyword */: + return write("true"); + case 70 /* FalseKeyword */: + return write("false"); + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 4 /* RegularExpressionLiteral */: + return write(node.text); + case 112 /* QualifiedName */: + return emitPropertyAccess(node); + case 127 /* ArrayLiteral */: + return emitArrayLiteral(node); + case 128 /* ObjectLiteral */: + return emitObjectLiteral(node); + case 129 /* PropertyAssignment */: + return emitPropertyAssignment(node); + case 130 /* PropertyAccess */: + return emitPropertyAccess(node); + case 131 /* IndexedAccess */: + return emitIndexedAccess(node); + case 132 /* CallExpression */: + return emitCallExpression(node); + case 133 /* NewExpression */: + return emitNewExpression(node); + case 134 /* TypeAssertion */: + return emit(node.operand); + case 135 /* ParenExpression */: + return emitParenExpression(node); + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return emitFunctionDeclaration(node); + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + return emitUnaryExpression(node); + case 140 /* BinaryExpression */: + return emitBinaryExpression(node); + case 141 /* ConditionalExpression */: + return emitConditionalExpression(node); + case 143 /* Block */: + case 162 /* TryBlock */: + case 164 /* FinallyBlock */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + return emitBlock(node); + case 144 /* VariableStatement */: + return emitVariableStatement(node); + case 145 /* EmptyStatement */: + return write(";"); + case 146 /* ExpressionStatement */: + return emitExpressionStatement(node); + case 147 /* IfStatement */: + return emitIfStatement(node); + case 148 /* DoStatement */: + return emitDoStatement(node); + case 149 /* WhileStatement */: + return emitWhileStatement(node); + case 150 /* ForStatement */: + return emitForStatement(node); + case 151 /* ForInStatement */: + return emitForInStatement(node); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return emitBreakOrContinueStatement(node); + case 154 /* ReturnStatement */: + return emitReturnStatement(node); + case 155 /* WithStatement */: + return emitWithStatement(node); + case 156 /* SwitchStatement */: + return emitSwitchStatement(node); + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + return emitCaseOrDefaultClause(node); + case 159 /* LabelledStatement */: + return emitLabelledStatement(node); + case 160 /* ThrowStatement */: + return emitThrowStatement(node); + case 161 /* TryStatement */: + return emitTryStatement(node); + case 163 /* CatchBlock */: + return emitCatchBlock(node); + case 165 /* DebuggerStatement */: + return emitDebuggerStatement(node); + case 166 /* VariableDeclaration */: + return emitVariableDeclaration(node); + case 169 /* ClassDeclaration */: + return emitClassDeclaration(node); + case 171 /* EnumDeclaration */: + return emitEnumDeclaration(node); + case 172 /* ModuleDeclaration */: + return emitModuleDeclaration(node); + case 174 /* ImportDeclaration */: + return emitImportDeclaration(node); + case 177 /* SourceFile */: + return emitSourceFile(node); + } + } + if (compilerOptions.sourceMap) { + initializeEmitterWithSourceMaps(); + } + else { + initializeEmitterWithoutSourceMaps(); + } + if (root) { + emit(root); + } + else { + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (!(sourceFile.flags & (1024 /* ExternalModule */ | 512 /* DeclarationFile */))) + emit(sourceFile); + }); + } + if (output.length) { + output += "\r\n"; + } + writeEmittedFiles(); + } +})(ts || (ts = {})); +var ts; +(function (ts) { + var nextSymbolId = 1; + var nextNodeId = 1; + var nextMergeId = 1; + function createTypeChecker(program) { + var Symbol = ts.objectAllocator.getSymbolConstructor(); + var Type = ts.objectAllocator.getTypeConstructor(); + var Signature = ts.objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var emptyArray = []; + var emptySymbols = {}; + var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var stringType = createIntrinsicType(2 /* String */, "string"); + var numberType = createIntrinsicType(4 /* Number */, "number"); + var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); + var voidType = createIntrinsicType(16 /* Void */, "void"); + var undefinedType = createIntrinsicType(32 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(64 /* Null */, "null"); + var unknownType = createIntrinsicType(1 /* Any */, "unknown"); + var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); + var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var globals = {}; + var globalObjectType; + var globalFunctionType; + var globalArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var stringLiteralTypes = {}; + var emitExtends = false; + var modulesVerified = false; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var diagnostics = []; + var diagnosticsModified = false; + var checker; + function addDiagnostic(diagnostic) { + diagnostics.push(diagnostic); + diagnosticsModified = true; + } + function error(location, message, arg0, arg1, arg2) { + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + addDiagnostic(diagnostic); + } + function createSymbol(flags, name) { + return new Symbol(flags, name); + } + function getExcludedSymbolFlags(flags) { + var result = 0; + if (flags & 1 /* Variable */) + result |= ts.SymbolFlags.VariableExcludes; + if (flags & 2 /* Property */) + result |= ts.SymbolFlags.PropertyExcludes; + if (flags & 4 /* EnumMember */) + result |= ts.SymbolFlags.EnumMemberExcludes; + if (flags & 8 /* Function */) + result |= ts.SymbolFlags.FunctionExcludes; + if (flags & 16 /* Class */) + result |= ts.SymbolFlags.ClassExcludes; + if (flags & 32 /* Interface */) + result |= ts.SymbolFlags.InterfaceExcludes; + if (flags & 64 /* Enum */) + result |= ts.SymbolFlags.EnumExcludes; + if (flags & 128 /* ValueModule */) + result |= ts.SymbolFlags.ValueModuleExcludes; + if (flags & 2048 /* Method */) + result |= ts.SymbolFlags.MethodExcludes; + if (flags & 8192 /* GetAccessor */) + result |= ts.SymbolFlags.GetAccessorExcludes; + if (flags & 16384 /* SetAccessor */) + result |= ts.SymbolFlags.SetAccessorExcludes; + if (flags & 262144 /* TypeParameter */) + result |= ts.SymbolFlags.TypeParameterExcludes; + if (flags & 4194304 /* Import */) + result |= ts.SymbolFlags.ImportExcludes; + return result; + } + function recordMergedSymbol(target, source) { + if (!source.mergeId) + source.mergeId = nextMergeId++; + mergedSymbols[source.mergeId] = target; + } + function cloneSymbol(symbol) { + var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + result.declarations = symbol.declarations.slice(0); + result.parent = symbol.parent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.members) + result.members = cloneSymbolTable(symbol.members); + if (symbol.exports) + result.exports = cloneSymbolTable(symbol.exports); + recordMergedSymbol(result, symbol); + return result; + } + function extendSymbol(target, source) { + if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + target.flags |= source.flags; + if (!target.valueDeclaration && source.valueDeclaration) + target.valueDeclaration = source.valueDeclaration; + ts.forEach(source.declarations, function (node) { + target.declarations.push(node); + }); + if (source.members) { + if (!target.members) + target.members = {}; + extendSymbolTable(target.members, source.members); + } + if (source.exports) { + if (!target.exports) + target.exports = {}; + extendSymbolTable(target.exports, source.exports); + } + } + else { + ts.forEach(source.declarations, function (node) { + error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + }); + } + recordMergedSymbol(target, source); + } + function cloneSymbolTable(symbolTable) { + var result = {}; + for (var id in symbolTable) { + if (ts.hasProperty(symbolTable, id)) { + result[id] = symbolTable[id]; + } + } + return result; + } + function extendSymbolTable(target, source) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (!ts.hasProperty(target, id)) { + target[id] = source[id]; + } + else { + var symbol = target[id]; + if (!(symbol.flags & 16777216 /* Merged */)) { + target[id] = symbol = cloneSymbol(symbol); + } + extendSymbol(symbol, source[id]); + } + } + } + } + function getSymbolLinks(symbol) { + if (symbol.flags & 33554432 /* Transient */) + return symbol; + if (!symbol.id) + symbol.id = nextSymbolId++; + return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + } + function getNodeLinks(node) { + if (!node.id) + node.id = nextNodeId++; + return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + } + function getSourceFile(node) { + return getAncestor(node, 177 /* SourceFile */); + } + function getSymbol(symbols, name, meaning) { + if (meaning && ts.hasProperty(symbols, name)) { + var symbol = symbols[name]; + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + if (symbol.flags & meaning || (symbol.flags & 4194304 /* Import */ && resolveImport(symbol).flags & meaning)) { + return symbol; + } + } + } + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { + var errorLocation = location; + var result; + var lastLocation; + var memberWithInitializerThatReferencesIdentifierFromConstructor; + function returnResolvedSymbol(s) { + if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { + var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); + return undefined; + } + if (!s && nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, nameArg); + } + return s; + } + while (location) { + if (location.locals && (location.kind !== 177 /* SourceFile */ || location.flags & 1024 /* ExternalModule */)) { + if (result = getSymbol(location.locals, name, meaning)) { + return returnResolvedSymbol(result); + } + } + switch (location.kind) { + case 177 /* SourceFile */: + if (!(location.flags & 1024 /* ExternalModule */)) + break; + case 172 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { + return returnResolvedSymbol(result); + } + break; + case 171 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { + return returnResolvedSymbol(result); + } + break; + case 115 /* Property */: + if (location.parent.kind === 169 /* ClassDeclaration */ && !(location.flags & 64 /* Static */)) { + var ctor = findConstructorDeclaration(location.parent); + if (ctor && ctor.locals) { + if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { + memberWithInitializerThatReferencesIdentifierFromConstructor = location; + } + } + } + break; + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + if (lastLocation && lastLocation.flags & 64 /* Static */) { + error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); + return undefined; + } + else { + return returnResolvedSymbol(result); + } + } + break; + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + break; + case 136 /* FunctionExpression */: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + var id = location.name; + if (id && name === id.text) { + return returnResolvedSymbol(location.symbol); + } + break; + case 163 /* CatchBlock */: + var id = location.variable; + if (name === id.text) { + return returnResolvedSymbol(location.variable.symbol); + } + break; + } + lastLocation = location; + location = location.parent; + } + if (result = getSymbol(globals, name, meaning)) { + return returnResolvedSymbol(result); + } + return returnResolvedSymbol(undefined); + } + function resolveImport(symbol) { + ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + var links = getSymbolLinks(symbol); + if (!links.target) { + links.target = resolvingSymbol; + var node = getDeclarationOfKind(symbol, 174 /* ImportDeclaration */); + var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : resolveEntityName(node, node.entityName, node.entityName.kind === 112 /* QualifiedName */ ? ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace : ts.SymbolFlags.Namespace); + if (links.target === resolvingSymbol) { + links.target = target || unknownSymbol; + } + else { + error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); + } + } + else if (links.target === resolvingSymbol) { + links.target = unknownSymbol; + } + return links.target; + } + function getFullyQualifiedName(symbol) { + return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); + } + function resolveEntityName(location, name, meaning) { + if (name.kind === 55 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (!symbol) { + return; + } + } + else if (name.kind === 112 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); + if (!namespace || name.right.kind === 111 /* Missing */) + return; + var symbol = getSymbol(namespace.exports, name.right.text, meaning); + if (!symbol) { + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + return; + } + } + else { + return; + } + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + return symbol.flags & meaning ? symbol : resolveImport(symbol); + } + function isExternalModuleNameRelative(moduleName) { + var index = moduleName.charAt(0) === '"' ? 1 : 0; + return moduleName.substr(index, 2) === "./" || moduleName.substr(index, 3) === "../"; + } + function resolveExternalModuleName(location, moduleLiteral) { + var searchPath = ts.getDirectoryPath(getSourceFile(location).filename); + var moduleName = ts.getTextOfLiteral(moduleLiteral); + if (!moduleName) + return; + var isRelative = isExternalModuleNameRelative(moduleName); + if (!isRelative) { + var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + if (symbol) { + return getResolvedExportSymbol(symbol); + } + } + while (true) { + var filename = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); + var sourceFile = program.getSourceFile(filename + ".ts") || program.getSourceFile(filename + ".d.ts"); + if (sourceFile || isRelative) + break; + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) + break; + searchPath = parentPath; + } + if (sourceFile) { + if (sourceFile.symbol) { + return getResolvedExportSymbol(sourceFile.symbol); + } + error(moduleLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.filename); + return; + } + error(moduleLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + } + function getResolvedExportSymbol(moduleSymbol) { + var symbol = getExportAssignmentSymbol(moduleSymbol); + if (symbol) { + if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + return symbol; + } + if (symbol.flags & 4194304 /* Import */) { + return resolveImport(symbol); + } + } + return moduleSymbol; + } + function getExportAssignmentSymbol(symbol) { + if (!symbol.exportAssignSymbol) { + var exportInformation = collectExportInformationForSourceFileOrModule(symbol); + if (exportInformation.exportAssignments.length) { + if (exportInformation.exportAssignments.length > 1) { + ts.forEach(exportInformation.exportAssignments, function (node) { return error(node, ts.Diagnostics.A_module_cannot_have_more_than_one_export_assignment); }); + } + var node = exportInformation.exportAssignments[0]; + if (exportInformation.hasExportedMember) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } + if (node.exportName.text) { + var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + } + } + symbol.exportAssignSymbol = exportSymbol || unknownSymbol; + } + return symbol.exportAssignSymbol === unknownSymbol ? undefined : symbol.exportAssignSymbol; + } + function collectExportInformationForSourceFileOrModule(symbol) { + var seenExportedMember = false; + var result = []; + ts.forEach(symbol.declarations, function (declaration) { + var block = (declaration.kind === 177 /* SourceFile */ ? declaration : declaration.body); + ts.forEach(block.statements, function (node) { + if (node.kind === 175 /* ExportAssignment */) { + result.push(node); + } + else { + seenExportedMember = seenExportedMember || (node.flags & 1 /* Export */) !== 0; + } + }); + }); + return { + hasExportedMember: seenExportedMember, + exportAssignments: result + }; + } + function getMergedSymbol(symbol) { + var merged; + return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; + } + function getSymbolOfNode(node) { + return getMergedSymbol(node.symbol); + } + function getParentOfSymbol(symbol) { + return getMergedSymbol(symbol.parent); + } + function getExportSymbolOfValueSymbolIfExported(symbol) { + return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + } + function symbolIsValue(symbol) { + if (symbol.flags & ts.SymbolFlags.Value) { + return true; + } + if (symbol.flags & 4194304 /* Import */) { + return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + } + if (symbol.flags & 8388608 /* Instantiated */) { + return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; + } + return false; + } + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + if (declaration.kind === kind) + return declaration; + } + } + function findConstructorDeclaration(node) { + var members = node.members; + for (var i = 0; i < members.length; i++) { + var member = members[i]; + if (member.kind === 117 /* Constructor */ && member.body) { + return member; + } + } + } + function createType(flags) { + var result = new Type(checker, flags); + result.id = typeCount++; + return result; + } + function createIntrinsicType(kind, intrinsicName) { + var type = createType(kind); + type.intrinsicName = intrinsicName; + return type; + } + function createObjectType(kind, symbol) { + var type = createType(kind); + type.symbol = symbol; + return type; + } + function isReservedMemberName(name) { + return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */; + } + function getNamedMembers(members) { + var result; + for (var id in members) { + if (ts.hasProperty(members, id)) { + if (!isReservedMemberName(id)) { + if (!result) + result = []; + var symbol = members[id]; + if (symbolIsValue(symbol)) { + result.push(symbol); + } + } + } + } + return result || emptyArray; + } + function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { + type.members = members; + type.properties = getNamedMembers(members); + type.callSignatures = callSignatures; + type.constructSignatures = constructSignatures; + if (stringIndexType) + type.stringIndexType = stringIndexType; + if (numberIndexType) + type.numberIndexType = numberIndexType; + return type; + } + function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { + return setObjectTypeMembers(createObjectType(8192 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function isOptionalProperty(propertySymbol) { + if (propertySymbol.flags & 67108864 /* Prototype */) { + return false; + } + return (propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */) && propertySymbol.valueDeclaration.kind !== 114 /* Parameter */; + } + function symbolToString(symbol) { + if (symbol.declarations && symbol.declarations.length > 0) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.identifierToString(declaration.name); + } + } + return symbol.name; + } + function typeToString(type, printArrayAsGenericType) { + var typeStack; + return typeToString(type); + function typeToString(type) { + if (type.flags & ts.TypeFlags.Intrinsic) { + return type.intrinsicName; + } + if (type.flags & 4096 /* Reference */) { + return typeReferenceToString(type); + } + if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + return symbolToString(type.symbol); + } + if (type.flags & 8192 /* Anonymous */) { + return anonymousTypeToString(type); + } + if (type.flags & 256 /* StringLiteral */) { + return type.text; + } + return "{ ... }"; + } + function typeReferenceToString(type) { + if (type.target === globalArrayType && !printArrayAsGenericType) { + return typeToString(type.typeArguments[0]) + "[]"; + } + var result = symbolToString(type.target.symbol); + result += "<"; + for (var i = 0; i < type.typeArguments.length; i++) { + if (i > 0) + result += ", "; + result += typeToString(type.typeArguments[i]); + } + result += ">"; + return result; + } + function anonymousTypeToString(type) { + if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + return symbolTypeToString(type); + } + if (type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (typeStack && ts.contains(typeStack, type)) { + return symbolTypeToString(type); + } + } + if (!typeStack) + typeStack = []; + typeStack.push(type); + var result = literalTypeToString(type); + typeStack.pop(); + return result; + } + function symbolTypeToString(type) { + return "typeof " + symbolToString(type.symbol); + } + function literalTypeToString(type) { + var resolved = resolveObjectTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return "{}"; + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + return signatureToString(resolved.callSignatures[0], true); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + return "new " + signatureToString(resolved.constructSignatures[0], true); + } + } + var result = "{ "; + for (var i = 0; i < resolved.callSignatures.length; i++) { + result += signatureToString(resolved.callSignatures[i]); + result += "; "; + } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + result += "new "; + result += signatureToString(resolved.constructSignatures[i]); + result += "; "; + } + if (resolved.stringIndexType) { + result += "[x: string]: "; + result += typeToString(resolved.stringIndexType); + result += "; "; + } + if (resolved.numberIndexType) { + result += "[x: number]: "; + result += typeToString(resolved.numberIndexType); + result += "; "; + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); + for (var j = 0; j < signatures.length; j++) { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += signatureToString(signatures[j]); + result += "; "; + } + } + else { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += ": "; + result += typeToString(t); + result += "; "; + } + } + result += "}"; + return result; + } + function signatureToString(signature, arrowStyle) { + var result = ""; + if (signature.typeParameters) { + result += "<"; + for (var i = 0; i < signature.typeParameters.length; i++) { + if (i > 0) + result += ", "; + var tp = signature.typeParameters[i]; + result += symbolToString(tp.symbol); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + result += " extends "; + result += typeToString(constraint); + } + } + result += ">"; + } + result += "("; + for (var i = 0; i < signature.parameters.length; i++) { + if (i > 0) + result += ", "; + var p = signature.parameters[i]; + if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { + result += "..."; + } + result += symbolToString(p); + if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { + result += "?"; + } + result += ": "; + result += typeToString(getTypeOfSymbol(p)); + } + result += arrowStyle ? ") => " : "): "; + result += typeToString(getReturnTypeOfSignature(signature)); + return result; + } + } + function getApparentType(type) { + if (type.flags & 512 /* TypeParameter */) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & 512 /* TypeParameter */); + if (!type) + type = emptyObjectType; + } + if (type.flags & ts.TypeFlags.StringLike) { + type = globalStringType; + } + else if (type.flags & ts.TypeFlags.NumberLike) { + type = globalNumberType; + } + else if (type.flags & 8 /* Boolean */) { + type = globalBooleanType; + } + return type; + } + function getTypeOfPrototypeProperty(prototype) { + var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classDecl = getDeclarationOfKind(prototype.parent, 169 /* ClassDeclaration */); + return classDecl.typeParameters ? createTypeReference(classType, ts.map(classDecl.typeParameters, function (_) { return anyType; })) : classType; + } + function getTypeOfVariableDeclaration(declaration) { + var type; + if (declaration.parent.kind === 163 /* CatchBlock */ || declaration.parent.kind === 151 /* ForInStatement */) { + type = anyType; + } + else if (declaration.type) { + type = getTypeFromTypeNode(declaration.type); + } + else { + if (declaration.kind === 114 /* Parameter */ && declaration.parent.kind === 119 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 118 /* GetAccessor */); + if (getter) { + type = getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); + } + } + var unwidenedType; + if (!type) { + if (declaration.initializer) { + unwidenedType = checkAndMarkExpression(declaration.initializer); + type = getWidenedType(unwidenedType); + } + else if (declaration.flags & 8 /* Rest */) { + type = createArrayType(anyType); + } + else { + type = anyType; + } + } + if (program.getCompilerOptions().noImplicitAny && shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type, unwidenedType)) { + reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type); + } + } + return type; + function shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type, unwidenedType) { + if (type === unwidenedType) { + return false; + } + if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { + return false; + } + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 114 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + return false; + } + return true; + } + function reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type) { + var varName = ts.identifierToString(declaration.name); + var typeName = typeToString(type, false); + switch (declaration.kind) { + case 166 /* VariableDeclaration */: + error(declaration, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, varName, typeName); + break; + case 115 /* Property */: + error(declaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, varName, typeName); + break; + case 114 /* Parameter */: + var funcDeclaration = declaration.parent; + if (declaration.flags & 8 /* Rest */) { + error(declaration, ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type, varName); + } + else { + error(declaration, ts.Diagnostics.Parameter_0_implicitly_has_an_1_type, varName, typeName); + } + break; + default: + ts.Debug.fail("Received a '" + ts.SyntaxKind[declaration.kind] + "', but expected '" + ts.SyntaxKind[166 /* VariableDeclaration */] + "', '" + ts.SyntaxKind[115 /* Property */] + "', or '" + ts.SyntaxKind[114 /* Parameter */] + "'.\r\n"); + } + } + } + function getTypeOfVariableOrParameterOrProperty(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + if (symbol.flags & 67108864 /* Prototype */) { + links.type = getTypeOfPrototypeProperty(symbol); + } + else { + links.type = resolvingType; + var type = getTypeOfVariableDeclaration(symbol.valueDeclaration); + if (links.type === resolvingType) { + links.type = type; + } + } + } + else if (links.type === resolvingType) { + links.type = anyType; + } + return links.type; + } + function getSetAccessorTypeAnnotationNode(accessor) { + return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; + } + function getAnnotatedAccessorType(accessor) { + if (accessor) { + if (accessor.kind === 118 /* GetAccessor */) { + return accessor.type && getTypeFromTypeNode(accessor.type); + } + else { + var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + } + } + return undefined; + } + function getTypeOfAccessors(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = resolvingType; + var getter = getDeclarationOfKind(symbol, 118 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 119 /* SetAccessor */); + var type; + var getterReturnType = getAnnotatedAccessorType(getter); + if (getterReturnType) { + type = getterReturnType; + } + else { + var setterParameterType = getAnnotatedAccessorType(setter); + if (setterParameterType) { + type = setterParameterType; + } + else { + if (getter) { + type = getReturnTypeFromBody(getter); + } + else { + if (program.getCompilerOptions().noImplicitAny) { + error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + } + type = anyType; + } + } + } + if (links.type === resolvingType) { + links.type = type; + } + } + else if (links.type === resolvingType) { + links.type = anyType; + } + return links.type; + } + function getTypeOfFuncClassEnumModule(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + var type = links.type = createObjectType(8192 /* Anonymous */, symbol); + } + return links.type; + } + function getTypeOfEnumMember(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + } + return links.type; + } + function getTypeOfImport(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getTypeOfSymbol(resolveImport(symbol)); + } + return links.type; + } + function getTypeOfInstantiatedSymbol(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + } + return links.type; + } + function getTypeOfSymbol(symbol) { + if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + return getTypeOfVariableOrParameterOrProperty(symbol); + } + if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (symbol.flags & 4 /* EnumMember */) { + return getTypeOfEnumMember(symbol); + } + if (symbol.flags & ts.SymbolFlags.Accessor) { + return getTypeOfAccessors(symbol); + } + if (symbol.flags & 4194304 /* Import */) { + return getTypeOfImport(symbol); + } + if (symbol.flags & 8388608 /* Instantiated */) { + return getTypeOfInstantiatedSymbol(symbol); + } + return unknownType; + } + function getTargetType(type) { + return type.flags & 4096 /* Reference */ ? type.target : type; + } + function hasBaseType(type, checkBase) { + return check(type); + function check(type) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(target.baseTypes, check); + } + } + function getDeclaredTypeOfClass(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var declaration = getDeclarationOfKind(symbol, 169 /* ClassDeclaration */); + var type = links.declaredType = createObjectType(1024 /* Class */, symbol); + if (declaration.typeParameters && declaration.typeParameters.length) { + type.flags |= 4096 /* Reference */; + type.typeParameters = ts.map(declaration.typeParameters, function (node) { return getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); }); + type.instantiations = {}; + type.instantiations[getTypeListId(type.typeParameters)] = type; + type.target = type; + type.typeArguments = type.typeParameters; + } + type.baseTypes = []; + if (declaration.baseType) { + var baseType = getTypeFromTypeReferenceNode(declaration.baseType); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024 /* Class */) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, false)); + } + } + else { + error(declaration.baseType, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = emptyArray; + type.declaredConstructSignatures = emptyArray; + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return links.declaredType; + } + function getDeclaredTypeOfInterface(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var firstDeclaration = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); + if (firstDeclaration.typeParameters && firstDeclaration.typeParameters.length) { + type.flags |= 4096 /* Reference */; + type.typeParameters = ts.map(firstDeclaration.typeParameters, function (node) { return getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); }); + type.instantiations = {}; + type.instantiations[getTypeListId(type.typeParameters)] = type; + type.target = type; + type.typeArguments = type.typeParameters; + } + type.baseTypes = []; + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.kind === 170 /* InterfaceDeclaration */ && declaration.baseTypes) { + ts.forEach(declaration.baseTypes, function (node) { + var baseType = getTypeFromTypeReferenceNode(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, false)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + }); + } + }); + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return links.declaredType; + } + function getDeclaredTypeOfEnum(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(128 /* Enum */); + type.symbol = symbol; + links.declaredType = type; + } + return links.declaredType; + } + function getDeclaredTypeOfTypeParameter(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(512 /* TypeParameter */); + type.symbol = symbol; + if (!getDeclarationOfKind(symbol, 113 /* TypeParameter */).constraint) { + type.constraint = noConstraintType; + } + links.declaredType = type; + } + return links.declaredType; + } + function getDeclaredTypeOfImport(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol)); + } + return links.declaredType; + } + function getDeclaredTypeOfSymbol(symbol) { + if (symbol.flags & 16 /* Class */) { + return getDeclaredTypeOfClass(symbol); + } + if (symbol.flags & 32 /* Interface */) { + return getDeclaredTypeOfInterface(symbol); + } + if (symbol.flags & 64 /* Enum */) { + return getDeclaredTypeOfEnum(symbol); + } + if (symbol.flags & 262144 /* TypeParameter */) { + return getDeclaredTypeOfTypeParameter(symbol); + } + if (symbol.flags & 4194304 /* Import */) { + return getDeclaredTypeOfImport(symbol); + } + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); + return unknownType; + } + function createSymbolTable(symbols) { + var result = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = symbol; + } + return result; + } + function createInstantiatedSymbolTable(symbols, mapper) { + var result = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = instantiateSymbol(symbol, mapper); + } + return result; + } + function addInheritedMembers(symbols, baseSymbols) { + for (var i = 0; i < baseSymbols.length; i++) { + var s = baseSymbols[i]; + if (!ts.hasProperty(symbols, s.name)) { + symbols[s.name] = s; + } + } + } + function addInheritedSignatures(signatures, baseSignatures) { + if (baseSignatures) { + for (var i = 0; i < baseSignatures.length; i++) { + signatures.push(baseSignatures[i]); + } + } + } + function concatenateSignaturesWithIdentityCheckIgnoringReturnType(derived, base) { + var signatures = []; + for (var i = 0, len = base.length; i < len; ++i) { + var baseSignature = base[i]; + if (!ts.forEach(derived, function (s) { return isSignatureIdenticalToIgnoringReturnType(s, baseSignature); })) { + signatures.push(baseSignature); + } + } + return ts.concatenate(derived, signatures); + } + function resolveClassOrInterfaceMembers(type) { + var members = type.symbol.members; + var callSignatures = type.declaredCallSignatures; + var constructSignatures = type.declaredConstructSignatures; + var stringIndexType = type.declaredStringIndexType; + var numberIndexType = type.declaredNumberIndexType; + if (type.baseTypes.length) { + members = createSymbolTable(type.declaredProperties); + ts.forEach(type.baseTypes, function (baseType) { + addInheritedMembers(members, getPropertiesOfType(baseType)); + callSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); + constructSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); + }); + } + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveTypeReferenceMembers(type) { + var target = type.target; + var mapper = createTypeMapper(target.typeParameters, type.typeArguments); + var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); + var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); + var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); + var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; + var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; + ts.forEach(target.baseTypes, function (baseType) { + var instantiatedBaseType = instantiateType(baseType, mapper); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + callSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); + constructSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); + }); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { + var sig = new Signature(checker); + sig.declaration = declaration; + sig.typeParameters = typeParameters; + sig.parameters = parameters; + sig.resolvedReturnType = resolvedReturnType; + sig.minArgumentCount = minArgumentCount; + sig.hasRestParameter = hasRestParameter; + sig.hasStringLiterals = hasStringLiterals; + return sig; + } + function cloneSignature(sig) { + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + } + function getDefaultConstructSignatures(classType) { + if (classType.baseTypes.length) { + var baseType = classType.baseTypes[0]; + var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); + return ts.map(baseSignatures, function (baseSignature) { + var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + signature.typeParameters = classType.typeParameters; + signature.resolvedReturnType = classType; + return signature; + }); + } + return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + } + function resolveAnonymousTypeMembers(type) { + var symbol = type.symbol; + var members = emptySymbols; + var callSignatures = emptyArray; + var constructSignatures = emptyArray; + if (symbol.flags & ts.SymbolFlags.HasExports) { + members = symbol.exports; + } + if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 16 /* Class */) { + var classType = getDeclaredTypeOfClass(symbol); + constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + if (!constructSignatures.length) + constructSignatures = getDefaultConstructSignatures(classType); + if (classType.baseTypes.length) { + var members = createSymbolTable(getNamedMembers(members)); + addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + } + } + var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + setObjectTypeMembers(type, members, callSignatures, constructSignatures, undefined, numberIndexType); + } + function resolveObjectTypeMembers(type) { + if (!type.members) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { + resolveClassOrInterfaceMembers(type); + } + else if (type.flags & 8192 /* Anonymous */) { + resolveAnonymousTypeMembers(type); + } + else { + resolveTypeReferenceMembers(type); + } + } + return type; + } + function getPropertiesOfType(type) { + if (type.flags & ts.TypeFlags.ObjectType) { + return resolveObjectTypeMembers(type).properties; + } + return emptyArray; + } + function getPropertyOfType(type, name) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + function getPropertyOfApparentType(type, name) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfType(globalFunctionType, name); + if (symbol) + return symbol; + } + return getPropertyOfType(globalObjectType, name); + } + } + function getSignaturesOfType(type, kind) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; + } + return emptyArray; + } + function getIndexTypeOfType(type, kind) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; + } + } + function getSignatureFromDeclaration(declaration) { + var links = getNodeLinks(declaration); + if (!links.resolvedSignature) { + var classType = declaration.kind === 117 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? ts.map(declaration.typeParameters, function (tp) { return getDeclaredTypeOfTypeParameter(tp.symbol); }) : undefined; + var parameters = []; + var hasStringLiterals = false; + var minArgumentCount = -1; + for (var i = 0, n = declaration.parameters.length; i < n; i++) { + var param = declaration.parameters[i]; + parameters.push(param.symbol); + if (param.type && param.type.kind === 3 /* StringLiteral */) { + hasStringLiterals = true; + } + if (minArgumentCount < 0) { + if (param.initializer || param.flags & (4 /* QuestionMark */ | 8 /* Rest */)) { + minArgumentCount = i; + } + } + } + if (minArgumentCount < 0) { + minArgumentCount = declaration.parameters.length; + } + var returnType; + if (classType) { + returnType = classType; + } + else if (declaration.type) { + returnType = getTypeFromTypeNode(declaration.type); + } + else { + if (declaration.kind === 118 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 119 /* SetAccessor */); + returnType = getAnnotatedAccessorType(setter); + } + if (!returnType && !declaration.body) { + returnType = anyType; + } + } + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, hasRestParameters(declaration), hasStringLiterals); + } + return links.resolvedSignature; + } + function hasRestParameters(s) { + return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; + } + function getSignaturesOfSymbol(symbol) { + if (!symbol) + return emptyArray; + var result = []; + for (var i = 0, len = symbol.declarations.length; i < len; i++) { + var node = symbol.declarations[i]; + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 116 /* Method */: + case 117 /* Constructor */: + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + if (i > 0 && node.body) { + var previous = symbol.declarations[i - 1]; + if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { + break; + } + } + result.push(getSignatureFromDeclaration(node)); + } + } + return result; + } + function getReturnTypeOfSignature(signature) { + if (!signature.resolvedReturnType) { + signature.resolvedReturnType = resolvingType; + if (signature.target) { + var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + } + else { + var type = getReturnTypeFromBody(signature.declaration); + } + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = type; + } + } + else if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = anyType; + } + return signature.resolvedReturnType; + } + function getRestTypeOfSignature(signature) { + if (signature.hasRestParameter) { + var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { + return type.typeArguments[0]; + } + } + return anyType; + } + function getSignatureInstantiation(signature, typeArguments) { + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + } + function getErasedSignature(signature) { + if (!signature.typeParameters) + return signature; + if (!signature.erasedSignatureCache) { + if (signature.target) { + signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); + } + else { + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + } + } + return signature.erasedSignatureCache; + } + function getOrCreateTypeFromSignature(signature) { + if (!signature.isolatedSignatureType) { + var isConstructor = signature.declaration.kind === 117 /* Constructor */ || signature.declaration.kind === 121 /* ConstructSignature */; + var type = createObjectType(8192 /* Anonymous */ | 16384 /* FromSignature */); + type.members = emptySymbols; + type.properties = emptyArray; + type.callSignatures = !isConstructor ? [signature] : emptyArray; + type.constructSignatures = isConstructor ? [signature] : emptyArray; + signature.isolatedSignatureType = type; + } + return signature.isolatedSignatureType; + } + function getIndexSymbol(symbol) { + return symbol.members["__index"]; + } + function getIndexDeclarationOfSymbol(symbol, kind) { + var syntaxKind = kind === 1 /* Number */ ? 108 /* NumberKeyword */ : 110 /* StringKeyword */; + var indexSymbol = getIndexSymbol(symbol); + if (indexSymbol) { + var len = indexSymbol.declarations.length; + for (var i = 0; i < len; i++) { + var node = indexSymbol.declarations[i]; + if (node.parameters.length === 1) { + var parameter = node.parameters[0]; + if (parameter && parameter.type && parameter.type.kind === syntaxKind) { + return node; + } + } + } + } + return undefined; + } + function getIndexTypeOfSymbol(symbol, kind) { + var declaration = getIndexDeclarationOfSymbol(symbol, kind); + return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; + } + function getConstraintOfTypeParameter(type) { + if (!type.constraint) { + if (type.target) { + var targetConstraint = getConstraintOfTypeParameter(type.target); + type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + } + else { + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 113 /* TypeParameter */).constraint); + } + } + return type.constraint === noConstraintType ? undefined : type.constraint; + } + function getTypeListId(types) { + switch (types.length) { + case 1: + return "" + types[0].id; + case 2: + return types[0].id + "," + types[1].id; + default: + var result = ""; + for (var i = 0; i < types.length; i++) { + if (i > 0) + result += ","; + result += types[i].id; + } + return result; + } + } + function createTypeReference(target, typeArguments) { + var id = getTypeListId(typeArguments); + var type = target.instantiations[id]; + if (!type) { + type = target.instantiations[id] = createObjectType(4096 /* Reference */, target.symbol); + type.target = target; + type.typeArguments = typeArguments; + } + return type; + } + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { + var links = getNodeLinks(typeReferenceNode); + if (links.isIllegalTypeReferenceInConstraint !== undefined) { + return links.isIllegalTypeReferenceInConstraint; + } + var currentNode = typeReferenceNode; + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + currentNode = currentNode.parent; + } + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 113 /* TypeParameter */; + return links.isIllegalTypeReferenceInConstraint; + } + function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { + var typeParameterSymbol; + function check(n) { + if (n.kind === 123 /* TypeReference */ && n.typeName.kind === 55 /* Identifier */) { + var links = getNodeLinks(n); + if (links.isIllegalTypeReferenceInConstraint === undefined) { + var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); + if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + } + } + if (links.isIllegalTypeReferenceInConstraint) { + error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); + } + } + ts.forEachChild(n, check); + } + if (typeParameter.constraint) { + typeParameterSymbol = getSymbolOfNode(typeParameter); + check(typeParameter.constraint); + } + } + function getTypeFromTypeReferenceNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + if (symbol) { + var type; + if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; + } + else { + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, function (t) { return getTypeFromTypeNode(t); })); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, true), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type, false)); + type = undefined; + } + } + } + } + links.resolvedType = type || unknownType; + } + return links.resolvedType; + } + function getTypeFromTypeQueryNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getWidenedType(checkExpression(node.exprName)); + } + return links.resolvedType; + } + function getGlobalType(name, arity) { + if (arity === void 0) { arity = 0; } + function getTypeDeclaration(symbol) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + switch (declaration.kind) { + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 125 /* TypeLiteral */: + case 167 /* FunctionDeclaration */: + return declaration; + } + } + } + var symbol = resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + if (!symbol) { + return emptyObjectType; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!(type.flags & ts.TypeFlags.ObjectType)) { + error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, name); + return emptyObjectType; + } + if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, name, arity); + return emptyObjectType; + } + return type; + } + function createArrayType(elementType) { + return globalArrayType !== emptyObjectType ? createTypeReference(globalArrayType, [elementType]) : emptyObjectType; + } + function getTypeFromArrayTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + } + return links.resolvedType; + } + function getTypeFromTypeLiteralNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = node.symbol; + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + links.resolvedType = createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + return links.resolvedType; + } + function getStringLiteralType(node) { + var stringText = ts.getTextOfLiteral(node); + if (ts.hasProperty(stringLiteralTypes, stringText)) + return stringLiteralTypes[stringText]; + var type = stringLiteralTypes[stringText] = createType(256 /* StringLiteral */); + type.text = node.text; + return type; + } + function getTypeFromStringLiteral(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getStringLiteralType(node); + } + return links.resolvedType; + } + function getTypeFromTypeNode(node) { + switch (node.kind) { + case 101 /* AnyKeyword */: + return anyType; + case 110 /* StringKeyword */: + return stringType; + case 108 /* NumberKeyword */: + return numberType; + case 102 /* BooleanKeyword */: + return booleanType; + case 89 /* VoidKeyword */: + return voidType; + case 3 /* StringLiteral */: + return getTypeFromStringLiteral(node); + case 123 /* TypeReference */: + return getTypeFromTypeReferenceNode(node); + case 124 /* TypeQuery */: + return getTypeFromTypeQueryNode(node); + case 126 /* ArrayType */: + return getTypeFromArrayTypeNode(node); + case 125 /* TypeLiteral */: + return getTypeFromTypeLiteralNode(node); + default: + return unknownType; + } + } + function instantiateList(items, mapper, instantiator) { + if (items && items.length) { + var result = []; + for (var i = 0; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } + return items; + } + function createUnaryTypeMapper(source, target) { + return function (t) { return t === source ? target : t; }; + } + function createBinaryTypeMapper(source1, target1, source2, target2) { + return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + } + function createTypeMapper(sources, targets) { + switch (sources.length) { + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + } + return function (t) { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) + return targets[i]; + } + return t; + }; + } + function createUnaryTypeEraser(source) { + return function (t) { return t === source ? anyType : t; }; + } + function createBinaryTypeEraser(source1, source2) { + return function (t) { return t === source1 || t === source2 ? anyType : t; }; + } + function createTypeEraser(sources) { + switch (sources.length) { + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); + } + return function (t) { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) + return anyType; + } + return t; + }; + } + function createInferenceMapper(context) { + return function (t) { + for (var i = 0; i < context.typeParameters.length; i++) { + if (t === context.typeParameters[i]) { + return getInferredType(context, i); + } + } + return t; + }; + } + function identityMapper(type) { + return type; + } + function combineTypeMappers(mapper1, mapper2) { + return function (t) { return mapper2(mapper1(t)); }; + } + function instantiateTypeParameter(typeParameter, mapper) { + var result = createType(512 /* TypeParameter */); + result.symbol = typeParameter.symbol; + if (typeParameter.constraint) { + result.constraint = instantiateType(typeParameter.constraint, mapper); + } + else { + result.target = typeParameter; + result.mapper = mapper; + } + return result; + } + function instantiateSignature(signature, mapper, eraseTypeParameters) { + if (signature.typeParameters && !eraseTypeParameters) { + var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + } + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + result.target = signature; + result.mapper = mapper; + return result; + } + function instantiateSymbol(symbol, mapper) { + if (symbol.flags & 8388608 /* Instantiated */) { + var links = getSymbolLinks(symbol); + symbol = links.target; + mapper = combineTypeMappers(links.mapper, mapper); + } + var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); + result.declarations = symbol.declarations; + result.parent = symbol.parent; + result.target = symbol; + result.mapper = mapper; + if (symbol.valueDeclaration) { + result.valueDeclaration = symbol.valueDeclaration; + } + return result; + } + function instantiateAnonymousType(type, mapper) { + var result = createObjectType(8192 /* Anonymous */, type.symbol); + result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + result.members = createSymbolTable(result.properties); + result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); + result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + result.stringIndexType = instantiateType(stringIndexType, mapper); + if (numberIndexType) + result.numberIndexType = instantiateType(numberIndexType, mapper); + return result; + } + function instantiateType(type, mapper) { + if (type.flags & 512 /* TypeParameter */) { + return mapper(type); + } + if (type.flags & 8192 /* Anonymous */) { + return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + } + if (type.flags & 4096 /* Reference */) { + return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); + } + return type; + } + function isContextSensitiveExpression(node) { + switch (node.kind) { + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); + case 128 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 129 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 127 /* ArrayLiteral */: + return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); + case 141 /* ConditionalExpression */: + return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); + case 140 /* BinaryExpression */: + return node.operator === 40 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + } + return false; + } + function getTypeWithoutConstructors(type) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (resolved.constructSignatures.length) { + var result = createObjectType(8192 /* Anonymous */, type.symbol); + result.members = resolved.members; + result.properties = resolved.properties; + result.callSignatures = resolved.callSignatures; + result.constructSignatures = emptyArray; + type = result; + } + } + return type; + } + var subtypeRelation = {}; + var assignableRelation = {}; + function isTypeSubtypeOf(source, target) { + return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); + } + function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + } + function isTypeAssignableTo(source, target) { + return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + } + function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + } + function isTypeRelatedTo(source, target, relation) { + return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + } + function isSignatureAssignableTo(source, target) { + var sourceType = getOrCreateTypeFromSignature(source); + var targetType = getOrCreateTypeFromSignature(target); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + } + function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + var errorInfo; + var sourceStack; + var targetStack; + var expandingFlags; + var depth = 0; + var overflow = false; + var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + if (overflow) { + error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source, false), typeToString(target, false)); + } + else if (errorInfo) { + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + } + return result; + function reportError(message, arg0, arg1) { + errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1); + } + function isRelatedTo(source, target, reportErrors) { + return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); + } + function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + if (source === target) + return true; + if (target.flags & 1 /* Any */) + return true; + if (source === undefinedType) + return true; + if (source === nullType && target !== undefinedType) + return true; + if (source.flags & 128 /* Enum */ && target === numberType) + return true; + if (source.flags & 256 /* StringLiteral */ && target === stringType) + return true; + if (relation === assignableRelation) { + if (source.flags & 1 /* Any */) + return true; + if (source === numberType && target.flags & 128 /* Enum */) + return true; + } + if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { + if (typeParameterRelatedTo(source, target)) { + return true; + } + } + else { + var saveErrorInfo = errorInfo; + if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return true; + } + } + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + var apparent = getApparentType(source); + if (apparent.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(apparent, target, reportStructuralErrors)) { + errorInfo = saveErrorInfo; + return true; + } + } + if (reportErrors) { + chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; + terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; + reportError(diagnosticKey, typeToString(source, false), typeToString(target, false)); + } + return false; + } + function typesRelatedTo(sources, targets, reportErrors) { + for (var i = 0, len = sources.length; i < len; i++) { + if (!isRelatedTo(sources[i], targets[i], reportErrors)) + return false; + } + return true; + } + function typeParameterRelatedTo(source, target) { + while (true) { + var constraint = getConstraintOfTypeParameter(source); + if (constraint === target) + return true; + if (!(constraint && constraint.flags & 512 /* TypeParameter */)) + break; + source = constraint; + } + return false; + } + function objectTypeRelatedTo(source, target, reportErrors) { + if (overflow) + return false; + var result; + var id = source.id + "," + target.id; + if ((result = relation[id]) !== undefined) + return result; + if (depth > 0) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) + return true; + } + if (depth === 100) { + overflow = true; + return false; + } + } + else { + sourceStack = []; + targetStack = []; + expandingFlags = 0; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + var saveExpandingFlags = expandingFlags; + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) + expandingFlags |= 1; + if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) + expandingFlags |= 2; + result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + expandingFlags = saveExpandingFlags; + depth--; + if (depth === 0) { + relation[id] = result; + } + return result; + } + function isDeeplyNestedGeneric(type, stack) { + if (type.flags & 4096 /* Reference */ && depth >= 10) { + var target = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 4096 /* Reference */ && t.target === target) { + count++; + if (count >= 10) + return true; + } + } + } + return false; + } + function propertiesRelatedTo(source, target, reportErrors) { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfApparentType(source, targetProp.name); + if (sourceProp === targetProp) { + continue; + } + var targetPropIsOptional = isOptionalProperty(targetProp); + if (!sourceProp) { + if (!targetPropIsOptional) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source, false)); + } + return false; + } + } + else if (sourceProp !== targetProp) { + if (targetProp.flags & 67108864 /* Prototype */) { + continue; + } + if (getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */ || getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */) { + if (reportErrors) { + reportError(ts.Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + } + return false; + } + if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + } + return false; + } + else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { + if (reportErrors) { + reportError(ts.Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source, false)); + } + return false; + } + } + } + return true; + } + function signaturesRelatedTo(source, target, kind, reportErrors) { + if (target === anyFunctionType || source === anyFunctionType) + return true; + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var saveErrorInfo = errorInfo; + outer: for (var i = 0; i < targetSignatures.length; i++) { + var t = targetSignatures[i]; + if (!t.hasStringLiterals || target.flags & 16384 /* FromSignature */) { + var localErrors = reportErrors; + for (var j = 0; j < sourceSignatures.length; j++) { + var s = sourceSignatures[j]; + if (!s.hasStringLiterals || source.flags & 16384 /* FromSignature */) { + if (signatureRelatedTo(s, t, localErrors)) { + errorInfo = saveErrorInfo; + continue outer; + } + localErrors = false; + } + } + return false; + } + } + return true; + } + function signatureRelatedTo(source, target, reportErrors) { + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount; + if (source.hasRestParameter && target.hasRestParameter) { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var saveErrorInfo = errorInfo; + if (!isRelatedTo(s, t, reportErrors)) { + if (!isRelatedTo(t, s, false)) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + } + return false; + } + errorInfo = saveErrorInfo; + } + } + var t = getReturnTypeOfSignature(target); + if (t === voidType) + return true; + var s = getReturnTypeOfSignature(source); + return isRelatedTo(s, t, reportErrors); + } + function stringIndexTypesRelatedTo(source, target, reportErrors) { + var targetType = getIndexTypeOfType(target, 0 /* String */); + if (targetType) { + var sourceType = getIndexTypeOfType(source, 0 /* String */); + if (!sourceType) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, false)); + } + return false; + } + if (!isRelatedTo(sourceType, targetType, reportErrors)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + function numberIndexTypesRelatedTo(source, target, reportErrors) { + var targetType = getIndexTypeOfType(target, 1 /* Number */); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, false)); + } + return false; + } + if (sourceStringType && sourceNumberType) { + var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!compatible) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + } + function isSupertypeOfEach(candidate, types) { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + return false; + } + return true; + } + function getBestCommonType(types, contextualType, candidatesOnly) { + if (contextualType && isSupertypeOfEach(contextualType, types)) + return contextualType; + return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); + } + function isTypeOfObjectLiteral(type) { + return (type.flags & 8192 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + } + function getWidenedTypeOfObjectLiteral(type) { + var properties = getPropertiesOfType(type); + if (properties.length) { + var widenedTypes = []; + var propTypeWasWidened = false; + ts.forEach(properties, function (p) { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType, false)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members = {}; + var index = 0; + ts.forEach(properties, function (p) { + var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + if (p.valueDeclaration) + symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) + numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + function isArrayType(type) { + return type.flags & 4096 /* Reference */ && type.target === globalArrayType; + } + function getInnermostTypeOfNestedArrayTypes(type) { + while (isArrayType(type)) { + type = type.typeArguments[0]; + } + return type; + } + function getWidenedTypeOfArrayLiteral(type) { + var elementType = type.typeArguments[0]; + var widenedType = getWidenedType(elementType); + type = elementType !== widenedType ? createArrayType(widenedType) : type; + return type; + } + function getWidenedType(type) { + if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { + return anyType; + } + if (isTypeOfObjectLiteral(type)) { + return getWidenedTypeOfObjectLiteral(type); + } + if (isArrayType(type)) { + return getWidenedTypeOfArrayLiteral(type); + } + return type; + } + function createInferenceContext(typeParameters) { + var inferences = []; + for (var i = 0; i < typeParameters.length; i++) + inferences.push([]); + return { + typeParameters: typeParameters, + inferences: inferences, + inferredTypes: new Array(typeParameters.length) + }; + } + function inferTypes(context, source, target) { + var sourceStack; + var targetStack; + var depth = 0; + inferFromTypes(source, target); + function isInProcess(source, target) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) + return true; + } + return false; + } + function isWithinDepthLimit(type, stack) { + if (depth >= 5) { + var target = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 4096 /* Reference */ && t.target === target) + count++; + } + return count < 5; + } + return true; + } + function inferFromTypes(source, target) { + if (target.flags & 512 /* TypeParameter */) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (target === typeParameters[i]) { + var inferences = context.inferences[i]; + if (!ts.contains(inferences, source)) + inferences.push(source); + break; + } + } + } + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + var sourceTypes = source.typeArguments; + var targetTypes = target.typeArguments; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); + } + } + else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & 4096 /* Reference */ || (target.flags & 8192 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { + if (depth === 0) { + sourceStack = []; + targetStack = []; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + inferFromProperties(source, target); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target, 0 /* String */); + inferFromIndexTypes(source, target, 1 /* Number */); + depth--; + } + } + } + function inferFromProperties(source, target) { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp) { + inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + } + } + function inferFromSignatures(source, target, kind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var sourceLen = sourceSignatures.length; + var targetLen = targetSignatures.length; + var len = sourceLen < targetLen ? sourceLen : targetLen; + for (var i = 0; i < len; i++) { + inferFromParameters(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); + } + } + function inferFromParameters(source, target) { + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount; + if (!source.hasRestParameter && !target.hasRestParameter) { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + inferFromTypes(s, t); + } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + function inferFromIndexTypes(source, target, kind) { + var targetIndexType = getIndexTypeOfType(target, kind); + if (targetIndexType) { + var sourceIndexType = getIndexTypeOfType(source, kind); + if (sourceIndexType) { + inferFromTypes(sourceIndexType, targetIndexType); + } + } + } + } + function getInferredType(context, index) { + var result = context.inferredTypes[index]; + if (!result) { + var commonType = getWidenedType(getBestCommonType(context.inferences[index])); + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; + context.inferredTypes[index] = result; + } + return result; + } + function getInferredTypes(context) { + for (var i = 0; i < context.inferredTypes.length; i++) { + getInferredType(context, i); + } + context.inferences = undefined; + return context.inferredTypes; + } + function hasAncestor(node, kind) { + return getAncestor(node, kind) !== undefined; + } + function getAncestor(node, kind) { + switch (kind) { + case 169 /* ClassDeclaration */: + while (node) { + switch (node.kind) { + case 169 /* ClassDeclaration */: + return node; + case 171 /* EnumDeclaration */: + case 170 /* InterfaceDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + else { + node = node.parent; + } + } + break; + } + return undefined; + } + function checkIdentifier(node) { + function isInTypeQuery(node) { + while (node) { + switch (node.kind) { + case 124 /* TypeQuery */: + return true; + case 55 /* Identifier */: + case 112 /* QualifiedName */: + node = node.parent; + continue; + default: + return false; + } + } + ts.Debug.fail("should not get here"); + } + var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); + if (!symbol) { + symbol = unknownSymbol; + } + if (symbol.flags & 4194304 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + } + getNodeLinks(node).resolvedSymbol = symbol; + checkCollisionWithCapturedSuperVariable(node, node); + checkCollisionWithIndexVariableInGeneratedCode(node, node); + return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); + } + function getThisContainer(node) { + while (true) { + node = node.parent; + if (!node) { + return node; + } + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 172 /* ModuleDeclaration */: + case 115 /* Property */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 171 /* EnumDeclaration */: + case 177 /* SourceFile */: + case 137 /* ArrowFunction */: + return node; + } + } + } + function captureLexicalThis(node, container) { + var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + getNodeLinks(node).flags |= 2 /* LexicalThis */; + if (container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */) { + getNodeLinks(classNode).flags |= 4 /* CaptureThis */; + } + else { + getNodeLinks(container).flags |= 4 /* CaptureThis */; + } + } + function checkThisExpression(node) { + var container = getThisContainer(node); + var needToCaptureLexicalThis = false; + while (container.kind === 137 /* ArrowFunction */) { + container = getThisContainer(container); + needToCaptureLexicalThis = true; + } + switch (container.kind) { + case 172 /* ModuleDeclaration */: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + break; + case 171 /* EnumDeclaration */: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + break; + case 117 /* Constructor */: + if (isInConstructorArgumentInitializer(node, container)) { + error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + } + break; + case 115 /* Property */: + if (container.flags & 64 /* Static */) { + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); + } + break; + } + if (needToCaptureLexicalThis) { + captureLexicalThis(node, container); + } + var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + if (classNode) { + var symbol = getSymbolOfNode(classNode); + return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + } + return anyType; + } + function getSuperContainer(node) { + while (true) { + node = node.parent; + if (!node) + return node; + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + case 115 /* Property */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return node; + } + } + } + function isInConstructorArgumentInitializer(node, constructorDecl) { + for (var n = node; n && n !== constructorDecl; n = n.parent) { + if (n.kind === 114 /* Parameter */) { + return true; + } + } + return false; + } + function checkSuperExpression(node, isCallExpression) { + var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var baseClass; + if (enclosingClass && enclosingClass.baseType) { + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); + baseClass = classType.baseTypes.length && classType.baseTypes[0]; + } + if (!baseClass) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + return unknownType; + } + var container = getSuperContainer(node); + if (container) { + var canUseSuperExpression = false; + if (isCallExpression) { + canUseSuperExpression = container.kind === 117 /* Constructor */; + } + else { + var needToCaptureLexicalThis = false; + while (container && container.kind === 137 /* ArrowFunction */) { + container = getSuperContainer(container); + needToCaptureLexicalThis = true; + } + if (container && container.parent && container.parent.kind === 169 /* ClassDeclaration */) { + if (container.flags & 64 /* Static */) { + canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */; + } + else { + canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */ || container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */; + } + } + } + if (canUseSuperExpression) { + var returnType; + if ((container.flags & 64 /* Static */) || isCallExpression) { + getNodeLinks(node).flags |= 32 /* SuperStatic */; + returnType = getTypeOfSymbol(baseClass.symbol); + } + else { + getNodeLinks(node).flags |= 16 /* SuperInstance */; + returnType = baseClass; + } + if (container.kind === 117 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + returnType = unknownType; + } + if (!isCallExpression && needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + return returnType; + } + } + if (isCallExpression) { + error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } + else { + error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + } + return unknownType; + } + function isInferentialContext(mapper) { + return mapper && mapper !== identityMapper; + } + function checkArrayLiteral(node, contextualType, contextualMapper) { + var contextualElementType = contextualType && getIndexTypeOfType(contextualType, 1 /* Number */); + var elementTypes = []; + ts.forEach(node.elements, function (element) { + if (element.kind !== 142 /* OmittedExpression */) { + var type = checkExpression(element, contextualElementType, contextualMapper); + if (!ts.contains(elementTypes, type)) + elementTypes.push(type); + } + }); + var elementType = getBestCommonType(elementTypes, isInferentialContext(contextualMapper) ? undefined : contextualElementType, true); + if (!elementType) + elementType = elementTypes.length ? emptyObjectType : undefinedType; + return createArrayType(elementType); + } + function isNumericName(name) { + return !isNaN(name); + } + function getContextualTypeForProperty(type, name) { + var prop = getPropertyOfType(type, name); + if (prop) + return getTypeOfSymbol(prop); + return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); + } + function checkObjectLiteral(node, contextualType, contextualMapper) { + var members = node.symbol.members; + var properties = {}; + for (var id in members) { + if (ts.hasProperty(members, id)) { + var member = members[id]; + if (member.flags & 2 /* Property */) { + var contextualPropType = contextualType && getContextualTypeForProperty(contextualType, member.name); + var type = checkExpression(member.declarations[0].initializer, contextualPropType, contextualMapper); + var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); + prop.declarations = member.declarations; + prop.parent = member.parent; + if (member.valueDeclaration) + prop.valueDeclaration = member.valueDeclaration; + prop.type = type; + member = prop; + } + else { + var getAccessor = getDeclarationOfKind(member, 118 /* GetAccessor */); + if (getAccessor) { + checkAccessorDeclaration(getAccessor); + } + var setAccessor = getDeclarationOfKind(member, 119 /* SetAccessor */); + if (setAccessor) { + checkAccessorDeclaration(setAccessor); + } + } + properties[member.name] = member; + } + } + var stringIndexType = getIndexType(properties, 0 /* String */); + var numberIndexType = getIndexType(properties, 1 /* Number */); + return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); + function getIndexType(properties, kind) { + if (contextualType) { + var indexType = getIndexTypeOfType(contextualType, kind); + if (indexType) { + var propTypes = []; + for (var id in properties) { + if (ts.hasProperty(properties, id)) { + if (kind === 0 /* String */ || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!ts.contains(propTypes, type)) + propTypes.push(type); + } + } + } + return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); + } + } + } + } + function getDeclarationKindFromSymbol(s) { + return s.flags & 67108864 /* Prototype */ ? 115 /* Property */ : s.valueDeclaration.kind; + } + function getDeclarationFlagsFromSymbol(s) { + return s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 64 /* Static */ : s.valueDeclaration.flags; + } + function checkPropertyAccess(node) { + var type = checkExpression(node.left); + if (type === unknownType) + return type; + if (type !== anyType) { + var apparentType = getApparentType(getWidenedType(type)); + if (apparentType === unknownType) { + return unknownType; + } + var prop = getPropertyOfApparentType(apparentType, node.right.text); + if (!prop) { + if (node.right.text) { + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type, false)); + } + return unknownType; + } + getNodeLinks(node).resolvedSymbol = prop; + if (prop.parent && prop.parent.flags & 16 /* Class */) { + if (node.left.kind === 81 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 116 /* Method */) { + error(node.right, ts.Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + } + else if (getDeclarationFlagsFromSymbol(prop) & 32 /* Private */) { + var classDeclaration = getAncestor(node, 169 /* ClassDeclaration */); + if (!classDeclaration || !ts.contains(prop.parent.declarations, classDeclaration)) { + error(node, ts.Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); + } + } + } + return getTypeOfSymbol(prop); + } + return anyType; + } + function checkIndexedAccess(node) { + var objectType = checkExpression(node.object); + var indexType = checkExpression(node.index); + if (objectType === unknownType) + return unknownType; + var apparentType = getApparentType(objectType); + if (apparentType === unknownType) { + return unknownType; + } + if (node.index.kind === 3 /* StringLiteral */ || node.index.kind === 2 /* NumericLiteral */) { + var name = ts.getTextOfLiteral(node.index); + var prop = getPropertyOfApparentType(apparentType, name); + if (prop) { + return getTypeOfSymbol(prop); + } + } + if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); + if (numberIndexType) { + return numberIndexType; + } + } + var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + if (stringIndexType) { + return stringIndexType; + } + if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + } + return anyType; + } + error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any); + return unknownType; + } + function checkUntypedCall(node) { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + return anyType; + } + function checkErrorCall(node) { + checkUntypedCall(node); + return unknownType; + } + function isCandidateSignature(node, signature) { + var args = node.arguments || emptyArray; + return args.length >= signature.minArgumentCount && (signature.hasRestParameter || args.length <= signature.parameters.length) && (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + } + function collectCandidates(node, signatures) { + var result = []; + var lastParent; + var pos; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + if (isCandidateSignature(node, signature)) { + var parent = signature.declaration ? signature.declaration.parent : undefined; + if (lastParent && parent === lastParent) { + pos++; + } + else { + lastParent = parent; + pos = 0; + } + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; + } + } + return result; + } + function inferTypeArguments(signature, args, excludeArgument) { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters); + var mapper = createInferenceMapper(context); + for (var i = 0; i < args.length; i++) { + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + } + return getInferredTypes(context); + } + function checkTypeArguments(signature, typeArguments) { + var typeParameters = signature.typeParameters; + var result = []; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + result.push(typeArgument); + } + return result; + } + function isApplicableSignature(node, signature, relation, excludeArgument) { + if (node.arguments) { + for (var i = 0; i < node.arguments.length; i++) { + var arg = node.arguments[i]; + var paramType = getTypeAtPosition(signature, i); + var argType = arg.kind === 3 /* StringLiteral */ ? getStringLiteralType(arg) : checkExpression(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + if (!isTypeRelatedTo(argType, paramType, relation)) + return false; + } + } + return true; + } + function checkCall(node, signatures) { + ts.forEach(node.typeArguments, checkSourceElement); + var candidates = collectCandidates(node, signatures); + if (!candidates.length) { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + var args = node.arguments || emptyArray; + var excludeArgument; + for (var i = 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) + excludeArgument = new Array(args.length); + excludeArgument[i] = true; + } + } + var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; + while (true) { + for (var i = 0; i < candidates.length; i++) { + while (true) { + var candidate = candidates[i]; + if (candidate.typeParameters) { + var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); + candidate = getSignatureInstantiation(candidate, typeArguments); + } + if (!isApplicableSignature(node, candidate, relation, excludeArgument)) + break; + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return getReturnTypeOfSignature(candidate); + } + excludeArgument[index] = false; + } + } + if (relation === assignableRelation) + break; + relation = assignableRelation; + } + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + function checkCallExpression(node) { + if (node.func.kind === 81 /* SuperKeyword */) { + var superType = checkSuperExpression(node.func, true); + if (superType !== unknownType) { + checkCall(node, getSignaturesOfType(superType, 1 /* Construct */)); + } + else { + checkUntypedCall(node); + } + return voidType; + } + var funcType = checkExpression(node.func); + if (funcType === unknownType) { + return checkErrorCall(node); + } + var apparentType = getApparentType(funcType); + if (apparentType === unknownType) { + return checkErrorCall(node); + } + var signatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (funcType === anyType || !signatures.length && isTypeAssignableTo(funcType, globalFunctionType)) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return checkUntypedCall(node); + } + if (!signatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return checkErrorCall(node); + } + return checkCall(node, signatures); + } + function checkNewExpression(node) { + var expressionType = checkExpression(node.func); + if (expressionType === unknownType) { + return checkErrorCall(node); + } + if (expressionType === anyType) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return checkUntypedCall(node); + } + expressionType = getApparentType(expressionType); + if (expressionType === unknownType) { + return checkErrorCall(node); + } + var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); + if (constructSignatures.length) { + return checkCall(node, constructSignatures); + } + var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); + if (callSignatures.length) { + var type = checkCall(node, callSignatures); + if (type !== voidType) { + error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + } + if (program.getCompilerOptions().noImplicitAny) { + error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + } + return anyType; + } + error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + return checkErrorCall(node); + } + function checkTypeAssertion(node) { + var targetType = getTypeFromTypeNode(node.type); + if (targetType === unknownType) + return unknownType; + var exprType = checkExpression(node.operand, targetType); + var widenedType = getWidenedType(exprType); + if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { + checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + } + return targetType; + } + function getContextualSignature(contextualType) { + if (contextualType) { + var signatures = getSignaturesOfType(contextualType, 0 /* Call */); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } + } + function getTypeAtPosition(signature, pos) { + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + } + function assignContextualParameterTypes(signature, context, mapper) { + var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); + for (var i = 0; i < len; i++) { + var parameter = signature.parameters[i]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeAtPosition(context, i), mapper); + } + } + if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + } + } + } + function getReturnTypeFromBody(func, contextualType, contextualMapper) { + if (func.body.kind !== 168 /* FunctionBlock */) { + var unwidenedType = checkAndMarkExpression(func.body, contextualType, contextualMapper); + var widenedType = getWidenedType(unwidenedType); + if (program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType, false)); + } + return widenedType; + } + var types = []; + checkAndAggregateReturnExpressionTypes(func.body); + if (types.length) { + var commonType = getBestCommonType(types, undefined, true); + if (!commonType) { + error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); + return unknownType; + } + var widenedType = getWidenedType(commonType); + if (program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + var typeName = typeToString(widenedType, false); + if (func.name) { + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + } + else { + error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + return widenedType; + } + return voidType; + function checkAndAggregateReturnExpressionTypes(node) { + switch (node.kind) { + case 154 /* ReturnStatement */: + var expr = node.expression; + if (expr) { + var type = checkAndMarkExpression(expr, contextualType, contextualMapper); + if (!ts.contains(types, type)) + types.push(type); + } + break; + case 143 /* Block */: + case 168 /* FunctionBlock */: + case 147 /* IfStatement */: + case 148 /* DoStatement */: + case 149 /* WhileStatement */: + case 150 /* ForStatement */: + case 151 /* ForInStatement */: + case 155 /* WithStatement */: + case 156 /* SwitchStatement */: + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + case 159 /* LabelledStatement */: + case 161 /* TryStatement */: + case 162 /* TryBlock */: + case 163 /* CatchBlock */: + case 164 /* FinallyBlock */: + ts.forEachChild(node, checkAndAggregateReturnExpressionTypes); + break; + } + } + } + function checkFunctionExpression(node, contextualType, contextualMapper) { + if (contextualMapper === identityMapper) + return anyFunctionType; + var type = getTypeOfSymbol(node.symbol); + var links = getNodeLinks(node); + if (!(links.flags & 1 /* TypeChecked */)) { + var signature = getSignaturesOfType(type, 0 /* Call */)[0]; + var contextualSignature = getContextualSignature(contextualType); + if (contextualSignature) { + if (!node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; })) { + assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + } + if (!node.type) { + signature.resolvedReturnType = resolvingType; + var returnType = getReturnTypeFromBody(node, getReturnTypeOfSignature(contextualSignature), contextualMapper); + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = returnType; + } + } + } + checkSignatureDeclaration(node); + if (node.body.kind === 168 /* FunctionBlock */) { + checkSourceElement(node.body); + } + else { + var returnType = getReturnTypeOfSignature(signature); + if (node.type) { + checkTypeAssignableTo(checkExpression(node.body, returnType), returnType, node.body, undefined, undefined); + } + } + links.flags |= 1 /* TypeChecked */; + } + return type; + } + function checkArithmeticOperandType(operand, type, diagnostic) { + if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + error(operand, diagnostic); + return false; + } + return true; + } + function checkReferenceExpression(n, message) { + function testSymbol(n, flags) { + var symbol = getNodeLinks(n).resolvedSymbol; + if (!symbol || symbol === unknownSymbol) { + return undefined; + } + return (getExportSymbolOfValueSymbolIfExported(symbol).flags & flags) !== 0; + } + function isReferenceExpression(n) { + switch (n.kind) { + case 55 /* Identifier */: + return testSymbol(n, 1 /* Variable */); + case 130 /* PropertyAccess */: + return testSymbol(n, ~4 /* EnumMember */); + case 131 /* IndexedAccess */: + return true; + case 135 /* ParenExpression */: + return isReferenceExpression(n.expression); + default: + return false; + } + } + if (isReferenceExpression(n) === false) { + error(n, message); + return false; + } + return true; + } + function checkPrefixExpression(node) { + var operandType = checkExpression(node.operand); + switch (node.operator) { + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + return numberType; + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + return booleanType; + case 87 /* TypeOfKeyword */: + return stringType; + case 89 /* VoidKeyword */: + return undefinedType; + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + return unknownType; + } + function checkPostfixExpression(node) { + var operandType = checkExpression(node.operand); + var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + function isTypeAnyTypeObjectTypeOrTypeParameter(type) { + return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); + } + function checkInstanceOfExpression(node, leftType, rightType) { + if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); + } + return booleanType; + } + function checkInExpression(node, leftType, rightType) { + if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { + error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); + } + if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + return booleanType; + } + function checkBinaryExpression(node, contextualType, contextualMapper) { + var operator = node.operator; + var leftContextualType = operator === 40 /* BarBarToken */ ? contextualType : undefined; + var leftType = checkExpression(node.left, leftContextualType, contextualMapper); + var rightContextualType = operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment ? leftType : operator === 40 /* BarBarToken */ ? contextualType || leftType : undefined; + var rightType = checkExpression(node.right, rightContextualType, contextualMapper); + switch (operator) { + case 26 /* AsteriskToken */: + case 46 /* AsteriskEqualsToken */: + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + case 28 /* PercentToken */: + case 48 /* PercentEqualsToken */: + case 25 /* MinusToken */: + case 45 /* MinusEqualsToken */: + case 31 /* LessThanLessThanToken */: + case 49 /* LessThanLessThanEqualsToken */: + case 32 /* GreaterThanGreaterThanToken */: + case 50 /* GreaterThanGreaterThanEqualsToken */: + case 33 /* GreaterThanGreaterThanGreaterThanToken */: + case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 35 /* BarToken */: + case 53 /* BarEqualsToken */: + case 36 /* CaretToken */: + case 54 /* CaretEqualsToken */: + case 34 /* AmpersandToken */: + case 52 /* AmpersandEqualsToken */: + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) + leftType = rightType; + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) + rightType = leftType; + var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } + return numberType; + case 24 /* PlusToken */: + case 44 /* PlusEqualsToken */: + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) + leftType = rightType; + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) + rightType = leftType; + var resultType; + if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + resultType = numberType; + } + else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + resultType = stringType; + } + else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { + resultType = anyType; + } + if (!resultType) { + reportOperatorError(); + return anyType; + } + if (operator === 44 /* PlusEqualsToken */) { + checkAssignmentOperator(resultType); + } + return resultType; + case 19 /* EqualsEqualsToken */: + case 20 /* ExclamationEqualsToken */: + case 21 /* EqualsEqualsEqualsToken */: + case 22 /* ExclamationEqualsEqualsToken */: + case 15 /* LessThanToken */: + case 16 /* GreaterThanToken */: + case 17 /* LessThanEqualsToken */: + case 18 /* GreaterThanEqualsToken */: + if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + reportOperatorError(); + } + return booleanType; + case 77 /* InstanceOfKeyword */: + return checkInstanceOfExpression(node, leftType, rightType); + case 76 /* InKeyword */: + return checkInExpression(node, leftType, rightType); + case 39 /* AmpersandAmpersandToken */: + return rightType; + case 40 /* BarBarToken */: + return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : contextualType); + case 43 /* EqualsToken */: + checkAssignmentOperator(rightType); + return rightType; + case 14 /* CommaToken */: + return rightType; + } + function checkAssignmentOperator(valueType) { + if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (ok) { + checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + } + } + } + function reportOperatorError() { + error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operator), typeToString(leftType, false), typeToString(rightType, false)); + } + } + function checkConditionalExpression(node, contextualType, contextualMapper) { + checkExpression(node.condition); + var type1 = checkExpression(node.whenTrue, contextualType, contextualMapper); + var type2 = checkExpression(node.whenFalse, contextualType, contextualMapper); + var resultType = getBestCommonType([type1, type2], isInferentialContext(contextualMapper) ? undefined : contextualType, true); + if (!resultType) { + if (contextualType && !isInferentialContext(contextualMapper)) { + error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType, false), typeToString(type1, false), typeToString(type2, false)); + } + else { + error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1, false), typeToString(type2, false)); + } + resultType = emptyObjectType; + } + return resultType; + } + function checkAndMarkExpression(node, contextualType, contextualMapper) { + var result = checkExpression(node, contextualType, contextualMapper); + getNodeLinks(node).flags |= 1 /* TypeChecked */; + return result; + } + function checkExpression(node, contextualType, contextualMapper) { + switch (node.kind) { + case 55 /* Identifier */: + return checkIdentifier(node); + case 83 /* ThisKeyword */: + return checkThisExpression(node); + case 81 /* SuperKeyword */: + return checkSuperExpression(node, false); + case 79 /* NullKeyword */: + return nullType; + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + return booleanType; + case 2 /* NumericLiteral */: + return numberType; + case 3 /* StringLiteral */: + return stringType; + case 4 /* RegularExpressionLiteral */: + return globalRegExpType; + case 112 /* QualifiedName */: + return checkPropertyAccess(node); + case 127 /* ArrayLiteral */: + return checkArrayLiteral(node, contextualType, contextualMapper); + case 128 /* ObjectLiteral */: + return checkObjectLiteral(node, contextualType, contextualMapper); + case 130 /* PropertyAccess */: + return checkPropertyAccess(node); + case 131 /* IndexedAccess */: + return checkIndexedAccess(node); + case 132 /* CallExpression */: + return checkCallExpression(node); + case 133 /* NewExpression */: + return checkNewExpression(node); + case 134 /* TypeAssertion */: + return checkTypeAssertion(node); + case 135 /* ParenExpression */: + return checkExpression(node.expression); + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return checkFunctionExpression(node, contextualType, contextualMapper); + case 138 /* PrefixOperator */: + return checkPrefixExpression(node); + case 139 /* PostfixOperator */: + return checkPostfixExpression(node); + case 140 /* BinaryExpression */: + return checkBinaryExpression(node, contextualType, contextualMapper); + case 141 /* ConditionalExpression */: + return checkConditionalExpression(node, contextualType, contextualMapper); + } + return unknownType; + } + function checkTypeParameter(node) { + checkNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); + checkSourceElement(node.constraint); + checkTypeParameterHasIllegalReferencesInConstraint(node); + } + function checkParameter(parameterDeclaration) { + checkVariableDeclaration(parameterDeclaration); + checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + if (parameterDeclaration.flags & 8 /* Rest */) { + if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { + error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + else { + if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + } + } + function checkReferencesInInitializer(n) { + if (n.kind === 55 /* Identifier */) { + var referencedSymbol = getNodeLinks(n).resolvedSymbol; + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 114 /* Parameter */) { + if (referencedSymbol.valueDeclaration === parameterDeclaration) { + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + return; + } + var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); + if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { + return; + } + } + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + } + } + else { + ts.forEachChild(n, checkReferencesInInitializer); + } + } + if (parameterDeclaration.initializer) { + checkReferencesInInitializer(parameterDeclaration.initializer); + } + } + function isTypeIdenticalTo(source, target) { + return isTypeSubtypeOf(source, target) && isTypeSubtypeOf(target, source); + } + function isSignatureIdenticalToIgnoringReturnType(source, target) { + if (source === target) { + return true; + } + if (source.hasRestParameter !== target.hasRestParameter) { + return false; + } + if (source.parameters.length !== target.parameters.length) { + return false; + } + if (source.minArgumentCount !== target.minArgumentCount) { + return false; + } + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return false; + } + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + var sourceConstraint = getConstraintOfTypeParameter(source.typeParameters[i]); + var targetConstraint = getConstraintOfTypeParameter(target.typeParameters[i]); + if (sourceConstraint === targetConstraint) { + continue; + } + if (sourceConstraint === noConstraintType || targetConstraint === noConstraintType) { + return false; + } + if (!isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } + } + } + else if (source.typeParameters || source.typeParameters) { + return false; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + if (!isTypeIdenticalTo(s, t)) { + return false; + } + } + return true; + } + function checkSignatureDeclaration(node) { + ts.forEach(node.typeParameters, checkTypeParameter); + ts.forEach(node.parameters, checkParameter); + if (node.type) { + checkSourceElement(node.type); + } + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithArgumentsInGeneratedCode(node); + if (program.getCompilerOptions().noImplicitAny && !node.type) { + switch (node.kind) { + case 121 /* ConstructSignature */: + error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 120 /* CallSignature */: + error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } + } + checkSpecializedSignatureDeclaration(node); + } + function checkTypeForDuplicateIndexSignatures(node) { + if (node.kind === 170 /* InterfaceDeclaration */) { + var nodeSymbol = getSymbolOfNode(node); + if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { + return; + } + } + var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); + if (indexSymbol) { + var seenNumericIndexer = false; + var seenStringIndexer = false; + for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { + var declaration = indexSymbol.declarations[i]; + if (declaration.parameters.length == 1 && declaration.parameters[0].type) { + switch (declaration.parameters[0].type.kind) { + case 110 /* StringKeyword */: + if (!seenStringIndexer) { + seenStringIndexer = true; + } + else { + error(declaration, ts.Diagnostics.Duplicate_string_index_signature); + } + break; + case 108 /* NumberKeyword */: + if (!seenNumericIndexer) { + seenNumericIndexer = true; + } + else { + error(declaration, ts.Diagnostics.Duplicate_number_index_signature); + } + break; + } + } + } + } + } + function checkPropertyDeclaration(node) { + checkVariableDeclaration(node); + } + function checkMethodDeclaration(node) { + checkFunctionDeclaration(node); + } + function checkConstructorDeclaration(node) { + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + checkSourceElement(node.body); + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol.parent); + if (!(symbolLinks.typeChecked || type.flags & ts.TypeFlags.Intrinsic)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + if (!node.body) { + return; + } + function isSuperCallExpression(n) { + return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; + } + function containsSuperCall(n) { + if (isSuperCallExpression(n)) { + return true; + } + switch (n.kind) { + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + case 128 /* ObjectLiteral */: + return false; + default: + return ts.forEachChild(n, containsSuperCall); + } + } + function markThisReferencesAsErrors(n) { + if (n.kind === 83 /* ThisKeyword */) { + error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + } + else if (n.kind !== 136 /* FunctionExpression */ && n.kind !== 167 /* FunctionDeclaration */) { + ts.forEachChild(n, markThisReferencesAsErrors); + } + } + function isInstancePropertyWithInitializer(n) { + return n.kind === 115 /* Property */ && !(n.flags & 64 /* Static */) && !!n.initializer; + } + if (node.parent.baseType) { + if (containsSuperCall(node.body)) { + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */); }); + if (superCallShouldBeFirst) { + var statements = node.body.statements; + if (!statements.length || statements[0].kind !== 146 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); + } + else { + markThisReferencesAsErrors(statements[0].expression); + } + } + } + else { + error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + } + } + } + function checkAccessorDeclaration(node) { + function checkGetterContainsSingleThrowStatement(node) { + var block = node.body; + return block.statements.length === 1 && block.statements[0].kind === 160 /* ThrowStatement */; + } + function checkGetterReturnsValue(n) { + switch (n.kind) { + case 154 /* ReturnStatement */: + return true; + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + case 128 /* ObjectLiteral */: + return false; + default: + return ts.forEachChild(n, checkGetterReturnsValue); + } + } + if (node.kind === 118 /* GetAccessor */) { + if (!isDeclarationContext(node) && node.body && !(checkGetterContainsSingleThrowStatement(node) || checkGetterReturnsValue(node))) { + error(node.name, ts.Diagnostics.Getters_must_return_a_value); + } + } + var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); + if (otherAccessor) { + var visibilityFlags = 32 /* Private */ | 16 /* Public */; + if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); + } + var thisType = getAnnotatedAccessorType(node); + var otherType = getAnnotatedAccessorType(otherAccessor); + if (thisType && otherType) { + if (!isTypeIdenticalTo(thisType, otherType)) { + error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + } + } + } + checkFunctionDeclaration(node); + } + function checkTypeReference(node) { + var type = getTypeFromTypeReferenceNode(node); + if (type !== unknownType && node.typeArguments) { + var len = node.typeArguments.length; + for (var i = 0; i < len; i++) { + checkSourceElement(node.typeArguments[i]); + var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); + if (constraint) { + var typeArgument = type.typeArguments[i]; + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + } + function checkTypeQuery(node) { + getTypeFromTypeQueryNode(node); + } + function checkTypeLiteral(node) { + ts.forEach(node.members, checkSourceElement); + var type = getTypeFromTypeLiteralNode(node); + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } + function checkArrayType(node) { + getTypeFromArrayTypeNode(node); + } + function isPrivateWithinAmbient(node) { + return (node.flags & 32 /* Private */) && isAmbientContext(node); + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2 /* Ambient */) + return true; + node = node.parent; + } + return false; + } + function isDeclarationContext(node) { + while (node) { + if (node.flags & (2 /* Ambient */ | 512 /* DeclarationFile */)) + return true; + node = node.parent; + } + return false; + } + function checkDeclarationModifiers(node) { + if (node.flags & 1 /* Export */ && node.parent.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + } + if (node.kind === 170 /* InterfaceDeclaration */ || node.kind === 174 /* ImportDeclaration */) { + if (node.flags & 2 /* Ambient */) { + if (node.kind === 170 /* InterfaceDeclaration */) { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration); + } + else { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration); + } + } + } + else { + if (node.parent.kind === 177 /* SourceFile */) { + if (node.parent.flags & 512 /* DeclarationFile */ && !(node.flags & 2 /* Ambient */)) { + error(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + } + else { + if (isAmbientContext(node.parent) && node.flags & 2 /* Ambient */) { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + } + } + } + function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { + var signature = getSignatureFromDeclaration(signatureDeclarationNode); + if (!signature.hasStringLiterals) { + return; + } + if (signatureDeclarationNode.body) { + error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); + return; + } + var signaturesOfSymbol = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); + for (var i = 0; i < signaturesOfSymbol.length; i++) { + var otherSignature = signaturesOfSymbol[i]; + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + return; + } + } + error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); + } + function checkFunctionOrConstructorSymbol(symbol) { + function getEffectiveFlagsForFunctionCheck(n) { + var flags = n.flags; + if (n.parent.kind !== 170 /* InterfaceDeclaration */ && isDeclarationContext(n)) { + if (!(flags & 2 /* Ambient */)) { + flags |= 1 /* Export */; + } + flags |= 2 /* Ambient */; + } + return flags & flagsToCheck; + } + function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { + var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; + if (someButNotAllOverloadFlags !== 0) { + var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; + var canonicalFlags = implementationSharesContainerWithFirstOverload ? getEffectiveFlagsForFunctionCheck(implementation) : getEffectiveFlagsForFunctionCheck(overloads[0]); + ts.forEach(overloads, function (o) { + var deviation = getEffectiveFlagsForFunctionCheck(o) ^ canonicalFlags; + if (deviation & 1 /* Export */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); + } + else if (deviation & 2 /* Ambient */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } + else if (deviation & 32 /* Private */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_or_private); + } + else if (deviation & 4 /* QuestionMark */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); + } + }); + } + } + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 4 /* QuestionMark */; + var someNodeFlags = 0; + var allNodeFlags = flagsToCheck; + var hasOverloads = false; + var bodyDeclaration; + var lastSeenNonAmbientDeclaration; + var declarations = symbol.declarations; + var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + for (var i = 0; i < declarations.length; i++) { + var node = declarations[i]; + if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */) { + var currentNodeFlags = getEffectiveFlagsForFunctionCheck(node); + someNodeFlags |= currentNodeFlags; + allNodeFlags &= currentNodeFlags; + var inAmbientContext = isDeclarationContext(node); + var inAmbientContextOrInterface = node.parent.kind === 170 /* InterfaceDeclaration */ || node.parent.kind === 125 /* TypeLiteral */ || inAmbientContext; + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } + if (node.body) { + if (bodyDeclaration) { + if (isConstructor) { + error(node, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + } + else { + error(node, ts.Diagnostics.Duplicate_function_implementation); + } + } + else { + bodyDeclaration = node; + } + } + else { + hasOverloads = true; + } + } + } + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { + if (isConstructor) { + error(lastSeenNonAmbientDeclaration, ts.Diagnostics.Constructor_implementation_expected); + } + else { + error(lastSeenNonAmbientDeclaration, ts.Diagnostics.Function_implementation_expected); + } + } + if (hasOverloads) { + checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); + if (bodyDeclaration) { + var signatures = getSignaturesOfSymbol(symbol); + var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + if (!bodySignature.hasStringLiterals) { + for (var i = 0, len = signatures.length; i < len; ++i) { + if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { + error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + break; + } + } + } + } + } + } + function checkFunctionDeclaration(node) { + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol); + if (!(symbolLinks.typeChecked || type.flags & ts.TypeFlags.Intrinsic)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + checkSourceElement(node.body); + if (program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (!isPrivateWithinAmbient(node)) { + var typeName = typeToString(anyType, false); + if (node.name) { + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + } + else { + error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + } + } + function checkStatementContext(node) { + var parent = node.parent; + if ((parent.kind === 177 /* SourceFile */ || parent.kind === 173 /* ModuleBlock */) && isDeclarationContext(parent)) { + error(node, ts.Diagnostics.Statements_are_not_allowed_in_declaration_contexts); + } + } + function checkBlock(node) { + checkStatementContext(node); + ts.forEach(node.statements, checkSourceElement); + } + function checkCollisionWithArgumentsInGeneratedCode(node) { + if (!hasRestParameters(node) || isDeclarationContext(node) || !node.body) { + return; + } + ts.forEach(node.parameters, function (p) { + if (p.name && p.name.text === argumentsSymbol.name) { + error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + } + }); + } + function checkCollisionWithIndexVariableInGeneratedCode(node, name) { + if (!(name && name.text === "_i")) { + return; + } + if (node.kind === 114 /* Parameter */) { + if (node.parent.body && hasRestParameters(node.parent) && !isDeclarationContext(node)) { + error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); + } + return; + } + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol === unknownSymbol) { + return; + } + var current = node; + while (current) { + var definedOnCurrentLevel = ts.forEach(symbol.declarations, function (d) { return d.parent === current ? d : undefined; }); + if (definedOnCurrentLevel) { + return; + } + switch (current.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 116 /* Method */: + case 137 /* ArrowFunction */: + case 117 /* Constructor */: + if (hasRestParameters(current)) { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); + return; + } + break; + } + current = current.parent; + } + } + function checkCollisionWithCapturedSuperVariable(node, name) { + if (!(name && name.text === "_super")) { + return; + } + if (node.kind === 115 /* Property */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + return; + } + if (node.kind === 114 /* Parameter */ && !node.parent.body) { + return; + } + var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + if (!enclosingClass || isDeclarationContext(enclosingClass)) { + return; + } + if (enclosingClass.baseType) { + var isDeclaration = node.kind !== 55 /* Identifier */; + if (isDeclaration) { + error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); + } + } + } + function checkVariableDeclaration(node) { + checkSourceElement(node.type); + var symbol = getSymbolOfNode(node); + var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); + var type; + var useTypeFromValueDeclaration = node === symbol.valueDeclaration; + if (useTypeFromValueDeclaration) { + type = typeOfValueDeclaration; + } + else { + type = getTypeOfVariableDeclaration(node); + } + if (node.initializer) { + if (isDeclarationContext(node)) { + error(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_declaration_contexts); + } + if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { + checkTypeAssignableTo(checkAndMarkExpression(node.initializer, type), type, node, undefined, undefined); + } + } + checkCollisionWithCapturedSuperVariable(node, node.name); + if (!useTypeFromValueDeclaration) { + if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration, false), typeToString(type, false)); + } + } + } + function checkVariableStatement(node) { + checkDeclarationModifiers(node); + ts.forEach(node.declarations, checkVariableDeclaration); + } + function checkExpressionStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + } + function checkIfStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.thenStatement); + checkSourceElement(node.elseStatement); + } + function checkDoStatement(node) { + checkStatementContext(node); + checkSourceElement(node.statement); + checkExpression(node.expression); + } + function checkWhileStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.statement); + } + function checkForStatement(node) { + checkStatementContext(node); + if (node.declarations) + ts.forEach(node.declarations, checkVariableDeclaration); + if (node.initializer) + checkExpression(node.initializer); + if (node.condition) + checkExpression(node.condition); + if (node.iterator) + checkExpression(node.iterator); + checkSourceElement(node.statement); + } + function checkForInStatement(node) { + checkStatementContext(node); + if (node.declaration) { + checkVariableDeclaration(node.declaration); + if (node.declaration.type) { + error(node.declaration, ts.Diagnostics.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation); + } + } + if (node.variable) { + var exprType = checkExpression(node.variable); + if (exprType !== anyType && exprType !== stringType) { + error(node.variable, ts.Diagnostics.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any); + } + else { + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + } + } + var exprType = checkExpression(node.expression); + if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + checkSourceElement(node.statement); + } + function checkBreakOrContinueStatement(node) { + checkStatementContext(node); + } + function getContainingFunction(node) { + while (true) { + node = node.parent; + if (!node || node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 137 /* ArrowFunction */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + return node; + } + } + } + function checkReturnStatement(node) { + checkStatementContext(node); + if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { + var func = getContainingFunction(node); + if (func) { + if (func.kind === 119 /* SetAccessor */) { + if (node.expression) { + error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + } + } + else { + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); + var checkAssignability = func.type || (func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))); + if (checkAssignability) { + checkTypeAssignableTo(checkExpression(node.expression, returnType), returnType, node.expression, undefined, undefined); + } + else if (func.kind == 117 /* Constructor */) { + if (!isTypeAssignableTo(checkExpression(node.expression, returnType), returnType)) { + error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } + } + } + } + else { + error(node, ts.Diagnostics.return_statement_has_no_containing_function); + } + } + } + function checkWithStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.statement); + } + function checkSwitchStatement(node) { + checkStatementContext(node); + var expressionType = checkExpression(node.expression); + ts.forEach(node.clauses, function (clause) { + if (clause.expression) { + var caseType = checkExpression(clause.expression); + if (!isTypeAssignableTo(expressionType, caseType)) { + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + } + } + checkBlock(clause); + }); + } + function checkLabelledStatement(node) { + checkStatementContext(node); + checkSourceElement(node.statement); + } + function checkThrowStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + } + function checkTryStatement(node) { + checkStatementContext(node); + checkBlock(node.tryBlock); + if (node.catchBlock) + checkBlock(node.catchBlock); + if (node.finallyBlock) + checkBlock(node.finallyBlock); + } + function checkIndexConstraints(type) { + function checkIndexConstraintForProperty(prop, propertyType, indexDeclaration, indexType, indexKind) { + if (!indexType) { + return; + } + if (indexKind === 1 /* Number */ && !isNumericName(prop.name)) { + return; + } + var errorNode; + if (prop.parent === type.symbol) { + errorNode = prop.valueDeclaration; + } + else if (indexDeclaration) { + errorNode = indexDeclaration; + } + else if (type.flags & 2048 /* Interface */) { + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; + } + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { + var errorMessage = indexKind === 0 /* String */ ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType, false), typeToString(indexType, false)); + } + } + var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); + var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType || numberIndexType) { + ts.forEach(getPropertiesOfType(type), function (prop) { + var propType = getTypeOfSymbol(prop); + checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); + }); + } + var errorNode; + if (stringIndexType && numberIndexType) { + errorNode = declaredNumberIndexer || declaredStringIndexer; + if (!errorNode && (type.flags & 2048 /* Interface */)) { + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); + errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; + } + } + if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { + error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType, false), typeToString(stringIndexType, false)); + } + } + function checkNameIsReserved(name, message) { + switch (name.text) { + case "any": + case "number": + case "boolean": + case "string": + case "void": + error(name, message, name.text); + return true; + } + } + function checkClassDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); + ts.forEach(node.typeParameters, checkTypeParameter); + var symbol = getSymbolOfNode(node); + var type = getDeclaredTypeOfSymbol(symbol); + var staticType = getTypeOfSymbol(symbol); + if (node.baseType) { + emitExtends = emitExtends || !isDeclarationContext(node); + checkTypeReference(node.baseType); + } + if (type.baseTypes.length) { + var baseType = type.baseTypes[0]; + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var staticBaseType = getTypeOfSymbol(baseType.symbol); + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType, false)); + } + checkExpression(node.baseType.typeName); + checkKindsOfPropertyMemberOverrides(type, baseType); + } + if (node.implementedTypes) { + ts.forEach(node.implementedTypes, function (typeRefNode) { + checkTypeReference(typeRefNode); + var t = getTypeFromTypeReferenceNode(typeRefNode); + if (t !== unknownType) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + } + else { + error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + } + } + }); + } + checkIndexConstraints(type); + ts.forEach(node.members, checkSourceElement); + checkTypeForDuplicateIndexSignatures(node); + } + function checkKindsOfPropertyMemberOverrides(type, baseType) { + function getTargetSymbol(s) { + return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + } + var baseProperties = getPropertiesOfType(baseType); + for (var i = 0, len = baseProperties.length; i < len; ++i) { + var base = getTargetSymbol(baseProperties[i]); + if (base.flags & 67108864 /* Prototype */) { + continue; + } + var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + if (derived) { + var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); + var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); + if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { + continue; + } + if ((baseDeclarationFlags & 64 /* Static */) !== (derivedDeclarationFlags & 64 /* Static */)) { + continue; + } + if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + continue; + } + var errorMessage; + if (base.flags & 2048 /* Method */) { + if (derived.flags & ts.SymbolFlags.Accessor) { + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; + } + else { + ts.Debug.assert(derived.flags & 2 /* Property */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; + } + } + else if (base.flags & 2 /* Property */) { + ts.Debug.assert(derived.flags & 2048 /* Method */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; + } + else { + ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); + ts.Debug.assert(derived.flags & 2048 /* Method */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; + } + error(derived.valueDeclaration.name, errorMessage, typeToString(baseType, false), symbolToString(base), typeToString(type, false)); + } + } + } + function isAccessor(kind) { + return kind === 118 /* GetAccessor */ || kind === 119 /* SetAccessor */; + } + function areTypeParameterDeclarationsPairwiseIdentical(list1, list2) { + if (!list1 && !list2) { + return true; + } + if (!list1 || !list2 || list1.length !== list2.length) { + return false; + } + for (var i = 0, len = list1.length; i < len; ++i) { + if (list1[i].name.text !== list2[i].name.text) { + return false; + } + if (!list1[i].constraint && !list2[i].constraint) { + continue; + } + if (!list1[i].constraint || !list2[i].constraint) { + return false; + } + var t1 = getTypeFromTypeNode(list1[i].constraint); + var t2 = getTypeFromTypeNode(list2[i].constraint); + if (!isTypeIdenticalTo(t1, t2)) { + return false; + } + } + return true; + } + function checkInterfaceDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); + ts.forEach(node.typeParameters, checkTypeParameter); + var declarations = node.symbol.declarations; + if (declarations.length > 1) { + var firstInterfaceDecl; + for (var i = 0, len = declarations.length; i < len; ++i) { + if (declarations[i].kind === 170 /* InterfaceDeclaration */) { + firstInterfaceDecl = declarations[i]; + break; + } + } + if (node !== firstInterfaceDecl && !areTypeParameterDeclarationsPairwiseIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { + error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + } + } + var symbol = getSymbolOfNode(node); + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + var type = getDeclaredTypeOfSymbol(symbol); + ts.forEach(type.baseTypes, function (baseType) { + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + }); + checkIndexConstraints(type); + links.typeChecked = true; + } + ts.forEach(node.baseTypes, checkTypeReference); + ts.forEach(node.members, checkSourceElement); + checkTypeForDuplicateIndexSignatures(node); + } + function getConstantValue(node) { + if (node.kind === 2 /* NumericLiteral */) + return +node.text; + if (node.kind === 138 /* PrefixOperator */ && node.operator === 25 /* MinusToken */) { + node = node.operand; + if (node.kind === 2 /* NumericLiteral */) + return -node.text; + } + } + function checkEnumDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); + var enumType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); + var autoValue = 0; + var ambient = isDeclarationContext(node); + ts.forEach(node.members, function (member) { + var initializer = member.initializer; + if (initializer) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); + } + if (ambient) { + if (initializer) { + var value = getConstantValue(initializer); + if (value !== undefined) { + getNodeLinks(member).enumMemberValue = value; + } + else { + error(initializer, ts.Diagnostics.In_an_enum_declaration_context_initializer_must_be_a_number_literal); + } + } + } + else { + if (initializer) { + autoValue = initializer.kind === 2 /* NumericLiteral */ ? +initializer.text : undefined; + } + else if (autoValue === undefined) { + error(member, ts.Diagnostics.Enum_member_must_have_initializer); + autoValue = 0; + } + if (!initializer || initializer.kind === 2 /* NumericLiteral */) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + } + }); + } + function checkModuleDeclaration(node) { + checkDeclarationModifiers(node); + if (node.name.kind === 3 /* StringLiteral */) { + if (!isDeclarationContext(node)) { + error(node, ts.Diagnostics.Ambient_external_modules_require_a_declare_modifier); + } + if (node.parent.kind !== 177 /* SourceFile */ || node.parent.flags & 1024 /* ExternalModule */) { + error(node, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + } + if (isExternalModuleNameRelative(node.name.text)) { + error(node, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + } + var symbol = getSymbolOfNode(node); + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + getExportAssignmentSymbol(symbol); + links.typeChecked = true; + } + } + checkSourceElement(node.body); + } + function checkImportDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); + var symbol = getSymbolOfNode(node); + var target; + if (node.entityName) { + target = resolveImport(symbol); + if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { + checkExpression(node.entityName); + } + } + else { + if (node.parent.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + target = resolveImport(symbol); + } + else if (node.parent.kind === 173 /* ModuleBlock */ && node.parent.parent.name.kind === 3 /* StringLiteral */) { + if (isExternalModuleNameRelative(node.externalModuleName.text)) { + error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + target = unknownSymbol; + } + else { + target = resolveImport(symbol); + } + } + else { + target = unknownSymbol; + } + } + if (target !== unknownSymbol) { + var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + if (target.flags & excludedMeanings) { + error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); + } + } + } + function checkModulesEnabled(node) { + if (!modulesVerified) { + if (!program.getCompilerOptions().module) { + error(node, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided); + } + modulesVerified = true; + } + } + function checkExportAssignment(node) { + var container = node.parent; + if (container.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + } + } + function checkSourceElement(node) { + if (!node) + return; + switch (node.kind) { + case 113 /* TypeParameter */: + return checkTypeParameter(node); + case 114 /* Parameter */: + return checkParameter(node); + case 115 /* Property */: + return checkPropertyDeclaration(node); + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + return checkSignatureDeclaration(node); + case 116 /* Method */: + return checkMethodDeclaration(node); + case 117 /* Constructor */: + return checkConstructorDeclaration(node); + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return checkAccessorDeclaration(node); + case 123 /* TypeReference */: + return checkTypeReference(node); + case 124 /* TypeQuery */: + return checkTypeQuery(node); + case 125 /* TypeLiteral */: + return checkTypeLiteral(node); + case 126 /* ArrayType */: + return checkArrayType(node); + case 167 /* FunctionDeclaration */: + return checkFunctionDeclaration(node); + case 143 /* Block */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + return checkBlock(node); + case 144 /* VariableStatement */: + return checkVariableStatement(node); + case 146 /* ExpressionStatement */: + return checkExpressionStatement(node); + case 147 /* IfStatement */: + return checkIfStatement(node); + case 148 /* DoStatement */: + return checkDoStatement(node); + case 149 /* WhileStatement */: + return checkWhileStatement(node); + case 150 /* ForStatement */: + return checkForStatement(node); + case 151 /* ForInStatement */: + return checkForInStatement(node); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return checkBreakOrContinueStatement(node); + case 154 /* ReturnStatement */: + return checkReturnStatement(node); + case 155 /* WithStatement */: + return checkWithStatement(node); + case 156 /* SwitchStatement */: + return checkSwitchStatement(node); + case 159 /* LabelledStatement */: + return checkLabelledStatement(node); + case 160 /* ThrowStatement */: + return checkThrowStatement(node); + case 161 /* TryStatement */: + return checkTryStatement(node); + case 166 /* VariableDeclaration */: + return checkVariableDeclaration(node); + case 169 /* ClassDeclaration */: + return checkClassDeclaration(node); + case 170 /* InterfaceDeclaration */: + return checkInterfaceDeclaration(node); + case 171 /* EnumDeclaration */: + return checkEnumDeclaration(node); + case 172 /* ModuleDeclaration */: + return checkModuleDeclaration(node); + case 174 /* ImportDeclaration */: + return checkImportDeclaration(node); + case 175 /* ExportAssignment */: + return checkExportAssignment(node); + } + } + function checkSourceFile(node) { + var links = getNodeLinks(node); + if (!(links.flags & 1 /* TypeChecked */)) { + emitExtends = false; + ts.forEach(node.statements, checkSourceElement); + if (node.flags & 1024 /* ExternalModule */) { + var symbol = getExportAssignmentSymbol(node.symbol); + if (symbol && symbol.flags & 4194304 /* Import */) { + getSymbolLinks(symbol).referenced = true; + } + } + if (emitExtends) + links.flags |= 8 /* EmitExtends */; + links.flags |= 1 /* TypeChecked */; + } + } + function checkProgram() { + ts.forEach(program.getSourceFiles(), checkSourceFile); + } + function getSortedDiagnostics() { + if (diagnosticsModified) { + diagnostics.sort(ts.compareDiagnostics); + diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); + diagnosticsModified = false; + } + return diagnostics; + } + function getDiagnostics(sourceFile) { + if (sourceFile) { + checkSourceFile(sourceFile); + return ts.filter(getSortedDiagnostics(), function (d) { return d.file === sourceFile; }); + } + checkProgram(); + return getSortedDiagnostics(); + } + function getGlobalDiagnostics() { + return ts.filter(getSortedDiagnostics(), function (d) { return !d.file; }); + } + function getNodeAtPosition(sourceFile, position) { + function findChildAtPosition(parent) { + var child = ts.forEachChild(parent, function (node) { + if (position >= node.pos && position <= node.end && position >= ts.getTokenPosOfNode(node)) { + return findChildAtPosition(node); + } + }); + return child || parent; + } + if (position < sourceFile.pos) + position = sourceFile.pos; + if (position > sourceFile.end) + position = sourceFile.end; + return findChildAtPosition(sourceFile); + } + function getSymbolsInScope(location, meaning) { + var symbols = {}; + var memberFlags = 0; + function copySymbol(symbol, meaning) { + if (symbol.flags & meaning) { + var id = symbol.name; + if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) { + symbols[id] = symbol; + } + } + } + function copySymbols(source, meaning) { + if (meaning) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + copySymbol(source[id], meaning); + } + } + } + } + while (location) { + if (location.locals && (location.kind !== 177 /* SourceFile */ || location.flags & 1024 /* ExternalModule */)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 177 /* SourceFile */: + if (!(location.flags & 1024 /* ExternalModule */)) + break; + case 172 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + break; + case 171 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + break; + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + if (!(memberFlags & 64 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + } + break; + case 136 /* FunctionExpression */: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + case 163 /* CatchBlock */: + if (location.variable.text) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + return ts.mapToArray(symbols); + } + function isDeclarationIdentifier(identifier) { + if (identifier.parent) { + switch (identifier.parent.kind) { + case 113 /* TypeParameter */: + case 114 /* Parameter */: + case 166 /* VariableDeclaration */: + case 115 /* Property */: + case 129 /* PropertyAssignment */: + case 176 /* EnumMember */: + case 116 /* Method */: + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return identifier.parent.name === identifier; + case 163 /* CatchBlock */: + return identifier.parent.variable === identifier; + } + } + return false; + } + function isTypeReferenceIdentifier(identifier) { + var node = identifier; + while (node.parent && node.parent.kind === 112 /* QualifiedName */) + node = node.parent; + return node.parent && node.parent.kind === 123 /* TypeReference */; + } + function isExpression(node) { + switch (node.kind) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + case 4 /* RegularExpressionLiteral */: + case 127 /* ArrayLiteral */: + case 128 /* ObjectLiteral */: + case 130 /* PropertyAccess */: + case 131 /* IndexedAccess */: + case 132 /* CallExpression */: + case 133 /* NewExpression */: + case 134 /* TypeAssertion */: + case 135 /* ParenExpression */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + case 140 /* BinaryExpression */: + case 141 /* ConditionalExpression */: + return true; + case 112 /* QualifiedName */: + while (node.parent && node.parent.kind === 112 /* QualifiedName */) + node = node.parent; + return node.parent && node.parent.kind === 124 /* TypeQuery */; + case 55 /* Identifier */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + var parent = node.parent; + if (parent) { + if (isExpression(parent)) + return true; + switch (parent.kind) { + case 166 /* VariableDeclaration */: + case 114 /* Parameter */: + case 115 /* Property */: + case 176 /* EnumMember */: + return parent.initializer === node; + case 146 /* ExpressionStatement */: + case 147 /* IfStatement */: + case 148 /* DoStatement */: + case 149 /* WhileStatement */: + case 154 /* ReturnStatement */: + case 155 /* WithStatement */: + case 156 /* SwitchStatement */: + case 157 /* CaseClause */: + case 160 /* ThrowStatement */: + case 156 /* SwitchStatement */: + return parent.expression === node; + case 150 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 151 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + } + } + } + return false; + } + function getSymbolOfIdentifier(identifier) { + if (isExpression(identifier)) { + if (isRightSideOfQualifiedName()) { + } + return resolveEntityName(identifier, identifier, ts.SymbolFlags.Value); + } + if (isDeclarationIdentifier(identifier)) { + return getSymbolOfNode(identifier.parent); + } + if (isTypeReferenceIdentifier(identifier)) { + var entityName = isRightSideOfQualifiedName() ? identifier.parent : identifier; + var meaning = entityName.parent.kind === 123 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; + return resolveEntityName(entityName, entityName, meaning); + } + function isRightSideOfQualifiedName() { + return (identifier.parent.kind === 112 /* QualifiedName */ || identifier.parent.kind === 130 /* PropertyAccess */) && identifier.parent.right === identifier; + } + } + function getModuleObjectName(node) { + return ts.getSourceTextOfNode(node.name); + } + function isExternalModule(symbol) { + return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 177 /* SourceFile */; + } + function getExpressionNamePrefix(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); + var isExportedSymbolFoundInLocalScope = exportSymbol !== symbol; + var shouldEmitExportWithoutPrefix = (exportSymbol.flags & ts.SymbolFlags.ExportHasLocal) !== 0; + if (isExportedSymbolFoundInLocalScope && !shouldEmitExportWithoutPrefix) { + symbol = exportSymbol; + } + if (symbol.parent) { + return isExternalModule(symbol.parent) ? "exports" : symbolToString(symbol.parent); + } + } + } + function getPropertyAccessSubstitution(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & 4 /* EnumMember */)) { + var declaration = symbol.valueDeclaration; + var constantValue; + if (declaration.kind === 176 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue.toString() + " /* " + ts.identifierToString(declaration.name) + " */"; + } + } + } + function getExportAssignmentName(node) { + var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); + return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + } + function isTopLevelValueImportedViaEntityName(node) { + if (node.parent.kind !== 177 /* SourceFile */ || !node.entityName) { + return false; + } + var symbol = getSymbolOfNode(node); + var target = resolveImport(symbol); + return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + } + function isReferencedImportDeclaration(node) { + var symbol = getSymbolOfNode(node); + if (getSymbolLinks(symbol).referenced) { + return true; + } + if (node.flags & 1 /* Export */) { + var target = resolveImport(symbol); + if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { + return true; + } + } + return false; + } + function getNodeCheckFlags(node) { + return getNodeLinks(node).flags; + } + function getEnumMemberValue(node) { + return getNodeLinks(node).enumMemberValue; + } + function invokeEmitter() { + var resolver = { + getProgram: function () { return program; }, + getModuleObjectName: getModuleObjectName, + getExpressionNamePrefix: getExpressionNamePrefix, + getPropertyAccessSubstitution: getPropertyAccessSubstitution, + getExportAssignmentName: getExportAssignmentName, + isReferencedImportDeclaration: isReferencedImportDeclaration, + getNodeCheckFlags: getNodeCheckFlags, + getEnumMemberValue: getEnumMemberValue, + isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName + }; + checkProgram(); + return ts.emitFiles(resolver); + } + function initializeTypeChecker() { + ts.forEach(program.getSourceFiles(), function (file) { + ts.bindSourceFile(file); + ts.forEach(file.semanticErrors, addDiagnostic); + }); + ts.forEach(program.getSourceFiles(), function (file) { + if (!(file.flags & 1024 /* ExternalModule */)) { + extendSymbolTable(globals, file.locals); + } + }); + getSymbolLinks(undefinedSymbol).type = undefinedType; + getSymbolLinks(argumentsSymbol).type = anyType; + getSymbolLinks(unknownSymbol).type = unknownType; + globals[undefinedSymbol.name] = undefinedSymbol; + globalObjectType = getGlobalType("Object"); + globalFunctionType = getGlobalType("Function"); + globalArrayType = getGlobalType("Array", 1); + globalStringType = getGlobalType("String"); + globalNumberType = getGlobalType("Number"); + globalBooleanType = getGlobalType("Boolean"); + globalRegExpType = getGlobalType("RegExp"); + } + initializeTypeChecker(); + checker = { + getProgram: function () { return program; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, + getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, + getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, + getTypeCount: function () { return typeCount; }, + checkProgram: checkProgram, + emitFiles: invokeEmitter, + getSymbolOfNode: getSymbolOfNode, + getParentOfSymbol: getParentOfSymbol, + getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, + getPropertiesOfType: getPropertiesOfType, + getSignaturesOfType: getSignaturesOfType, + getIndexTypeOfType: getIndexTypeOfType, + getReturnTypeOfSignature: getReturnTypeOfSignature, + resolveEntityName: resolveEntityName, + getSymbolsInScope: getSymbolsInScope, + getSymbolOfIdentifier: getSymbolOfIdentifier + }; + return checker; + } + ts.createTypeChecker = createTypeChecker; +})(ts || (ts = {})); +var ts; +(function (ts) { + (function (ByteOrderMark) { + ByteOrderMark[ByteOrderMark["None"] = 0] = "None"; + ByteOrderMark[ByteOrderMark["Utf8"] = 1] = "Utf8"; + ByteOrderMark[ByteOrderMark["Utf16BigEndian"] = 2] = "Utf16BigEndian"; + ByteOrderMark[ByteOrderMark["Utf16LittleEndian"] = 3] = "Utf16LittleEndian"; + })(ts.ByteOrderMark || (ts.ByteOrderMark = {})); + var ByteOrderMark = ts.ByteOrderMark; + var scanner = ts.createScanner(1 /* ES5 */); + var emptyArray = []; + function createNode(kind, pos, end, flags, parent) { + var node = new (ts.getNodeConstructor(kind))(); + node.pos = pos; + node.end = end; + node.flags = flags; + node.parent = parent; + return node; + } + var NodeObject = (function () { + function NodeObject() { + } + NodeObject.prototype.getSourceFile = function () { + var node = this; + while (node.kind !== 177 /* SourceFile */) + node = node.parent; + return node; + }; + NodeObject.prototype.getTextPos = function () { + return ts.getTokenPosOfNode(this); + }; + NodeObject.prototype.getFullWidth = function () { + return this.end - this.pos; + }; + NodeObject.prototype.getTriviaWidth = function () { + return ts.getTokenPosOfNode(this) - this.pos; + }; + NodeObject.prototype.getFullText = function () { + return this.getSourceFile().text.substring(this.pos, this.end); + }; + NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) { + scanner.setTextPos(pos); + while (pos < end) { + var token = scanner.scan(); + var textPos = scanner.getTextPos(); + var node = nodes.push(createNode(token, pos, textPos, 256 /* Synthetic */, this)); + pos = textPos; + } + return pos; + }; + NodeObject.prototype.createSyntaxList = function (nodes) { + var list = createNode(179 /* SyntaxList */, nodes.pos, nodes.end, 256 /* Synthetic */, this); + list._children = []; + var pos = nodes.pos; + for (var i = 0, len = nodes.length; i < len; i++) { + var node = nodes[i]; + if (pos < node.pos) { + pos = this.addSyntheticNodes(list._children, pos, node.pos); + } + list._children.push(node); + pos = node.end; + } + if (pos < nodes.end) { + this.addSyntheticNodes(list._children, pos, nodes.end); + } + return list; + }; + NodeObject.prototype.createChildren = function () { + var _this = this; + if (this.kind > 111 /* Missing */) { + scanner.setText(this.getSourceFile().text); + var children = []; + var pos = this.pos; + var processNode = function (node) { + if (pos < node.pos) { + pos = _this.addSyntheticNodes(children, pos, node.pos); + } + children.push(node); + pos = node.end; + }; + var processNodes = function (nodes) { + if (pos < nodes.pos) { + pos = _this.addSyntheticNodes(children, pos, nodes.pos); + } + children.push(_this.createSyntaxList(nodes)); + pos = nodes.end; + }; + ts.forEachChild(this, processNode, processNodes); + if (pos < this.end) { + this.addSyntheticNodes(children, pos, this.end); + } + scanner.setText(undefined); + } + this._children = children || emptyArray; + }; + NodeObject.prototype.getChildCount = function () { + if (!this._children) + this.createChildren(); + return this._children.length; + }; + NodeObject.prototype.getChildAt = function (index) { + if (!this._children) + this.createChildren(); + return this._children[index]; + }; + NodeObject.prototype.getChildren = function () { + if (!this._children) + this.createChildren(); + return this._children; + }; + NodeObject.prototype.getFirstToken = function () { + var children = this.getChildren(); + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (child.kind < 111 /* Missing */) + return child; + if (child.kind > 111 /* Missing */) + return child.getFirstToken(); + } + }; + NodeObject.prototype.getLastToken = function () { + var children = this.getChildren(); + for (var i = children.length - 1; i >= 0; i--) { + var child = children[i]; + if (child.kind < 111 /* Missing */) + return child; + if (child.kind > 111 /* Missing */) + return child.getLastToken(); + } + }; + return NodeObject; + })(); + var SymbolObject = (function () { + function SymbolObject(flags, name) { + this.flags = flags; + this.name = name; + } + SymbolObject.prototype.getFlags = function () { + return this.flags; + }; + SymbolObject.prototype.getName = function () { + return this.name; + }; + SymbolObject.prototype.getDeclarations = function () { + return this.declarations; + }; + return SymbolObject; + })(); + var TypeObject = (function () { + function TypeObject(checker, flags) { + this.checker = checker; + this.flags = flags; + } + TypeObject.prototype.getFlags = function () { + return this.flags; + }; + TypeObject.prototype.getSymbol = function () { + return this.symbol; + }; + TypeObject.prototype.getProperties = function () { + return this.checker.getPropertiesOfType(this); + }; + TypeObject.prototype.getCallSignatures = function () { + return this.checker.getSignaturesOfType(this, 0 /* Call */); + }; + TypeObject.prototype.getConstructSignatures = function () { + return this.checker.getSignaturesOfType(this, 1 /* Construct */); + }; + TypeObject.prototype.getStringIndexType = function () { + return this.checker.getIndexTypeOfType(this, 0 /* String */); + }; + TypeObject.prototype.getNumberIndexType = function () { + return this.checker.getIndexTypeOfType(this, 1 /* Number */); + }; + return TypeObject; + })(); + var SignatureObject = (function () { + function SignatureObject(checker) { + this.checker = checker; + } + SignatureObject.prototype.getDeclaration = function () { + return this.declaration; + }; + SignatureObject.prototype.getTypeParameters = function () { + return this.typeParameters; + }; + SignatureObject.prototype.getParameters = function () { + return this.parameters; + }; + SignatureObject.prototype.getReturnType = function () { + return this.checker.getReturnTypeOfSignature(this); + }; + return SignatureObject; + })(); + function createLanguageService(host) { + var program; + var typeChecker; + var filesByName; + function createCompilerHost() { + return { + getSourceFile: function (filename, languageVersion) { + var hostFile = filesByName[filename]; + if (!hostFile.sourceText) { + hostFile.sourceText = host.getScriptSnapshot(filename); + } + return ts.createSourceFile(filename, hostFile.sourceText.getText(0, hostFile.sourceText.getLength()), languageVersion); + }, + getDefaultLibFilename: function () { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(sys.getExecutingFilePath())), "lib.d.ts"); }, + getCancellationToken: function () { return undefined; }, + writeFile: function (fileName, data) { + throw Error("TODO: write file"); + }, + getCurrentDirectory: function () { + throw Error("TODO: getCurrentDirectory"); + } + }; + } + function synchronizeHostData() { + filesByName = {}; + var files = host.getScriptFileNames(); + ts.forEach(files, function (f) { + filesByName[f] = { + version: host.getScriptVersion(f), + isOpen: host.getScriptIsOpen(f), + byteOrderMark: host.getScriptByteOrderMark(f) + }; + }); + var currentProgram = program; + var options = host.getCompilationSettings(); + program = ts.createProgram(files, options, createCompilerHost()); + typeChecker = program.getTypeChecker(); + if (currentProgram) { + } + } + function getSyntacticDiagnostics(filename) { + synchronizeHostData(); + var sourceFile = program.getSourceFile(filename); + return sourceFile ? program.getDiagnostics(sourceFile) : []; + } + function getSemanticDiagnostics(filename) { + synchronizeHostData(); + var sourceFile = program.getSourceFile(filename); + return sourceFile ? typeChecker.getDiagnostics(sourceFile) : []; + } + return { + getSyntacticDiagnostics: getSyntacticDiagnostics, + getSemanticDiagnostics: getSemanticDiagnostics + }; + } + ts.createLanguageService = createLanguageService; + function initializeServices() { + ts.objectAllocator = { + getNodeConstructor: function (kind) { + function Node() { + } + var proto = new NodeObject(); + proto.kind = kind; + proto.pos = 0; + proto.end = 0; + proto.flags = 0; + proto.parent = undefined; + Node.prototype = proto; + return Node; + }, + getSymbolConstructor: function () { return SymbolObject; }, + getTypeConstructor: function () { return TypeObject; }, + getSignatureConstructor: function () { return SignatureObject; } + }; + } + initializeServices(); +})(ts || (ts = {})); +var ts; +(function (ts) { + var ScriptSnapshotShimAdapter = (function () { + function ScriptSnapshotShimAdapter(scriptSnapshotShim) { + this.scriptSnapshotShim = scriptSnapshotShim; + this.lineStartPositions = null; + } + ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { + return this.scriptSnapshotShim.getText(start, end); + }; + ScriptSnapshotShimAdapter.prototype.getLength = function () { + return this.scriptSnapshotShim.getLength(); + }; + ScriptSnapshotShimAdapter.prototype.getLineStartPositions = function () { + if (this.lineStartPositions == null) { + this.lineStartPositions = JSON.parse(this.scriptSnapshotShim.getLineStartPositions()); + } + return this.lineStartPositions; + }; + ScriptSnapshotShimAdapter.prototype.getChangeRange = function (scriptSnapshot) { + function createTextRange(start, length) { + function createSpan(start, length) { + return { + start: function () { return start; }, + end: function () { return start + length; }, + lenth: function () { return length; }, + isEmpty: function () { return length === 0; } + }; + } + return { + span: function () { return createSpan(start, length); }, + newLength: function () { return length; }, + newSpan: function () { return createSpan(start, length); }, + isUnchanged: function () { return length === 0; } + }; + } + var encoded = this.scriptSnapshotShim.getChangeRange(scriptSnapshot.scriptSnapshotShim); + if (encoded == null) { + return null; + } + var decoded = JSON.parse(encoded); + return createTextRange(decoded.span.start, decoded.span.length); + }; + return ScriptSnapshotShimAdapter; + })(); + var LanguageServiceShimHostAdapter = (function () { + function LanguageServiceShimHostAdapter(shimHost) { + this.shimHost = shimHost; + } + LanguageServiceShimHostAdapter.prototype.log = function (s) { + this.shimHost.log(s); + }; + LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { + var settingsJson = this.shimHost.getCompilationSettings(); + if (settingsJson == null || settingsJson == "") { + return {}; + } + var settings = JSON.parse(settingsJson); + return settings; + }; + LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { + var encoded = this.shimHost.getScriptFileNames(); + return JSON.parse(encoded); + }; + LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { + return new ScriptSnapshotShimAdapter(this.shimHost.getScriptSnapshot(fileName)); + }; + LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) { + return this.shimHost.getScriptVersion(fileName); + }; + LanguageServiceShimHostAdapter.prototype.getScriptIsOpen = function (fileName) { + return this.shimHost.getScriptIsOpen(fileName); + }; + LanguageServiceShimHostAdapter.prototype.getScriptByteOrderMark = function (fileName) { + return this.shimHost.getScriptByteOrderMark(fileName); + }; + LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { + var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); + if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + return null; + } + try { + return JSON.parse(diagnosticMessagesJson); + } + catch (e) { + this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format"); + return null; + } + }; + return LanguageServiceShimHostAdapter; + })(); + ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; +})(ts || (ts = {})); +var ts; +(function (ts) { + var shortOptionNames = { + "d": "declaration", + "h": "help", + "m": "module", + "o": "out", + "t": "target", + "v": "version" + }; + var options = [ + { name: "codepage", type: "number" }, + { name: "declaration", type: "boolean" }, + { name: "diagnostics", type: "boolean" }, + { name: "help", type: "boolean" }, + { name: "locale", type: "string" }, + { name: "mapRoot", type: "string" }, + { name: "module", type: { "commonjs": 1 /* CommonJS */, "amd": 2 /* AMD */ }, error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { name: "noImplicitAny", type: "boolean" }, + { name: "noLib", type: "boolean" }, + { name: "noLibCheck", type: "boolean" }, + { name: "noResolve", type: "boolean" }, + { name: "out", type: "string" }, + { name: "outDir", type: "string" }, + { name: "removeComments", type: "boolean" }, + { name: "sourceMap", type: "boolean" }, + { name: "sourceRoot", type: "string" }, + { name: "target", type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 }, + { name: "version", type: "boolean" } + ]; + var optionDeclarations = {}; + ts.forEach(options, function (option) { + optionDeclarations[option.name.toLowerCase()] = option; + }); + function parseCommandLine(commandLine) { + var options = { + target: 0 /* ES3 */ + }; + var filenames = []; + var errors = []; + parseStrings(commandLine); + return { + options: options, + filenames: filenames, + errors: errors + }; + function parseStrings(args) { + var i = 0; + while (i < args.length) { + var s = args[i++]; + if (s.charCodeAt(0) === 64 /* at */) { + parseResponseFile(s.slice(1)); + } + else if (s.charCodeAt(0) === 45 /* minus */) { + s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); + if (ts.hasProperty(shortOptionNames, s)) { + s = shortOptionNames[s]; + } + if (ts.hasProperty(optionDeclarations, s)) { + var opt = optionDeclarations[s]; + if (!args[i] && opt.type !== "boolean") { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); + } + switch (opt.type) { + case "number": + options[opt.name] = parseInt(args[i++]); + break; + case "boolean": + options[opt.name] = true; + break; + case "string": + options[opt.name] = args[i++] || ""; + break; + default: + var value = (args[i++] || "").toLowerCase(); + if (ts.hasProperty(opt.type, value)) { + options[opt.name] = opt.type[value]; + } + else { + errors.push(ts.createCompilerDiagnostic(opt.error)); + } + } + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); + } + } + else { + filenames.push(s); + } + } + } + function parseResponseFile(filename) { + var text = sys.readFile(filename); + if (!text) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, filename)); + return; + } + var args = []; + var pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) + pos++; + if (pos >= text.length) + break; + var start = pos; + if (text.charCodeAt(start) === 34 /* doubleQuote */) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) + pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, filename)); + } + } + else { + while (text.charCodeAt(pos) > 32 /* space */) + pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } + ts.parseCommandLine = parseCommandLine; +})(ts || (ts = {})); diff --git a/bin/tc.js b/bin/tc.js new file mode 100644 index 0000000000000..5eee610c772ee --- /dev/null +++ b/bin/tc.js @@ -0,0 +1,11354 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +var ts; +(function (ts) { + ts.Diagnostics = { + Unknown_compiler_option_0: { code: 6001, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, + File_0_not_found: { code: 6002, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Unrecognized_escape_sequence: { code: 1000, category: 1 /* Error */, key: "Unrecognized escape sequence." }, + Unexpected_character_0: { code: 1001, category: 1 /* Error */, key: "Unexpected character {0}." }, + Missing_close_quote_character: { code: 1002, category: 1 /* Error */, key: "Missing close quote character." }, + Identifier_expected: { code: -9999999, category: 1 /* Error */, key: "Identifier expected." }, + _0_keyword_expected: { code: 1004, category: 1 /* Error */, key: "'{0}' keyword expected." }, + _0_expected: { code: -9999999, category: 1 /* Error */, key: "'{0}' expected." }, + Identifier_expected_0_is_a_keyword: { code: 1006, category: 1 /* Error */, key: "Identifier expected; '{0}' is a keyword." }, + Automatic_semicolon_insertion_not_allowed: { code: 1007, category: 1 /* Error */, key: "Automatic semicolon insertion not allowed." }, + Unexpected_token_0_expected: { code: 1008, category: 1 /* Error */, key: "Unexpected token; '{0}' expected." }, + Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, + public_or_private_modifier_must_precede_static: { code: 1011, category: 1 /* Error */, key: "'public' or 'private' modifier must precede 'static'." }, + Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, + extends_clause_already_seen: { code: 1024, category: 1 /* Error */, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1025, category: 1 /* Error */, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1027, category: 1 /* Error */, key: "'implements' clause already seen." }, + Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, + Interface_declaration_cannot_have_implements_clause: { code: 1032, category: 1 /* Error */, key: "Interface declaration cannot have 'implements' clause." }, + super_invocation_cannot_have_type_arguments: { code: 1034, category: 1 /* Error */, key: "'super' invocation cannot have type arguments." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, + Modifiers_cannot_appear_here: { code: 1055, category: 1 /* Error */, key: "Modifiers cannot appear here." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: -9999999, category: 1 /* Error */, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, + module_class_interface_enum_import_or_statement: { code: 1067, category: 3 /* NoPrefix */, key: "module, class, interface, enum, import or statement" }, + constructor_function_accessor_or_variable: { code: 1068, category: 3 /* NoPrefix */, key: "constructor, function, accessor or variable" }, + statement: { code: 1069, category: 3 /* NoPrefix */, key: "statement" }, + case_or_default_clause: { code: 1070, category: 3 /* NoPrefix */, key: "case or default clause" }, + identifier: { code: 1071, category: 3 /* NoPrefix */, key: "identifier" }, + call_construct_index_property_or_function_signature: { code: 1072, category: 3 /* NoPrefix */, key: "call, construct, index, property or function signature" }, + expression: { code: 1073, category: 3 /* NoPrefix */, key: "expression" }, + type_name: { code: 1074, category: 3 /* NoPrefix */, key: "type name" }, + property_or_accessor: { code: 1075, category: 3 /* NoPrefix */, key: "property or accessor" }, + parameter: { code: 1076, category: 3 /* NoPrefix */, key: "parameter" }, + type: { code: 1077, category: 3 /* NoPrefix */, key: "type" }, + type_parameter: { code: 1078, category: 3 /* NoPrefix */, key: "type parameter" }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, + Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "'continue' statement can only be used within an enclosing iteration statement." }, + break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_not_found: { code: 1106, category: 1 /* Error */, key: "Jump target not found." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, + return_statement_must_be_contained_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "'return' statement must be contained within a function body." }, + Expression_expected: { code: -9999999, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: -9999999, category: 1 /* Error */, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, + Duplicate_identifier_0: { code: 2000, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + A_class_may_only_implement_another_class_or_interface: { code: 2074, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + get_and_set_accessor_must_have_the_same_type: { code: 2096, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + Static_members_cannot_reference_class_type_parameters: { code: 2099, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: 1 /* Error */, key: "Variable declarations of a 'for' statement cannot use a type annotation." }, + Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: { code: 2116, category: 1 /* Error */, key: "Variable declarations of a 'for' statement must be of types 'string' or 'any'." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + Getters_must_return_a_value: { code: 2126, category: 1 /* Error */, key: "Getters must return a value." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + Setters_cannot_return_a_value: { code: 2122, category: 1 /* Error */, key: "Setters cannot return a value." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + Overload_signatures_must_all_be_public_or_private: { code: 2150, category: 1 /* Error */, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Duplicate_string_index_signature: { code: 2232, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2233, category: 1 /* Error */, key: "Duplicate number index signature." }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Constructor_implementation_expected: { code: 2240, category: 1 /* Error */, key: "Constructor implementation expected." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + Circular_definition_of_import_alias_0: { code: 3000, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 3001, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 3002, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + Cannot_find_external_module_0: { code: 3003, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 3006, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Generic_type_0_requires_1_type_argument_s: { code: 3008, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 3009, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Cannot_find_global_type_0: { code: 3010, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + this_cannot_be_referenced_in_a_module_body: { code: 3013, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + this_cannot_be_referenced_in_current_location: { code: -9999999, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + Property_0_does_not_exist_on_type_1: { code: 3017, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 3027, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 3029, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Duplicate_function_implementation: { code: 3034, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Index_signature_is_missing_in_type_0: { code: 4003, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 4004, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: 3 /* NoPrefix */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, + Could_not_write_file_0: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}'." }, + Could_not_create_directory_0: { code: 5035, category: 1 /* Error */, key: "Could not create directory '{0}'." }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, + Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, + Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: 1 /* Error */, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Array_literal_implicitly_has_an_0_type: { code: 7015, category: 1 /* Error */, key: "Array literal implicitly has an '{0}' type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + variable_declaration_list_cannot_be_empty: { code: -9999999, category: 1 /* Error */, key: "variable declaration list cannot be empty." }, + Digit_expected: { code: -9999999, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: -9999999, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: -9999999, category: 1 /* Error */, key: "Unexpected end of text." }, + Unterminated_string_constant: { code: -9999999, category: 1 /* Error */, key: "Unterminated string constant." }, + Invalid_character: { code: -9999999, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: -9999999, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: -9999999, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: -9999999, category: 1 /* Error */, key: "Property or signature expected." }, + Property_or_method_expected: { code: -9999999, category: 1 /* Error */, key: "Property or method expected." }, + Enum_member_expected: { code: -9999999, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: -9999999, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: -9999999, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: -9999999, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: -9999999, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: -9999999, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: -9999999, category: 1 /* Error */, key: "String literal expected." }, + not_preceded_by_parameter_list: { code: -9999999, category: 1 /* Error */, key: "'=>' not preceded by parameter list." }, + Invalid_assignment_target: { code: -9999999, category: 1 /* Error */, key: "Invalid assignment target." }, + super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: 1 /* Error */, key: "'super' must be followed by argument list or member access." }, + Line_break_not_permitted_here: { code: -9999999, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: -9999999, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: -9999999, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Class_member_declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Class member declaration expected." }, + Declaration_expected: { code: -9999999, category: 1 /* Error */, key: "Declaration expected." }, + Invalid_reference_comment: { code: -9999999, category: 1 /* Error */, key: "Invalid reference comment." }, + File_0_is_not_an_external_module: { code: -9999999, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: -9999999, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: -9999999, category: 1 /* Error */, key: "Private property '{0}' cannot be reimplemented." }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: 1 /* Error */, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: 1 /* Error */, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + Import_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: -9999999, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Unknown_identifier_0: { code: -9999999, category: 1 /* Error */, key: "Unknown identifier '{0}'." }, + Property_0_is_inaccessible: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' is inaccessible." }, + Function_implementation_expected: { code: -9999999, category: 1 /* Error */, key: "Function implementation expected." }, + Statements_are_not_allowed_in_declaration_contexts: { code: -9999999, category: 1 /* Error */, key: "Statements are not allowed in declaration contexts." }, + Initializers_are_not_allowed_in_declaration_contexts: { code: -9999999, category: 1 /* Error */, key: "Initializers are not allowed in declaration contexts." }, + return_statement_has_no_containing_function: { code: -9999999, category: 1 /* Error */, key: "'return' statement has no containing function." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, + Class_0_incorrectly_implements_interface_1: { code: -9999999, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + In_an_enum_declaration_context_initializer_must_be_a_number_literal: { code: -9999999, category: 1 /* Error */, key: "In an enum declaration context initializer must be a number literal." }, + Ambient_external_modules_require_a_declare_modifier: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules require a 'declare' modifier." }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: -9999999, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: -9999999, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Compiler_option_0_expects_an_argument: { code: -9999999, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: -9999999, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: -9999999, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: -9999999, category: 1 /* Error */, key: "Unsupported locale {0}." }, + Unable_to_open_file_0: { code: -9999999, category: 1 /* Error */, key: "Unable to open file {0}." }, + Corrupted_locale_file_0: { code: -9999999, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + No_input_files_specified: { code: -9999999, category: 1 /* Error */, key: "No input files specified." } + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var textToToken = { + "any": 101 /* AnyKeyword */, + "boolean": 102 /* BooleanKeyword */, + "break": 56 /* BreakKeyword */, + "case": 57 /* CaseKeyword */, + "catch": 58 /* CatchKeyword */, + "class": 59 /* ClassKeyword */, + "continue": 61 /* ContinueKeyword */, + "const": 60 /* ConstKeyword */, + "constructor": 103 /* ConstructorKeyword */, + "debugger": 62 /* DebuggerKeyword */, + "declare": 104 /* DeclareKeyword */, + "default": 63 /* DefaultKeyword */, + "delete": 64 /* DeleteKeyword */, + "do": 65 /* DoKeyword */, + "else": 66 /* ElseKeyword */, + "enum": 67 /* EnumKeyword */, + "export": 68 /* ExportKeyword */, + "extends": 69 /* ExtendsKeyword */, + "false": 70 /* FalseKeyword */, + "finally": 71 /* FinallyKeyword */, + "for": 72 /* ForKeyword */, + "function": 73 /* FunctionKeyword */, + "get": 105 /* GetKeyword */, + "if": 74 /* IfKeyword */, + "implements": 92 /* ImplementsKeyword */, + "import": 75 /* ImportKeyword */, + "in": 76 /* InKeyword */, + "instanceof": 77 /* InstanceOfKeyword */, + "interface": 93 /* InterfaceKeyword */, + "let": 94 /* LetKeyword */, + "module": 106 /* ModuleKeyword */, + "new": 78 /* NewKeyword */, + "null": 79 /* NullKeyword */, + "number": 108 /* NumberKeyword */, + "package": 95 /* PackageKeyword */, + "private": 96 /* PrivateKeyword */, + "protected": 97 /* ProtectedKeyword */, + "public": 98 /* PublicKeyword */, + "require": 107 /* RequireKeyword */, + "return": 80 /* ReturnKeyword */, + "set": 109 /* SetKeyword */, + "static": 99 /* StaticKeyword */, + "string": 110 /* StringKeyword */, + "super": 81 /* SuperKeyword */, + "switch": 82 /* SwitchKeyword */, + "this": 83 /* ThisKeyword */, + "throw": 84 /* ThrowKeyword */, + "true": 85 /* TrueKeyword */, + "try": 86 /* TryKeyword */, + "typeof": 87 /* TypeOfKeyword */, + "var": 88 /* VarKeyword */, + "void": 89 /* VoidKeyword */, + "while": 90 /* WhileKeyword */, + "with": 91 /* WithKeyword */, + "yield": 100 /* YieldKeyword */, + "{": 5 /* OpenBraceToken */, + "}": 6 /* CloseBraceToken */, + "(": 7 /* OpenParenToken */, + ")": 8 /* CloseParenToken */, + "[": 9 /* OpenBracketToken */, + "]": 10 /* CloseBracketToken */, + ".": 11 /* DotToken */, + "...": 12 /* DotDotDotToken */, + ";": 13 /* SemicolonToken */, + ",": 14 /* CommaToken */, + "<": 15 /* LessThanToken */, + ">": 16 /* GreaterThanToken */, + "<=": 17 /* LessThanEqualsToken */, + ">=": 18 /* GreaterThanEqualsToken */, + "==": 19 /* EqualsEqualsToken */, + "!=": 20 /* ExclamationEqualsToken */, + "===": 21 /* EqualsEqualsEqualsToken */, + "!==": 22 /* ExclamationEqualsEqualsToken */, + "=>": 23 /* EqualsGreaterThanToken */, + "+": 24 /* PlusToken */, + "-": 25 /* MinusToken */, + "*": 26 /* AsteriskToken */, + "/": 27 /* SlashToken */, + "%": 28 /* PercentToken */, + "++": 29 /* PlusPlusToken */, + "--": 30 /* MinusMinusToken */, + "<<": 31 /* LessThanLessThanToken */, + ">>": 32 /* GreaterThanGreaterThanToken */, + ">>>": 33 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 34 /* AmpersandToken */, + "|": 35 /* BarToken */, + "^": 36 /* CaretToken */, + "!": 37 /* ExclamationToken */, + "~": 38 /* TildeToken */, + "&&": 39 /* AmpersandAmpersandToken */, + "||": 40 /* BarBarToken */, + "?": 41 /* QuestionToken */, + ":": 42 /* ColonToken */, + "=": 43 /* EqualsToken */, + "+=": 44 /* PlusEqualsToken */, + "-=": 45 /* MinusEqualsToken */, + "*=": 46 /* AsteriskEqualsToken */, + "/=": 47 /* SlashEqualsToken */, + "%=": 48 /* PercentEqualsToken */, + "<<=": 49 /* LessThanLessThanEqualsToken */, + ">>=": 50 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 52 /* AmpersandEqualsToken */, + "|=": 53 /* BarEqualsToken */, + "^=": 54 /* CaretEqualsToken */ + }; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + function lookupInUnicodeMap(code, map) { + if (code < map[0]) { + return false; + } + var lo = 0; + var hi = map.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + function makeReverseMap(source) { + var result = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t) { + return tokenStrings[t]; + } + ts.tokenToString = tokenToString; + function getLineStarts(text) { + var result = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + switch (text.charCodeAt(pos++)) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + result.push(lineStart); + lineStart = pos; + break; + } + } + result.push(lineStart); + return result; + } + ts.getLineStarts = getLineStarts; + function getLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = ts.binarySearch(lineStarts, position); + if (lineNumber < 0) { + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function positionToLineAndCharacter(text, pos) { + var lineStarts = getLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + ts.positionToLineAndCharacter = positionToLineAndCharacter; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; + } + function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; + } + function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; + } + function isHexDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */; + } + function skipTrivia(text, pos, stopAfterLineBreak) { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (stopAfterLineBreak) + return pos; + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (isWhiteSpace(ch) || isLineBreak(ch)) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts.skipTrivia = skipTrivia; + function createScanner(languageVersion, text, onError, onComment) { + var pos; + var len; + var startPos; + var tokenPos; + var token; + var precedingLineBreak; + var hasUnicodeEscapeSequence; + function error(message) { + if (onError) + onError(message); + } + function isIdentifierStart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + function scanNumber() { + token = 2 /* NumericLiteral */; + while (isDigit(text.charCodeAt(pos))) + pos++; + if (text.charCodeAt(pos) === 46 /* dot */) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + } + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { + pos++; + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) + pos++; + if (!isDigit(text.charCodeAt(pos))) { + error(ts.Diagnostics.Digit_expected); + } + else { + do { + pos++; + } while (isDigit(text.charCodeAt(pos))); + } + } + return token; + } + function scanHexDigits(count, exact, ignoreErrors) { + var n = 0; + while ((n < count || !exact) && isHexDigit(text.charCodeAt(pos))) { + pos++; + n++; + } + if (n < count && !ignoreErrors) + error(ts.Diagnostics.Hexadecimal_digit_expected); + } + function scanHexNumber() { + token = 2 /* NumericLiteral */; + pos += 2; + scanHexDigits(1, false); + return token; + } + function scanString() { + token = 3 /* StringLiteral */; + var quote = text.charCodeAt(pos++); + while (true) { + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + pos++; + break; + } + if (isLineBreak(ch)) { + error(ts.Diagnostics.Unterminated_string_constant); + break; + } + pos++; + if (ch === 92 /* backslash */) { + switch (text.charCodeAt(pos)) { + case 13 /* carriageReturn */: + pos++; + if (text.charCodeAt(pos) === 10 /* lineFeed */) + pos++; + break; + case 120 /* x */: + pos++; + scanHexDigits(2, true); + break; + case 117 /* u */: + pos++; + scanHexDigits(4, true); + break; + default: + if (pos < len) + pos++; + } + } + } + return token; + } + function scanUnicodeIdentifierOrKeyword() { + var startPos = pos; + do { + scanCharOrUnicodeEscape(); + } while (isIdentifierPart(peekCharOrUnicodeEscape())); + var id = convertUnicodeEscapes(startPos, pos); + if (hasOwnProperty.call(textToToken, id)) { + return token = textToToken[id]; + } + return 55 /* Identifier */; + } + function peekCharOrUnicodeEscape() { + var ch; + tryScan(function () { + ch = scanCharOrUnicodeEscape(true); + }); + return ch; + } + function scanCharOrUnicodeEscape(ignoreErrors) { + var ch = text.charCodeAt(pos++); + if (ch === 92 /* backslash */ && text.charCodeAt(pos) === 117 /* u */) { + pos++; + hasUnicodeEscapeSequence = true; + return scanUnicodeEscape(ignoreErrors); + } + return ch; + } + function hexValue(start, length) { + var value = 0; + for (var i = 0; i < length; i++) { + var ch = text.charCodeAt(start + i); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) + value = (value << 4) + ch - 48 /* _0 */; + else if (ch >= 97 /* a */ && ch <= 102 /* f */) + value = (value << 4) + ch - 97 /* a */ + 10; + else if (ch >= 65 /* A */ && ch <= 70 /* F */) + value = (value << 4) + ch - 65 /* A */ + 10; + else + break; + } + return value; + } + function scanUnicodeEscape(ignoreErrors) { + var startPos = pos; + scanHexDigits(4, true, ignoreErrors); + return hexValue(startPos, 4); + } + var characterArray = []; + function convertUnicodeEscapes(pos, end) { + characterArray.length = 0; + var i = pos; + while (i < end) { + var ch = text.charCodeAt(i++); + if (ch === 92 /* backslash */ && text.charCodeAt(i) === 117 /* u */) { + i++; + var j = 0; + while (j < 4 && isHexDigit(text.charCodeAt(i + j))) + j++; + characterArray.push(hexValue(i, j)); + i += j; + } + else { + characterArray.push(ch); + } + } + ts.Debug.assert(characterArray.length, "Could not unescape a unicode sequence"); + return String.fromCharCode.apply(null, characterArray); + } + function scan() { + startPos = pos; + precedingLineBreak = false; + hasUnicodeEscapeSequence = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = 1 /* EndOfFileToken */; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case 10 /* lineFeed */: + case 13 /* carriageReturn */: + precedingLineBreak = true; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 22 /* ExclamationEqualsEqualsToken */; + } + return pos += 2, token = 20 /* ExclamationEqualsToken */; + } + return pos++, token = 37 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: + return scanString(); + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 48 /* PercentEqualsToken */; + } + return pos++, token = 28 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 39 /* AmpersandAmpersandToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 52 /* AmpersandEqualsToken */; + } + return pos++, token = 34 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 7 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 8 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 46 /* AsteriskEqualsToken */; + } + return pos++, token = 26 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 29 /* PlusPlusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 44 /* PlusEqualsToken */; + } + return pos++, token = 24 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 14 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 30 /* MinusMinusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 45 /* MinusEqualsToken */; + } + return pos++, token = 25 /* MinusToken */; + case 46 /* dot */: + if (isDigit(text.charCodeAt(pos + 1))) { + return scanNumber(); + } + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 12 /* DotDotDotToken */; + } + return pos++, token = 11 /* DotToken */; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + continue; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 47 /* SlashEqualsToken */; + } + return pos++, token = 27 /* SlashToken */; + case 48 /* _0 */: + if (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */) { + return scanHexNumber(); + } + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + return scanNumber(); + case 58 /* colon */: + return pos++, token = 42 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 13 /* SemicolonToken */; + case 60 /* lessThan */: + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 49 /* LessThanLessThanEqualsToken */; + } + return pos += 2, token = 31 /* LessThanLessThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 17 /* LessThanEqualsToken */; + } + return pos++, token = 15 /* LessThanToken */; + case 61 /* equals */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 21 /* EqualsEqualsEqualsToken */; + } + return pos += 2, token = 19 /* EqualsEqualsToken */; + } + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 23 /* EqualsGreaterThanToken */; + } + return pos++, token = 43 /* EqualsToken */; + case 62 /* greaterThan */: + return pos++, token = 16 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 41 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 9 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 10 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* CaretEqualsToken */; + } + return pos++, token = 36 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 5 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 40 /* BarBarToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 53 /* BarEqualsToken */; + } + return pos++, token = 35 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 6 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 38 /* TildeToken */; + default: + if (isIdentifierStart(ch)) { + var lastCh; + do { + lastCh = text.charCodeAt(++pos); + } while (isIdentifierPart(lastCh)); + if (lastCh !== 92 /* backslash */) { + if (ch >= 97 /* a */ && ch <= 122 /* z */ && pos - tokenPos >= 2) { + var id = text.substring(tokenPos, pos); + if (hasOwnProperty.call(textToToken, id)) { + return token = textToToken[id]; + } + } + return token = 55 /* Identifier */; + } + else { + pos = tokenPos; + } + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + if (isIdentifierStart(peekCharOrUnicodeEscape())) { + return scanUnicodeIdentifierOrKeyword(); + } + if (pos < len) { + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + } + } + } + } + function reScanGreaterToken() { + if (token === 16 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + } + return pos += 2, token = 33 /* GreaterThanGreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 50 /* GreaterThanGreaterThanEqualsToken */; + } + return pos++, token = 32 /* GreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 18 /* GreaterThanEqualsToken */; + } + } + return token; + } + function reScanSlashToken() { + if (token === 27 /* SlashToken */ || token === 47 /* SlashEqualsToken */) { + var p = tokenPos + 1; + var inEscape = false; + var inClass = false; + while (true) { + if (p >= len) { + return token; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + return token; + } + if (inEscape) { + inEscape = false; + } + else if (ch === 47 /* slash */) { + break; + } + else if (ch === 91 /* openBracket */) { + inClass = true; + } + else if (ch === 92 /* backslash */) { + inEscape = true; + } + else if (ch === 93 /* closeBracket */) { + inClass = false; + } + p++; + } + p++; + while (isIdentifierPart(text.charCodeAt(p))) + p++; + token = 4 /* RegularExpressionLiteral */; + pos = p; + } + return token; + } + function tryScan(callback) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var savePrecedingLineBreak = precedingLineBreak; + var savehasUnicodeEscapeSequence = hasUnicodeEscapeSequence; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + precedingLineBreak = savePrecedingLineBreak; + hasUnicodeEscapeSequence = savehasUnicodeEscapeSequence; + } + return result; + } + function setText(newText) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + function setTextPos(textPos) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0 /* Unknown */; + precedingLineBreak = false; + } + setText(text); + return { + getStartPos: function () { return startPos; }, + getTextPos: function () { return pos; }, + getToken: function () { return token; }, + getTokenPos: function () { return tokenPos; }, + getTokenText: function () { return text.substring(tokenPos, pos); }, + getIdentifierText: function () { return hasUnicodeEscapeSequence ? convertUnicodeEscapes(tokenPos, pos) : text.substring(tokenPos, pos); }, + hasPrecedingLineBreak: function () { return precedingLineBreak; }, + isIdentifier: function () { return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, + isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } + ts.createScanner = createScanner; +})(ts || (ts = {})); +var ts; +(function (ts) { + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 2] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 3] = "StringLiteral"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 4] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 5] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 6] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 7] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 8] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 9] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 10] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 11] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 12] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 13] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 14] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 15] = "LessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 16] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 17] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 18] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 19] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 20] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 21] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 22] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 23] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 24] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 25] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 26] = "AsteriskToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 27] = "SlashToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 28] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 29] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 30] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 31] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 32] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 33] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 34] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 35] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 36] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 37] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 38] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 39] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 40] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 41] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 42] = "ColonToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 43] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 44] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 45] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 46] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 47] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 48] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 49] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 50] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 51] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 52] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 53] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 54] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["Identifier"] = 55] = "Identifier"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 56] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 57] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 58] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 59] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 60] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 61] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 62] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 63] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 64] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 65] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 66] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 67] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 68] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 69] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 70] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 71] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 72] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 73] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 74] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 75] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 76] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 77] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 78] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 79] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 80] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 81] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 82] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 83] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 84] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 85] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 86] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 87] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 88] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 89] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 90] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 91] = "WithKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 92] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 93] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 94] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 95] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 96] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 97] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 98] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 99] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 100] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 101] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 102] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 103] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 104] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 105] = "GetKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 106] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 107] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 108] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 109] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 110] = "StringKeyword"; + SyntaxKind[SyntaxKind["Missing"] = 111] = "Missing"; + SyntaxKind[SyntaxKind["QualifiedName"] = 112] = "QualifiedName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 113] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 114] = "Parameter"; + SyntaxKind[SyntaxKind["Property"] = 115] = "Property"; + SyntaxKind[SyntaxKind["Method"] = 116] = "Method"; + SyntaxKind[SyntaxKind["Constructor"] = 117] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 118] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 119] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 120] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 121] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 122] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypeReference"] = 123] = "TypeReference"; + SyntaxKind[SyntaxKind["TypeQuery"] = 124] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 125] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; + SyntaxKind[SyntaxKind["ArrayLiteral"] = 127] = "ArrayLiteral"; + SyntaxKind[SyntaxKind["ObjectLiteral"] = 128] = "ObjectLiteral"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 129] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAccess"] = 130] = "PropertyAccess"; + SyntaxKind[SyntaxKind["IndexedAccess"] = 131] = "IndexedAccess"; + SyntaxKind[SyntaxKind["CallExpression"] = 132] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 133] = "NewExpression"; + SyntaxKind[SyntaxKind["TypeAssertion"] = 134] = "TypeAssertion"; + SyntaxKind[SyntaxKind["ParenExpression"] = 135] = "ParenExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 136] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 137] = "ArrowFunction"; + SyntaxKind[SyntaxKind["PrefixOperator"] = 138] = "PrefixOperator"; + SyntaxKind[SyntaxKind["PostfixOperator"] = 139] = "PostfixOperator"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 140] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 141] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 142] = "OmittedExpression"; + SyntaxKind[SyntaxKind["Block"] = 143] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 144] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 145] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 146] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 148] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 149] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 150] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 151] = "ForInStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 152] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 154] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 155] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; + SyntaxKind[SyntaxKind["CaseClause"] = 157] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 158] = "DefaultClause"; + SyntaxKind[SyntaxKind["LabelledStatement"] = 159] = "LabelledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 160] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 161] = "TryStatement"; + SyntaxKind[SyntaxKind["TryBlock"] = 162] = "TryBlock"; + SyntaxKind[SyntaxKind["CatchBlock"] = 163] = "CatchBlock"; + SyntaxKind[SyntaxKind["FinallyBlock"] = 164] = "FinallyBlock"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 165] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 166] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 167] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["FunctionBlock"] = 168] = "FunctionBlock"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 169] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 170] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 171] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 172] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 173] = "ModuleBlock"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 174] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 175] = "ExportAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 176] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 177] = "SourceFile"; + SyntaxKind[SyntaxKind["Program"] = 178] = "Program"; + SyntaxKind[SyntaxKind["SyntaxList"] = 179] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 180] = "Count"; + SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; + })(ts.SyntaxKind || (ts.SyntaxKind = {})); + var SyntaxKind = ts.SyntaxKind; + (function (NodeFlags) { + NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; + NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; + NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; + NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; + NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; + NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; + NodeFlags[NodeFlags["Static"] = 0x00000040] = "Static"; + NodeFlags[NodeFlags["MultiLine"] = 0x00000080] = "MultiLine"; + NodeFlags[NodeFlags["Synthetic"] = 0x00000100] = "Synthetic"; + NodeFlags[NodeFlags["DeclarationFile"] = 0x00000200] = "DeclarationFile"; + NodeFlags[NodeFlags["ExternalModule"] = 0x00000400] = "ExternalModule"; + NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Static] = "Modifier"; + })(ts.NodeFlags || (ts.NodeFlags = {})); + var NodeFlags = ts.NodeFlags; + (function (SymbolFlags) { + SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; + SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; + SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; + SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; + SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; + SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; + SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; + SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; + SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; + SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; + SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; + SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; + SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; + SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; + SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; + SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; + SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; + SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; + SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; + SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; + SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; + SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; + SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; + SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; + SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; + SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; + SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; + SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; + SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; + SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; + SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; + SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; + SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; + SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; + SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; + SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; + SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; + SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; + SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; + SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; + SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; + })(ts.SymbolFlags || (ts.SymbolFlags = {})); + var SymbolFlags = ts.SymbolFlags; + (function (NodeCheckFlags) { + NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; + NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; + NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; + NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; + NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; + NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; + })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); + var NodeCheckFlags = ts.NodeCheckFlags; + (function (TypeFlags) { + TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; + TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; + TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; + TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; + TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; + TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; + TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; + TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; + TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; + TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; + TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; + TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; + TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; + TypeFlags[TypeFlags["Anonymous"] = 0x00002000] = "Anonymous"; + TypeFlags[TypeFlags["FromSignature"] = 0x00004000] = "FromSignature"; + TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; + TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; + TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; + TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Anonymous] = "ObjectType"; + })(ts.TypeFlags || (ts.TypeFlags = {})); + var TypeFlags = ts.TypeFlags; + (function (SignatureKind) { + SignatureKind[SignatureKind["Call"] = 0] = "Call"; + SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; + })(ts.SignatureKind || (ts.SignatureKind = {})); + var SignatureKind = ts.SignatureKind; + (function (IndexKind) { + IndexKind[IndexKind["String"] = 0] = "String"; + IndexKind[IndexKind["Number"] = 1] = "Number"; + })(ts.IndexKind || (ts.IndexKind = {})); + var IndexKind = ts.IndexKind; + (function (DiagnosticCategory) { + DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; + DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; + DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; + DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; + })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); + var DiagnosticCategory = ts.DiagnosticCategory; + (function (ModuleKind) { + ModuleKind[ModuleKind["None"] = 0] = "None"; + ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; + ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; + })(ts.ModuleKind || (ts.ModuleKind = {})); + var ModuleKind = ts.ModuleKind; + (function (ScriptTarget) { + ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; + ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; + })(ts.ScriptTarget || (ts.ScriptTarget = {})); + var ScriptTarget = ts.ScriptTarget; + (function (CharacterCodes) { + CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; + CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; + CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; + CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; + CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; + CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; + CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; + CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; + CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; + CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; + CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; + CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; + CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; + CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; + CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; + CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; + CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; + CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; + CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; + CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; + CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; + CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; + CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; + CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; + CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; + CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; + CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; + CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; + CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; + CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; + CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; + CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; + CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; + CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; + CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; + CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; + CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; + CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; + CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; + CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; + CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; + CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; + CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; + CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; + CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; + CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; + CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; + CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; + CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; + CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; + CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; + CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; + CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; + CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; + CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; + CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; + CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; + CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; + CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; + CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; + CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; + CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; + CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; + CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; + CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; + CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; + CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; + CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; + CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; + CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; + CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; + CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; + CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; + CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; + CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; + CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; + CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; + CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; + CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; + CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; + CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; + CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; + CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; + CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; + CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; + CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; + CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; + CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; + CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; + CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; + CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; + CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; + CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; + CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; + CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; + CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; + CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; + CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; + CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; + CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; + CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; + CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; + CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; + CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; + CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; + CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; + CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; + CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; + CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; + CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; + CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; + CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; + CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; + CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; + CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; + CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; + CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; + CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; + CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; + CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; + CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; + })(ts.CharacterCodes || (ts.CharacterCodes = {})); + var CharacterCodes = ts.CharacterCodes; +})(ts || (ts = {})); +var ts; +(function (ts) { + function forEach(array, callback) { + var result; + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (result = callback(array[i])) + break; + } + } + return result; + } + ts.forEach = forEach; + function contains(array, value) { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) + return true; + } + } + return false; + } + ts.contains = contains; + function indexOf(array, value) { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) + return i; + } + } + return -1; + } + ts.indexOf = indexOf; + function filter(array, f) { + var result; + if (array) { + result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (f(item)) + result.push(item); + } + } + return result; + } + ts.filter = filter; + function map(array, f) { + var result; + if (array) { + result = []; + var len = array.length; + for (var i = 0; i < len; i++) { + result.push(f(array[i])); + } + } + return result; + } + ts.map = map; + function concatenate(array1, array2) { + if (!array2.length) + return array1; + if (!array1.length) + return array2; + return array1.concat(array2); + } + ts.concatenate = concatenate; + function sum(array, prop) { + var result = 0; + for (var i = 0; i < array.length; i++) { + result += array[i][prop]; + } + return result; + } + ts.sum = sum; + function binarySearch(array, value) { + var low = 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + return ~low; + } + ts.binarySearch = binarySearch; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function hasProperty(map, key) { + return hasOwnProperty.call(map, key); + } + ts.hasProperty = hasProperty; + function getProperty(map, key) { + return hasOwnProperty.call(map, key) ? map[key] : undefined; + } + ts.getProperty = getProperty; + function isEmpty(map) { + for (var id in map) + return false; + return true; + } + ts.isEmpty = isEmpty; + function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; + } + ts.clone = clone; + function forEachValue(map, callback) { + var result; + for (var id in map) { + if (result = callback(map[id])) + break; + } + return result; + } + ts.forEachValue = forEachValue; + function mapToArray(map) { + var result = []; + for (var id in map) + result.push(map[id]); + return result; + } + ts.mapToArray = mapToArray; + function formatStringFromArgs(text, args, baseIndex) { + baseIndex = baseIndex || 0; + return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + } + ts.localizedDiagnosticMessages = undefined; + function getLocaleSpecificMessage(message) { + if (ts.localizedDiagnosticMessages) { + message = ts.localizedDiagnosticMessages[message]; + } + Debug.assert(message, "Diagnostic message does not exist in locale map."); + return message; + } + function createFileDiagnostic(file, start, length, message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + return { + file: file, + start: start, + length: length, + messageText: text, + category: message.category, + code: message.code + }; + } + ts.createFileDiagnostic = createFileDiagnostic; + function createCompilerDiagnostic(message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + return { + file: undefined, + start: undefined, + length: undefined, + messageText: text, + category: message.category, + code: message.code + }; + } + ts.createCompilerDiagnostic = createCompilerDiagnostic; + function chainDiagnosticMessages(details, message) { + var text = getLocaleSpecificMessage(message.key); + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + return { + messageText: text, + category: message.category, + code: message.code, + next: details + }; + } + ts.chainDiagnosticMessages = chainDiagnosticMessages; + function flattenDiagnosticChain(file, start, length, diagnosticChain) { + var code = diagnosticChain.code; + var category = diagnosticChain.category; + var messageText = ""; + var indent = 0; + while (diagnosticChain) { + if (indent) { + messageText += sys.newLine; + for (var i = 0; i < indent; i++) { + messageText += " "; + } + } + messageText += diagnosticChain.messageText; + indent++; + diagnosticChain = diagnosticChain.next; + } + return { + file: file, + start: start, + length: length, + code: code, + category: category, + messageText: messageText + }; + } + ts.flattenDiagnosticChain = flattenDiagnosticChain; + function compareValues(a, b) { + if (a === b) + return 0; + if (a === undefined) + return -1; + if (b === undefined) + return 1; + return a < b ? -1 : 1; + } + function getDiagnosticFilename(diagnostic) { + return diagnostic.file ? diagnostic.file.filename : undefined; + } + function compareDiagnostics(d1, d2) { + return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; + } + ts.compareDiagnostics = compareDiagnostics; + function deduplicateSortedDiagnostics(diagnostics) { + if (diagnostics.length < 2) { + return diagnostics; + } + var newDiagnostics = [diagnostics[0]]; + var previousDiagnostic = diagnostics[0]; + for (var i = 1; i < diagnostics.length; i++) { + var currentDiagnostic = diagnostics[i]; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + if (!isDupe) { + newDiagnostics.push(currentDiagnostic); + previousDiagnostic = currentDiagnostic; + } + } + return newDiagnostics; + } + ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; + function normalizeSlashes(path) { + return path.replace(/\\/g, "/"); + } + ts.normalizeSlashes = normalizeSlashes; + function getRootLength(path) { + if (path.charCodeAt(0) === 47 /* slash */) { + if (path.charCodeAt(1) !== 47 /* slash */) + return 1; + var p1 = path.indexOf("/", 2); + if (p1 < 0) + return 2; + var p2 = path.indexOf("/", p1 + 1); + if (p2 < 0) + return p1 + 1; + return p2 + 1; + } + if (path.charCodeAt(1) === 58 /* colon */) { + if (path.charCodeAt(2) === 47 /* slash */) + return 3; + return 2; + } + return 0; + } + ts.directorySeparator = "/"; + function getNormalizedParts(normalizedSlashedPath, rootLength) { + var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); + var normalized = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part !== ".") { + if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + normalized.pop(); + } + else { + normalized.push(part); + } + } + } + return normalized; + } + function normalizePath(path) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + var normalized = getNormalizedParts(path, rootLength); + return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); + } + ts.normalizePath = normalizePath; + function getDirectoryPath(path) { + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function isUrl(path) { + return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; + } + ts.isUrl = isUrl; + function isRootedDiskPath(path) { + return getRootLength(path) !== 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + function normalizedPathComponents(path, rootLength) { + var normalizedParts = getNormalizedParts(path, rootLength); + return [path.substr(0, rootLength)].concat(normalizedParts); + } + function getNormalizedPathComponents(path, currentDirectory) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength == 0) { + path = combinePaths(normalizeSlashes(currentDirectory), path); + rootLength = getRootLength(path); + } + return normalizedPathComponents(path, rootLength); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedPathFromPathCompoments(pathComponents) { + if (pathComponents && pathComponents.length) { + return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); + } + } + ts.getNormalizedPathFromPathCompoments = getNormalizedPathFromPathCompoments; + function getNormalizedPathComponentsOfUrl(url) { + var urlLength = url.length; + var rootLength = url.indexOf("://") + "://".length; + while (rootLength < urlLength) { + if (url.charCodeAt(rootLength) === 47 /* slash */) { + rootLength++; + } + else { + break; + } + } + if (rootLength === urlLength) { + return [url]; + } + var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); + if (indexOfNextSlash !== -1) { + rootLength = indexOfNextSlash + 1; + return normalizedPathComponents(url, rootLength); + } + else { + return [url + ts.directorySeparator]; + } + } + function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { + if (isUrl(pathOrUrl)) { + return getNormalizedPathComponentsOfUrl(pathOrUrl); + } + else { + return getNormalizedPathComponents(pathOrUrl, currentDirectory); + } + } + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, isAbsolutePathAnUrl) { + var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); + var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); + if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + directoryComponents.length--; + } + for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { + break; + } + } + if (joinStartIndex) { + var relativePath = ""; + var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); + for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== "") { + relativePath = relativePath + ".." + ts.directorySeparator; + } + } + return relativePath + relativePathComponents.join(ts.directorySeparator); + } + var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); + if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { + absolutePath = "file:///" + absolutePath; + } + return absolutePath; + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function getBaseFilename(path) { + var i = path.lastIndexOf(ts.directorySeparator); + return i < 0 ? path : path.substring(i + 1); + } + ts.getBaseFilename = getBaseFilename; + function combinePaths(path1, path2) { + if (!(path1 && path1.length)) + return path2; + if (!(path2 && path2.length)) + return path1; + if (path2.charAt(0) === ts.directorySeparator) + return path2; + if (path1.charAt(path1.length - 1) === ts.directorySeparator) + return path1 + path2; + return path1 + ts.directorySeparator + path2; + } + ts.combinePaths = combinePaths; + function fileExtensionIs(path, extension) { + var pathLen = path.length; + var extLen = extension.length; + return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; + } + ts.fileExtensionIs = fileExtensionIs; + function Symbol(flags, name) { + this.flags = flags; + this.name = name; + this.declarations = undefined; + } + function Type(checker, flags) { + this.flags = flags; + } + function Signature(checker) { + } + ts.objectAllocator = { + getNodeConstructor: function (kind) { + function Node() { + } + Node.prototype = { + kind: kind, + pos: 0, + end: 0, + flags: 0, + parent: undefined + }; + return Node; + }, + getSymbolConstructor: function () { return Symbol; }, + getTypeConstructor: function () { return Type; }, + getSignatureConstructor: function () { return Signature; } + }; + (function (AssertionLevel) { + AssertionLevel[AssertionLevel["None"] = 0] = "None"; + AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; + AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; + AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; + })(ts.AssertionLevel || (ts.AssertionLevel = {})); + var AssertionLevel = ts.AssertionLevel; + (function (Debug) { + var currentAssertionLevel = 0 /* None */; + function shouldAssert(level) { + return this.currentAssertionLevel >= level; + } + Debug.shouldAssert = shouldAssert; + function assert(expression, message, verboseDebugInfo) { + if (!expression) { + var verboseDebugString = ""; + if (verboseDebugInfo) { + verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); + } + throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); + } + } + Debug.assert = assert; + function fail(message) { + Debug.assert(false, message); + } + Debug.fail = fail; + })(ts.Debug || (ts.Debug = {})); + var Debug = ts.Debug; +})(ts || (ts = {})); +var sys = (function () { + function getWScriptSystem() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + return { + args: args, + newLine: "\r\n", + write: function write(s) { + WScript.StdOut.Write(s); + }, + writeErr: function writeErr(s) { + WScript.StdErr.Write(s); + }, + readFile: function readFile(fileName) { + try { + var f = fso.OpenTextFile(fileName, 1); + var s = f.AtEndOfStream ? "" : f.ReadAll(); + if (s.length >= 3 && s.charCodeAt(0) === 0xEF && s.charCodeAt(1) === 0xBB && s.charCodeAt(2) === 0xBF) { + s = s.slice(3); + } + f.Close(); + } + catch (e) { + } + return s; + }, + writeFile: function writeFile(fileName, data) { + var f = fso.CreateTextFile(fileName, true); + f.Write(data); + f.Close(); + }, + resolvePath: function resolvePath(path) { + return fso.GetAbsolutePathName(path); + }, + fileExists: function fileExists(path) { + return fso.FileExists(path); + }, + directoryExists: function directoryExists(path) { + return fso.FolderExists(path); + }, + createDirectory: function createDirectory(directoryName) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath: function getExecutingFilePath() { + return WScript.ScriptFullName; + }, + getCurrentDirectory: function getCurrentDirectory() { + return new ActiveXObject("WScript.Shell").CurrentDirectory; + }, + getMemoryUsage: function getMemoryUsage() { + return 0; + }, + exit: function exit(exitCode) { + WScript.Quit(exitCode); + } + }; + } + function getNodeSystem() { + var _fs = require("fs"); + var _path = require("path"); + var _os = require('os'); + return { + args: process.argv.slice(2), + newLine: _os.EOL, + write: function write(s) { + process.stdout.write(s); + }, + writeErr: function writeErr(s) { + process.stderr.write(s); + }, + readFile: function readFile(fileName) { + try { + var s = _fs.readFileSync(fileName, "utf8"); + } + catch (e) { + } + return s; + }, + writeFile: function writeFile(fileName, data) { + _fs.writeFileSync(fileName, data, "utf8"); + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + fileExists: function fileExists(path) { + return _fs.existsSync(path); + }, + directoryExists: function directoryExists(path) { + return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); + }, + createDirectory: function createDirectory(directoryName) { + if (!this.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function getExecutingFilePath() { + return process.mainModule.filename; + }, + getCurrentDirectory: function getCurrentDirectory() { + return process.cwd(); + }, + getMemoryUsage: function getMemoryUsage() { + global.gc(); + return process.memoryUsage().heapUsed; + }, + exit: function exit(exitCode) { + process.exit(exitCode); + } + }; + } + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return getWScriptSystem(); + } + else if (typeof module !== "undefined" && module.exports) { + return getNodeSystem(); + } + else { + return undefined; + } +})(); +var ts; +(function (ts) { + var nodeConstructors = new Array(180 /* Count */); + function getNodeConstructor(kind) { + return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); + } + ts.getNodeConstructor = getNodeConstructor; + function createRootNode(kind, pos, end, flags) { + var node = new (getNodeConstructor(kind))(); + node.pos = pos; + node.end = end; + node.flags = flags; + return node; + } + var moduleExtensions = [".d.ts", ".ts", ".js"]; + function getModuleNameFromFilename(filename) { + for (var i = 0; i < moduleExtensions.length; i++) { + var ext = moduleExtensions[i]; + var len = filename.length - ext.length; + if (len > 0 && filename.substr(len) === ext) + return filename.substr(0, len); + } + return filename; + } + ts.getModuleNameFromFilename = getModuleNameFromFilename; + function getSourceFileOfNode(node) { + while (node && node.kind !== 177 /* SourceFile */) + node = node.parent; + return node; + } + ts.getSourceFileOfNode = getSourceFileOfNode; + function nodePosToString(node) { + var file = getSourceFileOfNode(node); + var loc = file.getLineAndCharacterFromPosition(node.pos); + return file.filename + "(" + loc.line + "," + loc.character + ")"; + } + ts.nodePosToString = nodePosToString; + function getStartPosOfNode(node) { + return node.pos; + } + ts.getStartPosOfNode = getStartPosOfNode; + function getTokenPosOfNode(node) { + return ts.skipTrivia(getSourceFileOfNode(node).text, node.pos); + } + ts.getTokenPosOfNode = getTokenPosOfNode; + function getSourceTextOfNode(node) { + var text = getSourceFileOfNode(node).text; + return text.substring(ts.skipTrivia(text, node.pos), node.end); + } + ts.getSourceTextOfNode = getSourceTextOfNode; + function getTextOfLiteral(node) { + switch (node.kind) { + case 55 /* Identifier */: + return node.text; + case 3 /* StringLiteral */: + return node.text.substr(1, node.text.length - 2); + case 2 /* NumericLiteral */: + return "" + (+node.text); + } + } + ts.getTextOfLiteral = getTextOfLiteral; + function escapeIdentifier(identifier) { + return identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; + } + ts.escapeIdentifier = escapeIdentifier; + function identifierToString(identifier) { + switch (identifier.kind) { + case 55 /* Identifier */: + return getSourceTextOfNode(identifier); + case 3 /* StringLiteral */: + return identifier.text; + case 2 /* NumericLiteral */: + return "" + (+identifier.text); + } + return "(Missing)"; + } + ts.identifierToString = identifierToString; + function createDiagnosticForNode(node, message, arg0, arg1, arg2) { + var file = getSourceFileOfNode(node); + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + } + ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeFromMessageChain(node, messageChain) { + var file = getSourceFileOfNode(node); + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + return ts.flattenDiagnosticChain(file, start, length, messageChain); + } + ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function forEachChild(node, cbNode, cbNodes) { + function child(node) { + if (node) + return cbNode(node); + } + function children(nodes) { + if (nodes) { + if (cbNodes) + return cbNodes(nodes); + var result; + for (var i = 0, len = nodes.length; i < len; i++) { + if (result = cbNode(nodes[i])) + break; + } + return result; + } + } + if (!node) + return; + switch (node.kind) { + case 112 /* QualifiedName */: + return child(node.left) || child(node.right); + case 113 /* TypeParameter */: + return child(node.name) || child(node.constraint); + case 114 /* Parameter */: + return child(node.name) || child(node.type) || child(node.initializer); + case 115 /* Property */: + case 129 /* PropertyAssignment */: + return child(node.name) || child(node.type) || child(node.initializer); + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + return children(node.typeParameters) || children(node.parameters) || child(node.type); + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); + case 123 /* TypeReference */: + return child(node.typeName) || children(node.typeArguments); + case 124 /* TypeQuery */: + return child(node.exprName); + case 125 /* TypeLiteral */: + return children(node.members); + case 126 /* ArrayType */: + return child(node.elementType); + case 127 /* ArrayLiteral */: + return children(node.elements); + case 128 /* ObjectLiteral */: + return children(node.properties); + case 130 /* PropertyAccess */: + return child(node.left) || child(node.right); + case 131 /* IndexedAccess */: + return child(node.object) || child(node.index); + case 132 /* CallExpression */: + case 133 /* NewExpression */: + return child(node.func) || children(node.typeArguments) || children(node.arguments); + case 134 /* TypeAssertion */: + return child(node.type) || child(node.operand); + case 135 /* ParenExpression */: + return child(node.expression); + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + return child(node.operand); + case 140 /* BinaryExpression */: + return child(node.left) || child(node.right); + case 141 /* ConditionalExpression */: + return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); + case 143 /* Block */: + case 162 /* TryBlock */: + case 164 /* FinallyBlock */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + case 177 /* SourceFile */: + return children(node.statements); + case 144 /* VariableStatement */: + return children(node.declarations); + case 146 /* ExpressionStatement */: + return child(node.expression); + case 147 /* IfStatement */: + return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); + case 148 /* DoStatement */: + return child(node.statement) || child(node.expression); + case 149 /* WhileStatement */: + return child(node.expression) || child(node.statement); + case 150 /* ForStatement */: + return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); + case 151 /* ForInStatement */: + return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return child(node.label); + case 154 /* ReturnStatement */: + return child(node.expression); + case 155 /* WithStatement */: + return child(node.expression) || child(node.statement); + case 156 /* SwitchStatement */: + return child(node.expression) || children(node.clauses); + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + return child(node.expression) || children(node.statements); + case 159 /* LabelledStatement */: + return child(node.label) || child(node.statement); + case 160 /* ThrowStatement */: + return child(node.expression); + case 161 /* TryStatement */: + return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); + case 163 /* CatchBlock */: + return child(node.variable) || children(node.statements); + case 166 /* VariableDeclaration */: + return child(node.name) || child(node.type) || child(node.initializer); + case 169 /* ClassDeclaration */: + return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); + case 170 /* InterfaceDeclaration */: + return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); + case 171 /* EnumDeclaration */: + return child(node.name) || children(node.members); + case 176 /* EnumMember */: + return child(node.name) || child(node.initializer); + case 172 /* ModuleDeclaration */: + return child(node.name) || child(node.body); + case 174 /* ImportDeclaration */: + return child(node.name) || child(node.entityName) || child(node.externalModuleName); + case 175 /* ExportAssignment */: + return child(node.exportName); + } + } + ts.forEachChild = forEachChild; + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; + ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; + ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; + ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; + ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; + ParsingContext[ParsingContext["Count"] = 16] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var parsingContextErrors = [ + ts.Diagnostics.Declaration_or_statement_expected, + ts.Diagnostics.Declaration_or_statement_expected, + ts.Diagnostics.Statement_expected, + ts.Diagnostics.case_or_default_expected, + ts.Diagnostics.Statement_expected, + ts.Diagnostics.Property_or_signature_expected, + ts.Diagnostics.Property_or_method_expected, + ts.Diagnostics.Enum_member_expected, + ts.Diagnostics.Type_reference_expected, + ts.Diagnostics.Variable_declaration_expected, + ts.Diagnostics.Argument_expression_expected, + ts.Diagnostics.Property_assignment_expected, + ts.Diagnostics.Expression_or_comma_expected, + ts.Diagnostics.Parameter_declaration_expected, + ts.Diagnostics.Type_parameter_declaration_expected, + ts.Diagnostics.Type_argument_expected + ]; + var LookAheadMode; + (function (LookAheadMode) { + LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; + LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; + LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; + })(LookAheadMode || (LookAheadMode = {})); + var ModifierContext; + (function (ModifierContext) { + ModifierContext[ModifierContext["ModuleElements"] = 0] = "ModuleElements"; + ModifierContext[ModifierContext["ClassMembers"] = 1] = "ClassMembers"; + ModifierContext[ModifierContext["Parameters"] = 2] = "Parameters"; + })(ModifierContext || (ModifierContext = {})); + function createSourceFile(filename, sourceText, languageVersion) { + var file; + var scanner; + var token; + var parsingContext; + var commentRanges; + var identifiers = {}; + var identifierCount = 0; + var nodeCount = 0; + var lineStarts; + var lookAheadMode = 0 /* NotLookingAhead */; + var inAmbientContext = false; + function getLineAndCharacterlFromSourcePosition(position) { + if (!lineStarts) { + lineStarts = ts.getLineStarts(sourceText); + } + return ts.getLineAndCharacterOfPosition(lineStarts, position); + } + function error(message, arg0, arg1, arg2) { + var start = scanner.getTokenPos(); + var length = scanner.getTextPos() - start; + errorAtPos(start, length, message, arg0, arg1, arg2); + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(file.text, node.pos); + var length = node.end - start; + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + function errorAtPos(start, length, message, arg0, arg1, arg2) { + var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + if (start !== lastErrorPos) { + file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + if (lookAheadMode === 1 /* NoErrorYet */) { + lookAheadMode = 2 /* Error */; + } + } + function scanError(message) { + var pos = scanner.getTextPos(); + errorAtPos(pos, 0, message); + } + function onComment(pos, end) { + if (commentRanges) + commentRanges.push({ pos: pos, end: end }); + } + function getNodePos() { + return scanner.getStartPos(); + } + function getNodeEnd() { + return scanner.getStartPos(); + } + function nextToken() { + return token = scanner.scan(); + } + function getTokenPos(pos) { + return ts.skipTrivia(sourceText, pos); + } + function reScanGreaterToken() { + return token = scanner.reScanGreaterToken(); + } + function reScanSlashToken() { + return token = scanner.reScanSlashToken(); + } + function lookAheadHelper(callback, alwaysResetState) { + var saveToken = token; + var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveLookAheadMode = lookAheadMode; + lookAheadMode = 1 /* NoErrorYet */; + var result = callback(); + ts.Debug.assert(lookAheadMode === 2 /* Error */ || lookAheadMode === 1 /* NoErrorYet */); + if (lookAheadMode === 2 /* Error */) { + result = undefined; + } + lookAheadMode = saveLookAheadMode; + if (!result || alwaysResetState) { + token = saveToken; + file.syntacticErrors.length = saveSyntacticErrorsLength; + } + return result; + } + function lookAhead(callback) { + var result; + scanner.tryScan(function () { + result = lookAheadHelper(callback, true); + return false; + }); + return result; + } + function tryParse(callback) { + return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); + } + function isIdentifier() { + return token === 55 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; + } + function isSemicolon() { + return token === 13 /* SemicolonToken */ || token === 6 /* CloseBraceToken */ || scanner.hasPrecedingLineBreak(); + } + function parseExpected(t) { + if (token === t) { + nextToken(); + return true; + } + error(ts.Diagnostics._0_expected, ts.tokenToString(t)); + return false; + } + function parseOptional(t) { + if (token === t) { + nextToken(); + return true; + } + return false; + } + function canParseSemicolon() { + if (token === 13 /* SemicolonToken */) { + return true; + } + return token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + } + function parseSemicolon() { + if (canParseSemicolon()) { + if (token === 13 /* SemicolonToken */) { + nextToken(); + } + } + else { + error(ts.Diagnostics._0_expected, ";"); + } + } + function createNode(kind, pos) { + nodeCount++; + var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); + if (!(pos >= 0)) + pos = scanner.getStartPos(); + node.pos = pos; + node.end = pos; + return node; + } + function finishNode(node) { + node.end = scanner.getStartPos(); + return node; + } + function createMissingNode() { + return createNode(111 /* Missing */); + } + function createIdentifier(isIdentifier) { + identifierCount++; + if (isIdentifier) { + var node = createNode(55 /* Identifier */); + var text = escapeIdentifier(scanner.getIdentifierText()); + node.text = ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); + nextToken(); + return finishNode(node); + } + error(ts.Diagnostics.Identifier_expected); + return createMissingNode(); + } + function parseIdentifier() { + return createIdentifier(isIdentifier()); + } + function parseIdentifierName() { + return createIdentifier(token >= 55 /* Identifier */); + } + function isPropertyName() { + return token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */; + } + function parsePropertyName() { + if (token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { + return parsePrimaryExpression(); + } + return parseIdentifierName(); + } + function isModifier(token) { + switch (token) { + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + case 68 /* ExportKeyword */: + case 104 /* DeclareKeyword */: + return true; + } + return false; + } + function parseContextualModifier(t) { + return token === t && tryParse(function () { + nextToken(); + return token === 9 /* OpenBracketToken */ || isPropertyName(); + }); + } + function parseAnyContextualModifier() { + return isModifier(token) && tryParse(function () { + nextToken(); + return token === 9 /* OpenBracketToken */ || isPropertyName(); + }); + } + function isListElement(kind) { + switch (kind) { + case 0 /* SourceElements */: + case 1 /* ModuleElements */: + return isSourceElement(); + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: + return isStatement(); + case 3 /* SwitchClauses */: + return token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + case 5 /* TypeMembers */: + return isTypeMember(); + case 6 /* ClassMembers */: + return isClassMemberDeclaration(); + case 7 /* EnumMembers */: + case 11 /* ObjectLiteralMembers */: + return isPropertyName(); + case 8 /* BaseTypeReferences */: + return isIdentifier() && ((token !== 69 /* ExtendsKeyword */ && token !== 92 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + case 9 /* VariableDeclarations */: + case 14 /* TypeParameters */: + return isIdentifier(); + case 10 /* ArgumentExpressions */: + return isExpression(); + case 12 /* ArrayLiteralMembers */: + return token === 14 /* CommaToken */ || isExpression(); + case 13 /* Parameters */: + return isParameter(); + case 15 /* TypeArguments */: + return isType(); + } + } + function isListTerminator(kind) { + if (token === 1 /* EndOfFileToken */) { + return true; + } + switch (kind) { + case 1 /* ModuleElements */: + case 2 /* BlockStatements */: + case 3 /* SwitchClauses */: + case 5 /* TypeMembers */: + case 6 /* ClassMembers */: + case 7 /* EnumMembers */: + case 11 /* ObjectLiteralMembers */: + return token === 6 /* CloseBraceToken */; + case 4 /* SwitchClauseStatements */: + return token === 6 /* CloseBraceToken */ || token === 57 /* CaseKeyword */ || token === 63 /* DefaultKeyword */; + case 8 /* BaseTypeReferences */: + return token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + case 9 /* VariableDeclarations */: + return isVariableDeclaratorListTerminator(); + case 14 /* TypeParameters */: + return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */ || token === 5 /* OpenBraceToken */ || token === 69 /* ExtendsKeyword */ || token === 92 /* ImplementsKeyword */; + case 10 /* ArgumentExpressions */: + return token === 8 /* CloseParenToken */ || token === 13 /* SemicolonToken */; + case 12 /* ArrayLiteralMembers */: + return token === 10 /* CloseBracketToken */; + case 13 /* Parameters */: + return token === 8 /* CloseParenToken */ || token === 10 /* CloseBracketToken */ || token === 5 /* OpenBraceToken */; + case 15 /* TypeArguments */: + return token === 16 /* GreaterThanToken */ || token === 7 /* OpenParenToken */; + } + } + function isVariableDeclaratorListTerminator() { + if (canParseSemicolon()) { + return true; + } + if (token === 76 /* InKeyword */) { + return true; + } + if (token === 23 /* EqualsGreaterThanToken */) { + return true; + } + return false; + } + function isInParsingContext() { + for (var kind = 0; kind < 16 /* Count */; kind++) { + if (parsingContext & (1 << kind)) { + if (isListElement(kind) || isListTerminator(kind)) + return true; + } + } + } + function parseList(kind, parseElement) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = []; + result.pos = getNodePos(); + while (!isListTerminator(kind)) { + if (isListElement(kind)) { + result.push(parseElement()); + } + else { + error(parsingContextErrors[kind]); + if (isInParsingContext()) + break; + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + function parseDelimitedList(kind, parseElement, allowTrailingComma) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = []; + result.pos = getNodePos(); + var errorCountBeforeParsingList = file.syntacticErrors.length; + var commaStart = -1; + while (true) { + if (isListElement(kind)) { + result.push(parseElement()); + commaStart = scanner.getTokenPos(); + if (parseOptional(14 /* CommaToken */)) { + continue; + } + commaStart = -1; + if (isListTerminator(kind)) { + break; + } + error(ts.Diagnostics._0_expected, ","); + } + else if (isListTerminator(kind)) { + if (!allowTrailingComma && commaStart >= 0) { + if (file.syntacticErrors.length === errorCountBeforeParsingList) { + grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + break; + } + else { + error(parsingContextErrors[kind]); + if (token !== 14 /* CommaToken */ && isInParsingContext()) + break; + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + function createMissingList() { + var pos = getNodePos(); + var result = []; + result.pos = pos; + result.end = pos; + return result; + } + function createNodeArray(node) { + var result = [node]; + result.pos = node.pos; + result.end = node.end; + return result; + } + function parseBracketedList(kind, parseElement, startToken, endToken, allowTrailingSeparator) { + if (parseExpected(startToken)) { + var result = parseDelimitedList(kind, parseElement, allowTrailingSeparator); + parseExpected(endToken); + return result; + } + return createMissingList(); + } + function parseEntityName() { + var entity = parseIdentifier(); + while (parseOptional(11 /* DotToken */)) { + var node = createNode(112 /* QualifiedName */, entity.pos); + node.left = entity; + node.right = parseIdentifier(); + entity = finishNode(node); + } + return entity; + } + function parseTokenNode() { + var node = createNode(token); + nextToken(); + return finishNode(node); + } + function parseLiteralNode() { + var node = createNode(token); + node.text = scanner.getTokenText(); + nextToken(); + return finishNode(node); + } + function parseStringLiteral() { + if (token === 3 /* StringLiteral */) + return parseLiteralNode(); + error(ts.Diagnostics.String_literal_expected); + return createMissingNode(); + } + function parseTypeReference() { + var node = createNode(123 /* TypeReference */); + node.typeName = parseEntityName(); + if (!scanner.hasPrecedingLineBreak() && token === 15 /* LessThanToken */) { + node.typeArguments = parseTypeArguments(); + } + return finishNode(node); + } + function parseTypeQuery() { + var node = createNode(124 /* TypeQuery */); + parseExpected(87 /* TypeOfKeyword */); + node.exprName = parseEntityName(); + return finishNode(node); + } + function parseTypeParameter() { + var node = createNode(113 /* TypeParameter */); + node.name = parseIdentifier(); + if (parseOptional(69 /* ExtendsKeyword */)) { + if (isType() || !isExpression()) { + node.constraint = parseType(); + } + else { + var expr = parseUnaryExpression(); + grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + } + } + return finishNode(node); + } + function parseTypeParameters() { + if (token === 15 /* LessThanToken */) { + var pos = getNodePos(); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 15 /* LessThanToken */, 16 /* GreaterThanToken */, false); + if (!result.length) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + return result; + } + } + function parseParameterType() { + return parseOptional(42 /* ColonToken */) ? token === 3 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + } + function isParameter() { + return token === 12 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + } + function parseParameter(flags) { + if (flags === void 0) { flags = 0; } + var node = createNode(114 /* Parameter */); + node.flags |= parseAndCheckModifiers(2 /* Parameters */); + if (parseOptional(12 /* DotDotDotToken */)) { + node.flags |= 8 /* Rest */; + } + node.name = parseIdentifier(); + if (parseOptional(41 /* QuestionToken */)) { + node.flags |= 4 /* QuestionMark */; + } + node.type = parseParameterType(); + node.initializer = parseInitializer(true); + return finishNode(node); + } + function parseSignature(kind, returnToken) { + if (kind === 121 /* ConstructSignature */) { + parseExpected(78 /* NewKeyword */); + } + var typeParameters = parseTypeParameters(); + var parameters = parseParameterList(7 /* OpenParenToken */, 8 /* CloseParenToken */); + checkParameterList(parameters); + var type = parseOptional(returnToken) ? parseType() : undefined; + return { + typeParameters: typeParameters, + parameters: parameters, + type: type + }; + } + function parseParameterList(startDelimiter, endDelimiter) { + return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter, false); + } + function checkParameterList(parameters) { + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + return; + } + if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + return; + } + if (parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + return; + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + return; + } + } + else { + if (seenOptionalParameter) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + return; + } + } + } + } + function parseSignatureMember(kind, returnToken) { + var node = createNode(kind); + var sig = parseSignature(kind, returnToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + parseSemicolon(); + return finishNode(node); + } + function parseIndexSignatureMember() { + var node = createNode(122 /* IndexSignature */); + var errorCountBeforeIndexSignature = file.syntacticErrors.length; + var indexerStart = scanner.getTokenPos(); + node.parameters = parseParameterList(9 /* OpenBracketToken */, 10 /* CloseBracketToken */); + var indexerLength = scanner.getStartPos() - indexerStart; + node.type = parseTypeAnnotation(); + parseSemicolon(); + if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { + checkIndexSignature(node, indexerStart, indexerLength); + } + return finishNode(node); + } + function checkIndexSignature(node, indexerStart, indexerLength) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; + if (parameter) { + grammarErrorOnNode(parameter.name, arityDiagnostic); + } + else { + grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); + } + return; + } + else if (parameter.flags & 8 /* Rest */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + return; + } + else if (parameter.flags & ts.NodeFlags.Modifier) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + return; + } + else if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + return; + } + else if (parameter.initializer) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + return; + } + else if (!parameter.type) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + return; + } + else if (parameter.type.kind !== 110 /* StringKeyword */ && parameter.type.kind !== 108 /* NumberKeyword */) { + grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + return; + } + else if (!node.type) { + grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + return; + } + } + function parsePropertyOrMethod() { + var node = createNode(0 /* Unknown */); + node.name = parsePropertyName(); + if (parseOptional(41 /* QuestionToken */)) { + node.flags |= 4 /* QuestionMark */; + } + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + node.kind = 116 /* Method */; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + } + else { + node.kind = 115 /* Property */; + node.type = parseTypeAnnotation(); + } + parseSemicolon(); + return finishNode(node); + } + function isTypeMember() { + switch (token) { + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + case 9 /* OpenBracketToken */: + return true; + default: + return isPropertyName() && lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 41 /* QuestionToken */ || token === 42 /* ColonToken */ || canParseSemicolon(); }); + } + } + function parseTypeMember() { + switch (token) { + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + return parseSignatureMember(120 /* CallSignature */, 42 /* ColonToken */); + case 9 /* OpenBracketToken */: + return parseIndexSignatureMember(); + case 78 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */; })) { + return parseSignatureMember(121 /* ConstructSignature */, 42 /* ColonToken */); + } + case 3 /* StringLiteral */: + case 2 /* NumericLiteral */: + return parsePropertyOrMethod(); + default: + if (token >= 55 /* Identifier */) { + return parsePropertyOrMethod(); + } + } + } + function parseTypeLiteral() { + var node = createNode(125 /* TypeLiteral */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseList(5 /* TypeMembers */, parseTypeMember); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + function parseFunctionType(signatureKind) { + var node = createNode(125 /* TypeLiteral */); + var member = createNode(signatureKind); + var sig = parseSignature(signatureKind, 23 /* EqualsGreaterThanToken */); + member.typeParameters = sig.typeParameters; + member.parameters = sig.parameters; + member.type = sig.type; + finishNode(member); + node.members = createNodeArray(member); + return finishNode(node); + } + function parseKeywordAndNoDot() { + var node = parseTokenNode(); + return token === 11 /* DotToken */ ? undefined : node; + } + function parseNonArrayType() { + switch (token) { + case 101 /* AnyKeyword */: + case 110 /* StringKeyword */: + case 108 /* NumberKeyword */: + case 102 /* BooleanKeyword */: + case 89 /* VoidKeyword */: + var node = tryParse(parseKeywordAndNoDot); + return node || parseTypeReference(); + case 87 /* TypeOfKeyword */: + return parseTypeQuery(); + case 5 /* OpenBraceToken */: + return parseTypeLiteral(); + case 7 /* OpenParenToken */: + case 15 /* LessThanToken */: + return parseFunctionType(120 /* CallSignature */); + case 78 /* NewKeyword */: + return parseFunctionType(121 /* ConstructSignature */); + default: + if (isIdentifier()) { + return parseTypeReference(); + } + } + error(ts.Diagnostics.Type_expected); + return createMissingNode(); + } + function isType() { + switch (token) { + case 101 /* AnyKeyword */: + case 110 /* StringKeyword */: + case 108 /* NumberKeyword */: + case 102 /* BooleanKeyword */: + case 89 /* VoidKeyword */: + case 87 /* TypeOfKeyword */: + case 5 /* OpenBraceToken */: + case 15 /* LessThanToken */: + case 78 /* NewKeyword */: + return true; + case 7 /* OpenParenToken */: + return lookAhead(function () { + nextToken(); + return token === 8 /* CloseParenToken */ || isParameter(); + }); + default: + return isIdentifier(); + } + } + function parseType() { + var type = parseNonArrayType(); + while (type && !scanner.hasPrecedingLineBreak() && parseOptional(9 /* OpenBracketToken */)) { + parseExpected(10 /* CloseBracketToken */); + var node = createNode(126 /* ArrayType */, type.pos); + node.elementType = type; + type = finishNode(node); + } + return type; + } + function parseTypeAnnotation() { + return parseOptional(42 /* ColonToken */) ? parseType() : undefined; + } + function isExpression() { + switch (token) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 7 /* OpenParenToken */: + case 9 /* OpenBracketToken */: + case 5 /* OpenBraceToken */: + case 73 /* FunctionKeyword */: + case 78 /* NewKeyword */: + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + case 87 /* TypeOfKeyword */: + case 89 /* VoidKeyword */: + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + case 15 /* LessThanToken */: + case 55 /* Identifier */: + return true; + default: + return isIdentifier(); + } + } + function parseExpression(noIn) { + var expr = parseAssignmentExpression(noIn); + while (parseOptional(14 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 14 /* CommaToken */, parseAssignmentExpression(noIn)); + } + return expr; + } + function parseInitializer(inParameter, noIn) { + if (token !== 43 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 5 /* OpenBraceToken */) || !isExpression()) { + return undefined; + } + } + parseExpected(43 /* EqualsToken */); + return parseAssignmentExpression(noIn); + } + function parseAssignmentExpression(noIn) { + var arrowExpression = tryParseArrowFunctionExpression(); + if (arrowExpression) { + return arrowExpression; + } + var expr = parseConditionalExpression(noIn); + if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { + var operator = token; + nextToken(); + return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); + } + return expr; + } + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 130 /* PropertyAccess */: + case 131 /* IndexedAccess */: + case 133 /* NewExpression */: + case 132 /* CallExpression */: + case 127 /* ArrayLiteral */: + case 135 /* ParenExpression */: + case 128 /* ObjectLiteral */: + case 136 /* FunctionExpression */: + case 55 /* Identifier */: + case 111 /* Missing */: + case 4 /* RegularExpressionLiteral */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 70 /* FalseKeyword */: + case 79 /* NullKeyword */: + case 83 /* ThisKeyword */: + case 85 /* TrueKeyword */: + case 81 /* SuperKeyword */: + return true; + } + } + return false; + } + function tryParseArrowFunctionExpression() { + return isSimpleArrowFunctionExpression() ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); + } + function isSimpleArrowFunctionExpression() { + if (token === 23 /* EqualsGreaterThanToken */) { + return true; + } + if (token === 55 /* Identifier */) { + return lookAhead(function () { + return nextToken() === 23 /* EqualsGreaterThanToken */; + }); + } + return false; + } + function parseSimpleArrowFunctionExpression() { + ts.Debug.assert(token === 55 /* Identifier */ || token === 23 /* EqualsGreaterThanToken */); + var identifier = parseIdentifier(); + ts.Debug.assert(token === 23 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(23 /* EqualsGreaterThanToken */); + var parameter = createNode(114 /* Parameter */, identifier.pos); + parameter.name = identifier; + finishNode(parameter); + var signature = { parameters: [parameter] }; + return parseArrowExpressionTail(identifier.pos, signature, false); + } + function tryParseParenthesizedArrowFunctionExpression() { + var pos = getNodePos(); + var triState = isParenthesizedArrowFunctionExpression(); + if (triState !== false) { + var sig = triState === true ? parseSignatureAndArrow() : tryParse(parseSignatureAndArrow); + if (sig) { + return parseArrowExpressionTail(pos, sig, false); + } + } + return undefined; + } + function isParenthesizedArrowFunctionExpression() { + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + return lookAhead(function () { + var first = token; + nextToken(); + if (first === 7 /* OpenParenToken */) { + if (token === 8 /* CloseParenToken */ || token === 12 /* DotDotDotToken */) { + return true; + } + if (!isIdentifier()) { + return false; + } + return undefined; + } + else { + ts.Debug.assert(first === 15 /* LessThanToken */); + if (!isIdentifier()) { + return false; + } + return undefined; + } + }); + } + return false; + } + function parseSignatureAndArrow() { + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + parseExpected(23 /* EqualsGreaterThanToken */); + return sig; + } + function parseArrowExpressionTail(pos, sig, noIn) { + var body = token === 5 /* OpenBraceToken */ ? parseBody() : parseAssignmentExpression(noIn); + return makeFunctionExpression(137 /* ArrowFunction */, pos, undefined, sig, body); + } + function isAssignmentOperator() { + return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + } + function parseConditionalExpression(noIn) { + var expr = parseBinaryExpression(noIn); + while (parseOptional(41 /* QuestionToken */)) { + var node = createNode(141 /* ConditionalExpression */, expr.pos); + node.condition = expr; + node.whenTrue = parseAssignmentExpression(false); + parseExpected(42 /* ColonToken */); + node.whenFalse = parseAssignmentExpression(noIn); + expr = finishNode(node); + } + return expr; + } + function parseBinaryExpression(noIn) { + return parseBinaryOperators(parseUnaryExpression(), 0, noIn); + } + function parseBinaryOperators(expr, minPrecedence, noIn) { + while (true) { + reScanGreaterToken(); + var precedence = getOperatorPrecedence(); + if (precedence && precedence > minPrecedence && (!noIn || token !== 76 /* InKeyword */)) { + var operator = token; + nextToken(); + expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); + continue; + } + return expr; + } + } + function getOperatorPrecedence() { + switch (token) { + case 40 /* BarBarToken */: + return 1; + case 39 /* AmpersandAmpersandToken */: + return 2; + case 35 /* BarToken */: + return 3; + case 36 /* CaretToken */: + return 4; + case 34 /* AmpersandToken */: + return 5; + case 19 /* EqualsEqualsToken */: + case 20 /* ExclamationEqualsToken */: + case 21 /* EqualsEqualsEqualsToken */: + case 22 /* ExclamationEqualsEqualsToken */: + return 6; + case 15 /* LessThanToken */: + case 16 /* GreaterThanToken */: + case 17 /* LessThanEqualsToken */: + case 18 /* GreaterThanEqualsToken */: + case 77 /* InstanceOfKeyword */: + case 76 /* InKeyword */: + return 7; + case 31 /* LessThanLessThanToken */: + case 32 /* GreaterThanGreaterThanToken */: + case 33 /* GreaterThanGreaterThanGreaterThanToken */: + return 8; + case 24 /* PlusToken */: + case 25 /* MinusToken */: + return 9; + case 26 /* AsteriskToken */: + case 27 /* SlashToken */: + case 28 /* PercentToken */: + return 10; + } + return undefined; + } + function makeBinaryExpression(left, operator, right) { + var node = createNode(140 /* BinaryExpression */, left.pos); + node.left = left; + node.operator = operator; + node.right = right; + return finishNode(node); + } + function parseUnaryExpression() { + var pos = getNodePos(); + switch (token) { + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + case 87 /* TypeOfKeyword */: + case 89 /* VoidKeyword */: + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + var operator = token; + nextToken(); + var operand = parseUnaryExpression(); + return makeUnaryExpression(138 /* PrefixOperator */, pos, operator, operand); + case 15 /* LessThanToken */: + return parseTypeAssertion(); + } + var primaryExpression = parsePrimaryExpression(); + var illegalUsageOfSuperKeyword = primaryExpression.kind === 81 /* SuperKeyword */ && token !== 7 /* OpenParenToken */ && token !== 11 /* DotToken */; + if (illegalUsageOfSuperKeyword) { + error(ts.Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + } + var expr = parseCallAndAccess(primaryExpression, false); + ts.Debug.assert(isLeftHandSideExpression(expr)); + if ((token === 29 /* PlusPlusToken */ || token === 30 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + var operator = token; + nextToken(); + expr = makeUnaryExpression(139 /* PostfixOperator */, expr.pos, operator, expr); + } + return expr; + } + function parseTypeAssertion() { + var node = createNode(134 /* TypeAssertion */); + parseExpected(15 /* LessThanToken */); + node.type = parseType(); + parseExpected(16 /* GreaterThanToken */); + node.operand = parseUnaryExpression(); + return finishNode(node); + } + function makeUnaryExpression(kind, pos, operator, operand) { + var node = createNode(kind, pos); + node.operator = operator; + node.operand = operand; + return finishNode(node); + } + function parseCallAndAccess(expr, inNewExpression) { + while (true) { + if (parseOptional(11 /* DotToken */)) { + var propertyAccess = createNode(130 /* PropertyAccess */, expr.pos); + propertyAccess.left = expr; + propertyAccess.right = parseIdentifierName(); + expr = finishNode(propertyAccess); + continue; + } + var bracketStart = scanner.getTokenPos(); + if (parseOptional(9 /* OpenBracketToken */)) { + var indexedAccess = createNode(131 /* IndexedAccess */, expr.pos); + indexedAccess.object = expr; + if (inNewExpression && parseOptional(10 /* CloseBracketToken */)) { + indexedAccess.index = createMissingNode(); + grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + else { + indexedAccess.index = parseExpression(); + parseExpected(10 /* CloseBracketToken */); + } + expr = finishNode(indexedAccess); + continue; + } + if ((token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(132 /* CallExpression */, expr.pos); + callExpr.func = expr; + if (token === 15 /* LessThanToken */) { + if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) + return expr; + } + else { + parseExpected(7 /* OpenParenToken */); + } + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, false); + parseExpected(8 /* CloseParenToken */); + expr = finishNode(callExpr); + continue; + } + return expr; + } + } + function parseTypeArgumentsAndOpenParen() { + var result = parseTypeArguments(); + parseExpected(7 /* OpenParenToken */); + return result; + } + function parseTypeArguments() { + var typeArgumentListStart = scanner.getTokenPos(); + var errorCountBeforeTypeParameterList = file.syntacticErrors.length; + var result = parseBracketedList(15 /* TypeArguments */, parseType, 15 /* LessThanToken */, 16 /* GreaterThanToken */, false); + if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { + grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + return result; + } + function parsePrimaryExpression() { + switch (token) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + return parseTokenNode(); + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + return parseLiteralNode(); + case 7 /* OpenParenToken */: + return parseParenExpression(); + case 9 /* OpenBracketToken */: + return parseArrayLiteral(); + case 5 /* OpenBraceToken */: + return parseObjectLiteral(); + case 73 /* FunctionKeyword */: + return parseFunctionExpression(); + case 78 /* NewKeyword */: + return parseNewExpression(); + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + if (reScanSlashToken() === 4 /* RegularExpressionLiteral */) { + return parseLiteralNode(); + } + break; + default: + if (isIdentifier()) { + return parseIdentifier(); + } + } + error(ts.Diagnostics.Expression_expected); + return createMissingNode(); + } + function parseParenExpression() { + var node = createNode(135 /* ParenExpression */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + return finishNode(node); + } + function parseArrayLiteralElement() { + return token === 14 /* CommaToken */ ? createNode(142 /* OmittedExpression */) : parseAssignmentExpression(); + } + function parseArrayLiteral() { + var node = createNode(127 /* ArrayLiteral */); + parseExpected(9 /* OpenBracketToken */); + if (scanner.hasPrecedingLineBreak()) + node.flags |= 128 /* MultiLine */; + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); + parseExpected(10 /* CloseBracketToken */); + return finishNode(node); + } + function parsePropertyAssignment() { + var node = createNode(129 /* PropertyAssignment */); + node.name = parsePropertyName(); + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var body = parseBody(); + node.initializer = makeFunctionExpression(136 /* FunctionExpression */, node.pos, node.name, sig, body); + } + else { + parseExpected(42 /* ColonToken */); + node.initializer = parseAssignmentExpression(false); + } + return finishNode(node); + } + function parseObjectLiteralMember() { + var initialPos = getNodePos(); + var initialToken = token; + if (parseContextualModifier(105 /* GetKeyword */) || parseContextualModifier(109 /* SetKeyword */)) { + var kind = initialToken === 105 /* GetKeyword */ ? 118 /* GetAccessor */ : 119 /* SetAccessor */; + return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + } + return parsePropertyAssignment(); + } + function parseObjectLiteral() { + var node = createNode(128 /* ObjectLiteral */); + parseExpected(5 /* OpenBraceToken */); + if (scanner.hasPrecedingLineBreak()) + node.flags |= 128 /* MultiLine */; + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); + parseExpected(6 /* CloseBraceToken */); + return finishNode(node); + } + function parseFunctionExpression() { + var pos = getNodePos(); + parseExpected(73 /* FunctionKeyword */); + var name = isIdentifier() ? parseIdentifier() : undefined; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + var body = parseBody(); + return makeFunctionExpression(136 /* FunctionExpression */, pos, name, sig, body); + } + function makeFunctionExpression(kind, pos, name, sig, body) { + var node = createNode(kind, pos); + node.name = name; + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = body; + return finishNode(node); + } + function parseNewExpression() { + var node = createNode(133 /* NewExpression */); + parseExpected(78 /* NewKeyword */); + node.func = parseCallAndAccess(parsePrimaryExpression(), true); + if (parseOptional(7 /* OpenParenToken */) || token === 15 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseAssignmentExpression, false); + parseExpected(8 /* CloseParenToken */); + } + return finishNode(node); + } + function parseBlock() { + var node = createNode(143 /* Block */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.statements = parseList(2 /* BlockStatements */, parseStatement); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + function parseBody() { + var block = parseBlock(); + block.kind = 168 /* FunctionBlock */; + return block; + } + function parseEmptyStatement() { + var node = createNode(145 /* EmptyStatement */); + parseExpected(13 /* SemicolonToken */); + return finishNode(node); + } + function parseIfStatement() { + var node = createNode(147 /* IfStatement */); + parseExpected(74 /* IfKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(66 /* ElseKeyword */) ? parseStatement() : undefined; + return finishNode(node); + } + function parseDoStatement() { + var node = createNode(148 /* DoStatement */); + parseExpected(65 /* DoKeyword */); + node.statement = parseStatement(); + parseExpected(90 /* WhileKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + parseOptional(13 /* SemicolonToken */); + return finishNode(node); + } + function parseWhileStatement() { + var node = createNode(149 /* WhileStatement */); + parseExpected(90 /* WhileKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseForOrForInStatement() { + var pos = getNodePos(); + parseExpected(72 /* ForKeyword */); + parseExpected(7 /* OpenParenToken */); + if (token !== 13 /* SemicolonToken */) { + if (parseOptional(88 /* VarKeyword */)) { + var declarations = parseVariableDeclarationList(0, true); + if (!declarations.length) { + error(ts.Diagnostics.variable_declaration_list_cannot_be_empty); + } + } + else { + var varOrInit = parseExpression(true); + } + } + if (parseOptional(76 /* InKeyword */)) { + var forInStat = createNode(151 /* ForInStatement */, pos); + if (declarations) { + if (declarations.length > 1) { + error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + forInStat.declaration = declarations[0]; + } + else { + forInStat.variable = varOrInit; + } + forInStat.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + forInStat.statement = parseStatement(); + return finishNode(forInStat); + } + else { + var forStat = createNode(150 /* ForStatement */, pos); + if (declarations) + forStat.declarations = declarations; + if (varOrInit) + forStat.initializer = varOrInit; + parseExpected(13 /* SemicolonToken */); + if (token !== 13 /* SemicolonToken */ && token !== 8 /* CloseParenToken */) { + forStat.condition = parseExpression(); + } + parseExpected(13 /* SemicolonToken */); + if (token !== 8 /* CloseParenToken */) { + forStat.iterator = parseExpression(); + } + parseExpected(8 /* CloseParenToken */); + forStat.statement = parseStatement(); + return finishNode(forStat); + } + } + function parseBreakOrContinueStatement(kind) { + var node = createNode(kind); + parseExpected(kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */); + if (!isSemicolon()) + node.label = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + function parseReturnStatement() { + var node = createNode(154 /* ReturnStatement */); + parseExpected(80 /* ReturnKeyword */); + if (!isSemicolon()) + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function parseWithStatement() { + var node = createNode(155 /* WithStatement */); + parseExpected(91 /* WithKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseCaseClause() { + var node = createNode(157 /* CaseClause */); + parseExpected(57 /* CaseKeyword */); + node.expression = parseExpression(); + parseExpected(42 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, parseStatement); + return finishNode(node); + } + function parseDefaultClause() { + var node = createNode(158 /* DefaultClause */); + parseExpected(63 /* DefaultKeyword */); + parseExpected(42 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, parseStatement); + return finishNode(node); + } + function parseCaseOrDefaultClause() { + return token === 57 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + } + function parseSwitchStatement() { + var node = createNode(156 /* SwitchStatement */); + parseExpected(82 /* SwitchKeyword */); + parseExpected(7 /* OpenParenToken */); + node.expression = parseExpression(); + parseExpected(8 /* CloseParenToken */); + parseExpected(5 /* OpenBraceToken */); + node.clauses = parseList(3 /* SwitchClauses */, parseCaseOrDefaultClause); + parseExpected(6 /* CloseBraceToken */); + return finishNode(node); + } + function parseThrowStatement() { + var node = createNode(160 /* ThrowStatement */); + parseExpected(84 /* ThrowKeyword */); + if (scanner.hasPrecedingLineBreak()) { + error(ts.Diagnostics.Line_break_not_permitted_here); + } + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function parseTryStatement() { + var node = createNode(161 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(86 /* TryKeyword */, 162 /* TryBlock */); + if (token === 58 /* CatchKeyword */) { + node.catchBlock = parseCatchBlock(); + } + if (token === 71 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(71 /* FinallyKeyword */, 164 /* FinallyBlock */); + } + if (!(node.catchBlock || node.finallyBlock)) { + error(ts.Diagnostics.catch_or_finally_expected); + } + return finishNode(node); + } + function parseTokenAndBlock(token, kind) { + var pos = getNodePos(); + parseExpected(token); + var result = parseBlock(); + result.kind = kind; + result.pos = pos; + return result; + } + function parseCatchBlock() { + var pos = getNodePos(); + parseExpected(58 /* CatchKeyword */); + parseExpected(7 /* OpenParenToken */); + var variable = parseIdentifier(); + var typeAnnotationColonStart = scanner.getTokenPos(); + var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; + var typeAnnotation = parseTypeAnnotation(); + parseExpected(8 /* CloseParenToken */); + var result = parseBlock(); + result.kind = 163 /* CatchBlock */; + result.pos = pos; + result.variable = variable; + if (typeAnnotation) { + errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + return result; + } + function parseDebuggerStatement() { + var node = createNode(165 /* DebuggerStatement */); + parseExpected(62 /* DebuggerKeyword */); + parseSemicolon(); + return finishNode(node); + } + function parseLabelledStatement() { + var node = createNode(159 /* LabelledStatement */); + node.label = parseIdentifier(); + parseExpected(42 /* ColonToken */); + node.statement = parseStatement(); + return finishNode(node); + } + function parseExpressionStatement() { + var node = createNode(146 /* ExpressionStatement */); + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + function isStatement() { + switch (token) { + case 5 /* OpenBraceToken */: + case 88 /* VarKeyword */: + case 73 /* FunctionKeyword */: + case 13 /* SemicolonToken */: + case 74 /* IfKeyword */: + case 65 /* DoKeyword */: + case 90 /* WhileKeyword */: + case 72 /* ForKeyword */: + case 61 /* ContinueKeyword */: + case 56 /* BreakKeyword */: + case 80 /* ReturnKeyword */: + case 91 /* WithKeyword */: + case 82 /* SwitchKeyword */: + case 84 /* ThrowKeyword */: + case 86 /* TryKeyword */: + case 62 /* DebuggerKeyword */: + return true; + case 93 /* InterfaceKeyword */: + case 59 /* ClassKeyword */: + case 106 /* ModuleKeyword */: + case 67 /* EnumKeyword */: + if (isDeclaration()) + return false; + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 55 /* Identifier */; })) + return false; + default: + return isExpression(); + } + } + function isStatementOrFunction() { + return token === 73 /* FunctionKeyword */ || isStatement(); + } + function parseStatement() { + switch (token) { + case 5 /* OpenBraceToken */: + return parseBlock(); + case 88 /* VarKeyword */: + return parseVariableStatement(); + case 73 /* FunctionKeyword */: + return parseFunctionDeclaration(); + case 13 /* SemicolonToken */: + return parseEmptyStatement(); + case 74 /* IfKeyword */: + return parseIfStatement(); + case 65 /* DoKeyword */: + return parseDoStatement(); + case 90 /* WhileKeyword */: + return parseWhileStatement(); + case 72 /* ForKeyword */: + return parseForOrForInStatement(); + case 61 /* ContinueKeyword */: + return parseBreakOrContinueStatement(152 /* ContinueStatement */); + case 56 /* BreakKeyword */: + return parseBreakOrContinueStatement(153 /* BreakStatement */); + case 80 /* ReturnKeyword */: + return parseReturnStatement(); + case 91 /* WithKeyword */: + return parseWithStatement(); + case 82 /* SwitchKeyword */: + return parseSwitchStatement(); + case 84 /* ThrowKeyword */: + return parseThrowStatement(); + case 86 /* TryKeyword */: + return parseTryStatement(); + case 62 /* DebuggerKeyword */: + return parseDebuggerStatement(); + default: + if (isIdentifier() && lookAhead(function () { return nextToken() === 42 /* ColonToken */; })) { + return parseLabelledStatement(); + } + return parseExpressionStatement(); + } + } + function parseStatementOrFunction() { + return token === 73 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); + } + function parseAndCheckFunctionBody(isConstructor) { + var initialPosition = scanner.getTokenPos(); + var errorCountBeforeBody = file.syntacticErrors.length; + if (token === 5 /* OpenBraceToken */) { + var body = parseBody(); + if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + grammarErrorAtPos(initialPosition, 1, diagnostic); + } + return body; + } + if (isSemicolon()) { + parseSemicolon(); + return undefined; + } + error(ts.Diagnostics.Block_or_expected); + } + function parseVariableDeclaration(flags, noIn) { + var node = createNode(166 /* VariableDeclaration */); + node.flags = flags; + node.name = parseIdentifier(); + node.type = parseTypeAnnotation(); + node.initializer = parseInitializer(false, noIn); + return finishNode(node); + } + function parseVariableDeclarationList(flags, noIn) { + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); + } + function parseVariableStatement(pos, flags) { + var node = createNode(144 /* VariableStatement */, pos); + if (flags) + node.flags = flags; + var errorCountBeforeVarStatement = file.syntacticErrors.length; + parseExpected(88 /* VarKeyword */); + node.declarations = parseVariableDeclarationList(flags, false); + parseSemicolon(); + if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { + grammarErrorOnNode(node, ts.Diagnostics.variable_declaration_list_cannot_be_empty); + } + return finishNode(node); + } + function parseFunctionDeclaration(pos, flags) { + var node = createNode(167 /* FunctionDeclaration */, pos); + if (flags) + node.flags = flags; + parseExpected(73 /* FunctionKeyword */); + node.name = parseIdentifier(); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(false); + return finishNode(node); + } + function parseConstructorDeclaration(pos, flags) { + var node = createNode(117 /* Constructor */, pos); + node.flags = flags; + parseExpected(103 /* ConstructorKeyword */); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(true); + if (node.typeParameters) { + grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + if (node.type) { + grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + return finishNode(node); + } + function parsePropertyMemberDeclaration(pos, flags) { + var name = parsePropertyName(); + if (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */) { + var method = createNode(116 /* Method */, pos); + method.flags = flags; + method.name = name; + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + method.typeParameters = sig.typeParameters; + method.parameters = sig.parameters; + method.type = sig.type; + method.body = parseAndCheckFunctionBody(false); + return finishNode(method); + } + else { + var property = createNode(115 /* Property */, pos); + property.flags = flags; + property.name = name; + property.type = parseTypeAnnotation(); + property.initializer = parseInitializer(false); + parseSemicolon(); + return finishNode(property); + } + } + function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { + var errorCountBeforeAccessor = file.syntacticErrors.length; + var accessor = parseMemberAccessorDeclaration(kind, pos, flags); + if (errorCountBeforeAccessor === file.syntacticErrors.length) { + if (languageVersion < 1 /* ES5 */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.typeParameters) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 118 /* GetAccessor */ && accessor.parameters.length) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 119 /* SetAccessor */) { + if (accessor.type) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & ts.NodeFlags.Modifier) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + return accessor; + } + function parseMemberAccessorDeclaration(kind, pos, flags) { + var node = createNode(kind, pos); + node.flags = flags; + node.name = parsePropertyName(); + var sig = parseSignature(120 /* CallSignature */, 42 /* ColonToken */); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseBody(); + return finishNode(node); + } + function isClassMemberStart() { + var idToken; + while (isModifier(token)) { + idToken = token; + nextToken(); + } + if (isPropertyName()) { + idToken = token; + nextToken(); + } + return idToken && (token === 7 /* OpenParenToken */ || token === 15 /* LessThanToken */ || token === 42 /* ColonToken */ || token === 43 /* EqualsToken */ || token === 13 /* SemicolonToken */ || token === 6 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || (isPropertyName() && (idToken === 105 /* GetKeyword */ || idToken === 109 /* SetKeyword */))) || (isModifier(idToken) && token === 9 /* OpenBracketToken */); + } + function isClassMemberDeclaration() { + return token === 9 /* OpenBracketToken */ || lookAhead(isClassMemberStart); + } + function parseAndCheckModifiers(context) { + var flags = 0; + var lastStaticModifierStart; + var lastStaticModifierLength; + var lastDeclareModifierStart; + var lastDeclareModifierLength; + var lastPrivateModifierStart; + var lastPrivateModifierLength; + while (true) { + var modifierStart = scanner.getTokenPos(); + var modifierToken = token; + if (!parseAnyContextualModifier()) + break; + var modifierLength = scanner.getStartPos() - modifierStart; + switch (modifierToken) { + case 98 /* PublicKeyword */: + if (flags & 32 /* Private */ || flags & 16 /* Public */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); + } + flags |= 16 /* Public */; + break; + case 96 /* PrivateKeyword */: + if (flags & 32 /* Private */ || flags & 16 /* Public */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); + } + lastPrivateModifierStart = modifierStart; + lastPrivateModifierLength = modifierLength; + flags |= 32 /* Private */; + break; + case 99 /* StaticKeyword */: + if (flags & 64 /* Static */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (context === 0 /* ModuleElements */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + lastStaticModifierStart = modifierStart; + lastStaticModifierLength = modifierLength; + flags |= 64 /* Static */; + break; + case 68 /* ExportKeyword */: + if (flags & 1 /* Export */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (context === 1 /* ClassMembers */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 104 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (context === 1 /* ClassMembers */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (context === 2 /* Parameters */) { + grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + lastDeclareModifierStart = modifierStart; + lastDeclareModifierLength = modifierLength; + flags |= 2 /* Ambient */; + break; + } + } + if (token === 103 /* ConstructorKeyword */ && flags & 64 /* Static */) { + grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (token === 103 /* ConstructorKeyword */ && flags & 32 /* Private */) { + grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + else if (token === 75 /* ImportKeyword */ && flags & 2 /* Ambient */) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (token === 93 /* InterfaceKeyword */ && flags & 2 /* Ambient */) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + return flags; + } + function parseClassMemberDeclaration() { + var pos = getNodePos(); + var flags = parseAndCheckModifiers(1 /* ClassMembers */); + if (parseContextualModifier(105 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(118 /* GetAccessor */, pos, flags); + } + if (parseContextualModifier(109 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(119 /* SetAccessor */, pos, flags); + } + if (token === 103 /* ConstructorKeyword */) { + return parseConstructorDeclaration(pos, flags); + } + if (token >= 55 /* Identifier */ || token === 3 /* StringLiteral */ || token === 2 /* NumericLiteral */) { + return parsePropertyMemberDeclaration(pos, flags); + } + if (token === 9 /* OpenBracketToken */) { + if (flags) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + return parseIndexSignatureMember(); + } + error(ts.Diagnostics.Class_member_declaration_expected); + } + function parseClassDeclaration(pos, flags) { + var node = createNode(169 /* ClassDeclaration */, pos); + node.flags = flags; + var errorCountBeforeClassDeclaration = file.syntacticErrors.length; + parseExpected(59 /* ClassKeyword */); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + node.baseType = parseOptional(69 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + var implementsKeywordStart = scanner.getTokenPos(); + var implementsKeywordLength; + if (parseOptional(92 /* ImplementsKeyword */)) { + implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + } + var errorCountBeforeClassBody = file.syntacticErrors.length; + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseList(6 /* ClassMembers */, parseClassMemberDeclaration); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { + grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); + } + return finishNode(node); + } + function parseInterfaceDeclaration(pos, flags) { + var node = createNode(170 /* InterfaceDeclaration */, pos); + node.flags = flags; + var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; + parseExpected(93 /* InterfaceKeyword */); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + var extendsKeywordStart = scanner.getTokenPos(); + var extendsKeywordLength; + if (parseOptional(69 /* ExtendsKeyword */)) { + extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + } + var errorCountBeforeInterfaceBody = file.syntacticErrors.length; + node.members = parseTypeLiteral().members; + if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { + grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); + } + return finishNode(node); + } + function parseEnumMember() { + var node = createNode(176 /* EnumMember */); + node.name = parsePropertyName(); + node.initializer = parseInitializer(false); + return finishNode(node); + } + function parseEnumDeclaration(pos, flags) { + var node = createNode(171 /* EnumDeclaration */, pos); + node.flags = flags; + parseExpected(67 /* EnumKeyword */); + node.name = parseIdentifier(); + if (parseExpected(5 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember, true); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + function parseModuleBody() { + var node = createNode(173 /* ModuleBlock */); + if (parseExpected(5 /* OpenBraceToken */)) { + node.statements = parseList(1 /* ModuleElements */, parseSourceElement); + parseExpected(6 /* CloseBraceToken */); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + function parseInternalModuleTail(pos, flags) { + var node = createNode(172 /* ModuleDeclaration */, pos); + node.flags = flags; + node.name = parseIdentifier(); + if (parseOptional(11 /* DotToken */)) { + node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); + } + else { + node.body = parseModuleBody(); + ts.forEach(node.body.statements, function (s) { + if (s.kind === 175 /* ExportAssignment */) { + grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (s.kind === 174 /* ImportDeclaration */ && s.externalModuleName) { + grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + }); + } + return finishNode(node); + } + function parseAmbientExternalModuleDeclaration(pos, flags) { + var node = createNode(172 /* ModuleDeclaration */, pos); + node.flags = flags; + node.name = parseStringLiteral(); + var saveInAmbientContext = inAmbientContext; + inAmbientContext = true; + node.body = parseModuleBody(); + inAmbientContext = saveInAmbientContext; + return finishNode(node); + } + function parseModuleDeclaration(pos, flags) { + parseExpected(106 /* ModuleKeyword */); + return token === 3 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + } + function parseImportDeclaration(pos, flags) { + var node = createNode(174 /* ImportDeclaration */, pos); + node.flags = flags; + parseExpected(75 /* ImportKeyword */); + node.name = parseIdentifier(); + parseExpected(43 /* EqualsToken */); + var entityName = parseEntityName(); + if (entityName.kind === 55 /* Identifier */ && entityName.text === "require" && parseOptional(7 /* OpenParenToken */)) { + node.externalModuleName = parseStringLiteral(); + parseExpected(8 /* CloseParenToken */); + } + else { + node.entityName = entityName; + } + parseSemicolon(); + return finishNode(node); + } + function parseExportAssignmentTail(pos) { + var node = createNode(175 /* ExportAssignment */, pos); + node.exportName = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + function isDeclaration() { + switch (token) { + case 88 /* VarKeyword */: + case 73 /* FunctionKeyword */: + return true; + case 59 /* ClassKeyword */: + case 93 /* InterfaceKeyword */: + case 67 /* EnumKeyword */: + case 75 /* ImportKeyword */: + return lookAhead(function () { return nextToken() >= 55 /* Identifier */; }); + case 106 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 55 /* Identifier */ || token === 3 /* StringLiteral */; }); + case 68 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 43 /* EqualsToken */ || isDeclaration(); }); + case 104 /* DeclareKeyword */: + case 98 /* PublicKeyword */: + case 96 /* PrivateKeyword */: + case 99 /* StaticKeyword */: + return lookAhead(function () { + nextToken(); + return isDeclaration(); + }); + } + } + function parseDeclaration() { + var pos = getNodePos(); + var flags = parseAndCheckModifiers(0 /* ModuleElements */); + if (token === 68 /* ExportKeyword */) { + nextToken(); + if (parseOptional(43 /* EqualsToken */)) { + return parseExportAssignmentTail(pos); + } + } + var saveInAmbientContext = inAmbientContext; + if (flags & 2 /* Ambient */) { + inAmbientContext = true; + } + var result; + switch (token) { + case 88 /* VarKeyword */: + result = parseVariableStatement(pos, flags); + break; + case 73 /* FunctionKeyword */: + result = parseFunctionDeclaration(pos, flags); + break; + case 59 /* ClassKeyword */: + result = parseClassDeclaration(pos, flags); + break; + case 93 /* InterfaceKeyword */: + result = parseInterfaceDeclaration(pos, flags); + break; + case 67 /* EnumKeyword */: + result = parseEnumDeclaration(pos, flags); + break; + case 106 /* ModuleKeyword */: + result = parseModuleDeclaration(pos, flags); + break; + case 75 /* ImportKeyword */: + result = parseImportDeclaration(pos, flags); + break; + default: + error(ts.Diagnostics.Declaration_expected); + } + inAmbientContext = saveInAmbientContext; + return result; + } + function isSourceElement() { + return isDeclaration() || isStatement(); + } + function parseSourceElement() { + return isDeclaration() ? parseDeclaration() : parseStatement(); + } + function processReferenceComments() { + var referencedFiles = []; + var amdDependencies = []; + commentRanges = []; + token = scanner.scan(); + for (var i = 0; i < commentRanges.length; i++) { + var range = commentRanges[i]; + var comment = sourceText.substring(range.pos, range.end); + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (isNoDefaultLibRegEx.exec(comment)) { + file.hasNoDefaultLib = true; + } + else { + var fullReferenceRegEx = /^(\/\/\/\s*/; + var matchResult = fullReferenceRegEx.exec(comment); + if (!matchResult) { + var start = range.pos; + var length = range.end - start; + errorAtPos(start, length, ts.Diagnostics.Invalid_reference_comment); + } + else { + referencedFiles.push({ + pos: range.pos, + end: range.end, + filename: matchResult[3] + }); + } + } + } + else { + var amdDependencyRegEx = /^\/\/\/\s*= 0 ? filename : filename + extension; + } + function processRootFile(filename, isDefaultLib) { + processSourceFile(ts.normalizePath(addExtension(filename, ".ts")), isDefaultLib); + } + function processSourceFile(filename, isDefaultLib, refFile, refPos, refEnd) { + if (refEnd !== undefined && refPos !== undefined) { + var start = refPos; + var length = refEnd - refPos; + } + if (!ts.fileExtensionIs(filename, ".ts")) { + errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + } + else if (!findSourceFile(filename, isDefaultLib)) { + errors.push(ts.createFileDiagnostic(refFile, start, length, ts.Diagnostics.File_0_not_found, filename)); + } + } + function findSourceFile(filename, isDefaultLib) { + var file = getSourceFile(filename); + if (!file) { + file = host.getSourceFile(filename, options.target); + if (file) { + filesByName[filename] = file; + seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + if (!options.noResolve) { + var basePath = ts.getDirectoryPath(filename); + processReferencedFiles(file, basePath); + if (file.flags & 1024 /* ExternalModule */) { + processImportedModules(file, basePath); + } + } + if (isDefaultLib) { + files.unshift(file); + } + else { + files.push(file); + } + ts.forEach(file.syntacticErrors, function (e) { + errors.push(e); + }); + } + } + return file; + } + function processReferencedFiles(file, basePath) { + ts.forEach(file.referencedFiles, function (ref) { + processSourceFile(ts.normalizePath(ts.combinePaths(basePath, ref.filename)), false, file, ref.pos, ref.end); + }); + } + function processImportedModules(file, basePath) { + ts.forEach(file.statements, function (node) { + if (node.kind === 174 /* ImportDeclaration */ && node.externalModuleName) { + var moduleName = getTextOfLiteral(node.externalModuleName); + if (moduleName) { + var isRelative = moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../"; + var searchPath = basePath; + while (true) { + var searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); + if (findSourceFile(searchName + ".ts", false) || findSourceFile(searchName + ".d.ts", false)) + break; + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) + break; + searchPath = parentPath; + } + } + } + }); + } + function verifyCompilerOptions() { + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { + if (options.mapRoot) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + if (options.sourceRoot) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + return; + } + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || !!ts.filter(files, function (sourceFile) { return !!(sourceFile.flags & 1024 /* ExternalModule */); }).length))) { + var commonPathComponents; + ts.forEach(files, function (sourceFile) { + if (!(sourceFile.flags & 512 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + var sourcePathCompoments = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathCompoments.pop(); + if (commonPathComponents) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { + if (commonPathComponents[i] !== sourcePathCompoments[i]) { + if (i === 0) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + commonPathComponents.length = i; + break; + } + } + if (sourcePathCompoments.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathCompoments.length; + } + } + else { + commonPathComponents = sourcePathCompoments; + } + } + }); + commonSourceDirectory = ts.getNormalizedPathFromPathCompoments(commonPathComponents); + if (commonSourceDirectory) { + commonSourceDirectory += ts.directorySeparator; + } + } + } + } + ts.createProgram = createProgram; +})(ts || (ts = {})); +var ts; +(function (ts) { + function isInstantiated(node) { + if (node.kind === 170 /* InterfaceDeclaration */) { + return false; + } + else if (node.kind === 174 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return false; + } + else if (node.kind === 173 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { + return false; + } + else if (node.kind === 172 /* ModuleDeclaration */ && !isInstantiated(node.body)) { + return false; + } + else { + return true; + } + } + ts.isInstantiated = isInstantiated; + function bindSourceFile(file) { + var parent; + var container; + var symbolCount = 0; + var Symbol = ts.objectAllocator.getSymbolConstructor(); + if (!file.locals) { + file.locals = {}; + container = file; + bind(file); + file.symbolCount = symbolCount; + } + function createSymbol(flags, name) { + symbolCount++; + return new Symbol(flags, name); + } + function addDeclarationToSymbol(symbol, node, symbolKind) { + symbol.flags |= symbolKind; + if (!symbol.declarations) + symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + symbol.exports = {}; + if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + symbol.members = {}; + node.symbol = symbol; + if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + symbol.valueDeclaration = node; + } + function getDeclarationName(node) { + if (node.name) { + if (node.name.kind === 55 /* Identifier */) + return node.name.text; + if (node.kind === 172 /* ModuleDeclaration */) + return '"' + ts.getTextOfLiteral(node.name) + '"'; + return ts.getTextOfLiteral(node.name); + } + switch (node.kind) { + case 117 /* Constructor */: + return "__constructor"; + case 120 /* CallSignature */: + return "__call"; + case 121 /* ConstructSignature */: + return "__new"; + case 122 /* IndexSignature */: + return "__index"; + } + } + function getDisplayName(node) { + return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + } + function declareSymbol(symbols, parent, node, includes, excludes) { + var name = getDeclarationName(node); + if (name !== undefined) { + var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(ts.createDiagnosticForNode(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + if (node.kind === 169 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + return symbol; + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2 /* Ambient */) + return true; + node = node.parent; + } + return false; + } + function declareModuleMember(node, symbolKind, symbolExcludes) { + var exportKind = 0; + var exportExcludes = 0; + if (symbolKind & ts.SymbolFlags.Value) { + exportKind |= 524288 /* ExportValue */; + exportExcludes |= ts.SymbolFlags.Value; + } + if (symbolKind & ts.SymbolFlags.Type) { + exportKind |= 1048576 /* ExportType */; + exportExcludes |= ts.SymbolFlags.Type; + } + if (symbolKind & ts.SymbolFlags.Namespace) { + exportKind |= 2097152 /* ExportNamespace */; + exportExcludes |= ts.SymbolFlags.Namespace; + } + if (node.flags & 1 /* Export */ || (node.kind !== 174 /* ImportDeclaration */ && isAmbientContext(container))) { + if (exportKind) { + var local = declareSymbol(container.locals, undefined, node, exportKind, exportExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes | exportKind); + } + } + function bindDeclaration(node, symbolKind, symbolExcludes) { + switch (container.kind) { + case 172 /* ModuleDeclaration */: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case 177 /* SourceFile */: + if (container.flags & 1024 /* ExternalModule */) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case 169 /* ClassDeclaration */: + if (node.flags & 64 /* Static */) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case 125 /* TypeLiteral */: + case 128 /* ObjectLiteral */: + case 170 /* InterfaceDeclaration */: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case 171 /* EnumDeclaration */: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + if (symbolKind & ts.SymbolFlags.HasLocals) + node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + if (symbolKind & ts.SymbolFlags.IsContainer) + container = node; + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + function bindConstructorDeclaration(node) { + bindDeclaration(node, 4096 /* Constructor */, 0); + ts.forEach(node.parameters, function (p) { + if (p.flags & (16 /* Public */ | 32 /* Private */)) { + bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + } + }); + } + function bindModuleDeclaration(node) { + if (node.name.kind === 3 /* StringLiteral */) { + bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + } + else if (isInstantiated(node)) { + bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + } + else { + bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + } + } + function bindAnonymousDeclaration(node, symbolKind, name) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + if (symbolKind & ts.SymbolFlags.HasLocals) + node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + container = node; + ts.forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + function bindCatchVariableDeclaration(node) { + var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node.variable, 1 /* Variable */); + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + function bind(node) { + node.parent = parent; + switch (node.kind) { + case 113 /* TypeParameter */: + bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + break; + case 114 /* Parameter */: + bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + break; + case 166 /* VariableDeclaration */: + bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + break; + case 115 /* Property */: + case 129 /* PropertyAssignment */: + bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + break; + case 176 /* EnumMember */: + bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + break; + case 120 /* CallSignature */: + bindDeclaration(node, 32768 /* CallSignature */, 0); + break; + case 116 /* Method */: + bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + break; + case 121 /* ConstructSignature */: + bindDeclaration(node, 65536 /* ConstructSignature */, 0); + break; + case 122 /* IndexSignature */: + bindDeclaration(node, 131072 /* IndexSignature */, 0); + break; + case 167 /* FunctionDeclaration */: + bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + break; + case 117 /* Constructor */: + bindConstructorDeclaration(node); + break; + case 118 /* GetAccessor */: + bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + break; + case 119 /* SetAccessor */: + bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + break; + case 125 /* TypeLiteral */: + bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + break; + case 128 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + break; + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + break; + case 163 /* CatchBlock */: + bindCatchVariableDeclaration(node); + break; + case 169 /* ClassDeclaration */: + bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + break; + case 170 /* InterfaceDeclaration */: + bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + break; + case 171 /* EnumDeclaration */: + bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + break; + case 172 /* ModuleDeclaration */: + bindModuleDeclaration(node); + break; + case 174 /* ImportDeclaration */: + bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + break; + case 177 /* SourceFile */: + if (node.flags & 1024 /* ExternalModule */) { + bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.getModuleNameFromFilename(node.filename) + '"'); + break; + } + default: + var saveParent = parent; + parent = node; + ts.forEachChild(node, bind); + parent = saveParent; + } + } + } + ts.bindSourceFile = bindSourceFile; +})(ts || (ts = {})); +var ts; +(function (ts) { + function getSourceFilePathInNewDir(newDirPath, sourceFile, program, compilerHost) { + var sourceFilePath = ts.getNormalizedPathFromPathCompoments(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); + sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); + return ts.combinePaths(newDirPath, sourceFilePath); + } + function emitFiles(resolver) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (!(sourceFile.flags & 512 /* DeclarationFile */)) { + if ((sourceFile.flags & 1024 /* ExternalModule */ || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { + emitJavaScript(resolver, (ts.getModuleNameFromFilename(compilerOptions.outDir ? getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile, program, compilerHost) : sourceFile.filename)) + ".js", sourceMapDataList, sourceFile); + } + } + }); + if (compilerOptions.out) { + emitJavaScript(resolver, compilerOptions.out, sourceMapDataList); + } + return sourceMapDataList; + } + ts.emitFiles = emitFiles; + function emitJavaScript(resolver, jsFilePath, sourceMapDataList, root) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + var output = ""; + var indent = 0; + var lineStart = true; + var extendsEmitted = false; + var currentSourceFile; + var write; + var writeEmittedFiles; + var emitStart; + var emitEnd; + var emitToken; + var emitNewSourceFileStart; + var scopeEmitStart; + var scopeEmitEnd; + var sourceMapData; + function initializeEmitterWithoutSourceMaps() { + write = writeToOutput; + writeEmittedFiles = writeJavaScriptFile; + emitStart = function () { + }; + emitEnd = emitStart; + emitToken = emitTokenText; + emitNewSourceFileStart = emitStart; + scopeEmitStart = emitStart; + scopeEmitEnd = emitStart; + } + function initializeEmitterWithSourceMaps() { + var sourceMapDir; + var sourceMapCurrentSourceFile; + var sourceMapSourceIndex = -1; + var sourceMapNameIndexMap = {}; + var sourceMapNameIndices = []; + function getSourceMapNameIndex() { + return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + } + var emittedLine = 1; + var emittedColumn = 1; + var lastRecordedSourceMapSpan; + var lastEncodedSourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + var lastEncodedNameIndex = 0; + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + function base64VLQFormatEncode(inValue) { + function base64FormatEncode(inValue) { + if (inValue < 64) { + return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + var encodedStr = ""; + do { + var currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + return encodedStr; + } + } + function recordSourceMapSpan(pos) { + emitIndent(); + var sourceLinePos = sourceMapCurrentSourceFile.getLineAndCharacterFromPosition(pos); + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)) { + encodeLastRecordedSourceMapSpan(); + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + nameIndex: getSourceMapNameIndex(), + sourceIndex: sourceMapSourceIndex + }; + } + else { + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + } + } + function recordEmitNodeStartSpan(node) { + recordSourceMapSpan(ts.getTokenPosOfNode(node)); + } + function recordEmitNodeEndSpan(node) { + recordSourceMapSpan(node.end); + } + function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { + var tokenStartPos = ts.skipTrivia(sourceMapCurrentSourceFile.text, startPos); + recordSourceMapSpan(tokenStartPos); + var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); + recordSourceMapSpan(tokenEndPos); + return tokenEndPos; + } + function recordNewSourceFileStart(node) { + sourceMapCurrentSourceFile = node; + var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, sourceMapCurrentSourceFile.filename, compilerHost.getCurrentDirectory(), true)); + sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; + sourceMapData.inputSourceFileNames.push(sourceMapCurrentSourceFile.filename); + } + function recordScopeNameOfNode(node, scopeName) { + function recordScopeNameIndex(scopeNameIndex) { + sourceMapNameIndices.push(scopeNameIndex); + } + function recordScopeNameStart(scopeName) { + var scopeNameIndex = -1; + if (scopeName) { + var parentIndex = getSourceMapNameIndex(); + if (parentIndex !== -1) { + scopeName = sourceMapData.sourceMapNames[parentIndex] + "." + scopeName; + } + scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); + if (scopeNameIndex === undefined) { + scopeNameIndex = sourceMapData.sourceMapNames.length; + sourceMapData.sourceMapNames.push(scopeName); + sourceMapNameIndexMap[scopeName] = scopeNameIndex; + } + } + recordScopeNameIndex(scopeNameIndex); + } + if (scopeName) { + recordScopeNameStart(scopeName); + } + else if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */ || node.kind === 172 /* ModuleDeclaration */ || node.kind === 169 /* ClassDeclaration */ || node.kind === 171 /* EnumDeclaration */) { + if (node.name) { + scopeName = node.name.text; + } + recordScopeNameStart(scopeName); + } + else { + recordScopeNameIndex(getSourceMapNameIndex()); + } + } + function recordScopeNameEnd() { + sourceMapNameIndices.pop(); + } + ; + function writeWithLineColumnTracking(s) { + writeToOutput(s); + if (s && s.length) { + var lineCol = ts.positionToLineAndCharacter(s, s.length); + if (lineCol.line == 1) { + emittedColumn += lineCol.character - 1; + } + else { + emittedLine += lineCol.line - 1; + emittedColumn = lineCol.character; + } + } + } + function writeJavaScriptAndSourceMapFile() { + encodeLastRecordedSourceMapSpan(); + output += "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; + compilerHost.writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings + })); + sourceMapDataList.push(sourceMapData); + writeJavaScriptFile(); + } + var sourceMapJsFile = ts.getBaseFilename(ts.normalizeSlashes(jsFilePath)); + sourceMapData = { + sourceMapFilePath: jsFilePath + ".map", + jsSourceMappingURL: sourceMapJsFile + ".map", + sourceMapFile: sourceMapJsFile, + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapDecodedMappings: [] + }; + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { + sourceMapData.sourceMapSourceRoot += ts.directorySeparator; + } + if (compilerOptions.mapRoot) { + sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); + if (root) { + sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(sourceMapDir, root, program, compilerHost)); + } + if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), true); + } + else { + sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); + } + write = writeWithLineColumnTracking; + writeEmittedFiles = writeJavaScriptAndSourceMapFile; + emitStart = recordEmitNodeStartSpan; + emitEnd = recordEmitNodeEndSpan; + emitToken = writeTextWithSpanRecord; + emitNewSourceFileStart = recordNewSourceFileStart; + scopeEmitStart = recordScopeNameOfNode; + scopeEmitEnd = recordScopeNameEnd; + } + function emitTokenText(tokenKind, startPos, emitFn) { + var tokenString = ts.tokenToString(tokenKind); + if (emitFn) { + emitFn(); + } + else { + write(tokenString); + } + return startPos + tokenString.length; + } + function writeJavaScriptFile() { + compilerHost.writeFile(jsFilePath, output); + } + function emit(node) { + if (node && node.kind != 177 /* SourceFile */) { + emitStart(node); + emitNode(node); + emitEnd(node); + } + else { + emitNewSourceFileStart(node); + emitNode(node); + } + } + function emitIndent() { + if (lineStart) { + lineStart = false; + if (output.length) { + write("\r\n"); + } + for (var i = 0; i < indent; i++) { + write(" "); + } + } + } + function writeToOutput(s) { + if (s && s.length) { + emitIndent(); + output += s; + } + } + function writeLine() { + lineStart = true; + } + function emitOptional(prefix, node) { + if (node) { + write(prefix); + emit(node); + } + } + function emitCommaList(nodes, count) { + if (!(count >= 0)) + count = nodes.length; + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) + write(", "); + emit(nodes[i]); + } + } + } + function emitMultiLineList(nodes) { + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (i) + write(","); + writeLine(); + emit(nodes[i]); + } + } + } + function emitLines(nodes) { + for (var i = 0; i < nodes.length; i++) { + writeLine(); + emit(nodes[i]); + } + } + function emitIdentifierValue(node) { + if (node.kind === 3 /* StringLiteral */ || node.kind === 2 /* NumericLiteral */) { + write(node.text); + } + else { + write("\""); + write(ts.getSourceTextOfNode(node)); + write("\""); + } + } + function isNonExpressionIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 114 /* Parameter */: + case 166 /* VariableDeclaration */: + case 115 /* Property */: + case 129 /* PropertyAssignment */: + case 176 /* EnumMember */: + case 116 /* Method */: + case 167 /* FunctionDeclaration */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return parent.name === node; + case 153 /* BreakStatement */: + case 152 /* ContinueStatement */: + case 175 /* ExportAssignment */: + return false; + case 159 /* LabelledStatement */: + return node.parent.label === node; + case 163 /* CatchBlock */: + return node.parent.variable === node; + } + } + function emitIdentifier(node) { + if (!isNonExpressionIdentifier(node)) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); + } + } + write(ts.getSourceTextOfNode(node)); + } + function emitThis(node) { + if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { + write("_this"); + } + else { + write("this"); + } + } + function emitSuper(node) { + var flags = resolver.getNodeCheckFlags(node); + if (flags & 16 /* SuperInstance */) { + write("_super.prototype"); + } + else if (flags & 32 /* SuperStatic */) { + write("_super"); + } + else { + write("super"); + } + } + function emitArrayLiteral(node) { + if (node.flags & 128 /* MultiLine */) { + write("["); + indent++; + emitMultiLineList(node.elements); + indent--; + writeLine(); + write("]"); + } + else { + write("["); + emitCommaList(node.elements); + write("]"); + } + } + function emitObjectLiteral(node) { + if (!node.properties.length) { + write("{}"); + } + else if (node.flags & 128 /* MultiLine */) { + write("{"); + indent++; + emitMultiLineList(node.properties); + indent--; + writeLine(); + write("}"); + } + else { + write("{ "); + emitCommaList(node.properties); + write(" }"); + } + } + function emitPropertyAssignment(node) { + emit(node.name); + write(": "); + emit(node.initializer); + } + function emitPropertyAccess(node) { + var text = resolver.getPropertyAccessSubstitution(node); + if (text) { + write(text); + return; + } + emit(node.left); + write("."); + emit(node.right); + } + function emitIndexedAccess(node) { + emit(node.object); + write("["); + emit(node.index); + write("]"); + } + function emitCallExpression(node) { + var superCall = false; + if (node.func.kind === 81 /* SuperKeyword */) { + write("_super"); + superCall = true; + } + else { + emit(node.func); + superCall = node.func.kind === 130 /* PropertyAccess */ && node.func.left.kind === 81 /* SuperKeyword */; + } + if (superCall) { + write(".call("); + emitThis(node.func); + if (node.arguments.length) { + write(", "); + emitCommaList(node.arguments); + } + write(")"); + } + else { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + function emitNewExpression(node) { + write("new "); + emit(node.func); + if (node.arguments) { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + function emitParenExpression(node) { + if (node.expression.kind === 134 /* TypeAssertion */) { + var operand = node.expression.operand; + while (operand.kind == 134 /* TypeAssertion */) { + operand = operand.operand; + } + if (operand.kind !== 138 /* PrefixOperator */ && operand.kind !== 139 /* PostfixOperator */ && operand.kind !== 133 /* NewExpression */ && !(operand.kind === 132 /* CallExpression */ && node.parent.kind === 133 /* NewExpression */) && !(operand.kind === 136 /* FunctionExpression */ && node.parent.kind === 132 /* CallExpression */)) { + emit(operand); + return; + } + } + write("("); + emit(node.expression); + write(")"); + } + function emitUnaryExpression(node) { + if (node.kind === 138 /* PrefixOperator */) { + write(ts.tokenToString(node.operator)); + } + if (node.operator >= 55 /* Identifier */) { + write(" "); + } + else if (node.kind === 138 /* PrefixOperator */ && node.operand.kind === 138 /* PrefixOperator */) { + var operand = node.operand; + if (node.operator === 24 /* PlusToken */ && (operand.operator === 24 /* PlusToken */ || operand.operator === 29 /* PlusPlusToken */)) { + write(" "); + } + else if (node.operator === 25 /* MinusToken */ && (operand.operator === 25 /* MinusToken */ || operand.operator === 30 /* MinusMinusToken */)) { + write(" "); + } + } + emit(node.operand); + if (node.kind === 139 /* PostfixOperator */) { + write(ts.tokenToString(node.operator)); + } + } + function emitBinaryExpression(node) { + emit(node.left); + if (node.operator !== 14 /* CommaToken */) + write(" "); + write(ts.tokenToString(node.operator)); + write(" "); + emit(node.right); + } + function emitConditionalExpression(node) { + emit(node.condition); + write(" ? "); + emit(node.whenTrue); + write(" : "); + emit(node.whenFalse); + } + function emitBlock(node) { + emitToken(5 /* OpenBraceToken */, node.pos); + indent++; + scopeEmitStart(node.parent); + if (node.kind === 173 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 172 /* ModuleDeclaration */); + emitCaptureThisForNodeIfNecessary(node.parent); + } + emitLines(node.statements); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.statements.end); + scopeEmitEnd(); + } + function emitEmbeddedStatement(node) { + if (node.kind === 143 /* Block */) { + write(" "); + emit(node); + } + else { + indent++; + writeLine(); + emit(node); + indent--; + } + } + function emitExpressionStatement(node) { + var isArrowExpression = node.expression.kind === 137 /* ArrowFunction */; + if (isArrowExpression) + write("("); + emit(node.expression); + if (isArrowExpression) + write(")"); + write(";"); + } + function emitIfStatement(node) { + var endPos = emitToken(74 /* IfKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + emit(node.expression); + emitToken(8 /* CloseParenToken */, node.expression.end); + emitEmbeddedStatement(node.thenStatement); + if (node.elseStatement) { + writeLine(); + emitToken(66 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 147 /* IfStatement */) { + write(" "); + emit(node.elseStatement); + } + else { + emitEmbeddedStatement(node.elseStatement); + } + } + } + function emitDoStatement(node) { + write("do"); + emitEmbeddedStatement(node.statement); + if (node.statement.kind === 143 /* Block */) { + write(" "); + } + else { + writeLine(); + } + write("while ("); + emit(node.expression); + write(");"); + } + function emitWhileStatement(node) { + write("while ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitForStatement(node) { + var endPos = emitToken(72 /* ForKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + if (node.declarations) { + emitToken(88 /* VarKeyword */, endPos); + write(" "); + emitCommaList(node.declarations); + } + if (node.initializer) { + emit(node.initializer); + } + write(";"); + emitOptional(" ", node.condition); + write(";"); + emitOptional(" ", node.iterator); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitForInStatement(node) { + var endPos = emitToken(72 /* ForKeyword */, node.pos); + write(" "); + endPos = emitToken(7 /* OpenParenToken */, endPos); + if (node.declaration) { + emitToken(88 /* VarKeyword */, endPos); + write(" "); + emit(node.declaration); + } + else { + emit(node.variable); + } + write(" in "); + emit(node.expression); + emitToken(8 /* CloseParenToken */, node.expression.end); + emitEmbeddedStatement(node.statement); + } + function emitBreakOrContinueStatement(node) { + emitToken(node.kind === 153 /* BreakStatement */ ? 56 /* BreakKeyword */ : 61 /* ContinueKeyword */, node.pos); + emitOptional(" ", node.label); + write(";"); + } + function emitReturnStatement(node) { + emitToken(80 /* ReturnKeyword */, node.pos); + emitOptional(" ", node.expression); + write(";"); + } + function emitWithStatement(node) { + write("with ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + function emitSwitchStatement(node) { + var endPos = emitToken(82 /* SwitchKeyword */, node.pos); + write(" "); + emitToken(7 /* OpenParenToken */, endPos); + emit(node.expression); + endPos = emitToken(8 /* CloseParenToken */, node.expression.end); + write(" "); + emitToken(5 /* OpenBraceToken */, endPos); + indent++; + emitLines(node.clauses); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.clauses.end); + } + function emitCaseOrDefaultClause(node) { + if (node.kind === 157 /* CaseClause */) { + write("case "); + emit(node.expression); + write(":"); + } + else { + write("default:"); + } + indent++; + emitLines(node.statements); + indent--; + } + function emitThrowStatement(node) { + write("throw "); + emit(node.expression); + write(";"); + } + function emitTryStatement(node) { + write("try "); + emit(node.tryBlock); + emit(node.catchBlock); + if (node.finallyBlock) { + writeLine(); + write("finally "); + emit(node.finallyBlock); + } + } + function emitCatchBlock(node) { + writeLine(); + var endPos = emitToken(58 /* CatchKeyword */, node.pos); + write(" "); + emitToken(7 /* OpenParenToken */, endPos); + emit(node.variable); + emitToken(8 /* CloseParenToken */, node.variable.end); + write(" "); + emitBlock(node); + } + function emitDebuggerStatement(node) { + emitToken(62 /* DebuggerKeyword */, node.pos); + write(";"); + } + function emitLabelledStatement(node) { + emit(node.label); + write(": "); + emit(node.statement); + } + function getContainingModule(node) { + do { + node = node.parent; + } while (node && node.kind !== 172 /* ModuleDeclaration */); + return node; + } + function emitModuleMemberName(node) { + emitStart(node.name); + if (node.flags & 1 /* Export */) { + var container = getContainingModule(node); + write(container ? resolver.getModuleObjectName(container) : "exports"); + write("."); + } + emitNode(node.name); + emitEnd(node.name); + } + function emitVariableDeclaration(node) { + emitModuleMemberName(node); + emitOptional(" = ", node.initializer); + } + function emitVariableStatement(node) { + if (!(node.flags & 1 /* Export */)) + write("var "); + emitCommaList(node.declarations); + write(";"); + } + function emitParameter(node) { + emit(node.name); + } + function emitDefaultValueAssignments(node) { + ts.forEach(node.parameters, function (param) { + if (param.initializer) { + writeLine(); + emitStart(param); + write("if ("); + emitNode(param.name); + write(" === void 0)"); + emitEnd(param); + write(" { "); + emitStart(param); + emitNode(param.name); + write(" = "); + emitNode(param.initializer); + emitEnd(param); + write("; }"); + } + }); + } + function emitRestParameter(node) { + if (node.parameters.length && (node.parameters[node.parameters.length - 1].flags & 8 /* Rest */) !== 0) { + var restIndex = node.parameters.length - 1; + var restParam = node.parameters[restIndex]; + writeLine(); + emitStart(restParam); + write("var "); + emitNode(restParam.name); + write(" = [];"); + emitEnd(restParam); + writeLine(); + write("for ("); + emitStart(restParam); + write("var _i = " + restIndex + ";"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i < arguments.length;"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i++"); + emitEnd(restParam); + write(") {"); + indent++; + writeLine(); + emitStart(restParam); + emitNode(restParam.name); + write("[_i - " + restIndex + "] = arguments[_i];"); + emitEnd(restParam); + indent--; + writeLine(); + write("}"); + } + } + function emitAccessor(node) { + write(node.kind === 118 /* GetAccessor */ ? "get " : "set "); + emit(node.name); + emitSignatureAndBody(node); + } + function emitFunctionDeclaration(node) { + if (!node.body) + return; + write("function "); + if (node.kind === 167 /* FunctionDeclaration */ || (node.kind === 136 /* FunctionExpression */ && node.name)) { + emit(node.name); + } + emitSignatureAndBody(node); + } + function emitCaptureThisForNodeIfNecessary(node) { + if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { + writeLine(); + emitStart(node); + write("var _this = this;"); + emitEnd(node); + } + } + function emitSignatureAndBody(node) { + var hasRestParameter = node.parameters.length && (node.parameters[node.parameters.length - 1].flags & 8 /* Rest */) !== 0; + write("("); + emitCommaList(node.parameters, node.parameters.length - (hasRestParameter ? 1 : 0)); + write(") {"); + scopeEmitStart(node); + indent++; + var outPos = output.length; + emitCaptureThisForNodeIfNecessary(node); + emitDefaultValueAssignments(node); + emitRestParameter(node); + if (node.body.kind !== 168 /* FunctionBlock */ && outPos === output.length) { + indent--; + write(" "); + emitStart(node.body); + write("return "); + emitNode(node.body); + emitEnd(node.body); + write("; "); + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + else { + if (node.body.kind === 168 /* FunctionBlock */) { + emitLines(node.body.statements); + } + else { + writeLine(); + write("return "); + emit(node.body); + write(";"); + } + indent--; + writeLine(); + if (node.body.kind === 168 /* FunctionBlock */) { + emitToken(6 /* CloseBraceToken */, node.body.statements.end); + } + else { + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + } + scopeEmitEnd(); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + function findConstructor(node) { + return ts.forEach(node.members, function (member) { + if (member.kind === 117 /* Constructor */ && member.body) { + return member; + } + }); + } + function findInitialSuperCall(ctor) { + if (ctor.body) { + var statement = ctor.body.statements[0]; + if (statement && statement.kind === 146 /* ExpressionStatement */) { + var expr = statement.expression; + if (expr && expr.kind === 132 /* CallExpression */) { + var func = expr.func; + if (func && func.kind === 81 /* SuperKeyword */) { + return statement; + } + } + } + } + } + function emitParameterPropertyAssignments(node) { + ts.forEach(node.parameters, function (param) { + if (param.flags & (16 /* Public */ | 32 /* Private */)) { + writeLine(); + emitStart(param); + emitStart(param.name); + write("this."); + emitNode(param.name); + emitEnd(param.name); + write(" = "); + emit(param.name); + write(";"); + emitEnd(param); + } + }); + } + function emitMemberAccess(memberName) { + if (memberName.kind === 3 /* StringLiteral */ || memberName.kind === 2 /* NumericLiteral */) { + write("["); + emitNode(memberName); + write("]"); + } + else { + write("."); + emitNode(memberName); + } + } + function emitMemberAssignments(node, staticFlag) { + ts.forEach(node.members, function (member) { + if (member.kind === 115 /* Property */ && (member.flags & 64 /* Static */) === staticFlag && member.initializer) { + writeLine(); + emitStart(member); + emitStart(member.name); + if (staticFlag) { + emitNode(node.name); + } + else { + write("this"); + } + emitMemberAccess(member.name); + emitEnd(member.name); + write(" = "); + emit(member.initializer); + write(";"); + emitEnd(member); + } + }); + } + function getAccessorDeclarations(node, name, staticFlag) { + var firstAccessor; + var getAccessor; + var setAccessor; + ts.forEach(node.members, function (member) { + if ((member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) && member.name.text === name && (member.flags & 64 /* Static */) === staticFlag) { + if (!firstAccessor) + firstAccessor = member; + if (member.kind === 118 /* GetAccessor */ && !getAccessor) + getAccessor = member; + if (member.kind === 119 /* SetAccessor */ && !setAccessor) + setAccessor = member; + } + }); + return { + firstAccessor: firstAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + function emitMemberFunctions(node) { + ts.forEach(node.members, function (member) { + if (member.kind === 116 /* Method */) { + if (!member.body) + return; + writeLine(); + emitStart(member); + emitStart(member.name); + emitNode(node.name); + if (!(member.flags & 64 /* Static */)) { + write(".prototype"); + } + emitMemberAccess(member.name); + emitEnd(member.name); + write(" = "); + emitStart(member); + emitFunctionDeclaration(member); + emitEnd(member); + emitEnd(member); + write(";"); + } + else if (member.kind === 118 /* GetAccessor */ || member.kind === 119 /* SetAccessor */) { + var accessors = getAccessorDeclarations(node, member.name.text, member.flags & 64 /* Static */); + if (member === accessors.firstAccessor) { + writeLine(); + emitStart(member); + write("Object.defineProperty("); + emitStart(member.name); + emitNode(node.name); + if (!(member.flags & 64 /* Static */)) { + write(".prototype"); + } + write(", "); + emitIdentifierValue(member.name); + emitEnd(member.name); + write(", {"); + indent++; + if (accessors.getAccessor) { + writeLine(); + write("get: "); + emitStart(accessors.getAccessor); + write("function "); + emitSignatureAndBody(accessors.getAccessor); + emitEnd(accessors.getAccessor); + write(","); + } + if (accessors.setAccessor) { + writeLine(); + write("set: "); + emitStart(accessors.setAccessor); + write("function "); + emitSignatureAndBody(accessors.setAccessor); + emitEnd(accessors.setAccessor); + write(","); + } + writeLine(); + write("enumerable: true,"); + writeLine(); + write("configurable: true"); + indent--; + writeLine(); + write("});"); + emitEnd(member); + } + } + }); + } + function emitClassDeclaration(node) { + var ctor = findConstructor(node); + write("var "); + emit(node.name); + write(" = (function ("); + if (node.baseType) + write("_super"); + write(") {"); + indent++; + scopeEmitStart(node); + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("__extends("); + emit(node.name); + write(", _super);"); + emitEnd(node.baseType); + } + writeLine(); + emitStart(ctor || node); + write("function "); + emit(node.name); + write("("); + if (ctor) { + emitCommaList(ctor.parameters); + } + write(") {"); + scopeEmitStart(node, "constructor"); + indent++; + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (node.baseType) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("_super.apply(this, arguments);"); + emitEnd(node.baseType); + } + } + emitCaptureThisForNodeIfNecessary(node); + emitMemberAssignments(node, 0); + if (ctor) { + var statements = ctor.body.statements; + if (superCall) + statements = statements.slice(1); + emitLines(statements); + } + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + emitMemberFunctions(node); + emitMemberAssignments(node, 64 /* Static */); + writeLine(); + function emitClassReturnStatement() { + write("return "); + emitNode(node.name); + } + emitToken(6 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + write(";"); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.members.end); + scopeEmitEnd(); + emitStart(node); + write(")("); + if (node.baseType) { + emit(node.baseType.typeName); + } + write(");"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + function emitEnumDeclaration(node) { + if (!(node.flags & 1 /* Export */)) { + emitStart(node); + write("var "); + emit(node.name); + emitEnd(node); + write(";"); + } + writeLine(); + emitStart(node); + write("(function ("); + emit(node.name); + write(") {"); + indent++; + scopeEmitStart(node); + ts.forEach(node.members, function (member) { + writeLine(); + emitStart(member); + emitNode(node.name); + write("["); + emitNode(node.name); + write("["); + emitIdentifierValue(member.name); + write("] = "); + if (member.initializer) { + emit(member.initializer); + } + else { + write(resolver.getEnumMemberValue(member).toString()); + } + write("] = "); + emitIdentifierValue(member.name); + emitEnd(member); + write(";"); + }); + indent--; + writeLine(); + emitToken(6 /* CloseBraceToken */, node.members.end); + scopeEmitEnd(); + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { + if (moduleDeclaration.body.kind === 172 /* ModuleDeclaration */) { + var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); + return recursiveInnerModule || moduleDeclaration.body; + } + } + function emitModuleDeclaration(node) { + if (!ts.isInstantiated(node)) + return; + if (!(node.flags & 1 /* Export */)) { + emitStart(node); + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); + } + emitStart(node); + write("(function ("); + emit(node.name); + write(") "); + if (node.body.kind === 173 /* ModuleBlock */) { + emit(node.body); + } + else { + write("{"); + indent++; + scopeEmitStart(node); + emitCaptureThisForNodeIfNecessary(node); + writeLine(); + emit(node.body); + indent--; + writeLine(); + var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; + emitToken(6 /* CloseBraceToken */, moduleBlock.statements.end); + scopeEmitEnd(); + } + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + function emitImportDeclaration(node) { + var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); + if (!emitImportDeclaration) { + emitImportDeclaration = !(currentSourceFile.flags & 1024 /* ExternalModule */) && resolver.isTopLevelValueImportedViaEntityName(node); + } + if (emitImportDeclaration) { + if (node.externalModuleName && node.parent.kind === 177 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.flags & 1 /* Export */) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + write(";"); + emitEnd(node); + } + } + else { + writeLine(); + emitStart(node); + if (!(node.flags & 1 /* Export */)) + write("var "); + emitModuleMemberName(node); + write(" = "); + if (node.entityName) { + emit(node.entityName); + } + else { + write("require("); + emitStart(node.externalModuleName); + write(node.externalModuleName.text); + emitEnd(node.externalModuleName); + emitToken(8 /* CloseParenToken */, node.externalModuleName.end); + } + write(";"); + emitEnd(node); + } + } + } + function getExternalImportDeclarations(node) { + var result = []; + ts.forEach(node.statements, function (stat) { + if (stat.kind === 174 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); + } + }); + return result; + } + function getFirstExportAssignment(sourceFile) { + return ts.forEach(sourceFile.statements, function (node) { + if (node.kind === 175 /* ExportAssignment */) { + return node; + } + }); + } + function emitAMDModule(node) { + var imports = getExternalImportDeclarations(node); + writeLine(); + write("define([\"require\", \"exports\""); + ts.forEach(imports, function (imp) { + write(", "); + write(imp.externalModuleName.text); + }); + ts.forEach(node.amdDependencies, function (amdDependency) { + var text = "\"" + amdDependency + "\""; + write(", "); + write(text); + }); + write("], function (require, exports"); + ts.forEach(imports, function (imp) { + write(", "); + emit(imp.name); + }); + write(") {"); + indent++; + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("return "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + indent--; + writeLine(); + write("});"); + } + function emitCommonJSModule(node) { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("module.exports = "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + } + function emitSourceFile(node) { + currentSourceFile = node; + if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */) { + writeLine(); + write("var __extends = this.__extends || function (d, b) {"); + indent++; + writeLine(); + write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); + writeLine(); + write("function __() { this.constructor = d; }"); + writeLine(); + write("__.prototype = b.prototype;"); + writeLine(); + write("d.prototype = new __();"); + indent--; + writeLine(); + write("};"); + extendsEmitted = true; + } + if (node.flags & 1024 /* ExternalModule */) { + if (compilerOptions.module === 2 /* AMD */) { + emitAMDModule(node); + } + else { + emitCommonJSModule(node); + } + } + else { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + } + } + function emitNode(node) { + if (!node || node.flags & 2 /* Ambient */) + return; + switch (node.kind) { + case 55 /* Identifier */: + return emitIdentifier(node); + case 114 /* Parameter */: + return emitParameter(node); + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return emitAccessor(node); + case 83 /* ThisKeyword */: + return emitThis(node); + case 81 /* SuperKeyword */: + return emitSuper(node); + case 79 /* NullKeyword */: + return write("null"); + case 85 /* TrueKeyword */: + return write("true"); + case 70 /* FalseKeyword */: + return write("false"); + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + case 4 /* RegularExpressionLiteral */: + return write(node.text); + case 112 /* QualifiedName */: + return emitPropertyAccess(node); + case 127 /* ArrayLiteral */: + return emitArrayLiteral(node); + case 128 /* ObjectLiteral */: + return emitObjectLiteral(node); + case 129 /* PropertyAssignment */: + return emitPropertyAssignment(node); + case 130 /* PropertyAccess */: + return emitPropertyAccess(node); + case 131 /* IndexedAccess */: + return emitIndexedAccess(node); + case 132 /* CallExpression */: + return emitCallExpression(node); + case 133 /* NewExpression */: + return emitNewExpression(node); + case 134 /* TypeAssertion */: + return emit(node.operand); + case 135 /* ParenExpression */: + return emitParenExpression(node); + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return emitFunctionDeclaration(node); + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + return emitUnaryExpression(node); + case 140 /* BinaryExpression */: + return emitBinaryExpression(node); + case 141 /* ConditionalExpression */: + return emitConditionalExpression(node); + case 143 /* Block */: + case 162 /* TryBlock */: + case 164 /* FinallyBlock */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + return emitBlock(node); + case 144 /* VariableStatement */: + return emitVariableStatement(node); + case 145 /* EmptyStatement */: + return write(";"); + case 146 /* ExpressionStatement */: + return emitExpressionStatement(node); + case 147 /* IfStatement */: + return emitIfStatement(node); + case 148 /* DoStatement */: + return emitDoStatement(node); + case 149 /* WhileStatement */: + return emitWhileStatement(node); + case 150 /* ForStatement */: + return emitForStatement(node); + case 151 /* ForInStatement */: + return emitForInStatement(node); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return emitBreakOrContinueStatement(node); + case 154 /* ReturnStatement */: + return emitReturnStatement(node); + case 155 /* WithStatement */: + return emitWithStatement(node); + case 156 /* SwitchStatement */: + return emitSwitchStatement(node); + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + return emitCaseOrDefaultClause(node); + case 159 /* LabelledStatement */: + return emitLabelledStatement(node); + case 160 /* ThrowStatement */: + return emitThrowStatement(node); + case 161 /* TryStatement */: + return emitTryStatement(node); + case 163 /* CatchBlock */: + return emitCatchBlock(node); + case 165 /* DebuggerStatement */: + return emitDebuggerStatement(node); + case 166 /* VariableDeclaration */: + return emitVariableDeclaration(node); + case 169 /* ClassDeclaration */: + return emitClassDeclaration(node); + case 171 /* EnumDeclaration */: + return emitEnumDeclaration(node); + case 172 /* ModuleDeclaration */: + return emitModuleDeclaration(node); + case 174 /* ImportDeclaration */: + return emitImportDeclaration(node); + case 177 /* SourceFile */: + return emitSourceFile(node); + } + } + if (compilerOptions.sourceMap) { + initializeEmitterWithSourceMaps(); + } + else { + initializeEmitterWithoutSourceMaps(); + } + if (root) { + emit(root); + } + else { + ts.forEach(program.getSourceFiles(), function (sourceFile) { + if (!(sourceFile.flags & (1024 /* ExternalModule */ | 512 /* DeclarationFile */))) + emit(sourceFile); + }); + } + if (output.length) { + output += "\r\n"; + } + writeEmittedFiles(); + } +})(ts || (ts = {})); +var ts; +(function (ts) { + var nextSymbolId = 1; + var nextNodeId = 1; + var nextMergeId = 1; + function createTypeChecker(program) { + var Symbol = ts.objectAllocator.getSymbolConstructor(); + var Type = ts.objectAllocator.getTypeConstructor(); + var Signature = ts.objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var emptyArray = []; + var emptySymbols = {}; + var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var stringType = createIntrinsicType(2 /* String */, "string"); + var numberType = createIntrinsicType(4 /* Number */, "number"); + var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); + var voidType = createIntrinsicType(16 /* Void */, "void"); + var undefinedType = createIntrinsicType(32 /* Undefined */, "undefined"); + var nullType = createIntrinsicType(64 /* Null */, "null"); + var unknownType = createIntrinsicType(1 /* Any */, "unknown"); + var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); + var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var globals = {}; + var globalObjectType; + var globalFunctionType; + var globalArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var stringLiteralTypes = {}; + var emitExtends = false; + var modulesVerified = false; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var diagnostics = []; + var diagnosticsModified = false; + var checker; + function addDiagnostic(diagnostic) { + diagnostics.push(diagnostic); + diagnosticsModified = true; + } + function error(location, message, arg0, arg1, arg2) { + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + addDiagnostic(diagnostic); + } + function createSymbol(flags, name) { + return new Symbol(flags, name); + } + function getExcludedSymbolFlags(flags) { + var result = 0; + if (flags & 1 /* Variable */) + result |= ts.SymbolFlags.VariableExcludes; + if (flags & 2 /* Property */) + result |= ts.SymbolFlags.PropertyExcludes; + if (flags & 4 /* EnumMember */) + result |= ts.SymbolFlags.EnumMemberExcludes; + if (flags & 8 /* Function */) + result |= ts.SymbolFlags.FunctionExcludes; + if (flags & 16 /* Class */) + result |= ts.SymbolFlags.ClassExcludes; + if (flags & 32 /* Interface */) + result |= ts.SymbolFlags.InterfaceExcludes; + if (flags & 64 /* Enum */) + result |= ts.SymbolFlags.EnumExcludes; + if (flags & 128 /* ValueModule */) + result |= ts.SymbolFlags.ValueModuleExcludes; + if (flags & 2048 /* Method */) + result |= ts.SymbolFlags.MethodExcludes; + if (flags & 8192 /* GetAccessor */) + result |= ts.SymbolFlags.GetAccessorExcludes; + if (flags & 16384 /* SetAccessor */) + result |= ts.SymbolFlags.SetAccessorExcludes; + if (flags & 262144 /* TypeParameter */) + result |= ts.SymbolFlags.TypeParameterExcludes; + if (flags & 4194304 /* Import */) + result |= ts.SymbolFlags.ImportExcludes; + return result; + } + function recordMergedSymbol(target, source) { + if (!source.mergeId) + source.mergeId = nextMergeId++; + mergedSymbols[source.mergeId] = target; + } + function cloneSymbol(symbol) { + var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + result.declarations = symbol.declarations.slice(0); + result.parent = symbol.parent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.members) + result.members = cloneSymbolTable(symbol.members); + if (symbol.exports) + result.exports = cloneSymbolTable(symbol.exports); + recordMergedSymbol(result, symbol); + return result; + } + function extendSymbol(target, source) { + if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + target.flags |= source.flags; + if (!target.valueDeclaration && source.valueDeclaration) + target.valueDeclaration = source.valueDeclaration; + ts.forEach(source.declarations, function (node) { + target.declarations.push(node); + }); + if (source.members) { + if (!target.members) + target.members = {}; + extendSymbolTable(target.members, source.members); + } + if (source.exports) { + if (!target.exports) + target.exports = {}; + extendSymbolTable(target.exports, source.exports); + } + } + else { + ts.forEach(source.declarations, function (node) { + error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + }); + } + recordMergedSymbol(target, source); + } + function cloneSymbolTable(symbolTable) { + var result = {}; + for (var id in symbolTable) { + if (ts.hasProperty(symbolTable, id)) { + result[id] = symbolTable[id]; + } + } + return result; + } + function extendSymbolTable(target, source) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + if (!ts.hasProperty(target, id)) { + target[id] = source[id]; + } + else { + var symbol = target[id]; + if (!(symbol.flags & 16777216 /* Merged */)) { + target[id] = symbol = cloneSymbol(symbol); + } + extendSymbol(symbol, source[id]); + } + } + } + } + function getSymbolLinks(symbol) { + if (symbol.flags & 33554432 /* Transient */) + return symbol; + if (!symbol.id) + symbol.id = nextSymbolId++; + return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + } + function getNodeLinks(node) { + if (!node.id) + node.id = nextNodeId++; + return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + } + function getSourceFile(node) { + return getAncestor(node, 177 /* SourceFile */); + } + function getSymbol(symbols, name, meaning) { + if (meaning && ts.hasProperty(symbols, name)) { + var symbol = symbols[name]; + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + if (symbol.flags & meaning || (symbol.flags & 4194304 /* Import */ && resolveImport(symbol).flags & meaning)) { + return symbol; + } + } + } + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { + var errorLocation = location; + var result; + var lastLocation; + var memberWithInitializerThatReferencesIdentifierFromConstructor; + function returnResolvedSymbol(s) { + if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { + var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); + return undefined; + } + if (!s && nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, nameArg); + } + return s; + } + while (location) { + if (location.locals && (location.kind !== 177 /* SourceFile */ || location.flags & 1024 /* ExternalModule */)) { + if (result = getSymbol(location.locals, name, meaning)) { + return returnResolvedSymbol(result); + } + } + switch (location.kind) { + case 177 /* SourceFile */: + if (!(location.flags & 1024 /* ExternalModule */)) + break; + case 172 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { + return returnResolvedSymbol(result); + } + break; + case 171 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { + return returnResolvedSymbol(result); + } + break; + case 115 /* Property */: + if (location.parent.kind === 169 /* ClassDeclaration */ && !(location.flags & 64 /* Static */)) { + var ctor = findConstructorDeclaration(location.parent); + if (ctor && ctor.locals) { + if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { + memberWithInitializerThatReferencesIdentifierFromConstructor = location; + } + } + } + break; + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + if (lastLocation && lastLocation.flags & 64 /* Static */) { + error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); + return undefined; + } + else { + return returnResolvedSymbol(result); + } + } + break; + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + break; + case 136 /* FunctionExpression */: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + var id = location.name; + if (id && name === id.text) { + return returnResolvedSymbol(location.symbol); + } + break; + case 163 /* CatchBlock */: + var id = location.variable; + if (name === id.text) { + return returnResolvedSymbol(location.variable.symbol); + } + break; + } + lastLocation = location; + location = location.parent; + } + if (result = getSymbol(globals, name, meaning)) { + return returnResolvedSymbol(result); + } + return returnResolvedSymbol(undefined); + } + function resolveImport(symbol) { + ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + var links = getSymbolLinks(symbol); + if (!links.target) { + links.target = resolvingSymbol; + var node = getDeclarationOfKind(symbol, 174 /* ImportDeclaration */); + var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : resolveEntityName(node, node.entityName, node.entityName.kind === 112 /* QualifiedName */ ? ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace : ts.SymbolFlags.Namespace); + if (links.target === resolvingSymbol) { + links.target = target || unknownSymbol; + } + else { + error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); + } + } + else if (links.target === resolvingSymbol) { + links.target = unknownSymbol; + } + return links.target; + } + function getFullyQualifiedName(symbol) { + return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); + } + function resolveEntityName(location, name, meaning) { + if (name.kind === 55 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (!symbol) { + return; + } + } + else if (name.kind === 112 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); + if (!namespace || name.right.kind === 111 /* Missing */) + return; + var symbol = getSymbol(namespace.exports, name.right.text, meaning); + if (!symbol) { + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + return; + } + } + else { + return; + } + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + return symbol.flags & meaning ? symbol : resolveImport(symbol); + } + function isExternalModuleNameRelative(moduleName) { + var index = moduleName.charAt(0) === '"' ? 1 : 0; + return moduleName.substr(index, 2) === "./" || moduleName.substr(index, 3) === "../"; + } + function resolveExternalModuleName(location, moduleLiteral) { + var searchPath = ts.getDirectoryPath(getSourceFile(location).filename); + var moduleName = ts.getTextOfLiteral(moduleLiteral); + if (!moduleName) + return; + var isRelative = isExternalModuleNameRelative(moduleName); + if (!isRelative) { + var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + if (symbol) { + return getResolvedExportSymbol(symbol); + } + } + while (true) { + var filename = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); + var sourceFile = program.getSourceFile(filename + ".ts") || program.getSourceFile(filename + ".d.ts"); + if (sourceFile || isRelative) + break; + var parentPath = ts.getDirectoryPath(searchPath); + if (parentPath === searchPath) + break; + searchPath = parentPath; + } + if (sourceFile) { + if (sourceFile.symbol) { + return getResolvedExportSymbol(sourceFile.symbol); + } + error(moduleLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.filename); + return; + } + error(moduleLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); + } + function getResolvedExportSymbol(moduleSymbol) { + var symbol = getExportAssignmentSymbol(moduleSymbol); + if (symbol) { + if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + return symbol; + } + if (symbol.flags & 4194304 /* Import */) { + return resolveImport(symbol); + } + } + return moduleSymbol; + } + function getExportAssignmentSymbol(symbol) { + if (!symbol.exportAssignSymbol) { + var exportInformation = collectExportInformationForSourceFileOrModule(symbol); + if (exportInformation.exportAssignments.length) { + if (exportInformation.exportAssignments.length > 1) { + ts.forEach(exportInformation.exportAssignments, function (node) { return error(node, ts.Diagnostics.A_module_cannot_have_more_than_one_export_assignment); }); + } + var node = exportInformation.exportAssignments[0]; + if (exportInformation.hasExportedMember) { + error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } + if (node.exportName.text) { + var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + } + } + symbol.exportAssignSymbol = exportSymbol || unknownSymbol; + } + return symbol.exportAssignSymbol === unknownSymbol ? undefined : symbol.exportAssignSymbol; + } + function collectExportInformationForSourceFileOrModule(symbol) { + var seenExportedMember = false; + var result = []; + ts.forEach(symbol.declarations, function (declaration) { + var block = (declaration.kind === 177 /* SourceFile */ ? declaration : declaration.body); + ts.forEach(block.statements, function (node) { + if (node.kind === 175 /* ExportAssignment */) { + result.push(node); + } + else { + seenExportedMember = seenExportedMember || (node.flags & 1 /* Export */) !== 0; + } + }); + }); + return { + hasExportedMember: seenExportedMember, + exportAssignments: result + }; + } + function getMergedSymbol(symbol) { + var merged; + return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; + } + function getSymbolOfNode(node) { + return getMergedSymbol(node.symbol); + } + function getParentOfSymbol(symbol) { + return getMergedSymbol(symbol.parent); + } + function getExportSymbolOfValueSymbolIfExported(symbol) { + return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + } + function symbolIsValue(symbol) { + if (symbol.flags & ts.SymbolFlags.Value) { + return true; + } + if (symbol.flags & 4194304 /* Import */) { + return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + } + if (symbol.flags & 8388608 /* Instantiated */) { + return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; + } + return false; + } + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + if (declaration.kind === kind) + return declaration; + } + } + function findConstructorDeclaration(node) { + var members = node.members; + for (var i = 0; i < members.length; i++) { + var member = members[i]; + if (member.kind === 117 /* Constructor */ && member.body) { + return member; + } + } + } + function createType(flags) { + var result = new Type(checker, flags); + result.id = typeCount++; + return result; + } + function createIntrinsicType(kind, intrinsicName) { + var type = createType(kind); + type.intrinsicName = intrinsicName; + return type; + } + function createObjectType(kind, symbol) { + var type = createType(kind); + type.symbol = symbol; + return type; + } + function isReservedMemberName(name) { + return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */; + } + function getNamedMembers(members) { + var result; + for (var id in members) { + if (ts.hasProperty(members, id)) { + if (!isReservedMemberName(id)) { + if (!result) + result = []; + var symbol = members[id]; + if (symbolIsValue(symbol)) { + result.push(symbol); + } + } + } + } + return result || emptyArray; + } + function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { + type.members = members; + type.properties = getNamedMembers(members); + type.callSignatures = callSignatures; + type.constructSignatures = constructSignatures; + if (stringIndexType) + type.stringIndexType = stringIndexType; + if (numberIndexType) + type.numberIndexType = numberIndexType; + return type; + } + function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { + return setObjectTypeMembers(createObjectType(8192 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function isOptionalProperty(propertySymbol) { + if (propertySymbol.flags & 67108864 /* Prototype */) { + return false; + } + return (propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */) && propertySymbol.valueDeclaration.kind !== 114 /* Parameter */; + } + function symbolToString(symbol) { + if (symbol.declarations && symbol.declarations.length > 0) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return ts.identifierToString(declaration.name); + } + } + return symbol.name; + } + function typeToString(type, printArrayAsGenericType) { + var typeStack; + return typeToString(type); + function typeToString(type) { + if (type.flags & ts.TypeFlags.Intrinsic) { + return type.intrinsicName; + } + if (type.flags & 4096 /* Reference */) { + return typeReferenceToString(type); + } + if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + return symbolToString(type.symbol); + } + if (type.flags & 8192 /* Anonymous */) { + return anonymousTypeToString(type); + } + if (type.flags & 256 /* StringLiteral */) { + return type.text; + } + return "{ ... }"; + } + function typeReferenceToString(type) { + if (type.target === globalArrayType && !printArrayAsGenericType) { + return typeToString(type.typeArguments[0]) + "[]"; + } + var result = symbolToString(type.target.symbol); + result += "<"; + for (var i = 0; i < type.typeArguments.length; i++) { + if (i > 0) + result += ", "; + result += typeToString(type.typeArguments[i]); + } + result += ">"; + return result; + } + function anonymousTypeToString(type) { + if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + return symbolTypeToString(type); + } + if (type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (typeStack && ts.contains(typeStack, type)) { + return symbolTypeToString(type); + } + } + if (!typeStack) + typeStack = []; + typeStack.push(type); + var result = literalTypeToString(type); + typeStack.pop(); + return result; + } + function symbolTypeToString(type) { + return "typeof " + symbolToString(type.symbol); + } + function literalTypeToString(type) { + var resolved = resolveObjectTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return "{}"; + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + return signatureToString(resolved.callSignatures[0], true); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + return "new " + signatureToString(resolved.constructSignatures[0], true); + } + } + var result = "{ "; + for (var i = 0; i < resolved.callSignatures.length; i++) { + result += signatureToString(resolved.callSignatures[i]); + result += "; "; + } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + result += "new "; + result += signatureToString(resolved.constructSignatures[i]); + result += "; "; + } + if (resolved.stringIndexType) { + result += "[x: string]: "; + result += typeToString(resolved.stringIndexType); + result += "; "; + } + if (resolved.numberIndexType) { + result += "[x: number]: "; + result += typeToString(resolved.numberIndexType); + result += "; "; + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); + for (var j = 0; j < signatures.length; j++) { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += signatureToString(signatures[j]); + result += "; "; + } + } + else { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += ": "; + result += typeToString(t); + result += "; "; + } + } + result += "}"; + return result; + } + function signatureToString(signature, arrowStyle) { + var result = ""; + if (signature.typeParameters) { + result += "<"; + for (var i = 0; i < signature.typeParameters.length; i++) { + if (i > 0) + result += ", "; + var tp = signature.typeParameters[i]; + result += symbolToString(tp.symbol); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + result += " extends "; + result += typeToString(constraint); + } + } + result += ">"; + } + result += "("; + for (var i = 0; i < signature.parameters.length; i++) { + if (i > 0) + result += ", "; + var p = signature.parameters[i]; + if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { + result += "..."; + } + result += symbolToString(p); + if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { + result += "?"; + } + result += ": "; + result += typeToString(getTypeOfSymbol(p)); + } + result += arrowStyle ? ") => " : "): "; + result += typeToString(getReturnTypeOfSignature(signature)); + return result; + } + } + function getApparentType(type) { + if (type.flags & 512 /* TypeParameter */) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & 512 /* TypeParameter */); + if (!type) + type = emptyObjectType; + } + if (type.flags & ts.TypeFlags.StringLike) { + type = globalStringType; + } + else if (type.flags & ts.TypeFlags.NumberLike) { + type = globalNumberType; + } + else if (type.flags & 8 /* Boolean */) { + type = globalBooleanType; + } + return type; + } + function getTypeOfPrototypeProperty(prototype) { + var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classDecl = getDeclarationOfKind(prototype.parent, 169 /* ClassDeclaration */); + return classDecl.typeParameters ? createTypeReference(classType, ts.map(classDecl.typeParameters, function (_) { return anyType; })) : classType; + } + function getTypeOfVariableDeclaration(declaration) { + var type; + if (declaration.parent.kind === 163 /* CatchBlock */ || declaration.parent.kind === 151 /* ForInStatement */) { + type = anyType; + } + else if (declaration.type) { + type = getTypeFromTypeNode(declaration.type); + } + else { + if (declaration.kind === 114 /* Parameter */ && declaration.parent.kind === 119 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 118 /* GetAccessor */); + if (getter) { + type = getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); + } + } + var unwidenedType; + if (!type) { + if (declaration.initializer) { + unwidenedType = checkAndMarkExpression(declaration.initializer); + type = getWidenedType(unwidenedType); + } + else if (declaration.flags & 8 /* Rest */) { + type = createArrayType(anyType); + } + else { + type = anyType; + } + } + if (program.getCompilerOptions().noImplicitAny && shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type, unwidenedType)) { + reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type); + } + } + return type; + function shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type, unwidenedType) { + if (type === unwidenedType) { + return false; + } + if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { + return false; + } + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 114 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + return false; + } + return true; + } + function reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type) { + var varName = ts.identifierToString(declaration.name); + var typeName = typeToString(type, false); + switch (declaration.kind) { + case 166 /* VariableDeclaration */: + error(declaration, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, varName, typeName); + break; + case 115 /* Property */: + error(declaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, varName, typeName); + break; + case 114 /* Parameter */: + var funcDeclaration = declaration.parent; + if (declaration.flags & 8 /* Rest */) { + error(declaration, ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type, varName); + } + else { + error(declaration, ts.Diagnostics.Parameter_0_implicitly_has_an_1_type, varName, typeName); + } + break; + default: + ts.Debug.fail("Received a '" + ts.SyntaxKind[declaration.kind] + "', but expected '" + ts.SyntaxKind[166 /* VariableDeclaration */] + "', '" + ts.SyntaxKind[115 /* Property */] + "', or '" + ts.SyntaxKind[114 /* Parameter */] + "'.\r\n"); + } + } + } + function getTypeOfVariableOrParameterOrProperty(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + if (symbol.flags & 67108864 /* Prototype */) { + links.type = getTypeOfPrototypeProperty(symbol); + } + else { + links.type = resolvingType; + var type = getTypeOfVariableDeclaration(symbol.valueDeclaration); + if (links.type === resolvingType) { + links.type = type; + } + } + } + else if (links.type === resolvingType) { + links.type = anyType; + } + return links.type; + } + function getSetAccessorTypeAnnotationNode(accessor) { + return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; + } + function getAnnotatedAccessorType(accessor) { + if (accessor) { + if (accessor.kind === 118 /* GetAccessor */) { + return accessor.type && getTypeFromTypeNode(accessor.type); + } + else { + var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + } + } + return undefined; + } + function getTypeOfAccessors(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = resolvingType; + var getter = getDeclarationOfKind(symbol, 118 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 119 /* SetAccessor */); + var type; + var getterReturnType = getAnnotatedAccessorType(getter); + if (getterReturnType) { + type = getterReturnType; + } + else { + var setterParameterType = getAnnotatedAccessorType(setter); + if (setterParameterType) { + type = setterParameterType; + } + else { + if (getter) { + type = getReturnTypeFromBody(getter); + } + else { + if (program.getCompilerOptions().noImplicitAny) { + error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + } + type = anyType; + } + } + } + if (links.type === resolvingType) { + links.type = type; + } + } + else if (links.type === resolvingType) { + links.type = anyType; + } + return links.type; + } + function getTypeOfFuncClassEnumModule(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + var type = links.type = createObjectType(8192 /* Anonymous */, symbol); + } + return links.type; + } + function getTypeOfEnumMember(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + } + return links.type; + } + function getTypeOfImport(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getTypeOfSymbol(resolveImport(symbol)); + } + return links.type; + } + function getTypeOfInstantiatedSymbol(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + } + return links.type; + } + function getTypeOfSymbol(symbol) { + if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + return getTypeOfVariableOrParameterOrProperty(symbol); + } + if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (symbol.flags & 4 /* EnumMember */) { + return getTypeOfEnumMember(symbol); + } + if (symbol.flags & ts.SymbolFlags.Accessor) { + return getTypeOfAccessors(symbol); + } + if (symbol.flags & 4194304 /* Import */) { + return getTypeOfImport(symbol); + } + if (symbol.flags & 8388608 /* Instantiated */) { + return getTypeOfInstantiatedSymbol(symbol); + } + return unknownType; + } + function getTargetType(type) { + return type.flags & 4096 /* Reference */ ? type.target : type; + } + function hasBaseType(type, checkBase) { + return check(type); + function check(type) { + var target = getTargetType(type); + return target === checkBase || ts.forEach(target.baseTypes, check); + } + } + function getDeclaredTypeOfClass(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var declaration = getDeclarationOfKind(symbol, 169 /* ClassDeclaration */); + var type = links.declaredType = createObjectType(1024 /* Class */, symbol); + if (declaration.typeParameters && declaration.typeParameters.length) { + type.flags |= 4096 /* Reference */; + type.typeParameters = ts.map(declaration.typeParameters, function (node) { return getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); }); + type.instantiations = {}; + type.instantiations[getTypeListId(type.typeParameters)] = type; + type.target = type; + type.typeArguments = type.typeParameters; + } + type.baseTypes = []; + if (declaration.baseType) { + var baseType = getTypeFromTypeReferenceNode(declaration.baseType); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024 /* Class */) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, false)); + } + } + else { + error(declaration.baseType, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = emptyArray; + type.declaredConstructSignatures = emptyArray; + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return links.declaredType; + } + function getDeclaredTypeOfInterface(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var firstDeclaration = getDeclarationOfKind(symbol, 170 /* InterfaceDeclaration */); + var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); + if (firstDeclaration.typeParameters && firstDeclaration.typeParameters.length) { + type.flags |= 4096 /* Reference */; + type.typeParameters = ts.map(firstDeclaration.typeParameters, function (node) { return getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); }); + type.instantiations = {}; + type.instantiations[getTypeListId(type.typeParameters)] = type; + type.target = type; + type.typeArguments = type.typeParameters; + } + type.baseTypes = []; + ts.forEach(symbol.declarations, function (declaration) { + if (declaration.kind === 170 /* InterfaceDeclaration */ && declaration.baseTypes) { + ts.forEach(declaration.baseTypes, function (node) { + var baseType = getTypeFromTypeReferenceNode(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, false)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + }); + } + }); + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + } + return links.declaredType; + } + function getDeclaredTypeOfEnum(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(128 /* Enum */); + type.symbol = symbol; + links.declaredType = type; + } + return links.declaredType; + } + function getDeclaredTypeOfTypeParameter(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(512 /* TypeParameter */); + type.symbol = symbol; + if (!getDeclarationOfKind(symbol, 113 /* TypeParameter */).constraint) { + type.constraint = noConstraintType; + } + links.declaredType = type; + } + return links.declaredType; + } + function getDeclaredTypeOfImport(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol)); + } + return links.declaredType; + } + function getDeclaredTypeOfSymbol(symbol) { + if (symbol.flags & 16 /* Class */) { + return getDeclaredTypeOfClass(symbol); + } + if (symbol.flags & 32 /* Interface */) { + return getDeclaredTypeOfInterface(symbol); + } + if (symbol.flags & 64 /* Enum */) { + return getDeclaredTypeOfEnum(symbol); + } + if (symbol.flags & 262144 /* TypeParameter */) { + return getDeclaredTypeOfTypeParameter(symbol); + } + if (symbol.flags & 4194304 /* Import */) { + return getDeclaredTypeOfImport(symbol); + } + ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); + return unknownType; + } + function createSymbolTable(symbols) { + var result = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = symbol; + } + return result; + } + function createInstantiatedSymbolTable(symbols, mapper) { + var result = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = instantiateSymbol(symbol, mapper); + } + return result; + } + function addInheritedMembers(symbols, baseSymbols) { + for (var i = 0; i < baseSymbols.length; i++) { + var s = baseSymbols[i]; + if (!ts.hasProperty(symbols, s.name)) { + symbols[s.name] = s; + } + } + } + function addInheritedSignatures(signatures, baseSignatures) { + if (baseSignatures) { + for (var i = 0; i < baseSignatures.length; i++) { + signatures.push(baseSignatures[i]); + } + } + } + function concatenateSignaturesWithIdentityCheckIgnoringReturnType(derived, base) { + var signatures = []; + for (var i = 0, len = base.length; i < len; ++i) { + var baseSignature = base[i]; + if (!ts.forEach(derived, function (s) { return isSignatureIdenticalToIgnoringReturnType(s, baseSignature); })) { + signatures.push(baseSignature); + } + } + return ts.concatenate(derived, signatures); + } + function resolveClassOrInterfaceMembers(type) { + var members = type.symbol.members; + var callSignatures = type.declaredCallSignatures; + var constructSignatures = type.declaredConstructSignatures; + var stringIndexType = type.declaredStringIndexType; + var numberIndexType = type.declaredNumberIndexType; + if (type.baseTypes.length) { + members = createSymbolTable(type.declaredProperties); + ts.forEach(type.baseTypes, function (baseType) { + addInheritedMembers(members, getPropertiesOfType(baseType)); + callSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); + constructSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); + }); + } + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function resolveTypeReferenceMembers(type) { + var target = type.target; + var mapper = createTypeMapper(target.typeParameters, type.typeArguments); + var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); + var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); + var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); + var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; + var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; + ts.forEach(target.baseTypes, function (baseType) { + var instantiatedBaseType = instantiateType(baseType, mapper); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + callSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); + constructSignatures = concatenateSignaturesWithIdentityCheckIgnoringReturnType(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); + }); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { + var sig = new Signature(checker); + sig.declaration = declaration; + sig.typeParameters = typeParameters; + sig.parameters = parameters; + sig.resolvedReturnType = resolvedReturnType; + sig.minArgumentCount = minArgumentCount; + sig.hasRestParameter = hasRestParameter; + sig.hasStringLiterals = hasStringLiterals; + return sig; + } + function cloneSignature(sig) { + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + } + function getDefaultConstructSignatures(classType) { + if (classType.baseTypes.length) { + var baseType = classType.baseTypes[0]; + var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); + return ts.map(baseSignatures, function (baseSignature) { + var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + signature.typeParameters = classType.typeParameters; + signature.resolvedReturnType = classType; + return signature; + }); + } + return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + } + function resolveAnonymousTypeMembers(type) { + var symbol = type.symbol; + var members = emptySymbols; + var callSignatures = emptyArray; + var constructSignatures = emptyArray; + if (symbol.flags & ts.SymbolFlags.HasExports) { + members = symbol.exports; + } + if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 16 /* Class */) { + var classType = getDeclaredTypeOfClass(symbol); + constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + if (!constructSignatures.length) + constructSignatures = getDefaultConstructSignatures(classType); + if (classType.baseTypes.length) { + var members = createSymbolTable(getNamedMembers(members)); + addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + } + } + var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + setObjectTypeMembers(type, members, callSignatures, constructSignatures, undefined, numberIndexType); + } + function resolveObjectTypeMembers(type) { + if (!type.members) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { + resolveClassOrInterfaceMembers(type); + } + else if (type.flags & 8192 /* Anonymous */) { + resolveAnonymousTypeMembers(type); + } + else { + resolveTypeReferenceMembers(type); + } + } + return type; + } + function getPropertiesOfType(type) { + if (type.flags & ts.TypeFlags.ObjectType) { + return resolveObjectTypeMembers(type).properties; + } + return emptyArray; + } + function getPropertyOfType(type, name) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + function getPropertyOfApparentType(type, name) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfType(globalFunctionType, name); + if (symbol) + return symbol; + } + return getPropertyOfType(globalObjectType, name); + } + } + function getSignaturesOfType(type, kind) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; + } + return emptyArray; + } + function getIndexTypeOfType(type, kind) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; + } + } + function getSignatureFromDeclaration(declaration) { + var links = getNodeLinks(declaration); + if (!links.resolvedSignature) { + var classType = declaration.kind === 117 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? ts.map(declaration.typeParameters, function (tp) { return getDeclaredTypeOfTypeParameter(tp.symbol); }) : undefined; + var parameters = []; + var hasStringLiterals = false; + var minArgumentCount = -1; + for (var i = 0, n = declaration.parameters.length; i < n; i++) { + var param = declaration.parameters[i]; + parameters.push(param.symbol); + if (param.type && param.type.kind === 3 /* StringLiteral */) { + hasStringLiterals = true; + } + if (minArgumentCount < 0) { + if (param.initializer || param.flags & (4 /* QuestionMark */ | 8 /* Rest */)) { + minArgumentCount = i; + } + } + } + if (minArgumentCount < 0) { + minArgumentCount = declaration.parameters.length; + } + var returnType; + if (classType) { + returnType = classType; + } + else if (declaration.type) { + returnType = getTypeFromTypeNode(declaration.type); + } + else { + if (declaration.kind === 118 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 119 /* SetAccessor */); + returnType = getAnnotatedAccessorType(setter); + } + if (!returnType && !declaration.body) { + returnType = anyType; + } + } + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, hasRestParameters(declaration), hasStringLiterals); + } + return links.resolvedSignature; + } + function hasRestParameters(s) { + return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; + } + function getSignaturesOfSymbol(symbol) { + if (!symbol) + return emptyArray; + var result = []; + for (var i = 0, len = symbol.declarations.length; i < len; i++) { + var node = symbol.declarations[i]; + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 116 /* Method */: + case 117 /* Constructor */: + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + if (i > 0 && node.body) { + var previous = symbol.declarations[i - 1]; + if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { + break; + } + } + result.push(getSignatureFromDeclaration(node)); + } + } + return result; + } + function getReturnTypeOfSignature(signature) { + if (!signature.resolvedReturnType) { + signature.resolvedReturnType = resolvingType; + if (signature.target) { + var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + } + else { + var type = getReturnTypeFromBody(signature.declaration); + } + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = type; + } + } + else if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = anyType; + } + return signature.resolvedReturnType; + } + function getRestTypeOfSignature(signature) { + if (signature.hasRestParameter) { + var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { + return type.typeArguments[0]; + } + } + return anyType; + } + function getSignatureInstantiation(signature, typeArguments) { + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + } + function getErasedSignature(signature) { + if (!signature.typeParameters) + return signature; + if (!signature.erasedSignatureCache) { + if (signature.target) { + signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); + } + else { + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + } + } + return signature.erasedSignatureCache; + } + function getOrCreateTypeFromSignature(signature) { + if (!signature.isolatedSignatureType) { + var isConstructor = signature.declaration.kind === 117 /* Constructor */ || signature.declaration.kind === 121 /* ConstructSignature */; + var type = createObjectType(8192 /* Anonymous */ | 16384 /* FromSignature */); + type.members = emptySymbols; + type.properties = emptyArray; + type.callSignatures = !isConstructor ? [signature] : emptyArray; + type.constructSignatures = isConstructor ? [signature] : emptyArray; + signature.isolatedSignatureType = type; + } + return signature.isolatedSignatureType; + } + function getIndexSymbol(symbol) { + return symbol.members["__index"]; + } + function getIndexDeclarationOfSymbol(symbol, kind) { + var syntaxKind = kind === 1 /* Number */ ? 108 /* NumberKeyword */ : 110 /* StringKeyword */; + var indexSymbol = getIndexSymbol(symbol); + if (indexSymbol) { + var len = indexSymbol.declarations.length; + for (var i = 0; i < len; i++) { + var node = indexSymbol.declarations[i]; + if (node.parameters.length === 1) { + var parameter = node.parameters[0]; + if (parameter && parameter.type && parameter.type.kind === syntaxKind) { + return node; + } + } + } + } + return undefined; + } + function getIndexTypeOfSymbol(symbol, kind) { + var declaration = getIndexDeclarationOfSymbol(symbol, kind); + return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; + } + function getConstraintOfTypeParameter(type) { + if (!type.constraint) { + if (type.target) { + var targetConstraint = getConstraintOfTypeParameter(type.target); + type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + } + else { + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 113 /* TypeParameter */).constraint); + } + } + return type.constraint === noConstraintType ? undefined : type.constraint; + } + function getTypeListId(types) { + switch (types.length) { + case 1: + return "" + types[0].id; + case 2: + return types[0].id + "," + types[1].id; + default: + var result = ""; + for (var i = 0; i < types.length; i++) { + if (i > 0) + result += ","; + result += types[i].id; + } + return result; + } + } + function createTypeReference(target, typeArguments) { + var id = getTypeListId(typeArguments); + var type = target.instantiations[id]; + if (!type) { + type = target.instantiations[id] = createObjectType(4096 /* Reference */, target.symbol); + type.target = target; + type.typeArguments = typeArguments; + } + return type; + } + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { + var links = getNodeLinks(typeReferenceNode); + if (links.isIllegalTypeReferenceInConstraint !== undefined) { + return links.isIllegalTypeReferenceInConstraint; + } + var currentNode = typeReferenceNode; + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + currentNode = currentNode.parent; + } + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 113 /* TypeParameter */; + return links.isIllegalTypeReferenceInConstraint; + } + function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { + var typeParameterSymbol; + function check(n) { + if (n.kind === 123 /* TypeReference */ && n.typeName.kind === 55 /* Identifier */) { + var links = getNodeLinks(n); + if (links.isIllegalTypeReferenceInConstraint === undefined) { + var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); + if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + } + } + if (links.isIllegalTypeReferenceInConstraint) { + error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); + } + } + ts.forEachChild(n, check); + } + if (typeParameter.constraint) { + typeParameterSymbol = getSymbolOfNode(typeParameter); + check(typeParameter.constraint); + } + } + function getTypeFromTypeReferenceNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + if (symbol) { + var type; + if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + type = unknownType; + } + else { + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { + var typeParameters = type.typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, ts.map(node.typeArguments, function (t) { return getTypeFromTypeNode(t); })); + } + else { + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, true), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type, false)); + type = undefined; + } + } + } + } + links.resolvedType = type || unknownType; + } + return links.resolvedType; + } + function getTypeFromTypeQueryNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getWidenedType(checkExpression(node.exprName)); + } + return links.resolvedType; + } + function getGlobalType(name, arity) { + if (arity === void 0) { arity = 0; } + function getTypeDeclaration(symbol) { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + switch (declaration.kind) { + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 125 /* TypeLiteral */: + case 167 /* FunctionDeclaration */: + return declaration; + } + } + } + var symbol = resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + if (!symbol) { + return emptyObjectType; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!(type.flags & ts.TypeFlags.ObjectType)) { + error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, name); + return emptyObjectType; + } + if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { + error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, name, arity); + return emptyObjectType; + } + return type; + } + function createArrayType(elementType) { + return globalArrayType !== emptyObjectType ? createTypeReference(globalArrayType, [elementType]) : emptyObjectType; + } + function getTypeFromArrayTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + } + return links.resolvedType; + } + function getTypeFromTypeLiteralNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = node.symbol; + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); + links.resolvedType = createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + return links.resolvedType; + } + function getStringLiteralType(node) { + var stringText = ts.getTextOfLiteral(node); + if (ts.hasProperty(stringLiteralTypes, stringText)) + return stringLiteralTypes[stringText]; + var type = stringLiteralTypes[stringText] = createType(256 /* StringLiteral */); + type.text = node.text; + return type; + } + function getTypeFromStringLiteral(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getStringLiteralType(node); + } + return links.resolvedType; + } + function getTypeFromTypeNode(node) { + switch (node.kind) { + case 101 /* AnyKeyword */: + return anyType; + case 110 /* StringKeyword */: + return stringType; + case 108 /* NumberKeyword */: + return numberType; + case 102 /* BooleanKeyword */: + return booleanType; + case 89 /* VoidKeyword */: + return voidType; + case 3 /* StringLiteral */: + return getTypeFromStringLiteral(node); + case 123 /* TypeReference */: + return getTypeFromTypeReferenceNode(node); + case 124 /* TypeQuery */: + return getTypeFromTypeQueryNode(node); + case 126 /* ArrayType */: + return getTypeFromArrayTypeNode(node); + case 125 /* TypeLiteral */: + return getTypeFromTypeLiteralNode(node); + default: + return unknownType; + } + } + function instantiateList(items, mapper, instantiator) { + if (items && items.length) { + var result = []; + for (var i = 0; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } + return items; + } + function createUnaryTypeMapper(source, target) { + return function (t) { return t === source ? target : t; }; + } + function createBinaryTypeMapper(source1, target1, source2, target2) { + return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + } + function createTypeMapper(sources, targets) { + switch (sources.length) { + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + } + return function (t) { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) + return targets[i]; + } + return t; + }; + } + function createUnaryTypeEraser(source) { + return function (t) { return t === source ? anyType : t; }; + } + function createBinaryTypeEraser(source1, source2) { + return function (t) { return t === source1 || t === source2 ? anyType : t; }; + } + function createTypeEraser(sources) { + switch (sources.length) { + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); + } + return function (t) { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) + return anyType; + } + return t; + }; + } + function createInferenceMapper(context) { + return function (t) { + for (var i = 0; i < context.typeParameters.length; i++) { + if (t === context.typeParameters[i]) { + return getInferredType(context, i); + } + } + return t; + }; + } + function identityMapper(type) { + return type; + } + function combineTypeMappers(mapper1, mapper2) { + return function (t) { return mapper2(mapper1(t)); }; + } + function instantiateTypeParameter(typeParameter, mapper) { + var result = createType(512 /* TypeParameter */); + result.symbol = typeParameter.symbol; + if (typeParameter.constraint) { + result.constraint = instantiateType(typeParameter.constraint, mapper); + } + else { + result.target = typeParameter; + result.mapper = mapper; + } + return result; + } + function instantiateSignature(signature, mapper, eraseTypeParameters) { + if (signature.typeParameters && !eraseTypeParameters) { + var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + } + var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + result.target = signature; + result.mapper = mapper; + return result; + } + function instantiateSymbol(symbol, mapper) { + if (symbol.flags & 8388608 /* Instantiated */) { + var links = getSymbolLinks(symbol); + symbol = links.target; + mapper = combineTypeMappers(links.mapper, mapper); + } + var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); + result.declarations = symbol.declarations; + result.parent = symbol.parent; + result.target = symbol; + result.mapper = mapper; + if (symbol.valueDeclaration) { + result.valueDeclaration = symbol.valueDeclaration; + } + return result; + } + function instantiateAnonymousType(type, mapper) { + var result = createObjectType(8192 /* Anonymous */, type.symbol); + result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + result.members = createSymbolTable(result.properties); + result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); + result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + result.stringIndexType = instantiateType(stringIndexType, mapper); + if (numberIndexType) + result.numberIndexType = instantiateType(numberIndexType, mapper); + return result; + } + function instantiateType(type, mapper) { + if (type.flags & 512 /* TypeParameter */) { + return mapper(type); + } + if (type.flags & 8192 /* Anonymous */) { + return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + } + if (type.flags & 4096 /* Reference */) { + return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); + } + return type; + } + function isContextSensitiveExpression(node) { + switch (node.kind) { + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); + case 128 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 129 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 127 /* ArrayLiteral */: + return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); + case 141 /* ConditionalExpression */: + return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); + case 140 /* BinaryExpression */: + return node.operator === 40 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + } + return false; + } + function getTypeWithoutConstructors(type) { + if (type.flags & ts.TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (resolved.constructSignatures.length) { + var result = createObjectType(8192 /* Anonymous */, type.symbol); + result.members = resolved.members; + result.properties = resolved.properties; + result.callSignatures = resolved.callSignatures; + result.constructSignatures = emptyArray; + type = result; + } + } + return type; + } + var subtypeRelation = {}; + var assignableRelation = {}; + function isTypeSubtypeOf(source, target) { + return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); + } + function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + } + function isTypeAssignableTo(source, target) { + return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + } + function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + } + function isTypeRelatedTo(source, target, relation) { + return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + } + function isSignatureAssignableTo(source, target) { + var sourceType = getOrCreateTypeFromSignature(source); + var targetType = getOrCreateTypeFromSignature(target); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + } + function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + var errorInfo; + var sourceStack; + var targetStack; + var expandingFlags; + var depth = 0; + var overflow = false; + var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + if (overflow) { + error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source, false), typeToString(target, false)); + } + else if (errorInfo) { + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + } + return result; + function reportError(message, arg0, arg1) { + errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1); + } + function isRelatedTo(source, target, reportErrors) { + return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); + } + function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + if (source === target) + return true; + if (target.flags & 1 /* Any */) + return true; + if (source === undefinedType) + return true; + if (source === nullType && target !== undefinedType) + return true; + if (source.flags & 128 /* Enum */ && target === numberType) + return true; + if (source.flags & 256 /* StringLiteral */ && target === stringType) + return true; + if (relation === assignableRelation) { + if (source.flags & 1 /* Any */) + return true; + if (source === numberType && target.flags & 128 /* Enum */) + return true; + } + if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { + if (typeParameterRelatedTo(source, target)) { + return true; + } + } + else { + var saveErrorInfo = errorInfo; + if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return true; + } + } + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + var apparent = getApparentType(source); + if (apparent.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(apparent, target, reportStructuralErrors)) { + errorInfo = saveErrorInfo; + return true; + } + } + if (reportErrors) { + chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; + terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; + reportError(diagnosticKey, typeToString(source, false), typeToString(target, false)); + } + return false; + } + function typesRelatedTo(sources, targets, reportErrors) { + for (var i = 0, len = sources.length; i < len; i++) { + if (!isRelatedTo(sources[i], targets[i], reportErrors)) + return false; + } + return true; + } + function typeParameterRelatedTo(source, target) { + while (true) { + var constraint = getConstraintOfTypeParameter(source); + if (constraint === target) + return true; + if (!(constraint && constraint.flags & 512 /* TypeParameter */)) + break; + source = constraint; + } + return false; + } + function objectTypeRelatedTo(source, target, reportErrors) { + if (overflow) + return false; + var result; + var id = source.id + "," + target.id; + if ((result = relation[id]) !== undefined) + return result; + if (depth > 0) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) + return true; + } + if (depth === 100) { + overflow = true; + return false; + } + } + else { + sourceStack = []; + targetStack = []; + expandingFlags = 0; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + var saveExpandingFlags = expandingFlags; + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) + expandingFlags |= 1; + if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) + expandingFlags |= 2; + result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + expandingFlags = saveExpandingFlags; + depth--; + if (depth === 0) { + relation[id] = result; + } + return result; + } + function isDeeplyNestedGeneric(type, stack) { + if (type.flags & 4096 /* Reference */ && depth >= 10) { + var target = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 4096 /* Reference */ && t.target === target) { + count++; + if (count >= 10) + return true; + } + } + } + return false; + } + function propertiesRelatedTo(source, target, reportErrors) { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfApparentType(source, targetProp.name); + if (sourceProp === targetProp) { + continue; + } + var targetPropIsOptional = isOptionalProperty(targetProp); + if (!sourceProp) { + if (!targetPropIsOptional) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source, false)); + } + return false; + } + } + else if (sourceProp !== targetProp) { + if (targetProp.flags & 67108864 /* Prototype */) { + continue; + } + if (getDeclarationFlagsFromSymbol(sourceProp) & 32 /* Private */ || getDeclarationFlagsFromSymbol(targetProp) & 32 /* Private */) { + if (reportErrors) { + reportError(ts.Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + } + return false; + } + if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + } + return false; + } + else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { + if (reportErrors) { + reportError(ts.Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source, false)); + } + return false; + } + } + } + return true; + } + function signaturesRelatedTo(source, target, kind, reportErrors) { + if (target === anyFunctionType || source === anyFunctionType) + return true; + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var saveErrorInfo = errorInfo; + outer: for (var i = 0; i < targetSignatures.length; i++) { + var t = targetSignatures[i]; + if (!t.hasStringLiterals || target.flags & 16384 /* FromSignature */) { + var localErrors = reportErrors; + for (var j = 0; j < sourceSignatures.length; j++) { + var s = sourceSignatures[j]; + if (!s.hasStringLiterals || source.flags & 16384 /* FromSignature */) { + if (signatureRelatedTo(s, t, localErrors)) { + errorInfo = saveErrorInfo; + continue outer; + } + localErrors = false; + } + } + return false; + } + } + return true; + } + function signatureRelatedTo(source, target, reportErrors) { + if (source === target) { + return true; + } + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount; + if (source.hasRestParameter && target.hasRestParameter) { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var saveErrorInfo = errorInfo; + if (!isRelatedTo(s, t, reportErrors)) { + if (!isRelatedTo(t, s, false)) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + } + return false; + } + errorInfo = saveErrorInfo; + } + } + var t = getReturnTypeOfSignature(target); + if (t === voidType) + return true; + var s = getReturnTypeOfSignature(source); + return isRelatedTo(s, t, reportErrors); + } + function stringIndexTypesRelatedTo(source, target, reportErrors) { + var targetType = getIndexTypeOfType(target, 0 /* String */); + if (targetType) { + var sourceType = getIndexTypeOfType(source, 0 /* String */); + if (!sourceType) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, false)); + } + return false; + } + if (!isRelatedTo(sourceType, targetType, reportErrors)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + function numberIndexTypesRelatedTo(source, target, reportErrors) { + var targetType = getIndexTypeOfType(target, 1 /* Number */); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, false)); + } + return false; + } + if (sourceStringType && sourceNumberType) { + var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!compatible) { + if (reportErrors) { + reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + } + function isSupertypeOfEach(candidate, types) { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + return false; + } + return true; + } + function getBestCommonType(types, contextualType, candidatesOnly) { + if (contextualType && isSupertypeOfEach(contextualType, types)) + return contextualType; + return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); + } + function isTypeOfObjectLiteral(type) { + return (type.flags & 8192 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + } + function getWidenedTypeOfObjectLiteral(type) { + var properties = getPropertiesOfType(type); + if (properties.length) { + var widenedTypes = []; + var propTypeWasWidened = false; + ts.forEach(properties, function (p) { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType, false)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members = {}; + var index = 0; + ts.forEach(properties, function (p) { + var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + if (p.valueDeclaration) + symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType) + stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) + numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + function isArrayType(type) { + return type.flags & 4096 /* Reference */ && type.target === globalArrayType; + } + function getInnermostTypeOfNestedArrayTypes(type) { + while (isArrayType(type)) { + type = type.typeArguments[0]; + } + return type; + } + function getWidenedTypeOfArrayLiteral(type) { + var elementType = type.typeArguments[0]; + var widenedType = getWidenedType(elementType); + type = elementType !== widenedType ? createArrayType(widenedType) : type; + return type; + } + function getWidenedType(type) { + if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { + return anyType; + } + if (isTypeOfObjectLiteral(type)) { + return getWidenedTypeOfObjectLiteral(type); + } + if (isArrayType(type)) { + return getWidenedTypeOfArrayLiteral(type); + } + return type; + } + function createInferenceContext(typeParameters) { + var inferences = []; + for (var i = 0; i < typeParameters.length; i++) + inferences.push([]); + return { + typeParameters: typeParameters, + inferences: inferences, + inferredTypes: new Array(typeParameters.length) + }; + } + function inferTypes(context, source, target) { + var sourceStack; + var targetStack; + var depth = 0; + inferFromTypes(source, target); + function isInProcess(source, target) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) + return true; + } + return false; + } + function isWithinDepthLimit(type, stack) { + if (depth >= 5) { + var target = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 4096 /* Reference */ && t.target === target) + count++; + } + return count < 5; + } + return true; + } + function inferFromTypes(source, target) { + if (target.flags & 512 /* TypeParameter */) { + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (target === typeParameters[i]) { + var inferences = context.inferences[i]; + if (!ts.contains(inferences, source)) + inferences.push(source); + break; + } + } + } + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + var sourceTypes = source.typeArguments; + var targetTypes = target.typeArguments; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); + } + } + else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & 4096 /* Reference */ || (target.flags & 8192 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { + if (depth === 0) { + sourceStack = []; + targetStack = []; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + inferFromProperties(source, target); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target, 0 /* String */); + inferFromIndexTypes(source, target, 1 /* Number */); + depth--; + } + } + } + function inferFromProperties(source, target) { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp) { + inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + } + } + function inferFromSignatures(source, target, kind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var sourceLen = sourceSignatures.length; + var targetLen = targetSignatures.length; + var len = sourceLen < targetLen ? sourceLen : targetLen; + for (var i = 0; i < len; i++) { + inferFromParameters(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); + } + } + function inferFromParameters(source, target) { + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount; + if (!source.hasRestParameter && !target.hasRestParameter) { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + inferFromTypes(s, t); + } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + function inferFromIndexTypes(source, target, kind) { + var targetIndexType = getIndexTypeOfType(target, kind); + if (targetIndexType) { + var sourceIndexType = getIndexTypeOfType(source, kind); + if (sourceIndexType) { + inferFromTypes(sourceIndexType, targetIndexType); + } + } + } + } + function getInferredType(context, index) { + var result = context.inferredTypes[index]; + if (!result) { + var commonType = getWidenedType(getBestCommonType(context.inferences[index])); + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; + context.inferredTypes[index] = result; + } + return result; + } + function getInferredTypes(context) { + for (var i = 0; i < context.inferredTypes.length; i++) { + getInferredType(context, i); + } + context.inferences = undefined; + return context.inferredTypes; + } + function hasAncestor(node, kind) { + return getAncestor(node, kind) !== undefined; + } + function getAncestor(node, kind) { + switch (kind) { + case 169 /* ClassDeclaration */: + while (node) { + switch (node.kind) { + case 169 /* ClassDeclaration */: + return node; + case 171 /* EnumDeclaration */: + case 170 /* InterfaceDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + else { + node = node.parent; + } + } + break; + } + return undefined; + } + function checkIdentifier(node) { + function isInTypeQuery(node) { + while (node) { + switch (node.kind) { + case 124 /* TypeQuery */: + return true; + case 55 /* Identifier */: + case 112 /* QualifiedName */: + node = node.parent; + continue; + default: + return false; + } + } + ts.Debug.fail("should not get here"); + } + var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); + if (!symbol) { + symbol = unknownSymbol; + } + if (symbol.flags & 4194304 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + } + getNodeLinks(node).resolvedSymbol = symbol; + checkCollisionWithCapturedSuperVariable(node, node); + checkCollisionWithIndexVariableInGeneratedCode(node, node); + return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); + } + function getThisContainer(node) { + while (true) { + node = node.parent; + if (!node) { + return node; + } + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 172 /* ModuleDeclaration */: + case 115 /* Property */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 171 /* EnumDeclaration */: + case 177 /* SourceFile */: + case 137 /* ArrowFunction */: + return node; + } + } + } + function captureLexicalThis(node, container) { + var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + getNodeLinks(node).flags |= 2 /* LexicalThis */; + if (container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */) { + getNodeLinks(classNode).flags |= 4 /* CaptureThis */; + } + else { + getNodeLinks(container).flags |= 4 /* CaptureThis */; + } + } + function checkThisExpression(node) { + var container = getThisContainer(node); + var needToCaptureLexicalThis = false; + while (container.kind === 137 /* ArrowFunction */) { + container = getThisContainer(container); + needToCaptureLexicalThis = true; + } + switch (container.kind) { + case 172 /* ModuleDeclaration */: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + break; + case 171 /* EnumDeclaration */: + error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + break; + case 117 /* Constructor */: + if (isInConstructorArgumentInitializer(node, container)) { + error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + } + break; + case 115 /* Property */: + if (container.flags & 64 /* Static */) { + error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); + } + break; + } + if (needToCaptureLexicalThis) { + captureLexicalThis(node, container); + } + var classNode = container.parent && container.parent.kind === 169 /* ClassDeclaration */ ? container.parent : undefined; + if (classNode) { + var symbol = getSymbolOfNode(classNode); + return container.flags & 64 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + } + return anyType; + } + function getSuperContainer(node) { + while (true) { + node = node.parent; + if (!node) + return node; + switch (node.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + case 115 /* Property */: + case 116 /* Method */: + case 117 /* Constructor */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return node; + } + } + } + function isInConstructorArgumentInitializer(node, constructorDecl) { + for (var n = node; n && n !== constructorDecl; n = n.parent) { + if (n.kind === 114 /* Parameter */) { + return true; + } + } + return false; + } + function checkSuperExpression(node, isCallExpression) { + var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + var baseClass; + if (enclosingClass && enclosingClass.baseType) { + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); + baseClass = classType.baseTypes.length && classType.baseTypes[0]; + } + if (!baseClass) { + error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + return unknownType; + } + var container = getSuperContainer(node); + if (container) { + var canUseSuperExpression = false; + if (isCallExpression) { + canUseSuperExpression = container.kind === 117 /* Constructor */; + } + else { + var needToCaptureLexicalThis = false; + while (container && container.kind === 137 /* ArrowFunction */) { + container = getSuperContainer(container); + needToCaptureLexicalThis = true; + } + if (container && container.parent && container.parent.kind === 169 /* ClassDeclaration */) { + if (container.flags & 64 /* Static */) { + canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */; + } + else { + canUseSuperExpression = container.kind === 116 /* Method */ || container.kind === 118 /* GetAccessor */ || container.kind === 119 /* SetAccessor */ || container.kind === 115 /* Property */ || container.kind === 117 /* Constructor */; + } + } + } + if (canUseSuperExpression) { + var returnType; + if ((container.flags & 64 /* Static */) || isCallExpression) { + getNodeLinks(node).flags |= 32 /* SuperStatic */; + returnType = getTypeOfSymbol(baseClass.symbol); + } + else { + getNodeLinks(node).flags |= 16 /* SuperInstance */; + returnType = baseClass; + } + if (container.kind === 117 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + returnType = unknownType; + } + if (!isCallExpression && needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + return returnType; + } + } + if (isCallExpression) { + error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } + else { + error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + } + return unknownType; + } + function isInferentialContext(mapper) { + return mapper && mapper !== identityMapper; + } + function checkArrayLiteral(node, contextualType, contextualMapper) { + var contextualElementType = contextualType && getIndexTypeOfType(contextualType, 1 /* Number */); + var elementTypes = []; + ts.forEach(node.elements, function (element) { + if (element.kind !== 142 /* OmittedExpression */) { + var type = checkExpression(element, contextualElementType, contextualMapper); + if (!ts.contains(elementTypes, type)) + elementTypes.push(type); + } + }); + var elementType = getBestCommonType(elementTypes, isInferentialContext(contextualMapper) ? undefined : contextualElementType, true); + if (!elementType) + elementType = elementTypes.length ? emptyObjectType : undefinedType; + return createArrayType(elementType); + } + function isNumericName(name) { + return !isNaN(name); + } + function getContextualTypeForProperty(type, name) { + var prop = getPropertyOfType(type, name); + if (prop) + return getTypeOfSymbol(prop); + return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); + } + function checkObjectLiteral(node, contextualType, contextualMapper) { + var members = node.symbol.members; + var properties = {}; + for (var id in members) { + if (ts.hasProperty(members, id)) { + var member = members[id]; + if (member.flags & 2 /* Property */) { + var contextualPropType = contextualType && getContextualTypeForProperty(contextualType, member.name); + var type = checkExpression(member.declarations[0].initializer, contextualPropType, contextualMapper); + var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); + prop.declarations = member.declarations; + prop.parent = member.parent; + if (member.valueDeclaration) + prop.valueDeclaration = member.valueDeclaration; + prop.type = type; + member = prop; + } + else { + var getAccessor = getDeclarationOfKind(member, 118 /* GetAccessor */); + if (getAccessor) { + checkAccessorDeclaration(getAccessor); + } + var setAccessor = getDeclarationOfKind(member, 119 /* SetAccessor */); + if (setAccessor) { + checkAccessorDeclaration(setAccessor); + } + } + properties[member.name] = member; + } + } + var stringIndexType = getIndexType(properties, 0 /* String */); + var numberIndexType = getIndexType(properties, 1 /* Number */); + return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); + function getIndexType(properties, kind) { + if (contextualType) { + var indexType = getIndexTypeOfType(contextualType, kind); + if (indexType) { + var propTypes = []; + for (var id in properties) { + if (ts.hasProperty(properties, id)) { + if (kind === 0 /* String */ || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!ts.contains(propTypes, type)) + propTypes.push(type); + } + } + } + return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); + } + } + } + } + function getDeclarationKindFromSymbol(s) { + return s.flags & 67108864 /* Prototype */ ? 115 /* Property */ : s.valueDeclaration.kind; + } + function getDeclarationFlagsFromSymbol(s) { + return s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 64 /* Static */ : s.valueDeclaration.flags; + } + function checkPropertyAccess(node) { + var type = checkExpression(node.left); + if (type === unknownType) + return type; + if (type !== anyType) { + var apparentType = getApparentType(getWidenedType(type)); + if (apparentType === unknownType) { + return unknownType; + } + var prop = getPropertyOfApparentType(apparentType, node.right.text); + if (!prop) { + if (node.right.text) { + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type, false)); + } + return unknownType; + } + getNodeLinks(node).resolvedSymbol = prop; + if (prop.parent && prop.parent.flags & 16 /* Class */) { + if (node.left.kind === 81 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 116 /* Method */) { + error(node.right, ts.Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + } + else if (getDeclarationFlagsFromSymbol(prop) & 32 /* Private */) { + var classDeclaration = getAncestor(node, 169 /* ClassDeclaration */); + if (!classDeclaration || !ts.contains(prop.parent.declarations, classDeclaration)) { + error(node, ts.Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); + } + } + } + return getTypeOfSymbol(prop); + } + return anyType; + } + function checkIndexedAccess(node) { + var objectType = checkExpression(node.object); + var indexType = checkExpression(node.index); + if (objectType === unknownType) + return unknownType; + var apparentType = getApparentType(objectType); + if (apparentType === unknownType) { + return unknownType; + } + if (node.index.kind === 3 /* StringLiteral */ || node.index.kind === 2 /* NumericLiteral */) { + var name = ts.getTextOfLiteral(node.index); + var prop = getPropertyOfApparentType(apparentType, name); + if (prop) { + return getTypeOfSymbol(prop); + } + } + if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); + if (numberIndexType) { + return numberIndexType; + } + } + var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); + if (stringIndexType) { + return stringIndexType; + } + if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + } + return anyType; + } + error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any); + return unknownType; + } + function checkUntypedCall(node) { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + return anyType; + } + function checkErrorCall(node) { + checkUntypedCall(node); + return unknownType; + } + function isCandidateSignature(node, signature) { + var args = node.arguments || emptyArray; + return args.length >= signature.minArgumentCount && (signature.hasRestParameter || args.length <= signature.parameters.length) && (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + } + function collectCandidates(node, signatures) { + var result = []; + var lastParent; + var pos; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + if (isCandidateSignature(node, signature)) { + var parent = signature.declaration ? signature.declaration.parent : undefined; + if (lastParent && parent === lastParent) { + pos++; + } + else { + lastParent = parent; + pos = 0; + } + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; + } + } + return result; + } + function inferTypeArguments(signature, args, excludeArgument) { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters); + var mapper = createInferenceMapper(context); + for (var i = 0; i < args.length; i++) { + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + } + return getInferredTypes(context); + } + function checkTypeArguments(signature, typeArguments) { + var typeParameters = signature.typeParameters; + var result = []; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + result.push(typeArgument); + } + return result; + } + function isApplicableSignature(node, signature, relation, excludeArgument) { + if (node.arguments) { + for (var i = 0; i < node.arguments.length; i++) { + var arg = node.arguments[i]; + var paramType = getTypeAtPosition(signature, i); + var argType = arg.kind === 3 /* StringLiteral */ ? getStringLiteralType(arg) : checkExpression(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + if (!isTypeRelatedTo(argType, paramType, relation)) + return false; + } + } + return true; + } + function checkCall(node, signatures) { + ts.forEach(node.typeArguments, checkSourceElement); + var candidates = collectCandidates(node, signatures); + if (!candidates.length) { + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + var args = node.arguments || emptyArray; + var excludeArgument; + for (var i = 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) + excludeArgument = new Array(args.length); + excludeArgument[i] = true; + } + } + var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; + while (true) { + for (var i = 0; i < candidates.length; i++) { + while (true) { + var candidate = candidates[i]; + if (candidate.typeParameters) { + var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); + candidate = getSignatureInstantiation(candidate, typeArguments); + } + if (!isApplicableSignature(node, candidate, relation, excludeArgument)) + break; + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return getReturnTypeOfSignature(candidate); + } + excludeArgument[index] = false; + } + } + if (relation === assignableRelation) + break; + relation = assignableRelation; + } + error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + function checkCallExpression(node) { + if (node.func.kind === 81 /* SuperKeyword */) { + var superType = checkSuperExpression(node.func, true); + if (superType !== unknownType) { + checkCall(node, getSignaturesOfType(superType, 1 /* Construct */)); + } + else { + checkUntypedCall(node); + } + return voidType; + } + var funcType = checkExpression(node.func); + if (funcType === unknownType) { + return checkErrorCall(node); + } + var apparentType = getApparentType(funcType); + if (apparentType === unknownType) { + return checkErrorCall(node); + } + var signatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (funcType === anyType || !signatures.length && isTypeAssignableTo(funcType, globalFunctionType)) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return checkUntypedCall(node); + } + if (!signatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return checkErrorCall(node); + } + return checkCall(node, signatures); + } + function checkNewExpression(node) { + var expressionType = checkExpression(node.func); + if (expressionType === unknownType) { + return checkErrorCall(node); + } + if (expressionType === anyType) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return checkUntypedCall(node); + } + expressionType = getApparentType(expressionType); + if (expressionType === unknownType) { + return checkErrorCall(node); + } + var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); + if (constructSignatures.length) { + return checkCall(node, constructSignatures); + } + var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); + if (callSignatures.length) { + var type = checkCall(node, callSignatures); + if (type !== voidType) { + error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + } + if (program.getCompilerOptions().noImplicitAny) { + error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + } + return anyType; + } + error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + return checkErrorCall(node); + } + function checkTypeAssertion(node) { + var targetType = getTypeFromTypeNode(node.type); + if (targetType === unknownType) + return unknownType; + var exprType = checkExpression(node.operand, targetType); + var widenedType = getWidenedType(exprType); + if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { + checkTypeAssignableTo(targetType, widenedType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + } + return targetType; + } + function getContextualSignature(contextualType) { + if (contextualType) { + var signatures = getSignaturesOfType(contextualType, 0 /* Call */); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } + } + function getTypeAtPosition(signature, pos) { + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + } + function assignContextualParameterTypes(signature, context, mapper) { + var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); + for (var i = 0; i < len; i++) { + var parameter = signature.parameters[i]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeAtPosition(context, i), mapper); + } + } + if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + } + } + } + function getReturnTypeFromBody(func, contextualType, contextualMapper) { + if (func.body.kind !== 168 /* FunctionBlock */) { + var unwidenedType = checkAndMarkExpression(func.body, contextualType, contextualMapper); + var widenedType = getWidenedType(unwidenedType); + if (program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType, false)); + } + return widenedType; + } + var types = []; + checkAndAggregateReturnExpressionTypes(func.body); + if (types.length) { + var commonType = getBestCommonType(types, undefined, true); + if (!commonType) { + error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); + return unknownType; + } + var widenedType = getWidenedType(commonType); + if (program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + var typeName = typeToString(widenedType, false); + if (func.name) { + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + } + else { + error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + return widenedType; + } + return voidType; + function checkAndAggregateReturnExpressionTypes(node) { + switch (node.kind) { + case 154 /* ReturnStatement */: + var expr = node.expression; + if (expr) { + var type = checkAndMarkExpression(expr, contextualType, contextualMapper); + if (!ts.contains(types, type)) + types.push(type); + } + break; + case 143 /* Block */: + case 168 /* FunctionBlock */: + case 147 /* IfStatement */: + case 148 /* DoStatement */: + case 149 /* WhileStatement */: + case 150 /* ForStatement */: + case 151 /* ForInStatement */: + case 155 /* WithStatement */: + case 156 /* SwitchStatement */: + case 157 /* CaseClause */: + case 158 /* DefaultClause */: + case 159 /* LabelledStatement */: + case 161 /* TryStatement */: + case 162 /* TryBlock */: + case 163 /* CatchBlock */: + case 164 /* FinallyBlock */: + ts.forEachChild(node, checkAndAggregateReturnExpressionTypes); + break; + } + } + } + function checkFunctionExpression(node, contextualType, contextualMapper) { + if (contextualMapper === identityMapper) + return anyFunctionType; + var type = getTypeOfSymbol(node.symbol); + var links = getNodeLinks(node); + if (!(links.flags & 1 /* TypeChecked */)) { + var signature = getSignaturesOfType(type, 0 /* Call */)[0]; + var contextualSignature = getContextualSignature(contextualType); + if (contextualSignature) { + if (!node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; })) { + assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + } + if (!node.type) { + signature.resolvedReturnType = resolvingType; + var returnType = getReturnTypeFromBody(node, getReturnTypeOfSignature(contextualSignature), contextualMapper); + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = returnType; + } + } + } + checkSignatureDeclaration(node); + if (node.body.kind === 168 /* FunctionBlock */) { + checkSourceElement(node.body); + } + else { + var returnType = getReturnTypeOfSignature(signature); + if (node.type) { + checkTypeAssignableTo(checkExpression(node.body, returnType), returnType, node.body, undefined, undefined); + } + } + links.flags |= 1 /* TypeChecked */; + } + return type; + } + function checkArithmeticOperandType(operand, type, diagnostic) { + if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + error(operand, diagnostic); + return false; + } + return true; + } + function checkReferenceExpression(n, message) { + function testSymbol(n, flags) { + var symbol = getNodeLinks(n).resolvedSymbol; + if (!symbol || symbol === unknownSymbol) { + return undefined; + } + return (getExportSymbolOfValueSymbolIfExported(symbol).flags & flags) !== 0; + } + function isReferenceExpression(n) { + switch (n.kind) { + case 55 /* Identifier */: + return testSymbol(n, 1 /* Variable */); + case 130 /* PropertyAccess */: + return testSymbol(n, ~4 /* EnumMember */); + case 131 /* IndexedAccess */: + return true; + case 135 /* ParenExpression */: + return isReferenceExpression(n.expression); + default: + return false; + } + } + if (isReferenceExpression(n) === false) { + error(n, message); + return false; + } + return true; + } + function checkPrefixExpression(node) { + var operandType = checkExpression(node.operand); + switch (node.operator) { + case 24 /* PlusToken */: + case 25 /* MinusToken */: + case 38 /* TildeToken */: + return numberType; + case 37 /* ExclamationToken */: + case 64 /* DeleteKeyword */: + return booleanType; + case 87 /* TypeOfKeyword */: + return stringType; + case 89 /* VoidKeyword */: + return undefinedType; + case 29 /* PlusPlusToken */: + case 30 /* MinusMinusToken */: + var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + return unknownType; + } + function checkPostfixExpression(node) { + var operandType = checkExpression(node.operand); + var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + function isTypeAnyTypeObjectTypeOrTypeParameter(type) { + return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); + } + function checkInstanceOfExpression(node, leftType, rightType) { + if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); + } + return booleanType; + } + function checkInExpression(node, leftType, rightType) { + if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { + error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); + } + if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + return booleanType; + } + function checkBinaryExpression(node, contextualType, contextualMapper) { + var operator = node.operator; + var leftContextualType = operator === 40 /* BarBarToken */ ? contextualType : undefined; + var leftType = checkExpression(node.left, leftContextualType, contextualMapper); + var rightContextualType = operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment ? leftType : operator === 40 /* BarBarToken */ ? contextualType || leftType : undefined; + var rightType = checkExpression(node.right, rightContextualType, contextualMapper); + switch (operator) { + case 26 /* AsteriskToken */: + case 46 /* AsteriskEqualsToken */: + case 27 /* SlashToken */: + case 47 /* SlashEqualsToken */: + case 28 /* PercentToken */: + case 48 /* PercentEqualsToken */: + case 25 /* MinusToken */: + case 45 /* MinusEqualsToken */: + case 31 /* LessThanLessThanToken */: + case 49 /* LessThanLessThanEqualsToken */: + case 32 /* GreaterThanGreaterThanToken */: + case 50 /* GreaterThanGreaterThanEqualsToken */: + case 33 /* GreaterThanGreaterThanGreaterThanToken */: + case 51 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 35 /* BarToken */: + case 53 /* BarEqualsToken */: + case 36 /* CaretToken */: + case 54 /* CaretEqualsToken */: + case 34 /* AmpersandToken */: + case 52 /* AmpersandEqualsToken */: + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) + leftType = rightType; + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) + rightType = leftType; + var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } + return numberType; + case 24 /* PlusToken */: + case 44 /* PlusEqualsToken */: + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) + leftType = rightType; + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) + rightType = leftType; + var resultType; + if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + resultType = numberType; + } + else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + resultType = stringType; + } + else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { + resultType = anyType; + } + if (!resultType) { + reportOperatorError(); + return anyType; + } + if (operator === 44 /* PlusEqualsToken */) { + checkAssignmentOperator(resultType); + } + return resultType; + case 19 /* EqualsEqualsToken */: + case 20 /* ExclamationEqualsToken */: + case 21 /* EqualsEqualsEqualsToken */: + case 22 /* ExclamationEqualsEqualsToken */: + case 15 /* LessThanToken */: + case 16 /* GreaterThanToken */: + case 17 /* LessThanEqualsToken */: + case 18 /* GreaterThanEqualsToken */: + if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + reportOperatorError(); + } + return booleanType; + case 77 /* InstanceOfKeyword */: + return checkInstanceOfExpression(node, leftType, rightType); + case 76 /* InKeyword */: + return checkInExpression(node, leftType, rightType); + case 39 /* AmpersandAmpersandToken */: + return rightType; + case 40 /* BarBarToken */: + return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : contextualType); + case 43 /* EqualsToken */: + checkAssignmentOperator(rightType); + return rightType; + case 14 /* CommaToken */: + return rightType; + } + function checkAssignmentOperator(valueType) { + if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (ok) { + checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + } + } + } + function reportOperatorError() { + error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operator), typeToString(leftType, false), typeToString(rightType, false)); + } + } + function checkConditionalExpression(node, contextualType, contextualMapper) { + checkExpression(node.condition); + var type1 = checkExpression(node.whenTrue, contextualType, contextualMapper); + var type2 = checkExpression(node.whenFalse, contextualType, contextualMapper); + var resultType = getBestCommonType([type1, type2], isInferentialContext(contextualMapper) ? undefined : contextualType, true); + if (!resultType) { + if (contextualType && !isInferentialContext(contextualMapper)) { + error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType, false), typeToString(type1, false), typeToString(type2, false)); + } + else { + error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1, false), typeToString(type2, false)); + } + resultType = emptyObjectType; + } + return resultType; + } + function checkAndMarkExpression(node, contextualType, contextualMapper) { + var result = checkExpression(node, contextualType, contextualMapper); + getNodeLinks(node).flags |= 1 /* TypeChecked */; + return result; + } + function checkExpression(node, contextualType, contextualMapper) { + switch (node.kind) { + case 55 /* Identifier */: + return checkIdentifier(node); + case 83 /* ThisKeyword */: + return checkThisExpression(node); + case 81 /* SuperKeyword */: + return checkSuperExpression(node, false); + case 79 /* NullKeyword */: + return nullType; + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + return booleanType; + case 2 /* NumericLiteral */: + return numberType; + case 3 /* StringLiteral */: + return stringType; + case 4 /* RegularExpressionLiteral */: + return globalRegExpType; + case 112 /* QualifiedName */: + return checkPropertyAccess(node); + case 127 /* ArrayLiteral */: + return checkArrayLiteral(node, contextualType, contextualMapper); + case 128 /* ObjectLiteral */: + return checkObjectLiteral(node, contextualType, contextualMapper); + case 130 /* PropertyAccess */: + return checkPropertyAccess(node); + case 131 /* IndexedAccess */: + return checkIndexedAccess(node); + case 132 /* CallExpression */: + return checkCallExpression(node); + case 133 /* NewExpression */: + return checkNewExpression(node); + case 134 /* TypeAssertion */: + return checkTypeAssertion(node); + case 135 /* ParenExpression */: + return checkExpression(node.expression); + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + return checkFunctionExpression(node, contextualType, contextualMapper); + case 138 /* PrefixOperator */: + return checkPrefixExpression(node); + case 139 /* PostfixOperator */: + return checkPostfixExpression(node); + case 140 /* BinaryExpression */: + return checkBinaryExpression(node, contextualType, contextualMapper); + case 141 /* ConditionalExpression */: + return checkConditionalExpression(node, contextualType, contextualMapper); + } + return unknownType; + } + function checkTypeParameter(node) { + checkNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); + checkSourceElement(node.constraint); + checkTypeParameterHasIllegalReferencesInConstraint(node); + } + function checkParameter(parameterDeclaration) { + checkVariableDeclaration(parameterDeclaration); + checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */) && !(parameterDeclaration.parent.kind === 117 /* Constructor */ && parameterDeclaration.parent.body)) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + if (parameterDeclaration.flags & 8 /* Rest */) { + if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { + error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + else { + if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { + error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + } + } + function checkReferencesInInitializer(n) { + if (n.kind === 55 /* Identifier */) { + var referencedSymbol = getNodeLinks(n).resolvedSymbol; + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 114 /* Parameter */) { + if (referencedSymbol.valueDeclaration === parameterDeclaration) { + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + return; + } + var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); + if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { + return; + } + } + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + } + } + else { + ts.forEachChild(n, checkReferencesInInitializer); + } + } + if (parameterDeclaration.initializer) { + checkReferencesInInitializer(parameterDeclaration.initializer); + } + } + function isTypeIdenticalTo(source, target) { + return isTypeSubtypeOf(source, target) && isTypeSubtypeOf(target, source); + } + function isSignatureIdenticalToIgnoringReturnType(source, target) { + if (source === target) { + return true; + } + if (source.hasRestParameter !== target.hasRestParameter) { + return false; + } + if (source.parameters.length !== target.parameters.length) { + return false; + } + if (source.minArgumentCount !== target.minArgumentCount) { + return false; + } + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return false; + } + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + var sourceConstraint = getConstraintOfTypeParameter(source.typeParameters[i]); + var targetConstraint = getConstraintOfTypeParameter(target.typeParameters[i]); + if (sourceConstraint === targetConstraint) { + continue; + } + if (sourceConstraint === noConstraintType || targetConstraint === noConstraintType) { + return false; + } + if (!isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } + } + } + else if (source.typeParameters || source.typeParameters) { + return false; + } + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + if (!isTypeIdenticalTo(s, t)) { + return false; + } + } + return true; + } + function checkSignatureDeclaration(node) { + ts.forEach(node.typeParameters, checkTypeParameter); + ts.forEach(node.parameters, checkParameter); + if (node.type) { + checkSourceElement(node.type); + } + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithArgumentsInGeneratedCode(node); + if (program.getCompilerOptions().noImplicitAny && !node.type) { + switch (node.kind) { + case 121 /* ConstructSignature */: + error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 120 /* CallSignature */: + error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } + } + checkSpecializedSignatureDeclaration(node); + } + function checkTypeForDuplicateIndexSignatures(node) { + if (node.kind === 170 /* InterfaceDeclaration */) { + var nodeSymbol = getSymbolOfNode(node); + if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { + return; + } + } + var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); + if (indexSymbol) { + var seenNumericIndexer = false; + var seenStringIndexer = false; + for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { + var declaration = indexSymbol.declarations[i]; + if (declaration.parameters.length == 1 && declaration.parameters[0].type) { + switch (declaration.parameters[0].type.kind) { + case 110 /* StringKeyword */: + if (!seenStringIndexer) { + seenStringIndexer = true; + } + else { + error(declaration, ts.Diagnostics.Duplicate_string_index_signature); + } + break; + case 108 /* NumberKeyword */: + if (!seenNumericIndexer) { + seenNumericIndexer = true; + } + else { + error(declaration, ts.Diagnostics.Duplicate_number_index_signature); + } + break; + } + } + } + } + } + function checkPropertyDeclaration(node) { + checkVariableDeclaration(node); + } + function checkMethodDeclaration(node) { + checkFunctionDeclaration(node); + } + function checkConstructorDeclaration(node) { + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + checkSourceElement(node.body); + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol.parent); + if (!(symbolLinks.typeChecked || type.flags & ts.TypeFlags.Intrinsic)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + if (!node.body) { + return; + } + function isSuperCallExpression(n) { + return n.kind === 132 /* CallExpression */ && n.func.kind === 81 /* SuperKeyword */; + } + function containsSuperCall(n) { + if (isSuperCallExpression(n)) { + return true; + } + switch (n.kind) { + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + case 128 /* ObjectLiteral */: + return false; + default: + return ts.forEachChild(n, containsSuperCall); + } + } + function markThisReferencesAsErrors(n) { + if (n.kind === 83 /* ThisKeyword */) { + error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + } + else if (n.kind !== 136 /* FunctionExpression */ && n.kind !== 167 /* FunctionDeclaration */) { + ts.forEachChild(n, markThisReferencesAsErrors); + } + } + function isInstancePropertyWithInitializer(n) { + return n.kind === 115 /* Property */ && !(n.flags & 64 /* Static */) && !!n.initializer; + } + if (node.parent.baseType) { + if (containsSuperCall(node.body)) { + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */); }); + if (superCallShouldBeFirst) { + var statements = node.body.statements; + if (!statements.length || statements[0].kind !== 146 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); + } + else { + markThisReferencesAsErrors(statements[0].expression); + } + } + } + else { + error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + } + } + } + function checkAccessorDeclaration(node) { + function checkGetterContainsSingleThrowStatement(node) { + var block = node.body; + return block.statements.length === 1 && block.statements[0].kind === 160 /* ThrowStatement */; + } + function checkGetterReturnsValue(n) { + switch (n.kind) { + case 154 /* ReturnStatement */: + return true; + case 136 /* FunctionExpression */: + case 167 /* FunctionDeclaration */: + case 137 /* ArrowFunction */: + case 128 /* ObjectLiteral */: + return false; + default: + return ts.forEachChild(n, checkGetterReturnsValue); + } + } + if (node.kind === 118 /* GetAccessor */) { + if (!isDeclarationContext(node) && node.body && !(checkGetterContainsSingleThrowStatement(node) || checkGetterReturnsValue(node))) { + error(node.name, ts.Diagnostics.Getters_must_return_a_value); + } + } + var otherKind = node.kind === 118 /* GetAccessor */ ? 119 /* SetAccessor */ : 118 /* GetAccessor */; + var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); + if (otherAccessor) { + var visibilityFlags = 32 /* Private */ | 16 /* Public */; + if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); + } + var thisType = getAnnotatedAccessorType(node); + var otherType = getAnnotatedAccessorType(otherAccessor); + if (thisType && otherType) { + if (!isTypeIdenticalTo(thisType, otherType)) { + error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); + } + } + } + checkFunctionDeclaration(node); + } + function checkTypeReference(node) { + var type = getTypeFromTypeReferenceNode(node); + if (type !== unknownType && node.typeArguments) { + var len = node.typeArguments.length; + for (var i = 0; i < len; i++) { + checkSourceElement(node.typeArguments[i]); + var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); + if (constraint) { + var typeArgument = type.typeArguments[i]; + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + } + function checkTypeQuery(node) { + getTypeFromTypeQueryNode(node); + } + function checkTypeLiteral(node) { + ts.forEach(node.members, checkSourceElement); + var type = getTypeFromTypeLiteralNode(node); + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } + function checkArrayType(node) { + getTypeFromArrayTypeNode(node); + } + function isPrivateWithinAmbient(node) { + return (node.flags & 32 /* Private */) && isAmbientContext(node); + } + function isAmbientContext(node) { + while (node) { + if (node.flags & 2 /* Ambient */) + return true; + node = node.parent; + } + return false; + } + function isDeclarationContext(node) { + while (node) { + if (node.flags & (2 /* Ambient */ | 512 /* DeclarationFile */)) + return true; + node = node.parent; + } + return false; + } + function checkDeclarationModifiers(node) { + if (node.flags & 1 /* Export */ && node.parent.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + } + if (node.kind === 170 /* InterfaceDeclaration */ || node.kind === 174 /* ImportDeclaration */) { + if (node.flags & 2 /* Ambient */) { + if (node.kind === 170 /* InterfaceDeclaration */) { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration); + } + else { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration); + } + } + } + else { + if (node.parent.kind === 177 /* SourceFile */) { + if (node.parent.flags & 512 /* DeclarationFile */ && !(node.flags & 2 /* Ambient */)) { + error(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + } + else { + if (isAmbientContext(node.parent) && node.flags & 2 /* Ambient */) { + error(node, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + } + } + } + function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { + var signature = getSignatureFromDeclaration(signatureDeclarationNode); + if (!signature.hasStringLiterals) { + return; + } + if (signatureDeclarationNode.body) { + error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); + return; + } + var signaturesOfSymbol = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); + for (var i = 0; i < signaturesOfSymbol.length; i++) { + var otherSignature = signaturesOfSymbol[i]; + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + return; + } + } + error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); + } + function checkFunctionOrConstructorSymbol(symbol) { + function getEffectiveFlagsForFunctionCheck(n) { + var flags = n.flags; + if (n.parent.kind !== 170 /* InterfaceDeclaration */ && isDeclarationContext(n)) { + if (!(flags & 2 /* Ambient */)) { + flags |= 1 /* Export */; + } + flags |= 2 /* Ambient */; + } + return flags & flagsToCheck; + } + function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { + var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; + if (someButNotAllOverloadFlags !== 0) { + var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; + var canonicalFlags = implementationSharesContainerWithFirstOverload ? getEffectiveFlagsForFunctionCheck(implementation) : getEffectiveFlagsForFunctionCheck(overloads[0]); + ts.forEach(overloads, function (o) { + var deviation = getEffectiveFlagsForFunctionCheck(o) ^ canonicalFlags; + if (deviation & 1 /* Export */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); + } + else if (deviation & 2 /* Ambient */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } + else if (deviation & 32 /* Private */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_or_private); + } + else if (deviation & 4 /* QuestionMark */) { + error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); + } + }); + } + } + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 4 /* QuestionMark */; + var someNodeFlags = 0; + var allNodeFlags = flagsToCheck; + var hasOverloads = false; + var bodyDeclaration; + var lastSeenNonAmbientDeclaration; + var declarations = symbol.declarations; + var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + for (var i = 0; i < declarations.length; i++) { + var node = declarations[i]; + if (node.kind === 167 /* FunctionDeclaration */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */) { + var currentNodeFlags = getEffectiveFlagsForFunctionCheck(node); + someNodeFlags |= currentNodeFlags; + allNodeFlags &= currentNodeFlags; + var inAmbientContext = isDeclarationContext(node); + var inAmbientContextOrInterface = node.parent.kind === 170 /* InterfaceDeclaration */ || node.parent.kind === 125 /* TypeLiteral */ || inAmbientContext; + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } + if (node.body) { + if (bodyDeclaration) { + if (isConstructor) { + error(node, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + } + else { + error(node, ts.Diagnostics.Duplicate_function_implementation); + } + } + else { + bodyDeclaration = node; + } + } + else { + hasOverloads = true; + } + } + } + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { + if (isConstructor) { + error(lastSeenNonAmbientDeclaration, ts.Diagnostics.Constructor_implementation_expected); + } + else { + error(lastSeenNonAmbientDeclaration, ts.Diagnostics.Function_implementation_expected); + } + } + if (hasOverloads) { + checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); + if (bodyDeclaration) { + var signatures = getSignaturesOfSymbol(symbol); + var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + if (!bodySignature.hasStringLiterals) { + for (var i = 0, len = signatures.length; i < len; ++i) { + if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { + error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + break; + } + } + } + } + } + } + function checkFunctionDeclaration(node) { + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol); + if (!(symbolLinks.typeChecked || type.flags & ts.TypeFlags.Intrinsic)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + checkSourceElement(node.body); + if (program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + if (!isPrivateWithinAmbient(node)) { + var typeName = typeToString(anyType, false); + if (node.name) { + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + } + else { + error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + } + } + function checkStatementContext(node) { + var parent = node.parent; + if ((parent.kind === 177 /* SourceFile */ || parent.kind === 173 /* ModuleBlock */) && isDeclarationContext(parent)) { + error(node, ts.Diagnostics.Statements_are_not_allowed_in_declaration_contexts); + } + } + function checkBlock(node) { + checkStatementContext(node); + ts.forEach(node.statements, checkSourceElement); + } + function checkCollisionWithArgumentsInGeneratedCode(node) { + if (!hasRestParameters(node) || isDeclarationContext(node) || !node.body) { + return; + } + ts.forEach(node.parameters, function (p) { + if (p.name && p.name.text === argumentsSymbol.name) { + error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + } + }); + } + function checkCollisionWithIndexVariableInGeneratedCode(node, name) { + if (!(name && name.text === "_i")) { + return; + } + if (node.kind === 114 /* Parameter */) { + if (node.parent.body && hasRestParameters(node.parent) && !isDeclarationContext(node)) { + error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); + } + return; + } + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol === unknownSymbol) { + return; + } + var current = node; + while (current) { + var definedOnCurrentLevel = ts.forEach(symbol.declarations, function (d) { return d.parent === current ? d : undefined; }); + if (definedOnCurrentLevel) { + return; + } + switch (current.kind) { + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 116 /* Method */: + case 137 /* ArrowFunction */: + case 117 /* Constructor */: + if (hasRestParameters(current)) { + error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); + return; + } + break; + } + current = current.parent; + } + } + function checkCollisionWithCapturedSuperVariable(node, name) { + if (!(name && name.text === "_super")) { + return; + } + if (node.kind === 115 /* Property */ || node.kind === 116 /* Method */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + return; + } + if (node.kind === 114 /* Parameter */ && !node.parent.body) { + return; + } + var enclosingClass = getAncestor(node, 169 /* ClassDeclaration */); + if (!enclosingClass || isDeclarationContext(enclosingClass)) { + return; + } + if (enclosingClass.baseType) { + var isDeclaration = node.kind !== 55 /* Identifier */; + if (isDeclaration) { + error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); + } + else { + error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); + } + } + } + function checkVariableDeclaration(node) { + checkSourceElement(node.type); + var symbol = getSymbolOfNode(node); + var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); + var type; + var useTypeFromValueDeclaration = node === symbol.valueDeclaration; + if (useTypeFromValueDeclaration) { + type = typeOfValueDeclaration; + } + else { + type = getTypeOfVariableDeclaration(node); + } + if (node.initializer) { + if (isDeclarationContext(node)) { + error(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_declaration_contexts); + } + if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { + checkTypeAssignableTo(checkAndMarkExpression(node.initializer, type), type, node, undefined, undefined); + } + } + checkCollisionWithCapturedSuperVariable(node, node.name); + if (!useTypeFromValueDeclaration) { + if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration, false), typeToString(type, false)); + } + } + } + function checkVariableStatement(node) { + checkDeclarationModifiers(node); + ts.forEach(node.declarations, checkVariableDeclaration); + } + function checkExpressionStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + } + function checkIfStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.thenStatement); + checkSourceElement(node.elseStatement); + } + function checkDoStatement(node) { + checkStatementContext(node); + checkSourceElement(node.statement); + checkExpression(node.expression); + } + function checkWhileStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.statement); + } + function checkForStatement(node) { + checkStatementContext(node); + if (node.declarations) + ts.forEach(node.declarations, checkVariableDeclaration); + if (node.initializer) + checkExpression(node.initializer); + if (node.condition) + checkExpression(node.condition); + if (node.iterator) + checkExpression(node.iterator); + checkSourceElement(node.statement); + } + function checkForInStatement(node) { + checkStatementContext(node); + if (node.declaration) { + checkVariableDeclaration(node.declaration); + if (node.declaration.type) { + error(node.declaration, ts.Diagnostics.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation); + } + } + if (node.variable) { + var exprType = checkExpression(node.variable); + if (exprType !== anyType && exprType !== stringType) { + error(node.variable, ts.Diagnostics.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any); + } + else { + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + } + } + var exprType = checkExpression(node.expression); + if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + checkSourceElement(node.statement); + } + function checkBreakOrContinueStatement(node) { + checkStatementContext(node); + } + function getContainingFunction(node) { + while (true) { + node = node.parent; + if (!node || node.kind === 167 /* FunctionDeclaration */ || node.kind === 136 /* FunctionExpression */ || node.kind === 137 /* ArrowFunction */ || node.kind === 116 /* Method */ || node.kind === 117 /* Constructor */ || node.kind === 118 /* GetAccessor */ || node.kind === 119 /* SetAccessor */) { + return node; + } + } + } + function checkReturnStatement(node) { + checkStatementContext(node); + if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { + var func = getContainingFunction(node); + if (func) { + if (func.kind === 119 /* SetAccessor */) { + if (node.expression) { + error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); + } + } + else { + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); + var checkAssignability = func.type || (func.kind === 118 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 119 /* SetAccessor */))); + if (checkAssignability) { + checkTypeAssignableTo(checkExpression(node.expression, returnType), returnType, node.expression, undefined, undefined); + } + else if (func.kind == 117 /* Constructor */) { + if (!isTypeAssignableTo(checkExpression(node.expression, returnType), returnType)) { + error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } + } + } + } + else { + error(node, ts.Diagnostics.return_statement_has_no_containing_function); + } + } + } + function checkWithStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + checkSourceElement(node.statement); + } + function checkSwitchStatement(node) { + checkStatementContext(node); + var expressionType = checkExpression(node.expression); + ts.forEach(node.clauses, function (clause) { + if (clause.expression) { + var caseType = checkExpression(clause.expression); + if (!isTypeAssignableTo(expressionType, caseType)) { + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + } + } + checkBlock(clause); + }); + } + function checkLabelledStatement(node) { + checkStatementContext(node); + checkSourceElement(node.statement); + } + function checkThrowStatement(node) { + checkStatementContext(node); + checkExpression(node.expression); + } + function checkTryStatement(node) { + checkStatementContext(node); + checkBlock(node.tryBlock); + if (node.catchBlock) + checkBlock(node.catchBlock); + if (node.finallyBlock) + checkBlock(node.finallyBlock); + } + function checkIndexConstraints(type) { + function checkIndexConstraintForProperty(prop, propertyType, indexDeclaration, indexType, indexKind) { + if (!indexType) { + return; + } + if (indexKind === 1 /* Number */ && !isNumericName(prop.name)) { + return; + } + var errorNode; + if (prop.parent === type.symbol) { + errorNode = prop.valueDeclaration; + } + else if (indexDeclaration) { + errorNode = indexDeclaration; + } + else if (type.flags & 2048 /* Interface */) { + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; + } + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { + var errorMessage = indexKind === 0 /* String */ ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType, false), typeToString(indexType, false)); + } + } + var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); + var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); + if (stringIndexType || numberIndexType) { + ts.forEach(getPropertiesOfType(type), function (prop) { + var propType = getTypeOfSymbol(prop); + checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); + }); + } + var errorNode; + if (stringIndexType && numberIndexType) { + errorNode = declaredNumberIndexer || declaredStringIndexer; + if (!errorNode && (type.flags & 2048 /* Interface */)) { + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); + errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; + } + } + if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { + error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType, false), typeToString(stringIndexType, false)); + } + } + function checkNameIsReserved(name, message) { + switch (name.text) { + case "any": + case "number": + case "boolean": + case "string": + case "void": + error(name, message, name.text); + return true; + } + } + function checkClassDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); + ts.forEach(node.typeParameters, checkTypeParameter); + var symbol = getSymbolOfNode(node); + var type = getDeclaredTypeOfSymbol(symbol); + var staticType = getTypeOfSymbol(symbol); + if (node.baseType) { + emitExtends = emitExtends || !isDeclarationContext(node); + checkTypeReference(node.baseType); + } + if (type.baseTypes.length) { + var baseType = type.baseTypes[0]; + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var staticBaseType = getTypeOfSymbol(baseType.symbol); + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType, false)); + } + checkExpression(node.baseType.typeName); + checkKindsOfPropertyMemberOverrides(type, baseType); + } + if (node.implementedTypes) { + ts.forEach(node.implementedTypes, function (typeRefNode) { + checkTypeReference(typeRefNode); + var t = getTypeFromTypeReferenceNode(typeRefNode); + if (t !== unknownType) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + } + else { + error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + } + } + }); + } + checkIndexConstraints(type); + ts.forEach(node.members, checkSourceElement); + checkTypeForDuplicateIndexSignatures(node); + } + function checkKindsOfPropertyMemberOverrides(type, baseType) { + function getTargetSymbol(s) { + return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + } + var baseProperties = getPropertiesOfType(baseType); + for (var i = 0, len = baseProperties.length; i < len; ++i) { + var base = getTargetSymbol(baseProperties[i]); + if (base.flags & 67108864 /* Prototype */) { + continue; + } + var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + if (derived) { + var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); + var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); + if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { + continue; + } + if ((baseDeclarationFlags & 64 /* Static */) !== (derivedDeclarationFlags & 64 /* Static */)) { + continue; + } + if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + continue; + } + var errorMessage; + if (base.flags & 2048 /* Method */) { + if (derived.flags & ts.SymbolFlags.Accessor) { + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; + } + else { + ts.Debug.assert(derived.flags & 2 /* Property */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; + } + } + else if (base.flags & 2 /* Property */) { + ts.Debug.assert(derived.flags & 2048 /* Method */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; + } + else { + ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); + ts.Debug.assert(derived.flags & 2048 /* Method */); + errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; + } + error(derived.valueDeclaration.name, errorMessage, typeToString(baseType, false), symbolToString(base), typeToString(type, false)); + } + } + } + function isAccessor(kind) { + return kind === 118 /* GetAccessor */ || kind === 119 /* SetAccessor */; + } + function areTypeParameterDeclarationsPairwiseIdentical(list1, list2) { + if (!list1 && !list2) { + return true; + } + if (!list1 || !list2 || list1.length !== list2.length) { + return false; + } + for (var i = 0, len = list1.length; i < len; ++i) { + if (list1[i].name.text !== list2[i].name.text) { + return false; + } + if (!list1[i].constraint && !list2[i].constraint) { + continue; + } + if (!list1[i].constraint || !list2[i].constraint) { + return false; + } + var t1 = getTypeFromTypeNode(list1[i].constraint); + var t2 = getTypeFromTypeNode(list2[i].constraint); + if (!isTypeIdenticalTo(t1, t2)) { + return false; + } + } + return true; + } + function checkInterfaceDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); + ts.forEach(node.typeParameters, checkTypeParameter); + var declarations = node.symbol.declarations; + if (declarations.length > 1) { + var firstInterfaceDecl; + for (var i = 0, len = declarations.length; i < len; ++i) { + if (declarations[i].kind === 170 /* InterfaceDeclaration */) { + firstInterfaceDecl = declarations[i]; + break; + } + } + if (node !== firstInterfaceDecl && !areTypeParameterDeclarationsPairwiseIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { + error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + } + } + var symbol = getSymbolOfNode(node); + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + var type = getDeclaredTypeOfSymbol(symbol); + ts.forEach(type.baseTypes, function (baseType) { + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + }); + checkIndexConstraints(type); + links.typeChecked = true; + } + ts.forEach(node.baseTypes, checkTypeReference); + ts.forEach(node.members, checkSourceElement); + checkTypeForDuplicateIndexSignatures(node); + } + function getConstantValue(node) { + if (node.kind === 2 /* NumericLiteral */) + return +node.text; + if (node.kind === 138 /* PrefixOperator */ && node.operator === 25 /* MinusToken */) { + node = node.operand; + if (node.kind === 2 /* NumericLiteral */) + return -node.text; + } + } + function checkEnumDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); + var enumType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); + var autoValue = 0; + var ambient = isDeclarationContext(node); + ts.forEach(node.members, function (member) { + var initializer = member.initializer; + if (initializer) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); + } + if (ambient) { + if (initializer) { + var value = getConstantValue(initializer); + if (value !== undefined) { + getNodeLinks(member).enumMemberValue = value; + } + else { + error(initializer, ts.Diagnostics.In_an_enum_declaration_context_initializer_must_be_a_number_literal); + } + } + } + else { + if (initializer) { + autoValue = initializer.kind === 2 /* NumericLiteral */ ? +initializer.text : undefined; + } + else if (autoValue === undefined) { + error(member, ts.Diagnostics.Enum_member_must_have_initializer); + autoValue = 0; + } + if (!initializer || initializer.kind === 2 /* NumericLiteral */) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + } + }); + } + function checkModuleDeclaration(node) { + checkDeclarationModifiers(node); + if (node.name.kind === 3 /* StringLiteral */) { + if (!isDeclarationContext(node)) { + error(node, ts.Diagnostics.Ambient_external_modules_require_a_declare_modifier); + } + if (node.parent.kind !== 177 /* SourceFile */ || node.parent.flags & 1024 /* ExternalModule */) { + error(node, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + } + if (isExternalModuleNameRelative(node.name.text)) { + error(node, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + } + var symbol = getSymbolOfNode(node); + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + getExportAssignmentSymbol(symbol); + links.typeChecked = true; + } + } + checkSourceElement(node.body); + } + function checkImportDeclaration(node) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); + var symbol = getSymbolOfNode(node); + var target; + if (node.entityName) { + target = resolveImport(symbol); + if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { + checkExpression(node.entityName); + } + } + else { + if (node.parent.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + target = resolveImport(symbol); + } + else if (node.parent.kind === 173 /* ModuleBlock */ && node.parent.parent.name.kind === 3 /* StringLiteral */) { + if (isExternalModuleNameRelative(node.externalModuleName.text)) { + error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + target = unknownSymbol; + } + else { + target = resolveImport(symbol); + } + } + else { + target = unknownSymbol; + } + } + if (target !== unknownSymbol) { + var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + if (target.flags & excludedMeanings) { + error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); + } + } + } + function checkModulesEnabled(node) { + if (!modulesVerified) { + if (!program.getCompilerOptions().module) { + error(node, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided); + } + modulesVerified = true; + } + } + function checkExportAssignment(node) { + var container = node.parent; + if (container.kind === 177 /* SourceFile */) { + checkModulesEnabled(node); + } + } + function checkSourceElement(node) { + if (!node) + return; + switch (node.kind) { + case 113 /* TypeParameter */: + return checkTypeParameter(node); + case 114 /* Parameter */: + return checkParameter(node); + case 115 /* Property */: + return checkPropertyDeclaration(node); + case 120 /* CallSignature */: + case 121 /* ConstructSignature */: + case 122 /* IndexSignature */: + return checkSignatureDeclaration(node); + case 116 /* Method */: + return checkMethodDeclaration(node); + case 117 /* Constructor */: + return checkConstructorDeclaration(node); + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + return checkAccessorDeclaration(node); + case 123 /* TypeReference */: + return checkTypeReference(node); + case 124 /* TypeQuery */: + return checkTypeQuery(node); + case 125 /* TypeLiteral */: + return checkTypeLiteral(node); + case 126 /* ArrayType */: + return checkArrayType(node); + case 167 /* FunctionDeclaration */: + return checkFunctionDeclaration(node); + case 143 /* Block */: + case 168 /* FunctionBlock */: + case 173 /* ModuleBlock */: + return checkBlock(node); + case 144 /* VariableStatement */: + return checkVariableStatement(node); + case 146 /* ExpressionStatement */: + return checkExpressionStatement(node); + case 147 /* IfStatement */: + return checkIfStatement(node); + case 148 /* DoStatement */: + return checkDoStatement(node); + case 149 /* WhileStatement */: + return checkWhileStatement(node); + case 150 /* ForStatement */: + return checkForStatement(node); + case 151 /* ForInStatement */: + return checkForInStatement(node); + case 152 /* ContinueStatement */: + case 153 /* BreakStatement */: + return checkBreakOrContinueStatement(node); + case 154 /* ReturnStatement */: + return checkReturnStatement(node); + case 155 /* WithStatement */: + return checkWithStatement(node); + case 156 /* SwitchStatement */: + return checkSwitchStatement(node); + case 159 /* LabelledStatement */: + return checkLabelledStatement(node); + case 160 /* ThrowStatement */: + return checkThrowStatement(node); + case 161 /* TryStatement */: + return checkTryStatement(node); + case 166 /* VariableDeclaration */: + return checkVariableDeclaration(node); + case 169 /* ClassDeclaration */: + return checkClassDeclaration(node); + case 170 /* InterfaceDeclaration */: + return checkInterfaceDeclaration(node); + case 171 /* EnumDeclaration */: + return checkEnumDeclaration(node); + case 172 /* ModuleDeclaration */: + return checkModuleDeclaration(node); + case 174 /* ImportDeclaration */: + return checkImportDeclaration(node); + case 175 /* ExportAssignment */: + return checkExportAssignment(node); + } + } + function checkSourceFile(node) { + var links = getNodeLinks(node); + if (!(links.flags & 1 /* TypeChecked */)) { + emitExtends = false; + ts.forEach(node.statements, checkSourceElement); + if (node.flags & 1024 /* ExternalModule */) { + var symbol = getExportAssignmentSymbol(node.symbol); + if (symbol && symbol.flags & 4194304 /* Import */) { + getSymbolLinks(symbol).referenced = true; + } + } + if (emitExtends) + links.flags |= 8 /* EmitExtends */; + links.flags |= 1 /* TypeChecked */; + } + } + function checkProgram() { + ts.forEach(program.getSourceFiles(), checkSourceFile); + } + function getSortedDiagnostics() { + if (diagnosticsModified) { + diagnostics.sort(ts.compareDiagnostics); + diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); + diagnosticsModified = false; + } + return diagnostics; + } + function getDiagnostics(sourceFile) { + if (sourceFile) { + checkSourceFile(sourceFile); + return ts.filter(getSortedDiagnostics(), function (d) { return d.file === sourceFile; }); + } + checkProgram(); + return getSortedDiagnostics(); + } + function getGlobalDiagnostics() { + return ts.filter(getSortedDiagnostics(), function (d) { return !d.file; }); + } + function getNodeAtPosition(sourceFile, position) { + function findChildAtPosition(parent) { + var child = ts.forEachChild(parent, function (node) { + if (position >= node.pos && position <= node.end && position >= ts.getTokenPosOfNode(node)) { + return findChildAtPosition(node); + } + }); + return child || parent; + } + if (position < sourceFile.pos) + position = sourceFile.pos; + if (position > sourceFile.end) + position = sourceFile.end; + return findChildAtPosition(sourceFile); + } + function getSymbolsInScope(location, meaning) { + var symbols = {}; + var memberFlags = 0; + function copySymbol(symbol, meaning) { + if (symbol.flags & meaning) { + var id = symbol.name; + if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) { + symbols[id] = symbol; + } + } + } + function copySymbols(source, meaning) { + if (meaning) { + for (var id in source) { + if (ts.hasProperty(source, id)) { + copySymbol(source[id], meaning); + } + } + } + } + while (location) { + if (location.locals && (location.kind !== 177 /* SourceFile */ || location.flags & 1024 /* ExternalModule */)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case 177 /* SourceFile */: + if (!(location.flags & 1024 /* ExternalModule */)) + break; + case 172 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + break; + case 171 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + break; + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + if (!(memberFlags & 64 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + } + break; + case 136 /* FunctionExpression */: + if (location.name) { + copySymbol(location.symbol, meaning); + } + break; + case 163 /* CatchBlock */: + if (location.variable.text) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + return ts.mapToArray(symbols); + } + function isDeclarationIdentifier(identifier) { + if (identifier.parent) { + switch (identifier.parent.kind) { + case 113 /* TypeParameter */: + case 114 /* Parameter */: + case 166 /* VariableDeclaration */: + case 115 /* Property */: + case 129 /* PropertyAssignment */: + case 176 /* EnumMember */: + case 116 /* Method */: + case 167 /* FunctionDeclaration */: + case 136 /* FunctionExpression */: + case 118 /* GetAccessor */: + case 119 /* SetAccessor */: + case 169 /* ClassDeclaration */: + case 170 /* InterfaceDeclaration */: + case 171 /* EnumDeclaration */: + case 172 /* ModuleDeclaration */: + case 174 /* ImportDeclaration */: + return identifier.parent.name === identifier; + case 163 /* CatchBlock */: + return identifier.parent.variable === identifier; + } + } + return false; + } + function isTypeReferenceIdentifier(identifier) { + var node = identifier; + while (node.parent && node.parent.kind === 112 /* QualifiedName */) + node = node.parent; + return node.parent && node.parent.kind === 123 /* TypeReference */; + } + function isExpression(node) { + switch (node.kind) { + case 83 /* ThisKeyword */: + case 81 /* SuperKeyword */: + case 79 /* NullKeyword */: + case 85 /* TrueKeyword */: + case 70 /* FalseKeyword */: + case 4 /* RegularExpressionLiteral */: + case 127 /* ArrayLiteral */: + case 128 /* ObjectLiteral */: + case 130 /* PropertyAccess */: + case 131 /* IndexedAccess */: + case 132 /* CallExpression */: + case 133 /* NewExpression */: + case 134 /* TypeAssertion */: + case 135 /* ParenExpression */: + case 136 /* FunctionExpression */: + case 137 /* ArrowFunction */: + case 138 /* PrefixOperator */: + case 139 /* PostfixOperator */: + case 140 /* BinaryExpression */: + case 141 /* ConditionalExpression */: + return true; + case 112 /* QualifiedName */: + while (node.parent && node.parent.kind === 112 /* QualifiedName */) + node = node.parent; + return node.parent && node.parent.kind === 124 /* TypeQuery */; + case 55 /* Identifier */: + case 2 /* NumericLiteral */: + case 3 /* StringLiteral */: + var parent = node.parent; + if (parent) { + if (isExpression(parent)) + return true; + switch (parent.kind) { + case 166 /* VariableDeclaration */: + case 114 /* Parameter */: + case 115 /* Property */: + case 176 /* EnumMember */: + return parent.initializer === node; + case 146 /* ExpressionStatement */: + case 147 /* IfStatement */: + case 148 /* DoStatement */: + case 149 /* WhileStatement */: + case 154 /* ReturnStatement */: + case 155 /* WithStatement */: + case 156 /* SwitchStatement */: + case 157 /* CaseClause */: + case 160 /* ThrowStatement */: + case 156 /* SwitchStatement */: + return parent.expression === node; + case 150 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 151 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + } + } + } + return false; + } + function getSymbolOfIdentifier(identifier) { + if (isExpression(identifier)) { + if (isRightSideOfQualifiedName()) { + } + return resolveEntityName(identifier, identifier, ts.SymbolFlags.Value); + } + if (isDeclarationIdentifier(identifier)) { + return getSymbolOfNode(identifier.parent); + } + if (isTypeReferenceIdentifier(identifier)) { + var entityName = isRightSideOfQualifiedName() ? identifier.parent : identifier; + var meaning = entityName.parent.kind === 123 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; + return resolveEntityName(entityName, entityName, meaning); + } + function isRightSideOfQualifiedName() { + return (identifier.parent.kind === 112 /* QualifiedName */ || identifier.parent.kind === 130 /* PropertyAccess */) && identifier.parent.right === identifier; + } + } + function getModuleObjectName(node) { + return ts.getSourceTextOfNode(node.name); + } + function isExternalModule(symbol) { + return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 177 /* SourceFile */; + } + function getExpressionNamePrefix(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); + var isExportedSymbolFoundInLocalScope = exportSymbol !== symbol; + var shouldEmitExportWithoutPrefix = (exportSymbol.flags & ts.SymbolFlags.ExportHasLocal) !== 0; + if (isExportedSymbolFoundInLocalScope && !shouldEmitExportWithoutPrefix) { + symbol = exportSymbol; + } + if (symbol.parent) { + return isExternalModule(symbol.parent) ? "exports" : symbolToString(symbol.parent); + } + } + } + function getPropertyAccessSubstitution(node) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & 4 /* EnumMember */)) { + var declaration = symbol.valueDeclaration; + var constantValue; + if (declaration.kind === 176 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue.toString() + " /* " + ts.identifierToString(declaration.name) + " */"; + } + } + } + function getExportAssignmentName(node) { + var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); + return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + } + function isTopLevelValueImportedViaEntityName(node) { + if (node.parent.kind !== 177 /* SourceFile */ || !node.entityName) { + return false; + } + var symbol = getSymbolOfNode(node); + var target = resolveImport(symbol); + return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + } + function isReferencedImportDeclaration(node) { + var symbol = getSymbolOfNode(node); + if (getSymbolLinks(symbol).referenced) { + return true; + } + if (node.flags & 1 /* Export */) { + var target = resolveImport(symbol); + if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { + return true; + } + } + return false; + } + function getNodeCheckFlags(node) { + return getNodeLinks(node).flags; + } + function getEnumMemberValue(node) { + return getNodeLinks(node).enumMemberValue; + } + function invokeEmitter() { + var resolver = { + getProgram: function () { return program; }, + getModuleObjectName: getModuleObjectName, + getExpressionNamePrefix: getExpressionNamePrefix, + getPropertyAccessSubstitution: getPropertyAccessSubstitution, + getExportAssignmentName: getExportAssignmentName, + isReferencedImportDeclaration: isReferencedImportDeclaration, + getNodeCheckFlags: getNodeCheckFlags, + getEnumMemberValue: getEnumMemberValue, + isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName + }; + checkProgram(); + return ts.emitFiles(resolver); + } + function initializeTypeChecker() { + ts.forEach(program.getSourceFiles(), function (file) { + ts.bindSourceFile(file); + ts.forEach(file.semanticErrors, addDiagnostic); + }); + ts.forEach(program.getSourceFiles(), function (file) { + if (!(file.flags & 1024 /* ExternalModule */)) { + extendSymbolTable(globals, file.locals); + } + }); + getSymbolLinks(undefinedSymbol).type = undefinedType; + getSymbolLinks(argumentsSymbol).type = anyType; + getSymbolLinks(unknownSymbol).type = unknownType; + globals[undefinedSymbol.name] = undefinedSymbol; + globalObjectType = getGlobalType("Object"); + globalFunctionType = getGlobalType("Function"); + globalArrayType = getGlobalType("Array", 1); + globalStringType = getGlobalType("String"); + globalNumberType = getGlobalType("Number"); + globalBooleanType = getGlobalType("Boolean"); + globalRegExpType = getGlobalType("RegExp"); + } + initializeTypeChecker(); + checker = { + getProgram: function () { return program; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, + getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, + getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, + getTypeCount: function () { return typeCount; }, + checkProgram: checkProgram, + emitFiles: invokeEmitter, + getSymbolOfNode: getSymbolOfNode, + getParentOfSymbol: getParentOfSymbol, + getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, + getPropertiesOfType: getPropertiesOfType, + getSignaturesOfType: getSignaturesOfType, + getIndexTypeOfType: getIndexTypeOfType, + getReturnTypeOfSignature: getReturnTypeOfSignature, + resolveEntityName: resolveEntityName, + getSymbolsInScope: getSymbolsInScope, + getSymbolOfIdentifier: getSymbolOfIdentifier + }; + return checker; + } + ts.createTypeChecker = createTypeChecker; +})(ts || (ts = {})); +var ts; +(function (ts) { + var shortOptionNames = { + "d": "declaration", + "h": "help", + "m": "module", + "o": "out", + "t": "target", + "v": "version" + }; + var options = [ + { name: "codepage", type: "number" }, + { name: "declaration", type: "boolean" }, + { name: "diagnostics", type: "boolean" }, + { name: "help", type: "boolean" }, + { name: "locale", type: "string" }, + { name: "mapRoot", type: "string" }, + { name: "module", type: { "commonjs": 1 /* CommonJS */, "amd": 2 /* AMD */ }, error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { name: "noImplicitAny", type: "boolean" }, + { name: "noLib", type: "boolean" }, + { name: "noLibCheck", type: "boolean" }, + { name: "noResolve", type: "boolean" }, + { name: "out", type: "string" }, + { name: "outDir", type: "string" }, + { name: "removeComments", type: "boolean" }, + { name: "sourceMap", type: "boolean" }, + { name: "sourceRoot", type: "string" }, + { name: "target", type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 }, + { name: "version", type: "boolean" } + ]; + var optionDeclarations = {}; + ts.forEach(options, function (option) { + optionDeclarations[option.name.toLowerCase()] = option; + }); + function parseCommandLine(commandLine) { + var options = { + target: 0 /* ES3 */ + }; + var filenames = []; + var errors = []; + parseStrings(commandLine); + return { + options: options, + filenames: filenames, + errors: errors + }; + function parseStrings(args) { + var i = 0; + while (i < args.length) { + var s = args[i++]; + if (s.charCodeAt(0) === 64 /* at */) { + parseResponseFile(s.slice(1)); + } + else if (s.charCodeAt(0) === 45 /* minus */) { + s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); + if (ts.hasProperty(shortOptionNames, s)) { + s = shortOptionNames[s]; + } + if (ts.hasProperty(optionDeclarations, s)) { + var opt = optionDeclarations[s]; + if (!args[i] && opt.type !== "boolean") { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); + } + switch (opt.type) { + case "number": + options[opt.name] = parseInt(args[i++]); + break; + case "boolean": + options[opt.name] = true; + break; + case "string": + options[opt.name] = args[i++] || ""; + break; + default: + var value = (args[i++] || "").toLowerCase(); + if (ts.hasProperty(opt.type, value)) { + options[opt.name] = opt.type[value]; + } + else { + errors.push(ts.createCompilerDiagnostic(opt.error)); + } + } + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); + } + } + else { + filenames.push(s); + } + } + } + function parseResponseFile(filename) { + var text = sys.readFile(filename); + if (!text) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, filename)); + return; + } + var args = []; + var pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) + pos++; + if (pos >= text.length) + break; + var start = pos; + if (text.charCodeAt(start) === 34 /* doubleQuote */) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) + pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } + else { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, filename)); + } + } + else { + while (text.charCodeAt(pos) > 32 /* space */) + pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } + ts.parseCommandLine = parseCommandLine; +})(ts || (ts = {})); +var ts; +(function (ts) { + function validateLocaleAndSetLanguage(locale, errors) { + var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); + if (!matchResult) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, 'en', 'ja-jp')); + return false; + } + var language = matchResult[1]; + var territory = matchResult[3]; + if (!trySetLanguageAndTerritory(language, territory, errors) && !trySetLanguageAndTerritory(language, undefined, errors)) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_locale_0, locale)); + return false; + } + return true; + } + function trySetLanguageAndTerritory(language, territory, errors) { + var compilerFilePath = sys.getExecutingFilePath(); + var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath); + var filePath = ts.combinePaths(containingDirectoryPath, language); + if (territory) { + filePath = filePath + "-" + territory; + } + filePath = sys.resolvePath(ts.combinePaths(filePath, "diagnosticMessages.generated.json")); + if (!sys.fileExists(filePath)) { + return false; + } + try { + var fileContents = sys.readFile(filePath); + } + catch (e) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath)); + return false; + } + try { + ts.localizedDiagnosticMessages = JSON.parse(fileContents); + } + catch (e) { + errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath)); + return false; + } + return true; + } + function countLines(program) { + var count = 0; + ts.forEach(program.getSourceFiles(), function (file) { + count += file.getLineAndCharacterFromPosition(file.end).line; + }); + return count; + } + var hasReportedErrors = false; + function reportErrors(errors) { + for (var i = 0; i < errors.length; i++) { + var error = errors[i]; + ts.Debug.assert(error.messageText.indexOf("{NL}") < 0); + if (error.file) { + var loc = error.file.getLineAndCharacterFromPosition(error.start); + sys.writeErr(error.file.filename + "(" + loc.line + "," + loc.character + "): " + error.messageText + sys.newLine); + } + else { + sys.writeErr(error.messageText + sys.newLine); + } + hasReportedErrors = true; + } + } + function padLeft(s, length) { + while (s.length < length) + s = " " + s; + return s; + } + function padRight(s, length) { + while (s.length < length) + s = s + " "; + return s; + } + function reportDiagnostic(name, value) { + sys.writeErr(padRight(name + ":", 12) + padLeft(value.toString(), 10) + sys.newLine); + } + function reportDiagnosticCount(name, count) { + reportDiagnostic(name, "" + count); + } + function reportDiagnosticTime(name, time) { + reportDiagnostic(name, (time / 1000).toFixed(2) + "s"); + } + function getSourceFile(filename, languageVersion) { + var text = sys.readFile(filename); + return text !== undefined ? ts.createSourceFile(filename, text, languageVersion) : undefined; + } + function writeFile(fileName, data) { + function ensureDirectoryStructure(directoryName) { + if (directoryName) { + if (!sys.directoryExists(directoryName)) { + var parentDirectory = ts.getDirectoryPath(directoryName); + if (parentDirectory !== directoryName) { + if (ensureDirectoryStructure(parentDirectory)) { + try { + sys.createDirectory(directoryName); + } + catch (e) { + reportErrors([ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_create_directory_0, [directoryName])]); + return false; + } + } + } + } + } + return true; + } + if (ensureDirectoryStructure(ts.getDirectoryPath(ts.normalizePath(fileName)))) { + try { + sys.writeFile(fileName, data); + } + catch (e) { + reportErrors([ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0, [fileName])]); + } + } + } + var currentDirectory; + function getCurrentDictory() { + currentDirectory = currentDirectory || sys.getCurrentDirectory(); + return currentDirectory; + } + function createCompilerHost() { + return { + getSourceFile: getSourceFile, + getDefaultLibFilename: function () { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(sys.getExecutingFilePath())), "lib.d.ts"); }, + writeFile: writeFile, + getCurrentDirectory: getCurrentDictory + }; + } + function executeCommandLine(args) { + var cmds = ts.parseCommandLine(args); + if (cmds.filenames.length === 0 && !(cmds.options.help || cmds.options.version)) { + cmds.errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.No_input_files_specified)); + } + if (cmds.options.version) { + } + if (cmds.filenames.length === 0 || cmds.options.help) { + } + if (cmds.options.locale) { + validateLocaleAndSetLanguage(cmds.options.locale, cmds.errors); + } + if (cmds.errors.length) { + reportErrors(cmds.errors); + return 1; + } + var parseStart = new Date().getTime(); + var program = ts.createProgram(cmds.filenames, cmds.options, createCompilerHost()); + var bindStart = new Date().getTime(); + var errors = program.getDiagnostics(); + if (errors.length) { + var checkStart = bindStart; + var emitStart = bindStart; + var reportStart = bindStart; + } + else { + var checker = program.getTypeChecker(); + var checkStart = new Date().getTime(); + errors = checker.getDiagnostics(); + var emitStart = new Date().getTime(); + checker.emitFiles(); + var reportStart = new Date().getTime(); + } + reportErrors(errors); + if (cmds.options.diagnostics) { + reportDiagnosticCount("Files", program.getSourceFiles().length); + reportDiagnosticCount("Lines", countLines(program)); + reportDiagnosticCount("Nodes", checker.getNodeCount()); + reportDiagnosticCount("Identifiers", checker.getIdentifierCount()); + reportDiagnosticCount("Symbols", checker.getSymbolCount()); + reportDiagnosticCount("Types", checker.getTypeCount()); + reportDiagnosticTime("Parse time", bindStart - parseStart); + reportDiagnosticTime("Bind time", checkStart - bindStart); + reportDiagnosticTime("Check time", emitStart - checkStart); + reportDiagnosticTime("Emit time", reportStart - emitStart); + reportDiagnosticTime("Total time", reportStart - parseStart); + } + return hasReportedErrors ? 1 : 0; + } + ts.executeCommandLine = executeCommandLine; +})(ts || (ts = {})); +ts.executeCommandLine(sys.args); diff --git a/bin/tsc b/bin/tsc new file mode 100644 index 0000000000000..3c0dab574f297 --- /dev/null +++ b/bin/tsc @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('./tsc.js') diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx new file mode 100644 index 0000000000000..7d4948d33f8cd Binary files /dev/null and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/TypeScript Language Specification.pdf b/doc/TypeScript Language Specification.pdf new file mode 100644 index 0000000000000..54aec6b8d09da Binary files /dev/null and b/doc/TypeScript Language Specification.pdf differ diff --git a/package.json b/package.json new file mode 100644 index 0000000000000..1add14ef5751c --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "typescript", + "author": "Microsoft Corp.", + "homepage": "http://typescriptlang.org/", + "version": "1.0.1", + "licenses": [ + { + "type": "Apache License 2.0", + "url": "http://typescript.codeplex.com/license" + } + ], + "description": "TypeScript is a language for application scale JavaScript development", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript" + ], + "bugs": { + "url" : "http://typescript.codeplex.com/workitem/list/basic" + }, + "repository" : { + "type" : "git", + "url" : "https://git01.codeplex.com/typescript" + }, + "preferGlobal" : true, + "main" : "./bin/typescript.js", + "bin" : { + "tsc" : "./bin/tsc" + }, + "engines" : { + "node" : ">=0.8.0" + }, + "devDependencies": { + "jake" : "latest", + "mocha" : "latest", + "chai" : "latest", + "browserify" : "latest" + } +} diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts new file mode 100644 index 0000000000000..e1a198a212457 --- /dev/null +++ b/scripts/processDiagnosticMessages.ts @@ -0,0 +1,182 @@ +/// + +interface DiagnosticDetails { + category: string; + code: number; +} + +interface InputDiagnosticMessageTable { + [msg: string]: DiagnosticDetails; +} + +interface IIndexable { + [key: string]: V; +} + +function main(): void { + if (sys.args.length < 1) { + sys.write("Usage:" + sys.newLine) + sys.write("\tnode processDiagnosticMessages.js " + sys.newLine); + return; + } + + var inputFilePath = sys.args[0].replace(/\\/g, "/"); + var inputStr = sys.readFile(inputFilePath); + + var diagnosticMesages: InputDiagnosticMessageTable = JSON.parse(inputStr); + + var names = Utilities.getObjectKeys(diagnosticMesages); + var nameMap = buildUniqueNameMap(names); + + var infoFileOutput = buildInfoFileOutput(diagnosticMesages, nameMap); + + // TODO: Fix path joining + var inputDirectory = inputFilePath.substr(0,inputFilePath.lastIndexOf("/")); + var fileOutputPath = inputDirectory + "/diagnosticInformationMap.generated.ts"; + sys.writeFile(fileOutputPath, infoFileOutput); +} + +function buildUniqueNameMap(names: string[]): IIndexable { + var nameMap: IIndexable = {}; + + var uniqueNames = NameGenerator.ensureUniqueness(names, /*isFixed */ undefined, /* isCaseSensitive */ false); + + for (var i = 0; i < names.length; i++) { + nameMap[names[i]] = uniqueNames[i]; + } + + return nameMap; +} + +function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: IIndexable): string { + var result = + '// \r\n' + + '/// \r\n' + + 'module ts {\r\n' + + ' export var Diagnostics = {\r\n'; + var names = Utilities.getObjectKeys(messageTable); + for (var i = 0; i < names.length; i++) { + var name = names[i]; + var diagnosticDetails = messageTable[name]; + + result += + ' ' + convertPropertyName(nameMap[name]) + + ': { code: ' + diagnosticDetails.code + + ', category: DiagnosticCategory.' + diagnosticDetails.category + + ', key: "' + name.replace('"', '\\"') + + '" },\r\n'; + } + + result += ' };\r\n}'; + + return result; +} + +function convertPropertyName(origName: string): string { + var result = origName.split("").map(char => { + if (char === '*') { return "_Asterisk"; } + if (char === '/') { return "_Slash"; } + if (char === ':') { return "_Colon"; } + return /\w/.test(char) ? char : "_"; + }).join(""); + + + // get rid of all multi-underscores + result = result.replace(/_+/g, "_"); + + // remove any leading underscore, unless it is followed by a number. + result = result.replace(/^_([^\d])/, "$1") + + // get rid of all trailing underscores. + result = result.replace(/_$/, ""); + + return result; +} + +module NameGenerator { + export function ensureUniqueness( + names: string[], + isFixed: boolean[]= names.map(() => false), + isCaseSensitive: boolean = true): string[] { + + var names = names.map(x => x); + ensureUniquenessInPlace(names, isFixed, isCaseSensitive); + return names; + } + + function ensureUniquenessInPlace(names: string[], isFixed: boolean[], isCaseSensitive: boolean): void { + for (var i = 0; i < names.length; i++) { + var name = names[i]; + var collisionIndices = Utilities.collectMatchingIndices(name, names, isCaseSensitive); + + // We will always have one "collision" because getCollisionIndices returns the index of name itself as well; + // so if we only have one collision, then there are no issues. + if (collisionIndices.length < 2) { + continue; + } + + handleCollisions(name, names, isFixed, collisionIndices, isCaseSensitive); + } + } + + function handleCollisions(name: string, proposedNames: string[], isFixed: boolean[], collisionIndices: number[], isCaseSensitive: boolean): void { + var suffix = 1; + + for (var i = 0; i < collisionIndices.length; i++) { + var collisionIndex = collisionIndices[i]; + + if (isFixed[collisionIndex]) { + // can't do anything about this name. + continue; + } + + while (true) { + var newName = name + suffix++; + + if (proposedNames.some((name) => Utilities.stringEquals(name, newName, isCaseSensitive))) { + proposedNames[collisionIndex] = newName; + break; + } + } + } + } +} + +module Utilities { + /// Return a list of all indices where a string occurs. + export function collectMatchingIndices(name: string, proposedNames: string[], isCaseSensitive: boolean = true): number[] { + var matchingIndices: number[] = []; + + for (var i = 0; i < proposedNames.length; i++) { + if (stringEquals(name, proposedNames[i], isCaseSensitive)) { + matchingIndices.push(i); + } + } + + return matchingIndices; + } + + export function stringEquals(s1: string, s2: string, caseSensitive: boolean = true): boolean { + if (!caseSensitive) { + s1 = s1.toLowerCase(); + s2 = s2.toLowerCase(); + } + + return s1 == s2; + } + + // Like Object.keys + export function getObjectKeys(obj: any): string[]{ + var result: string[] = []; + + for (var name in obj) { + if (obj.hasOwnProperty(name)) { + result.push(name); + } + } + + return result; + } +} + +main(); \ No newline at end of file diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts new file mode 100644 index 0000000000000..7f83681a490e4 --- /dev/null +++ b/src/compiler/binder.ts @@ -0,0 +1,338 @@ +/// +/// +/// +/// + +module ts { + + export function isInstantiated(node: Node): boolean { + // A module is uninstantiated if it contains only + // 1. interface declarations + if (node.kind === SyntaxKind.InterfaceDeclaration) { + return false; + } + // 2. non - exported import declarations + else if (node.kind === SyntaxKind.ImportDeclaration && !(node.flags & NodeFlags.Export)) { + return false; + } + // 3. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock && !forEachChild(node, isInstantiated)) { + return false; + } + else if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated((node).body)) { + return false; + } + else { + return true; + } + } + + export function bindSourceFile(file: SourceFile) { + + var parent: Node; + var container: Declaration; + var symbolCount = 0; + var Symbol = objectAllocator.getSymbolConstructor(); + + if (!file.locals) { + file.locals = {}; + container = file; + bind(file); + file.symbolCount = symbolCount; + } + + function createSymbol(flags: SymbolFlags, name: string): Symbol { + symbolCount++; + return new Symbol(flags, name); + } + + function addDeclarationToSymbol(symbol: Symbol, node: Declaration, symbolKind: SymbolFlags) { + symbol.flags |= symbolKind; + if (!symbol.declarations) symbol.declarations = []; + symbol.declarations.push(node); + if (symbolKind & SymbolFlags.HasExports && !symbol.exports) symbol.exports = {}; + if (symbolKind & SymbolFlags.HasMembers && !symbol.members) symbol.members = {}; + node.symbol = symbol; + if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node; + } + + function getDeclarationName(node: Declaration): string { + if (node.name) { + if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) { + return '"' + node.name.text + '"'; + } + return node.name.text; + } + switch (node.kind) { + case SyntaxKind.Constructor: return "__constructor"; + case SyntaxKind.CallSignature: return "__call"; + case SyntaxKind.ConstructSignature: return "__new"; + case SyntaxKind.IndexSignature: return "__index"; + } + } + + function getDisplayName(node: Declaration): string { + return node.name ? identifierToString(node.name) : getDeclarationName(node); + } + + function declareSymbol(symbols: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol { + var name = getDeclarationName(node); + if (name !== undefined) { + var symbol = hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + if (symbol.flags & excludes) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(createDiagnosticForNode(node.name ? node.name : node, + Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + symbol = createSymbol(0, name); + } + } + else { + symbol = createSymbol(0, "__missing"); + } + addDeclarationToSymbol(symbol, node, includes); + symbol.parent = parent; + + if (node.kind === SyntaxKind.ClassDeclaration && symbol.exports) { + // TypeScript 1.0 spec (April 2014): 8.4 + // Every class automatically contains a static property member named 'prototype', + // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. + // It is an error to explicitly declare a static property member with the name 'prototype'. + var prototypeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Prototype, "prototype"); + if (hasProperty(symbol.exports, prototypeSymbol.name)) { + if (node.name) { + node.name.parent = node; + } + file.semanticErrors.push(createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], + Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + } + symbol.exports[prototypeSymbol.name] = prototypeSymbol; + prototypeSymbol.parent = symbol; + } + + return symbol; + } + + function isAmbientContext(node: Node): boolean { + while (node) { + if (node.flags & NodeFlags.Ambient) return true; + node = node.parent; + } + return false; + } + + function declareModuleMember(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) { + // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue, + // ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set + // on it. There are 2 main reasons: + // + // 1. We treat locals and exports of the same name as mutually exclusive within a container. + // That means the binder will issue a Duplicate Identifier error if you mix locals and exports + // with the same name in the same container. + // TODO: Make this a more specific error and decouple it from the exclusion logic. + // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, + // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way + // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. + var exportKind = 0; + var exportExcludes = 0; + if (symbolKind & SymbolFlags.Value) { + exportKind |= SymbolFlags.ExportValue; + exportExcludes |= SymbolFlags.Value; + } + if (symbolKind & SymbolFlags.Type) { + exportKind |= SymbolFlags.ExportType; + exportExcludes |= SymbolFlags.Type; + } + if (symbolKind & SymbolFlags.Namespace) { + exportKind |= SymbolFlags.ExportNamespace; + exportExcludes |= SymbolFlags.Namespace; + } + if (node.flags & NodeFlags.Export || (node.kind !== SyntaxKind.ImportDeclaration && isAmbientContext(container))) { + if (exportKind) { + var local = declareSymbol(container.locals, undefined, node, exportKind, exportExcludes); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + else { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + } + } + else { + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes | exportKind); + } + } + + function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) { + switch (container.kind) { + case SyntaxKind.ModuleDeclaration: + declareModuleMember(node, symbolKind, symbolExcludes); + break; + case SyntaxKind.SourceFile: + if (container.flags & NodeFlags.ExternalModule) { + declareModuleMember(node, symbolKind, symbolExcludes); + break; + } + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); + break; + case SyntaxKind.ClassDeclaration: + if (node.flags & NodeFlags.Static) { + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + case SyntaxKind.TypeLiteral: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.InterfaceDeclaration: + declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); + break; + case SyntaxKind.EnumDeclaration: + declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); + break; + } + if (symbolKind & SymbolFlags.HasLocals) node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + if (symbolKind & SymbolFlags.IsContainer) container = node; + forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + + function bindConstructorDeclaration(node: ConstructorDeclaration) { + bindDeclaration(node, SymbolFlags.Constructor, 0); + forEach(node.parameters, p => { + if (p.flags & (NodeFlags.Public | NodeFlags.Private)) { + bindDeclaration(p, SymbolFlags.Property, SymbolFlags.PropertyExcludes); + } + }); + } + + function bindModuleDeclaration(node: ModuleDeclaration) { + if (node.name.kind === SyntaxKind.StringLiteral) { + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); + } + else if (isInstantiated(node)) { + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); + } + else { + bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes); + } + } + + function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string) { + var symbol = createSymbol(symbolKind, name); + addDeclarationToSymbol(symbol, node, symbolKind); + if (symbolKind & SymbolFlags.HasLocals) node.locals = {}; + var saveParent = parent; + var saveContainer = container; + parent = node; + container = node; + forEachChild(node, bind); + container = saveContainer; + parent = saveParent; + } + + function bindCatchVariableDeclaration(node: CatchBlock) { + var symbol = createSymbol(SymbolFlags.Variable, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node.variable, SymbolFlags.Variable); + var saveParent = parent; + parent = node; + forEachChild(node, bind); + parent = saveParent; + } + + function bind(node: Node) { + node.parent = parent; + switch (node.kind) { + case SyntaxKind.TypeParameter: + bindDeclaration(node, SymbolFlags.TypeParameter, SymbolFlags.TypeParameterExcludes); + break; + case SyntaxKind.Parameter: + bindDeclaration(node, SymbolFlags.Variable, SymbolFlags.ParameterExcludes); + break; + case SyntaxKind.VariableDeclaration: + bindDeclaration(node, SymbolFlags.Variable, SymbolFlags.VariableExcludes); + break; + case SyntaxKind.Property: + case SyntaxKind.PropertyAssignment: + bindDeclaration(node, SymbolFlags.Property, SymbolFlags.PropertyExcludes); + break; + case SyntaxKind.EnumMember: + bindDeclaration(node, SymbolFlags.EnumMember, SymbolFlags.EnumMemberExcludes); + break; + case SyntaxKind.CallSignature: + bindDeclaration(node, SymbolFlags.CallSignature, 0); + break; + case SyntaxKind.Method: + bindDeclaration(node, SymbolFlags.Method, SymbolFlags.MethodExcludes); + break; + case SyntaxKind.ConstructSignature: + bindDeclaration(node, SymbolFlags.ConstructSignature, 0); + break; + case SyntaxKind.IndexSignature: + bindDeclaration(node, SymbolFlags.IndexSignature, 0); + break; + case SyntaxKind.FunctionDeclaration: + bindDeclaration(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); + break; + case SyntaxKind.Constructor: + bindConstructorDeclaration(node); + break; + case SyntaxKind.GetAccessor: + bindDeclaration(node, SymbolFlags.GetAccessor, SymbolFlags.GetAccessorExcludes); + break; + case SyntaxKind.SetAccessor: + bindDeclaration(node, SymbolFlags.SetAccessor, SymbolFlags.SetAccessorExcludes); + break; + case SyntaxKind.TypeLiteral: + bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type"); + break; + case SyntaxKind.ObjectLiteral: + bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object"); + break; + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + bindAnonymousDeclaration(node, SymbolFlags.Function, "__function"); + break; + case SyntaxKind.CatchBlock: + bindCatchVariableDeclaration(node); + break; + case SyntaxKind.ClassDeclaration: + bindDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes); + break; + case SyntaxKind.InterfaceDeclaration: + bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes); + break; + case SyntaxKind.EnumDeclaration: + bindDeclaration(node, SymbolFlags.Enum, SymbolFlags.EnumExcludes); + break; + case SyntaxKind.ModuleDeclaration: + bindModuleDeclaration(node); + break; + case SyntaxKind.ImportDeclaration: + bindDeclaration(node, SymbolFlags.Import, SymbolFlags.ImportExcludes); + break; + case SyntaxKind.SourceFile: + if (node.flags & NodeFlags.ExternalModule) { + bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + getModuleNameFromFilename((node).filename) + '"'); + break; + } + default: + var saveParent = parent; + parent = node; + forEachChild(node, bind); + parent = saveParent; + } + } + } +} diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts new file mode 100644 index 0000000000000..e424c2a0644ca --- /dev/null +++ b/src/compiler/checker.ts @@ -0,0 +1,5797 @@ +/// +/// +/// +/// +/// +/// + +module ts { + + var nextSymbolId = 1; + var nextNodeId = 1; + var nextMergeId = 1; + + export function createTypeChecker(program: Program): TypeChecker { + + var Symbol = objectAllocator.getSymbolConstructor(); + var Type = objectAllocator.getTypeConstructor(); + var Signature = objectAllocator.getSignatureConstructor(); + + var typeCount = 0; + + var emptyArray: any[] = []; + var emptySymbols: SymbolTable = {}; + + var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); + var argumentsSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "arguments"); + var unknownSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "unknown"); + var resolvingSymbol = createSymbol(SymbolFlags.Transient, "__resolving__"); + + var anyType = createIntrinsicType(TypeFlags.Any, "any"); + var stringType = createIntrinsicType(TypeFlags.String, "string"); + var numberType = createIntrinsicType(TypeFlags.Number, "number"); + var booleanType = createIntrinsicType(TypeFlags.Boolean, "boolean"); + var voidType = createIntrinsicType(TypeFlags.Void, "void"); + var undefinedType = createIntrinsicType(TypeFlags.Undefined, "undefined"); + var nullType = createIntrinsicType(TypeFlags.Null, "null"); + var unknownType = createIntrinsicType(TypeFlags.Any, "unknown"); + var resolvingType = createIntrinsicType(TypeFlags.Any, "__resolving__"); + + var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + + var globals: SymbolTable = {}; + + var globalObjectType: ObjectType; + var globalFunctionType: ObjectType; + var globalArrayType: ObjectType; + var globalStringType: ObjectType; + var globalNumberType: ObjectType; + var globalBooleanType: ObjectType; + var globalRegExpType: ObjectType; + + var stringLiteralTypes: Map = {}; + + var emitExtends = false; + var modulesVerified = false; + + var mergedSymbols: Symbol[] = []; + var symbolLinks: SymbolLinks[] = []; + var nodeLinks: NodeLinks[] = []; + + var diagnostics: Diagnostic[] = []; + var diagnosticsModified: boolean = false; + + var checker: TypeChecker; + + function addDiagnostic(diagnostic: Diagnostic) { + diagnostics.push(diagnostic); + diagnosticsModified = true; + } + + function error(location: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { + var diagnostic = location + ? createDiagnosticForNode(location, message, arg0, arg1, arg2) + : createCompilerDiagnostic(message, arg0, arg1, arg2); + addDiagnostic(diagnostic); + } + + function createSymbol(flags: SymbolFlags, name: string): Symbol { + return new Symbol(flags, name); + } + + function getExcludedSymbolFlags(flags: SymbolFlags): SymbolFlags { + var result: SymbolFlags = 0; + if (flags & SymbolFlags.Variable) result |= SymbolFlags.VariableExcludes; + if (flags & SymbolFlags.Property) result |= SymbolFlags.PropertyExcludes; + if (flags & SymbolFlags.EnumMember) result |= SymbolFlags.EnumMemberExcludes; + if (flags & SymbolFlags.Function) result |= SymbolFlags.FunctionExcludes; + if (flags & SymbolFlags.Class) result |= SymbolFlags.ClassExcludes; + if (flags & SymbolFlags.Interface) result |= SymbolFlags.InterfaceExcludes; + if (flags & SymbolFlags.Enum) result |= SymbolFlags.EnumExcludes; + if (flags & SymbolFlags.ValueModule) result |= SymbolFlags.ValueModuleExcludes; + if (flags & SymbolFlags.Method) result |= SymbolFlags.MethodExcludes; + if (flags & SymbolFlags.GetAccessor) result |= SymbolFlags.GetAccessorExcludes; + if (flags & SymbolFlags.SetAccessor) result |= SymbolFlags.SetAccessorExcludes; + if (flags & SymbolFlags.TypeParameter) result |= SymbolFlags.TypeParameterExcludes; + if (flags & SymbolFlags.Import) result |= SymbolFlags.ImportExcludes; + return result; + } + + function recordMergedSymbol(target: Symbol, source: Symbol) { + if (!source.mergeId) source.mergeId = nextMergeId++; + mergedSymbols[source.mergeId] = target; + } + + function cloneSymbol(symbol: Symbol): Symbol { + var result = createSymbol(symbol.flags | SymbolFlags.Merged, symbol.name); + result.declarations = symbol.declarations.slice(0); + result.parent = symbol.parent; + if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.members) result.members = cloneSymbolTable(symbol.members); + if (symbol.exports) result.exports = cloneSymbolTable(symbol.exports); + recordMergedSymbol(result, symbol); + return result; + } + + function extendSymbol(target: Symbol, source: Symbol) { + if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + target.flags |= source.flags; + if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; + forEach(source.declarations, node => { + target.declarations.push(node); + }); + if (source.members) { + if (!target.members) target.members = {}; + extendSymbolTable(target.members, source.members); + } + if (source.exports) { + if (!target.exports) target.exports = {}; + extendSymbolTable(target.exports, source.exports); + } + recordMergedSymbol(target, source); + } + else { + forEach(source.declarations, node => { + error(node.name ? node.name : node, Diagnostics.Duplicate_identifier_0, symbolToString(source)); + }); + } + } + + function cloneSymbolTable(symbolTable: SymbolTable): SymbolTable { + var result: SymbolTable = {}; + for (var id in symbolTable) { + if (hasProperty(symbolTable, id)) { + result[id] = symbolTable[id]; + } + } + return result; + } + + function extendSymbolTable(target: SymbolTable, source: SymbolTable) { + for (var id in source) { + if (hasProperty(source, id)) { + if (!hasProperty(target, id)) { + target[id] = source[id]; + } + else { + var symbol = target[id]; + if (!(symbol.flags & SymbolFlags.Merged)) { + target[id] = symbol = cloneSymbol(symbol); + } + extendSymbol(symbol, source[id]); + } + } + } + } + + function getSymbolLinks(symbol: Symbol): SymbolLinks { + if (symbol.flags & SymbolFlags.Transient) return symbol; + if (!symbol.id) symbol.id = nextSymbolId++; + return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); + } + + function getNodeLinks(node: Node): NodeLinks { + if (!node.id) node.id = nextNodeId++; + return nodeLinks[node.id] || (nodeLinks[node.id] = {}); + } + + function getSourceFile(node: Node): SourceFile { + return getAncestor(node, SyntaxKind.SourceFile); + } + + function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol { + if (meaning && hasProperty(symbols, name)) { + var symbol = symbols[name]; + Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here."); + if (symbol.flags & meaning) { + return symbol; + } + + if (symbol.flags & SymbolFlags.Import) { + var target = resolveImport(symbol); + // unknown symbol will mean that there were reported error during import resolution + // treat it as positive answer to avoid cascading errors + if (target === unknownSymbol || target.flags & meaning) { + return symbol; + } + } + } + + // return undefined if we can't find a symbol. + } + + function resolveName(location: Node, name: string, meaning: SymbolFlags, nameNotFoundMessage: DiagnosticMessage, nameArg: string): Symbol { + var errorLocation = location; + var result: Symbol; + var lastLocation: Node; + + var memberWithInitializerThatReferencesIdentifierFromConstructor: Node; + + function returnResolvedSymbol(s: Symbol) { + // we've seen member with initializer that references identifier defined in constructor during the search. + // if this was the only result with given name then just report default 'nameNotFound' message. + // however if we met something else that was 'shadowed' by the identifier in constructor - report more specific error + if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { + var propertyName = (memberWithInitializerThatReferencesIdentifierFromConstructor).name; + error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, identifierToString(propertyName), nameArg); + return undefined; + } + if (!s && nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, nameArg); + } + return s; + } + + while (location) { + // Locals of a source file are not in scope (because they get merged into the global symbol table) + if (location.locals && (location.kind !== SyntaxKind.SourceFile || location.flags & NodeFlags.ExternalModule)) { + if (result = getSymbol(location.locals, name, meaning)) { + return returnResolvedSymbol(result); + } + } + switch (location.kind) { + case SyntaxKind.SourceFile: + if (!(location.flags & NodeFlags.ExternalModule)) break; + case SyntaxKind.ModuleDeclaration: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) { + return returnResolvedSymbol(result); + } + break; + case SyntaxKind.EnumDeclaration: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.EnumMember)) { + return returnResolvedSymbol(result); + } + break; + case SyntaxKind.Property: + // TypeScript 1.0 spec (April 2014): 8.4.1 + // Initializer expressions for instance member variables are evaluated in the scope + // of the class constructor body but are not permitted to reference parameters or + // local variables of the constructor.This effectively means that entities from outer scopes + // by the same name as a constructor parameter or local variable are inaccessible + // in initializer expressions for instance member variables. + if (location.parent.kind === SyntaxKind.ClassDeclaration && !(location.flags & NodeFlags.Static)) { + var ctor = findConstructorDeclaration(location.parent); + if (ctor && ctor.locals) { + if (getSymbol(ctor.locals, name, meaning & SymbolFlags.Value)) { + // save the property node - later it will be used by 'returnResolvedSymbol' to report appropriate error + memberWithInitializerThatReferencesIdentifierFromConstructor = location; + } + } + } + break; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & SymbolFlags.Type)) { + if (lastLocation && lastLocation.flags & NodeFlags.Static) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // The scope of a type parameter extends over the entire declaration + // with which the type parameter list is associated, with the exception of static member declarations in classes. + error(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); + return undefined; + } + else { + return returnResolvedSymbol(result); + } + } + break; + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + break; + case SyntaxKind.FunctionExpression: + if (name === "arguments") { + return returnResolvedSymbol(argumentsSymbol); + } + var id = (location).name; + if (id && name === id.text) { + return returnResolvedSymbol(location.symbol); + } + break; + case SyntaxKind.CatchBlock: + var id = (location).variable; + if (name === id.text) { + return returnResolvedSymbol((location).variable.symbol); + } + break; + } + lastLocation = location; + location = location.parent; + } + if (result = getSymbol(globals, name, meaning)) { + return returnResolvedSymbol(result); + } + + return returnResolvedSymbol(undefined); + } + + function resolveImport(symbol: Symbol): Symbol { + Debug.assert((symbol.flags & SymbolFlags.Import) !== 0, "Should only get Imports here."); + var links = getSymbolLinks(symbol); + if (!links.target) { + links.target = resolvingSymbol; + var node = getDeclarationOfKind(symbol, SyntaxKind.ImportDeclaration); + var target = node.externalModuleName ? + resolveExternalModuleName(node, node.externalModuleName) : + resolveEntityName(node, node.entityName, node.entityName.kind === SyntaxKind.QualifiedName ? + SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace : SymbolFlags.Namespace); + if (links.target === resolvingSymbol) { + links.target = target || unknownSymbol; + } + else { + error(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); + } + } + else if (links.target === resolvingSymbol) { + links.target = unknownSymbol; + } + return links.target; + } + + function getFullyQualifiedName(symbol: Symbol) { + return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); + } + + // Resolves a qualified name and any involved import aliases + function resolveEntityName(location: Node, name: EntityName, meaning: SymbolFlags): Symbol { + if (name.kind === SyntaxKind.Identifier) { + // TODO: Investigate error recovery for symbols not found + var symbol = resolveName(location, (name).text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(name)); + if (!symbol) { + return; + } + } + else if (name.kind === SyntaxKind.QualifiedName) { + var namespace = resolveEntityName(location, (name).left, SymbolFlags.Namespace); + if (!namespace || namespace === unknownSymbol || (name).right.kind === SyntaxKind.Missing) return; + var symbol = getSymbol(namespace.exports, (name).right.text, meaning); + if (!symbol) { + error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), + identifierToString((name).right)); + return; + } + } + else { + // Missing identifier + return; + } + Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here."); + return symbol.flags & meaning ? symbol : resolveImport(symbol); + } + + function isExternalModuleNameRelative(moduleName: string): boolean { + // TypeScript 1.0 spec (April 2014): 11.2.1 + // An external module name is "relative" if the first term is "." or "..". + return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; + } + + function resolveExternalModuleName(location: Node, moduleLiteral: LiteralExpression): Symbol { + var searchPath = getDirectoryPath(getSourceFile(location).filename); + var moduleName = moduleLiteral.text; + if (!moduleName) return; + var isRelative = isExternalModuleNameRelative(moduleName); + if (!isRelative) { + var symbol = getSymbol(globals, '"' + moduleName + '"', SymbolFlags.ValueModule); + if (symbol) { + return getResolvedExportSymbol(symbol); + } + } + while (true) { + var filename = normalizePath(combinePaths(searchPath, moduleName)); + var sourceFile = program.getSourceFile(filename + ".ts") || program.getSourceFile(filename + ".d.ts"); + if (sourceFile || isRelative) break; + var parentPath = getDirectoryPath(searchPath); + if (parentPath === searchPath) break; + searchPath = parentPath; + } + if (sourceFile) { + if (sourceFile.symbol) { + return getResolvedExportSymbol(sourceFile.symbol); + } + error(moduleLiteral, Diagnostics.File_0_is_not_an_external_module, sourceFile.filename); + return; + } + error(moduleLiteral, Diagnostics.Cannot_find_external_module_0, moduleName); + } + + function getResolvedExportSymbol(moduleSymbol: Symbol): Symbol { + var symbol = getExportAssignmentSymbol(moduleSymbol); + if (symbol) { + if (symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace)) { + return symbol; + } + if (symbol.flags & SymbolFlags.Import) { + return resolveImport(symbol); + } + } + return moduleSymbol; + } + + function getExportAssignmentSymbol(symbol: Symbol): Symbol { + if (!symbol.exportAssignSymbol) { + var exportInformation = collectExportInformationForSourceFileOrModule(symbol); + if (exportInformation.exportAssignments.length) { + if (exportInformation.exportAssignments.length > 1) { + // TypeScript 1.0 spec (April 2014): 11.2.4 + // It is an error for an external module to contain more than one export assignment. + forEach(exportInformation.exportAssignments, node => error(node, Diagnostics.A_module_cannot_have_more_than_one_export_assignment)); + } + var node = exportInformation.exportAssignments[0]; + if (exportInformation.hasExportedMember) { + // TypeScript 1.0 spec (April 2014): 11.2.3 + // If an external module contains an export assignment it is an error + // for the external module to also contain export declarations. + // The two types of exports are mutually exclusive. + error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } + if (node.exportName.text) { + var meaning = SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace; + var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(node.exportName)); + } + } + symbol.exportAssignSymbol = exportSymbol || unknownSymbol; + } + return symbol.exportAssignSymbol === unknownSymbol ? undefined : symbol.exportAssignSymbol; + } + + function collectExportInformationForSourceFileOrModule(symbol: Symbol) { + var seenExportedMember = false; + var result: ExportAssignment[] = []; + forEach(symbol.declarations, declaration => { + var block = (declaration.kind === SyntaxKind.SourceFile ? declaration : (declaration).body); + forEach(block.statements, node => { + if (node.kind === SyntaxKind.ExportAssignment) { + result.push(node); + } + else { + seenExportedMember = seenExportedMember || (node.flags & NodeFlags.Export) !== 0; + } + }); + }); + return { + hasExportedMember: seenExportedMember, + exportAssignments: result + }; + } + + function getMergedSymbol(symbol: Symbol): Symbol { + var merged: Symbol; + return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; + } + + function getSymbolOfNode(node: Node): Symbol { + return getMergedSymbol(node.symbol); + } + + function getParentOfSymbol(symbol: Symbol): Symbol { + return getMergedSymbol(symbol.parent); + } + + function getExportSymbolOfValueSymbolIfExported(symbol: Symbol): Symbol { + return symbol && (symbol.flags & SymbolFlags.ExportValue) !== 0 + ? getMergedSymbol(symbol.exportSymbol) + : symbol; + } + + function symbolIsValue(symbol: Symbol): boolean { + // If the symbol has the value flag, it is trivially a value. + if (symbol.flags & SymbolFlags.Value) { + return true; + } + + // If it is an import, then it is a value if the symbol it resolves to is a value. + if (symbol.flags & SymbolFlags.Import) { + return (resolveImport(symbol).flags & SymbolFlags.Value) !== 0; + } + + // If it is an instantiated symbol, then it is a value if hte symbol it is an + // instantiation of is a value. + if (symbol.flags & SymbolFlags.Instantiated) { + return (getSymbolLinks(symbol).target.flags & SymbolFlags.Value) !== 0; + } + + return false; + } + + function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + if (declaration.kind === kind) return declaration; + } + } + + function findConstructorDeclaration(node: ClassDeclaration): ConstructorDeclaration { + var members = node.members; + for (var i = 0; i < members.length; i++) { + var member = members[i]; + if (member.kind === SyntaxKind.Constructor && (member).body) { + return member; + } + } + } + + function createType(flags: TypeFlags): Type { + var result = new Type(checker, flags); + result.id = typeCount++; + return result; + } + + function createIntrinsicType(kind: TypeFlags, intrinsicName: string): IntrinsicType { + var type = createType(kind); + type.intrinsicName = intrinsicName; + return type; + } + + function createObjectType(kind: TypeFlags, symbol?: Symbol): ObjectType { + var type = createType(kind); + type.symbol = symbol; + return type; + } + + // A reserved member name starts with two underscores followed by a non-underscore + function isReservedMemberName(name: string) { + return name.charCodeAt(0) === CharacterCodes._ && name.charCodeAt(1) === CharacterCodes._ && name.charCodeAt(2) !== CharacterCodes._; + } + + function getNamedMembers(members: SymbolTable): Symbol[] { + var result: Symbol[]; + for (var id in members) { + if (hasProperty(members, id)) { + if (!isReservedMemberName(id)) { + if (!result) result = []; + var symbol = members[id]; + if (symbolIsValue(symbol)) { + result.push(symbol); + } + } + } + } + return result || emptyArray; + } + + function setObjectTypeMembers(type: ObjectType, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedObjectType { + (type).members = members; + (type).properties = getNamedMembers(members); + (type).callSignatures = callSignatures; + (type).constructSignatures = constructSignatures; + if (stringIndexType) (type).stringIndexType = stringIndexType; + if (numberIndexType) (type).numberIndexType = numberIndexType; + return type; + } + + function createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexType: Type, numberIndexType: Type): ResolvedObjectType { + return setObjectTypeMembers(createObjectType(TypeFlags.Anonymous, symbol), + members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + + // Takes a VariableDeclaration because it could be an exported var from a module (VariableDeclaration), + // a class or object type property (PropertyDeclaration), or a parameter property (ParameterDeclaration) + function isOptionalProperty(propertySymbol: Symbol): boolean { + if (propertySymbol.flags & SymbolFlags.Prototype) { + return false; + } + // class C { + // constructor(public x?) { } + // } + // + // x is an optional parameter, but it is a required property. + return (propertySymbol.valueDeclaration.flags & NodeFlags.QuestionMark) && propertySymbol.valueDeclaration.kind !== SyntaxKind.Parameter; + } + + function symbolToString(symbol: Symbol) { + if (symbol.declarations && symbol.declarations.length > 0) { + var declaration = symbol.declarations[0]; + if (declaration.name) { + return identifierToString(declaration.name); + } + } + return symbol.name; + } + + function typeToString(type: Type, printArrayAsGenericType: boolean): string { + var typeStack: Type[]; + return typeToString(type); + + function typeToString(type: Type): string { + if (type.flags & TypeFlags.Intrinsic) { + return (type).intrinsicName; + } + if (type.flags & TypeFlags.Reference) { + return typeReferenceToString(type); + } + if (type.flags & (TypeFlags.Class | TypeFlags.Interface | TypeFlags.Enum | TypeFlags.TypeParameter)) { + return symbolToString(type.symbol); + } + if (type.flags & TypeFlags.Anonymous) { + return anonymousTypeToString(type); + } + if (type.flags & TypeFlags.StringLiteral) { + return (type).text; + } + // Should never get here + return "{ ... }"; + } + + function typeReferenceToString(type: TypeReference): string { + if (type.target === globalArrayType && !printArrayAsGenericType) { + return typeToString(type.typeArguments[0]) + "[]"; + } + var result = symbolToString(type.target.symbol); + result += "<"; + for (var i = 0; i < type.typeArguments.length; i++) { + if (i > 0) result += ", "; + result += typeToString(type.typeArguments[i]); + } + result += ">"; + return result; + } + + function anonymousTypeToString(type: ObjectType): string { + // Always use 'typeof T' for type of class, enum, and module objects + if (type.symbol && type.symbol.flags & (SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { + return symbolTypeToString(type); + } + // Use 'typeof T' for types of functions and methods that circularly reference themselves + if (type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method)) { + if (typeStack && contains(typeStack, type)) { + return symbolTypeToString(type); + } + } + if (!typeStack) typeStack = []; + typeStack.push(type); + var result = literalTypeToString(type); + typeStack.pop(); + return result; + } + + function symbolTypeToString(type: ObjectType): string { + return "typeof " + symbolToString(type.symbol); + } + + function literalTypeToString(type: ObjectType): string { + var resolved = resolveObjectTypeMembers(type); + if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + return "{}"; + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + return signatureToString(resolved.callSignatures[0], /*arrowStyle*/ true); + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + return "new " + signatureToString(resolved.constructSignatures[0], /*arrowStyle*/ true); + } + } + var result = "{ "; + for (var i = 0; i < resolved.callSignatures.length; i++) { + result += signatureToString(resolved.callSignatures[i]); + result += "; "; + } + for (var i = 0; i < resolved.constructSignatures.length; i++) { + result += "new "; + result += signatureToString(resolved.constructSignatures[i]); + result += "; "; + } + if (resolved.stringIndexType) { + result += "[x: string]: "; + result += typeToString(resolved.stringIndexType); + result += "; "; + } + if (resolved.numberIndexType) { + result += "[x: number]: "; + result += typeToString(resolved.numberIndexType); + result += "; "; + } + for (var i = 0; i < resolved.properties.length; i++) { + var p = resolved.properties[i]; + var t = getTypeOfSymbol(p); + if (p.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfType(t).length) { + var signatures = getSignaturesOfType(t, SignatureKind.Call); + for (var j = 0; j < signatures.length; j++) { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += signatureToString(signatures[j]); + result += "; "; + } + } + else { + result += symbolToString(p); + if (isOptionalProperty(p)) { + result += "?"; + } + result += ": "; + result += typeToString(t); + result += "; "; + } + } + result += "}"; + return result; + } + + function signatureToString(signature: Signature, arrowStyle?: boolean): string { + var result = ""; + if (signature.typeParameters) { + result += "<"; + for (var i = 0; i < signature.typeParameters.length; i++) { + if (i > 0) result += ", "; + var tp = signature.typeParameters[i]; + result += symbolToString(tp.symbol); + var constraint = getConstraintOfTypeParameter(tp); + if (constraint) { + result += " extends "; + result += typeToString(constraint); + } + } + result += ">"; + } + result += "("; + for (var i = 0; i < signature.parameters.length; i++) { + if (i > 0) result += ", "; + var p = signature.parameters[i]; + if (getDeclarationFlagsFromSymbol(p) & NodeFlags.Rest) { + result += "..."; + } + result += symbolToString(p); + if (p.valueDeclaration.flags & NodeFlags.QuestionMark || (p.valueDeclaration).initializer) { + result += "?"; + } + result += ": "; + result += typeToString(getTypeOfSymbol(p)); + } + result += arrowStyle ? ") => " : "): "; + result += typeToString(getReturnTypeOfSignature(signature)); + return result; + } + } + + function getApparentType(type: Type): ApparentType { + if (type.flags & TypeFlags.TypeParameter) { + do { + type = getConstraintOfTypeParameter(type); + } while (type && type.flags & TypeFlags.TypeParameter); + if (!type) type = emptyObjectType; + } + if (type.flags & TypeFlags.StringLike) { + type = globalStringType; + } + else if (type.flags & TypeFlags.NumberLike) { + type = globalNumberType; + } + else if (type.flags & TypeFlags.Boolean) { + type = globalBooleanType; + } + return type; + } + + function getTypeOfPrototypeProperty(prototype: Symbol): Type { + // TypeScript 1.0 spec (April 2014): 8.4 + // Every class automatically contains a static property member named 'prototype', + // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. + // It is an error to explicitly declare a static property member with the name 'prototype'. + var classType = getDeclaredTypeOfSymbol(prototype.parent); + return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, _ => anyType)) : classType; + } + + function getTypeOfVariableDeclaration(declaration: VariableDeclaration): Type { + var type: Type; + + if (declaration.parent.kind === SyntaxKind.CatchBlock || declaration.parent.kind === SyntaxKind.ForInStatement) { + type = anyType; + } + else if (declaration.type) { + type = getTypeFromTypeNode(declaration.type); + } + else { + // TypeScript 1.0 spec (April 2014): + // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. + // If neither accessor includes a type annotation, the inferred return type of the get accessor becomes the parameter type of the set accessor. + if (declaration.kind === SyntaxKind.Parameter && declaration.parent.kind === SyntaxKind.SetAccessor) { + var getter = getDeclarationOfKind(declaration.parent.symbol, SyntaxKind.GetAccessor); + if (getter) { + //getReturnTypeOfSignature will check both type annotation and return type inferred from body + type = getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); + } + } + + var unwidenedType: Type; + + if (!type) { + if (declaration.initializer) { + unwidenedType = checkAndMarkExpression(declaration.initializer); + type = getWidenedType(unwidenedType); + } + else if (declaration.flags & NodeFlags.Rest) { + type = createArrayType(anyType); + } + else { + type = anyType; + } + } + + if (program.getCompilerOptions().noImplicitAny && shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type, unwidenedType)) { + reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration, type); + } + } + + return type; + + function shouldReportNoImplicitAnyOnVariableOrParameterOrProperty(declaration: VariableDeclaration, type: Type, unwidenedType: Type): boolean { + // If we attempted to widen, the resulting type has to be a different. + if (type === unwidenedType) { + return false; + } + + // We need to have ended up with 'any', 'any[]', 'any[][]', etc. + if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { + return false; + } + + // Ignore privates within ambient contexts; they exist purely for documentative purposes to avoid name clashing. + // (e.g. privates within .d.ts files do not expose type information) + if (isPrivateWithinAmbient(declaration) || (declaration.kind === SyntaxKind.Parameter && isPrivateWithinAmbient(declaration.parent))) { + return false; + } + + return true; + } + + function reportNoImplicitAnyOnVariableOrParameterOrProperty(declaration: VariableDeclaration, type: Type): void { + var varName = identifierToString(declaration.name); + var typeName = typeToString(type, /* printArrayAsGeneric */ false); + + switch (declaration.kind) { + case SyntaxKind.VariableDeclaration: + error(declaration, Diagnostics.Variable_0_implicitly_has_an_1_type, varName, typeName) + break; + + case SyntaxKind.Property: + error(declaration, Diagnostics.Member_0_implicitly_has_an_1_type, varName, typeName) + break; + + case SyntaxKind.Parameter: + var funcDeclaration = declaration.parent; + + // If this is a rest parameter, we should have widened specifically to 'any[]'. + if (declaration.flags & NodeFlags.Rest) { + error(declaration, Diagnostics.Rest_parameter_0_implicitly_has_an_any_type, varName) + } + else { + error(declaration, Diagnostics.Parameter_0_implicitly_has_an_1_type, varName, typeName) + } + + break; + + default: + Debug.fail("Received a '" + SyntaxKind[declaration.kind] + "', but expected '" + + SyntaxKind[SyntaxKind.VariableDeclaration] + "', '" + + SyntaxKind[SyntaxKind.Property] + "', or '" + + SyntaxKind[SyntaxKind.Parameter] + "'.\r\n"); + } + } + + } + + function getTypeOfVariableOrParameterOrProperty(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + if (symbol.flags & SymbolFlags.Prototype) { + links.type = getTypeOfPrototypeProperty(symbol); + } + else { + links.type = resolvingType; + var type = getTypeOfVariableDeclaration(symbol.valueDeclaration); + if (links.type === resolvingType) { + links.type = type; + } + } + } + + else if (links.type === resolvingType) { + links.type = anyType; + } + + return links.type; + + } + + function getSetAccessorTypeAnnotationNode(accessor: AccessorDeclaration): TypeNode { + return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; + } + + function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { + if (accessor) { + if (accessor.kind === SyntaxKind.GetAccessor) { + return accessor.type && getTypeFromTypeNode(accessor.type); + } + else { + var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + } + } + return undefined; + } + + function getTypeOfAccessors(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = resolvingType; + var getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); + var setter = getDeclarationOfKind(symbol, SyntaxKind.SetAccessor); + + var type: Type; + + // First try to see if the user specified a return type on the get-accessor. + var getterReturnType = getAnnotatedAccessorType(getter); + if (getterReturnType) { + type = getterReturnType; + } + else { + // If the user didn't specify a return type, try to use the set-accessor's parameter type. + var setterParameterType = getAnnotatedAccessorType(setter); + if (setterParameterType) { + type = setterParameterType; + } + else { + // If there are no specified types, try to infer it from the body of the get accessor if it exists. + if (getter) { + type = getReturnTypeFromBody(getter); + } + // Otherwise, fall back to 'any'. + else { + if (program.getCompilerOptions().noImplicitAny) { + error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbol.name); + } + + type = anyType; + } + } + } + + + if (links.type === resolvingType) { + links.type = type; + } + } + else if (links.type === resolvingType) { + links.type = anyType; + } + return links.type; + } + + function getTypeOfFuncClassEnumModule(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + var type = links.type = createObjectType(TypeFlags.Anonymous, symbol); + } + return links.type; + } + + function getTypeOfEnumMember(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + } + return links.type; + } + + function getTypeOfImport(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = getTypeOfSymbol(resolveImport(symbol)); + } + return links.type; + } + + function getTypeOfInstantiatedSymbol(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); + } + return links.type; + } + + function getTypeOfSymbol(symbol: Symbol): Type { + if (symbol.flags & (SymbolFlags.Variable | SymbolFlags.Property)) { + return getTypeOfVariableOrParameterOrProperty(symbol); + } + if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (symbol.flags & SymbolFlags.EnumMember) { + return getTypeOfEnumMember(symbol); + } + if (symbol.flags & SymbolFlags.Accessor) { + return getTypeOfAccessors(symbol); + } + if (symbol.flags & SymbolFlags.Import) { + return getTypeOfImport(symbol); + } + if (symbol.flags & SymbolFlags.Instantiated) { + return getTypeOfInstantiatedSymbol(symbol); + } + return unknownType; + } + + function getTargetType(type: ObjectType): Type { + return type.flags & TypeFlags.Reference ? (type).target : type; + } + + function hasBaseType(type: InterfaceType, checkBase: InterfaceType) { + return check(type); + function check(type: InterfaceType) { + var target = getTargetType(type); + return target === checkBase || forEach(target.baseTypes, check); + } + } + + // Return combined list of type parameters from all declarations of a class or interface. Elsewhere we check they're all + // the same, but even if they're not we still need the complete list to ensure instantiations supply type arguments + // for all type parameters. + function getTypeParametersOfClassOrInterface(symbol: Symbol): TypeParameter[] { + var result: TypeParameter[]; + forEach(symbol.declarations, node => { + if (node.kind === SyntaxKind.InterfaceDeclaration || node.kind === SyntaxKind.ClassDeclaration) { + var declaration = node; + if (declaration.typeParameters && declaration.typeParameters.length) { + forEach(declaration.typeParameters, node => { + var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + if (!result) { + result = [tp]; + } + else if (!contains(result, tp)) { + result.push(tp); + } + }); + } + } + }); + return result; + } + + function getDeclaredTypeOfClass(symbol: Symbol): InterfaceType { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = links.declaredType = createObjectType(TypeFlags.Class, symbol); + var typeParameters = getTypeParametersOfClassOrInterface(symbol); + if (typeParameters) { + type.flags |= TypeFlags.Reference; + type.typeParameters = typeParameters; + (type).instantiations = {}; + (type).instantiations[getTypeListId(type.typeParameters)] = type; + (type).target = type; + (type).typeArguments = type.typeParameters; + } + type.baseTypes = []; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); + if (declaration.baseType) { + var baseType = getTypeFromTypeReferenceNode(declaration.baseType); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & TypeFlags.Class) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*printArrayAsGenericType*/ false)); + } + } + else { + error(declaration.baseType, Diagnostics.A_class_may_only_extend_another_class); + } + } + } + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = emptyArray; + type.declaredConstructSignatures = emptyArray; + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); + } + return links.declaredType; + } + + function getDeclaredTypeOfInterface(symbol: Symbol): InterfaceType { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = links.declaredType = createObjectType(TypeFlags.Interface, symbol); + var typeParameters = getTypeParametersOfClassOrInterface(symbol); + if (typeParameters) { + type.flags |= TypeFlags.Reference; + type.typeParameters = typeParameters; + (type).instantiations = {}; + (type).instantiations[getTypeListId(type.typeParameters)] = type; + (type).target = type; + (type).typeArguments = type.typeParameters; + } + type.baseTypes = []; + forEach(symbol.declarations, declaration => { + if (declaration.kind === SyntaxKind.InterfaceDeclaration && (declaration).baseTypes) { + forEach((declaration).baseTypes, node => { + var baseType = getTypeFromTypeReferenceNode(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*printArrayAsGenericType*/ false)); + } + } + else { + error(node, Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + }); + } + }); + type.declaredProperties = getNamedMembers(symbol.members); + type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); + type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); + } + return links.declaredType; + } + + function getDeclaredTypeOfEnum(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(TypeFlags.Enum); + type.symbol = symbol; + links.declaredType = type; + } + return links.declaredType; + } + + function getDeclaredTypeOfTypeParameter(symbol: Symbol): TypeParameter { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var type = createType(TypeFlags.TypeParameter); + type.symbol = symbol; + if (!(getDeclarationOfKind(symbol, SyntaxKind.TypeParameter)).constraint) { + type.constraint = noConstraintType; + } + links.declaredType = type; + } + return links.declaredType; + } + + function getDeclaredTypeOfImport(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol)); + } + return links.declaredType; + } + + function getDeclaredTypeOfSymbol(symbol: Symbol): Type { + if (symbol.flags & SymbolFlags.Class) { + return getDeclaredTypeOfClass(symbol); + } + if (symbol.flags & SymbolFlags.Interface) { + return getDeclaredTypeOfInterface(symbol); + } + if (symbol.flags & SymbolFlags.Enum) { + return getDeclaredTypeOfEnum(symbol); + } + if (symbol.flags & SymbolFlags.TypeParameter) { + return getDeclaredTypeOfTypeParameter(symbol); + } + if (symbol.flags & SymbolFlags.Import) { + return getDeclaredTypeOfImport(symbol); + } + Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0); + return unknownType; + } + + function createSymbolTable(symbols: Symbol[]): SymbolTable { + var result: SymbolTable = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = symbol; + } + return result; + } + + function createInstantiatedSymbolTable(symbols: Symbol[], mapper: TypeMapper): SymbolTable { + var result: SymbolTable = {}; + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + result[symbol.name] = instantiateSymbol(symbol, mapper); + } + return result; + } + + function addInheritedMembers(symbols: SymbolTable, baseSymbols: Symbol[]) { + for (var i = 0; i < baseSymbols.length; i++) { + var s = baseSymbols[i]; + if (!hasProperty(symbols, s.name)) { + symbols[s.name] = s; + } + } + } + + function addInheritedSignatures(signatures: Signature[], baseSignatures: Signature[]) { + if (baseSignatures) { + for (var i = 0; i < baseSignatures.length; i++) { + signatures.push(baseSignatures[i]); + } + } + } + + function resolveClassOrInterfaceMembers(type: InterfaceType): void { + var members = type.symbol.members; + var callSignatures = type.declaredCallSignatures; + var constructSignatures = type.declaredConstructSignatures; + var stringIndexType = type.declaredStringIndexType; + var numberIndexType = type.declaredNumberIndexType; + if (type.baseTypes.length) { + members = createSymbolTable(type.declaredProperties); + forEach(type.baseTypes, baseType => { + addInheritedMembers(members, getPropertiesOfType(baseType)); + callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call)); + constructSignatures = concatenate(constructSignatures, getSignaturesOfType(baseType, SignatureKind.Construct)); + stringIndexType = stringIndexType || getIndexTypeOfType(baseType, IndexKind.String); + numberIndexType = numberIndexType || getIndexTypeOfType(baseType, IndexKind.Number); + }); + } + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + + function resolveTypeReferenceMembers(type: TypeReference): void { + var target = type.target; + var mapper = createTypeMapper(target.typeParameters, type.typeArguments); + var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); + var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); + var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); + var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; + var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; + forEach(target.baseTypes, baseType => { + var instantiatedBaseType = instantiateType(baseType, mapper); + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call)); + constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Construct)); + stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, IndexKind.String); + numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, IndexKind.Number); + }); + setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + + function createSignature(declaration: SignatureDeclaration, typeParameters: TypeParameter[], parameters: Symbol[], + resolvedReturnType: Type, minArgumentCount: number, hasRestParameter: boolean, hasStringLiterals: boolean): Signature { + var sig = new Signature(checker); + sig.declaration = declaration; + sig.typeParameters = typeParameters; + sig.parameters = parameters; + sig.resolvedReturnType = resolvedReturnType; + sig.minArgumentCount = minArgumentCount; + sig.hasRestParameter = hasRestParameter; + sig.hasStringLiterals = hasStringLiterals; + return sig; + } + + function cloneSignature(sig: Signature): Signature { + return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, + sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); + } + + function getDefaultConstructSignatures(classType: InterfaceType): Signature[] { + if (classType.baseTypes.length) { + var baseType = classType.baseTypes[0]; + var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), SignatureKind.Construct); + return map(baseSignatures, baseSignature => { + var signature = baseType.flags & TypeFlags.Reference ? + getSignatureInstantiation(baseSignature, (baseType).typeArguments) : cloneSignature(baseSignature); + signature.typeParameters = classType.typeParameters; + signature.resolvedReturnType = classType; + return signature; + }); + } + return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + } + + function resolveAnonymousTypeMembers(type: ObjectType) { + var symbol = type.symbol; + var members = emptySymbols; + var callSignatures = emptyArray; + var constructSignatures = emptyArray; + if (symbol.flags & SymbolFlags.HasExports) { + members = symbol.exports; + } + if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method)) { + callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & SymbolFlags.Class) { + var classType = getDeclaredTypeOfClass(symbol); + constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); + if (!constructSignatures.length) constructSignatures = getDefaultConstructSignatures(classType); + if (classType.baseTypes.length) { + var members = createSymbolTable(getNamedMembers(members)); + addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + } + } + var numberIndexType = (symbol.flags & SymbolFlags.Enum) ? stringType : undefined; + + setObjectTypeMembers(type, members, callSignatures, constructSignatures, /* stringIndexType */ undefined, numberIndexType); + } + + function resolveObjectTypeMembers(type: ObjectType): ResolvedObjectType { + if (!(type).members) { + if (type.flags & (TypeFlags.Class | TypeFlags.Interface)) { + resolveClassOrInterfaceMembers(type); + } + else if (type.flags & TypeFlags.Anonymous) { + resolveAnonymousTypeMembers(type); + } + else { + resolveTypeReferenceMembers(type); + } + } + return type; + } + + function getPropertiesOfType(type: Type): Symbol[] { + if (type.flags & TypeFlags.ObjectType) { + return resolveObjectTypeMembers(type).properties; + } + return emptyArray; + } + + function getPropertyOfType(type: Type, name: string): Symbol { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + } + } + + function getPropertyOfApparentType(type: ApparentType, name: string): Symbol { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfType(globalFunctionType, name); + if (symbol) return symbol; + } + return getPropertyOfType(globalObjectType, name); + } + } + + function getSignaturesOfType(type: Type, kind: SignatureKind): Signature[] { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === SignatureKind.Call ? resolved.callSignatures : resolved.constructSignatures; + } + return emptyArray; + } + + function getIndexTypeOfType(type: Type, kind: IndexKind): Type { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + return kind === IndexKind.String ? resolved.stringIndexType : resolved.numberIndexType; + } + } + + // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual + // type checking functions). + function getTypeParametersFromDeclaration(typeParameterDeclarations: TypeParameterDeclaration[]): TypeParameter[] { + var result: TypeParameter[] = []; + forEach(typeParameterDeclarations, node => { + var tp = getDeclaredTypeOfTypeParameter(node.symbol); + if (!contains(result, tp)) { + result.push(tp); + } + }); + return result; + } + + function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature { + var links = getNodeLinks(declaration); + if (!links.resolvedSignature) { + var classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClass((declaration.parent).symbol) : undefined; + var typeParameters = classType ? classType.typeParameters : + declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + var parameters: Symbol[] = []; + var hasStringLiterals = false; + var minArgumentCount = -1; + for (var i = 0, n = declaration.parameters.length; i < n; i++) { + var param = declaration.parameters[i]; + parameters.push(param.symbol); + if (param.type && param.type.kind === SyntaxKind.StringLiteral) { + hasStringLiterals = true; + } + if (minArgumentCount < 0) { + if (param.initializer || param.flags & (NodeFlags.QuestionMark | NodeFlags.Rest)) { + minArgumentCount = i; + } + } + } + + if (minArgumentCount < 0) { + minArgumentCount = declaration.parameters.length; + } + + var returnType: Type; + if (classType) { + returnType = classType; + } + else if (declaration.type) { + returnType = getTypeFromTypeNode(declaration.type); + } + else { + // TypeScript 1.0 spec (April 2014): + // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. + if (declaration.kind === SyntaxKind.GetAccessor) { + var setter = getDeclarationOfKind(declaration.symbol, SyntaxKind.SetAccessor); + returnType = getAnnotatedAccessorType(setter); + } + + if (!returnType && !(declaration).body) { + returnType = anyType; + } + } + + links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, + minArgumentCount, hasRestParameters(declaration), hasStringLiterals); + } + return links.resolvedSignature; + } + + function getSignaturesOfSymbol(symbol: Symbol): Signature[] { + if (!symbol) return emptyArray; + var result: Signature[] = []; + for (var i = 0, len = symbol.declarations.length; i < len; i++) { + var node = symbol.declarations[i]; + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + // Don't include signature if node is the implementation of an overloaded function. A node is considered + // an implementation node if it has a body and the previous node is of the same kind and immediately + // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). + if (i > 0 && (node).body) { + var previous = symbol.declarations[i - 1]; + if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { + break; + } + } + result.push(getSignatureFromDeclaration(node)); + } + } + return result; + } + + function getReturnTypeOfSignature(signature: Signature): Type { + if (!signature.resolvedReturnType) { + signature.resolvedReturnType = resolvingType; + if (signature.target) { + var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + } + else { + var type = getReturnTypeFromBody(signature.declaration); + } + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = type; + } + } + else if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = anyType; + } + return signature.resolvedReturnType; + } + + function getRestTypeOfSignature(signature: Signature): Type { + if (signature.hasRestParameter) { + var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (type.flags & TypeFlags.Reference && (type).target === globalArrayType) { + return (type).typeArguments[0]; + } + } + return anyType; + } + + function getSignatureInstantiation(signature: Signature, typeArguments: Type[]): Signature { + return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); + } + + function getErasedSignature(signature: Signature): Signature { + if (!signature.typeParameters) return signature; + if (!signature.erasedSignatureCache) { + if (signature.target) { + signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); + } + else { + signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); + } + } + return signature.erasedSignatureCache; + } + + function getOrCreateTypeFromSignature(signature: Signature): ObjectType { + // There are two ways to declare a construct signature, one is by declaring a class constructor + // using the constructor keyword, and the other is declaring a bare construct signature in an + // object type literal or interface (using the new keyword). Each way of declaring a constructor + // will result in a different declaration kind. + if (!signature.isolatedSignatureType) { + var isConstructor = signature.declaration.kind === SyntaxKind.Constructor || signature.declaration.kind === SyntaxKind.ConstructSignature; + var type = createObjectType(TypeFlags.Anonymous | TypeFlags.FromSignature); + type.members = emptySymbols; + type.properties = emptyArray; + type.callSignatures = !isConstructor ? [signature] : emptyArray; + type.constructSignatures = isConstructor ? [signature] : emptyArray; + signature.isolatedSignatureType = type; + } + + return signature.isolatedSignatureType; + } + + function getIndexSymbol(symbol: Symbol): Symbol { + return symbol.members["__index"]; + } + + function getIndexDeclarationOfSymbol(symbol: Symbol, kind: IndexKind): SignatureDeclaration { + var syntaxKind = kind === IndexKind.Number ? SyntaxKind.NumberKeyword : SyntaxKind.StringKeyword; + var indexSymbol = getIndexSymbol(symbol); + if (indexSymbol) { + var len = indexSymbol.declarations.length; + for (var i = 0; i < len; i++) { + var node = indexSymbol.declarations[i]; + if (node.parameters.length === 1) { + var parameter = node.parameters[0]; + if (parameter && parameter.type && parameter.type.kind === syntaxKind) { + return node; + } + } + } + } + + return undefined; + } + + function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { + var declaration = getIndexDeclarationOfSymbol(symbol, kind); + return declaration + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType + : undefined; + } + + function getConstraintOfTypeParameter(type: TypeParameter): Type { + if (!type.constraint) { + if (type.target) { + var targetConstraint = getConstraintOfTypeParameter(type.target); + type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + } + else { + type.constraint = getTypeFromTypeNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + } + } + return type.constraint === noConstraintType ? undefined : type.constraint; + } + + function getTypeListId(types: Type[]) { + switch (types.length) { + case 1: + return "" + types[0].id; + case 2: + return types[0].id + "," + types[1].id; + default: + var result = ""; + for (var i = 0; i < types.length; i++) { + if (i > 0) result += ","; + result += types[i].id; + } + return result; + } + } + + function createTypeReference(target: GenericType, typeArguments: Type[]): TypeReference { + var id = getTypeListId(typeArguments); + var type = target.instantiations[id]; + if (!type) { + type = target.instantiations[id] = createObjectType(TypeFlags.Reference, target.symbol); + type.target = target; + type.typeArguments = typeArguments; + } + return type; + } + + function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode, typeParameterSymbol: Symbol): boolean { + var links = getNodeLinks(typeReferenceNode); + if (links.isIllegalTypeReferenceInConstraint !== undefined) { + return links.isIllegalTypeReferenceInConstraint; + } + + // bubble up to the declaration + var currentNode: Node = typeReferenceNode; + // forEach === exists + while (!forEach(typeParameterSymbol.declarations, d => d.parent === currentNode.parent)) { + currentNode = currentNode.parent; + } + // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal + links.isIllegalTypeReferenceInConstraint = currentNode.kind === SyntaxKind.TypeParameter; + return links.isIllegalTypeReferenceInConstraint; + } + + function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter: TypeParameterDeclaration): void { + var typeParameterSymbol: Symbol; + function check(n: Node): void { + if (n.kind === SyntaxKind.TypeReference && (n).typeName.kind === SyntaxKind.Identifier) { + var links = getNodeLinks(n); + if (links.isIllegalTypeReferenceInConstraint === undefined) { + var symbol = resolveName(typeParameter, ((n).typeName).text, SymbolFlags.Type, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + if (symbol && (symbol.flags & SymbolFlags.TypeParameter)) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // Type parameters declared in a particular type parameter list + // may not be referenced in constraints in that type parameter list + + // symbol.declaration.parent === typeParameter.parent + // -> typeParameter and symbol.declaration originate from the same type parameter list + // -> illegal for all declarations in symbol + // forEach === exists + links.isIllegalTypeReferenceInConstraint = forEach(symbol.declarations, d => d.parent == typeParameter.parent); + } + } + if (links.isIllegalTypeReferenceInConstraint) { + error(typeParameter, Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); + } + } + forEachChild(n, check); + } + + if (typeParameter.constraint) { + typeParameterSymbol = getSymbolOfNode(typeParameter); + check(typeParameter.constraint); + } + } + + function getTypeFromTypeReferenceNode(node: TypeReferenceNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = resolveEntityName(node, node.typeName, SymbolFlags.Type); + if (symbol) { + var type: Type; + if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // Type parameters declared in a particular type parameter list + // may not be referenced in constraints in that type parameter list + // Implementation: such type references are resolved to 'unknown' type that usually denotes error + type = unknownType; + } + else { + type = getDeclaredTypeOfSymbol(symbol); + if (type.flags & (TypeFlags.Class | TypeFlags.Interface) && type.flags & TypeFlags.Reference) { + var typeParameters = (type).typeParameters; + if (node.typeArguments && node.typeArguments.length === typeParameters.length) { + type = createTypeReference(type, map(node.typeArguments, t => getTypeFromTypeNode(t))); + } + else { + error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*printArrayAsGenericType*/ true), typeParameters.length); + type = undefined; + } + } + else { + if (node.typeArguments) { + error(node, Diagnostics.Type_0_is_not_generic, typeToString(type, /*printArrayAsGenericType*/ false)); + type = undefined; + } + } + } + } + links.resolvedType = type || unknownType; + } + return links.resolvedType; + } + + function getTypeFromTypeQueryNode(node: TypeQueryNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // The expression is processed as an identifier expression (section 4.3) + // or property access expression(section 4.10), + // the widened type(section 3.9) of which becomes the result. + links.resolvedType = getWidenedType(checkExpression(node.exprName)); + } + return links.resolvedType; + } + + function getGlobalType(name: string, arity: number = 0): ObjectType { + + function getTypeDeclaration(symbol: Symbol): Declaration { + var declarations = symbol.declarations; + for (var i = 0; i < declarations.length; i++) { + var declaration = declarations[i]; + switch (declaration.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.TypeLiteral: + case SyntaxKind.FunctionDeclaration: + return declaration; + } + } + } + + var symbol = resolveName(undefined, name, SymbolFlags.Type, Diagnostics.Cannot_find_global_type_0, name); + if (!symbol) { + return emptyObjectType; + } + var type = getDeclaredTypeOfSymbol(symbol); + if (!(type.flags & TypeFlags.ObjectType)) { + error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, name); + return emptyObjectType; + } + if (((type).typeParameters ? (type).typeParameters.length : 0) !== arity) { + error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, name, arity); + return emptyObjectType; + } + return type; + } + + function createArrayType(elementType: Type): Type { + return globalArrayType !== emptyObjectType ? createTypeReference(globalArrayType, [elementType]) : emptyObjectType; + } + + function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); + } + return links.resolvedType; + } + + function getTypeFromTypeLiteralNode(node: TypeLiteralNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var symbol = node.symbol; + var members = symbol.members; + var callSignatures = getSignaturesOfSymbol(members["__call"]); + var constructSignatures = getSignaturesOfSymbol(members["__new"]); + var stringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); + var numberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); + links.resolvedType = createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + } + return links.resolvedType; + } + + function getStringLiteralType(node: StringLiteralTypeNode): StringLiteralType { + if (hasProperty(stringLiteralTypes, node.text)) return stringLiteralTypes[node.text]; + var type = stringLiteralTypes[node.text] = createType(TypeFlags.StringLiteral); + type.text = getSourceTextOfNode(node); + return type; + } + + function getTypeFromStringLiteral(node: StringLiteralTypeNode): Type { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getStringLiteralType(node); + } + return links.resolvedType; + } + + function getTypeFromTypeNode(node: TypeNode): Type { + switch (node.kind) { + case SyntaxKind.AnyKeyword: + return anyType; + case SyntaxKind.StringKeyword: + return stringType; + case SyntaxKind.NumberKeyword: + return numberType; + case SyntaxKind.BooleanKeyword: + return booleanType; + case SyntaxKind.VoidKeyword: + return voidType; + case SyntaxKind.StringLiteral: + return getTypeFromStringLiteral(node); + case SyntaxKind.TypeReference: + return getTypeFromTypeReferenceNode(node); + case SyntaxKind.TypeQuery: + return getTypeFromTypeQueryNode(node); + case SyntaxKind.ArrayType: + return getTypeFromArrayTypeNode(node); + case SyntaxKind.TypeLiteral: + return getTypeFromTypeLiteralNode(node); + default: + return unknownType; + } + } + + function instantiateList(items: T[], mapper: TypeMapper, instantiator: (item: T, mapper: TypeMapper) => T): T[] { + if (items && items.length) { + var result: T[] = []; + for (var i = 0; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } + return items; + } + + function createUnaryTypeMapper(source: Type, target: Type): TypeMapper { + return t => t === source ? target : t; + } + + function createBinaryTypeMapper(source1: Type, target1: Type, source2: Type, target2: Type): TypeMapper { + return t => t === source1 ? target1 : t === source2 ? target2 : t; + } + + function createTypeMapper(sources: Type[], targets: Type[]): TypeMapper { + switch (sources.length) { + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + } + return t => { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) return targets[i]; + } + return t; + }; + } + + function createUnaryTypeEraser(source: Type): TypeMapper { + return t => t === source ? anyType : t; + } + + function createBinaryTypeEraser(source1: Type, source2: Type): TypeMapper { + return t => t === source1 || t === source2 ? anyType : t; + } + + function createTypeEraser(sources: Type[]): TypeMapper { + switch (sources.length) { + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); + } + return t => { + for (var i = 0; i < sources.length; i++) { + if (t === sources[i]) return anyType; + } + return t; + }; + } + + function createInferenceMapper(context: InferenceContext): TypeMapper { + return t => { + for (var i = 0; i < context.typeParameters.length; i++) { + if (t === context.typeParameters[i]) { + return getInferredType(context, i); + } + } + return t; + } + } + + function identityMapper(type: Type): Type { + return type; + } + + function combineTypeMappers(mapper1: TypeMapper, mapper2: TypeMapper): TypeMapper { + return t => mapper2(mapper1(t)); + } + + function instantiateTypeParameter(typeParameter: TypeParameter, mapper: TypeMapper): TypeParameter { + var result = createType(TypeFlags.TypeParameter); + result.symbol = typeParameter.symbol; + if (typeParameter.constraint) { + result.constraint = instantiateType(typeParameter.constraint, mapper); + } + else { + result.target = typeParameter; + result.mapper = mapper; + } + return result; + } + + function instantiateSignature(signature: Signature, mapper: TypeMapper, eraseTypeParameters?: boolean): Signature { + if (signature.typeParameters && !eraseTypeParameters) { + var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + } + var result = createSignature(signature.declaration, freshTypeParameters, + instantiateList(signature.parameters, mapper, instantiateSymbol), + signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, + signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); + result.target = signature; + result.mapper = mapper; + return result; + } + + function instantiateSymbol(symbol: Symbol, mapper: TypeMapper): Symbol { + if (symbol.flags & SymbolFlags.Instantiated) { + var links = getSymbolLinks(symbol); + // If symbol being instantiated is itself a instantiation, fetch the original target and combine the + // type mappers. This ensures that original type identities are properly preserved and that aliases + // always reference a non-aliases. + symbol = links.target; + mapper = combineTypeMappers(links.mapper, mapper); + } + + // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and + // also transient so that we can just store data on it directly. + var result = createSymbol(SymbolFlags.Instantiated | SymbolFlags.Transient, symbol.name); + result.declarations = symbol.declarations; + result.parent = symbol.parent; + result.target = symbol; + result.mapper = mapper; + if (symbol.valueDeclaration) { + result.valueDeclaration = symbol.valueDeclaration; + } + + return result; + } + + function instantiateAnonymousType(type: ObjectType, mapper: TypeMapper): ObjectType { + var result = createObjectType(TypeFlags.Anonymous, type.symbol); + result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); + result.members = createSymbolTable(result.properties); + result.callSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Call), mapper, instantiateSignature); + result.constructSignatures = instantiateList(getSignaturesOfType(type, SignatureKind.Construct), mapper, instantiateSignature); + var stringIndexType = getIndexTypeOfType(type, IndexKind.String); + var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); + if (stringIndexType) result.stringIndexType = instantiateType(stringIndexType, mapper); + if (numberIndexType) result.numberIndexType = instantiateType(numberIndexType, mapper); + return result; + } + + function instantiateType(type: Type, mapper: TypeMapper): Type { + if (type.flags & TypeFlags.TypeParameter) { + return mapper(type); + } + if (type.flags & TypeFlags.Anonymous) { + return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) ? + instantiateAnonymousType(type, mapper) : type; + } + if (type.flags & TypeFlags.Reference) { + return createTypeReference((type).target, instantiateList((type).typeArguments, mapper, instantiateType)); + } + return type; + } + + // Returns true if the given expression contains (at any level of nesting) a function or arrow expression + // that is subject to contextual typing. + function isContextSensitiveExpression(node: Expression): boolean { + switch (node.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return !(node).typeParameters && !forEach((node).parameters, p => p.type); + case SyntaxKind.ObjectLiteral: + return forEach((node).properties, p => + p.kind === SyntaxKind.PropertyAssignment && isContextSensitiveExpression((p).initializer)); + case SyntaxKind.ArrayLiteral: + return forEach((node).elements, e => isContextSensitiveExpression(e)); + case SyntaxKind.ConditionalExpression: + return isContextSensitiveExpression((node).whenTrue) || + isContextSensitiveExpression((node).whenFalse); + case SyntaxKind.BinaryExpression: + return (node).operator === SyntaxKind.BarBarToken && + (isContextSensitiveExpression((node).left) || isContextSensitiveExpression((node).right)); + } + return false; + } + + function getTypeWithoutConstructors(type: Type): Type { + if (type.flags & TypeFlags.ObjectType) { + var resolved = resolveObjectTypeMembers(type); + if (resolved.constructSignatures.length) { + var result = createObjectType(TypeFlags.Anonymous, type.symbol); + result.members = resolved.members; + result.properties = resolved.properties; + result.callSignatures = resolved.callSignatures; + result.constructSignatures = emptyArray; + type = result; + } + } + return type; + } + + // TYPE CHECKING + + var subtypeRelation: Map = {}; + var assignableRelation: Map = {}; + var identityRelation: Map = {}; + + function isTypeIdenticalTo(source: Type, target: Type): boolean { + return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function isTypeSubtypeOf(source: Type, target: Type): boolean { + return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + } + + function isTypeAssignableTo(source: Type, target: Type): boolean { + return checkTypeAssignableTo(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + } + + function isTypeRelatedTo(source: Type, target: Type, relation: Map): boolean { + return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function isSignatureAssignableTo(source: Signature, target: Signature): boolean { + var sourceType = getOrCreateTypeFromSignature(source); + var targetType = getOrCreateTypeFromSignature(target); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean { + return isPropertyIdenticalToRecursive(sourceProp, targetProp, /*reportErrors*/ false, (s, t, _reportErrors) => isTypeIdenticalTo(s, t)); + } + + function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { + if (!type.baseTypes.length) { + return true; + } + + var seen: Map<{ prop: Symbol; containingType: Type }> = {}; + forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); + var ok = true; + + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + + var typeName1 = typeToString(existing.containingType, /*printArrayAsGenericType*/ false); + var typeName2 = typeToString(base, /*printArrayAsGenericType*/ false); + + var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type, /*printArrayAsGenericType*/ false), typeName1, typeName2); + addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + } + } + } + } + + return ok; + } + + function isPropertyIdenticalToRecursive(sourceProp: Symbol, targetProp: Symbol, reportErrors: boolean, relate: (source: Type, target: Type, reportErrors: boolean) => boolean): boolean { + Debug.assert(sourceProp); + if (!targetProp) { + return false; + } + + // Two members are considered identical when + // - they are public properties with identical names, optionality, and types, + // - they are private properties originating in the same declaration and having identical types + var sourcePropIsPrivate = getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private; + var targetPropIsPrivate = getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private; + if (sourcePropIsPrivate !== targetPropIsPrivate) { + return false; + } + + if (sourcePropIsPrivate) { + return (getTargetSymbol(sourceProp).parent === getTargetSymbol(targetProp).parent) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + } + else { + return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + } + } + + function checkTypeRelatedTo(source: Type, target: Type, relation: Map, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + var errorInfo: DiagnosticMessageChain; + var sourceStack: ObjectType[]; + var targetStack: ObjectType[]; + var expandingFlags: number; + var depth = 0; + var overflow = false; + + Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); + + var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + if (overflow) { + error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source, /*printArrayAsGenericType*/ false), typeToString(target, /*printArrayAsGenericType*/ false)); + } + else if (errorInfo) { + addDiagnostic(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + } + return result; + + function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string): void { + errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1); + } + + function isRelatedTo(source: Type, target: Type, reportErrors: boolean): boolean { + return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + + function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + if (relation === identityRelation) { + // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases + if (source === target) return true; + } + else { + if (source === target) return true; + if (target.flags & TypeFlags.Any) return true; + if (source === undefinedType) return true; + if (source === nullType && target !== undefinedType) return true; + if (source.flags & TypeFlags.Enum && target === numberType) return true; + if (source.flags & TypeFlags.StringLiteral && target === stringType) return true; + if (relation === assignableRelation) { + if (source.flags & TypeFlags.Any) return true; + if (source === numberType && target.flags & TypeFlags.Enum) return true; + } + } + + if (source.flags & TypeFlags.TypeParameter && target.flags & TypeFlags.TypeParameter) { + if (typeParameterRelatedTo(source, target, reportErrors)) { + return true; + } + } + else { + var saveErrorInfo = errorInfo; + if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { + // We have type references to same target type, see if relationship holds for all type arguments + if (typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { + return true; + } + } + // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + // identity relation does not use apparent type + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType && + objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + errorInfo = saveErrorInfo; + return true; + } + } + if (reportErrors) { + // The error should end in a period when this is the deepest error in the chain + // (when errorInfo is undefined). Otherwise, it has a colon before the nested + // error. + + chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; + terminalMessage = terminalMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; + var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; + Debug.assert(diagnosticKey); + reportError(diagnosticKey, typeToString(source, /*printArrayAsGenericType*/ false), typeToString(target, /*printArrayAsGenericType*/ false)); + } + return false; + } + + function typesRelatedTo(sources: Type[], targets: Type[], reportErrors: boolean): boolean { + for (var i = 0, len = sources.length; i < len; i++) { + if (!isRelatedTo(sources[i], targets[i], reportErrors)) return false; + } + return true; + } + + function typeParameterRelatedTo(source: TypeParameter, target: TypeParameter, reportErrors: boolean): boolean { + if (relation === identityRelation) { + if (source.symbol.name !== target.symbol.name) { + return false; + } + + // covers case when both type parameters does not have constraint (both equal to noConstraintType) + if (source.constraint === target.constraint) { + return true; + } + + if (source.constraint === noConstraintType || target.constraint === noConstraintType) { + return false; + } + + return isRelatedTo(source.constraint, target.constraint, reportErrors); + } + else { + while (true) { + var constraint = getConstraintOfTypeParameter(source); + if (constraint === target) return true; + if (!(constraint && constraint.flags & TypeFlags.TypeParameter)) break; + source = constraint; + } + return false; + } + } + + // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. + // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are + // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion + // and issue an error. Otherwise, actually compare the structure of the two types. + function objectTypeRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + if (overflow) return false; + var result: boolean; + var id = source.id + "," + target.id; + if ((result = relation[id]) !== undefined) return result; + if (depth > 0) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) return true; + } + if (depth === 100) { + overflow = true; + return false; + } + } + else { + sourceStack = []; + targetStack = []; + expandingFlags = 0; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + var saveExpandingFlags = expandingFlags; + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; + if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; + result = expandingFlags === 3 || + propertiesRelatedTo(source, target, reportErrors) && + signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors) && + signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors) && + stringIndexTypesRelatedTo(source, target, reportErrors) && + numberIndexTypesRelatedTo(source, target, reportErrors); + expandingFlags = saveExpandingFlags; + depth--; + if (depth === 0) { + relation[id] = result; + } + return result; + } + + // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case + // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. + // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at + // some level beyond that. + function isDeeplyNestedGeneric(type: ObjectType, stack: ObjectType[]): boolean { + if (type.flags & TypeFlags.Reference && depth >= 10) { + var target = (type).target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & TypeFlags.Reference && (t).target === target) { + count++; + if (count >= 10) return true; + } + } + } + return false; + } + + function propertiesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + if (relation === identityRelation) { + return propertiesAreIdenticalTo(source, target, reportErrors); + } + else { + return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); + } + } + + function propertiesAreIdenticalTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + if (source === target) { + return true; + } + + var sourceProperties = getPropertiesOfType(source); + var targetProperties = getPropertiesOfType(target); + if (sourceProperties.length !== targetProperties.length) { + return false; + } + + for (var i = 0, len = sourceProperties.length; i < len; ++i) { + var sourceProp = sourceProperties[i]; + var targetProp = getPropertyOfType(target, sourceProp.name); + + if (!isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { + return false; + } + } + + return true; + } + + function propertiesAreSubtypeOrAssignableTo(source: ApparentType, target: ObjectType, reportErrors: boolean): boolean { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfApparentType(source, targetProp.name); + if (sourceProp === targetProp) { + continue; + } + + var targetPropIsOptional = isOptionalProperty(targetProp); + if (!sourceProp) { + if (!targetPropIsOptional) { + if (reportErrors) { + reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source, /*printArrayAsGenericType*/ false)); + } + return false; + } + } + else if (sourceProp !== targetProp) { + if (targetProp.flags & SymbolFlags.Prototype) { + continue; + } + + if (getDeclarationFlagsFromSymbol(sourceProp) & NodeFlags.Private || getDeclarationFlagsFromSymbol(targetProp) & NodeFlags.Private) { + if (reportErrors) { + reportError(Diagnostics.Private_property_0_cannot_be_reimplemented, symbolToString(targetProp)); + } + return false; + } + if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + if (reportErrors) { + reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + } + return false; + } + else if (isOptionalProperty(sourceProp) && !targetPropIsOptional) { + // TypeScript 1.0 spec (April 2014): 3.8.3 + // S is a subtype of a type T, and T is a supertype of S if ... + // S' and T are object types and, for each member M in T.. + // M is a property and S' contains a property N where + // if M is a required property, N is also a required property + // (M - property in T) + // (N - property in S) + if (reportErrors) { + reportError(Diagnostics.Required_property_0_cannot_be_reimplemented_with_optional_property_in_1, targetProp.name, typeToString(source, /*printArrayAsGenericType*/ false)); + } + return false; + } + } + } + return true; + } + + function signaturesRelatedTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + if (relation === identityRelation) { + return areSignaturesIdenticalTo(source, target, kind, reportErrors); + } + else { + return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); + } + } + + function areSignaturesIdenticalTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return false; + } + + for (var i = 0, len = sourceSignatures.length; i < len; ++i) { + if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { + return false; + } + } + + return true; + } + + function isSignatureIdenticalTo(source: Signature, target: Signature, reportErrors: boolean): boolean { + if (source === target) { + return true; + } + + if (source.hasRestParameter !== target.hasRestParameter) { + return false; + } + + if (source.parameters.length !== target.parameters.length) { + return false; + } + + if (source.minArgumentCount !== target.minArgumentCount) { + return false; + } + + if (source.typeParameters && target.typeParameters) { + if (source.typeParameters.length !== target.typeParameters.length) { + return false; + } + + for (var i = 0, len = source.typeParameters.length; i < len; ++i) { + if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { + return false; + } + } + } + else if (source.typeParameters || source.typeParameters) { + return false; + } + + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0, len = source.parameters.length; i < len; i++) { + var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); + var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); + if (!isRelatedTo(s, t, reportErrors)) { + return false; + } + } + var t = getReturnTypeOfSignature(target); + var s = getReturnTypeOfSignature(source); + return isRelatedTo(s, t, reportErrors); + } + + function areSignaturesSubtypeOrAssignableTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + if (target === anyFunctionType || source === anyFunctionType) return true; + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var saveErrorInfo = errorInfo; + outer: for (var i = 0; i < targetSignatures.length; i++) { + var t = targetSignatures[i]; + if (!t.hasStringLiterals || target.flags & TypeFlags.FromSignature) { + var localErrors = reportErrors; + for (var j = 0; j < sourceSignatures.length; j++) { + var s = sourceSignatures[j]; + if (!s.hasStringLiterals || source.flags & TypeFlags.FromSignature) { + if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { + errorInfo = saveErrorInfo; + continue outer; + } + // Only report errors from the first failure + localErrors = false; + } + } + return false; + } + } + return true; + } + + function isSignatureSubtypeOrAssignableTo(source: Signature, target: Signature, reportErrors: boolean): boolean { + if (source === target) { + return true; + } + + if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { + return false; + } + + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount: number; + if (source.hasRestParameter && target.hasRestParameter) { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N + source = getErasedSignature(source); + target = getErasedSignature(target); + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var saveErrorInfo = errorInfo; + if (!isRelatedTo(s, t, reportErrors)) { + if (!isRelatedTo(t, s, false)) { + if (reportErrors) { + reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, + source.parameters[i < sourceMax ? i : sourceMax].name, + target.parameters[i < targetMax ? i : targetMax].name); + } + return false; + } + errorInfo = saveErrorInfo; + } + } + var t = getReturnTypeOfSignature(target); + if (t === voidType) return true; + var s = getReturnTypeOfSignature(source); + return isRelatedTo(s, t, reportErrors); + } + + function stringIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + if (relation === identityRelation) { + return areIndexTypesIdenticalTo(IndexKind.String, source, target, reportErrors); + } + else { + var targetType = getIndexTypeOfType(target, IndexKind.String); + if (targetType) { + var sourceType = getIndexTypeOfType(source, IndexKind.String); + if (!sourceType) { + if (reportErrors) { + reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, /*printArrayAsGenericType*/ false)); + } + return false; + } + if (!isRelatedTo(sourceType, targetType, reportErrors)) { + if (reportErrors) { + reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + } + + function numberIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + if (relation === identityRelation) { + return areIndexTypesIdenticalTo(IndexKind.Number, source, target, reportErrors); + } + else { + var targetType = getIndexTypeOfType(target, IndexKind.Number); + if (targetType) { + var sourceStringType = getIndexTypeOfType(source, IndexKind.String); + var sourceNumberType = getIndexTypeOfType(source, IndexKind.Number); + if (!(sourceStringType || sourceNumberType)) { + if (reportErrors) { + reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source, /*printArrayAsGenericType*/ false)); + } + return false; + } + if (sourceStringType && sourceNumberType) { + // If we know for sure we're testing both string and numeric index types then only report errors from the second one + var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + } + else { + var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + } + if (!compatible) { + if (reportErrors) { + reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + } + return false; + } + } + return true; + } + } + + function areIndexTypesIdenticalTo(indexKind: IndexKind, source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + var targetType = getIndexTypeOfType(target, indexKind); + var sourceType = getIndexTypeOfType(source, indexKind); + return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + } + } + + function isSupertypeOfEach(candidate: Type, types: Type[]): boolean { + for (var i = 0, len = types.length; i < len; i++) { + if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) return false; + } + return true; + } + + function getBestCommonType(types: Type[], contextualType?: Type, candidatesOnly?: boolean): Type { + if (contextualType && isSupertypeOfEach(contextualType, types)) return contextualType; + return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined) || (candidatesOnly ? undefined : emptyObjectType); + } + + function isTypeOfObjectLiteral(type: Type): boolean { + return (type.flags & TypeFlags.Anonymous) && type.symbol && (type.symbol.flags & SymbolFlags.ObjectLiteral) ? true : false; + } + + function getWidenedTypeOfObjectLiteral(type: Type): Type { + var properties = getPropertiesOfType(type); + if (properties.length) { + var widenedTypes: Type[] = []; + var propTypeWasWidened: boolean = false; + forEach(properties, p => { + var propType = getTypeOfSymbol(p); + var widenedType = getWidenedType(propType); + if (propType !== widenedType) { + propTypeWasWidened = true; + + if (program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType, /* printArrayAsGeneric */ false)); + } + } + widenedTypes.push(widenedType); + }); + if (propTypeWasWidened) { + var members: SymbolTable = {}; + var index = 0; + forEach(properties, p => { + var symbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, p.name); + symbol.declarations = p.declarations; + symbol.parent = p.parent; + symbol.type = widenedTypes[index++]; + if (p.valueDeclaration) symbol.valueDeclaration = p.valueDeclaration; + members[symbol.name] = symbol; + }); + var stringIndexType = getIndexTypeOfType(type, IndexKind.String); + var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); + if (stringIndexType) stringIndexType = getWidenedType(stringIndexType); + if (numberIndexType) numberIndexType = getWidenedType(numberIndexType); + type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); + } + } + return type; + } + + function isArrayType(type: Type): boolean { + return type.flags & TypeFlags.Reference && (type).target === globalArrayType; + } + + function getInnermostTypeOfNestedArrayTypes(type: Type): Type { + while (isArrayType(type)) { + type = (type).typeArguments[0]; + } + + return type; + } + + function getWidenedTypeOfArrayLiteral(type: Type): Type { + var elementType = (type).typeArguments[0]; + var widenedType = getWidenedType(elementType); + + type = elementType !== widenedType ? createArrayType(widenedType) : type; + + return type; + } + + /* If we are widening on a literal, then we may need to the 'node' parameter for reporting purposes */ + function getWidenedType(type: Type): Type { + if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) { + return anyType; + } + if (isTypeOfObjectLiteral(type)) { + return getWidenedTypeOfObjectLiteral(type); + } + if (isArrayType(type)) { + return getWidenedTypeOfArrayLiteral(type); + } + return type; + } + + function createInferenceContext(typeParameters: TypeParameter[]): InferenceContext { + var inferences: Type[][] = []; + for (var i = 0; i < typeParameters.length; i++) inferences.push([]); + return { + typeParameters: typeParameters, + inferences: inferences, + inferredTypes: new Array(typeParameters.length), + }; + } + + function inferTypes(context: InferenceContext, source: Type, target: Type) { + var sourceStack: Type[]; + var targetStack: Type[]; + var depth = 0; + inferFromTypes(source, target); + + function isInProcess(source: Type, target: Type) { + for (var i = 0; i < depth; i++) { + if (source === sourceStack[i] && target === targetStack[i]) return true; + } + return false; + } + + function isWithinDepthLimit(type: Type, stack: Type[]) { + if (depth >= 5) { + var target = (type).target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & TypeFlags.Reference && (t).target === target) count++; + } + return count < 5; + } + return true; + } + + function inferFromTypes(source: Type, target: Type) { + if (target.flags & TypeFlags.TypeParameter) { + // If target is a type parameter, make an inference + var typeParameters = context.typeParameters; + for (var i = 0; i < typeParameters.length; i++) { + if (target === typeParameters[i]) { + var inferences = context.inferences[i]; + if (!contains(inferences, source)) inferences.push(source); + break; + } + } + } + else if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { + // If source and target are references to the same generic type, infer from type arguments + var sourceTypes = (source).typeArguments; + var targetTypes = (target).typeArguments; + for (var i = 0; i < sourceTypes.length; i++) { + inferFromTypes(sourceTypes[i], targetTypes[i]); + } + } + else if (source.flags & TypeFlags.ObjectType && (target.flags & TypeFlags.Reference || (target.flags & TypeFlags.Anonymous) && + target.symbol && target.symbol.flags & (SymbolFlags.Method | SymbolFlags.TypeLiteral))) { + // If source is an object type, and target is a type reference, the type of a method, or a type literal, infer from members + if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { + if (depth === 0) { + sourceStack = []; + targetStack = []; + } + sourceStack[depth] = source; + targetStack[depth] = target; + depth++; + inferFromProperties(source, target); + inferFromSignatures(source, target, SignatureKind.Call); + inferFromSignatures(source, target, SignatureKind.Construct); + inferFromIndexTypes(source, target, IndexKind.String); + inferFromIndexTypes(source, target, IndexKind.Number); + depth--; + } + } + } + + function inferFromProperties(source: Type, target: Type) { + var properties = getPropertiesOfType(target); + for (var i = 0; i < properties.length; i++) { + var targetProp = properties[i]; + var sourceProp = getPropertyOfType(source, targetProp.name); + if (sourceProp) { + inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + } + } + + function inferFromSignatures(source: Type, target: Type, kind: SignatureKind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var sourceLen = sourceSignatures.length; + var targetLen = targetSignatures.length; + var len = sourceLen < targetLen ? sourceLen : targetLen; + for (var i = 0; i < len; i++) { + inferFromParameters(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); + } + } + + function inferFromParameters(source: Signature, target: Signature) { + var sourceMax = source.parameters.length; + var targetMax = target.parameters.length; + var checkCount: number; + if (!source.hasRestParameter && !target.hasRestParameter) { + checkCount = sourceMax < targetMax ? sourceMax : targetMax; + } + else if (source.hasRestParameter) { + sourceMax--; + checkCount = targetMax; + } + else if (target.hasRestParameter) { + targetMax--; + checkCount = sourceMax; + } + else { + checkCount = sourceMax > targetMax ? sourceMax : targetMax; + sourceMax--; + targetMax--; + } + for (var i = 0; i < checkCount; i++) { + var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + inferFromTypes(s, t); + } + inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + + function inferFromIndexTypes(source: Type, target: Type, kind: IndexKind) { + var targetIndexType = getIndexTypeOfType(target, kind); + if (targetIndexType) { + var sourceIndexType = getIndexTypeOfType(source, kind); + if (sourceIndexType) { + inferFromTypes(sourceIndexType, targetIndexType); + } + } + } + } + + function getInferredType(context: InferenceContext, index: number): Type { + var result = context.inferredTypes[index]; + if (!result) { + var commonType = getWidenedType(getBestCommonType(context.inferences[index])); + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; + context.inferredTypes[index] = result; + } + return result; + } + + function getInferredTypes(context: InferenceContext): Type[] { + for (var i = 0; i < context.inferredTypes.length; i++) { + getInferredType(context, i); + } + context.inferences = undefined; + return context.inferredTypes; + } + + function hasAncestor(node: Node, kind: SyntaxKind): boolean { + return getAncestor(node, kind) !== undefined; + } + + function getAncestor(node: Node, kind: SyntaxKind): Node { + switch (kind) { + // special-cases that can be come first + case SyntaxKind.ClassDeclaration: + while (node) { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + return node; + case SyntaxKind.EnumDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportDeclaration: + // early exit cases - declarations cannot be nested in classes + return undefined; + default: + node = node.parent; + continue; + } + } + break; + default: + while (node) { + if (node.kind === kind) { + return node; + } + else { + node = node.parent; + } + } + break; + } + + return undefined; + } + + // EXPRESSION TYPE CHECKING + + function checkIdentifier(node: Identifier): Type { + function isInTypeQuery(node: Node): boolean { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // A type query consists of the keyword typeof followed by an expression. + // The expression is restricted to a single identifier or a sequence of identifiers separated by periods + while (node) { + switch (node.kind) { + case SyntaxKind.TypeQuery: + return true; + case SyntaxKind.Identifier: + case SyntaxKind.QualifiedName: + node = node.parent; + continue; + default: + return false; + } + } + Debug.fail("should not get here"); + } + + var symbol = resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, identifierToString(node)); + if (!symbol) { + symbol = unknownSymbol; + } + + if (symbol.flags & SymbolFlags.Import) { + // Mark the import as referenced so that we emit it in the final .js file. + // exception: identifiers that appear in type queries + getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + } + + getNodeLinks(node).resolvedSymbol = symbol; + + checkCollisionWithCapturedSuperVariable(node, node); + checkCollisionWithIndexVariableInGeneratedCode(node, node); + + return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); + } + + function getThisContainer(node: Node): Node { + while (true) { + node = node.parent; + if (!node) { + return node; + } + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.SourceFile: + case SyntaxKind.ArrowFunction: + return node; + } + } + } + + function captureLexicalThis(node: Node, container: Node): void { + var classNode = container.parent && container.parent.kind === SyntaxKind.ClassDeclaration ? container.parent : undefined; + getNodeLinks(node).flags |= NodeCheckFlags.LexicalThis; + if (container.kind === SyntaxKind.Property || container.kind === SyntaxKind.Constructor) { + getNodeLinks(classNode).flags |= NodeCheckFlags.CaptureThis; + } + else { + getNodeLinks(container).flags |= NodeCheckFlags.CaptureThis; + } + } + + function checkThisExpression(node: Node): Type { + var container = getThisContainer(node); + var needToCaptureLexicalThis = false; + // skip arrow functions + while (container.kind === SyntaxKind.ArrowFunction) { + container = getThisContainer(container); + needToCaptureLexicalThis = true; + } + + switch (container.kind) { + case SyntaxKind.ModuleDeclaration: + error(node, Diagnostics.this_cannot_be_referenced_in_a_module_body); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks + break; + case SyntaxKind.EnumDeclaration: + error(node, Diagnostics.this_cannot_be_referenced_in_current_location); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks + break; + case SyntaxKind.Constructor: + if (isInConstructorArgumentInitializer(node, container)) { + error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks + } + break; + case SyntaxKind.Property: + if (container.flags & NodeFlags.Static) { + error(node, Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks + } + break; + } + + if (needToCaptureLexicalThis) { + captureLexicalThis(node, container); + } + + var classNode = container.parent && container.parent.kind === SyntaxKind.ClassDeclaration ? container.parent : undefined; + if (classNode) { + var symbol = getSymbolOfNode(classNode); + return container.flags & NodeFlags.Static ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + } + return anyType; + } + + function getSuperContainer(node: Node): Node { + while (true) { + node = node.parent; + if (!node) return node; + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return node; + } + } + } + + function isInConstructorArgumentInitializer(node: Node, constructorDecl: Node): boolean { + for (var n = node; n && n !== constructorDecl; n = n.parent) { + if (n.kind === SyntaxKind.Parameter) { + return true; + } + } + return false; + } + + function checkSuperExpression(node: Node, isCallExpression: boolean): Type { + var enclosingClass = getAncestor(node, SyntaxKind.ClassDeclaration); + var baseClass: Type; + if (enclosingClass && enclosingClass.baseType) { + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); + baseClass = classType.baseTypes.length && classType.baseTypes[0]; + } + + if (!baseClass) { + error(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); + return unknownType; + } + + var container = getSuperContainer(node); + + if (container) { + var canUseSuperExpression = false; + if (isCallExpression) { + // TS 1.0 SPEC (April 2014): 4.8.1 + // Super calls are only permitted in constructors of derived classes + canUseSuperExpression = container.kind === SyntaxKind.Constructor; + } + else { + // TS 1.0 SPEC (April 2014) + // 'super' property access is allowed + // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance + // - In a static member function or static member accessor + + // super property access might appear in arrow functions with arbitrary deep nesting + var needToCaptureLexicalThis = false; + while (container && container.kind === SyntaxKind.ArrowFunction) { + container = getSuperContainer(container); + needToCaptureLexicalThis = true; + } + + // topmost container must be something that is directly nested in the class declaration + if (container && container.parent && container.parent.kind === SyntaxKind.ClassDeclaration) { + if (container.flags & NodeFlags.Static) { + canUseSuperExpression = + container.kind === SyntaxKind.Method || + container.kind === SyntaxKind.GetAccessor || + container.kind === SyntaxKind.SetAccessor; + } + else { + canUseSuperExpression = + container.kind === SyntaxKind.Method || + container.kind === SyntaxKind.GetAccessor || + container.kind === SyntaxKind.SetAccessor || + container.kind === SyntaxKind.Property || + container.kind === SyntaxKind.Constructor; + } + } + } + + if (canUseSuperExpression) { + var returnType: Type; + + if ((container.flags & NodeFlags.Static) || isCallExpression) { + getNodeLinks(node).flags |= NodeCheckFlags.SuperStatic; + returnType = getTypeOfSymbol(baseClass.symbol); + } + else { + getNodeLinks(node).flags |= NodeCheckFlags.SuperInstance; + returnType = baseClass; + } + + if (container.kind === SyntaxKind.Constructor && isInConstructorArgumentInitializer(node, container)) { + // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) + error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + returnType = unknownType; + } + + if (!isCallExpression && needToCaptureLexicalThis) { + // call expressions are allowed only in constructors so they should always capture correct 'this' + // super property access expressions can also appear in arrow functions - + // in this case they should also use correct lexical this + captureLexicalThis(node.parent, container); + } + + return returnType; + } + } + + if (isCallExpression) { + error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } + else { + error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + } + + return unknownType; + } + + // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is + // used as a special marker for other purposes. + function isInferentialContext(mapper: TypeMapper) { + return mapper && mapper !== identityMapper; + } + + function checkArrayLiteral(node: ArrayLiteral, contextualType?: Type, contextualMapper?: TypeMapper): Type { + var contextualElementType = contextualType && getIndexTypeOfType(contextualType, IndexKind.Number); + var elementTypes: Type[] = []; + forEach(node.elements, element => { + if (element.kind !== SyntaxKind.OmittedExpression) { + var type = checkExpression(element, contextualElementType, contextualMapper); + if (!contains(elementTypes, type)) elementTypes.push(type); + } + }); + var elementType = getBestCommonType(elementTypes, isInferentialContext(contextualMapper) ? undefined : contextualElementType, true); + if (!elementType) elementType = elementTypes.length ? emptyObjectType : undefinedType; + return createArrayType(elementType); + } + + function isNumericName(name: string) { + return !isNaN(name); + } + + function getContextualTypeForProperty(type: Type, name: string) { + var prop = getPropertyOfType(type, name); + if (prop) return getTypeOfSymbol(prop); + return isNumericName(name) && getIndexTypeOfType(type, IndexKind.Number) || getIndexTypeOfType(type, IndexKind.String); + } + + function checkObjectLiteral(node: ObjectLiteral, contextualType?: Type, contextualMapper?: TypeMapper): Type { + var members = node.symbol.members; + var properties: SymbolTable = {}; + + for (var id in members) { + if (hasProperty(members, id)) { + var member = members[id]; + if (member.flags & SymbolFlags.Property) { + var contextualPropType = contextualType && getContextualTypeForProperty(contextualType, member.name); + var type = checkExpression((member.declarations[0]).initializer, contextualPropType, contextualMapper); + var prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, member.name); + prop.declarations = member.declarations; + prop.parent = member.parent; + if (member.valueDeclaration) prop.valueDeclaration = member.valueDeclaration; + prop.type = type; + member = prop; + } + else { + // TypeScript 1.0 spec (April 2014) + // A get accessor declaration is processed in the same manner as + // an ordinary function declaration(section 6.1) with no parameters. + // A set accessor declaration is processed in the same manner + // as an ordinary function declaration with a single parameter and a Void return type. + var getAccessor = getDeclarationOfKind(member, SyntaxKind.GetAccessor); + if (getAccessor) { + checkAccessorDeclaration(getAccessor); + } + + var setAccessor = getDeclarationOfKind(member, SyntaxKind.SetAccessor); + if (setAccessor) { + checkAccessorDeclaration(setAccessor); + } + } + properties[member.name] = member; + } + } + var stringIndexType = getIndexType(properties, IndexKind.String); + var numberIndexType = getIndexType(properties, IndexKind.Number); + return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); + + function getIndexType(properties: SymbolTable, kind: IndexKind) { + if (contextualType) { + var indexType = getIndexTypeOfType(contextualType, kind); + if (indexType) { + var propTypes: Type[] = []; + for (var id in properties) { + if (hasProperty(properties, id)) { + if (kind === IndexKind.String || isNumericName(id)) { + var type = getTypeOfSymbol(properties[id]); + if (!contains(propTypes, type)) propTypes.push(type); + } + } + } + + return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); + } + } + } + } + + function getDeclarationKindFromSymbol(s: Symbol) { + return s.flags & SymbolFlags.Prototype ? SyntaxKind.Property : s.valueDeclaration.kind; + } + + function getDeclarationFlagsFromSymbol(s: Symbol) { + return s.flags & SymbolFlags.Prototype ? NodeFlags.Public | NodeFlags.Static : s.valueDeclaration.flags; + } + + function checkPropertyAccess(node: PropertyAccess) { + var type = checkExpression(node.left); + if (type === unknownType) return type; + if (type !== anyType) { + var apparentType = getApparentType(getWidenedType(type)); + if (apparentType === unknownType) { + // handle cases when type is Type parameter with invalid constraint + return unknownType; + } + var prop = getPropertyOfApparentType(apparentType, node.right.text); + if (!prop) { + if (node.right.text) { + error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, identifierToString(node.right), typeToString(type, /*printArrayAsGenericType*/ false)); + } + return unknownType; + } + getNodeLinks(node).resolvedSymbol = prop; + if (prop.parent && prop.parent.flags & SymbolFlags.Class) { + + // TS 1.0 spec (April 2014): 4.8.2 + // - In a constructor, instance member function, instance member accessor, or + // instance member variable initializer where this references a derived class instance, + // a super property access is permitted and must specify a public instance member function of the base class. + // - In a static member function or static member accessor + // where this references the constructor function object of a derived class, + // a super property access is permitted and must specify a public static member function of the base class. + if (node.left.kind === SyntaxKind.SuperKeyword && getDeclarationKindFromSymbol(prop) !== SyntaxKind.Method) { + error(node.right, Diagnostics.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword); + } + else if (getDeclarationFlagsFromSymbol(prop) & NodeFlags.Private) { + var classDeclaration = getAncestor(node, SyntaxKind.ClassDeclaration); + if (!classDeclaration || !contains(prop.parent.declarations, classDeclaration)) { + error(node, Diagnostics.Property_0_is_inaccessible, getFullyQualifiedName(prop)); + } + } + } + return getTypeOfSymbol(prop); + } + return anyType; + } + + function checkIndexedAccess(node: IndexedAccess): Type { + var objectType = checkExpression(node.object); + var indexType = checkExpression(node.index); + if (objectType === unknownType) return unknownType; + + // TypeScript 1.0 spec (April 2014): 4.10 Property Access + // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name + // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. + // - Otherwise, if ObjExpr's apparent type has a numeric index signature and IndexExpr is of type Any, the Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if ObjExpr's apparent type has a string index signature and IndexExpr is of type Any, the String or Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. + + // See if we can index as a property. + var apparentType = getApparentType(objectType); + if (apparentType === unknownType) { + // handle cases when objectType is type parameter with invalid type + return unknownType; + } + if (node.index.kind === SyntaxKind.StringLiteral || node.index.kind === SyntaxKind.NumericLiteral) { + var name = (node.index).text; + var prop = getPropertyOfApparentType(apparentType, name); + if (prop) { + return getTypeOfSymbol(prop); + } + } + + // Check for compatible indexer types. + if (indexType.flags & (TypeFlags.Any | TypeFlags.StringLike | TypeFlags.NumberLike)) { + + // Try to use a number indexer. + if (indexType.flags & (TypeFlags.Any | TypeFlags.NumberLike)) { + var numberIndexType = getIndexTypeOfType(apparentType, IndexKind.Number); + if (numberIndexType) { + return numberIndexType; + } + } + + // Try to use string indexing. + var stringIndexType = getIndexTypeOfType(apparentType, IndexKind.String); + if (stringIndexType) { + return stringIndexType; + } + + // Fall back to any. + if (program.getCompilerOptions().noImplicitAny && objectType !== anyType) { + error(node, Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + } + + return anyType; + } + + // REVIEW: Users should know the type that was actually used. + error(node, Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any); + + return unknownType; + } + + function checkUntypedCall(node: CallExpression): Type { + forEach(node.arguments, argument => { checkExpression(argument); }); + return anyType; + } + + function checkErrorCall(node: CallExpression): Type { + checkUntypedCall(node); + return unknownType; + } + + function isCandidateSignature(node: CallExpression, signature: Signature) { + var args = node.arguments || emptyArray; + return args.length >= signature.minArgumentCount && + (signature.hasRestParameter || args.length <= signature.parameters.length) && + (!node.typeArguments || signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + } + + // The candidate list is in reverse order of declaration, except that groups of signatures with the same parent are + // kept in declaration order. + function collectCandidates(node: CallExpression, signatures: Signature[]): Signature[] { + var result: Signature[] = []; + var lastParent: Node; + var pos: number; + for (var i = 0; i < signatures.length; i++) { + var signature = signatures[i]; + if (isCandidateSignature(node, signature)) { + var parent = signature.declaration ? signature.declaration.parent : undefined; + if (lastParent && parent === lastParent) { + pos++; + } + else { + lastParent = parent; + pos = 0; + } + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; + } + } + return result; + } + + function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): Type[] { + var typeParameters = signature.typeParameters; + var context = createInferenceContext(typeParameters); + var mapper = createInferenceMapper(context); + // First infer from arguments that are not context sensitive + for (var i = 0; i < args.length; i++) { + if (!excludeArgument || excludeArgument[i] === undefined) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + // Next, infer from those context sensitive arguments that are no longer excluded + if (excludeArgument) { + for (var i = 0; i < args.length; i++) { + if (excludeArgument[i] === false) { + var parameterType = getTypeAtPosition(signature, i); + inferTypes(context, checkExpression(args[i], parameterType, mapper), parameterType); + } + } + } + return getInferredTypes(context); + } + + function checkTypeArguments(signature: Signature, typeArguments: TypeNode[]): Type[] { + var typeParameters = signature.typeParameters; + var result: Type[] = []; + for (var i = 0; i < typeParameters.length; i++) { + var typeArgNode = typeArguments[i]; + var typeArgument = getTypeFromTypeNode(typeArgNode); + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + checkTypeAssignableTo(typeArgument, constraint, typeArgNode, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + result.push(typeArgument); + } + return result; + } + + function isApplicableSignature(node: CallExpression, signature: Signature, relation: Map, excludeArgument: boolean[]) { + if (node.arguments) { + for (var i = 0; i < node.arguments.length; i++) { + var arg = node.arguments[i]; + var paramType = getTypeAtPosition(signature, i); + var argType = arg.kind === SyntaxKind.StringLiteral ? + getStringLiteralType(arg) : + checkExpression(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + if (!isTypeRelatedTo(argType, paramType, relation)) return false; + } + } + return true; + } + + function checkCall(node: CallExpression, signatures: Signature[]): Type { + forEach(node.typeArguments, checkSourceElement); + var candidates = collectCandidates(node, signatures); + if (!candidates.length) { + error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + var args = node.arguments || emptyArray; + var excludeArgument: boolean[]; + for (var i = 0; i < args.length; i++) { + if (isContextSensitiveExpression(args[i])) { + if (!excludeArgument) excludeArgument = new Array(args.length); + excludeArgument[i] = true; + } + } + var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; + while (true) { + for (var i = 0; i < candidates.length; i++) { + while (true) { + var candidate = candidates[i]; + if (candidate.typeParameters) { + var typeArguments = node.typeArguments ? + checkTypeArguments(candidate, node.typeArguments) : + inferTypeArguments(candidate, args, excludeArgument); + candidate = getSignatureInstantiation(candidate, typeArguments); + } + if (!isApplicableSignature(node, candidate, relation, excludeArgument)) break; + var index = excludeArgument ? indexOf(excludeArgument, true) : -1; + if (index < 0) { + return getReturnTypeOfSignature(candidate); + } + excludeArgument[index] = false; + } + } + if (relation === assignableRelation) break; + relation = assignableRelation; + } + error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); + return checkErrorCall(node); + } + + function checkCallExpression(node: CallExpression): Type { + if (node.func.kind === SyntaxKind.SuperKeyword) { + var superType = checkSuperExpression(node.func, true); + if (superType !== unknownType) { + checkCall(node, getSignaturesOfType(superType, SignatureKind.Construct)); + } + else { + checkUntypedCall(node); + } + + // TS 1.0 spec: 4.8.1 + // The type of a super call expression is Void. + return voidType; + } + + var funcType = checkExpression(node.func); + if (funcType === unknownType) { + // Another error has already been reported + return checkErrorCall(node); + } + + var apparentType = getApparentType(funcType) + if (apparentType === unknownType) { + // handler cases when funcType is type parameter with invalid constraint + // Another error was already reported + return checkErrorCall(node); + } + + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including call signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var signatures = getSignaturesOfType(apparentType, SignatureKind.Call); + + var constructSignatures = getSignaturesOfType(apparentType, SignatureKind.Construct); + // TS 1.0 spec: 4.12 + // If FuncExpr is of type Any, or of an object type that has no call signatures but is a + // subtype of the Function interface, the call is an untyped function call. In an untyped + // function call no TypeArgs are permitted, Args can be any argument list, no contextual + // types are provided for the argument expressions, and the result is always of type Any. + // NOTE (not in spec yet): permit untyped call only if type has no both call and construct signatures + if ((funcType === anyType) || (!signatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { + if (node.typeArguments) { + error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return checkUntypedCall(node); + } + // If FuncExprs apparent type(section 3.8.1) is a function type, the call is a typed function call. + // TypeScript employs overload resolution in typed function calls in order to support functions + // with multiple call signatures. + if (!signatures.length) { + if (constructSignatures.length) { + error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType, /*printArrayAsGenericType*/ false)); + } + else { + error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + } + return checkErrorCall(node); + } + return checkCall(node, signatures); + } + + function checkNewExpression(node: NewExpression): Type { + var expressionType = checkExpression(node.func); + if (expressionType === unknownType) { + // Another error has already been reported + return checkErrorCall(node); + } + // TS 1.0 spec: 4.11 + // If ConstructExpr is of type Any, Args can be any argument + // list and the result of the operation is of type Any. + if (expressionType === anyType) { + if (node.typeArguments) { + error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + + return checkUntypedCall(node); + } + + // If ConstructExprs apparent type(section 3.8.1) is an object type with one or + // more construct signatures, the expression is processed in the same manner as a + // function call, but using the construct signatures as the initial set of candidate + // signatures for overload resolution.The result type of the function call becomes + // the result type of the operation. + expressionType = getApparentType(expressionType); + if (expressionType === unknownType) { + // handler cases when original expressionType is a type parameter with invalid constraint + // another error has already been reported + return checkErrorCall(node); + } + + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including construct signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var constructSignatures = getSignaturesOfType(expressionType, SignatureKind.Construct); + if (constructSignatures.length) { + return checkCall(node, constructSignatures); + } + + // If ConstructExprs apparent type is an object type with no construct signatures but + // one or more call signatures, the expression is processed as a function call. A compile-time + // error occurs if the result of the function call is not Void. The type of the result of the + // operation is Any. + var callSignatures = getSignaturesOfType(expressionType, SignatureKind.Call); + if (callSignatures.length) { + var type = checkCall(node, callSignatures); + + if (type !== voidType) { + error(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + } + + // Since we found no constructor signature, we (implicitly) return any. + if (program.getCompilerOptions().noImplicitAny) { + error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + } + + return anyType; + } + + error(node, Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + return checkErrorCall(node); + } + + function checkTypeAssertion(node: TypeAssertion): Type { + var targetType = getTypeFromTypeNode(node.type); + if (targetType === unknownType) return unknownType; + var exprType = checkExpression(node.operand, targetType); + var widenedType = getWidenedType(exprType); + if (!(isTypeAssignableTo(exprType, targetType) || isTypeAssignableTo(targetType, widenedType))) { + checkTypeAssignableTo(targetType, widenedType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + } + return targetType; + } + + function getContextualSignature(contextualType: Type) { + if (contextualType) { + var signatures = getSignaturesOfType(contextualType, SignatureKind.Call); + if (signatures.length === 1) { + var signature = signatures[0]; + if (!signature.typeParameters) { + return signature; + } + } + } + } + + function getTypeAtPosition(signature: Signature, pos: number): Type { + return signature.hasRestParameter ? + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + } + + function assignContextualParameterTypes(signature: Signature, context: Signature, mapper: TypeMapper) { + var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); + for (var i = 0; i < len; i++) { + var parameter = signature.parameters[i]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeAtPosition(context, i), mapper); + } + } + if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { + var parameter = signature.parameters[signature.parameters.length - 1]; + var links = getSymbolLinks(parameter); + if (!links.type) { + links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + } + } + } + + function getReturnTypeFromBody(func: FunctionDeclaration, contextualType?: Type, contextualMapper?: TypeMapper): Type { + if (func.body.kind !== SyntaxKind.FunctionBlock) { + var unwidenedType = checkAndMarkExpression(func.body, contextualType, contextualMapper); + var widenedType = getWidenedType(unwidenedType); + + if (program.getCompilerOptions().noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + error(func, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType, /* printArrayAsGeneric */ false)); + } + + return widenedType; + } + + // Aggregate the types of expressions within all the return statements. + var types: Type[] = []; + checkAndAggregateReturnExpressionTypes(func.body); + + // Try to return the best common type if we have any return expressions. + if (types.length) { + + var commonType = getBestCommonType(types, /*contextualType:*/ undefined, /*candidatesOnly:*/ true); + if (!commonType) { + error(func, Diagnostics.No_best_common_type_exists_among_return_expressions); + + return unknownType; + } + + var widenedType = getWidenedType(commonType); + + // Check and report for noImplicitAny if the best common type implicitly gets widened to an 'any'/arrays-of-'any' type. + if (program.getCompilerOptions().noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { + var typeName = typeToString(widenedType, /* printArrayAsGeneric */ false); + + if (func.name) { + error(func, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(func.name), typeName); + } + else { + error(func, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + + return widenedType; + } + + return voidType; + + function checkAndAggregateReturnExpressionTypes(node: Node) { + switch (node.kind) { + case SyntaxKind.ReturnStatement: + var expr = (node).expression; + if (expr) { + var type = checkAndMarkExpression(expr, contextualType, contextualMapper); + if (!contains(types, type)) types.push(type); + } + break; + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + case SyntaxKind.LabelledStatement: + case SyntaxKind.TryStatement: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + forEachChild(node, checkAndAggregateReturnExpressionTypes); + break; + } + } + } + + function checkFunctionExpression(node: FunctionExpression, contextualType?: Type, contextualMapper?: TypeMapper): Type { + // The identityMapper object is used to indicate that function expressions are wildcards + if (contextualMapper === identityMapper) return anyFunctionType; + var type = getTypeOfSymbol(node.symbol); + var links = getNodeLinks(node); + + if (!(links.flags & NodeCheckFlags.TypeChecked)) { + var signature = getSignaturesOfType(type, SignatureKind.Call)[0]; + var contextualSignature = getContextualSignature(contextualType); + if (contextualSignature) { + if (!node.typeParameters && !forEach(node.parameters, p => p.type)) { + assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); + } + if (!node.type) { + signature.resolvedReturnType = resolvingType; + var returnType = getReturnTypeFromBody(node, getReturnTypeOfSignature(contextualSignature), contextualMapper); + if (signature.resolvedReturnType === resolvingType) { + signature.resolvedReturnType = returnType; + } + } + } + checkSignatureDeclaration(node); + if (node.body.kind === SyntaxKind.FunctionBlock) { + checkSourceElement(node.body); + } + else { + var returnType = getReturnTypeOfSignature(signature); + if (node.type) { + // Use default error messages for this check + checkTypeAssignableTo(checkExpression(node.body, returnType), returnType, node.body, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + } + links.flags |= NodeCheckFlags.TypeChecked; + } + return type; + } + + function checkArithmeticOperandType(operand: Node, type: Type, diagnostic: DiagnosticMessage): boolean { + if (!(type.flags & (TypeFlags.Any | TypeFlags.NumberLike))) { + error(operand, diagnostic); + return false; + } + return true; + } + + function checkReferenceExpression(n: Node, message: DiagnosticMessage): boolean { + function findSymbol(n: Node): Symbol { + var symbol = getNodeLinks(n).resolvedSymbol; + // Because we got the symbol from the resolvedSymbol property, it might be of kind + // SymbolFlags.ExportValue. In this case it is necessary to get the actual export + // symbol, which will have the correct flags set on it. + return symbol && getExportSymbolOfValueSymbolIfExported(symbol); + } + + function isReferenceOrErrorExpression(n: Node): boolean { + // TypeScript 1.0 spec (April 2014): + // Expressions are classified as values or references. + // References are the subset of expressions that are permitted as the target of an assignment. + // Specifically, references are combinations of identifiers(section 4.3), parentheses(section 4.7), + // and property accesses(section 4.10). + // All other expression constructs described in this chapter are classified as values. + switch (n.kind) { + case SyntaxKind.Identifier: + var symbol = findSymbol(n); + // TypeScript 1.0 spec (April 2014): 4.3 + // An identifier expression that references a variable or parameter is classified as a reference. + // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & SymbolFlags.Variable) !== 0; + case SyntaxKind.PropertyAccess: + var symbol = findSymbol(n); + // TypeScript 1.0 spec (April 2014): 4.10 + // A property access expression is always classified as a reference. + // NOTE (not in spec): assignment to enum members should not be allowed + return !symbol || symbol === unknownSymbol || (symbol.flags & ~SymbolFlags.EnumMember) !== 0; + case SyntaxKind.IndexedAccess: + // old compiler doesn't check indexed assess + return true; + case SyntaxKind.ParenExpression: + return isReferenceOrErrorExpression((n).expression); + default: + return false; + } + } + + if (!isReferenceOrErrorExpression(n)) { + error(n, message); + return false; + } + return true; + } + + function checkPrefixExpression(node: UnaryExpression): Type { + var operandType = checkExpression(node.operand); + switch (node.operator) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + return numberType; + case SyntaxKind.ExclamationToken: + case SyntaxKind.DeleteKeyword: + return booleanType; + case SyntaxKind.TypeOfKeyword: + return stringType; + case SyntaxKind.VoidKeyword: + return undefinedType; + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + var ok = checkArithmeticOperandType(node.operand, operandType, Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors + checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + return unknownType; + } + + function checkPostfixExpression(node: UnaryExpression): Type { + var operandType = checkExpression(node.operand); + var ok = checkArithmeticOperandType(node.operand, operandType, Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); + if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors + checkReferenceExpression(node.operand, Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + } + return numberType; + } + + function isTypeAnyTypeObjectTypeOrTypeParameter(type: Type): boolean { + return type === anyType || ((type.flags & (TypeFlags.ObjectType | TypeFlags.TypeParameter)) !== 0); + } + + function checkInstanceOfExpression(node: BinaryExpression, leftType: Type, rightType: Type): Type { + // TypeScript 1.0 spec (April 2014): 4.15.4 + // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, + // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // The result is always of the Boolean primitive type. + if (!isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { + error(node.left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + if (rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { + error(node.right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); + } + return booleanType; + } + + function checkInExpression(node: BinaryExpression, leftType: Type, rightType: Type): Type { + // TypeScript 1.0 spec (April 2014): 4.15.5 + // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, + // and the right operand to be of type Any, an object type, or a type parameter type. + // The result is always of the Boolean primitive type. + if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { + error(node.left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); + } + if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { + error(node.right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + return booleanType; + } + + function checkBinaryExpression(node: BinaryExpression, contextualType?: Type, contextualMapper?: TypeMapper) { + var operator = node.operator; + var leftContextualType = operator === SyntaxKind.BarBarToken ? contextualType : undefined + var leftType = checkExpression(node.left, leftContextualType, contextualMapper); + var rightContextualType = operator >= SyntaxKind.FirstAssignment && operator <= SyntaxKind.LastAssignment ? leftType : + operator === SyntaxKind.BarBarToken ? contextualType || leftType : undefined; + var rightType = checkExpression(node.right, rightContextualType, contextualMapper); + switch (operator) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.MinusToken: + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.BarToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.CaretToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.AmpersandToken: + case SyntaxKind.AmpersandEqualsToken: + // TypeScript 1.0 spec (April 2014): 4.15.1 + // These operators require their operands to be of type Any, the Number primitive type, + // or an enum type. Operands of an enum type are treated + // as having the primitive type Number. If one operand is the null or undefined value, + // it is treated as having the type of the other operand. + // The result is always of the Number primitive type. + if (leftType.flags & (TypeFlags.Undefined | TypeFlags.Null)) leftType = rightType; + if (rightType.flags & (TypeFlags.Undefined | TypeFlags.Null)) rightType = leftType; + + var leftOk = checkArithmeticOperandType(node.left, leftType, Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + var rightOk = checkArithmeticOperandType(node.right, rightType, Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); + if (leftOk && rightOk) { + checkAssignmentOperator(numberType); + } + + return numberType; + case SyntaxKind.PlusToken: + case SyntaxKind.PlusEqualsToken: + // TypeScript 1.0 spec (April 2014): 4.15.2 + // The binary + operator requires both operands to be of the Number primitive type or an enum type, + // or at least one of the operands to be of type Any or the String primitive type. + + // If one operand is the null or undefined value, it is treated as having the type of the other operand. + if (leftType.flags & (TypeFlags.Undefined | TypeFlags.Null)) leftType = rightType; + if (rightType.flags & (TypeFlags.Undefined | TypeFlags.Null)) rightType = leftType; + + var resultType: Type; + if (leftType.flags & TypeFlags.NumberLike && rightType.flags & TypeFlags.NumberLike) { + // Operands of an enum type are treated as having the primitive type Number. + // If both operands are of the Number primitive type, the result is of the Number primitive type. + resultType = numberType; + } + else if (leftType.flags & TypeFlags.StringLike || rightType.flags & TypeFlags.StringLike) { + // If one or both operands are of the String primitive type, the result is of the String primitive type. + resultType = stringType; + } + else if (leftType.flags & TypeFlags.Any || leftType === unknownType || rightType.flags & TypeFlags.Any || rightType === unknownType) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. + resultType = anyType; + } + + if (!resultType) { + reportOperatorError(); + return anyType; + } + + if (operator === SyntaxKind.PlusEqualsToken) { + checkAssignmentOperator(resultType); + } + return resultType; + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { + reportOperatorError(); + } + return booleanType; + case SyntaxKind.InstanceOfKeyword: + return checkInstanceOfExpression(node, leftType, rightType); + case SyntaxKind.InKeyword: + return checkInExpression(node, leftType, rightType); + case SyntaxKind.AmpersandAmpersandToken: + return rightType; + case SyntaxKind.BarBarToken: + return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : contextualType); + case SyntaxKind.EqualsToken: + checkAssignmentOperator(rightType); + return rightType; + case SyntaxKind.CommaToken: + return rightType; + } + + function checkAssignmentOperator(valueType: Type): void { + if (operator >= SyntaxKind.FirstAssignment && operator <= SyntaxKind.LastAssignment) { + // TypeScript 1.0 spec (April 2014): 4.17 + // An assignment of the form + // VarExpr = ValueExpr + // requires VarExpr to be classified as a reference + // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) + // and the type of the non - compound operation to be assignable to the type of VarExpr. + var ok = checkReferenceExpression(node.left, Diagnostics.Invalid_left_hand_side_of_assignment_expression); + // Use default messages + if (ok) { + // to avoid cascading errors check assignability only if 'isReference' check succeded and no errors were reported + checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + } + } + + function reportOperatorError() { + error(node, Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, tokenToString(node.operator), typeToString(leftType, /*printArrayAsGenericType*/ false), typeToString(rightType, /*printArrayAsGenericType*/ false)); + } + } + + function checkConditionalExpression(node: ConditionalExpression, contextualType?: Type, contextualMapper?: TypeMapper): Type { + checkExpression(node.condition); + var type1 = checkExpression(node.whenTrue, contextualType, contextualMapper); + var type2 = checkExpression(node.whenFalse, contextualType, contextualMapper); + var resultType = getBestCommonType([type1, type2], isInferentialContext(contextualMapper) ? undefined : contextualType, true); + if (!resultType) { + + if (contextualType && !isInferentialContext(contextualMapper)) { + error(node, Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType, /*printArrayAsGenericType*/ false), typeToString(type1, /*printArrayAsGenericType*/ false), typeToString(type2, /*printArrayAsGenericType*/ false)); + } + else { + error(node, Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1, /*printArrayAsGenericType*/ false), typeToString(type2, /*printArrayAsGenericType*/ false)); + } + + resultType = emptyObjectType; + } + return resultType; + } + + function checkAndMarkExpression(node: Expression, contextualType?: Type, contextualMapper?: TypeMapper): Type { + var result = checkExpression(node, contextualType, contextualMapper); + getNodeLinks(node).flags |= NodeCheckFlags.TypeChecked; + return result; + } + + // Checks an expression and returns its type. The contextualType parameter provides a contextual type for + // the check or is undefined if there is no contextual type. The contextualMapper parameter serves two + // purposes: When contextualMapper is not undefined and not equal to the identityMapper function object + // it provides a type mapper to use during inferential typing (the contextual type is then a generic type). + // When contextualMapper is equal to the identityMapper function object, it serves as an indicator that all + // contained function and arrow expressions should be considered to have the wildcard function type; this + // form of type check is used during overload resolution to exclude contextually typed function and arrow + // expressions in the initial phase. + function checkExpression(node: Expression, contextualType?: Type, contextualMapper?: TypeMapper): Type { + switch (node.kind) { + case SyntaxKind.Identifier: + return checkIdentifier(node); + case SyntaxKind.ThisKeyword: + return checkThisExpression(node); + case SyntaxKind.SuperKeyword: + return checkSuperExpression(node, false); + case SyntaxKind.NullKeyword: + return nullType; + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + return booleanType; + case SyntaxKind.NumericLiteral: + return numberType; + case SyntaxKind.StringLiteral: + return stringType; + case SyntaxKind.RegularExpressionLiteral: + return globalRegExpType; + case SyntaxKind.QualifiedName: + return checkPropertyAccess(node); + case SyntaxKind.ArrayLiteral: + return checkArrayLiteral(node, contextualType, contextualMapper); + case SyntaxKind.ObjectLiteral: + return checkObjectLiteral(node, contextualType, contextualMapper); + case SyntaxKind.PropertyAccess: + return checkPropertyAccess(node); + case SyntaxKind.IndexedAccess: + return checkIndexedAccess(node); + case SyntaxKind.CallExpression: + return checkCallExpression(node); + case SyntaxKind.NewExpression: + return checkNewExpression(node); + case SyntaxKind.TypeAssertion: + return checkTypeAssertion(node); + case SyntaxKind.ParenExpression: + return checkExpression((node).expression); + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return checkFunctionExpression(node, contextualType, contextualMapper); + case SyntaxKind.PrefixOperator: + return checkPrefixExpression(node); + case SyntaxKind.PostfixOperator: + return checkPostfixExpression(node); + case SyntaxKind.BinaryExpression: + return checkBinaryExpression(node, contextualType, contextualMapper); + case SyntaxKind.ConditionalExpression: + return checkConditionalExpression(node, contextualType, contextualMapper); + } + return unknownType; + } + + // DECLARATION AND STATEMENT TYPE CHECKING + + function checkTypeParameter(node: TypeParameterDeclaration) { + checkNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0); + checkSourceElement(node.constraint); + checkTypeParameterHasIllegalReferencesInConstraint(node); + // TODO: Check multiple declarations are identical + } + + function checkParameter(parameterDeclaration: ParameterDeclaration) { + checkVariableDeclaration(parameterDeclaration); + + checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); + + if (parameterDeclaration.flags & (NodeFlags.Public | NodeFlags.Private) && !(parameterDeclaration.parent.kind === SyntaxKind.Constructor && (parameterDeclaration.parent).body)) { + error(parameterDeclaration, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + if (parameterDeclaration.flags & NodeFlags.Rest) { + if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { + error(parameterDeclaration, Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + else { + if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { + error(parameterDeclaration, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + } + } + + function checkReferencesInInitializer(n: Node): void { + if (n.kind === SyntaxKind.Identifier) { + var referencedSymbol = getNodeLinks(n).resolvedSymbol; + // check FunctionDeclaration.locals (stores parameters\function local variable) + // if it contains entry with a specified name and if this entry matches the resolved symbol + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, SymbolFlags.Value) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === SyntaxKind.Parameter) { + if (referencedSymbol.valueDeclaration === parameterDeclaration) { + error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, identifierToString(parameterDeclaration.name)); + return; + } + var enclosingOrReferencedParameter = + forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); + + if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { + // legal case - parameter initializer references some parameter strictly on left of current parameter declaration + return; + } + // fallthrough to error reporting + } + + error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, identifierToString(parameterDeclaration.name), identifierToString(n)); + } + } + else { + forEachChild(n, checkReferencesInInitializer); + } + } + + if (parameterDeclaration.initializer) { + checkReferencesInInitializer(parameterDeclaration.initializer); + } + } + + function checkSignatureDeclaration(node: SignatureDeclaration) { + checkTypeParameters(node.typeParameters); + forEach(node.parameters, checkParameter); + if (node.type) { + checkSourceElement(node.type); + } + + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithArgumentsInGeneratedCode(node); + if (program.getCompilerOptions().noImplicitAny && !node.type) { + switch (node.kind) { + case SyntaxKind.ConstructSignature: + error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case SyntaxKind.CallSignature: + error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } + } + + checkSpecializedSignatureDeclaration(node); + } + + function checkTypeForDuplicateIndexSignatures(node: Node) { + if (node.kind === SyntaxKind.InterfaceDeclaration) { + var nodeSymbol = getSymbolOfNode(node); + // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration + // to prevent this run check only for the first declaration of a given kind + if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { + return; + } + } + + // TypeScript 1.0 spec (April 2014) + // 3.7.4: An object type can contain at most one string index signature and one numeric index signature. + // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration + var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); + if (indexSymbol) { + var seenNumericIndexer = false; + var seenStringIndexer = false; + for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { + var declaration = indexSymbol.declarations[i]; + if (declaration.parameters.length == 1 && declaration.parameters[0].type) { + switch (declaration.parameters[0].type.kind) { + case SyntaxKind.StringKeyword: + if (!seenStringIndexer) { + seenStringIndexer = true; + } + else { + error(declaration, Diagnostics.Duplicate_string_index_signature); + } + break; + case SyntaxKind.NumberKeyword: + if (!seenNumericIndexer) { + seenNumericIndexer = true; + } + else { + error(declaration, Diagnostics.Duplicate_number_index_signature); + } + break; + } + } + } + } + } + + function checkPropertyDeclaration(node: PropertyDeclaration) { + // TODO + checkVariableDeclaration(node); + } + + function checkMethodDeclaration(node: MethodDeclaration) { + // TODO + checkFunctionDeclaration(node); + } + + function checkConstructorDeclaration(node: ConstructorDeclaration) { + // TODO + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + checkSourceElement(node.body); + + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol.parent); + if (!(symbolLinks.typeChecked)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + + // exit early in the case of signature - super checks are not relevant to them + if (!node.body) { + return; + } + + function isSuperCallExpression(n: Node): boolean { + return n.kind === SyntaxKind.CallExpression && (n).func.kind === SyntaxKind.SuperKeyword + } + + function containsSuperCall(n: Node): boolean { + if (isSuperCallExpression(n)) { + return true; + } + switch (n.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.ObjectLiteral: return false; + default: return forEachChild(n, containsSuperCall); + } + } + + function markThisReferencesAsErrors(n: Node): void { + if (n.kind === SyntaxKind.ThisKeyword) { + error(n, Diagnostics.this_cannot_be_referenced_in_current_location); + } + else if (n.kind !== SyntaxKind.FunctionExpression && n.kind !== SyntaxKind.FunctionDeclaration) { + forEachChild(n, markThisReferencesAsErrors); + } + } + + function isInstancePropertyWithInitializer(n: Node): boolean { + return n.kind === SyntaxKind.Property && + !(n.flags & NodeFlags.Static) && + !!(n).initializer; + } + + // TS 1.0 spec (April 2014): 8.3.2 + // Constructors of classes with no extends clause may not contain super calls, whereas + // constructors of derived classes must contain at least one super call somewhere in their function body. + if ((node.parent).baseType) { + + if (containsSuperCall(node.body)) { + // The first statement in the body of a constructor must be a super call if both of the following are true: + // - The containing class is a derived class. + // - The constructor declares parameter properties + // or the containing class declares instance member variables with initializers. + var superCallShouldBeFirst = + forEach((node.parent).members, isInstancePropertyWithInitializer) || + forEach(node.parameters, p => p.flags & (NodeFlags.Public | NodeFlags.Private)); + + if (superCallShouldBeFirst) { + var statements = (node.body).statements; + if (!statements.length || statements[0].kind !== SyntaxKind.ExpressionStatement || !isSuperCallExpression((statements[0]).expression)) { + error(node, Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); + } + else { + // In such a required super call, it is a compile-time error for argument expressions to reference this. + markThisReferencesAsErrors((statements[0]).expression); + } + } + } + else { + error(node, Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + } + } + } + + function checkAccessorDeclaration(node: AccessorDeclaration) { + function checkGetterContainsSingleThrowStatement(node: AccessorDeclaration): boolean { + var block = node.body; + return block.statements.length === 1 && block.statements[0].kind === SyntaxKind.ThrowStatement; + } + + function checkGetterReturnsValue(n: Node): boolean { + switch (n.kind) { + case SyntaxKind.ReturnStatement: + return true; + // do not dive into function-like things - return statements there don't count + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + case SyntaxKind.ObjectLiteral: + return false; + default: + return forEachChild(n, checkGetterReturnsValue); + } + } + if (node.kind === SyntaxKind.GetAccessor) { + if (!isDeclarationContext(node) && node.body && !(checkGetterContainsSingleThrowStatement(node) || checkGetterReturnsValue(node))) { + error(node.name, Diagnostics.Getters_must_return_a_value); + } + } + + // TypeScript 1.0 spec (April 2014): 8.4.3 + // Accessors for the same member name must specify the same accessibility. + var otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor; + var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); + if (otherAccessor) { + var visibilityFlags = NodeFlags.Private | NodeFlags.Public; + if (((node.flags & visibilityFlags) !== (otherAccessor.flags & visibilityFlags))) { + error(node.name, Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); + } + + var thisType = getAnnotatedAccessorType(node); + var otherType = getAnnotatedAccessorType(otherAccessor); + // TypeScript 1.0 spec (April 2014): 4.5 + // If both accessors include type annotations, the specified types must be identical. + if (thisType && otherType) { + if (!isTypeIdenticalTo(thisType, otherType)) { + error(node, Diagnostics.get_and_set_accessor_must_have_the_same_type); + } + } + } + + checkFunctionDeclaration(node); + } + + function checkTypeReference(node: TypeReferenceNode) { + var type = getTypeFromTypeReferenceNode(node); + if (type !== unknownType && node.typeArguments) { + // Do type argument local checks only if referenced type is successfully resolved + var len = node.typeArguments.length; + for (var i = 0; i < len; i++) { + checkSourceElement(node.typeArguments[i]); + var constraint = getConstraintOfTypeParameter((type).target.typeParameters[i]); + if (constraint) { + var typeArgument = (type).typeArguments[i]; + checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + } + } + + function checkTypeQuery(node: TypeQueryNode) { + getTypeFromTypeQueryNode(node); + } + + function checkTypeLiteral(node: TypeLiteralNode) { + forEach(node.members, checkSourceElement); + var type = getTypeFromTypeLiteralNode(node); + checkIndexConstraints(type); + checkTypeForDuplicateIndexSignatures(node); + } + + function checkArrayType(node: ArrayTypeNode) { + getTypeFromArrayTypeNode(node); + } + + function isPrivateWithinAmbient(node: Node): boolean { + return (node.flags & NodeFlags.Private) && isAmbientContext(node); + } + + function isAmbientContext(node: Node): boolean { + while (node) { + if (node.flags & NodeFlags.Ambient) return true; + node = node.parent; + } + return false; + } + + function isDeclarationContext(node: Node): boolean { + while (node) { + if (node.flags & (NodeFlags.Ambient | NodeFlags.DeclarationFile)) return true; + node = node.parent; + } + return false; + } + + function checkDeclarationModifiers(node: Node) { + if (node.flags & NodeFlags.Export && node.parent.kind === SyntaxKind.SourceFile) { + checkModulesEnabled(node); + } + } + + function checkSpecializedSignatureDeclaration(signatureDeclarationNode: SignatureDeclaration): void { + var signature = getSignatureFromDeclaration(signatureDeclarationNode); + if (!signature.hasStringLiterals) { + return; + } + + // TypeScript 1.0 spec (April 2014): 3.7.2.2 + // Specialized signatures are not permitted in conjunction with a function body + if ((signatureDeclarationNode).body) { + error(signatureDeclarationNode, Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); + return; + } + + // TypeScript 1.0 spec (April 2014): 3.7.2.4 + // Every specialized call or construct signature in an object type must be assignable + // to at least one non-specialized call or construct signature in the same object type + var signaturesOfSymbol = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); + for (var i = 0; i < signaturesOfSymbol.length; i++) { + var otherSignature = signaturesOfSymbol[i]; + if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { + return; + } + } + + error(signatureDeclarationNode, Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); + } + + function checkFunctionOrConstructorSymbol(symbol: Symbol) { + function getEffectiveFlagsForFunctionCheck(n: Node) { + var flags = n.flags; + // We want to determine if an overload is effectively ambient, which can happen if it + // is nested in an ambient context. However, do not treat members of interfaces differently + // based on whether the interface itself is in an ambient context. Interfaces should never + // be considered ambient for purposes of comparing overload attributes. + if (n.parent.kind !== SyntaxKind.InterfaceDeclaration && isDeclarationContext(n)) { + if (!(flags & NodeFlags.Ambient)) { + // It is nested in an ambient context, which means it is automatically exported + flags |= NodeFlags.Export; + } + flags |= NodeFlags.Ambient; + } + + return flags & flagsToCheck; + } + + function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { + // Error if some overloads have a flag that is not shared by all overloads. To find the + // deviations, we XOR someOverloadFlags with allOverloadFlags + var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; + if (someButNotAllOverloadFlags !== 0) { + // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration + // Error on all deviations from this canonical set of flags + // The caveat is that if some overloads are defined in lib.d.ts, we don't want to + // report the errors on those. To achieve this, we will say that the implementation is + // the canonical signature only if it is in the same container as the first overload + var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; + var canonicalFlags = implementationSharesContainerWithFirstOverload + ? getEffectiveFlagsForFunctionCheck(implementation) + : getEffectiveFlagsForFunctionCheck(overloads[0]); + forEach(overloads, o => { + var deviation = getEffectiveFlagsForFunctionCheck(o) ^ canonicalFlags; + if (deviation & NodeFlags.Export) { + error(o.name, Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); + } + else if (deviation & NodeFlags.Ambient) { + error(o.name, Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } + else if (deviation & NodeFlags.Private) { + error(o.name, Diagnostics.Overload_signatures_must_all_be_public_or_private); + } + else if (deviation & NodeFlags.QuestionMark) { + error(o.name, Diagnostics.Overload_signatures_must_all_be_optional_or_required); + } + }); + } + } + + var flagsToCheck: NodeFlags = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Private | NodeFlags.QuestionMark; + var someNodeFlags: NodeFlags = 0; + var allNodeFlags = flagsToCheck; + var hasOverloads = false; + var bodyDeclaration: FunctionDeclaration; + var lastSeenNonAmbientDeclaration: FunctionDeclaration; + var declarations = symbol.declarations; + var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; + for (var i = 0; i < declarations.length; i++) { + var node = declarations[i]; + if (node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.Method || node.kind === SyntaxKind.Constructor) { + var currentNodeFlags = getEffectiveFlagsForFunctionCheck(node); + someNodeFlags |= currentNodeFlags; + allNodeFlags &= currentNodeFlags; + + var inAmbientContext = isDeclarationContext(node); + var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } + + if (node.body) { + if (bodyDeclaration) { + if (isConstructor) { + error(node, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + } + else { + error(node, Diagnostics.Duplicate_function_implementation); + } + } + else { + bodyDeclaration = node; + } + } + else { + hasOverloads = true; + } + } + } + + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { + if (isConstructor) { + error(lastSeenNonAmbientDeclaration, Diagnostics.Constructor_implementation_expected); + } + else { + error(lastSeenNonAmbientDeclaration, Diagnostics.Function_implementation_expected); + } + } + + if (hasOverloads) { + checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); + if (bodyDeclaration) { + var signatures = getSignaturesOfSymbol(symbol); + var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + // If the implementation signature has string literals, we will have reported an error in + // checkSpecializedSignatureDeclaration + if (!bodySignature.hasStringLiterals) { + // TypeScript 1.0 spec (April 2014): 6.1 + // If a function declaration includes overloads, the overloads determine the call + // signatures of the type given to the function object + // and the function implementation signature must be assignable to that type + // + // TypeScript 1.0 spec (April 2014): 3.8.4 + // Note that specialized call and construct signatures (section 3.7.2.4) are not significant when determining assignment compatibility + // Consider checking against specialized signatures too. Not doing so creates a type hole: + // + // function g(x: "hi", y: boolean); + // function g(x: string, y: {}); + // function g(x: string, y: string) { } + // + // The implementation is completely unrelated to the specialized signature, yet we do not check this. + for (var i = 0, len = signatures.length; i < len; ++i) { + if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { + error(signatures[i].declaration, Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + break; + } + } + } + } + } + + // TODO: Check at least one return statement in non-void/any function (except single throw) + } + + function checkFunctionDeclaration(node: FunctionDeclaration) { + checkDeclarationModifiers(node); + checkSignatureDeclaration(node); + var symbol = getSymbolOfNode(node); + var symbolLinks = getSymbolLinks(symbol); + var type = getTypeOfSymbol(symbol); + if (!(symbolLinks.typeChecked)) { + checkFunctionOrConstructorSymbol(symbol); + symbolLinks.typeChecked = true; + } + checkSourceElement(node.body); + + // If there is no body and no explicit return type, then report an error. + if (program.getCompilerOptions().noImplicitAny && !node.body && !node.type) { + // Ignore privates within ambient contexts; they exist purely for documentative purposes to avoid name clashing. + // (e.g. privates within .d.ts files do not expose type information) + if (!isPrivateWithinAmbient(node)) { + var typeName = typeToString(anyType, /* printArrayAsGeneric */ false); + + if (node.name) { + error(node, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(node.name), typeName); + } + else { + error(node, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); + } + } + } + } + + function checkBlock(node: Block) { + forEach(node.statements, checkSourceElement); + } + + function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { + // no rest parameters \ declaration context \ overload - no codegen impact + if (!hasRestParameters(node) || isDeclarationContext(node) || !(node).body) { + return; + } + + forEach(node.parameters, p => { + if (p.name && p.name.text === argumentsSymbol.name) { + error(p, Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + } + }); + } + + function checkCollisionWithIndexVariableInGeneratedCode(node: Node, name: Identifier) { + if (!(name && name.text === "_i")) { + return; + } + + if (node.kind === SyntaxKind.Parameter) { + // report error if parameter has name '_i' when: + // - function has implementation (not a signature) + // - function has rest parameters + // - context is not ambient (otherwise no codegen impact) + if ((node.parent).body && hasRestParameters(node.parent) && !isDeclarationContext(node)) { + error(node, Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); + } + return; + } + + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol === unknownSymbol) { + return; + } + + // we would like to discover cases like one below: + // + // var _i = "!"; + // function foo(...a) { + // function bar() { + // var x = { get baz() { return _i; } } + // } + // } + // + // at runtime '_i' referenced in getter will be resolved to the generated index variable '_i' used to initialize rest parameters. + // legitimate case: when '_i' is defined inside the function declaration with rest parameters. + // + // function foo(...a) { + // var _i = "!"; + // function bar() { + // var x = { get baz() { return _i; } } + // } + // } + + //// if resolved symbol for node has more than one declaration - this is definitely an error + //// (there is nothing value-like in the language that can be nested in function and consists of multiple declarations) + //if (symbol.declarations.length > 1) { + // error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); + // return; + //} + + // short gist of the check: + // - otherwise + // - walk to the top of the tree starting from the 'node' + // - at every step check if 'current' node contains any declaration of original node + // yes - return + // no - check if current declaration is function with rest parameters + // yes - report error since '_i' from this function will shadow '_i' defined in the outer scope + // no - go up to the next level + var current = node; + while (current) { + var definedOnCurrentLevel = forEach(symbol.declarations, d => d.parent === current ? d : undefined); + if (definedOnCurrentLevel) { + return; + } + switch (current.kind) { + // all kinds that might have rest parameters + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Constructor: + if (hasRestParameters(current)) { + error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); + return; + } + break; + } + current = current.parent; + } + } + + function checkCollisionWithCapturedSuperVariable(node: Node, name: Identifier) { + if (!(name && name.text === "_super")) { + return; + } + + if (node.kind === SyntaxKind.Property || + node.kind === SyntaxKind.Method || + node.kind === SyntaxKind.GetAccessor || + node.kind === SyntaxKind.SetAccessor) { + // it is ok to have member named '_super' - member access is always qualified + return; + } + + if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { + // just an overload - no codegen impact + return; + } + + // bubble up and find containing type + var enclosingClass = getAncestor(node, SyntaxKind.ClassDeclaration); + // if containing type was not found or it is ambient - exit (no codegen) + if (!enclosingClass || isDeclarationContext(enclosingClass)) { + return; + } + + if (enclosingClass.baseType) { + var isDeclaration = node.kind !== SyntaxKind.Identifier; + if (isDeclaration) { + error(node, Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); + } + else { + error(node, Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); + } + } + } + + function checkVariableDeclaration(node: VariableDeclaration) { + checkSourceElement(node.type); + + var symbol = getSymbolOfNode(node); + + var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); + var type: Type; + var useTypeFromValueDeclaration = node === symbol.valueDeclaration; + if (useTypeFromValueDeclaration) { + type = typeOfValueDeclaration; + } + else { + type = getTypeOfVariableDeclaration(node); + } + + if (node.initializer) { + if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) { + // Use default messages + checkTypeAssignableTo(checkAndMarkExpression(node.initializer, type), type, node, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + } + + checkCollisionWithCapturedSuperVariable(node, node.name); + if (!useTypeFromValueDeclaration) { + // TypeScript 1.0 spec (April 2014): 5.1 + // Multiple declarations for the same variable name in the same declaration space are permitted, + // provided that each declaration associates the same type with the variable. + if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { + error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, identifierToString(node.name), typeToString(typeOfValueDeclaration, /*printArrayAsGenericType*/ false), typeToString(type, /*printArrayAsGenericType*/ false)); + } + } + } + + function checkVariableStatement(node: VariableStatement) { + checkDeclarationModifiers(node); + forEach(node.declarations, checkVariableDeclaration); + } + + function checkExpressionStatement(node: ExpressionStatement) { + checkExpression(node.expression); + } + + function checkIfStatement(node: IfStatement) { + checkExpression(node.expression); + checkSourceElement(node.thenStatement); + checkSourceElement(node.elseStatement); + } + + function checkDoStatement(node: DoStatement) { + checkSourceElement(node.statement); + checkExpression(node.expression); + } + + function checkWhileStatement(node: WhileStatement) { + checkExpression(node.expression); + checkSourceElement(node.statement); + } + + function checkForStatement(node: ForStatement) { + if (node.declarations) forEach(node.declarations, checkVariableDeclaration); + if (node.initializer) checkExpression(node.initializer); + if (node.condition) checkExpression(node.condition); + if (node.iterator) checkExpression(node.iterator); + checkSourceElement(node.statement); + } + + function checkForInStatement(node: ForInStatement) { + + // TypeScript 1.0 spec (April 2014): 5.4 + // In a 'for-in' statement of the form + // for (var VarDecl in Expr) Statement + // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, + // and Expr must be an expression of type Any, an object type, or a type parameter type. + if (node.declaration) { + checkVariableDeclaration(node.declaration); + if (node.declaration.type) { + error(node.declaration, Diagnostics.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation); + } + } + + // In a 'for-in' statement of the form + // for (Var in Expr) Statement + // Var must be an expression classified as a reference of type Any or the String primitive type, + // and Expr must be an expression of type Any, an object type, or a type parameter type. + if (node.variable) { + var exprType = checkExpression(node.variable); + if (exprType !== anyType && exprType !== stringType) { + error(node.variable, Diagnostics.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any); + } + else { + // run check only former check succeeded to avoid cascading errors + checkReferenceExpression(node.variable, Diagnostics.Invalid_left_hand_side_in_for_in_statement); + } + } + + var exprType = checkExpression(node.expression); + // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved + // in this case error about missing name is already reported - do not report extra one + if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { + error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + + checkSourceElement(node.statement); + } + + function checkBreakOrContinueStatement(node: BreakOrContinueStatement) { + // TODO: Check that target label is valid + } + + function getContainingFunction(node: Node): SignatureDeclaration { + while (true) { + node = node.parent; + if (!node || node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.FunctionExpression || + node.kind === SyntaxKind.ArrowFunction || node.kind === SyntaxKind.Method || node.kind === SyntaxKind.Constructor || + node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor) { + return node; + } + } + } + + function checkReturnStatement(node: ReturnStatement) { + if (node.expression && !(getNodeLinks(node.expression).flags & NodeCheckFlags.TypeChecked)) { + var func = getContainingFunction(node); + if (func) { + if (func.kind === SyntaxKind.SetAccessor) { + if (node.expression) { + error(node.expression, Diagnostics.Setters_cannot_return_a_value); + } + } + else { + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); + // do assignability check only if we short circuited in determining return type + // - function has explicit type annotation + // - function is getter with no type annotation and setter parameter type is used + // - function is a constructor (will be special cased below) + var checkAssignability = + func.type || + (func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor))); + if (checkAssignability) { + checkTypeAssignableTo(checkExpression(node.expression, returnType), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + else if (func.kind == SyntaxKind.Constructor) { + // constructor doesn't have explicit return type annontation and yet its return type is known - declaring type + // handle constructors and issue specialized error message for them. + if (!isTypeAssignableTo(checkExpression(node.expression, returnType), returnType)) { + error(node.expression, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } + } + } + } + else { + error(node, Diagnostics.return_statement_has_no_containing_function); + } + } + } + + function checkWithStatement(node: WithStatement) { + checkExpression(node.expression); + checkSourceElement(node.statement); + } + + function checkSwitchStatement(node: SwitchStatement) { + var expressionType = checkExpression(node.expression); + forEach(node.clauses, clause => { + if (clause.expression) { + // TypeScript 1.0 spec (April 2014):5.9 + // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. + var caseType = checkExpression(clause.expression); + if (!isTypeAssignableTo(expressionType, caseType)) { + // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails + checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + } + checkBlock(clause); + }); + } + + function checkLabelledStatement(node: LabelledStatement) { + checkSourceElement(node.statement); + } + + function checkThrowStatement(node: ThrowStatement) { + checkExpression(node.expression); + } + + function checkTryStatement(node: TryStatement) { + checkBlock(node.tryBlock); + if (node.catchBlock) checkBlock(node.catchBlock); + if (node.finallyBlock) checkBlock(node.finallyBlock); + } + + function checkIndexConstraints(type: Type) { + + function checkIndexConstraintForProperty(prop: Symbol, propertyType: Type, indexDeclaration: Declaration, indexType: Type, indexKind: IndexKind): void { + if (!indexType) { + return; + } + + // index is numeric and property name is not valid numeric literal + if (indexKind === IndexKind.Number && !isNumericName(prop.name)) { + return; + } + + // perform property check if property or indexer is declared in 'type' + // this allows to rule out cases when both property and indexer are inherited from the base class + var errorNode: Node; + if (prop.parent === type.symbol) { + errorNode = prop.valueDeclaration; + } + else if (indexDeclaration) { + errorNode = indexDeclaration; + } + + else if (type.flags & TypeFlags.Interface) { + // for interfaces property and indexer might be inherited from different bases + // check if any base class already has both property and indexer. + // check should be performed only if 'type' is the first type that brings property\indexer together + var someBaseClassHasBothPropertyAndIndexer = forEach((type).baseTypes, (base) => getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind)); + errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; + } + + if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { + var errorMessage = + indexKind === IndexKind.String + ? Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 + : Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType, /*printArrayAsGenericType*/ false), typeToString(indexType, /*printArrayAsGenericType*/ false)); + } + } + + var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, IndexKind.Number); + var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, IndexKind.String); + + var stringIndexType = getIndexTypeOfType(type, IndexKind.String); + var numberIndexType = getIndexTypeOfType(type, IndexKind.Number); + + if (stringIndexType || numberIndexType) { + forEach(getPropertiesOfType(type), prop => { + var propType = getTypeOfSymbol(prop); + checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, IndexKind.String); + checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, IndexKind.Number); + }); + } + + var errorNode: Node; + if (stringIndexType && numberIndexType) { + errorNode = declaredNumberIndexer || declaredStringIndexer; + // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer + if (!errorNode && (type.flags & TypeFlags.Interface)) { + var someBaseTypeHasBothIndexers = forEach((type).baseTypes, base => getIndexTypeOfType(base, IndexKind.String) && getIndexTypeOfType(base, IndexKind.Number)); + errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; + } + } + + if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { + error(errorNode, Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, + typeToString(numberIndexType, /*printArrayAsGenericType*/ false), typeToString(stringIndexType, /*printArrayAsGenericType*/ false)); + } + } + + function checkNameIsReserved(name: Identifier, message: DiagnosticMessage): boolean { + // TS 1.0 spec (April 2014): 3.6.1 + // The predefined type keywords are reserved and cannot be used as names of user defined types. + switch (name.text) { + case "any": + case "number": + case "boolean": + case "string": + case "void": + error(name, message, name.text); + return true; + } + } + + // Check each type parameter and check that list has no duplicate type parameter declarations + function checkTypeParameters(typeParameterDeclarations: TypeParameterDeclaration[]) { + if (typeParameterDeclarations) { + for (var i = 0; i < typeParameterDeclarations.length; i++) { + var node = typeParameterDeclarations[i]; + checkTypeParameter(node); + for (var j = 0; j < i; j++) { + if (typeParameterDeclarations[j].symbol === node.symbol) { + error(node.name, Diagnostics.Duplicate_identifier_0, identifierToString(node.name)); + } + } + } + } + } + + function checkClassDeclaration(node: ClassDeclaration) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, Diagnostics.Class_name_cannot_be_0); + checkTypeParameters(node.typeParameters); + var symbol = getSymbolOfNode(node); + var type = getDeclaredTypeOfSymbol(symbol); + var staticType = getTypeOfSymbol(symbol); + if (node.baseType) { + emitExtends = emitExtends || !isDeclarationContext(node); + checkTypeReference(node.baseType); + } + if (type.baseTypes.length) { + var baseType = type.baseTypes[0]; + checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, Diagnostics.Class_0_incorrectly_extends_base_class_1); + var staticBaseType = getTypeOfSymbol(baseType.symbol); + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, + Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, SymbolFlags.Value)) { + error(node.baseType, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType, /*printArrayAsGenericType*/ false)); + } + + // Check that base type can be evaluated as expression + checkExpression(node.baseType.typeName); + + checkKindsOfPropertyMemberOverrides(type, baseType); + } + if (node.implementedTypes) { + forEach(node.implementedTypes, typeRefNode => { + checkTypeReference(typeRefNode); + var t = getTypeFromTypeReferenceNode(typeRefNode); + if (t !== unknownType) { + var declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; + if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { + checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, Diagnostics.Class_0_incorrectly_implements_interface_1); + } + else { + error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface); + } + } + }); + } + checkIndexConstraints(type); + forEach(node.members, checkSourceElement); + + checkTypeForDuplicateIndexSignatures(node); + } + + function getTargetSymbol(s: Symbol) { + // if symbol is instantiated it's flags are not copied from the 'target' + // so we'll need to get back original 'target' symbol to work with correct set of flags + return s.flags & SymbolFlags.Instantiated ? getSymbolLinks(s).target : s; + } + + function checkKindsOfPropertyMemberOverrides(type: InterfaceType, baseType: ObjectType): void { + + // TypeScript 1.0 spec (April 2014): 8.2.3 + // A derived class inherits all members from its base class it doesn't override. + // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. + // Both public and private property members are inherited, but only public property members can be overridden. + // A property member in a derived class is said to override a property member in a base class + // when the derived class property member has the same name and kind(instance or static) + // as the base class property member. + // The type of an overriding property member must be assignable(section 3.8.4) + // to the type of the overridden property member, or otherwise a compile - time error occurs. + // Base class instance member functions can be overridden by derived class instance member functions, + // but not by other kinds of members. + // Base class instance member variables and accessors can be overridden by + // derived class instance member variables and accessors, but not by other kinds of members. + + // NOTE: assignability is checked in checkClassDeclaration + var baseProperties = getPropertiesOfType(baseType); + for (var i = 0, len = baseProperties.length; i < len; ++i) { + var base = getTargetSymbol(baseProperties[i]); + + if (base.flags & SymbolFlags.Prototype) { + continue; + } + + var derived = getTargetSymbol(getPropertyOfType(type, base.name)); + if (derived) { + var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); + var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); + if ((baseDeclarationFlags & NodeFlags.Private) || (derivedDeclarationFlags & NodeFlags.Private)) { + // either base or derived property is private - not override, skip it + continue; + } + + if ((baseDeclarationFlags & NodeFlags.Static) !== (derivedDeclarationFlags & NodeFlags.Static)) { + // value of 'static' is not the same for properties - not override, skip it + continue; + } + + if ((base.flags & derived.flags & SymbolFlags.Method) || ((base.flags & SymbolFlags.PropertyOrAccessor) && (derived.flags & SymbolFlags.PropertyOrAccessor))) { + // method is overridden with method or property\accessor is overridden with property\accessor - correct case + continue; + } + + var errorMessage: DiagnosticMessage; + if (base.flags & SymbolFlags.Method) { + if (derived.flags & SymbolFlags.Accessor) { + errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; + } + else { + Debug.assert(derived.flags & SymbolFlags.Property); + errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; + } + } + else if (base.flags & SymbolFlags.Property) { + Debug.assert(derived.flags & SymbolFlags.Method); + errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; + } + else { + Debug.assert(base.flags & SymbolFlags.Accessor); + Debug.assert(derived.flags & SymbolFlags.Method); + errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; + } + + error(derived.valueDeclaration.name, errorMessage, typeToString(baseType, /* printArrayAsGenericType*/ false), symbolToString(base), typeToString(type, /* printArrayAsGenericType*/ false)); + } + } + } + + function isAccessor(kind: SyntaxKind): boolean { + return kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor; + } + + function areTypeParametersIdentical(list1: TypeParameterDeclaration[], list2: TypeParameterDeclaration[]) { + if (!list1 && !list2) { + return true; + } + if (!list1 || !list2 || list1.length !== list2.length) { + return false; + } + // TypeScript 1.0 spec (April 2014): + // When a generic interface has multiple declarations, all declarations must have identical type parameter + // lists, i.e. identical type parameter names with identical constraints in identical order. + for (var i = 0, len = list1.length; i < len; i++) { + var tp1 = list1[i]; + var tp2 = list2[i]; + if (tp1.name.text !== tp2.name.text) { + return false; + } + if (!tp1.constraint && !tp2.constraint) { + continue; + } + if (!tp1.constraint || !tp2.constraint) { + return false; + } + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { + return false; + } + } + return true; + } + + function checkInterfaceDeclaration(node: InterfaceDeclaration) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, Diagnostics.Interface_name_cannot_be_0); + checkTypeParameters(node.typeParameters); + var symbol = getSymbolOfNode(node); + if (symbol.declarations.length > 1) { + var firstInterfaceDecl = getDeclarationOfKind(symbol, SyntaxKind.InterfaceDeclaration); + if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { + error(node.name, Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); + } + } + + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + var type = getDeclaredTypeOfSymbol(symbol); + // run subsequent checks only if first set succeeded + if (checkInheritedPropertiesAreIdentical(type, node.name)) { + forEach(type.baseTypes, baseType => { + checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, Diagnostics.Interface_0_incorrectly_extends_interface_1); + }); + checkIndexConstraints(type); + } + links.typeChecked = true; + } + forEach(node.baseTypes, checkTypeReference); + forEach(node.members, checkSourceElement); + + checkTypeForDuplicateIndexSignatures(node); + } + + function getConstantValue(node: Expression): number { + var isNegative = false; + if (node.kind === SyntaxKind.PrefixOperator) { + var unaryExpression = node; + if (unaryExpression.operator === SyntaxKind.MinusToken || unaryExpression.operator === SyntaxKind.PlusToken) { + node = unaryExpression.operand; + isNegative = unaryExpression.operator === SyntaxKind.MinusToken; + } + } + if (node.kind === SyntaxKind.NumericLiteral) { + var literalText = (node).text; + return isNegative ? -literalText : +literalText; + } + + return undefined; + } + + function checkEnumDeclaration(node: EnumDeclaration) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, Diagnostics.Enum_name_cannot_be_0); + var enumType = getDeclaredTypeOfSymbol(getSymbolOfNode(node)); + var autoValue = 0; + var ambient = isDeclarationContext(node); + forEach(node.members, member => { + var initializer = member.initializer; + if (initializer) { + autoValue = getConstantValue(initializer); + if (autoValue === undefined && !ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + } + } + else if (ambient) { + autoValue = undefined; + } + + if (autoValue !== undefined) { + getNodeLinks(member).enumMemberValue = autoValue++; + } + }); + // TODO: Only one enum declaration can omit the initial value + } + + function checkModuleDeclaration(node: ModuleDeclaration) { + checkDeclarationModifiers(node); + if (node.name.kind === SyntaxKind.StringLiteral) { + if (!isDeclarationContext(node)) { + error(node, Diagnostics.Ambient_external_modules_require_a_declare_modifier); + } + if (node.parent.kind !== SyntaxKind.SourceFile || node.parent.flags & NodeFlags.ExternalModule) { + error(node, Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); + } + if (isExternalModuleNameRelative(node.name.text)) { + error(node, Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); + } + var symbol = getSymbolOfNode(node); + var links = getSymbolLinks(symbol); + if (!links.typeChecked) { + getExportAssignmentSymbol(symbol); + links.typeChecked = true; + } + } + checkSourceElement(node.body); + } + + function checkImportDeclaration(node: ImportDeclaration) { + checkDeclarationModifiers(node); + checkNameIsReserved(node.name, Diagnostics.Import_name_cannot_be_0); + var symbol = getSymbolOfNode(node); + var target: Symbol; + + if (node.entityName) { + target = resolveImport(symbol); + // Import declaration for an internal module + if (target !== unknownSymbol && target.flags & SymbolFlags.Value) { + // Target is a value symbol, check that it can be evaluated as an expression + checkExpression(node.entityName); + } + } + else { + // Import declaration for an external module + if (node.parent.kind === SyntaxKind.SourceFile) { + // Parent is a source file, check that external modules are enabled + checkModulesEnabled(node); + target = resolveImport(symbol); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock && (node.parent.parent).name.kind === SyntaxKind.StringLiteral) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. + if (isExternalModuleNameRelative(node.externalModuleName.text)) { + error(node, Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); + target = unknownSymbol; + } + else { + target = resolveImport(symbol); + } + } + else { + // Parent is an internal module (syntax error is already reported) + target = unknownSymbol; + } + } + if (target !== unknownSymbol) { + var excludedMeanings = + (symbol.flags & SymbolFlags.Value ? SymbolFlags.Value : 0) | + (symbol.flags & SymbolFlags.Type ? SymbolFlags.Type : 0) | + (symbol.flags & SymbolFlags.Namespace ? SymbolFlags.Namespace : 0); + if (target.flags & excludedMeanings) { + error(node, Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); + } + } + } + + function checkModulesEnabled(node: Node) { + if (!modulesVerified) { + if (!program.getCompilerOptions().module) { + error(node, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided); + } + modulesVerified = true; + } + } + + function checkExportAssignment(node: ExportAssignment) { + var container = node.parent; + if (container.kind === SyntaxKind.SourceFile) { + checkModulesEnabled(node); + } + } + + function checkSourceElement(node: Node): void { + if (!node) return; + switch (node.kind) { + case SyntaxKind.TypeParameter: + return checkTypeParameter(node); + case SyntaxKind.Parameter: + return checkParameter(node); + case SyntaxKind.Property: + return checkPropertyDeclaration(node); + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return checkSignatureDeclaration(node); + case SyntaxKind.Method: + return checkMethodDeclaration(node); + case SyntaxKind.Constructor: + return checkConstructorDeclaration(node); + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return checkAccessorDeclaration(node); + case SyntaxKind.TypeReference: + return checkTypeReference(node); + case SyntaxKind.TypeQuery: + return checkTypeQuery(node); + case SyntaxKind.TypeLiteral: + return checkTypeLiteral(node); + case SyntaxKind.ArrayType: + return checkArrayType(node); + case SyntaxKind.FunctionDeclaration: + return checkFunctionDeclaration(node); + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: + return checkBlock(node); + case SyntaxKind.VariableStatement: + return checkVariableStatement(node); + case SyntaxKind.ExpressionStatement: + return checkExpressionStatement(node); + case SyntaxKind.IfStatement: + return checkIfStatement(node); + case SyntaxKind.DoStatement: + return checkDoStatement(node); + case SyntaxKind.WhileStatement: + return checkWhileStatement(node); + case SyntaxKind.ForStatement: + return checkForStatement(node); + case SyntaxKind.ForInStatement: + return checkForInStatement(node); + case SyntaxKind.ContinueStatement: + case SyntaxKind.BreakStatement: + return checkBreakOrContinueStatement(node); + case SyntaxKind.ReturnStatement: + return checkReturnStatement(node); + case SyntaxKind.WithStatement: + return checkWithStatement(node); + case SyntaxKind.SwitchStatement: + return checkSwitchStatement(node); + case SyntaxKind.LabelledStatement: + return checkLabelledStatement(node); + case SyntaxKind.ThrowStatement: + return checkThrowStatement(node); + case SyntaxKind.TryStatement: + return checkTryStatement(node); + case SyntaxKind.VariableDeclaration: + return Debug.fail("Checker encountered variable declaration"); + case SyntaxKind.ClassDeclaration: + return checkClassDeclaration(node); + case SyntaxKind.InterfaceDeclaration: + return checkInterfaceDeclaration(node); + case SyntaxKind.EnumDeclaration: + return checkEnumDeclaration(node); + case SyntaxKind.ModuleDeclaration: + return checkModuleDeclaration(node); + case SyntaxKind.ImportDeclaration: + return checkImportDeclaration(node); + case SyntaxKind.ExportAssignment: + return checkExportAssignment(node); + } + } + + function checkSourceFile(node: SourceFile) { + var links = getNodeLinks(node); + if (!(links.flags & NodeCheckFlags.TypeChecked)) { + emitExtends = false; + forEach(node.statements, checkSourceElement); + if (node.flags & NodeFlags.ExternalModule) { + var symbol = getExportAssignmentSymbol(node.symbol); + if (symbol && symbol.flags & SymbolFlags.Import) { + // Mark the import as referenced so that we emit it in the final .js file. + getSymbolLinks(symbol).referenced = true; + } + } + if (emitExtends) links.flags |= NodeCheckFlags.EmitExtends; + links.flags |= NodeCheckFlags.TypeChecked; + } + } + + function checkProgram() { + forEach(program.getSourceFiles(), checkSourceFile); + } + + function getSortedDiagnostics(): Diagnostic[] { + if (diagnosticsModified) { + diagnostics.sort(compareDiagnostics); + diagnostics = deduplicateSortedDiagnostics(diagnostics); + diagnosticsModified = false; + } + return diagnostics; + } + + function getDiagnostics(sourceFile?: SourceFile): Diagnostic[] { + if (sourceFile) { + checkSourceFile(sourceFile); + return filter(getSortedDiagnostics(), d => d.file === sourceFile); + } + checkProgram(); + return getSortedDiagnostics(); + } + + function getGlobalDiagnostics(): Diagnostic[] { + return filter(getSortedDiagnostics(), d => !d.file); + } + + // Language service support + + function getNodeAtPosition(sourceFile: SourceFile, position: number): Node { + function findChildAtPosition(parent: Node) { + var child = forEachChild(parent, node => { + if (position >= node.pos && position <= node.end && position >= getTokenPosOfNode(node)) { + return findChildAtPosition(node); + } + }); + return child || parent; + } + if (position < sourceFile.pos) position = sourceFile.pos; + if (position > sourceFile.end) position = sourceFile.end; + return findChildAtPosition(sourceFile); + } + + function getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[] { + var symbols: SymbolTable = {}; + var memberFlags: NodeFlags = 0; + function copySymbol(symbol: Symbol, meaning: SymbolFlags) { + if (symbol.flags & meaning) { + var id = symbol.name; + if (!isReservedMemberName(id) && !hasProperty(symbols, id)) { + symbols[id] = symbol; + } + } + } + function copySymbols(source: SymbolTable, meaning: SymbolFlags) { + if (meaning) { + for (var id in source) { + if (hasProperty(source, id)) { + copySymbol(source[id], meaning); + } + } + } + } + while (location) { + if (location.locals && (location.kind !== SyntaxKind.SourceFile || location.flags & NodeFlags.ExternalModule)) { + copySymbols(location.locals, meaning); + } + switch (location.kind) { + case SyntaxKind.SourceFile: + if (!(location.flags & NodeFlags.ExternalModule)) break; + case SyntaxKind.ModuleDeclaration: + copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.ModuleMember); + break; + case SyntaxKind.EnumDeclaration: + copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.EnumMember); + break; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + if (!(memberFlags & NodeFlags.Static)) { + copySymbols(getSymbolOfNode(location).members, meaning & SymbolFlags.Type); + } + break; + case SyntaxKind.FunctionExpression: + if ((location).name) { + copySymbol(location.symbol, meaning); + } + break; + case SyntaxKind.CatchBlock: + if ((location).variable.text) { + copySymbol(location.symbol, meaning); + } + break; + } + memberFlags = location.flags; + location = location.parent; + } + copySymbols(globals, meaning); + return mapToArray(symbols); + } + + // True if the given identifier is the identifier of a declaration node + function isDeclarationIdentifier(identifier: Identifier): boolean { + if (identifier.parent) { + switch (identifier.parent.kind) { + case SyntaxKind.TypeParameter: + case SyntaxKind.Parameter: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Property: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.EnumMember: + case SyntaxKind.Method: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportDeclaration: + return (identifier.parent).name === identifier; + case SyntaxKind.CatchBlock: + return (identifier.parent).variable === identifier; + } + } + return false; + } + + // True if the given identifier is part of a type reference + function isTypeReferenceIdentifier(identifier: Identifier): boolean { + var node: Node = identifier; + while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + return node.parent && node.parent.kind === SyntaxKind.TypeReference; + } + + function isExpression(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.TypeAssertion: + case SyntaxKind.ParenExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + case SyntaxKind.BinaryExpression: + case SyntaxKind.ConditionalExpression: + return true; + case SyntaxKind.QualifiedName: + while (node.parent && node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + return node.parent && node.parent.kind === SyntaxKind.TypeQuery; + case SyntaxKind.Identifier: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + var parent = node.parent; + if (parent) { + if (isExpression(parent)) return true; + switch (parent.kind) { + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Parameter: + case SyntaxKind.Property: + case SyntaxKind.EnumMember: + return (parent).initializer === node; + case SyntaxKind.ExpressionStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.ThrowStatement: + case SyntaxKind.SwitchStatement: + return (parent).expression === node; + case SyntaxKind.ForStatement: + return (parent).initializer === node || (parent).condition === node || + (parent).iterator === node; + case SyntaxKind.ForInStatement: + return (parent).variable === node || (parent).expression === node; + } + } + } + return false; + } + + function getSymbolOfIdentifier(identifier: Identifier) { + if (isExpression(identifier)) { + if (isRightSideOfQualifiedName()) { + // TODO + } + return resolveEntityName(identifier, identifier, SymbolFlags.Value); + } + if (isDeclarationIdentifier(identifier)) { + return getSymbolOfNode(identifier.parent); + } + if (isTypeReferenceIdentifier(identifier)) { + var entityName = isRightSideOfQualifiedName() ? identifier.parent : identifier; + var meaning = entityName.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace; + return resolveEntityName(entityName, entityName, meaning); + } + function isRightSideOfQualifiedName() { + return (identifier.parent.kind === SyntaxKind.QualifiedName || identifier.parent.kind === SyntaxKind.PropertyAccess) && + (identifier.parent).right === identifier; + } + } + + // Emitter support + + function getModuleObjectName(node: ModuleDeclaration): string { + return getSourceTextOfNode(node.name); + } + + function isExternalModule(symbol: Symbol): boolean { + return symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length === 1 && symbol.declarations[0].kind === SyntaxKind.SourceFile; + } + + function getExpressionNamePrefix(node: Identifier): string { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + // In general, we need to prefix an identifier with its parent name if it references + // an exported entity from another module declaration. If we reference an exported + // entity within the same module declaration, then whether we prefix depends on the + // kind of entity. SymbolFlags.ExportHasLocal encompasses all the kinds that we + // do NOT prefix. + var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); + var isExportedSymbolFoundInLocalScope = exportSymbol !== symbol; + var shouldEmitExportWithoutPrefix = (exportSymbol.flags & SymbolFlags.ExportHasLocal) !== 0; + if (isExportedSymbolFoundInLocalScope && !shouldEmitExportWithoutPrefix) { + symbol = exportSymbol; + } + + // symbol will have a parent if it is an export symbol + if (symbol.parent) { + return isExternalModule(symbol.parent) ? "exports" : symbolToString(symbol.parent); + } + } + } + + function getPropertyAccessSubstitution(node: PropertyAccess): string { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && (symbol.flags & SymbolFlags.EnumMember)) { + var declaration = symbol.valueDeclaration; + var constantValue: number; + if (declaration.kind === SyntaxKind.EnumMember && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + return constantValue.toString() + " /* " + identifierToString(declaration.name) + " */"; + } + } + } + + function getExportAssignmentName(node: SourceFile): string { + var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); + return symbol && symbolIsValue(symbol) ? symbolToString(symbol): undefined; + } + + function isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean { + if (node.parent.kind !== SyntaxKind.SourceFile || !node.entityName) { + // parent is not source file or it is not reference to internal module + return false; + } + var symbol = getSymbolOfNode(node); + var target = resolveImport(symbol); + return target !== unknownSymbol && ((target.flags & SymbolFlags.Value) !== 0); + } + + function shouldEmitDeclarations() { + // If the declaration emit and there are no errors being reported in program or by checker + // declarations can be emitted + return program.getCompilerOptions().declaration && + !program.getDiagnostics().length && + !getDiagnostics().length; + } + + function isReferencedImportDeclaration(node: ImportDeclaration): boolean { + var symbol = getSymbolOfNode(node); + if (getSymbolLinks(symbol).referenced) { + return true; + } + // logic below will answer 'true' for exported import declaration in a nested module that itself is not exported. + // As a consequence this might cause emitting extra. + if (node.flags & NodeFlags.Export) { + var target = resolveImport(symbol); + if (target !== unknownSymbol && target.flags & SymbolFlags.Value) { + return true; + } + } + return false; + } + + function getNodeCheckFlags(node: Node): NodeCheckFlags { + return getNodeLinks(node).flags; + } + + function getEnumMemberValue(node: EnumMember): number { + return getNodeLinks(node).enumMemberValue; + } + + function invokeEmitter() { + var resolver: EmitResolver = { + getProgram: () => program, + getModuleObjectName: getModuleObjectName, + getExpressionNamePrefix: getExpressionNamePrefix, + getPropertyAccessSubstitution: getPropertyAccessSubstitution, + getExportAssignmentName: getExportAssignmentName, + isReferencedImportDeclaration: isReferencedImportDeclaration, + getNodeCheckFlags: getNodeCheckFlags, + getEnumMemberValue: getEnumMemberValue, + isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + shouldEmitDeclarations: shouldEmitDeclarations + }; + checkProgram(); + return emitFiles(resolver); + } + + function initializeTypeChecker() { + // Bind all source files and propagate errors + forEach(program.getSourceFiles(), file => { + bindSourceFile(file); + forEach(file.semanticErrors, addDiagnostic); + }); + // Initialize global symbol table + forEach(program.getSourceFiles(), file => { + if (!(file.flags & NodeFlags.ExternalModule)) { + extendSymbolTable(globals, file.locals); + } + }); + // Initialize special symbols + getSymbolLinks(undefinedSymbol).type = undefinedType; + getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); + getSymbolLinks(unknownSymbol).type = unknownType; + globals[undefinedSymbol.name] = undefinedSymbol; + // Initialize special types + globalObjectType = getGlobalType("Object"); + globalFunctionType = getGlobalType("Function"); + globalArrayType = getGlobalType("Array", 1); + globalStringType = getGlobalType("String"); + globalNumberType = getGlobalType("Number"); + globalBooleanType = getGlobalType("Boolean"); + globalRegExpType = getGlobalType("RegExp"); + } + + initializeTypeChecker(); + checker = { + getProgram: () => program, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"), + getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"), + getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"), + getTypeCount: () => typeCount, + checkProgram: checkProgram, + emitFiles: invokeEmitter, + getSymbolOfNode: getSymbolOfNode, + getParentOfSymbol: getParentOfSymbol, + getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, + getPropertiesOfType: getPropertiesOfType, + getSignaturesOfType: getSignaturesOfType, + getIndexTypeOfType: getIndexTypeOfType, + getReturnTypeOfSignature: getReturnTypeOfSignature, + resolveEntityName: resolveEntityName, + getSymbolsInScope: getSymbolsInScope, + getSymbolOfIdentifier: getSymbolOfIdentifier + }; + return checker; + } +} diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts new file mode 100644 index 0000000000000..87904cc297c90 --- /dev/null +++ b/src/compiler/commandLineParser.ts @@ -0,0 +1,146 @@ +/// +/// +/// +/// + +module ts { + var shortOptionNames: Map = { + "d": "declaration", + "h": "help", + "m": "module", + "o": "out", + "t": "target", + "v": "version", + }; + + var options: CommandLineOption[] = [ + { name: "codepage", type: "number" }, + { name: "declaration", type: "boolean" }, + { name: "diagnostics", type: "boolean" }, + { name: "help", type: "boolean" }, + { name: "locale", type: "string" }, + { name: "mapRoot", type: "string" }, + { name: "module", type: { "commonjs": ModuleKind.CommonJS, "amd": ModuleKind.AMD }, error: Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { name: "noImplicitAny", type: "boolean" }, + { name: "noLib", type: "boolean" }, + { name: "noLibCheck", type: "boolean" }, + { name: "noResolve", type: "boolean" }, + { name: "out", type: "string" }, + { name: "outDir", type: "string" }, + { name: "removeComments", type: "boolean" }, + { name: "sourceMap", type: "boolean" }, + { name: "sourceRoot", type: "string" }, + { name: "target", type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5 }, error: Diagnostics.Argument_for_target_option_must_be_es3_or_es5 }, + { name: "version", type: "boolean" } + ]; + + // Map command line switches to compiler options' property descriptors. Keys must be lower case spellings of command line switches. + // The 'name' property specifies the property name in the CompilerOptions type. The 'type' property specifies the type of the option. + var optionDeclarations: Map = {}; + forEach(options, option => { + optionDeclarations[option.name.toLowerCase()] = option; + }); + + export function parseCommandLine(commandLine: string[]): ParsedCommandLine { + // Set default compiler option values + var options: CompilerOptions = { + target: ScriptTarget.ES3 + }; + var filenames: string[] = []; + var errors: Diagnostic[] = []; + + parseStrings(commandLine); + return { + options: options, + filenames: filenames, + errors: errors + }; + + function parseStrings(args: string[]) { + var i = 0; + while (i < args.length) { + var s = args[i++]; + if (s.charCodeAt(0) === CharacterCodes.at) { + parseResponseFile(s.slice(1)); + } + else if (s.charCodeAt(0) === CharacterCodes.minus) { + s = s.slice(s.charCodeAt(1) === CharacterCodes.minus ? 2 : 1).toLowerCase(); + + // Try to translate short option names to their full equivalents. + if (hasProperty(shortOptionNames, s)) { + s = shortOptionNames[s]; + } + + if (hasProperty(optionDeclarations, s)) { + var opt = optionDeclarations[s]; + + // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). + if (!args[i] && opt.type !== "boolean") { + errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); + } + + switch (opt.type) { + case "number": + options[opt.name] = parseInt(args[i++]); + break; + case "boolean": + options[opt.name] = true; + break; + case "string": + options[opt.name] = args[i++] || ""; + break; + // If not a primitive, the possible types are specified in what is effectively a map of options. + default: + var value = (args[i++] || "").toLowerCase(); + if (hasProperty(opt.type, value)) { + options[opt.name] = opt.type[value]; + } + else { + errors.push(createCompilerDiagnostic(opt.error)); + } + } + } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Unknown_compiler_option_0, s)); + } + } + else { + filenames.push(s); + } + } + } + + function parseResponseFile(filename: string) { + var text = sys.readFile(filename); + + if (!text) { + errors.push(createCompilerDiagnostic(Diagnostics.File_0_not_found, filename)); + return; + } + + var args: string[] = []; + var pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= CharacterCodes.space) pos++; + if (pos >= text.length) break; + var start = pos; + if (text.charCodeAt(start) === CharacterCodes.doubleQuote) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== CharacterCodes.doubleQuote) pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Unterminated_quoted_string_in_response_file_0, filename)); + } + } + else { + while (text.charCodeAt(pos) > CharacterCodes.space) pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } +} diff --git a/src/compiler/core.ts b/src/compiler/core.ts new file mode 100644 index 0000000000000..7338448a3e7c7 --- /dev/null +++ b/src/compiler/core.ts @@ -0,0 +1,534 @@ +/// + +module ts { + export interface Map { + [index: string]: T; + } + + export function forEach(array: T[], callback: (element: T) => U): U { + var result: U; + if (array) { + for (var i = 0, len = array.length; i < len; i++) { + if (result = callback(array[i])) break; + } + } + return result; + } + + export function contains(array: T[], value: T): boolean { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) return true; + } + } + return false; + } + + export function indexOf(array: T[], value: T): number { + if (array) { + var len = array.length; + for (var i = 0; i < len; i++) { + if (array[i] === value) return i; + } + } + return -1; + } + + export function filter(array: T[], f: (x: T) => boolean): T[] { + var result: T[]; + if (array) { + result = []; + for (var i = 0, len = array.length; i < len; i++) { + var item = array[i]; + if (f(item)) result.push(item); + } + } + return result; + } + + export function map(array: T[], f: (x: T) => U): U[] { + var result: U[]; + if (array) { + result = []; + var len = array.length; + for (var i = 0; i < len; i++) { + result.push(f(array[i])); + } + } + return result; + } + + export function concatenate(array1: T[], array2: T[]): T[] { + if (!array2.length) return array1; + if (!array1.length) return array2; + return array1.concat(array2); + } + + export function sum(array: any[], prop: string): number { + var result = 0; + for (var i = 0; i < array.length; i++) { + result += array[i][prop]; + } + return result; + } + + export function binarySearch(array: number[], value: number): number { + var low = 0; + var high = array.length - 1; + + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + + return ~low; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + export function hasProperty(map: Map, key: string): boolean { + return hasOwnProperty.call(map, key); + } + + export function getProperty(map: Map, key: string): T { + return hasOwnProperty.call(map, key) ? map[key] : undefined; + } + + export function isEmpty(map: Map) { + for (var id in map) return false; + return true; + } + + export function clone(object: T): T { + var result: any = {}; + for (var id in object) { + result[id] = (object)[id]; + } + return result; + } + + export function forEachValue(map: Map, callback: (value: T) => U): U { + var result: U; + for (var id in map) { + if (result = callback(map[id])) break; + } + return result; + } + + export function mapToArray(map: Map): T[] { + var result: T[] = []; + for (var id in map) result.push(map[id]); + return result; + } + + function formatStringFromArgs(text: string, args: { [index: number]: any; }, baseIndex?: number): string { + baseIndex = baseIndex || 0; + + return text.replace(/{(\d+)}/g, (match, index?) => args[+index + baseIndex]); + } + + export var localizedDiagnosticMessages: Map = undefined; + + function getLocaleSpecificMessage(message: string) { + if (ts.localizedDiagnosticMessages) { + message = localizedDiagnosticMessages[message]; + } + + /* Check to see that we got an actual value back. */ + Debug.assert(message, "Diagnostic message does not exist in locale map."); + + return message; + } + + export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; + export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage): Diagnostic { + var text = getLocaleSpecificMessage(message.key); + + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + + return { + file: file, + start: start, + length: length, + + messageText: text, + category: message.category, + code: message.code + }; + } + + export function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic; + export function createCompilerDiagnostic(message: DiagnosticMessage): Diagnostic { + var text = getLocaleSpecificMessage(message.key); + + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + + return { + file: undefined, + start: undefined, + length: undefined, + + messageText: text, + category: message.category, + code: message.code + }; + } + + export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; + export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage): DiagnosticMessageChain { + var text = getLocaleSpecificMessage(message.key); + + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + + return { + messageText: text, + category: message.category, + code: message.code, + + next: details + } + } + + export function flattenDiagnosticChain(file: SourceFile, start: number, length: number, diagnosticChain: DiagnosticMessageChain): Diagnostic { + var code = diagnosticChain.code; + var category = diagnosticChain.category; + var messageText = ""; + + var indent = 0; + while (diagnosticChain) { + if (indent) { + messageText += sys.newLine; + + for (var i = 0; i < indent; i++) { + messageText += " "; + } + } + messageText += diagnosticChain.messageText; + indent++; + diagnosticChain = diagnosticChain.next; + } + + return { + file: file, + start: start, + length: length, + code: code, + category: category, + messageText: messageText + }; + } + + function compareValues(a: any, b: any): number { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return 1; + return a < b ? -1 : 1; + } + + function getDiagnosticFilename(diagnostic: Diagnostic): string { + return diagnostic.file ? diagnostic.file.filename : undefined; + } + + export function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): number { + return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || + compareValues(d1.start, d2.start) || + compareValues(d1.length, d2.length) || + compareValues(d1.code, d2.code) || + compareValues(d1.messageText, d2.messageText) || + 0; + } + + export function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[] { + if (diagnostics.length < 2) { + return diagnostics; + } + + var newDiagnostics = [diagnostics[0]]; + var previousDiagnostic = diagnostics[0]; + for (var i = 1; i < diagnostics.length; i++) { + var currentDiagnostic = diagnostics[i]; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + if (!isDupe) { + newDiagnostics.push(currentDiagnostic); + previousDiagnostic = currentDiagnostic; + } + } + + return newDiagnostics; + } + + export function normalizeSlashes(path: string): string { + return path.replace(/\\/g, "/"); + } + + // Returns length of path root (i.e. length of "/", "x:/", "//server/share/") + function getRootLength(path: string): number { + if (path.charCodeAt(0) === CharacterCodes.slash) { + if (path.charCodeAt(1) !== CharacterCodes.slash) return 1; + var p1 = path.indexOf("/", 2); + if (p1 < 0) return 2; + var p2 = path.indexOf("/", p1 + 1); + if (p2 < 0) return p1 + 1; + return p2 + 1; + } + if (path.charCodeAt(1) === CharacterCodes.colon) { + if (path.charCodeAt(2) === CharacterCodes.slash) return 3; + return 2; + } + return 0; + } + + export var directorySeparator = "/"; + function getNormalizedParts(normalizedSlashedPath: string, rootLength: number) { + var parts = normalizedSlashedPath.substr(rootLength).split(directorySeparator); + var normalized: string[] = []; + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part !== ".") { + if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + normalized.pop(); + } + else { + normalized.push(part); + } + } + } + + return normalized; + } + + export function normalizePath(path: string): string { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + var normalized = getNormalizedParts(path, rootLength); + return path.substr(0, rootLength) + normalized.join(directorySeparator); + } + + export function getDirectoryPath(path: string) { + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); + } + + export function isUrl(path: string) { + return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; + } + + export function isRootedDiskPath(path: string) { + return getRootLength(path) !== 0; + } + + function normalizedPathComponents(path: string, rootLength: number) { + var normalizedParts = getNormalizedParts(path, rootLength); + return [path.substr(0, rootLength)].concat(normalizedParts); + } + + export function getNormalizedPathComponents(path: string, currentDirectory: string) { + var path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength == 0) { + // If the path is not rooted it is relative to current directory + path = combinePaths(normalizeSlashes(currentDirectory), path); + rootLength = getRootLength(path); + } + + return normalizedPathComponents(path, rootLength); + } + + export function getNormalizedPathFromPathCompoments(pathComponents: string[]) { + if (pathComponents && pathComponents.length) { + return pathComponents[0] + pathComponents.slice(1).join(directorySeparator); + } + } + + function getNormalizedPathComponentsOfUrl(url: string) { + // Get root length of http://www.website.com/folder1/foler2/ + // In this example the root is: http://www.website.com/ + // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] + + var urlLength = url.length; + // Initial root length is http:// part + var rootLength = url.indexOf("://") + "://".length; + while (rootLength < urlLength) { + // Consume all immediate slashes in the protocol + // eg.initial rootlength is just file:// but it needs to consume another "/" in file:/// + if (url.charCodeAt(rootLength) === CharacterCodes.slash) { + rootLength++; + } + else { + // non slash character means we continue proceeding to next component of root search + break; + } + } + + // there are no parts after http:// just return current string as the pathComponent + if (rootLength === urlLength) { + return [url]; + } + + // Find the index of "/" after website.com so the root can be http://www.website.com/ (from existing http://) + var indexOfNextSlash = url.indexOf(directorySeparator, rootLength); + if (indexOfNextSlash !== -1) { + // Found the "/" after the website.com so the root is length of http://www.website.com/ + // and get components afetr the root normally like any other folder components + rootLength = indexOfNextSlash + 1; + return normalizedPathComponents(url, rootLength); + } + else { + // Can't find the host assume the rest of the string as component + // but make sure we append "/" to it as root is not joined using "/" + // eg. if url passed in was http://website.com we want to use root as [http://website.com/] + // so that other path manipulations will be correct and it can be merged with relative paths correctly + return [url + directorySeparator]; + } + } + + function getNormalizedPathOrUrlComponents(pathOrUrl: string, currentDirectory: string) { + if (isUrl(pathOrUrl)) { + return getNormalizedPathComponentsOfUrl(pathOrUrl); + } + else { + return getNormalizedPathComponents(pathOrUrl, currentDirectory); + } + } + + export function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, isAbsolutePathAnUrl: boolean) { + var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); + var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); + if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + // If the directory path given was of type test/cases/ then we really need components of directry to be only till its name + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] + directoryComponents.length--; + } + + // Find the component that differs + for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== pathComponents[joinStartIndex]) { + break; + } + } + + // Get the relative path + if (joinStartIndex) { + var relativePath = ""; + var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); + for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { + if (directoryComponents[joinStartIndex] !== "") { + relativePath = relativePath + ".." + directorySeparator; + } + } + + return relativePath + relativePathComponents.join(directorySeparator); + } + + // Cant find the relative path, get the absolute path + var absolutePath = getNormalizedPathFromPathCompoments(pathComponents); + if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { + absolutePath = "file:///" + absolutePath; + } + + return absolutePath; + } + + export function getBaseFilename(path: string) { + var i = path.lastIndexOf(directorySeparator); + return i < 0 ? path : path.substring(i + 1); + } + + export function combinePaths(path1: string, path2: string) { + if (!(path1 && path1.length)) return path2; + if (!(path2 && path2.length)) return path1; + if (path2.charAt(0) === directorySeparator) return path2; + if (path1.charAt(path1.length - 1) === directorySeparator) return path1 + path2; + return path1 + directorySeparator + path2; + } + + export function fileExtensionIs(path: string, extension: string): boolean { + var pathLen = path.length; + var extLen = extension.length; + return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; + } + + export interface ObjectAllocator { + getNodeConstructor(kind: SyntaxKind): new () => Node; + getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; + getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; + getSignatureConstructor(): new (checker: TypeChecker) => Signature; + } + + function Symbol(flags: SymbolFlags, name: string) { + this.flags = flags; + this.name = name; + this.declarations = undefined; + } + + function Type(checker: TypeChecker, flags: TypeFlags) { + this.flags = flags; + } + + function Signature(checker: TypeChecker) { + } + + export var objectAllocator: ObjectAllocator = { + getNodeConstructor: kind => { + function Node() { + } + Node.prototype = { + kind: kind, + pos: 0, + end: 0, + flags: 0, + parent: undefined, + }; + return Node; + }, + getSymbolConstructor: () => Symbol, + getTypeConstructor: () => Type, + getSignatureConstructor: () => Signature + } + + export enum AssertionLevel { + None = 0, + Normal = 1, + Aggressive = 2, + VeryAggressive = 3, + } + + export module Debug { + var currentAssertionLevel = AssertionLevel.None; + + export function shouldAssert(level: AssertionLevel): boolean { + return this.currentAssertionLevel >= level; + } + + export function assert(expression: any, message?: string, verboseDebugInfo?: () => string): void { + if (!expression) { + var verboseDebugString = ""; + if (verboseDebugInfo) { + verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); + } + + throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); + } + } + + export function fail(message?: string): void { + Debug.assert(false, message); + } + } +} diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts new file mode 100644 index 0000000000000..695dc909cf94c --- /dev/null +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -0,0 +1,296 @@ +// +/// +module ts { + export var Diagnostics = { + Unknown_compiler_option_0: { code: 6001, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, + File_0_not_found: { code: 6002, category: DiagnosticCategory.Error, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Unrecognized_escape_sequence: { code: 1000, category: DiagnosticCategory.Error, key: "Unrecognized escape sequence." }, + Unexpected_character_0: { code: 1001, category: DiagnosticCategory.Error, key: "Unexpected character {0}." }, + Missing_close_quote_character: { code: 1002, category: DiagnosticCategory.Error, key: "Missing close quote character." }, + Identifier_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Identifier expected." }, + _0_keyword_expected: { code: 1004, category: DiagnosticCategory.Error, key: "'{0}' keyword expected." }, + _0_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'{0}' expected." }, + Identifier_expected_0_is_a_keyword: { code: 1006, category: DiagnosticCategory.Error, key: "Identifier expected; '{0}' is a keyword." }, + Automatic_semicolon_insertion_not_allowed: { code: 1007, category: DiagnosticCategory.Error, key: "Automatic semicolon insertion not allowed." }, + Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: DiagnosticCategory.Error, key: "'*/' expected." }, + public_or_private_modifier_must_precede_static: { code: 1011, category: DiagnosticCategory.Error, key: "'public' or 'private' modifier must precede 'static'." }, + Unexpected_token: { code: 1012, category: DiagnosticCategory.Error, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: DiagnosticCategory.Error, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, + extends_clause_already_seen: { code: 1024, category: DiagnosticCategory.Error, key: "'extends' clause already seen." }, + extends_clause_must_precede_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, + Classes_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "Classes can only extend a single class." }, + implements_clause_already_seen: { code: 1027, category: DiagnosticCategory.Error, key: "'implements' clause already seen." }, + Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, + Interface_declaration_cannot_have_implements_clause: { code: 1032, category: DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, + super_invocation_cannot_have_type_arguments: { code: 1034, category: DiagnosticCategory.Error, key: "'super' invocation cannot have type arguments." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: DiagnosticCategory.Error, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, + Modifiers_cannot_appear_here: { code: 1055, category: DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, + module_class_interface_enum_import_or_statement: { code: 1067, category: DiagnosticCategory.NoPrefix, key: "module, class, interface, enum, import or statement" }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, + statement: { code: 1069, category: DiagnosticCategory.NoPrefix, key: "statement" }, + case_or_default_clause: { code: 1070, category: DiagnosticCategory.NoPrefix, key: "case or default clause" }, + identifier: { code: 1071, category: DiagnosticCategory.NoPrefix, key: "identifier" }, + call_construct_index_property_or_function_signature: { code: 1072, category: DiagnosticCategory.NoPrefix, key: "call, construct, index, property or function signature" }, + expression: { code: 1073, category: DiagnosticCategory.NoPrefix, key: "expression" }, + type_name: { code: 1074, category: DiagnosticCategory.NoPrefix, key: "type name" }, + property_or_accessor: { code: 1075, category: DiagnosticCategory.NoPrefix, key: "property or accessor" }, + parameter: { code: 1076, category: DiagnosticCategory.NoPrefix, key: "parameter" }, + type: { code: 1077, category: DiagnosticCategory.NoPrefix, key: "type" }, + type_parameter: { code: 1078, category: DiagnosticCategory.NoPrefix, key: "type parameter" }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, + Invalid_left_hand_side_in_for_in_statement: { code: 1103, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, + continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: DiagnosticCategory.Error, key: "'continue' statement can only be used within an enclosing iteration statement." }, + break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: DiagnosticCategory.Error, key: "'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_not_found: { code: 1106, category: DiagnosticCategory.Error, key: "Jump target not found." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, + return_statement_must_be_contained_within_a_function_body: { code: 1108, category: DiagnosticCategory.Error, key: "'return' statement must be contained within a function body." }, + Expression_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Expression expected." }, + Type_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: DiagnosticCategory.Error, key: "A constructor implementation cannot be declared in an ambient context." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, + Duplicate_identifier_0: { code: 2000, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2070, category: DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, + A_class_may_only_implement_another_class_or_interface: { code: 2074, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, + get_and_set_accessor_must_have_the_same_type: { code: 2096, category: DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, + Static_members_cannot_reference_class_type_parameters: { code: 2099, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2102, category: DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2112, category: DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2113, category: DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2114, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: { code: 2115, category: DiagnosticCategory.Error, key: "Variable declarations of a 'for' statement cannot use a type annotation." }, + Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: { code: 2116, category: DiagnosticCategory.Error, key: "Variable declarations of a 'for' statement must be of types 'string' or 'any'." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2117, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2118, category: DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2119, category: DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + Getters_must_return_a_value: { code: 2126, category: DiagnosticCategory.Error, key: "Getters must return a value." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2127, category: DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2158, category: DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2120, category: DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2121, category: DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + Setters_cannot_return_a_value: { code: 2122, category: DiagnosticCategory.Error, key: "Setters cannot return a value." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2130, category: DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2134, category: DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2139, category: DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + Overload_signatures_must_all_be_public_or_private: { code: 2150, category: DiagnosticCategory.Error, key: "Overload signatures must all be public or private." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2151, category: DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2152, category: DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2153, category: DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2155, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2161, category: DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2163, category: DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2189, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2190, category: DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2193, category: DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2194, category: DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2196, category: DiagnosticCategory.Error, key: "Ambient external module declaration cannot specify relative module name." }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2197, category: DiagnosticCategory.Error, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2205, category: DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2207, category: DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2224, category: DiagnosticCategory.Error, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2225, category: DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2229, category: DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2230, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2231, category: DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Duplicate_string_index_signature: { code: 2232, category: DiagnosticCategory.Error, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2233, category: DiagnosticCategory.Error, key: "Duplicate number index signature." }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Constructor_implementation_expected: { code: 2240, category: DiagnosticCategory.Error, key: "Constructor implementation expected." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + Circular_definition_of_import_alias_0: { code: 3000, category: DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 3001, category: DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 3002, category: DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, + Cannot_find_external_module_0: { code: 3003, category: DiagnosticCategory.Error, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 3004, category: DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 3005, category: DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 3006, category: DiagnosticCategory.Error, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 3007, category: DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, + Generic_type_0_requires_1_type_argument_s: { code: 3008, category: DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 3009, category: DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, + Cannot_find_global_type_0: { code: 3010, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 3011, category: DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 3012, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, + this_cannot_be_referenced_in_a_module_body: { code: 3013, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 3014, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, + this_cannot_be_referenced_in_current_location: { code: -9999999, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, + super_can_only_be_referenced_in_a_derived_class: { code: 3015, category: DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, + Property_0_does_not_exist_on_type_1: { code: 3017, category: DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 3018, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 3019, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, + Type_0_does_not_satisfy_the_constraint_1: { code: 3019, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 3020, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 3021, category: DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 3022, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 3023, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 3024, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 3024, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 3027, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 3028, category: DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + No_best_common_type_exists_between_0_and_1: { code: 3029, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}' and '{1}'." }, + No_best_common_type_exists_between_0_1_and_2: { code: 3030, category: DiagnosticCategory.Error, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, + A_rest_parameter_must_be_of_an_array_type: { code: 3031, category: DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 3032, category: DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 3033, category: DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Duplicate_function_implementation: { code: 3034, category: DiagnosticCategory.Error, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 3035, category: DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, + Index_signature_is_missing_in_type_0: { code: 4003, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible_Colon: { code: 4004, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4016, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 4017, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 4018, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 4019, category: DiagnosticCategory.NoPrefix, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 4032, category: DiagnosticCategory.NoPrefix, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, + Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.NoPrefix, key: "Unsupported file encoding." }, + Could_not_write_file_0: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}'." }, + Could_not_create_directory_0: { code: 5035, category: DiagnosticCategory.Error, key: "Could not create directory '{0}'." }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + 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." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: DiagnosticCategory.Error, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Lambda_function_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7014, category: DiagnosticCategory.Error, key: "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Array_literal_implicitly_has_an_0_type: { code: 7015, category: DiagnosticCategory.Error, key: "Array literal implicitly has an '{0}' type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Variable_declaration_list_cannot_be_empty: { code: -9999999, category: DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: -9999999, category: DiagnosticCategory.Error, key: "Unexpected end of text." }, + Unterminated_string_constant: { code: -9999999, category: DiagnosticCategory.Error, key: "Unterminated string constant." }, + Invalid_character: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid character." }, + Declaration_or_statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration or statement expected." }, + Statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Statement expected." }, + case_or_default_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Property or signature expected." }, + Enum_member_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum member expected." }, + Type_reference_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type reference expected." }, + Variable_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Variable declaration expected." }, + Argument_expression_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Argument expression expected." }, + Property_assignment_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type argument expected." }, + String_literal_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "String literal expected." }, + not_preceded_by_parameter_list: { code: -9999999, category: DiagnosticCategory.Error, key: "'=>' not preceded by parameter list." }, + Invalid_assignment_target: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid assignment target." }, + super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: DiagnosticCategory.Error, key: "'super' must be followed by argument list or member access." }, + Line_break_not_permitted_here: { code: -9999999, category: DiagnosticCategory.Error, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, + Class_member_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Class member declaration expected." }, + Declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration expected." }, + Invalid_reference_comment: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid reference comment." }, + File_0_is_not_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, + Type_0_is_not_assignable_to_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, + Private_property_0_cannot_be_reimplemented: { code: -9999999, category: DiagnosticCategory.Error, key: "Private property '{0}' cannot be reimplemented." }, + Required_property_0_cannot_be_reimplemented_with_optional_property_in_1: { code: 2012, category: DiagnosticCategory.Error, key: "Required property '{0}' cannot be reimplemented with optional property in '{1}'." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: -9999999, category: DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: -9999999, category: DiagnosticCategory.Error, key: "Only public methods of the base class are accessible via the 'super' keyword" }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: -9999999, category: DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: -9999999, category: DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, + Import_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, + Type_parameter_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, + Class_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, + Interface_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, + Enum_name_cannot_be_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, + Types_of_property_0_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Unknown_identifier_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unknown identifier '{0}'." }, + Property_0_is_inaccessible: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, + Function_implementation_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation expected." }, + return_statement_has_no_containing_function: { code: -9999999, category: DiagnosticCategory.Error, key: "'return' statement has no containing function." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_0_incorrectly_extends_base_class_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, + Class_0_incorrectly_extends_base_class_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, + Class_0_incorrectly_implements_interface_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, + Interface_0_incorrectly_extends_interface_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, + Interface_0_incorrectly_extends_interface_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Ambient_external_modules_require_a_declare_modifier: { code: -9999999, category: DiagnosticCategory.Error, key: "Ambient external modules require a 'declare' modifier." }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: -9999999, category: DiagnosticCategory.Error, key: "Ambient external modules cannot be nested in other modules." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: -9999999, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: -9999999, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: -9999999, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_or_es5: { code: -9999999, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Compiler_option_0_expects_an_argument: { code: -9999999, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unsupported locale {0}." }, + Unable_to_open_file_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unable to open file {0}." }, + Corrupted_locale_file_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, + No_input_files_specified: { code: -9999999, category: DiagnosticCategory.Error, key: "No input files specified." }, + }; +} \ No newline at end of file diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json new file mode 100644 index 0000000000000..e1cb792a16041 --- /dev/null +++ b/src/compiler/diagnosticMessages.json @@ -0,0 +1,1197 @@ +{ + "Unknown compiler option '{0}'.": { + "category": "Error", + "code": 6001 + }, + "File '{0}' not found.": { + "category": "Error", + "code": 6002 + }, + "File '{0}' must have extension '.ts' or '.d.ts'.": { + "category": "Error", + "code": 6003 + }, + + + + "Unrecognized escape sequence.": { + "category": "Error", + "code": 1000 + }, + "Unexpected character {0}.": { + "category": "Error", + "code": 1001 + }, + "Missing close quote character.": { + "category": "Error", + "code": 1002 + }, + "Identifier expected.": { + "category": "Error", + "code": 1003 + }, + "'{0}' keyword expected.": { + "category": "Error", + "code": 1004 + }, + "'{0}' expected.": { + "category": "Error", + "code": 1005 + }, + "Identifier expected; '{0}' is a keyword.": { + "category": "Error", + "code": 1006 + }, + "Automatic semicolon insertion not allowed.": { + "category": "Error", + "code": 1007 + }, + "Trailing comma not allowed.": { + "category": "Error", + "code": 1009 + }, + "'*/' expected.": { + "category": "Error", + "code": 1010 + }, + "'public' or 'private' modifier must precede 'static'.": { + "category": "Error", + "code": 1011 + }, + "Unexpected token.": { + "category": "Error", + "code": 1012 + }, + "Catch clause parameter cannot have a type annotation.": { + "category": "Error", + "code": 1013 + }, + "A rest parameter must be last in a parameter list.": { + "category": "Error", + "code": 1014 + }, + "Parameter cannot have question mark and initializer.": { + "category": "Error", + "code": 1015 + }, + "A required parameter cannot follow an optional parameter.": { + "category": "Error", + "code": 1016 + }, + "An index signature cannot have a rest parameter.": { + "category": "Error", + "code": 1017 + }, + "An index signature parameter cannot have an accessibility modifier.": { + "category": "Error", + "code": 1018 + }, + "An index signature parameter cannot have a question mark.": { + "category": "Error", + "code": 1019 + }, + "An index signature parameter cannot have an initializer.": { + "category": "Error", + "code": 1020 + }, + "An index signature must have a type annotation.": { + "category": "Error", + "code": 1021 + }, + "An index signature parameter must have a type annotation.": { + "category": "Error", + "code": 1022 + }, + "An index signature parameter type must be 'string' or 'number'.": { + "category": "Error", + "code": 1023 + }, + "'extends' clause already seen.": { + "category": "Error", + "code": 1024 + }, + "'extends' clause must precede 'implements' clause.": { + "category": "Error", + "code": 1025 + }, + "Classes can only extend a single class.": { + "category": "Error", + "code": 1026 + }, + "'implements' clause already seen.": { + "category": "Error", + "code": 1027 + }, + "Accessibility modifier already seen.": { + "category": "Error", + "code": 1028 + }, + "'{0}' modifier must precede '{1}' modifier.": { + "category": "Error", + "code": 1029 + }, + "'{0}' modifier already seen.": { + "category": "Error", + "code": 1030 + }, + "'{0}' modifier cannot appear on a class element.": { + "category": "Error", + "code": 1031 + }, + "Interface declaration cannot have 'implements' clause.": { + "category": "Error", + "code": 1032 + }, + "'super' invocation cannot have type arguments.": { + "category": "Error", + "code": 1034 + }, + "Only ambient modules can use quoted names.": { + "category": "Error", + "code": 1035 + }, + "Statements are not allowed in ambient contexts.": { + "category": "Error", + "code": 1036 + }, + "A function implementation cannot be declared in an ambient context.": { + "category": "Error", + "code": 1037 + }, + "A 'declare' modifier cannot be used in an already ambient context.": { + "category": "Error", + "code": 1038 + }, + "Initializers are not allowed in ambient contexts.": { + "category": "Error", + "code": 1039 + }, + "'{0}' modifier cannot appear on a module element.": { + "category": "Error", + "code": 1044 + }, + "A 'declare' modifier cannot be used with an interface declaration.": { + "category": "Error", + "code": 1045 + }, + "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { + "category": "Error", + "code": 1046 + }, + "A rest parameter cannot be optional.": { + "category": "Error", + "code": 1047 + }, + "A rest parameter cannot have an initializer.": { + "category": "Error", + "code": 1048 + }, + "A 'set' accessor must have exactly one parameter.": { + "category": "Error", + "code": 1049 + }, + "A 'set' accessor cannot have an optional parameter.": { + "category": "Error", + "code": 1051 + }, + "A 'set' accessor parameter cannot have an initializer.": { + "category": "Error", + "code": 1052 + }, + "A 'set' accessor cannot have rest parameter.": { + "category": "Error", + "code": 1053 + }, + "A 'get' accessor cannot have parameters.": { + "category": "Error", + "code": 1054 + }, + "Modifiers cannot appear here.": { + "category": "Error", + "code": 1055 + }, + "Accessors are only available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1056 + }, + "Enum member must have initializer.": { + "category": "Error", + "code": 1061 + }, + "An export assignment cannot be used in an internal module.": { + "category": "Error", + "code": 1063 + }, + "Ambient enum elements can only have integer literal initializers.": { + "category": "Error", + "code": 1066 + }, + "module, class, interface, enum, import or statement": { + "category": "NoPrefix", + "code": 1067 + }, + "Unexpected token. A constructor, method, accessor, or property was expected." : { + "category": "Error", + "code": 1068 + }, + "statement": { + "category": "NoPrefix", + "code": 1069 + }, + "case or default clause": { + "category": "NoPrefix", + "code": 1070 + }, + "identifier": { + "category": "NoPrefix", + "code": 1071 + }, + "call, construct, index, property or function signature": { + "category": "NoPrefix", + "code": 1072 + }, + "expression": { + "category": "NoPrefix", + "code": 1073 + }, + "type name": { + "category": "NoPrefix", + "code": 1074 + }, + "property or accessor": { + "category": "NoPrefix", + "code": 1075 + }, + "parameter": { + "category": "NoPrefix", + "code": 1076 + }, + "type": { + "category": "NoPrefix", + "code": 1077 + }, + "type parameter": { + "category": "NoPrefix", + "code": 1078 + }, + "A 'declare' modifier cannot be used with an import declaration.": { + "category": "Error", + "code": 1079 + }, + "Invalid 'reference' directive syntax.": { + "category": "Error", + "code": 1084 + }, + "Octal literals are not available when targeting ECMAScript 5 and higher.": { + "category": "Error", + "code": 1085 + }, + "An accessor cannot be declared in an ambient context.": { + "category": "Error", + "code": 1086 + }, + "'{0}' modifier cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1089 + }, + "'{0}' modifier cannot appear on a parameter.": { + "category": "Error", + "code": 1090 + }, + "Only a single variable declaration is allowed in a 'for...in' statement.": { + "category": "Error", + "code": 1091 + }, + "Type parameters cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1092 + }, + "Type annotation cannot appear on a constructor declaration.": { + "category": "Error", + "code": 1093 + }, + "An accessor cannot have type parameters.": { + "category": "Error", + "code": 1094 + }, + "A 'set' accessor cannot have a return type annotation.": { + "category": "Error", + "code": 1095 + }, + "An index signature must have exactly one parameter.": { + "category": "Error", + "code": 1096 + }, + "'{0}' list cannot be empty.": { + "category": "Error", + "code": 1097 + }, + "Type parameter list cannot be empty.": { + "category": "Error", + "code": 1098 + }, + "Type argument list cannot be empty.": { + "category": "Error", + "code": 1099 + }, + "Invalid use of '{0}' in strict mode.": { + "category": "Error", + "code": 1100 + }, + "'with' statements are not allowed in strict mode.": { + "category": "Error", + "code": 1101 + }, + "'delete' cannot be called on an identifier in strict mode.": { + "category": "Error", + "code": 1102 + }, + "Invalid left-hand side in 'for...in' statement.": { + "category": "Error", + "code": 1103 + }, + "'continue' statement can only be used within an enclosing iteration statement.": { + "category": "Error", + "code": 1104 + }, + "'break' statement can only be used within an enclosing iteration or switch statement.": { + "category": "Error", + "code": 1105 + }, + "Jump target not found.": { + "category": "Error", + "code": 1106 + }, + "Jump target cannot cross function boundary.": { + "category": "Error", + "code": 1107 + }, + "'return' statement must be contained within a function body.": { + "category": "Error", + "code": 1108 + }, + "Expression expected.": { + "category": "Error", + "code": 1109 + }, + "Type expected.": { + "category": "Error", + "code": 1110 + }, + "A constructor implementation cannot be declared in an ambient context.": { + "category": "Error", + "code": 1111 + }, + "A class member cannot be declared optional.": { + "category": "Error", + "code": 1112 + }, + + + "Duplicate identifier '{0}'.": { + "category": "Error", + "code": 2000 + }, + "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { + "category": "Error", + "code": 2068 + }, + "Multiple constructor implementations are not allowed.": { + "category": "Error", + "code": 2070 + }, + "A class may only implement another class or interface.": { + "category": "Error", + "code": 2074 + }, + "'get' and 'set' accessor must have the same type.": { + "category": "Error", + "code": 2096 + }, + "Static members cannot reference class type parameters.": { + "category": "Error", + "code": 2099 + }, + "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class": { + "category": "Error", + "code": 2102 + }, + "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2112 + }, + "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2113 + }, + "An arithmetic operand must be of type 'any', 'number' or an enum type.": { + "category": "Error", + "code": 2114 + }, + "Variable declarations of a 'for' statement cannot use a type annotation.": { + "category": "Error", + "code": 2115 + }, + "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { + "category": "Error", + "code": 2116 + }, + "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2117 + }, + "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { + "category": "Error", + "code": 2118 + }, + "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter": { + "category": "Error", + "code": 2119 + }, + "Getters must return a value.": { + "category": "Error", + "code": 2126 + }, + "Getter and setter accessors do not agree in visibility.": { + "category": "Error", + "code": 2127 + }, + "Untyped function calls may not accept type arguments.": { + "category": "Error", + "code": 2158 + }, + "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { + "category": "Error", + "code": 2120 + }, + "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { + "category": "Error", + "code": 2121 + }, + "Setters cannot return a value.": { + "category": "Error", + "code": 2122 + }, + "Invalid left-hand side of assignment expression.": { + "category": "Error", + "code": 2130 + }, + "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { + "category": "Error", + "code": 2134 + }, + "The operand of an increment or decrement operator must be a variable, property or indexer.": { + "category": "Error", + "code": 2139 + }, + "Overload signatures must all be public or private.": { + "category": "Error", + "code": 2150 + }, + "Overload signatures must all be exported or not exported.": { + "category": "Error", + "code": 2151 + }, + "Overload signatures must all be ambient or non-ambient.": { + "category": "Error", + "code": 2152 + }, + "Overload signatures must all be optional or required.": { + "category": "Error", + "code": 2153 + }, + "'this' cannot be referenced in constructor arguments.": { + "category": "Error", + "code": 2155 + }, + "Value of type '{0}' is not callable. Did you mean to include 'new'?": { + "category": "Error", + "code": 2161 + }, + "A signature with an implementation cannot use a string literal type.": { + "category": "Error", + "code": 2163 + }, + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { + "category": "Error", + "code": 2189 + }, + "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { + "category": "Error", + "code": 2190 + }, + "'super' cannot be referenced in constructor arguments.":{ + "category": "Error", + "code": 2193 + }, + "Return type of constructor signature must be assignable to the instance type of the class":{ + "category": "Error", + "code": 2194 + }, + "Ambient external module declaration cannot specify relative module name.":{ + "category": "Error", + "code": 2196 + }, + "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { + "category": "Error", + "code": 2197 + }, + "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { + "category": "Error", + "code": 2205 + }, + "Expression resolves to '_super' that compiler uses to capture base class reference.": { + "category": "Error", + "code": 2207 + }, + "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { + "category": "Error", + "code": 2224 + }, + "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { + "category": "Error", + "code": 2225 + }, + "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { + "category": "Error", + "code": 2229 + }, + "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { + "category": "Error", + "code": 2230 + }, + "Parameter '{0}' cannot be referenced in its initializer.": { + "category": "Error", + "code": 2231 + }, + "Duplicate string index signature.": { + "category": "Error", + "code": 2232 + }, + "Duplicate number index signature.": { + "category": "Error", + "code": 2233 + }, + "All declarations of an interface must have identical type parameters.": { + "category": "Error", + "code": 2234 + }, + "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { + "category": "Error", + "code": 2235 + }, + "Constructor implementation expected.": { + "category": "Error", + "code": 2240 + }, + "An export assignment cannot be used in a module with other exported elements.": { + "category": "Error", + "code": 2245 + }, + "A parameter property is only allowed in a constructor implementation.": { + "category": "Error", + "code": 2246 + }, + "Circular definition of import alias '{0}'.": { + "category": "Error", + "code": 3000 + }, + "Cannot find name '{0}'.": { + "category": "Error", + "code": 3001 + }, + "Module '{0}' has no exported member '{1}'.": { + "category": "Error", + "code": 3002 + }, + "Cannot find external module '{0}'.": { + "category": "Error", + "code": 3003 + }, + "A module cannot have more than one export assignment.": { + "category": "Error", + "code": 3004 + }, + "Type '{0}' recursively references itself as a base type.": { + "category": "Error", + "code": 3005 + }, + "A class may only extend another class.": { + "category": "Error", + "code": 3006 + }, + "An interface may only extend a class or another interface.": { + "category": "Error", + "code": 3007 + }, + "Generic type '{0}' requires {1} type argument(s).": { + "category": "Error", + "code": 3008 + }, + "Type '{0}' is not generic.": { + "category": "Error", + "code": 3009 + }, + "Cannot find global type '{0}'.": { + "category": "Error", + "code": 3010 + }, + "Global type '{0}' must be a class or interface type.": { + "category": "Error", + "code": 3011 + }, + "Global type '{0}' must have {1} type parameter(s).": { + "category": "Error", + "code": 3012 + }, + "'this' cannot be referenced in a module body.": { + "category": "Error", + "code": 3013 + }, + "'this' cannot be referenced in a static property initializer.": { + "category": "Error", + "code": 3014 + }, + "'this' cannot be referenced in current location.": { + "category": "Error", + "code": -9999999 + }, + "'super' can only be referenced in a derived class.": { + "category": "Error", + "code": 3015 + }, + "Property '{0}' does not exist on type '{1}'.": { + "category": "Error", + "code": 3017 + }, + "An index expression argument must be of type 'string', 'number', or 'any'.": { + "category": "Error", + "code": 3018 + }, + "Type '{0}' does not satisfy the constraint '{1}':": { + "category": "Error", + "code": 3019 + }, + "Type '{0}' does not satisfy the constraint '{1}'.": { + "category": "Error", + "code": 3019 + }, + "Supplied parameters do not match any signature of call target.": { + "category": "Error", + "code": 3020 + }, + "Cannot invoke an expression whose type lacks a call signature.": { + "category": "Error", + "code": 3021 + }, + "Only a void function can be called with the 'new' keyword.": { + "category": "Error", + "code": 3022 + }, + "Cannot use 'new' with an expression whose type lacks a call or construct signature.": { + "category": "Error", + "code": 3023 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other:": { + "category": "Error", + "code": 3024 + }, + "Neither type '{0}' nor type '{1}' is assignable to the other.": { + "category": "Error", + "code": 3024 + }, + "No best common type exists among return expressions.": { + "category": "Error", + "code": 3027 + }, + "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { + "category": "Error", + "code": 3028 + }, + "No best common type exists between '{0}' and '{1}'.": { + "category": "Error", + "code": 3029 + }, + "No best common type exists between '{0}', '{1}', and '{2}'.": { + "category": "Error", + "code": 3030 + }, + "A rest parameter must be of an array type.": { + "category": "Error", + "code": 3031 + }, + "A parameter initializer is only allowed in a function or constructor implementation.": { + "category": "Error", + "code": 3032 + }, + "Specialized overload signature is not assignable to any non-specialized signature.": { + "category": "Error", + "code": 3033 + }, + "Duplicate function implementation.": { + "category": "Error", + "code": 3034 + }, + "Overload signature is not compatible with function implementation.": { + "category": "Error", + "code": 3035 + }, + + + + "Index signature is missing in type '{0}'.": { + "category": "Error", + "code": 4003 + }, + "Index signatures are incompatible:": { + "category": "Error", + "code": 4004 + }, + "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "NoPrefix", + "code": 4016 + }, + "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { + "category": "NoPrefix", + "code": 4017 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { + "category": "NoPrefix", + "code": 4018 + }, + "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { + "category": "NoPrefix", + "code": 4019 + }, + "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { + "category": "NoPrefix", + "code": 4032 + }, + "Cannot find the common subdirectory path for the input files.": { + "category": "Error", + "code": 5009 + }, + "Cannot read file '{0}': {1}": { + "category": "Error", + "code": 5012 + }, + "Unsupported file encoding.": { + "category": "NoPrefix", + "code": 5013 + }, + "Could not write file '{0}'.": { + "category": "Error", + "code": 5033 + }, + "Could not create directory '{0}'.": { + "category": "Error", + "code": 5035 + }, + "Option mapRoot cannot be specified without specifying sourcemap option.": { + "category": "Error", + "code": 5038 + }, + "Option sourceRoot cannot be specified without specifying sourcemap option.": { + "category": "Error", + "code": 5039 + }, + + "Variable '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7005 + }, + + "Parameter '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7006 + }, + "Member '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7008 + }, + "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.": { + "category": "Error", + "code": 7009 + }, + "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.": { + "category": "Error", + "code": 7010 + }, + "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.": { + "category": "Error", + "code": 7011 + }, + "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7013 + }, + "Lambda function, which lacks return-type annotation, implicitly has an '{0}' return type.": { + "category": "Error", + "code": 7014 + }, + "Array literal implicitly has an '{0}' type.": { + "category": "Error", + "code": 7015 + }, + "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": { + "category": "Error", + "code": 7016 + }, + "Index signature of object type implicitly has an 'any' type.": { + "category": "Error", + "code": 7017 + }, + "Object literal's property '{0}' implicitly has an '{1}' type.": { + "category": "Error", + "code": 7018 + }, + "Rest parameter '{0}' implicitly has an 'any[]' type.": { + "category": "Error", + "code": 7019 + }, + "Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": { + "category": "Error", + "code": 7020 + }, + + "Variable declaration list cannot be empty.": { + "category": "Error", + "code": -9999999 + }, + "Digit expected.": { + "category": "Error", + "code": -9999999 + }, + "Hexadecimal digit expected.": { + "category": "Error", + "code": -9999999 + }, + "Unexpected end of text.": { + "category": "Error", + "code": -9999999 + }, + "Unterminated string constant.": { + "category": "Error", + "code": -9999999 + }, + "Invalid character.": { + "category": "Error", + "code": -9999999 + }, + "Declaration or statement expected.": { + "category": "Error", + "code": -9999999 + }, + "Statement expected.": { + "category": "Error", + "code": -9999999 + }, + "'case' or 'default' expected.": { + "category": "Error", + "code": -9999999 + }, + "Property or signature expected.": { + "category": "Error", + "code": -9999999 + }, + "Enum member expected.": { + "category": "Error", + "code": -9999999 + }, + "Type reference expected.": { + "category": "Error", + "code": -9999999 + }, + "Variable declaration expected.": { + "category": "Error", + "code": -9999999 + }, + "Argument expression expected.": { + "category": "Error", + "code": -9999999 + }, + "Property assignment expected.": { + "category": "Error", + "code": -9999999 + }, + "Expression or comma expected.": { + "category": "Error", + "code": -9999999 + }, + "Parameter declaration expected.": { + "category": "Error", + "code": -9999999 + }, + "Type parameter declaration expected.": { + "category": "Error", + "code": -9999999 + }, + "Type argument expected.": { + "category": "Error", + "code": -9999999 + }, + "'{0}' expected.": { + "category": "Error", + "code": -9999999 + }, + "Identifier expected.": { + "category": "Error", + "code": -9999999 + }, + "String literal expected.": { + "category": "Error", + "code": -9999999 + }, + "Type expected.": { + "category": "Error", + "code": -9999999 + }, + "'=>' not preceded by parameter list.": { + "category": "Error", + "code": -9999999 + }, + "Invalid assignment target.": { + "category": "Error", + "code": -9999999 + }, + "'super' must be followed by argument list or member access.": { + "category": "Error", + "code": -9999999 + }, + "Expression expected.": { + "category": "Error", + "code": -9999999 + }, + "Line break not permitted here.": { + "category": "Error", + "code": -9999999 + }, + "'catch' or 'finally' expected.": { + "category": "Error", + "code": -9999999 + }, + "Block or ';' expected.": { + "category": "Error", + "code": -9999999 + }, + "Modifiers not permitted on index signature members.": { + "category": "Error", + "code": -9999999 + }, + "Class member declaration expected.": { + "category": "Error", + "code": -9999999 + }, + "Declaration expected.": { + "category": "Error", + "code": -9999999 + }, + "Invalid reference comment.": { + "category": "Error", + "code": -9999999 + }, + "File '{0}' is not an external module.": { + "category": "Error", + "code": -9999999 + }, + "Excessive stack depth comparing types '{0}' and '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Type '{0}' is not assignable to type '{1}':": { + "category": "Error", + "code": -9999999 + }, + "Type '{0}' is not assignable to type '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Property '{0}' is missing in type '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Private property '{0}' cannot be reimplemented.": { + "category": "Error", + "code": -9999999 + }, + "Required property '{0}' cannot be reimplemented with optional property in '{1}'.": { + "category": "Error", + "code": 2012 + }, + "Super calls are not permitted outside constructors or in nested functions inside constructors": { + "category": "Error", + "code": -9999999 + }, + "Only public methods of the base class are accessible via the 'super' keyword": { + "category": "Error", + "code": -9999999 + }, + "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { + "category": "Error", + "code": -9999999 + }, + "Constructors for derived classes must contain a 'super' call.": { + "category": "Error", + "code": -9999999 + }, + "Only public methods of the base class are accessible via the 'super' keyword": { + "category": "Error", + "code": -9999999 + }, + "Import name cannot be '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Type parameter name cannot be '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Class name cannot be '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Interface name cannot be '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Enum name cannot be '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Types of property '{0}' are incompatible:": { + "category": "Error", + "code": -9999999 + }, + "Types of parameters '{0}' and '{1}' are incompatible:": { + "category": "Error", + "code": -9999999 + }, + "Unknown identifier '{0}'.": { + "category": "Error", + "code": -9999999 + }, + "Property '{0}' is inaccessible.": { + "category": "Error", + "code": -9999999 + }, + "Function implementation expected.": { + "category": "Error", + "code": -9999999 + }, + "'return' statement has no containing function.": { + "category": "Error", + "code": -9999999 + }, + "Property '{0}' of type '{1}' is not assignable to string index type '{2}'.": { + "category": "Error", + "code": -9999999 + }, + "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.": { + "category": "Error", + "code": -9999999 + }, + "Numeric index type '{0}' is not assignable to string index type '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Class '{0}' incorrectly extends base class '{1}':": { + "category": "Error", + "code": -9999999 + }, + "Class '{0}' incorrectly extends base class '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}':": { + "category": "Error", + "code": -9999999 + }, + "Class static side '{0}' incorrectly extends base class static side '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { + "category": "Error", + "code": -9999999 + }, + "Class '{0}' incorrectly implements interface '{1}':": { + "category": "Error", + "code": -9999999 + }, + "Class '{0}' incorrectly implements interface '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Interface '{0}' incorrectly extends interface '{1}':": { + "category": "Error", + "code": -9999999 + }, + "Interface '{0}' incorrectly extends interface '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Enum member must have initializer.": { + "category": "Error", + "code": -9999999 + }, + "Ambient external modules require a 'declare' modifier.": { + "category": "Error", + "code": -9999999 + }, + "Ambient external modules cannot be nested in other modules.": { + "category": "Error", + "code": -9999999 + }, + "Import declarations in an internal module cannot reference an external module.": { + "category": "Error", + "code": -9999999 + }, + "Cannot compile external modules unless the '--module' flag is provided.": { + "category": "Error", + "code": -9999999 + }, + "Import declaration conflicts with local declaration of '{0}'": { + "category": "Error", + "code": -9999999 + }, + "Filename '{0}' differs from already included filename '{1}' only in casing": { + "category": "Error", + "code": -9999999 + }, + "Argument for '--module' option must be 'commonjs' or 'amd'.": { + "category": "Error", + "code": -9999999 + }, + "Argument for '--target' option must be 'es3' or 'es5'.": { + "category": "Error", + "code": -9999999 + }, + "Compiler option '{0}' expects an argument.": { + "category": "Error", + "code": -9999999 + }, + "Unterminated quoted string in response file '{0}'.": { + "category": "Error", + "code": -9999999 + }, + "Locale must be of the form or -. For example '{0}' or '{1}'.": { + "category": "Error", + "code": -9999999 + }, + "Unsupported locale {0}.": { + "category": "Error", + "code": -9999999 + }, + "Unable to open file {0}.": { + "category": "Error", + "code": -9999999 + }, + "Corrupted locale file {0}.": { + "category": "Error", + "code": -9999999 + }, + "No input files specified.": { + "category": "Error", + "code": -9999999 + } +} \ No newline at end of file diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts new file mode 100644 index 0000000000000..563c1fe634f3b --- /dev/null +++ b/src/compiler/emitter.ts @@ -0,0 +1,2284 @@ +/// +/// +/// +/// + +module ts { + function getSourceFilePathInNewDir(newDirPath: string, sourceFile: SourceFile, program: Program, compilerHost: CompilerHost) { + var sourceFilePath = getNormalizedPathFromPathCompoments(getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); + sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); + return combinePaths(newDirPath, sourceFilePath); + } + + function emitToOwnOutputFile(sourceFile: SourceFile, compilerOptions: CompilerOptions) { + if (!(sourceFile.flags & NodeFlags.DeclarationFile)) { + if ((sourceFile.flags & NodeFlags.ExternalModule || !compilerOptions.out) && !fileExtensionIs(sourceFile.filename, ".js")) { + return true; + } + } + } + + function getOwnEmitOutputFilePath(sourceFile: SourceFile, program: Program, extension: string) { + if (program.getCompilerOptions().outDir) { + var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(getSourceFilePathInNewDir(program.getCompilerOptions().outDir, sourceFile, program, program.getCompilerHost())); + } + else { + var emitOutputFilePathWithoutExtension = getModuleNameFromFilename(sourceFile.filename); + } + + return emitOutputFilePathWithoutExtension + extension; + } + + function isExternalModuleOrDeclarationFile(sourceFile: SourceFile) { + return !!(sourceFile.flags & (NodeFlags.ExternalModule | NodeFlags.DeclarationFile)); + } + + function findConstructor(node: ClassDeclaration): ConstructorDeclaration { + return forEach(node.members, member => { + if (member.kind === SyntaxKind.Constructor && (member).body) { + return member; + } + }); + } + + function getAllAccessorDeclarations(node: ClassDeclaration, accessor: AccessorDeclaration) { + var firstAccessor: AccessorDeclaration; + var getAccessor: AccessorDeclaration; + var setAccessor: AccessorDeclaration; + forEach(node.members, (member: Declaration) => { + if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && + member.name.text === accessor.name.text && + (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { + if (!firstAccessor) { + firstAccessor = member; + } + + if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { + getAccessor = member; + } + + if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { + setAccessor = member; + } + } + }); + return { + firstAccessor: firstAccessor, + getAccessor: getAccessor, + setAccessor: setAccessor + }; + } + + export function emitFiles(resolver: EmitResolver) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + var shouldEmitDeclarations = resolver.shouldEmitDeclarations(); + + var sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined; + forEach(program.getSourceFiles(), sourceFile => { + if (emitToOwnOutputFile(sourceFile, compilerOptions)) { + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, program, ".js"); + emitJavaScript(resolver, jsFilePath, sourceMapDataList, sourceFile); + if (shouldEmitDeclarations) { + emitDeclarations(resolver, jsFilePath, sourceFile); + } + } + }); + if (compilerOptions.out) { + emitJavaScript(resolver, compilerOptions.out, sourceMapDataList); + if (shouldEmitDeclarations) { + emitDeclarations(resolver, compilerOptions.out); + } + } + return sourceMapDataList; + } + + interface TextWriter { + write(s: string): void; + writeLiteral(s: string): void; + writeLine(): void; + increaseIndent(): void; + decreaseIndent(): void; + getTextPos(): number; + getLine(): number; + getColumn(): number; + getText(): string; + } + + function createTextWriter(): TextWriter { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + + function write(s: string) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + + function writeLiteral(s: string) { + if (s && s.length) { + write(s); + var pos = 0; + while (pos < s.length) { + switch (s.charCodeAt(pos++)) { + case CharacterCodes.carriageReturn: + if (pos < s.length && s.charCodeAt(pos) === CharacterCodes.lineFeed) { + pos++; + } + case CharacterCodes.lineFeed: + lineCount++; + linePos = output.length - s.length + pos; + break; + } + } + } + } + + function writeLine() { + if (!lineStart) { + output += sys.newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + + return { + write: write, + writeLiteral: writeLiteral, + writeLine: writeLine, + increaseIndent: () => indent++, + decreaseIndent: () => indent--, + getTextPos: () => output.length, + getLine: () => lineCount + 1, + getColumn: () => lineStart ? indent * 4 + 1 : output.length - linePos + 1, + getText: () => output + }; + } + + var indentStrings: string[] = []; + + function getIndentString(level: number) { + return indentStrings[level] || (indentStrings[level] = level === 0 ? "" : getIndentString(level - 1) + " "); + } + + // Get source text of node in the current source file. Unlike getSourceTextOfNode this function + // doesn't walk the parent chain to find the containing source file, rather it assumes the node is + // in the source file currently being processed. + var currentSourceFile: SourceFile; + function getSourceTextOfLocalNode(node: Node): string { + var text = currentSourceFile.text; + return text.substring(skipTrivia(text, node.pos), node.end); + } + + function emitJavaScript(resolver: EmitResolver, jsFilePath: string, sourceMapDataList: SourceMapData[], root?: SourceFile) { + var program = resolver.getProgram(); + var compilerHost = program.getCompilerHost(); + var compilerOptions = program.getCompilerOptions(); + + var writer = createTextWriter(); + var write = writer.write; + var writeLine = writer.writeLine; + var increaseIndent = writer.increaseIndent; + var decreaseIndent = writer.decreaseIndent; + + var extendsEmitted = false; + + /** write emitted output to disk*/ + var writeEmittedFiles = writeJavaScriptFile; + + /** Emit a node */ + var emit = emitNode; + + /** Called just before starting emit of a node */ + var emitStart = function (node: Node) { } + + /** Called once the emit of the node is done */ + var emitEnd = function (node: Node) { } + + /** Emit the text for the given token that comes after startPos + * This by default writes the text provided with the given tokenKind + * but if optional emitFn callback is provided the text is emitted using the callback instead of default text + * @param tokenKind the kind of the token to search and emit + * @param startPos the position in the source to start searching for the token + * @param emitFn if given will be invoked to emit the text instead of actual token emit */ + var emitToken = emitTokenText; + + /** Called to notify start of new source file emit */ + var emitNewSourceFileStart = function (node: SourceFile) { } + + /** Called to before starting the lexical scopes as in function/class in the emitted code because of node + * @param scopeDeclaration node that starts the lexical scope + * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ + var scopeEmitStart = function (scopeDeclaration: Node, scopeName?: string) { } + + /** Called after coming out of the scope */ + var scopeEmitEnd = function () { } + + /** Sourcemap data that will get encoded */ + var sourceMapData: SourceMapData; + + function initializeEmitterWithSourceMaps() { + var sourceMapDir: string; // The directory in which sourcemap will be + + // Current source map file and its index in the sources list + var sourceMapSourceIndex = -1; + + // Names and its index map + var sourceMapNameIndexMap: Map = {}; + var sourceMapNameIndices: number[] = []; + function getSourceMapNameIndex() { + return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; + } + + // Last recorded and encoded spans + var lastRecordedSourceMapSpan: SourceMapSpan; + var lastEncodedSourceMapSpan: SourceMapSpan = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0 + }; + var lastEncodedNameIndex = 0; + + // Encoding for sourcemap span + function encodeLastRecordedSourceMapSpan() { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { + return; + } + + var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Line/Comma deliminators + if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + // Emit comma to separate the entry + if (sourceMapData.sourceMapMappings) { + sourceMapData.sourceMapMappings += ","; + } + } + else { + // Emit line deliminators + for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { + sourceMapData.sourceMapMappings += ";"; + } + prevEncodedEmittedColumn = 1; + } + + // 1. Relative Column 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + + // 2. Relative sourceIndex + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + + // 3. Relative sourceLine 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + + // 4. Relative sourceColumn 0 based + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + + // 5. Relative namePosition 0 based + if (lastRecordedSourceMapSpan.nameIndex >= 0) { + sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); + lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; + } + + lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; + sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); + + function base64VLQFormatEncode(inValue: number) { + function base64FormatEncode(inValue: number) { + if (inValue < 64) { + return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); + } + throw TypeError(inValue + ": not a 64 based value"); + } + + // Add a new least significant bit that has the sign of the value. + // if negative number the least significant bit that gets added to the number has value 1 + // else least significant bit value that gets added is 0 + // eg. -1 changes to binary : 01 [1] => 3 + // +1 changes to binary : 01 [0] => 2 + if (inValue < 0) { + inValue = ((-inValue) << 1) + 1; + } + else { + inValue = inValue << 1; + } + + // Encode 5 bits at a time starting from least significant bits + var encodedStr = ""; + do { + var currentDigit = inValue & 31; // 11111 + inValue = inValue >> 5; + if (inValue > 0) { + // There are still more digits to decode, set the msb (6th bit) + currentDigit = currentDigit | 32; + } + encodedStr = encodedStr + base64FormatEncode(currentDigit); + } while (inValue > 0); + + return encodedStr; + } + } + + function recordSourceMapSpan(pos: number) { + var sourceLinePos = currentSourceFile.getLineAndCharacterFromPosition(pos); + var emittedLine = writer.getLine(); + var emittedColumn = writer.getColumn(); + + // If this location wasnt recorded or the location in source is going backwards, record the span + if (!lastRecordedSourceMapSpan || + lastRecordedSourceMapSpan.emittedLine != emittedLine || + lastRecordedSourceMapSpan.emittedColumn != emittedColumn || + lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || + (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)) { + // Encode the last recordedSpan before assigning new + encodeLastRecordedSourceMapSpan(); + + // New span + lastRecordedSourceMapSpan = { + emittedLine: emittedLine, + emittedColumn: emittedColumn, + sourceLine: sourceLinePos.line, + sourceColumn: sourceLinePos.character, + nameIndex: getSourceMapNameIndex(), + sourceIndex: sourceMapSourceIndex + }; + } + else { + // Take the new pos instead since there is no change in emittedLine and column since last location + lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; + lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; + } + } + + function recordEmitNodeStartSpan(node: Node) { + // Get the token pos after skipping to the token (ignoring the leading trivia) + recordSourceMapSpan(ts.getTokenPosOfNode(node)); + } + + function recordEmitNodeEndSpan(node: Node) { + recordSourceMapSpan(node.end); + } + + function writeTextWithSpanRecord(tokenKind: SyntaxKind, startPos: number, emitFn?: () => void) { + var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); + recordSourceMapSpan(tokenStartPos); + var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); + recordSourceMapSpan(tokenEndPos); + return tokenEndPos; + } + + function recordNewSourceFileStart(node: SourceFile) { + // Add the the file to tsFilePaths + // If sourceroot option: Use the relative path corresponding to the common directory path + // otherwise source locations relative to map file location + var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; + + sourceMapData.sourceMapSources.push(getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, + node.filename, + compilerHost.getCurrentDirectory(), + /*isAbsolutePathAnUrl*/ true)); + sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; + + // The one that can be used from program to get the actual source file + sourceMapData.inputSourceFileNames.push(node.filename); + } + + function recordScopeNameOfNode(node: Node, scopeName?: string) { + function recordScopeNameIndex(scopeNameIndex: number) { + sourceMapNameIndices.push(scopeNameIndex); + } + + function recordScopeNameStart(scopeName: string) { + var scopeNameIndex = -1; + if (scopeName) { + var parentIndex = getSourceMapNameIndex(); + if (parentIndex !== -1) { + scopeName = sourceMapData.sourceMapNames[parentIndex] + "." + scopeName; + } + + scopeNameIndex = getProperty(sourceMapNameIndexMap, scopeName); + if (scopeNameIndex === undefined) { + scopeNameIndex = sourceMapData.sourceMapNames.length; + sourceMapData.sourceMapNames.push(scopeName); + sourceMapNameIndexMap[scopeName] = scopeNameIndex; + } + } + recordScopeNameIndex(scopeNameIndex); + } + + if (scopeName) { + // The scope was already given a name use it + recordScopeNameStart(scopeName); + } + else if (node.kind === SyntaxKind.FunctionDeclaration || + node.kind === SyntaxKind.FunctionExpression || + node.kind === SyntaxKind.Method || + node.kind === SyntaxKind.GetAccessor || + node.kind === SyntaxKind.SetAccessor || + node.kind === SyntaxKind.ModuleDeclaration || + node.kind === SyntaxKind.ClassDeclaration || + node.kind === SyntaxKind.EnumDeclaration) { + // Declaration and has associated name use it + if ((node).name) { + scopeName = (node).name.text; + } + recordScopeNameStart(scopeName); + } + else { + // Block just use the name from upper level scope + recordScopeNameIndex(getSourceMapNameIndex()); + } + } + + function recordScopeNameEnd() { + sourceMapNameIndices.pop(); + }; + + function writeJavaScriptAndSourceMapFile(emitOutput: string) { + // Write source map file + encodeLastRecordedSourceMapSpan(); + compilerHost.writeFile(sourceMapData.sourceMapFilePath, JSON.stringify({ + version: 3, + file: sourceMapData.sourceMapFile, + sourceRoot: sourceMapData.sourceMapSourceRoot, + sources: sourceMapData.sourceMapSources, + names: sourceMapData.sourceMapNames, + mappings: sourceMapData.sourceMapMappings + })); + sourceMapDataList.push(sourceMapData); + + // Write sourcemap url to the js file and write the js file + writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL); + } + + // Initialize source map data + var sourceMapJsFile = getBaseFilename(normalizeSlashes(jsFilePath)); + sourceMapData = { + sourceMapFilePath: jsFilePath + ".map", + jsSourceMappingURL: sourceMapJsFile + ".map", + sourceMapFile: sourceMapJsFile, + sourceMapSourceRoot: compilerOptions.sourceRoot || "", + sourceMapSources: [], + inputSourceFileNames: [], + sourceMapNames: [], + sourceMapMappings: "", + sourceMapDecodedMappings: [] + }; + + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // relative paths of the sources list in the sourcemap + sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== CharacterCodes.slash) { + sourceMapData.sourceMapSourceRoot += directorySeparator; + } + + if (compilerOptions.mapRoot) { + sourceMapDir = normalizeSlashes(compilerOptions.mapRoot); + if (root) { // emitting single module file + // For modules or multiple emit files the mapRoot will have directory structure like the sources + // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceMapDir, root, program, compilerHost)); + } + + if (!isRootedDiskPath(sourceMapDir) && !isUrl(sourceMapDir)) { + // The relative paths are relative to the common directory + sourceMapDir = combinePaths(program.getCommonSourceDirectory(), sourceMapDir); + sourceMapData.jsSourceMappingURL = getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizePath(jsFilePath)), // get the relative sourceMapDir path based on jsFilePath + combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), // this is where user expects to see sourceMap + compilerHost.getCurrentDirectory(), + /*isAbsolutePathAnUrl*/ true); + } + else { + sourceMapData.jsSourceMappingURL = combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); + } + } + else { + sourceMapDir = getDirectoryPath(normalizePath(jsFilePath)); + } + + function emitNodeWithMap(node: Node) { + if (node) { + if (node.kind != SyntaxKind.SourceFile) { + recordEmitNodeStartSpan(node); + emitNode(node); + recordEmitNodeEndSpan(node); + } + else { + recordNewSourceFileStart(node); + emitNode(node); + } + } + } + + writeEmittedFiles = writeJavaScriptAndSourceMapFile; + emit = emitNodeWithMap; + emitStart = recordEmitNodeStartSpan; + emitEnd = recordEmitNodeEndSpan; + emitToken = writeTextWithSpanRecord; + emitNewSourceFileStart = recordNewSourceFileStart; + scopeEmitStart = recordScopeNameOfNode; + scopeEmitEnd = recordScopeNameEnd; + } + + function writeJavaScriptFile(emitOutput: string) { + compilerHost.writeFile(jsFilePath, emitOutput); + } + + function emitTokenText(tokenKind: SyntaxKind, startPos: number, emitFn?: () => void) { + var tokenString = tokenToString(tokenKind); + if (emitFn) { + emitFn(); + } + else { + write(tokenString); + } + return startPos + tokenString.length; + } + + function emitOptional(prefix: string, node: Node) { + if (node) { + write(prefix); + emit(node); + } + } + + function emitCommaList(nodes: Node[], count?: number) { + if (!(count >= 0)) count = nodes.length; + if (nodes) { + for (var i = 0; i < count; i++) { + if (i) write(", "); + emit(nodes[i]); + } + } + } + + function emitMultiLineList(nodes: Node[]) { + if (nodes) { + for (var i = 0; i < nodes.length; i++) { + if (i) write(","); + writeLine(); + emit(nodes[i]); + } + } + } + + function emitLines(nodes: Node[]) { + for (var i = 0; i < nodes.length; i++) { + writeLine(); + emit(nodes[i]); + } + } + + function emitLiteral(node: LiteralExpression) { + var text = getSourceTextOfLocalNode(node); + if (node.kind === SyntaxKind.StringLiteral && compilerOptions.sourceMap) { + writer.writeLiteral(text); + } + else { + write(text); + } + } + + // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. + // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. + function emitQuotedIdentifier(node: Identifier) { + if (node.kind === SyntaxKind.StringLiteral) { + emitLiteral(node); + } + else { + write("\""); + + if (node.kind === SyntaxKind.NumericLiteral) { + write(node.text); + } + else { + write(getSourceTextOfLocalNode(node)); + } + + write("\""); + } + } + + function isNonExpressionIdentifier(node: Identifier) { + var parent = node.parent; + switch (parent.kind) { + case SyntaxKind.Parameter: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Property: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.EnumMember: + case SyntaxKind.Method: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ImportDeclaration: + return (parent).name === node; + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + case SyntaxKind.ExportAssignment: + return false; + case SyntaxKind.LabelledStatement: + return (node.parent).label === node; + case SyntaxKind.CatchBlock: + return (node.parent).variable === node; + } + } + + function emitIdentifier(node: Identifier) { + if (!isNonExpressionIdentifier(node)) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); + } + } + write(getSourceTextOfLocalNode(node)); + } + + function emitThis(node: Node) { + if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.LexicalThis) { + write("_this"); + } + else { + write("this"); + } + } + + function emitSuper(node: Node) { + var flags = resolver.getNodeCheckFlags(node); + if (flags & NodeCheckFlags.SuperInstance) { + write("_super.prototype"); + } + else if (flags & NodeCheckFlags.SuperStatic) { + write("_super"); + } + else { + write("super"); + } + } + + function emitArrayLiteral(node: ArrayLiteral) { + if (node.flags & NodeFlags.MultiLine) { + write("["); + increaseIndent(); + emitMultiLineList(node.elements); + decreaseIndent(); + writeLine(); + write("]"); + } + else { + write("["); + emitCommaList(node.elements); + write("]"); + } + } + + function emitObjectLiteral(node: ObjectLiteral) { + if (!node.properties.length) { + write("{}"); + } + else if (node.flags & NodeFlags.MultiLine) { + write("{"); + increaseIndent(); + emitMultiLineList(node.properties); + decreaseIndent(); + writeLine(); + write("}"); + } + else { + write("{ "); + emitCommaList(node.properties); + write(" }"); + } + } + + function emitPropertyAssignment(node: PropertyDeclaration) { + emit(node.name); + write(": "); + emit(node.initializer); + } + + function emitPropertyAccess(node: PropertyAccess) { + var text = resolver.getPropertyAccessSubstitution(node); + if (text) { + write(text); + return; + } + emit(node.left); + write("."); + emit(node.right); + } + + function emitIndexedAccess(node: IndexedAccess) { + emit(node.object); + write("["); + emit(node.index); + write("]"); + } + + function emitCallExpression(node: CallExpression) { + var superCall = false; + if (node.func.kind === SyntaxKind.SuperKeyword) { + write("_super"); + superCall = true; + } + else { + emit(node.func); + superCall = node.func.kind === SyntaxKind.PropertyAccess && (node.func).left.kind === SyntaxKind.SuperKeyword; + } + if (superCall) { + write(".call("); + emitThis(node.func); + if (node.arguments.length) { + write(", "); + emitCommaList(node.arguments); + } + write(")"); + } + else { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + + function emitNewExpression(node: NewExpression) { + write("new "); + emit(node.func); + if (node.arguments) { + write("("); + emitCommaList(node.arguments); + write(")"); + } + } + + function emitParenExpression(node: ParenExpression) { + if (node.expression.kind === SyntaxKind.TypeAssertion) { + var operand = (node.expression).operand; + + // Make sure we consider all nested cast expressions, e.g.: + // (-A).x; + while (operand.kind == SyntaxKind.TypeAssertion) { + operand = (operand).operand; + } + + // We have an expression of the form: (SubExpr) + // Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is. + // Omitting the parentheses, however, could cause change in the semantics of the generated + // code if the casted expression has a lower precedence than the rest of the expression, e.g.: + // (new A).foo should be emitted as (new A).foo and not new A.foo + // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() + // new (A()) should be emitted as new (A()) and not new A() + // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () + if (operand.kind !== SyntaxKind.PrefixOperator && operand.kind !== SyntaxKind.PostfixOperator && operand.kind !== SyntaxKind.NewExpression && + !(operand.kind === SyntaxKind.CallExpression && node.parent.kind === SyntaxKind.NewExpression) && + !(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression)) { + emit(operand); + return; + } + } + write("("); + emit(node.expression); + write(")"); + } + + function emitUnaryExpression(node: UnaryExpression) { + if (node.kind === SyntaxKind.PrefixOperator) { + write(tokenToString(node.operator)); + } + // In some cases, we need to emit a space between the operator and the operand. One obvious case + // is when the operator is an identifer, like delete or typeof. We also need to do this for plus + // and minus expressions in certain cases. Specifically, consider the following two cases (parens + // are just for clarity of exposition, and not part of the source code): + // + // (+(+1)) + // (+(++1)) + // + // We need to emit a space in both cases. In the first case, the absence of a space will make + // the resulting expression a prefix increment operation. And in the second, it will make the resulting + // expression a prefix increment whose operand is a plus expression - (++(+x)) + // The same is true of minus of course. + if (node.operator >= SyntaxKind.Identifier) { + write(" "); + } + else if (node.kind === SyntaxKind.PrefixOperator && node.operand.kind === SyntaxKind.PrefixOperator) { + var operand = node.operand; + if (node.operator === SyntaxKind.PlusToken && (operand.operator === SyntaxKind.PlusToken || operand.operator === SyntaxKind.PlusPlusToken)) { + write(" "); + } + else if (node.operator === SyntaxKind.MinusToken && (operand.operator === SyntaxKind.MinusToken || operand.operator === SyntaxKind.MinusMinusToken)) { + write(" "); + } + } + emit(node.operand); + if (node.kind === SyntaxKind.PostfixOperator) { + write(tokenToString(node.operator)); + } + } + + function emitBinaryExpression(node: BinaryExpression) { + emit(node.left); + if (node.operator !== SyntaxKind.CommaToken) write(" "); + write(tokenToString(node.operator)); + write(" "); + emit(node.right); + } + + function emitConditionalExpression(node: ConditionalExpression) { + emit(node.condition); + write(" ? "); + emit(node.whenTrue); + write(" : "); + emit(node.whenFalse); + } + + function emitBlock(node: Block) { + emitToken(SyntaxKind.OpenBraceToken, node.pos); + increaseIndent(); + scopeEmitStart(node.parent); + if (node.kind === SyntaxKind.ModuleBlock) { + Debug.assert(node.parent.kind === SyntaxKind.ModuleDeclaration); + emitCaptureThisForNodeIfNecessary(node.parent); + } + emitLines(node.statements); + decreaseIndent(); + writeLine(); + emitToken(SyntaxKind.CloseBraceToken, node.statements.end); + scopeEmitEnd(); + } + + function emitEmbeddedStatement(node: Node) { + if (node.kind === SyntaxKind.Block) { + write(" "); + emit(node); + } + else { + increaseIndent(); + writeLine(); + emit(node); + decreaseIndent(); + } + } + + function emitExpressionStatement(node: ExpressionStatement) { + var isArrowExpression = node.expression.kind === SyntaxKind.ArrowFunction; + if (isArrowExpression) write("("); + emit(node.expression); + if (isArrowExpression) write(")"); + write(";"); + } + + function emitIfStatement(node: IfStatement) { + var endPos = emitToken(SyntaxKind.IfKeyword, node.pos); + write(" "); + endPos = emitToken(SyntaxKind.OpenParenToken, endPos); + emit(node.expression); + emitToken(SyntaxKind.CloseParenToken, node.expression.end); + emitEmbeddedStatement(node.thenStatement); + if (node.elseStatement) { + writeLine(); + emitToken(SyntaxKind.ElseKeyword, node.thenStatement.end); + if (node.elseStatement.kind === SyntaxKind.IfStatement) { + write(" "); + emit(node.elseStatement); + } + else { + emitEmbeddedStatement(node.elseStatement); + } + } + } + + function emitDoStatement(node: DoStatement) { + write("do"); + emitEmbeddedStatement(node.statement); + if (node.statement.kind === SyntaxKind.Block) { + write(" "); + } + else { + writeLine(); + } + write("while ("); + emit(node.expression); + write(");"); + } + + function emitWhileStatement(node: WhileStatement) { + write("while ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + + function emitForStatement(node: ForStatement) { + var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); + write(" "); + endPos = emitToken(SyntaxKind.OpenParenToken, endPos); + if (node.declarations) { + emitToken(SyntaxKind.VarKeyword, endPos); + write(" "); + emitCommaList(node.declarations); + } + if (node.initializer) { + emit(node.initializer); + } + write(";"); + emitOptional(" ", node.condition); + write(";"); + emitOptional(" ", node.iterator); + write(")"); + emitEmbeddedStatement(node.statement); + } + + function emitForInStatement(node: ForInStatement) { + var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); + write(" "); + endPos = emitToken(SyntaxKind.OpenParenToken, endPos); + if (node.declaration) { + emitToken(SyntaxKind.VarKeyword, endPos); + write(" "); + emit(node.declaration); + } + else { + emit(node.variable); + } + write(" in "); + emit(node.expression); + emitToken(SyntaxKind.CloseParenToken, node.expression.end); + emitEmbeddedStatement(node.statement); + } + + function emitBreakOrContinueStatement(node: BreakOrContinueStatement) { + emitToken(node.kind === SyntaxKind.BreakStatement ? SyntaxKind.BreakKeyword : SyntaxKind.ContinueKeyword, node.pos); + emitOptional(" ", node.label); + write(";"); + } + + function emitReturnStatement(node: ReturnStatement) { + emitToken(SyntaxKind.ReturnKeyword, node.pos); + emitOptional(" ", node.expression); + write(";"); + } + + function emitWithStatement(node: WhileStatement) { + write("with ("); + emit(node.expression); + write(")"); + emitEmbeddedStatement(node.statement); + } + + function emitSwitchStatement(node: SwitchStatement) { + var endPos = emitToken(SyntaxKind.SwitchKeyword, node.pos); + write(" "); + emitToken(SyntaxKind.OpenParenToken, endPos); + emit(node.expression); + endPos = emitToken(SyntaxKind.CloseParenToken, node.expression.end); + write(" "); + emitToken(SyntaxKind.OpenBraceToken, endPos); + increaseIndent(); + emitLines(node.clauses); + decreaseIndent(); + writeLine(); + emitToken(SyntaxKind.CloseBraceToken, node.clauses.end); + } + + function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { + if (node.kind === SyntaxKind.CaseClause) { + write("case "); + emit(node.expression); + write(":"); + } + else { + write("default:"); + } + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } + + function emitThrowStatement(node: ThrowStatement) { + write("throw "); + emit(node.expression); + write(";"); + } + + function emitTryStatement(node: TryStatement) { + write("try "); + emit(node.tryBlock); + emit(node.catchBlock); + if (node.finallyBlock) { + writeLine(); + write("finally "); + emit(node.finallyBlock); + } + } + + function emitCatchBlock(node: CatchBlock) { + writeLine(); + var endPos = emitToken(SyntaxKind.CatchKeyword, node.pos); + write(" "); + emitToken(SyntaxKind.OpenParenToken, endPos); + emit(node.variable); + emitToken(SyntaxKind.CloseParenToken, node.variable.end); + write(" "); + emitBlock(node); + } + + function emitDebuggerStatement(node: Node) { + emitToken(SyntaxKind.DebuggerKeyword, node.pos); + write(";"); + } + + function emitLabelledStatement(node: LabelledStatement) { + emit(node.label); + write(": "); + emit(node.statement); + } + + function getContainingModule(node: Node): ModuleDeclaration { + do { + node = node.parent; + } while (node && node.kind !== SyntaxKind.ModuleDeclaration); + return node; + } + + function emitModuleMemberName(node: Declaration) { + emitStart(node.name); + if (node.flags & NodeFlags.Export) { + var container = getContainingModule(node); + write(container ? resolver.getModuleObjectName(container) : "exports"); + write("."); + } + emitNode(node.name); + emitEnd(node.name); + } + + function emitVariableDeclaration(node: VariableDeclaration) { + emitModuleMemberName(node); + emitOptional(" = ", node.initializer); + } + + function emitVariableStatement(node: VariableStatement) { + if (!(node.flags & NodeFlags.Export)) write("var "); + emitCommaList(node.declarations); + write(";"); + } + + function emitParameter(node: ParameterDeclaration) { + emit(node.name); + } + + function emitDefaultValueAssignments(node: FunctionDeclaration) { + forEach(node.parameters, param => { + if (param.initializer) { + writeLine(); + emitStart(param); + write("if ("); + emitNode(param.name); + write(" === void 0)"); + emitEnd(param); + write(" { "); + emitStart(param); + emitNode(param.name); + write(" = "); + emitNode(param.initializer); + emitEnd(param); + write("; }"); + } + }); + } + + function emitRestParameter(node: FunctionDeclaration) { + if (hasRestParameters(node)) { + var restIndex = node.parameters.length - 1; + var restParam = node.parameters[restIndex]; + writeLine(); + emitStart(restParam); + write("var "); + emitNode(restParam.name); + write(" = [];"); + emitEnd(restParam); + writeLine(); + write("for ("); + emitStart(restParam); + write("var _i = " + restIndex + ";"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i < arguments.length;"); + emitEnd(restParam); + write(" "); + emitStart(restParam); + write("_i++"); + emitEnd(restParam); + write(") {"); + increaseIndent(); + writeLine(); + emitStart(restParam); + emitNode(restParam.name); + write("[_i - " + restIndex + "] = arguments[_i];"); + emitEnd(restParam); + decreaseIndent(); + writeLine(); + write("}"); + } + } + + function emitAccessor(node: AccessorDeclaration) { + write(node.kind === SyntaxKind.GetAccessor ? "get " : "set "); + emit(node.name); + emitSignatureAndBody(node); + } + + function emitFunctionDeclaration(node: FunctionDeclaration) { + if (!node.body) return; + write("function "); + if (node.kind === SyntaxKind.FunctionDeclaration || (node.kind === SyntaxKind.FunctionExpression && node.name)) { + emit(node.name); + } + emitSignatureAndBody(node); + } + + function emitCaptureThisForNodeIfNecessary(node: Node): void { + if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.CaptureThis) { + writeLine(); + emitStart(node); + write("var _this = this;"); + emitEnd(node); + } + } + + function emitSignatureAndBody(node: FunctionDeclaration) { + write("("); + emitCommaList(node.parameters, node.parameters.length - (hasRestParameters(node) ? 1 : 0)); + write(") {"); + scopeEmitStart(node); + increaseIndent(); + var outPos = writer.getTextPos(); + emitCaptureThisForNodeIfNecessary(node); + emitDefaultValueAssignments(node); + emitRestParameter(node); + if (node.body.kind !== SyntaxKind.FunctionBlock && outPos === writer.getTextPos()) { + decreaseIndent(); + write(" "); + emitStart(node.body); + write("return "); + emitNode(node.body); + emitEnd(node.body); + write("; "); + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + else { + if (node.body.kind === SyntaxKind.FunctionBlock) { + emitLines((node.body).statements); + } + else { + writeLine(); + write("return "); + emit(node.body); + write(";"); + } + decreaseIndent(); + writeLine(); + if (node.body.kind === SyntaxKind.FunctionBlock) { + emitToken(SyntaxKind.CloseBraceToken, (node.body).statements.end); + } + else { + emitStart(node.body); + write("}"); + emitEnd(node.body); + } + } + scopeEmitEnd(); + if (node.flags & NodeFlags.Export) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + + function findInitialSuperCall(ctor: ConstructorDeclaration): ExpressionStatement { + if (ctor.body) { + var statement = (ctor.body).statements[0]; + if (statement && statement.kind === SyntaxKind.ExpressionStatement) { + var expr = (statement).expression; + if (expr && expr.kind === SyntaxKind.CallExpression) { + var func = (expr).func; + if (func && func.kind === SyntaxKind.SuperKeyword) { + return statement; + } + } + } + } + } + + function emitParameterPropertyAssignments(node: ConstructorDeclaration) { + forEach(node.parameters, param => { + if (param.flags & (NodeFlags.Public | NodeFlags.Private)) { + writeLine(); + emitStart(param); + emitStart(param.name); + write("this."); + emitNode(param.name); + emitEnd(param.name); + write(" = "); + emit(param.name); + write(";"); + emitEnd(param); + } + }); + } + + function emitMemberAccess(memberName: Identifier) { + if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { + write("["); + emitNode(memberName); + write("]"); + } + else { + write("."); + emitNode(memberName); + } + } + + function emitMemberAssignments(node: ClassDeclaration, staticFlag: NodeFlags) { + forEach(node.members, member => { + if (member.kind === SyntaxKind.Property && (member.flags & NodeFlags.Static) === staticFlag && (member).initializer) { + writeLine(); + emitStart(member); + emitStart((member).name); + if (staticFlag) { + emitNode(node.name); + } + else { + write("this"); + } + emitMemberAccess((member).name); + emitEnd((member).name); + write(" = "); + emit((member).initializer); + write(";"); + emitEnd(member); + } + }); + } + + function emitMemberFunctions(node: ClassDeclaration) { + forEach(node.members, member => { + if (member.kind === SyntaxKind.Method) { + if (!(member).body) return; + writeLine(); + emitStart(member); + emitStart((member).name); + emitNode(node.name); + if (!(member.flags & NodeFlags.Static)) { + write(".prototype"); + } + emitMemberAccess((member).name); + emitEnd((member).name); + write(" = "); + emitStart(member); + emitFunctionDeclaration(member); + emitEnd(member); + emitEnd(member); + write(";"); + } + else if (member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) { + var accessors = getAllAccessorDeclarations(node, member); + if (member === accessors.firstAccessor) { + writeLine(); + emitStart(member); + write("Object.defineProperty("); + emitStart((member).name); + emitNode(node.name); + if (!(member.flags & NodeFlags.Static)) { + write(".prototype"); + } + write(", "); + emitQuotedIdentifier((member).name); + emitEnd((member).name); + write(", {"); + increaseIndent(); + if (accessors.getAccessor) { + writeLine(); + write("get: "); + emitStart(accessors.getAccessor); + write("function "); + emitSignatureAndBody(accessors.getAccessor); + emitEnd(accessors.getAccessor); + write(","); + } + if (accessors.setAccessor) { + writeLine(); + write("set: "); + emitStart(accessors.setAccessor); + write("function "); + emitSignatureAndBody(accessors.setAccessor); + emitEnd(accessors.setAccessor); + write(","); + } + writeLine(); + write("enumerable: true,"); + writeLine(); + write("configurable: true"); + decreaseIndent(); + writeLine(); + write("});"); + emitEnd(member); + } + } + }); + } + + function emitClassDeclaration(node: ClassDeclaration) { + var ctor = findConstructor(node); + write("var "); + emit(node.name); + write(" = (function ("); + if (node.baseType) write("_super"); + write(") {"); + increaseIndent(); + scopeEmitStart(node); + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("__extends("); + emit(node.name); + write(", _super);"); + emitEnd(node.baseType); + } + writeLine(); + emitStart(ctor || node); + write("function "); + emit(node.name); + write("("); + if (ctor) { + emitCommaList(ctor.parameters); + } + write(") {"); + scopeEmitStart(node, "constructor"); + increaseIndent(); + if (ctor) { + emitDefaultValueAssignments(ctor); + emitRestParameter(ctor); + if (node.baseType) { + var superCall = findInitialSuperCall(ctor); + if (superCall) { + writeLine(); + emit(superCall); + } + } + emitParameterPropertyAssignments(ctor); + } + else { + if (node.baseType) { + writeLine(); + emitStart(node.baseType); + write("_super.apply(this, arguments);"); + emitEnd(node.baseType); + } + } + emitCaptureThisForNodeIfNecessary(node); + emitMemberAssignments(node, /*nonstatic*/0); + if (ctor) { + var statements: Node[] = (ctor.body).statements; + if (superCall) statements = statements.slice(1); + emitLines(statements); + } + decreaseIndent(); + writeLine(); + emitToken(SyntaxKind.CloseBraceToken, ctor ? (ctor.body).statements.end : node.members.end); + scopeEmitEnd(); + emitEnd(ctor || node); + emitMemberFunctions(node); + emitMemberAssignments(node, NodeFlags.Static); + writeLine(); + function emitClassReturnStatement() { + write("return "); + emitNode(node.name); + } + emitToken(SyntaxKind.CloseBraceToken, node.members.end, emitClassReturnStatement); + write(";"); + decreaseIndent(); + writeLine(); + emitToken(SyntaxKind.CloseBraceToken, node.members.end); + scopeEmitEnd(); + emitStart(node); + write(")("); + if (node.baseType) { + emit(node.baseType.typeName); + } + write(");"); + emitEnd(node); + if (node.flags & NodeFlags.Export) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + emitEnd(node); + write(";"); + } + } + + function emitEnumDeclaration(node: EnumDeclaration) { + if (!(node.flags & NodeFlags.Export)) { + emitStart(node); + write("var "); + emit(node.name); + emitEnd(node); + write(";"); + } + writeLine(); + emitStart(node); + write("(function ("); + emit(node.name); + write(") {"); + increaseIndent(); + scopeEmitStart(node); + forEach(node.members, member => { + writeLine(); + emitStart(member); + emitNode(node.name); + write("["); + emitNode(node.name); + write("["); + emitQuotedIdentifier(member.name); + write("] = "); + if (member.initializer) { + emit(member.initializer); + } + else { + write(resolver.getEnumMemberValue(member).toString()); + } + write("] = "); + emitQuotedIdentifier(member.name); + emitEnd(member); + write(";"); + }); + decreaseIndent(); + writeLine(); + emitToken(SyntaxKind.CloseBraceToken, node.members.end); + scopeEmitEnd(); + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & NodeFlags.Export) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + + function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration: ModuleDeclaration): ModuleDeclaration { + if (moduleDeclaration.body.kind === SyntaxKind.ModuleDeclaration) { + var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); + return recursiveInnerModule || moduleDeclaration.body; + } + } + + function emitModuleDeclaration(node: ModuleDeclaration) { + if (!isInstantiated(node)) return; + if (!(node.flags & NodeFlags.Export)) { + emitStart(node); + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); + } + emitStart(node); + write("(function ("); + emit(node.name); + write(") "); + if (node.body.kind === SyntaxKind.ModuleBlock) { + emit(node.body); + } + else { + write("{"); + increaseIndent(); + scopeEmitStart(node); + emitCaptureThisForNodeIfNecessary(node); + writeLine(); + emit(node.body); + decreaseIndent(); + writeLine(); + var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; + emitToken(SyntaxKind.CloseBraceToken, moduleBlock.statements.end); + scopeEmitEnd(); + } + write(")("); + emitModuleMemberName(node); + write(" || ("); + emitModuleMemberName(node); + write(" = {}));"); + emitEnd(node); + if (node.flags & NodeFlags.Export) { + writeLine(); + emitStart(node); + write("var "); + emit(node.name); + write(" = "); + emitModuleMemberName(node); + emitEnd(node); + write(";"); + } + } + + function emitImportDeclaration(node: ImportDeclaration) { + var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); + + if (!emitImportDeclaration) { + // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when + // - current file is not external module + // - import declaration is top level and target is value imported by entity name + emitImportDeclaration = !(currentSourceFile.flags & NodeFlags.ExternalModule) && resolver.isTopLevelValueImportedViaEntityName(node); + } + + if (emitImportDeclaration) { + if (node.externalModuleName && node.parent.kind === SyntaxKind.SourceFile && compilerOptions.module === ModuleKind.AMD) { + if (node.flags & NodeFlags.Export) { + writeLine(); + emitStart(node); + emitModuleMemberName(node); + write(" = "); + emit(node.name); + write(";"); + emitEnd(node); + } + } + else { + writeLine(); + emitStart(node); + if (!(node.flags & NodeFlags.Export)) write("var "); + emitModuleMemberName(node); + write(" = "); + if (node.entityName) { + emit(node.entityName); + } + else { + write("require("); + emitStart(node.externalModuleName); + emitLiteral(node.externalModuleName); + emitEnd(node.externalModuleName); + emitToken(SyntaxKind.CloseParenToken, node.externalModuleName.end); + } + write(";"); + emitEnd(node); + } + } + } + + function getExternalImportDeclarations(node: SourceFile): ImportDeclaration[]{ + var result: ImportDeclaration[] = []; + forEach(node.statements, stat => { + if (stat.kind === SyntaxKind.ImportDeclaration && (stat).externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); + } + }); + return result; + } + + function getFirstExportAssignment(sourceFile: SourceFile) { + return forEach(sourceFile.statements, node => { + if (node.kind === SyntaxKind.ExportAssignment) { + return node; + } + }); + } + + function emitAMDModule(node: SourceFile) { + var imports = getExternalImportDeclarations(node); + writeLine(); + write("define([\"require\", \"exports\""); + forEach(imports, imp => { + write(", "); + emitLiteral(imp.externalModuleName); + }); + forEach(node.amdDependencies, amdDependency => { + var text = "\"" + amdDependency + "\""; + write(", "); + write(text); + }); + write("], function (require, exports"); + forEach(imports, imp => { + write(", "); + emit(imp.name); + }); + write(") {"); + increaseIndent(); + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("return "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + decreaseIndent(); + writeLine(); + write("});"); + } + + function emitCommonJSModule(node: SourceFile) { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + var exportName = resolver.getExportAssignmentName(node); + if (exportName) { + writeLine(); + var exportAssignement = getFirstExportAssignment(node); + emitStart(exportAssignement); + write("module.exports = "); + emitStart(exportAssignement.exportName); + write(exportName); + emitEnd(exportAssignement.exportName); + write(";"); + emitEnd(exportAssignement); + } + } + + function emitSourceFile(node: SourceFile) { + currentSourceFile = node; + if (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends) { + writeLine(); + write("var __extends = this.__extends || function (d, b) {"); + increaseIndent(); + writeLine(); + write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); + writeLine(); + write("function __() { this.constructor = d; }"); + writeLine(); + write("__.prototype = b.prototype;"); + writeLine(); + write("d.prototype = new __();"); + decreaseIndent(); + writeLine(); + write("};"); + extendsEmitted = true; + } + if (node.flags & NodeFlags.ExternalModule) { + if (compilerOptions.module === ModuleKind.AMD) { + emitAMDModule(node); + } + else { + emitCommonJSModule(node); + } + } + else { + emitCaptureThisForNodeIfNecessary(node); + emitLines(node.statements); + } + } + + function emitNode(node: Node) { + if (!node || node.flags & NodeFlags.Ambient) return; + switch (node.kind) { + case SyntaxKind.Identifier: + return emitIdentifier(node); + case SyntaxKind.Parameter: + return emitParameter(node); + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return emitAccessor(node); + case SyntaxKind.ThisKeyword: + return emitThis(node); + case SyntaxKind.SuperKeyword: + return emitSuper(node); + case SyntaxKind.NullKeyword: + return write("null"); + case SyntaxKind.TrueKeyword: + return write("true"); + case SyntaxKind.FalseKeyword: + return write("false"); + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.RegularExpressionLiteral: + return emitLiteral(node); + case SyntaxKind.QualifiedName: + return emitPropertyAccess(node); + case SyntaxKind.ArrayLiteral: + return emitArrayLiteral(node); + case SyntaxKind.ObjectLiteral: + return emitObjectLiteral(node); + case SyntaxKind.PropertyAssignment: + return emitPropertyAssignment(node); + case SyntaxKind.PropertyAccess: + return emitPropertyAccess(node); + case SyntaxKind.IndexedAccess: + return emitIndexedAccess(node); + case SyntaxKind.CallExpression: + return emitCallExpression(node); + case SyntaxKind.NewExpression: + return emitNewExpression(node); + case SyntaxKind.TypeAssertion: + return emit((node).operand); + case SyntaxKind.ParenExpression: + return emitParenExpression(node); + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return emitFunctionDeclaration(node); + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + return emitUnaryExpression(node); + case SyntaxKind.BinaryExpression: + return emitBinaryExpression(node); + case SyntaxKind.ConditionalExpression: + return emitConditionalExpression(node); + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: + return emitBlock(node); + case SyntaxKind.VariableStatement: + return emitVariableStatement(node); + case SyntaxKind.EmptyStatement: + return write(";"); + case SyntaxKind.ExpressionStatement: + return emitExpressionStatement(node); + case SyntaxKind.IfStatement: + return emitIfStatement(node); + case SyntaxKind.DoStatement: + return emitDoStatement(node); + case SyntaxKind.WhileStatement: + return emitWhileStatement(node); + case SyntaxKind.ForStatement: + return emitForStatement(node); + case SyntaxKind.ForInStatement: + return emitForInStatement(node); + case SyntaxKind.ContinueStatement: + case SyntaxKind.BreakStatement: + return emitBreakOrContinueStatement(node); + case SyntaxKind.ReturnStatement: + return emitReturnStatement(node); + case SyntaxKind.WithStatement: + return emitWithStatement(node); + case SyntaxKind.SwitchStatement: + return emitSwitchStatement(node); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return emitCaseOrDefaultClause(node); + case SyntaxKind.LabelledStatement: + return emitLabelledStatement(node); + case SyntaxKind.ThrowStatement: + return emitThrowStatement(node); + case SyntaxKind.TryStatement: + return emitTryStatement(node); + case SyntaxKind.CatchBlock: + return emitCatchBlock(node); + case SyntaxKind.DebuggerStatement: + return emitDebuggerStatement(node); + case SyntaxKind.VariableDeclaration: + return emitVariableDeclaration(node); + case SyntaxKind.ClassDeclaration: + return emitClassDeclaration(node); + case SyntaxKind.EnumDeclaration: + return emitEnumDeclaration(node); + case SyntaxKind.ModuleDeclaration: + return emitModuleDeclaration(node); + case SyntaxKind.ImportDeclaration: + return emitImportDeclaration(node); + case SyntaxKind.SourceFile: + return emitSourceFile(node); + } + } + + if (compilerOptions.sourceMap) { + initializeEmitterWithSourceMaps(); + } + + if (root) { + emit(root); + } + else { + forEach(program.getSourceFiles(), sourceFile => { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { + emit(sourceFile); + } + }); + } + + writeLine(); + writeEmittedFiles(writer.getText()); + } + + function emitDeclarations(resolver: EmitResolver, jsFilePath: string, root?: SourceFile) { + var program = resolver.getProgram(); + var compilerOptions = program.getCompilerOptions(); + var compilerHost = program.getCompilerHost(); + + var writer = createTextWriter(); + var write = writer.write; + var writeLine = writer.writeLine; + var increaseIndent = writer.increaseIndent; + var decreaseIndent = writer.decreaseIndent; + + function emitLines(nodes: Node[]) { + for (var i = 0, n = nodes.length; i < n; i++) { + emitNode(nodes[i]); + } + } + + function emitCommaList(nodes: Node[]) { + for (var i = 0, n = nodes.length; i < n; i++) { + if (i) { + write(", "); + } + emitNode(nodes[i]); + } + } + + function emitCommaTypeList(nodes: Node[]) { + if (nodes) { + for (var i = 0, n = nodes.length; i < n; i++) { + if (i) { + write(", "); + } + // TODO(shkamat): get the symbol name in the scope for this node + emitSourceTextOfNode(nodes[i]); + } + } + } + + + function emitSourceTextOfNode(node: Node) { + write(getSourceTextOfLocalNode(node)); + } + + function emitSourceFile(node: SourceFile) { + currentSourceFile = node; + emitLines(node.statements); + } + + function emitExportAssignment(node: ExportAssignment) { + write("export = "); + emitSourceTextOfNode(node.exportName); + write(";"); + writeLine(); + } + + function emitImportDeclaration(node: ImportDeclaration) { + // TODO(shkamat): Emit if import decl is used to declare type in this context or as export assignment + if (node.flags & NodeFlags.Export) { + //TODO: only emit when export flag once the above condition is modified + write("export "); + write("import "); + write(getSourceTextOfLocalNode(node.name) + " = "); + if (node.entityName) { + emitSourceTextOfNode(node.entityName); + write(";"); + } + else { + write("require("); + emitSourceTextOfNode(node.externalModuleName); + write(");"); + } + writeLine(); + } + } + + function canEmitDeclaration(node: Declaration) { + if (node.parent.kind === SyntaxKind.ModuleDeclaration || node.parent.kind === SyntaxKind.SourceFile) { + if (!(node.flags & NodeFlags.Export)) { + // Non exported member + // TODO(shkamat): check if the symbol at this location is externally visible + // eg. because of export assignment or is in global context because source file is non external module + return false; + } + } + + return true; + } + + function emitDeclarationFlags(node: Declaration) { + if (node.flags & NodeFlags.Static) { + if (node.flags & NodeFlags.Private) { + write("private "); + } + write("static "); + } + else { + if (node.flags & NodeFlags.Private) { + write("private "); + } + // If the node is parented in the current source file we need to emit export declare or just export + else if (node.parent === currentSourceFile) { + // If the node is exported + if (node.flags & NodeFlags.Export) { + write("export "); + } + + if (node.kind !== SyntaxKind.InterfaceDeclaration) { + write("declare "); + } + } + } + } + + function emitModuleDeclaration(node: ModuleDeclaration) { + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + write("module "); + emitSourceTextOfNode(node.name); + while (node.body.kind !== SyntaxKind.ModuleBlock) { + node = node.body; + write("."); + emitSourceTextOfNode(node.name); + } + write(" {"); + writeLine(); + increaseIndent(); + emitLines((node.body).statements); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitEnumDeclaration(node: EnumDeclaration) { + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + write("enum "); + emitSourceTextOfNode(node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitEnumMemberDeclaration(node: EnumMember) { + emitSourceTextOfNode(node.name); + var enumMemberValue = resolver.getEnumMemberValue(node); + if (enumMemberValue !== undefined) { + write(" = "); + write(enumMemberValue.toString()); + } + write(","); + writeLine(); + } + + function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { + if (typeParameters) { + write("<"); + emitCommaTypeList(typeParameters); + write(">"); + } + } + + function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { + if (typeReferences) { + write(isImplementsList ? " implments " : " extends "); + emitCommaTypeList(typeReferences); + } + } + + function emitClassDeclaration(node: ClassDeclaration) { + function emitParameterProperties(node: ConstructorDeclaration) { + if (node) { + forEach(node.parameters, param => { + if (param.flags & (NodeFlags.Public | NodeFlags.Private)) { + emitPropertyDeclaration(param); + } + }); + } + } + + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + write("class "); + emitSourceTextOfNode(node.name); + emitTypeParameters(node.typeParameters); + if (node.baseType) { + emitHeritageClause([node.baseType], /*isImplementsList*/ false); + } + emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(findConstructor(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitInterfaceDeclaration(node: InterfaceDeclaration) { + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + write("interface "); + emitSourceTextOfNode(node.name); + emitTypeParameters(node.typeParameters); + emitHeritageClause(node.baseTypes, /*isImplementsList*/ false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitPropertyDeclaration(node: PropertyDeclaration) { + emitDeclarationFlags(node); + emitVariableDeclaration(node); + write(";"); + writeLine(); + } + + function emitVariableDeclaration(node: VariableDeclaration) { + emitSourceTextOfNode(node.name); + // If optional property emit ? + if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + if (!(node.flags & NodeFlags.Private)) { + // TODO(shkamat): emit type of the node in given scope + } + } + + function emitVariableStatement(node: VariableStatement) { + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + write("var "); + emitCommaList(node.declarations); + write(";"); + writeLine(); + } + } + + function emitAccessorDeclaration(node: AccessorDeclaration) { + var accessors = getAllAccessorDeclarations(node.parent, node); + if (node === accessors.firstAccessor) { + emitDeclarationFlags(node); + emitSourceTextOfNode(node.name); + if (!(node.flags & NodeFlags.Private)) { + // TODO(shkamat): emit type of the node in given scope + // If get accessor -> return type of getAccessor otherwise parameter type of setAccessor + } + write(";"); + writeLine(); + } + } + + function emitFunctionDeclaration(node: FunctionDeclaration) { + // TODO(shkamat): if this is overloaded declaration do not emit if body is present + if (canEmitDeclaration(node)) { + emitDeclarationFlags(node); + if (node.kind === SyntaxKind.FunctionDeclaration) { + write("function "); + emitSourceTextOfNode(node.name); + } + else if (node.kind === SyntaxKind.Constructor) { + write("constructor "); + } + else { + emitSourceTextOfNode(node.name); + if (node.flags & NodeFlags.QuestionMark) { + write("?"); + } + } + emitSignatureDeclaration(node); + } + } + + function emitConstructSignatureDeclaration(node: SignatureDeclaration) { + write("new "); + emitSignatureDeclaration(node); + } + + function emitSignatureDeclaration(node: SignatureDeclaration) { + emitTypeParameters(node.typeParameters); + if (node.kind === SyntaxKind.IndexSignature) { + write("["); + } + else { + write("("); + } + + // Parameters + emitCommaList(node.parameters); + + if (node.kind === SyntaxKind.IndexSignature) { + write("]"); + } + else { + write(")"); + } + + if (!(node.flags & NodeFlags.Private)) { + // TODO(shkamat): emit return type of the signature + } + write(";"); + writeLine(); + } + + function emitParameterDeclaration(node: ParameterDeclaration) { + if (node.flags & NodeFlags.Rest) { + write("..."); + } + emitSourceTextOfNode(node.name); + if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + + if (!(node.parent.flags & NodeFlags.Private)) { + // TODO(shkamat): emitType of the parameter if the method is not private + } + } + + function emitNode(node: Node) { + switch (node.kind) { + case SyntaxKind.Parameter: + return emitParameterDeclaration(node); + case SyntaxKind.Constructor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + return emitFunctionDeclaration(node); + case SyntaxKind.ConstructSignature: + return emitConstructSignatureDeclaration(node); + case SyntaxKind.CallSignature: + case SyntaxKind.IndexSignature: + return emitSignatureDeclaration(node); + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return emitAccessorDeclaration(node); + case SyntaxKind.VariableStatement: + return emitVariableStatement(node); + case SyntaxKind.VariableDeclaration: + return emitVariableDeclaration(node); + case SyntaxKind.Property: + return emitPropertyDeclaration(node); + case SyntaxKind.InterfaceDeclaration: + return emitInterfaceDeclaration(node); + case SyntaxKind.ClassDeclaration: + return emitClassDeclaration(node); + case SyntaxKind.EnumMember: + return emitEnumMemberDeclaration(node); + case SyntaxKind.EnumDeclaration: + return emitEnumDeclaration(node); + case SyntaxKind.ModuleDeclaration: + return emitModuleDeclaration(node); + case SyntaxKind.ImportDeclaration: + return emitImportDeclaration(node); + case SyntaxKind.ExportAssignment: + return emitExportAssignment(node); + case SyntaxKind.SourceFile: + return emitSourceFile(node); + } + } + + function resolveScriptReference(sourceFile: SourceFile, reference: FileReference) { + var referenceFileName = compilerOptions.noResolve + ? reference.filename + : normalizePath(combinePaths(getDirectoryPath(sourceFile.filename), reference.filename)); + return program.getSourceFile(referenceFileName); + } + + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file + // and we could be collecting these paths from multiple files into single one with --out option + var referencePathsOutput = ""; + function writeReferencePath(referencedFile: SourceFile) { + var declFileName = referencedFile.flags & NodeFlags.DeclarationFile + ? referencedFile.filename // Declaration file, use declaration file name + : emitToOwnOutputFile(referencedFile, compilerOptions) + ? getOwnEmitOutputFilePath(referencedFile, program, ".d.ts") // Own output file so get the .d.ts file + : getModuleNameFromFilename(compilerOptions.out) + ".d.ts";// Global out file + + declFileName = getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizeSlashes(jsFilePath)), + declFileName, + compilerHost.getCurrentDirectory(), + /*isAbsolutePathAnUrl*/ false); + + referencePathsOutput += "/// " + sys.newLine; + } + + if (root) { + // Emiting single file so emit references in this file only + var addedGlobalFileReference = false; + forEach(root.referencedFiles, fileReference => { + var referencedFile = resolveScriptReference(root, fileReference); + + // All the references that are not going to be part of same file + if ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference + emitToOwnOutputFile(referencedFile, compilerOptions) || // This is referenced file is emitting its own js file + !addedGlobalFileReference) { // Or the global out file corresponding to this reference was not added + + writeReferencePath(referencedFile); + if (!isExternalModuleOrDeclarationFile(referencedFile)) { + addedGlobalFileReference = true; + } + } + }); + + emitNode(root); + } + else { + // Emit references corresponding to this file + var emittedReferencedFiles: SourceFile[] = []; + forEach(program.getSourceFiles(), sourceFile => { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { + // Check what references need to be added + forEach(sourceFile.referencedFiles, fileReference => { + var referencedFile = resolveScriptReference(sourceFile, fileReference); + + // If the reference file is declaration file or external module emit that reference + if (isExternalModuleOrDeclarationFile(referencedFile) && + !contains(emittedReferencedFiles, referencedFile)) { // If the file refernece was not already emitted + + writeReferencePath(referencedFile); + emittedReferencedFiles.push(referencedFile); + } + }); + + emitNode(sourceFile); + } + }); + } + + compilerHost.writeFile(getModuleNameFromFilename(jsFilePath) + ".d.ts", referencePathsOutput + writer.getText()); + } +} diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts new file mode 100644 index 0000000000000..408968bd78731 --- /dev/null +++ b/src/compiler/parser.ts @@ -0,0 +1,3104 @@ +/// +/// +/// +/// + +module ts { + var nodeConstructors = new Array Node>(SyntaxKind.Count); + + export function getNodeConstructor(kind: SyntaxKind): new () => Node { + return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)); + } + + function createRootNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags): Node { + var node = new (getNodeConstructor(kind))(); + node.pos = pos; + node.end = end; + node.flags = flags; + return node; + } + + var moduleExtensions = [".d.ts", ".ts", ".js"]; + + interface ReferenceComments { + referencedFiles: FileReference[]; + amdDependencies: string[]; + } + + export function getModuleNameFromFilename(filename: string) { + for (var i = 0; i < moduleExtensions.length; i++) { + var ext = moduleExtensions[i]; + var len = filename.length - ext.length; + if (len > 0 && filename.substr(len) === ext) return filename.substr(0, len); + } + return filename; + } + + export function getSourceFileOfNode(node: Node): SourceFile { + while (node && node.kind !== SyntaxKind.SourceFile) node = node.parent; + return node; + } + + // This is a useful function for debugging purposes. + export function nodePosToString(node: Node): string { + var file = getSourceFileOfNode(node); + var loc = file.getLineAndCharacterFromPosition(node.pos); + return file.filename + "(" + loc.line + "," + loc.character + ")"; + } + + + export function getStartPosOfNode(node: Node): number { + return node.pos; + } + + export function getTokenPosOfNode(node: Node): number { + return skipTrivia(getSourceFileOfNode(node).text, node.pos); + } + + export function getSourceTextOfNode(node: Node): string { + var text = getSourceFileOfNode(node).text; + return text.substring(skipTrivia(text, node.pos), node.end); + } + + // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' + export function escapeIdentifier(identifier: string): string { + return identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier; + } + + // Return display name of an identifier + export function identifierToString(identifier: Identifier) { + return identifier.kind === SyntaxKind.Missing ? "(Missing)" : getSourceTextOfNode(identifier); + } + + export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic { + var file = getSourceFileOfNode(node); + var start = skipTrivia(file.text, node.pos); + var length = node.end - start; + + return createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + } + + export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic { + var file = getSourceFileOfNode(node); + var start = skipTrivia(file.text, node.pos); + var length = node.end - start; + return flattenDiagnosticChain(file, start, length, messageChain); + } + + // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes + // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, + // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns + // a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. + export function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodes?: (nodes: Node[]) => T): T { + function child(node: Node): T { + if (node) return cbNode(node); + } + function children(nodes: Node[]) { + if (nodes) { + if (cbNodes) return cbNodes(nodes); + var result: T; + for (var i = 0, len = nodes.length; i < len; i++) { + if (result = cbNode(nodes[i])) break; + } + return result; + } + } + if (!node) return; + switch (node.kind) { + case SyntaxKind.QualifiedName: + return child((node).left) || + child((node).right); + case SyntaxKind.TypeParameter: + return child((node).name) || + child((node).constraint); + case SyntaxKind.Parameter: + return child((node).name) || + child((node).type) || + child((node).initializer); + case SyntaxKind.Property: + case SyntaxKind.PropertyAssignment: + return child((node).name) || + child((node).type) || + child((node).initializer); + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return children((node).typeParameters) || + children((node).parameters) || + child((node).type); + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ArrowFunction: + return child((node).name) || + children((node).typeParameters) || + children((node).parameters) || + child((node).type) || + child((node).body); + case SyntaxKind.TypeReference: + return child((node).typeName) || + children((node).typeArguments); + case SyntaxKind.TypeQuery: + return child((node).exprName); + case SyntaxKind.TypeLiteral: + return children((node).members); + case SyntaxKind.ArrayType: + return child((node).elementType); + case SyntaxKind.ArrayLiteral: + return children((node).elements); + case SyntaxKind.ObjectLiteral: + return children((node).properties); + case SyntaxKind.PropertyAccess: + return child((node).left) || + child((node).right); + case SyntaxKind.IndexedAccess: + return child((node).object) || + child((node).index); + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return child((node).func) || + children((node).typeArguments) || + children((node).arguments); + case SyntaxKind.TypeAssertion: + return child((node).type) || + child((node).operand); + case SyntaxKind.ParenExpression: + return child((node).expression); + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + return child((node).operand); + case SyntaxKind.BinaryExpression: + return child((node).left) || + child((node).right); + case SyntaxKind.ConditionalExpression: + return child((node).condition) || + child((node).whenTrue) || + child((node).whenFalse); + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: + case SyntaxKind.SourceFile: + return children((node).statements); + case SyntaxKind.VariableStatement: + return children((node).declarations); + case SyntaxKind.ExpressionStatement: + return child((node).expression); + case SyntaxKind.IfStatement: + return child((node).expression) || + child((node).thenStatement) || + child((node).elseStatement); + case SyntaxKind.DoStatement: + return child((node).statement) || + child((node).expression); + case SyntaxKind.WhileStatement: + return child((node).expression) || + child((node).statement); + case SyntaxKind.ForStatement: + return children((node).declarations) || + child((node).initializer) || + child((node).condition) || + child((node).iterator) || + child((node).statement); + case SyntaxKind.ForInStatement: + return child((node).declaration) || + child((node).variable) || + child((node).expression) || + child((node).statement); + case SyntaxKind.ContinueStatement: + case SyntaxKind.BreakStatement: + return child((node).label); + case SyntaxKind.ReturnStatement: + return child((node).expression); + case SyntaxKind.WithStatement: + return child((node).expression) || + child((node).statement); + case SyntaxKind.SwitchStatement: + return child((node).expression) || + children((node).clauses); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return child((node).expression) || + children((node).statements); + case SyntaxKind.LabelledStatement: + return child((node).label) || + child((node).statement); + case SyntaxKind.ThrowStatement: + return child((node).expression); + case SyntaxKind.TryStatement: + return child((node).tryBlock) || + child((node).catchBlock) || + child((node).finallyBlock); + case SyntaxKind.CatchBlock: + return child((node).variable) || + children((node).statements); + case SyntaxKind.VariableDeclaration: + return child((node).name) || + child((node).type) || + child((node).initializer); + case SyntaxKind.ClassDeclaration: + return child((node).name) || + children((node).typeParameters) || + child((node).baseType) || + children((node).implementedTypes) || + children((node).members); + case SyntaxKind.InterfaceDeclaration: + return child((node).name) || + children((node).typeParameters) || + children((node).baseTypes) || + children((node).members); + case SyntaxKind.EnumDeclaration: + return child((node).name) || + children((node).members); + case SyntaxKind.EnumMember: + return child((node).name) || + child((node).initializer); + case SyntaxKind.ModuleDeclaration: + return child((node).name) || + child((node).body); + case SyntaxKind.ImportDeclaration: + return child((node).name) || + child((node).entityName) || + child((node).externalModuleName); + case SyntaxKind.ExportAssignment: + return child((node).exportName); + } + } + + export function hasRestParameters(s: SignatureDeclaration): boolean { + return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & NodeFlags.Rest) !== 0; + } + + enum ParsingContext { + SourceElements, // Elements in source file + ModuleElements, // Elements in module declaration + BlockStatements, // Statements in block + SwitchClauses, // Clauses in switch statement + SwitchClauseStatements, // Statements in switch clause + TypeMembers, // Members in interface or type literal + ClassMembers, // Members in class declaration + EnumMembers, // Members in enum declaration + BaseTypeReferences, // Type references in extends or implements clause + VariableDeclarations, // Variable declarations in variable statement + ArgumentExpressions, // Expressions in argument list + ObjectLiteralMembers, // Members in object literal + ArrayLiteralMembers, // Members in array literal + Parameters, // Parameters in parameter list + TypeParameters, // Type parameters in type parameter list + TypeArguments, // Type arguments in type argument list + Count // Number of parsing contexts + } + + function parsingContextErrors(context: ParsingContext): DiagnosticMessage { + switch (context) { + case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected; + case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected; + case ParsingContext.BlockStatements: return Diagnostics.Statement_expected; + case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected; + case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected; + case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected; + case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected; + case ParsingContext.BaseTypeReferences: return Diagnostics.Type_reference_expected; + case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected; + case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected; + case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected; + case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected; + case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected; + case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected; + case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected; + } + }; + + enum LookAheadMode { + NotLookingAhead, + NoErrorYet, + Error + } + + enum ModifierContext { + SourceElements, // Top level elements in a source file + ModuleElements, // Elements in module declaration + ClassMembers, // Members in class declaration + Parameters, // Parameters in parameter list + } + + export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget): SourceFile { + var file: SourceFile; + var scanner: Scanner; + var token: SyntaxKind; + var parsingContext: ParsingContext; + var commentRanges: TextRange[]; + var identifiers: Map = {}; + var identifierCount = 0; + var nodeCount = 0; + var lineStarts: number[]; + + var lookAheadMode = LookAheadMode.NotLookingAhead; + var inAmbientContext = false; + + function getLineAndCharacterlFromSourcePosition(position: number) { + if (!lineStarts) { + lineStarts = getLineStarts(sourceText); + } + return getLineAndCharacterOfPosition(lineStarts, position); + } + + function error(message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { + var start = scanner.getTokenPos(); + var length = scanner.getTextPos() - start; + + errorAtPos(start, length, message, arg0, arg1, arg2); + } + + // This is just like createDiagnosticForNode except that it uses the current file + // being parsed instead of the file containing the node. This is because during + // parse, the nodes do not have parent pointers to get to the file. + // + // It is very intentional that we are not checking or changing the lookAheadMode value + // here. 'grammarErrorOnNode' is called when we are doing extra grammar checks and not + // when we are doing the actual parsing to determine what the user wrote. In other + // words, this function is called once we have already parsed the node, and are just + // applying some stricter checks on that node. + function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { + var start = skipTrivia(file.text, node.pos); + var length = node.end - start; + + file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + + function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { + file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + + function errorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { + var lastErrorPos = file.syntacticErrors.length + ? file.syntacticErrors[file.syntacticErrors.length - 1].start + : -1; + if (start !== lastErrorPos) { + file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + } + + if (lookAheadMode === LookAheadMode.NoErrorYet) { + lookAheadMode = LookAheadMode.Error; + } + } + + function scanError(message: DiagnosticMessage) { + var pos = scanner.getTextPos(); + errorAtPos(pos, 0, message); + } + + function onComment(pos: number, end: number) { + if (commentRanges) commentRanges.push({ pos: pos, end: end }); + } + + function getNodePos(): number { + return scanner.getStartPos(); + } + + function getNodeEnd(): number { + return scanner.getStartPos(); + } + + function nextToken(): SyntaxKind { + return token = scanner.scan(); + } + + function getTokenPos(pos: number): number { + return skipTrivia(sourceText, pos); + } + + function reScanGreaterToken(): SyntaxKind { + return token = scanner.reScanGreaterToken(); + } + + function reScanSlashToken(): SyntaxKind { + return token = scanner.reScanSlashToken(); + } + + function lookAheadHelper(callback: () => T, alwaysResetState: boolean): T { + // Keep track of the state we'll need to rollback to if lookahead fails (or if the + // caller asked us to always reset our state). + var saveToken = token; + var saveSyntacticErrorsLength = file.syntacticErrors.length; + + // Keep track of the current look ahead mode (this matters if we have nested + // speculative parsing). + var saveLookAheadMode = lookAheadMode; + + // Mark that we're in speculative parsing and then try to parse out whatever code + // the callback wants. + lookAheadMode = LookAheadMode.NoErrorYet; + var result = callback(); + + // If we switched from 1 to to -1 then a parse error occurred during the callback. + // If that's the case, then we want to act as if we never got any result at all. + Debug.assert(lookAheadMode === LookAheadMode.Error || lookAheadMode === LookAheadMode.NoErrorYet); + if (lookAheadMode === LookAheadMode.Error) { + result = undefined; + } + + // Now restore as appropriate. + lookAheadMode = saveLookAheadMode; + if (!result || alwaysResetState) { + token = saveToken; + file.syntacticErrors.length = saveSyntacticErrorsLength; + } + + return result; + } + + function lookAhead(callback: () => T): T { + var result: T; + scanner.tryScan(() => { + result = lookAheadHelper(callback, /*alwaysResetState:*/ true); + + // Returning false here indicates to the scanner that it should always jump + // back to where it started. This makes sense as 'lookahead' acts as if + // neither the parser nor scanner was affected by the operation. + // + // Note: the rewinding of the parser state is already handled in lookAheadHelper + // (because we passed 'true' for alwaysResetState). + return false; + }); + + return result; + } + + function tryParse(callback: () => T): T { + return scanner.tryScan(() => lookAheadHelper(callback, /*alwaysResetState:*/ false)); + } + + function isIdentifier(): boolean { + return token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord; + } + + function isSemicolon(): boolean { + // True if real or automatic semicolon + return token === SyntaxKind.SemicolonToken || token === SyntaxKind.CloseBraceToken || scanner.hasPrecedingLineBreak(); + } + + function parseExpected(t: SyntaxKind): boolean { + if (token === t) { + nextToken(); + return true; + } + error(Diagnostics._0_expected, tokenToString(t)); + return false; + } + + function parseOptional(t: SyntaxKind): boolean { + if (token === t) { + nextToken(); + return true; + } + return false; + } + + function canParseSemicolon() { + // If there's a real semicolon, then we can always parse it out. + if (token === SyntaxKind.SemicolonToken) { + return true; + } + + // We can parse out an optional semicolon in ASI cases in the following cases. + return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.EndOfFileToken || scanner.hasPrecedingLineBreak(); + } + + function parseSemicolon(): void { + if (canParseSemicolon()) { + if (token === SyntaxKind.SemicolonToken) { + // consume the semicolon if it was explicitly provided. + nextToken(); + } + } + else { + error(Diagnostics._0_expected, ";"); + } + } + + function createNode(kind: SyntaxKind, pos?: number): Node { + nodeCount++; + var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(); + if (!(pos >= 0)) pos = scanner.getStartPos(); + node.pos = pos; + node.end = pos; + return node; + } + + function finishNode(node: T): T { + node.end = scanner.getStartPos(); + return node; + } + + function createMissingNode(): Node { + return createNode(SyntaxKind.Missing); + } + + // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues + // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for + // each identifier in order to reduce memory consumption. + function createIdentifier(isIdentifier: boolean): Identifier { + identifierCount++; + if (isIdentifier) { + var node = createNode(SyntaxKind.Identifier); + var text = escapeIdentifier(scanner.getTokenValue()); + node.text = hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); + nextToken(); + return finishNode(node); + } + error(Diagnostics.Identifier_expected); + return createMissingNode(); + } + + function parseIdentifier(): Identifier { + return createIdentifier(isIdentifier()); + } + + function parseIdentifierName(): Identifier { + return createIdentifier(token >= SyntaxKind.Identifier); + } + + function isPropertyName(): boolean { + return token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral; + } + + function parsePropertyName(): Identifier { + if (token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral) { + return parsePrimaryExpression(); + } + return parseIdentifierName(); + } + + + function isKeyword(token: SyntaxKind): boolean { + return SyntaxKind.FirstKeyword <= token && token <= SyntaxKind.LastKeyword; + } + + function isModifier(token: SyntaxKind): boolean { + switch (token) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + case SyntaxKind.ExportKeyword: + case SyntaxKind.DeclareKeyword: + return true; + } + return false; + } + + function parseContextualModifier(t: SyntaxKind): boolean { + return token === t && tryParse(() => { + nextToken(); + return token === SyntaxKind.OpenBracketToken || isPropertyName(); + }); + } + + function parseAnyContextualModifier(): boolean { + return isModifier(token) && tryParse(() => { + nextToken(); + return token === SyntaxKind.OpenBracketToken || isPropertyName(); + }); + } + + // True if positioned at the start of a list element + function isListElement(kind: ParsingContext): boolean { + switch (kind) { + case ParsingContext.SourceElements: + case ParsingContext.ModuleElements: + return isSourceElement(); + case ParsingContext.BlockStatements: + case ParsingContext.SwitchClauseStatements: + return isStatement(); + case ParsingContext.SwitchClauses: + return token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; + case ParsingContext.TypeMembers: + return isTypeMember(); + case ParsingContext.ClassMembers: + return lookAhead(isClassMemberStart); + case ParsingContext.EnumMembers: + case ParsingContext.ObjectLiteralMembers: + return isPropertyName(); + case ParsingContext.BaseTypeReferences: + return isIdentifier() && ((token !== SyntaxKind.ExtendsKeyword && token !== SyntaxKind.ImplementsKeyword) || !lookAhead(() => (nextToken(), isIdentifier()))); + case ParsingContext.VariableDeclarations: + case ParsingContext.TypeParameters: + return isIdentifier(); + case ParsingContext.ArgumentExpressions: + return isExpression(); + case ParsingContext.ArrayLiteralMembers: + return token === SyntaxKind.CommaToken || isExpression(); + case ParsingContext.Parameters: + return isParameter(); + case ParsingContext.TypeArguments: + return isType(); + } + } + + // True if positioned at a list terminator + function isListTerminator(kind: ParsingContext): boolean { + if (token === SyntaxKind.EndOfFileToken) { + // Being at the end of the file ends all lists. + return true; + } + + switch (kind) { + case ParsingContext.ModuleElements: + case ParsingContext.BlockStatements: + case ParsingContext.SwitchClauses: + case ParsingContext.TypeMembers: + case ParsingContext.ClassMembers: + case ParsingContext.EnumMembers: + case ParsingContext.ObjectLiteralMembers: + return token === SyntaxKind.CloseBraceToken; + case ParsingContext.SwitchClauseStatements: + return token === SyntaxKind.CloseBraceToken || token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; + case ParsingContext.BaseTypeReferences: + return token === SyntaxKind.OpenBraceToken || token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; + case ParsingContext.VariableDeclarations: + return isVariableDeclaratorListTerminator(); + case ParsingContext.TypeParameters: + // Tokens other than '>' are here for better error recovery + return token === SyntaxKind.GreaterThanToken || token === SyntaxKind.OpenParenToken || token === SyntaxKind.OpenBraceToken || token === SyntaxKind.ExtendsKeyword || token === SyntaxKind.ImplementsKeyword; + case ParsingContext.ArgumentExpressions: + // Tokens other than ')' are here for better error recovery + return token === SyntaxKind.CloseParenToken || token === SyntaxKind.SemicolonToken; + case ParsingContext.ArrayLiteralMembers: + return token === SyntaxKind.CloseBracketToken; + case ParsingContext.Parameters: + // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery + return token === SyntaxKind.CloseParenToken || token === SyntaxKind.CloseBracketToken || token === SyntaxKind.OpenBraceToken; + case ParsingContext.TypeArguments: + // Tokens other than '>' are here for better error recovery + return token === SyntaxKind.GreaterThanToken || token === SyntaxKind.OpenParenToken; + } + } + + function isVariableDeclaratorListTerminator(): boolean { + // If we can consume a semicolon (either explicitly, or with ASI), then consider us done + // with parsing the list of variable declarators. + if (canParseSemicolon()) { + return true; + } + + // in the case where we're parsing the variable declarator of a 'for-in' statement, we + // are done if we see an 'in' keyword in front of us. + if (token === SyntaxKind.InKeyword) { + return true; + } + + // ERROR RECOVERY TWEAK: + // For better error recovery, if we see an '=>' then we just stop immediately. We've got an + // arrow function here and it's going to be very unlikely that we'll resynchronize and get + // another variable declaration. + if (token === SyntaxKind.EqualsGreaterThanToken) { + return true; + } + + // Keep trying to parse out variable declarators. + return false; + } + + // True if positioned at element or terminator of the current list or any enclosing list + function isInParsingContext(): boolean { + for (var kind = 0; kind < ParsingContext.Count; kind++) { + if (parsingContext & (1 << kind)) { + if (isListElement(kind) || isListTerminator(kind)) return true; + } + } + + return false; + } + + // Parses a list of elements + function parseList(kind: ParsingContext, parseElement: () => T): NodeArray { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = >[]; + result.pos = getNodePos(); + while (!isListTerminator(kind)) { + if (isListElement(kind)) { + result.push(parseElement()); + } + else { + error(parsingContextErrors(kind)); + if (isInParsingContext()) { + break; + } + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + + // Parses a comma delimited list of elements + function parseDelimitedList(kind: ParsingContext, parseElement: () => T, allowTrailingComma: boolean): NodeArray { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var result = >[]; + result.pos = getNodePos(); + // Keep track of how many errors we had before the list started. If we don't see any new + // errors resulting from the list being malformed, we are free to complain about a trailing + // comma. + var errorCountBeforeParsingList = file.syntacticErrors.length; + var commaStart = -1; // Meaning the previous token was not a comma + while (true) { + if (isListElement(kind)) { + result.push(parseElement()); + commaStart = scanner.getTokenPos(); + if (parseOptional(SyntaxKind.CommaToken)) { + continue; + } + commaStart = -1; // Back to the state where the last token was not a comma + if (isListTerminator(kind)) { + break; + } + error(Diagnostics._0_expected, ","); + } + else if (isListTerminator(kind)) { + if (!allowTrailingComma && commaStart >= 0 /*meaning the last token was a comma*/) { + if (file.syntacticErrors.length === errorCountBeforeParsingList) { + // Report a grammar error so we don't affect lookahead + grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, Diagnostics.Trailing_comma_not_allowed); + } + } + break; + } + else { + error(parsingContextErrors(kind)); + if (token !== SyntaxKind.CommaToken && isInParsingContext()) { + break; + } + nextToken(); + } + } + result.end = getNodeEnd(); + parsingContext = saveParsingContext; + return result; + } + + function createMissingList(): NodeArray { + var pos = getNodePos(); + var result = >[]; + result.pos = pos; + result.end = pos; + return result; + } + + function createNodeArray(node: T): NodeArray { + var result = >[node]; + result.pos = node.pos; + result.end = node.end; + return result; + } + + function parseBracketedList(kind: ParsingContext, parseElement: () => T, startToken: SyntaxKind, endToken: SyntaxKind, allowTrailingSeparator: boolean): NodeArray { + if (parseExpected(startToken)) { + var result = parseDelimitedList(kind, parseElement, allowTrailingSeparator); + parseExpected(endToken); + return result; + } + return createMissingList(); + } + + function parseEntityName(): EntityName { + var entity: EntityName = parseIdentifier(); + while (parseOptional(SyntaxKind.DotToken)) { + var node = createNode(SyntaxKind.QualifiedName, entity.pos); + node.left = entity; + node.right = parseIdentifier(); + entity = finishNode(node); + } + return entity; + } + + function parseTokenNode(): Node { + var node = createNode(token); + nextToken(); + return finishNode(node); + } + + function parseLiteralNode(): LiteralExpression { + var node = createNode(token); + node.text = scanner.getTokenValue(); + nextToken(); + return finishNode(node); + } + + function parseStringLiteral(): LiteralExpression { + if (token === SyntaxKind.StringLiteral) return parseLiteralNode(); + error(Diagnostics.String_literal_expected); + return createMissingNode(); + } + + // TYPES + + function parseTypeReference(): TypeReferenceNode { + var node = createNode(SyntaxKind.TypeReference); + node.typeName = parseEntityName(); + if (!scanner.hasPrecedingLineBreak() && token === SyntaxKind.LessThanToken) { + node.typeArguments = parseTypeArguments(); + } + return finishNode(node); + } + + function parseTypeQuery(): TypeQueryNode { + var node = createNode(SyntaxKind.TypeQuery); + parseExpected(SyntaxKind.TypeOfKeyword); + node.exprName = parseEntityName(); + return finishNode(node); + } + + function parseTypeParameter(): TypeParameterDeclaration { + var node = createNode(SyntaxKind.TypeParameter); + node.name = parseIdentifier(); + if (parseOptional(SyntaxKind.ExtendsKeyword)) { + // It's not uncommon for people to write improper constraints to a generic. If the + // user writes a constraint that is an expression and not an actual type, then parse + // it out as an expression (so we can recover well), but report that a type is needed + // instead. + if (isType() || !isExpression()) { + node.constraint = parseType(); + } + else { + // It was not a type, and it looked like an expression. Parse out an expression + // here so we recover well. Note: it is important that we call parseUnaryExpression + // and not parseExpression here. If the user has: + // + // + // + // We do *not* want to consume the > as we're consuming the expression for "". + var expr = parseUnaryExpression(); + grammarErrorOnNode(expr, Diagnostics.Type_expected); + } + } + + return finishNode(node); + } + + function parseTypeParameters(): NodeArray { + if (token === SyntaxKind.LessThanToken) { + var pos = getNodePos(); + var result = parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken, /*allowTrailingSeparator*/ false); + if (!result.length) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, Diagnostics.Type_parameter_list_cannot_be_empty); + } + return result; + } + } + + function parseParameterType(): TypeNode { + return parseOptional(SyntaxKind.ColonToken) ? token === SyntaxKind.StringLiteral ? parseStringLiteral() : parseType() : undefined; + } + + function isParameter(): boolean { + return token === SyntaxKind.DotDotDotToken || isIdentifier() || isModifier(token); + } + + function parseParameter(flags: NodeFlags = 0): ParameterDeclaration { + var node = createNode(SyntaxKind.Parameter); + node.flags |= parseAndCheckModifiers(ModifierContext.Parameters); + if (parseOptional(SyntaxKind.DotDotDotToken)) { + node.flags |= NodeFlags.Rest; + } + node.name = parseIdentifier(); + if (parseOptional(SyntaxKind.QuestionToken)) { + node.flags |= NodeFlags.QuestionMark; + } + node.type = parseParameterType(); + node.initializer = parseInitializer(/*inParameter*/ true); + + // Do not check for initializers in an ambient context for parameters. This is not + // a grammar error because the grammar allows arbitrary call signatures in + // an ambient context. + // It is actually not necessary for this to be an error at all. The reason is that + // function/constructor implementations are syntactically disallowed in ambient + // contexts. In addition, parameter initializers are semantically disallowed in + // overload signatures. So parameter initializers are transitively disallowed in + // ambient contexts. + return finishNode(node); + } + + function parseSignature(kind: SyntaxKind, returnToken: SyntaxKind): ParsedSignature { + if (kind === SyntaxKind.ConstructSignature) { + parseExpected(SyntaxKind.NewKeyword); + } + var typeParameters = parseTypeParameters(); + var parameters = parseParameterList(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken); + checkParameterList(parameters); + var type = parseOptional(returnToken) ? parseType() : undefined; + return { + typeParameters: typeParameters, + parameters: parameters, + type: type + }; + } + + // Because we use this for index signatures as well, we sometimes use + // parentheses, and sometimes use brackets. + function parseParameterList(startDelimiter: SyntaxKind, endDelimiter: SyntaxKind) { + return parseBracketedList(ParsingContext.Parameters, parseParameter, startDelimiter, endDelimiter, /*allowTrailingSeparator*/ false); + } + + function checkParameterList(parameters: NodeArray): void { + var seenOptionalParameter = false; + var parameterCount = parameters.length; + + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + + if (parameter.flags & NodeFlags.Rest) { + if (i !== (parameterCount - 1)) { + grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + return; + } + + if (parameter.flags & NodeFlags.QuestionMark) { + grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_be_optional); + return; + } + + if (parameter.initializer) { + grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); + return; + } + } + else if (parameter.flags & NodeFlags.QuestionMark || parameter.initializer) { + seenOptionalParameter = true; + + if (parameter.flags & NodeFlags.QuestionMark && parameter.initializer) { + grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + return; + } + } + else { + if (seenOptionalParameter) { + grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + return; + } + } + } + } + + function parseSignatureMember(kind: SyntaxKind, returnToken: SyntaxKind): SignatureDeclaration { + var node = createNode(kind); + var sig = parseSignature(kind, returnToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + parseSemicolon(); + return finishNode(node); + } + + function parseIndexSignatureMember(): SignatureDeclaration { + var node = createNode(SyntaxKind.IndexSignature); + var errorCountBeforeIndexSignature = file.syntacticErrors.length; + var indexerStart = scanner.getTokenPos(); + node.parameters = parseParameterList(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); + var indexerLength = scanner.getStartPos() - indexerStart; + node.type = parseTypeAnnotation(); + parseSemicolon(); + if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { + checkIndexSignature(node, indexerStart, indexerLength); + } + return finishNode(node); + } + + function checkIndexSignature(node: SignatureDeclaration, indexerStart: number, indexerLength: number): boolean { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + var arityDiagnostic = Diagnostics.An_index_signature_must_have_exactly_one_parameter + if (parameter) { + grammarErrorOnNode(parameter.name, arityDiagnostic); + } + else { + grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); + } + return; + } + else if (parameter.flags & NodeFlags.Rest) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + return; + } + else if (parameter.flags & NodeFlags.Modifier) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + return; + } + else if (parameter.flags & NodeFlags.QuestionMark) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + return; + } + else if (parameter.initializer) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + return; + } + else if (!parameter.type) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + return; + } + else if (parameter.type.kind !== SyntaxKind.StringKeyword && + parameter.type.kind !== SyntaxKind.NumberKeyword) { + grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + return; + } + else if (!node.type) { + grammarErrorAtPos(indexerStart, indexerLength, Diagnostics.An_index_signature_must_have_a_type_annotation); + return; + } + } + + function parsePropertyOrMethod(): Declaration { + var node = createNode(SyntaxKind.Unknown); + node.name = parsePropertyName(); + if (parseOptional(SyntaxKind.QuestionToken)) { + node.flags |= NodeFlags.QuestionMark; + } + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + node.kind = SyntaxKind.Method; + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + (node).typeParameters = sig.typeParameters; + (node).parameters = sig.parameters; + (node).type = sig.type; + } + else { + node.kind = SyntaxKind.Property; + (node).type = parseTypeAnnotation(); + } + parseSemicolon(); + return finishNode(node); + } + + function isTypeMember(): boolean { + switch (token) { + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.OpenBracketToken: + return true; + default: + return isPropertyName() && lookAhead(() => nextToken() === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken || token === SyntaxKind.QuestionToken || + token === SyntaxKind.ColonToken || canParseSemicolon()); + } + } + + function parseTypeMember(): Declaration { + switch (token) { + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + return parseSignatureMember(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + case SyntaxKind.OpenBracketToken: + return parseIndexSignatureMember(); + case SyntaxKind.NewKeyword: + if (lookAhead(() => nextToken() === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken)) { + return parseSignatureMember(SyntaxKind.ConstructSignature, SyntaxKind.ColonToken); + } + case SyntaxKind.StringLiteral: + case SyntaxKind.NumericLiteral: + return parsePropertyOrMethod(); + default: + if (token >= SyntaxKind.Identifier) { + return parsePropertyOrMethod(); + } + } + } + + function parseTypeLiteral(): TypeLiteralNode { + var node = createNode(SyntaxKind.TypeLiteral); + if (parseExpected(SyntaxKind.OpenBraceToken)) { + node.members = parseList(ParsingContext.TypeMembers, parseTypeMember); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + + function parseFunctionType(signatureKind: SyntaxKind): TypeLiteralNode { + var node = createNode(SyntaxKind.TypeLiteral); + var member = createNode(signatureKind); + var sig = parseSignature(signatureKind, SyntaxKind.EqualsGreaterThanToken); + member.typeParameters = sig.typeParameters; + member.parameters = sig.parameters; + member.type = sig.type; + finishNode(member); + node.members = createNodeArray(member); + return finishNode(node); + } + + function parseKeywordAndNoDot(): Node { + var node = parseTokenNode(); + return token === SyntaxKind.DotToken ? undefined : node; + } + + function parseNonArrayType(): TypeNode { + switch (token) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.VoidKeyword: + var node = tryParse(parseKeywordAndNoDot); + return node || parseTypeReference(); + case SyntaxKind.TypeOfKeyword: + return parseTypeQuery(); + case SyntaxKind.OpenBraceToken: + return parseTypeLiteral(); + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + return parseFunctionType(SyntaxKind.CallSignature); + case SyntaxKind.NewKeyword: + return parseFunctionType(SyntaxKind.ConstructSignature); + default: + if (isIdentifier()) { + return parseTypeReference(); + } + } + error(Diagnostics.Type_expected); + return createMissingNode(); + } + + function isType(): boolean { + switch (token) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.OpenBraceToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.NewKeyword: + return true; + case SyntaxKind.OpenParenToken: + // Only consider an ( as the start of a type if we have () or (id + // We don't want to consider things like (1) as a function type. + return lookAhead(() => { + nextToken(); + return token === SyntaxKind.CloseParenToken || isParameter(); + }); + default: + return isIdentifier(); + } + } + + function parseType(): TypeNode { + var type = parseNonArrayType(); + while (type && !scanner.hasPrecedingLineBreak() && parseOptional(SyntaxKind.OpenBracketToken)) { + parseExpected(SyntaxKind.CloseBracketToken); + var node = createNode(SyntaxKind.ArrayType, type.pos); + node.elementType = type; + type = finishNode(node); + } + return type; + } + + function parseTypeAnnotation(): TypeNode { + return parseOptional(SyntaxKind.ColonToken) ? parseType() : undefined; + } + + // EXPRESSIONS + + function isExpression(): boolean { + switch (token) { + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.OpenParenToken: + case SyntaxKind.OpenBracketToken: + case SyntaxKind.OpenBraceToken: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.NewKeyword: + case SyntaxKind.SlashToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.DeleteKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.Identifier: + return true; + default: + return isIdentifier(); + } + } + + function parseExpression(noIn?: boolean): Expression { + var expr = parseAssignmentExpression(noIn); + while (parseOptional(SyntaxKind.CommaToken)) { + expr = makeBinaryExpression(expr, SyntaxKind.CommaToken, parseAssignmentExpression(noIn)); + } + return expr; + } + + function parseInitializer(inParameter: boolean, noIn?: boolean): Expression { + if (token !== SyntaxKind.EqualsToken) { + // It's not uncommon during typing for the user to miss writing the '=' token. Check if + // there is no newline after the last token and if we're on an expression. If so, parse + // this as an equals-value clause with a missing equals. + // NOTE: There are two places where we allow equals-value clauses. The first is in a + // variable declarator. The second is with a parameter. For variable declarators + // it's more likely that a { would be a allowed (as an object literal). While this + // is also allowed for parameters, the risk is that we consume the { as an object + // literal when it really will be for the block following the parameter. + if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isExpression()) { + // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - + // do not try to parse initializer + return undefined; + } + } + + parseExpected(SyntaxKind.EqualsToken); + return parseAssignmentExpression(noIn); + } + + function parseAssignmentExpression(noIn?: boolean): Expression { + // Augmented by TypeScript: + // + // AssignmentExpression[in]: + // 1) ConditionalExpression[in] + // 2) LeftHandSideExpression = AssignmentExpression[in] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[in] + // 4) ArrowFunctionExpression <-- added by TypeScript + // + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // (i.e. they're both BinaryExpressions with an assignment operator in it). + + // First, check if we have production '4' (an arrow function). Note that if we do, we + // must *not* recurse for productsion 1, 2 or 3. An ArrowFunction is not a + // LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // with AssignmentExpression if we see one. + var arrowExpression = tryParseArrowFunctionExpression(); + if (arrowExpression) { + return arrowExpression; + } + + // Now try to handle the rest of the cases. First, see if we can parse out up to and + // including a conditional expression. + var expr = parseConditionalExpression(noIn); + + // Now see if we might be in cases '2' or '3'. + // If the expression was a LHS expression, and we have an assignment operator, then + // we're in '2' or '3'. Consume the assignement and return. + if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { + var operator = token; + nextToken(); + return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); + } + + // otherwise this was production '1'. Return whatever we parsed so far. + return expr; + } + + function isLeftHandSideExpression(expr: Expression): boolean { + if (expr) { + switch (expr.kind) { + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ParenExpression: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Identifier: + case SyntaxKind.Missing: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.SuperKeyword: + return true; + } + } + + return false; + } + + function tryParseArrowFunctionExpression(): Expression { + return isSimpleArrowFunctionExpression() + ? parseSimpleArrowFunctionExpression() + : tryParseParenthesizedArrowFunctionExpression(); + } + + function isSimpleArrowFunctionExpression(): boolean { + if (token === SyntaxKind.EqualsGreaterThanToken) { + // ERROR RECOVERY TWEAK: + // If we see a standalone => try to parse it as an arrow function expression as that's + // likely whatthe user intended to write. + return true; + } + + if (token === SyntaxKind.Identifier) { + // if we see: a => + // then this is clearly an arrow function expression. + return lookAhead(() => { + return nextToken() === SyntaxKind.EqualsGreaterThanToken; + }); + } + + // Definitely not a simple arrow function expression. + return false; + } + + function parseSimpleArrowFunctionExpression(): Expression { + Debug.assert(token === SyntaxKind.Identifier || token === SyntaxKind.EqualsGreaterThanToken); + + // Get the identifier for the simple arrow. If one isn't there then we'll report a useful + // message that it is missing. + var identifier = parseIdentifier(); + + Debug.assert(token === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(SyntaxKind.EqualsGreaterThanToken); + + var parameter = createNode(SyntaxKind.Parameter, identifier.pos); + parameter.name = identifier; + finishNode(parameter); + + var signature = { parameters: [parameter] }; + + return parseArrowExpressionTail(identifier.pos, signature, /*noIn:*/ false); + } + + function tryParseParenthesizedArrowFunctionExpression(): Expression { + var pos = getNodePos(); + + // Note isParenthesizedArrowFunctionExpression returns true, false or undefined. + var triState = isParenthesizedArrowFunctionExpression(); + if (triState !== false) { + // If we *definitely* had an arrow function expression, then just parse one out. + // Otherwise we *maybe* had an arrow function and we need to *try* to parse it out + // (which will ensure we rollback if we fail). + var sig = triState === true + ? parseSignatureAndArrow() + : tryParse(parseSignatureAndArrow); + + // If we got a signature, we're good to go. consume the rest of this arrow function. + if (sig) { + return parseArrowExpressionTail(pos, sig, /*noIn:*/ false); + } + } + + // Was not a parenthesized arrow function. + return undefined; + } + + // Note: this function returns a tristate: + // + // true -> there is definitely a parenthesized arrow function here. + // false -> there is definitely *not* a parenthesized arrow function here. + // undefined -> there *might* be a parenthesized arrow function here. Speculatively + // look ahead to be sure. + function isParenthesizedArrowFunctionExpression(): boolean { + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + return lookAhead(() => { + var first = token; + nextToken(); + if (first === SyntaxKind.OpenParenToken) { + if (token === SyntaxKind.CloseParenToken || token === SyntaxKind.DotDotDotToken) { + // Simple cases. if we see () or (... then presume that presume + // that this must be an arrow function. Note, this may be too aggressive + // for the "()" case. It's not uncommon for this to appear while editing + // code. We should look to see if there's actually a => before proceeding. + return true; + } + + if (!isIdentifier()) { + // We had "(" not followed by an identifier. This definitely doesn't + // look like a lambda. Note: we could be a little more lenient and allow + // (public or (private. These would not ever actually be allowed, + // but we could provide a good error message instead of bailing out. + return false; + } + + // This *could* be a parenthesized arrow function. Return 'undefined' to let + // the caller know. + return undefined; + } + else { + Debug.assert(first === SyntaxKind.LessThanToken); + + // If we have "<" not followed by an identifier, then this definitely is not + // an arrow function. + if (!isIdentifier()) { + return false; + } + + // This *could* be a parenthesized arrow function. Return 'undefined' to let + // the caller know. + return undefined; + } + }); + } + + // Definitely not a parenthesized arrow function. + return false; + } + + function parseSignatureAndArrow(): ParsedSignature { + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + parseExpected(SyntaxKind.EqualsGreaterThanToken); + return sig; + } + + function parseArrowExpressionTail(pos: number, sig: ParsedSignature, noIn: boolean): FunctionExpression { + var body = token === SyntaxKind.OpenBraceToken ? parseBody() : parseAssignmentExpression(noIn); + return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, undefined, sig, body); + } + + function isAssignmentOperator(): boolean { + return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; + } + + function parseConditionalExpression(noIn?: boolean): Expression { + var expr = parseBinaryExpression(noIn); + while (parseOptional(SyntaxKind.QuestionToken)) { + var node = createNode(SyntaxKind.ConditionalExpression, expr.pos); + node.condition = expr; + node.whenTrue = parseAssignmentExpression(false); + parseExpected(SyntaxKind.ColonToken); + node.whenFalse = parseAssignmentExpression(noIn); + expr = finishNode(node); + } + return expr; + } + + function parseBinaryExpression(noIn?: boolean): Expression { + return parseBinaryOperators(parseUnaryExpression(), 0, noIn); + } + + function parseBinaryOperators(expr: Expression, minPrecedence: number, noIn?: boolean): Expression { + while (true) { + reScanGreaterToken(); + var precedence = getOperatorPrecedence(); + if (precedence && precedence > minPrecedence && (!noIn || token !== SyntaxKind.InKeyword)) { + var operator = token; + nextToken(); + expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); + continue; + } + return expr; + } + } + + function getOperatorPrecedence(): number { + switch (token) { + case SyntaxKind.BarBarToken: + return 1; + case SyntaxKind.AmpersandAmpersandToken: + return 2; + case SyntaxKind.BarToken: + return 3; + case SyntaxKind.CaretToken: + return 4; + case SyntaxKind.AmpersandToken: + return 5; + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + return 6; + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.InstanceOfKeyword: + case SyntaxKind.InKeyword: + return 7; + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + return 8; + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + return 9; + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + return 10; + } + return undefined; + } + + function makeBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression): BinaryExpression { + var node = createNode(SyntaxKind.BinaryExpression, left.pos); + node.left = left; + node.operator = operator; + node.right = right; + return finishNode(node); + } + + function parseUnaryExpression(): Expression { + var pos = getNodePos(); + switch (token) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.DeleteKeyword: + case SyntaxKind.TypeOfKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + var operator = token; + nextToken(); + var operand = parseUnaryExpression(); + return makeUnaryExpression(SyntaxKind.PrefixOperator, pos, operator, operand); + case SyntaxKind.LessThanToken: + return parseTypeAssertion(); + } + + var primaryExpression = parsePrimaryExpression(); + // TS 1.0 spec (2014): 4.8 + // CallExpression: ( Modified ) + // super ( ArgumentListopt ) + // super . IdentifierName + var illegalUsageOfSuperKeyword = + primaryExpression.kind === SyntaxKind.SuperKeyword && token !== SyntaxKind.OpenParenToken && token !== SyntaxKind.DotToken; + + if (illegalUsageOfSuperKeyword) { + error(Diagnostics.super_must_be_followed_by_argument_list_or_member_access); + } + + var expr = parseCallAndAccess(primaryExpression, /* inNewExpression */ false); + + Debug.assert(isLeftHandSideExpression(expr)); + if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { + var operator = token; + nextToken(); + expr = makeUnaryExpression(SyntaxKind.PostfixOperator, expr.pos, operator, expr); + } + + return expr; + } + + function parseTypeAssertion(): TypeAssertion { + var node = createNode(SyntaxKind.TypeAssertion); + parseExpected(SyntaxKind.LessThanToken); + node.type = parseType(); + parseExpected(SyntaxKind.GreaterThanToken); + node.operand = parseUnaryExpression(); + return finishNode(node); + } + + function makeUnaryExpression(kind: SyntaxKind, pos: number, operator: SyntaxKind, operand: Expression): UnaryExpression { + var node = createNode(kind, pos); + node.operator = operator; + node.operand = operand; + return finishNode(node); + } + + function parseCallAndAccess(expr: Expression, inNewExpression: boolean): Expression { + while (true) { + if (parseOptional(SyntaxKind.DotToken)) { + var propertyAccess = createNode(SyntaxKind.PropertyAccess, expr.pos); + propertyAccess.left = expr; + propertyAccess.right = parseIdentifierName(); + expr = finishNode(propertyAccess); + continue; + } + + var bracketStart = scanner.getTokenPos(); + if (parseOptional(SyntaxKind.OpenBracketToken)) { + + var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); + indexedAccess.object = expr; + + // It's not uncommon for a user to write: "new Type[]". Check for that common pattern + // and report a better error message. + if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { + indexedAccess.index = createMissingNode(); + grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + // Otherwise parse the indexed access normally. + else { + indexedAccess.index = parseExpression(); + parseExpected(SyntaxKind.CloseBracketToken); + } + + expr = finishNode(indexedAccess); + continue; + } + + // Try to parse a Call Expression unless we are in a New Expression. + // If we are parsing a New Expression, then parentheses are optional, + // and is taken care of by the 'parseNewExpression' caller. + if ((token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) && !inNewExpression) { + var callExpr = createNode(SyntaxKind.CallExpression, expr.pos); + callExpr.func = expr; + if (token === SyntaxKind.LessThanToken) { + if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; + } + else { + parseExpected(SyntaxKind.OpenParenToken); + } + callExpr.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseAssignmentExpression, /*allowTrailingSeparator*/ false); + parseExpected(SyntaxKind.CloseParenToken); + expr = finishNode(callExpr); + continue; + } + return expr; + } + } + + function parseTypeArgumentsAndOpenParen(): NodeArray { + var result = parseTypeArguments(); + parseExpected(SyntaxKind.OpenParenToken); + return result; + } + + function parseTypeArguments(): NodeArray { + var typeArgumentListStart = scanner.getTokenPos(); + var errorCountBeforeTypeParameterList = file.syntacticErrors.length; + var result = parseBracketedList(ParsingContext.TypeArguments, parseType, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken, /*allowTrailingSeparator*/ false); + if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { + grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, Diagnostics.Type_argument_list_cannot_be_empty); + } + return result; + } + + function parsePrimaryExpression(): Expression { + switch (token) { + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + return parseTokenNode(); + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + return parseLiteralNode(); + case SyntaxKind.OpenParenToken: + return parseParenExpression(); + case SyntaxKind.OpenBracketToken: + return parseArrayLiteral(); + case SyntaxKind.OpenBraceToken: + return parseObjectLiteral(); + case SyntaxKind.FunctionKeyword: + return parseFunctionExpression(); + case SyntaxKind.NewKeyword: + return parseNewExpression(); + case SyntaxKind.SlashToken: + case SyntaxKind.SlashEqualsToken: + if (reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { + return parseLiteralNode(); + } + break; + default: + if (isIdentifier()) { + return parseIdentifier(); + } + } + error(Diagnostics.Expression_expected); + return createMissingNode(); + } + + function parseParenExpression(): ParenExpression { + var node = createNode(SyntaxKind.ParenExpression); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + return finishNode(node); + } + + function parseArrayLiteralElement(): Expression { + return token === SyntaxKind.CommaToken ? createNode(SyntaxKind.OmittedExpression) : parseAssignmentExpression(); + } + + function parseArrayLiteral(): ArrayLiteral { + var node = createNode(SyntaxKind.ArrayLiteral); + parseExpected(SyntaxKind.OpenBracketToken); + if (scanner.hasPrecedingLineBreak()) node.flags |= NodeFlags.MultiLine; + node.elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArrayLiteralElement, /*allowTrailingSeparator*/ true); + parseExpected(SyntaxKind.CloseBracketToken); + return finishNode(node); + } + + function parsePropertyAssignment(): PropertyDeclaration { + var node = createNode(SyntaxKind.PropertyAssignment); + node.name = parsePropertyName(); + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + var body = parseBody(); + node.initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, node.name, sig, body); + } + else { + parseExpected(SyntaxKind.ColonToken); + node.initializer = parseAssignmentExpression(false); + } + return finishNode(node); + } + + function parseObjectLiteralMember(): Node { + var initialPos = getNodePos(); + var initialToken = token; + if (parseContextualModifier(SyntaxKind.GetKeyword) || parseContextualModifier(SyntaxKind.SetKeyword)) { + var kind = initialToken === SyntaxKind.GetKeyword ? SyntaxKind.GetAccessor : SyntaxKind.SetAccessor; + return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + } + return parsePropertyAssignment(); + } + + function parseObjectLiteral(): ObjectLiteral { + var node = createNode(SyntaxKind.ObjectLiteral); + parseExpected(SyntaxKind.OpenBraceToken); + if (scanner.hasPrecedingLineBreak()) node.flags |= NodeFlags.MultiLine; + node.properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralMember, /*allowTrailingSeparator*/ true); + parseExpected(SyntaxKind.CloseBraceToken); + return finishNode(node); + } + + function parseFunctionExpression(): FunctionExpression { + var pos = getNodePos(); + parseExpected(SyntaxKind.FunctionKeyword); + var name = isIdentifier() ? parseIdentifier() : undefined; + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + var body = parseBody(); + return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); + } + + function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node) { + var node = createNode(kind, pos); + node.name = name; + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = body; + return finishNode(node); + } + + function parseNewExpression(): NewExpression { + var node = createNode(SyntaxKind.NewExpression); + parseExpected(SyntaxKind.NewKeyword); + node.func = parseCallAndAccess(parsePrimaryExpression(), /* inNewExpression */ true); + if (parseOptional(SyntaxKind.OpenParenToken) || token === SyntaxKind.LessThanToken && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + node.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseAssignmentExpression, /*allowTrailingSeparator*/ false); + parseExpected(SyntaxKind.CloseParenToken); + } + return finishNode(node); + } + + // STATEMENTS + + function parseBlock(): Block { + var node = createNode(SyntaxKind.Block); + if (parseExpected(SyntaxKind.OpenBraceToken)) { + node.statements = parseList(ParsingContext.BlockStatements, parseStatement); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + + function parseBody(): Block { + var block = parseBlock(); + block.kind = SyntaxKind.FunctionBlock; + return block; + } + + function parseEmptyStatement(): Statement { + var node = createNode(SyntaxKind.EmptyStatement); + parseExpected(SyntaxKind.SemicolonToken); + return finishNode(node); + } + + function parseIfStatement(): IfStatement { + var node = createNode(SyntaxKind.IfStatement); + parseExpected(SyntaxKind.IfKeyword); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(SyntaxKind.ElseKeyword) ? parseStatement() : undefined; + return finishNode(node); + } + + function parseDoStatement(): DoStatement { + var node = createNode(SyntaxKind.DoStatement); + parseExpected(SyntaxKind.DoKeyword); + node.statement = parseStatement(); + parseExpected(SyntaxKind.WhileKeyword); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + + // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html + // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in + // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby + // do;while(0)x will have a semicolon inserted before x. + parseOptional(SyntaxKind.SemicolonToken); + return finishNode(node); + } + + function parseWhileStatement(): WhileStatement { + var node = createNode(SyntaxKind.WhileStatement); + parseExpected(SyntaxKind.WhileKeyword); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + node.statement = parseStatement(); + return finishNode(node); + } + + function parseForOrForInStatement(): Statement { + var pos = getNodePos(); + parseExpected(SyntaxKind.ForKeyword); + parseExpected(SyntaxKind.OpenParenToken); + if (token !== SyntaxKind.SemicolonToken) { + if (parseOptional(SyntaxKind.VarKeyword)) { + var declarations = parseVariableDeclarationList(0, true); + if (!declarations.length) { + error(Diagnostics.Variable_declaration_list_cannot_be_empty); + } + } + else { + var varOrInit = parseExpression(true); + } + } + if (parseOptional(SyntaxKind.InKeyword)) { + var forInStat = createNode(SyntaxKind.ForInStatement, pos); + if (declarations) { + if (declarations.length > 1) { + error(Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + forInStat.declaration = declarations[0]; + } + else { + forInStat.variable = varOrInit; + } + forInStat.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + forInStat.statement = parseStatement(); + return finishNode(forInStat); + } + else { + var forStat = createNode(SyntaxKind.ForStatement, pos); + if (declarations) forStat.declarations = declarations; + if (varOrInit) forStat.initializer = varOrInit; + parseExpected(SyntaxKind.SemicolonToken); + if (token !== SyntaxKind.SemicolonToken && token !== SyntaxKind.CloseParenToken) { + forStat.condition = parseExpression(); + } + parseExpected(SyntaxKind.SemicolonToken); + if (token !== SyntaxKind.CloseParenToken) { + forStat.iterator = parseExpression(); + } + parseExpected(SyntaxKind.CloseParenToken); + forStat.statement = parseStatement(); + return finishNode(forStat); + } + } + + function parseBreakOrContinueStatement(kind: SyntaxKind): BreakOrContinueStatement { + var node = createNode(kind); + parseExpected(kind === SyntaxKind.BreakStatement ? SyntaxKind.BreakKeyword : SyntaxKind.ContinueKeyword); + if (!isSemicolon()) node.label = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + + function parseReturnStatement(): ReturnStatement { + var node = createNode(SyntaxKind.ReturnStatement); + parseExpected(SyntaxKind.ReturnKeyword); + if (!isSemicolon()) node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + + function parseWithStatement(): WithStatement { + var node = createNode(SyntaxKind.WithStatement); + parseExpected(SyntaxKind.WithKeyword); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + node.statement = parseStatement(); + return finishNode(node); + } + + function parseCaseClause(): CaseOrDefaultClause { + var node = createNode(SyntaxKind.CaseClause); + parseExpected(SyntaxKind.CaseKeyword); + node.expression = parseExpression(); + parseExpected(SyntaxKind.ColonToken); + node.statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + return finishNode(node); + } + + function parseDefaultClause(): CaseOrDefaultClause { + var node = createNode(SyntaxKind.DefaultClause); + parseExpected(SyntaxKind.DefaultKeyword); + parseExpected(SyntaxKind.ColonToken); + node.statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); + return finishNode(node); + } + + function parseCaseOrDefaultClause(): CaseOrDefaultClause { + return token === SyntaxKind.CaseKeyword ? parseCaseClause() : parseDefaultClause(); + } + + function parseSwitchStatement(): SwitchStatement { + var node = createNode(SyntaxKind.SwitchStatement); + parseExpected(SyntaxKind.SwitchKeyword); + parseExpected(SyntaxKind.OpenParenToken); + node.expression = parseExpression(); + parseExpected(SyntaxKind.CloseParenToken); + parseExpected(SyntaxKind.OpenBraceToken); + node.clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); + parseExpected(SyntaxKind.CloseBraceToken); + return finishNode(node); + } + + function parseThrowStatement(): ThrowStatement { + var node = createNode(SyntaxKind.ThrowStatement); + parseExpected(SyntaxKind.ThrowKeyword); + if (scanner.hasPrecedingLineBreak()) { + error(Diagnostics.Line_break_not_permitted_here); + } + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + + // TODO: Review for error recovery + function parseTryStatement(): TryStatement { + var node = createNode(SyntaxKind.TryStatement); + node.tryBlock = parseTokenAndBlock(SyntaxKind.TryKeyword, SyntaxKind.TryBlock); + if (token === SyntaxKind.CatchKeyword) { + node.catchBlock = parseCatchBlock(); + } + if (token === SyntaxKind.FinallyKeyword) { + node.finallyBlock = parseTokenAndBlock(SyntaxKind.FinallyKeyword, SyntaxKind.FinallyBlock); + } + if (!(node.catchBlock || node.finallyBlock)) { + error(Diagnostics.catch_or_finally_expected); + } + return finishNode(node); + } + + function parseTokenAndBlock(token: SyntaxKind, kind: SyntaxKind): Block { + var pos = getNodePos(); + parseExpected(token); + var result = parseBlock(); + result.kind = kind; + result.pos = pos; + return result; + } + + function parseCatchBlock(): CatchBlock { + var pos = getNodePos(); + parseExpected(SyntaxKind.CatchKeyword); + parseExpected(SyntaxKind.OpenParenToken); + var variable = parseIdentifier(); + var typeAnnotationColonStart = scanner.getTokenPos(); + var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; + var typeAnnotation = parseTypeAnnotation(); + parseExpected(SyntaxKind.CloseParenToken); + var result = parseBlock(); + result.kind = SyntaxKind.CatchBlock; + result.pos = pos; + result.variable = variable; + + if (typeAnnotation) { + errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + return result; + } + + function parseDebuggerStatement(): Statement { + var node = createNode(SyntaxKind.DebuggerStatement); + parseExpected(SyntaxKind.DebuggerKeyword); + parseSemicolon(); + return finishNode(node); + } + + function parseLabelledStatement(): LabelledStatement { + var node = createNode(SyntaxKind.LabelledStatement); + node.label = parseIdentifier(); + parseExpected(SyntaxKind.ColonToken); + node.statement = parseStatement(); + return finishNode(node); + } + + function parseExpressionStatement(): ExpressionStatement { + var node = createNode(SyntaxKind.ExpressionStatement); + node.expression = parseExpression(); + parseSemicolon(); + return finishNode(node); + } + + function isStatement(): boolean { + switch (token) { + case SyntaxKind.OpenBraceToken: + case SyntaxKind.VarKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.SemicolonToken: + case SyntaxKind.IfKeyword: + case SyntaxKind.DoKeyword: + case SyntaxKind.WhileKeyword: + case SyntaxKind.ForKeyword: + case SyntaxKind.ContinueKeyword: + case SyntaxKind.BreakKeyword: + case SyntaxKind.ReturnKeyword: + case SyntaxKind.WithKeyword: + case SyntaxKind.SwitchKeyword: + case SyntaxKind.ThrowKeyword: + case SyntaxKind.TryKeyword: + case SyntaxKind.DebuggerKeyword: + return true; + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.ClassKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.EnumKeyword: + // When followed by an identifier, these do not start a statement but might + // instead be following declarations + if (isDeclaration()) return false; + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + // When followed by an identifier or keyword, these do not start a statement but + // might instead be following type members + if (lookAhead(() => nextToken() >= SyntaxKind.Identifier)) return false; + default: + return isExpression(); + } + } + + function isStatementOrFunction(): boolean { + return token === SyntaxKind.FunctionKeyword || isStatement(); + } + + function parseStatement(): Statement { + switch (token) { + case SyntaxKind.OpenBraceToken: + return parseBlock(); + case SyntaxKind.VarKeyword: + return parseVariableStatement(); + case SyntaxKind.FunctionKeyword: + return parseFunctionDeclaration(); + case SyntaxKind.SemicolonToken: + return parseEmptyStatement(); + case SyntaxKind.IfKeyword: + return parseIfStatement(); + case SyntaxKind.DoKeyword: + return parseDoStatement(); + case SyntaxKind.WhileKeyword: + return parseWhileStatement(); + case SyntaxKind.ForKeyword: + return parseForOrForInStatement(); + case SyntaxKind.ContinueKeyword: + return parseBreakOrContinueStatement(SyntaxKind.ContinueStatement); + case SyntaxKind.BreakKeyword: + return parseBreakOrContinueStatement(SyntaxKind.BreakStatement); + case SyntaxKind.ReturnKeyword: + return parseReturnStatement(); + case SyntaxKind.WithKeyword: + return parseWithStatement(); + case SyntaxKind.SwitchKeyword: + return parseSwitchStatement(); + case SyntaxKind.ThrowKeyword: + return parseThrowStatement(); + case SyntaxKind.TryKeyword: + return parseTryStatement(); + case SyntaxKind.DebuggerKeyword: + return parseDebuggerStatement(); + default: + if (isIdentifier() && lookAhead(() => nextToken() === SyntaxKind.ColonToken)) { + return parseLabelledStatement(); + } + return parseExpressionStatement(); + } + } + + function parseStatementOrFunction(): Statement { + return token === SyntaxKind.FunctionKeyword ? parseFunctionDeclaration() : parseStatement(); + } + + function parseAndCheckFunctionBody(isConstructor: boolean): Block { + var initialPosition = scanner.getTokenPos(); + var errorCountBeforeBody = file.syntacticErrors.length; + if (token === SyntaxKind.OpenBraceToken) { + var body = parseBody(); + if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { + var diagnostic = isConstructor ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + grammarErrorAtPos(initialPosition, 1, diagnostic); + } + return body; + } + if (isSemicolon()) { + parseSemicolon(); + return undefined; + } + error(Diagnostics.Block_or_expected); // block or ';' expected + } + + // DECLARATIONS + + function parseVariableDeclaration(flags: NodeFlags, noIn?: boolean): VariableDeclaration { + var node = createNode(SyntaxKind.VariableDeclaration); + node.flags = flags; + var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; + node.name = parseIdentifier(); + node.type = parseTypeAnnotation(); + + // Issue any initializer-related errors on the equals token + var initializerStart = scanner.getTokenPos(); + var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; + node.initializer = parseInitializer(/*inParameter*/ false, noIn); + + if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { + grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + return finishNode(node); + } + + function parseVariableDeclarationList(flags: NodeFlags, noIn?: boolean): NodeArray { + return parseDelimitedList(ParsingContext.VariableDeclarations, () => parseVariableDeclaration(flags, noIn), /*allowTrailingSeparator*/ false); + } + + function parseVariableStatement(pos?: number, flags?: NodeFlags): VariableStatement { + var node = createNode(SyntaxKind.VariableStatement, pos); + if (flags) node.flags = flags; + var errorCountBeforeVarStatement = file.syntacticErrors.length; + parseExpected(SyntaxKind.VarKeyword); + node.declarations = parseVariableDeclarationList(flags, /*noIn*/false); + parseSemicolon(); + if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { + grammarErrorOnNode(node, Diagnostics.Variable_declaration_list_cannot_be_empty); + } + return finishNode(node); + } + + function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionDeclaration { + var node = createNode(SyntaxKind.FunctionDeclaration, pos); + if (flags) node.flags = flags; + parseExpected(SyntaxKind.FunctionKeyword); + node.name = parseIdentifier(); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(/*isConstructor*/ false); + return finishNode(node); + } + + function parseConstructorDeclaration(pos: number, flags: NodeFlags): ConstructorDeclaration { + var node = createNode(SyntaxKind.Constructor, pos); + node.flags = flags; + parseExpected(SyntaxKind.ConstructorKeyword); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseAndCheckFunctionBody(/*isConstructor*/ true); + if (node.typeParameters) { + grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + if (node.type) { + grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + return finishNode(node); + } + + function parsePropertyMemberDeclaration(pos: number, flags: NodeFlags): Declaration { + var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; + var name = parsePropertyName(); + + var questionStart = scanner.getTokenPos(); + if (parseOptional(SyntaxKind.QuestionToken)) { + errorAtPos(questionStart, scanner.getStartPos() - questionStart, Diagnostics.A_class_member_cannot_be_declared_optional); + } + + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + var method = createNode(SyntaxKind.Method, pos); + method.flags = flags; + method.name = name; + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + method.typeParameters = sig.typeParameters; + method.parameters = sig.parameters; + method.type = sig.type; + method.body = parseAndCheckFunctionBody(/*isConstructor*/ false); + return finishNode(method); + } + else { + var property = createNode(SyntaxKind.Property, pos); + property.flags = flags; + property.name = name; + property.type = parseTypeAnnotation(); + + var initializerStart = scanner.getTokenPos(); + var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; + property.initializer = parseInitializer(/*inParameter*/ false); + parseSemicolon(); + + if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { + grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + return finishNode(property); + } + } + + function parseAndCheckMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { + var errorCountBeforeAccessor = file.syntacticErrors.length; + var accessor = parseMemberAccessorDeclaration(kind, pos, flags); + + if (errorCountBeforeAccessor === file.syntacticErrors.length) { + if (languageVersion < ScriptTarget.ES5) { + grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.typeParameters) { + grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { + grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === SyntaxKind.SetAccessor) { + if (accessor.type) { + grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & NodeFlags.Rest) { + grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & NodeFlags.QuestionMark) { + grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + return accessor; + } + + function parseMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { + var node = createNode(kind, pos); + node.flags = flags; + node.name = parsePropertyName(); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken); + node.typeParameters = sig.typeParameters; + node.parameters = sig.parameters; + node.type = sig.type; + node.body = parseBody(); + return finishNode(node); + } + + function isClassMemberStart(): boolean { + var idToken: SyntaxKind; + + // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. + while (isModifier(token)) { + idToken = token; + nextToken(); + } + + // Try to get the first property-like token following all modifiers. + // This can either be an identifier or the 'get' or 'set' keywords. + if (isPropertyName()) { + idToken = token; + nextToken(); + } + + // Index signatures are class members; we can parse. + if (token === SyntaxKind.OpenBracketToken) { + return true; + } + + // If we were able to get any potential identifier... + if (idToken !== undefined) { + // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. + if (!isKeyword(idToken) || idToken === SyntaxKind.SetKeyword || idToken === SyntaxKind.GetKeyword) { + return true; + } + + // If it *is* a keyword, but not an accessor, check a little farther along + // to see if it should actually be parsed as a class member. + switch (token) { + case SyntaxKind.OpenParenToken: // Method declaration + case SyntaxKind.LessThanToken: // Generic Method declaration + case SyntaxKind.ColonToken: // Type Annotation for declaration + case SyntaxKind.EqualsToken: // Initializer for declaration + case SyntaxKind.SemicolonToken: // Declaration termination + case SyntaxKind.CloseBraceToken: // End-of-class, must be declaration. + case SyntaxKind.EndOfFileToken: // Not valid, but permitted so that it gets caught later on. + case SyntaxKind.QuestionToken: // Not valid, but permitted so that it gets caught later on. + return true; + } + } + + return false; + } + + function parseAndCheckModifiers(context: ModifierContext): number { + var flags = 0; + var lastStaticModifierStart: number; + var lastStaticModifierLength: number; + var lastDeclareModifierStart: number; + var lastDeclareModifierLength: number + var lastPrivateModifierStart: number; + var lastPrivateModifierLength: number; + + while (true) { + var modifierStart = scanner.getTokenPos(); + var modifierToken = token; + + // Try to parse the modifier + if (!parseAnyContextualModifier()) break; + + var modifierLength = scanner.getStartPos() - modifierStart; + + switch (modifierToken) { + case SyntaxKind.PublicKeyword: + if (flags & NodeFlags.Private || flags & NodeFlags.Public) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & NodeFlags.Static) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); + } + else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); + } + flags |= NodeFlags.Public; + break; + + case SyntaxKind.PrivateKeyword: + if (flags & NodeFlags.Private || flags & NodeFlags.Public) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & NodeFlags.Static) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); + } + else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); + } + lastPrivateModifierStart = modifierStart; + lastPrivateModifierLength = modifierLength; + flags |= NodeFlags.Private; + break; + + case SyntaxKind.StaticKeyword: + if (flags & NodeFlags.Static) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "static"); + } + else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (context === ModifierContext.Parameters) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + lastStaticModifierStart = modifierStart; + lastStaticModifierLength = modifierLength; + flags |= NodeFlags.Static; + break; + + case SyntaxKind.ExportKeyword: + if (flags & NodeFlags.Export) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & NodeFlags.Ambient) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (context === ModifierContext.ClassMembers) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (context === ModifierContext.Parameters) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= NodeFlags.Export; + break; + + case SyntaxKind.DeclareKeyword: + if (flags & NodeFlags.Ambient) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "declare"); + } + else if (context === ModifierContext.ClassMembers) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (context === ModifierContext.Parameters) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && context === ModifierContext.ModuleElements) { + grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + lastDeclareModifierStart = modifierStart; + lastDeclareModifierLength = modifierLength; + flags |= NodeFlags.Ambient; + break; + } + } + + if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Static) { + grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Private) { + grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + else if (token === SyntaxKind.ImportKeyword) { + if (flags & NodeFlags.Ambient) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + } + else if (token === SyntaxKind.InterfaceKeyword) { + if (flags & NodeFlags.Ambient) { + grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + else if (token !== SyntaxKind.ExportKeyword && !(flags & NodeFlags.Ambient) && inAmbientContext && context === ModifierContext.SourceElements) { + // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: + // categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + var declarationStart = scanner.getTokenPos(); + var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; + grammarErrorAtPos(declarationStart, declarationFirstTokenLength, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + return flags; + } + + function parseClassMemberDeclaration(): Declaration { + var pos = getNodePos(); + var flags = parseAndCheckModifiers(ModifierContext.ClassMembers); + if (parseContextualModifier(SyntaxKind.GetKeyword)) { + return parseAndCheckMemberAccessorDeclaration(SyntaxKind.GetAccessor, pos, flags); + } + if (parseContextualModifier(SyntaxKind.SetKeyword)) { + return parseAndCheckMemberAccessorDeclaration(SyntaxKind.SetAccessor, pos, flags); + } + if (token === SyntaxKind.ConstructorKeyword) { + return parseConstructorDeclaration(pos, flags); + } + if (token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral) { + return parsePropertyMemberDeclaration(pos, flags); + } + if (token === SyntaxKind.OpenBracketToken) { + if (flags) { + var start = getTokenPos(pos); + var length = getNodePos() - start; + errorAtPos(start, length, Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + return parseIndexSignatureMember(); + } + + // 'isClassMemberStart' should have hinted not to attempt parsing. + Debug.fail("Should not have attempted to parse class member declaration."); + } + + function parseClassDeclaration(pos: number, flags: NodeFlags): ClassDeclaration { + var node = createNode(SyntaxKind.ClassDeclaration, pos); + node.flags = flags; + var errorCountBeforeClassDeclaration = file.syntacticErrors.length; + parseExpected(SyntaxKind.ClassKeyword); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates + node.baseType = parseOptional(SyntaxKind.ExtendsKeyword) ? parseTypeReference() : undefined; + var implementsKeywordStart = scanner.getTokenPos(); + var implementsKeywordLength: number; + if (parseOptional(SyntaxKind.ImplementsKeyword)) { + implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; + node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference, /*allowTrailingSeparator*/ false); + } + var errorCountBeforeClassBody = file.syntacticErrors.length; + if (parseExpected(SyntaxKind.OpenBraceToken)) { + node.members = parseList(ParsingContext.ClassMembers, parseClassMemberDeclaration); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + node.members = createMissingList(); + } + if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { + grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, Diagnostics._0_list_cannot_be_empty, "implements"); + } + return finishNode(node); + } + + function parseInterfaceDeclaration(pos: number, flags: NodeFlags): InterfaceDeclaration { + var node = createNode(SyntaxKind.InterfaceDeclaration, pos); + node.flags = flags; + var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; + parseExpected(SyntaxKind.InterfaceKeyword); + node.name = parseIdentifier(); + node.typeParameters = parseTypeParameters(); + // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates + var extendsKeywordStart = scanner.getTokenPos(); + var extendsKeywordLength: number; + if (parseOptional(SyntaxKind.ExtendsKeyword)) { + extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; + node.baseTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference, /*allowTrailingSeparator*/ false); + } + var errorCountBeforeInterfaceBody = file.syntacticErrors.length; + node.members = parseTypeLiteral().members; + if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { + grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, Diagnostics._0_list_cannot_be_empty, "extends"); + } + return finishNode(node); + } + + function parseAndCheckEnumDeclaration(pos: number, flags: NodeFlags): EnumDeclaration { + function isIntegerLiteral(expression: Expression): boolean { + function isInteger(literalExpression: LiteralExpression): boolean { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coersion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + + if (expression.kind === SyntaxKind.PrefixOperator) { + var unaryExpression = expression; + if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { + expression = unaryExpression.operand; + } + } + if (expression.kind === SyntaxKind.NumericLiteral) { + return isInteger(expression); + } + + return false; + } + + var inConstantEnumMemberSection = true; + // In an ambient declaration, the grammar only allows integer literals as initializers. + // In a nonambient declaration, the grammar allows uninitialized members only in a + // ConstantEnumMemberSection, which starts at the beginning of an enum declaration + // or any time an integer literal initializer is encountered. + function parseAndCheckEnumMember(): EnumMember { + var node = createNode(SyntaxKind.EnumMember); + var errorCountBeforeEnumMember = file.syntacticErrors.length; + node.name = parsePropertyName(); + node.initializer = parseInitializer(/*inParameter*/ false); + + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer); + } + return finishNode(node); + } + + var node = createNode(SyntaxKind.EnumDeclaration, pos); + node.flags = flags; + parseExpected(SyntaxKind.EnumKeyword); + node.name = parseIdentifier(); + if (parseExpected(SyntaxKind.OpenBraceToken)) { + node.members = parseDelimitedList(ParsingContext.EnumMembers, parseAndCheckEnumMember, /*allowTrailingSeparator*/ true); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + node.members = createMissingList(); + } + return finishNode(node); + } + + function parseModuleBody(): Block { + var node = createNode(SyntaxKind.ModuleBlock); + if (parseExpected(SyntaxKind.OpenBraceToken)) { + node.statements = parseList(ParsingContext.ModuleElements, parseModuleElement); + parseExpected(SyntaxKind.CloseBraceToken); + } + else { + node.statements = createMissingList(); + } + return finishNode(node); + } + + function parseInternalModuleTail(pos: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, pos); + node.flags = flags; + node.name = parseIdentifier(); + if (parseOptional(SyntaxKind.DotToken)) { + node.body = parseInternalModuleTail(getNodePos(), NodeFlags.Export); + } + else { + node.body = parseModuleBody(); + forEach((node.body).statements, s => { + if (s.kind === SyntaxKind.ExportAssignment) { + // Export assignments are not allowed in an internal module + grammarErrorOnNode(s, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (s.kind === SyntaxKind.ImportDeclaration && (s).externalModuleName) { + grammarErrorOnNode(s, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module) + } + }); + } + return finishNode(node); + } + + function parseAmbientExternalModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, pos); + node.flags = flags; + node.name = parseStringLiteral(); + + // For error recovery, just in case the user forgot the declare modifier on this ambient + // external module, treat it as ambient anyway. + var saveInAmbientContext = inAmbientContext; + inAmbientContext = true; + node.body = parseModuleBody(); + inAmbientContext = saveInAmbientContext; + return finishNode(node); + } + + function parseModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { + parseExpected(SyntaxKind.ModuleKeyword); + return token === SyntaxKind.StringLiteral ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + } + + function parseImportDeclaration(pos: number, flags: NodeFlags): ImportDeclaration { + var node = createNode(SyntaxKind.ImportDeclaration, pos); + node.flags = flags; + parseExpected(SyntaxKind.ImportKeyword); + node.name = parseIdentifier(); + parseExpected(SyntaxKind.EqualsToken); + var entityName = parseEntityName(); + if (entityName.kind === SyntaxKind.Identifier && (entityName).text === "require" && parseOptional(SyntaxKind.OpenParenToken)) { + node.externalModuleName = parseStringLiteral(); + parseExpected(SyntaxKind.CloseParenToken); + } + else { + node.entityName = entityName; + } + parseSemicolon(); + return finishNode(node); + } + + function parseExportAssignmentTail(pos: number): ExportAssignment { + var node = createNode(SyntaxKind.ExportAssignment, pos); + node.exportName = parseIdentifier(); + parseSemicolon(); + return finishNode(node); + } + + function isDeclaration() { + switch (token) { + case SyntaxKind.VarKeyword: + case SyntaxKind.FunctionKeyword: + return true; + case SyntaxKind.ClassKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.EnumKeyword: + case SyntaxKind.ImportKeyword: + // Not true keywords so ensure an identifier follows + return lookAhead(() => nextToken() >= SyntaxKind.Identifier); + case SyntaxKind.ModuleKeyword: + // Not a true keyword so ensure an identifier or string literal follows + return lookAhead(() => nextToken() >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral); + case SyntaxKind.ExportKeyword: + // Check for export assignment or modifier on source element + return lookAhead(() => nextToken() === SyntaxKind.EqualsToken || isDeclaration()); + case SyntaxKind.DeclareKeyword: + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + // Check for modifier on source element + return lookAhead(() => { nextToken(); return isDeclaration(); }); + } + } + + function parseDeclaration(modifierContext: ModifierContext): Statement { + var pos = getNodePos(); + var errorCountBeforeModifiers = file.syntacticErrors.length; + var flags = parseAndCheckModifiers(modifierContext); + + if (token === SyntaxKind.ExportKeyword) { + nextToken(); + if (parseOptional(SyntaxKind.EqualsToken)) { + return parseExportAssignmentTail(pos); + } + } + + var saveInAmbientContext = inAmbientContext; + if (flags & NodeFlags.Ambient) { + inAmbientContext = true; + } + + var result: Declaration; + switch (token) { + case SyntaxKind.VarKeyword: + result = parseVariableStatement(pos, flags); + break; + case SyntaxKind.FunctionKeyword: + result = parseFunctionDeclaration(pos, flags); + break; + case SyntaxKind.ClassKeyword: + result = parseClassDeclaration(pos, flags); + break; + case SyntaxKind.InterfaceKeyword: + result = parseInterfaceDeclaration(pos, flags); + break; + case SyntaxKind.EnumKeyword: + result = parseAndCheckEnumDeclaration(pos, flags); + break; + case SyntaxKind.ModuleKeyword: + result = parseModuleDeclaration(pos, flags); + break; + case SyntaxKind.ImportKeyword: + result = parseImportDeclaration(pos, flags); + break; + default: + error(Diagnostics.Declaration_expected); + } + + inAmbientContext = saveInAmbientContext; + return result; + } + + function isSourceElement(): boolean { + return isDeclaration() || isStatement(); + } + + function parseSourceElement() { + return parseSourceElementOrModuleElement(ModifierContext.SourceElements); + } + + function parseModuleElement() { + return parseSourceElementOrModuleElement(ModifierContext.ModuleElements); + } + + function parseSourceElementOrModuleElement(modifierContext: ModifierContext): Statement { + if (isDeclaration()) { + return parseDeclaration(modifierContext); + } + + var statementStart = scanner.getTokenPos(); + var statementFirstTokenLength = scanner.getTextPos() - statementStart; + var errorCountBeforeStatement = file.syntacticErrors.length; + var statement = parseStatement(); + + if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { + grammarErrorAtPos(statementStart, statementFirstTokenLength, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + + return statement; + } + + function processReferenceComments(): ReferenceComments { + var referencedFiles: FileReference[] = []; + var amdDependencies: string[] = []; + commentRanges = []; + token = scanner.scan(); + + for (var i = 0; i < commentRanges.length; i++) { + var range = commentRanges[i]; + var comment = sourceText.substring(range.pos, range.end); + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (isNoDefaultLibRegEx.exec(comment)) { + file.hasNoDefaultLib = true; + } + else { + var fullReferenceRegEx = /^(\/\/\/\s*/; + var matchResult = fullReferenceRegEx.exec(comment); + if (!matchResult) { + var start = range.pos; + var length = range.end - start; + errorAtPos(start, length, Diagnostics.Invalid_reference_comment); + } + else { + referencedFiles.push({ + pos: range.pos, + end: range.end, + filename: matchResult[3] + }); + } + } + } + else { + var amdDependencyRegEx = /^\/\/\/\s* node.flags & NodeFlags.Export || + node.kind === SyntaxKind.ImportDeclaration && (node).externalModuleName || + node.kind === SyntaxKind.ExportAssignment ? true : false); + } + + scanner = createScanner(languageVersion, sourceText, scanError, onComment); + var rootNodeFlags: NodeFlags = 0; + if (fileExtensionIs(filename, ".d.ts")) { + rootNodeFlags = NodeFlags.DeclarationFile; + inAmbientContext = true; + } + file = createRootNode(SyntaxKind.SourceFile, 0, sourceText.length, rootNodeFlags); + file.filename = normalizePath(filename); + file.text = sourceText; + file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.syntacticErrors = []; + file.semanticErrors = []; + var referenceComments = processReferenceComments(); + file.referencedFiles = referenceComments.referencedFiles; + file.amdDependencies = referenceComments.amdDependencies; + file.statements = parseList(ParsingContext.SourceElements, parseSourceElement); + if (isExternalModule()) file.flags |= NodeFlags.ExternalModule; + file.nodeCount = nodeCount; + file.identifierCount = identifierCount; + return file; + } + + export function createProgram(rootNames: string[], options: CompilerOptions, host: CompilerHost): Program { + + var program: Program; + var files: SourceFile[] = []; + var filesByName: Map = {}; + var errors: Diagnostic[] = []; + var seenNoDefaultLib = options.noLib; + var commonSourceDirectory: string; + + forEach(rootNames, name => processRootFile(name, false)); + if (!seenNoDefaultLib) processRootFile(host.getDefaultLibFilename(), true); + verifyCompilerOptions(); + errors.sort(compareDiagnostics); + program = { + getSourceFile: getSourceFile, + getSourceFiles: () => files, + getCompilerOptions: () => options, + getCompilerHost: () => host, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, + getTypeChecker: () => createTypeChecker(program), + getCommonSourceDirectory: () => commonSourceDirectory, + }; + return program; + + function getSourceFile(filename: string) { + filename = host.getCanonicalFileName(filename); + return hasProperty(filesByName, filename) ? filesByName[filename] : undefined; + } + + function getDiagnostics(sourceFile?: SourceFile): Diagnostic[] { + return sourceFile ? filter(errors, e => e.file === sourceFile) : errors; + } + + function getGlobalDiagnostics(): Diagnostic[] { + return filter(errors, e => !e.file); + } + + function addExtension(filename: string, extension: string): string { + return getBaseFilename(filename).indexOf(".") >= 0 ? filename : filename + extension; + } + + function processRootFile(filename: string, isDefaultLib: boolean) { + processSourceFile(normalizePath(addExtension(filename, ".ts")), isDefaultLib); + } + + function processSourceFile(filename: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number) { + if (refEnd !== undefined && refPos !== undefined) { + var start = refPos; + var length = refEnd - refPos; + } + if (!fileExtensionIs(filename, ".ts")) { + errors.push(createFileDiagnostic(refFile, start, length, Diagnostics.File_0_must_have_extension_ts_or_d_ts, filename)); + } + else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { + errors.push(createFileDiagnostic(refFile, start, length, Diagnostics.File_0_not_found, filename)); + } + } + + // Get source file from normalized filename + function findSourceFile(filename: string, isDefaultLib: boolean, refFile?: SourceFile, refStart?: number, refLength?: number): SourceFile { + // Look through existing source files to see if we've encountered it. + var canonicalName = host.getCanonicalFileName(filename); + var file = getSourceFile(filename); + if (file) { + if (host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { + errors.push(createFileDiagnostic(refFile, refStart, refLength, + Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); + } + } + else { + // If we haven't, read the file. + file = host.getSourceFile(filename, options.target); + if (file) { + filesByName[host.getCanonicalFileName(filename)] = file; + seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + if (!options.noResolve) { + var basePath = getDirectoryPath(filename); + processReferencedFiles(file, basePath); + processImportedModules(file, basePath); + } + if (isDefaultLib) { + files.unshift(file); + } + else { + files.push(file); + } + forEach(file.syntacticErrors, e => { + errors.push(e); + }); + } + } + + return file; + } + + function processReferencedFiles(file: SourceFile, basePath: string) { + forEach(file.referencedFiles, ref => { + processSourceFile(normalizePath(combinePaths(basePath, ref.filename)), false, file, ref.pos, ref.end); + }); + } + + function processImportedModules(file: SourceFile, basePath: string) { + forEach(file.statements, node => { + if (node.kind === SyntaxKind.ImportDeclaration && (node).externalModuleName) { + var nameLiteral = (node).externalModuleName + var moduleName = nameLiteral.text; + if (moduleName) { + var searchPath = basePath; + while (true) { + var searchName = normalizePath(combinePaths(searchPath, moduleName)); + if (findModuleSourceFile(searchName + ".ts", nameLiteral) || findModuleSourceFile(searchName + ".d.ts", nameLiteral)) break; + var parentPath = getDirectoryPath(searchPath); + if (parentPath === searchPath) break; + searchPath = parentPath; + } + } + } + else if (node.kind === SyntaxKind.ModuleDeclaration && (node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || file.flags & NodeFlags.DeclarationFile)) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An AmbientExternalModuleDeclaration declares an external module. + // This type of declaration is permitted only in the global module. + // The StringLiteral must specify a top - level external module name. + // Relative external module names are not permitted + forEachChild((node).body, node => { + if (node.kind === SyntaxKind.ImportDeclaration && (node).externalModuleName) { + var nameLiteral = (node).externalModuleName; + var moduleName = nameLiteral.text; + if (moduleName) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. + var searchName = normalizePath(combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + if (!tsFile) { + findModuleSourceFile(searchName + ".d.ts", nameLiteral); + } + } + } + }) + } + }); + + function findModuleSourceFile(filename: string, nameLiteral: LiteralExpression) { + return findSourceFile(filename, /* isDefaultLib */ false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); + } + } + + function verifyCompilerOptions() { + if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { + // Error to specify --mapRoot or --sourceRoot without mapSourceFiles + if (options.mapRoot) { + errors.push(createCompilerDiagnostic(Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + if (options.sourceRoot) { + errors.push(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option)); + } + return; + } + + // there has to be common source directory if user specified --outdir || --sourcRoot + // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted + if (options.outDir || // there is --outDir specified + options.sourceRoot || // there is --sourceRoot specified + (options.mapRoot && // there is --mapRoot Specified and there would be multiple js files generated + (!options.out || !!filter(files, sourceFile => !!(sourceFile.flags & NodeFlags.ExternalModule)).length))) { + + var commonPathComponents: string[]; + forEach(files, sourceFile => { + // Each file contributes into common source file path + if (!(sourceFile.flags & NodeFlags.DeclarationFile) + && !fileExtensionIs(sourceFile.filename, ".js")) { + var sourcePathCompoments = getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); + sourcePathCompoments.pop(); // FileName is not part of directory + if (commonPathComponents) { + for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathCompoments.length); i++) { + if (commonPathComponents[i] !== sourcePathCompoments[i]) { + if (i === 0) { + errors.push(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 (sourcePathCompoments.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathCompoments.length; + } + } + else { + // first file + commonPathComponents = sourcePathCompoments; + } + } + }); + + commonSourceDirectory = getNormalizedPathFromPathCompoments(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 doesnt + // start with / making it rooted path + commonSourceDirectory += directorySeparator; + } + } + } + } +} diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts new file mode 100644 index 0000000000000..4b4d3f3d723b5 --- /dev/null +++ b/src/compiler/scanner.ts @@ -0,0 +1,915 @@ +/// +/// +/// + +module ts { + + export interface ErrorCallback { + (message: DiagnosticMessage): void; + } + + export interface CommentCallback { + (pos: number, end: number): void; + } + + export interface Scanner { + getStartPos(): number; + getToken(): SyntaxKind; + getTextPos(): number; + getTokenPos(): number; + getTokenText(): string; + getTokenValue(): string; + hasPrecedingLineBreak(): boolean; + isIdentifier(): boolean; + isReservedWord(): boolean; + reScanGreaterToken(): SyntaxKind; + reScanSlashToken(): SyntaxKind; + scan(): SyntaxKind; + setText(text: string): void; + setTextPos(textPos: number): void; + tryScan(callback: () => T): T; + } + + var textToToken: Map = { + "any": SyntaxKind.AnyKeyword, + "boolean": SyntaxKind.BooleanKeyword, + "break": SyntaxKind.BreakKeyword, + "case": SyntaxKind.CaseKeyword, + "catch": SyntaxKind.CatchKeyword, + "class": SyntaxKind.ClassKeyword, + "continue": SyntaxKind.ContinueKeyword, + "const": SyntaxKind.ConstKeyword, + "constructor": SyntaxKind.ConstructorKeyword, + "debugger": SyntaxKind.DebuggerKeyword, + "declare": SyntaxKind.DeclareKeyword, + "default": SyntaxKind.DefaultKeyword, + "delete": SyntaxKind.DeleteKeyword, + "do": SyntaxKind.DoKeyword, + "else": SyntaxKind.ElseKeyword, + "enum": SyntaxKind.EnumKeyword, + "export": SyntaxKind.ExportKeyword, + "extends": SyntaxKind.ExtendsKeyword, + "false": SyntaxKind.FalseKeyword, + "finally": SyntaxKind.FinallyKeyword, + "for": SyntaxKind.ForKeyword, + "function": SyntaxKind.FunctionKeyword, + "get": SyntaxKind.GetKeyword, + "if": SyntaxKind.IfKeyword, + "implements": SyntaxKind.ImplementsKeyword, + "import": SyntaxKind.ImportKeyword, + "in": SyntaxKind.InKeyword, + "instanceof": SyntaxKind.InstanceOfKeyword, + "interface": SyntaxKind.InterfaceKeyword, + "let": SyntaxKind.LetKeyword, + "module": SyntaxKind.ModuleKeyword, + "new": SyntaxKind.NewKeyword, + "null": SyntaxKind.NullKeyword, + "number": SyntaxKind.NumberKeyword, + "package": SyntaxKind.PackageKeyword, + "private": SyntaxKind.PrivateKeyword, + "protected": SyntaxKind.ProtectedKeyword, + "public": SyntaxKind.PublicKeyword, + "require": SyntaxKind.RequireKeyword, + "return": SyntaxKind.ReturnKeyword, + "set": SyntaxKind.SetKeyword, + "static": SyntaxKind.StaticKeyword, + "string": SyntaxKind.StringKeyword, + "super": SyntaxKind.SuperKeyword, + "switch": SyntaxKind.SwitchKeyword, + "this": SyntaxKind.ThisKeyword, + "throw": SyntaxKind.ThrowKeyword, + "true": SyntaxKind.TrueKeyword, + "try": SyntaxKind.TryKeyword, + "typeof": SyntaxKind.TypeOfKeyword, + "var": SyntaxKind.VarKeyword, + "void": SyntaxKind.VoidKeyword, + "while": SyntaxKind.WhileKeyword, + "with": SyntaxKind.WithKeyword, + "yield": SyntaxKind.YieldKeyword, + "{": SyntaxKind.OpenBraceToken, + "}": SyntaxKind.CloseBraceToken, + "(": SyntaxKind.OpenParenToken, + ")": SyntaxKind.CloseParenToken, + "[": SyntaxKind.OpenBracketToken, + "]": SyntaxKind.CloseBracketToken, + ".": SyntaxKind.DotToken, + "...": SyntaxKind.DotDotDotToken, + ";": SyntaxKind.SemicolonToken, + ",": SyntaxKind.CommaToken, + "<": SyntaxKind.LessThanToken, + ">": SyntaxKind.GreaterThanToken, + "<=": SyntaxKind.LessThanEqualsToken, + ">=": SyntaxKind.GreaterThanEqualsToken, + "==": SyntaxKind.EqualsEqualsToken, + "!=": SyntaxKind.ExclamationEqualsToken, + "===": SyntaxKind.EqualsEqualsEqualsToken, + "!==": SyntaxKind.ExclamationEqualsEqualsToken, + "=>": SyntaxKind.EqualsGreaterThanToken, + "+": SyntaxKind.PlusToken, + "-": SyntaxKind.MinusToken, + "*": SyntaxKind.AsteriskToken, + "/": SyntaxKind.SlashToken, + "%": SyntaxKind.PercentToken, + "++": SyntaxKind.PlusPlusToken, + "--": SyntaxKind.MinusMinusToken, + "<<": SyntaxKind.LessThanLessThanToken, + ">>": SyntaxKind.GreaterThanGreaterThanToken, + ">>>": SyntaxKind.GreaterThanGreaterThanGreaterThanToken, + "&": SyntaxKind.AmpersandToken, + "|": SyntaxKind.BarToken, + "^": SyntaxKind.CaretToken, + "!": SyntaxKind.ExclamationToken, + "~": SyntaxKind.TildeToken, + "&&": SyntaxKind.AmpersandAmpersandToken, + "||": SyntaxKind.BarBarToken, + "?": SyntaxKind.QuestionToken, + ":": SyntaxKind.ColonToken, + "=": SyntaxKind.EqualsToken, + "+=": SyntaxKind.PlusEqualsToken, + "-=": SyntaxKind.MinusEqualsToken, + "*=": SyntaxKind.AsteriskEqualsToken, + "/=": SyntaxKind.SlashEqualsToken, + "%=": SyntaxKind.PercentEqualsToken, + "<<=": SyntaxKind.LessThanLessThanEqualsToken, + ">>=": SyntaxKind.GreaterThanGreaterThanEqualsToken, + ">>>=": SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, + "&=": SyntaxKind.AmpersandEqualsToken, + "|=": SyntaxKind.BarEqualsToken, + "^=": SyntaxKind.CaretEqualsToken, + }; + + /* + As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers + IdentifierStart :: + Can contain Unicode 3.0.0 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: = + Can contain IdentifierStart + Unicode 3.0.0 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), or + Connector punctuation (Pc). + + Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at: + http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt + */ + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + + /* + As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers + IdentifierStart :: + Can contain Unicode 6.2 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: + Can contain IdentifierStart + Unicode 6.2 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), + Connector punctuation (Pc), + , or + . + + Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at: + http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt + */ + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + + function lookupInUnicodeMap(code: number, map: number[]): boolean { + // Bail out quickly if it couldn't possibly be in the map. + if (code < map[0]) { + return false; + } + + // Perform binary search in one of the unicode range maps + var lo: number = 0; + var hi: number = map.length; + var mid: number; + + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + // mid has to be even to catch a range's beginning + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + + return false; + } + + function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget) { + return languageVersion === ScriptTarget.ES3 ? + lookupInUnicodeMap(code, unicodeES3IdentifierStart) : + lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + + function isUnicodeIdentifierPart(code: number, languageVersion: ScriptTarget) { + return languageVersion === ScriptTarget.ES3 ? + lookupInUnicodeMap(code, unicodeES3IdentifierPart) : + lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + + function makeReverseMap(source: Map): string[] { + var result: string[] = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + + var tokenStrings = makeReverseMap(textToToken); + + export function tokenToString(t: SyntaxKind): string { + return tokenStrings[t]; + } + + export function getLineStarts(text: string): number[] { + var result: number[] = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + switch (text.charCodeAt(pos++)) { + case CharacterCodes.carriageReturn: + if (text.charCodeAt(pos) === CharacterCodes.lineFeed) { + pos++; + } + case CharacterCodes.lineFeed: + result.push(lineStart); + lineStart = pos; + break; + } + } + result.push(lineStart); + return result; + } + + export function getLineAndCharacterOfPosition(lineStarts: number[], position: number) { + var lineNumber = binarySearch(lineStarts, position); + if (lineNumber < 0) { + // If the actual position was not found, + // the binary search returns the negative value of the next line start + // eg. if line starts at [5, 10, 23, 80] and position requested was 20 + // the search will return -2 + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + + export function positionToLineAndCharacter(text: string, pos: number) { + var lineStarts = getLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function isWhiteSpace(ch: number): boolean { + return ch === CharacterCodes.space || ch === CharacterCodes.tab || ch === CharacterCodes.verticalTab || ch === CharacterCodes.formFeed || + ch === CharacterCodes.nonBreakingSpace || ch === CharacterCodes.ogham || ch >= CharacterCodes.enQuad && ch <= CharacterCodes.zeroWidthSpace || + ch === CharacterCodes.narrowNoBreakSpace || ch === CharacterCodes.mathematicalSpace || ch === CharacterCodes.ideographicSpace || ch === CharacterCodes.byteOrderMark; + } + + function isLineBreak(ch: number): boolean { + return ch === CharacterCodes.lineFeed || ch === CharacterCodes.carriageReturn || ch === CharacterCodes.lineSeparator || ch === CharacterCodes.paragraphSeparator; + } + + function isDigit(ch: number): boolean { + return ch >= CharacterCodes._0 && ch <= CharacterCodes._9; + } + + export function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case CharacterCodes.carriageReturn: + if (text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) pos++; + case CharacterCodes.lineFeed: + pos++; + if (stopAfterLineBreak) return pos; + continue; + case CharacterCodes.tab: + case CharacterCodes.verticalTab: + case CharacterCodes.formFeed: + case CharacterCodes.space: + pos++; + continue; + case CharacterCodes.slash: + if (text.charCodeAt(pos + 1) === CharacterCodes.slash) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (ch > CharacterCodes.maxAsciiCharacter && (isWhiteSpace(ch) || isLineBreak(ch))) { + pos++; + continue; + } + break; + } + return pos; + } + } + + export function createScanner(languageVersion: ScriptTarget, text?: string, onError?: ErrorCallback, onComment?: CommentCallback): Scanner { + var pos: number; // Current position (end position of text of current token) + var len: number; // Length of text + var startPos: number; // Start position of whitespace before current token + var tokenPos: number; // Start position of text of current token + var token: number; + var tokenValue: string; + var precedingLineBreak: boolean; + + function error(message: DiagnosticMessage): void { + if (onError) onError(message); + } + + function isIdentifierStart(ch: number): boolean { + return ch >= CharacterCodes.A && ch <= CharacterCodes.Z || ch >= CharacterCodes.a && ch <= CharacterCodes.z || + ch === CharacterCodes.$ || ch === CharacterCodes._ || + ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierStart(ch, languageVersion); + } + + function isIdentifierPart(ch: number): boolean { + return ch >= CharacterCodes.A && ch <= CharacterCodes.Z || ch >= CharacterCodes.a && ch <= CharacterCodes.z || + ch >= CharacterCodes._0 && ch <= CharacterCodes._9 || ch === CharacterCodes.$ || ch === CharacterCodes._ || + ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion); + } + + function scanNumber(): number { + var start = pos; + while (isDigit(text.charCodeAt(pos))) pos++; + if (text.charCodeAt(pos) === CharacterCodes.dot) { + pos++; + while (isDigit(text.charCodeAt(pos))) pos++; + } + var end = pos; + if (text.charCodeAt(pos) === CharacterCodes.E || text.charCodeAt(pos) === CharacterCodes.e) { + pos++; + if (text.charCodeAt(pos) === CharacterCodes.plus || text.charCodeAt(pos) === CharacterCodes.minus) pos++; + if (isDigit(text.charCodeAt(pos))) { + pos++; + while (isDigit(text.charCodeAt(pos))) pos++; + end = pos; + } + else { + error(Diagnostics.Digit_expected); + } + } + return +(text.substring(start, end)); + } + + function scanHexDigits(count: number, exact?: boolean): number { + var digits = 0; + var value = 0; + while (digits < count || !exact) { + var ch = text.charCodeAt(pos); + if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) { + value = value * 16 + ch - CharacterCodes._0; + } + else if (ch >= CharacterCodes.A && ch <= CharacterCodes.F) { + value = value * 16 + ch - CharacterCodes.A + 10; + } + else if (ch >= CharacterCodes.a && ch <= CharacterCodes.f) { + value = value * 16 + ch - CharacterCodes.a + 10; + } + else { + break; + } + pos++; + digits++; + } + if (digits < count) { + value = -1; + } + return value; + } + + function scanString(): string { + var quote = text.charCodeAt(pos++); + var result = ""; + var start = pos; + while (true) { + if (pos >= len) { + result += text.substring(start, pos); + error(Diagnostics.Unexpected_end_of_text); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + result += text.substring(start, pos); + pos++; + break; + } + if (ch === CharacterCodes.backslash) { + result += text.substring(start, pos); + pos++; + if (pos >= len) { + error(Diagnostics.Unexpected_end_of_text); + break; + } + ch = text.charCodeAt(pos++); + switch (ch) { + case CharacterCodes._0: + result += "\0"; + break; + case CharacterCodes.b: + result += "\b"; + break; + case CharacterCodes.t: + result += "\t"; + break; + case CharacterCodes.n: + result += "\n"; + break; + case CharacterCodes.v: + result += "\v"; + break; + case CharacterCodes.f: + result += "\f"; + break; + case CharacterCodes.r: + result += "\r"; + break; + case CharacterCodes.singleQuote: + result += "\'"; + break; + case CharacterCodes.doubleQuote: + result += "\""; + break; + case CharacterCodes.x: + case CharacterCodes.u: + var ch = scanHexDigits(ch === CharacterCodes.x ? 2 : 4, true); + if (ch >= 0) { + result += String.fromCharCode(ch); + } + else { + error(Diagnostics.Hexadecimal_digit_expected); + } + break; + case CharacterCodes.carriageReturn: + if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) pos++; + break; + case CharacterCodes.lineFeed: + case CharacterCodes.lineSeparator: + case CharacterCodes.paragraphSeparator: + break; + default: + result += String.fromCharCode(ch); + } + start = pos; + continue; + } + if (isLineBreak(ch)) { + result += text.substring(start, pos); + error(Diagnostics.Unterminated_string_constant); + break; + } + pos++; + } + return result; + } + + // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' + // and return code point value if valid Unicode escape is found. Otherwise return -1. + function peekUnicodeEscape(): number { + if (pos + 5 < len && text.charCodeAt(pos + 1) === CharacterCodes.u) { + var start = pos; + pos += 2; + var value = scanHexDigits(4, true); + pos = start; + return value; + } + return -1; + } + + function scanIdentifierParts(): string { + var result = ""; + var start = pos; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (isIdentifierPart(ch)) { + pos++; + } + else if (ch === CharacterCodes.backslash) { + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch))) { + break; + } + result += text.substring(start, pos); + result += String.fromCharCode(ch); + // Valid Unicode escape is always six characters + pos += 6; + start = pos; + } + else { + break; + } + } + result += text.substring(start, pos); + return result; + } + + function getIdentifierToken(): SyntaxKind { + // Reserved words are between 2 and 11 characters long and start with a lowercase letter + var len = tokenValue.length; + if (len >= 2 && len <= 11) { + var ch = tokenValue.charCodeAt(0); + if (ch >= CharacterCodes.a && ch <= CharacterCodes.z && hasOwnProperty.call(textToToken, tokenValue)) { + return token = textToToken[tokenValue]; + } + } + return token = SyntaxKind.Identifier; + } + + function scan(): SyntaxKind { + startPos = pos; + precedingLineBreak = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = SyntaxKind.EndOfFileToken; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case CharacterCodes.lineFeed: + case CharacterCodes.carriageReturn: + precedingLineBreak = true; + case CharacterCodes.tab: + case CharacterCodes.verticalTab: + case CharacterCodes.formFeed: + case CharacterCodes.space: + pos++; + continue; + case CharacterCodes.exclamation: + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { + return pos += 3, token = SyntaxKind.ExclamationEqualsEqualsToken; + } + return pos += 2, token = SyntaxKind.ExclamationEqualsToken; + } + return pos++, token = SyntaxKind.ExclamationToken; + case CharacterCodes.doubleQuote: + case CharacterCodes.singleQuote: + tokenValue = scanString(); + return token = SyntaxKind.StringLiteral; + case CharacterCodes.percent: + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.PercentEqualsToken; + } + return pos++, token = SyntaxKind.PercentToken; + case CharacterCodes.ampersand: + if (text.charCodeAt(pos + 1) === CharacterCodes.ampersand) { + return pos += 2, token = SyntaxKind.AmpersandAmpersandToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.AmpersandEqualsToken; + } + return pos++, token = SyntaxKind.AmpersandToken; + case CharacterCodes.openParen: + return pos++, token = SyntaxKind.OpenParenToken; + case CharacterCodes.closeParen: + return pos++, token = SyntaxKind.CloseParenToken; + case CharacterCodes.asterisk: + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.AsteriskEqualsToken; + } + return pos++, token = SyntaxKind.AsteriskToken; + case CharacterCodes.plus: + if (text.charCodeAt(pos + 1) === CharacterCodes.plus) { + return pos += 2, token = SyntaxKind.PlusPlusToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.PlusEqualsToken; + } + return pos++, token = SyntaxKind.PlusToken; + case CharacterCodes.comma: + return pos++, token = SyntaxKind.CommaToken; + case CharacterCodes.minus: + if (text.charCodeAt(pos + 1) === CharacterCodes.minus) { + return pos += 2, token = SyntaxKind.MinusMinusToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.MinusEqualsToken; + } + return pos++, token = SyntaxKind.MinusToken; + case CharacterCodes.dot: + if (isDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanNumber(); + return token = SyntaxKind.NumericLiteral; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.dot && text.charCodeAt(pos + 2) === CharacterCodes.dot) { + return pos += 3, token = SyntaxKind.DotDotDotToken; + } + return pos++, token = SyntaxKind.DotToken; + case CharacterCodes.slash: + // Single-line comment + if (text.charCodeAt(pos + 1) === CharacterCodes.slash) { + pos += 2; + + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + + } + if (onComment) { + onComment(tokenPos, pos); + } + continue; + } + // Multi-line comment + if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { + pos += 2; + + while (pos < len) { + var ch = text.charCodeAt(pos); + + if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) { + pos += 2; + break; + } + + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + + if (onComment) { + onComment(tokenPos, pos); + } + + continue; + } + + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.SlashEqualsToken; + } + + return pos++, token = SyntaxKind.SlashToken; + + case CharacterCodes._0: + if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { + pos += 2; + var value = scanHexDigits(1, false); + if (value < 0) { + error(Diagnostics.Hexadecimal_digit_expected); + value = 0; + } + tokenValue = "" + value; + return SyntaxKind.NumericLiteral; + } + case CharacterCodes._1: + case CharacterCodes._2: + case CharacterCodes._3: + case CharacterCodes._4: + case CharacterCodes._5: + case CharacterCodes._6: + case CharacterCodes._7: + case CharacterCodes._8: + case CharacterCodes._9: + tokenValue = "" + scanNumber(); + return token = SyntaxKind.NumericLiteral; + case CharacterCodes.colon: + return pos++, token = SyntaxKind.ColonToken; + case CharacterCodes.semicolon: + return pos++, token = SyntaxKind.SemicolonToken; + case CharacterCodes.lessThan: + if (text.charCodeAt(pos + 1) === CharacterCodes.lessThan) { + if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { + return pos += 3, token = SyntaxKind.LessThanLessThanEqualsToken; + } + return pos += 2, token = SyntaxKind.LessThanLessThanToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.LessThanEqualsToken; + } + return pos++, token = SyntaxKind.LessThanToken; + case CharacterCodes.equals: + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { + return pos += 3, token = SyntaxKind.EqualsEqualsEqualsToken; + } + return pos += 2, token = SyntaxKind.EqualsEqualsToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.greaterThan) { + return pos += 2, token = SyntaxKind.EqualsGreaterThanToken; + } + return pos++, token = SyntaxKind.EqualsToken; + case CharacterCodes.greaterThan: + return pos++, token = SyntaxKind.GreaterThanToken; + case CharacterCodes.question: + return pos++, token = SyntaxKind.QuestionToken; + case CharacterCodes.openBracket: + return pos++, token = SyntaxKind.OpenBracketToken; + case CharacterCodes.closeBracket: + return pos++, token = SyntaxKind.CloseBracketToken; + case CharacterCodes.caret: + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.CaretEqualsToken; + } + return pos++, token = SyntaxKind.CaretToken; + case CharacterCodes.openBrace: + return pos++, token = SyntaxKind.OpenBraceToken; + case CharacterCodes.bar: + if (text.charCodeAt(pos + 1) === CharacterCodes.bar) { + return pos += 2, token = SyntaxKind.BarBarToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.BarEqualsToken; + } + return pos++, token = SyntaxKind.BarToken; + case CharacterCodes.closeBrace: + return pos++, token = SyntaxKind.CloseBraceToken; + case CharacterCodes.tilde: + return pos++, token = SyntaxKind.TildeToken; + case CharacterCodes.backslash: + var ch = peekUnicodeEscape(); + if (ch >= 0 && isIdentifierStart(ch)) { + pos += 6; + tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error(Diagnostics.Invalid_character); + return pos++, token = SyntaxKind.Unknown; + default: + if (isIdentifierStart(ch)) { + pos++; + while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; + tokenValue = text.substring(tokenPos, pos); + if (ch === CharacterCodes.backslash) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + error(Diagnostics.Invalid_character); + return pos++, token = SyntaxKind.Unknown; + } + } + } + + function reScanGreaterToken(): SyntaxKind { + if (token === SyntaxKind.GreaterThanToken) { + if (text.charCodeAt(pos) === CharacterCodes.greaterThan) { + if (text.charCodeAt(pos + 1) === CharacterCodes.greaterThan) { + if (text.charCodeAt(pos + 2) === CharacterCodes.equals) { + return pos += 3, token = SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken; + } + return pos += 2, token = SyntaxKind.GreaterThanGreaterThanGreaterThanToken; + } + if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { + return pos += 2, token = SyntaxKind.GreaterThanGreaterThanEqualsToken; + } + return pos++, token = SyntaxKind.GreaterThanGreaterThanToken; + } + if (text.charCodeAt(pos) === CharacterCodes.equals) { + return pos++, token = SyntaxKind.GreaterThanEqualsToken; + } + } + return token; + } + + function reScanSlashToken(): SyntaxKind { + if (token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) { + var p = tokenPos + 1; + var inEscape = false; + var inClass = false; + while (true) { + if (p >= len) { + return token; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + return token; + } + if (inEscape) { + inEscape = false; + } + else if (ch === CharacterCodes.slash) { + break; + } + else if (ch === CharacterCodes.openBracket) { + inClass = true; + } + else if (ch === CharacterCodes.backslash) { + inEscape = true; + } + else if (ch === CharacterCodes.closeBracket) { + inClass = false; + } + p++; + } + p++; + while (isIdentifierPart(text.charCodeAt(p))) p++; + pos = p; + tokenValue = text.substring(tokenPos, pos); + token = SyntaxKind.RegularExpressionLiteral; + } + return token; + } + + function tryScan(callback: () => T): T { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var savePrecedingLineBreak = precedingLineBreak; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + precedingLineBreak = savePrecedingLineBreak; + } + return result; + } + + function setText(newText: string) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + + function setTextPos(textPos: number) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = SyntaxKind.Unknown; + precedingLineBreak = false; + } + + setText(text); + + + return { + getStartPos: () => startPos, + getTextPos: () => pos, + getToken: () => token, + getTokenPos: () => tokenPos, + getTokenText: () => text.substring(tokenPos, pos), + getTokenValue: () => tokenValue, + hasPrecedingLineBreak: () => precedingLineBreak, + isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, + isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } +} diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts new file mode 100644 index 0000000000000..ba0c430301242 --- /dev/null +++ b/src/compiler/sys.ts @@ -0,0 +1,259 @@ +interface System { + args: string[]; + newLine: string; + write(s: string): void; + writeErr(s: string): void; + readFile(fileName: string): string; + writeFile(fileName: string, data: string): void; + resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(directoryName: string): void; + getExecutingFilePath(): string; + getCurrentDirectory(): string; + getMemoryUsage(): number; + exit(exitCode?: number): void; + useCaseSensitiveFileNames: boolean; +} + +enum ErrorCodes { + UnsupportedFileEncoding = 1, + CannotReadFile = 2, +} + +declare var require: any; +declare var module: any; +declare var process: any; +declare var global: any; + +var sys: System = (function () { + function getWScriptSystem(): System { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var args: string[] = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + + var fileStreamObjectPool: any[] = []; + + function getFileStreamObject(): any { + if (fileStreamObjectPool.length > 0) { + return fileStreamObjectPool.pop(); + } + else { + return new ActiveXObject("ADODB.Stream"); + } + } + + function releaseFileStreamObject(obj: any) { + fileStreamObjectPool.push(obj); + } + + return { + args: args, + newLine: "\r\n", + write(s: string): void { + WScript.StdOut.Write(s); + }, + writeErr(s: string): void { + WScript.StdErr.Write(s); + }, + readFile(fileName: string): string { + var contents: string; + try { + // Initially just read the first two bytes of the file to see if there's a bom. + var fileStream = getFileStreamObject(); + fileStream.Open(); + fileStream.Type = 2; // Text data + + // Start reading individual chars without any interpretation. That way we can check for a byte-order-mark. + fileStream.Charset = "x-ansi"; + + fileStream.LoadFromFile(fileName); + var byteOrderMarkSeq: string = fileStream.ReadText(2) || ""; // Read the BOM char-seq or fall back to an empty string + + // Position has to be at 0 before changing the encoding + fileStream.Position = 0; + if (byteOrderMarkSeq.charCodeAt(0) === 0xFE && byteOrderMarkSeq.charCodeAt(1) === 0xFF) { + // utf16-be + fileStream.Charset = "unicode"; + } + else if (byteOrderMarkSeq.charCodeAt(0) === 0xFF && byteOrderMarkSeq.charCodeAt(1) === 0xFE) { + // utf16-le + fileStream.Charset = "unicode"; + } + else if (byteOrderMarkSeq.charCodeAt(0) === 0xEF && byteOrderMarkSeq.charCodeAt(1) === 0xBB) { + // utf-8 + fileStream.Charset = "utf-8"; + } + else { + // Always read a file as utf8 if it has no bom. + fileStream.Charset = "utf-8"; + } + contents = fileStream.ReadText(-1 /* Read from beginning to end-of-stream */); + fileStream.Close(); + releaseFileStreamObject(fileStream); + } + catch (err) { + // -2147024809 is the javascript value for 0x80070057 which is the HRESULT for + // "the parameter is incorrect". + if (err.number === -2147024809) { + err.code = ErrorCodes.UnsupportedFileEncoding; + } + else { + err.code = ErrorCodes.CannotReadFile; + } + throw err; + } + + return contents; + }, + writeFile(fileName: string, data: string): void { + var textStream = getFileStreamObject(); + textStream.Charset = "utf-8"; + textStream.Open(); + textStream.WriteText(data, 0 /*do not add newline*/); + textStream.SaveToFile(fileName, 2 /*overwrite*/); + textStream.Close(); + releaseFileStreamObject(textStream); + }, + resolvePath(path: string): string { + return fso.GetAbsolutePathName(path); + }, + fileExists(path: string): boolean { + return fso.FileExists(path); + }, + directoryExists(path: string) { + return fso.FolderExists(path); + }, + createDirectory(directoryName: string) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath() { + return WScript.ScriptFullName; + }, + getCurrentDirectory() { + return new ActiveXObject("WScript.Shell").CurrentDirectory; + }, + getMemoryUsage() { + return 0; + }, + exit(exitCode?: number): void { + WScript.Quit(exitCode); + }, + useCaseSensitiveFileNames: false, + }; + } + function getNodeSystem(): System { + var _fs = require("fs"); + var _path = require("path"); + var _os = require("os"); + var platform: string = _os.platform(); + // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive + var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; + + return { + args: process.argv.slice(2), + newLine: _os.EOL, + write(s: string): void { + process.stdout.write(s); + }, + writeErr(s: string): void { + process.stderr.write(s); + }, + readFile(fileName: string): string { + try { + var buffer = _fs.readFileSync(fileName); + + // Make sure buffer got initialized and that we don't try to read into a completely empty file. + if (!buffer || buffer.length === 0) { + return ""; + } + + switch (buffer[0]) { + case 0xFE: + if (buffer[1] === 0xFF) { + // utf16-be. Reading the buffer as big endian is not supported, so convert it to + // Little Endian first + var i = 0; + while ((i + 1) < buffer.length) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + i += 2; + } + return buffer.toString("utf16le", 2); + } + break; + case 0xFF: + if (buffer[1] === 0xFE) { + // utf16-le + return buffer.toString("utf16le", 2); + } + break; + case 0xEF: + if (buffer[1] === 0xBB) { + // utf-8 + return buffer.toString("utf8", 3); + } + } + + return buffer.toString("utf8", 0); + } + catch (err) { + err.code = ErrorCodes.CannotReadFile; + throw err; + } + }, + writeFile(fileName: string, data: string): void { + // TODO (drosen): bring back the old environment code if necessary + _fs.writeFileSync(fileName, data, "utf8"); + }, + resolvePath: function (path: string): string { + return _path.resolve(path); + }, + fileExists(path: string): boolean { + return _fs.existsSync(path); + }, + directoryExists(path: string) { + return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); + }, + createDirectory(directoryName: string) { + if (!this.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath() { + return process.mainModule.filename; + }, + getCurrentDirectory() { + return (process).cwd(); + }, + getMemoryUsage() { + global.gc(); + return process.memoryUsage().heapUsed; + }, + exit(exitCode?: number): void { + process.exit(exitCode); + }, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + }; + } + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return getWScriptSystem(); + } + else if (typeof module !== "undefined" && module.exports) { + return getNodeSystem(); + } + else { + return undefined; // Unsupported host + } +})(); + +function getCanonicalFileName(fileName: string): string { + // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. + // otherwise use toLowerCase as a canonical form. + return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); +} diff --git a/src/compiler/tc.ts b/src/compiler/tc.ts new file mode 100644 index 0000000000000..dcc6d0f03c5d9 --- /dev/null +++ b/src/compiler/tc.ts @@ -0,0 +1,241 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// + +module ts { + /// Checks to see if the locale is in the appropriate format, + /// and if it is, attempt to set the appropriate language. + function validateLocaleAndSetLanguage(locale: string, errors: Diagnostic[]): boolean { + var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); + + if (!matchResult) { + errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, 'en', 'ja-jp')); + return false; + } + + var language = matchResult[1]; + var territory = matchResult[3]; + + // First try the entire locale, then fall back to just language if that's all we have. + if (!trySetLanguageAndTerritory(language, territory, errors) && + !trySetLanguageAndTerritory(language, undefined, errors)) { + + errors.push(createCompilerDiagnostic(Diagnostics.Unsupported_locale_0, locale)); + return false; + } + + return true; + } + + function trySetLanguageAndTerritory(language: string, territory: string, errors: Diagnostic[]): boolean { + var compilerFilePath = sys.getExecutingFilePath(); + var containingDirectoryPath = getDirectoryPath(compilerFilePath); + + var filePath = combinePaths(containingDirectoryPath, language); + + if (territory) { + filePath = filePath + "-" + territory; + } + + filePath = sys.resolvePath(combinePaths(filePath, "diagnosticMessages.generated.json")); + + if (!sys.fileExists(filePath)) { + return false; + } + + // TODO: Add codePage support for readFile? + try { + var fileContents = sys.readFile(filePath); + } + catch (e) { + errors.push(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, filePath)); + return false; + } + try { + localizedDiagnosticMessages = JSON.parse(fileContents); + } + catch (e) { + errors.push(createCompilerDiagnostic(Diagnostics.Corrupted_locale_file_0, filePath)); + return false; + } + + return true; + } + + function countLines(program: Program): number { + var count = 0; + forEach(program.getSourceFiles(), file => { + count += file.getLineAndCharacterFromPosition(file.end).line; + }); + return count; + } + + // TODO (drosen): Make localize-friendly + var hasReportedErrors = false; + function reportErrors(errors: Diagnostic[]) { + for (var i = 0; i < errors.length; i++) { + var error = errors[i]; + // TODO(jfreeman): Remove assert + Debug.assert(error.messageText.indexOf("{NL}") < 0); + if (error.file) { + var loc = error.file.getLineAndCharacterFromPosition(error.start); + sys.writeErr(error.file.filename + "(" + loc.line + "," + loc.character + "): " + error.messageText + sys.newLine); + } + else { + sys.writeErr(error.messageText + sys.newLine); + } + hasReportedErrors = true; + } + } + + function padLeft(s: string, length: number) { + while (s.length < length) s = " " + s; + return s; + } + + function padRight(s: string, length: number) { + while (s.length < length) s = s + " "; + return s; + } + + function reportDiagnostic(name: string, value: string) { + sys.writeErr(padRight(name + ":", 12) + padLeft(value.toString(), 10) + sys.newLine); + } + + function reportDiagnosticCount(name: string, count: number) { + reportDiagnostic(name, "" + count); + } + + function reportDiagnosticTime(name: string, time: number) { + reportDiagnostic(name, (time / 1000).toFixed(2) + "s"); + } + + function getSourceFile(filename: string, languageVersion: ScriptTarget): SourceFile { + try { + var text = sys.readFile(filename); + } + catch (err) { + return undefined; + } + + return createSourceFile(filename, text, languageVersion); + } + + function writeFile(fileName: string, data: string) { + function ensureDirectoryStructure(directoryName: string) { + if (directoryName) { + if (!sys.directoryExists(directoryName)) { + var parentDirectory = getDirectoryPath(directoryName); + // If we arent at the root path ensure that the folder exists + if (parentDirectory !== directoryName) { + if (ensureDirectoryStructure(parentDirectory)) { + // If parent directory was present, create the current directory + try { + sys.createDirectory(directoryName); + } + catch (e) { + reportErrors([createCompilerDiagnostic(Diagnostics.Could_not_create_directory_0, [directoryName])]); + return false; + } + } + } + } + } + return true; + } + + // If parent directory structure is present create the file + if (ensureDirectoryStructure(getDirectoryPath(normalizePath(fileName)))) { + try { + sys.writeFile(fileName, data); + } + catch (e) { + reportErrors([createCompilerDiagnostic(Diagnostics.Could_not_write_file_0, [fileName])]); + } + } + } + + var currentDirectory: string; + function getCurrentDictory() { + currentDirectory = currentDirectory || sys.getCurrentDirectory(); + return currentDirectory; + } + + function createCompilerHost(): CompilerHost { + return { + getSourceFile: getSourceFile, + getDefaultLibFilename: () => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), "lib.d.ts"), + writeFile: writeFile, + getCurrentDirectory: getCurrentDictory, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, + getCanonicalFileName: getCanonicalFileName + }; + } + + export function executeCommandLine(args: string[]): number { + var cmds = parseCommandLine(args); + if (cmds.filenames.length === 0 && !(cmds.options.help || cmds.options.version)) { + cmds.errors.push(createCompilerDiagnostic(Diagnostics.No_input_files_specified)); + } + + if (cmds.options.version) { + } + + if (cmds.filenames.length === 0 || cmds.options.help) { + // TODO (drosen): Usage. + } + + // If a locale has been set but fails to load, act as if it was never specified, + // but collect the errors to report along the way. + if (cmds.options.locale) { + validateLocaleAndSetLanguage(cmds.options.locale, cmds.errors); + } + + if (cmds.errors.length) { + reportErrors(cmds.errors); + return 1; + } + + var parseStart = new Date().getTime(); + var program = createProgram(cmds.filenames, cmds.options, createCompilerHost()); + var bindStart = new Date().getTime(); + var errors = program.getDiagnostics(); + if (errors.length) { + var checkStart = bindStart; + var emitStart = bindStart; + var reportStart = bindStart; + } + else { + var checker = program.getTypeChecker(); + var checkStart = new Date().getTime(); + errors = checker.getDiagnostics(); + var emitStart = new Date().getTime(); + checker.emitFiles(); + var reportStart = new Date().getTime(); + } + + reportErrors(errors); + if (cmds.options.diagnostics) { + reportDiagnosticCount("Files", program.getSourceFiles().length); + reportDiagnosticCount("Lines", countLines(program)); + reportDiagnosticCount("Nodes", checker.getNodeCount()); + reportDiagnosticCount("Identifiers", checker.getIdentifierCount()); + reportDiagnosticCount("Symbols", checker.getSymbolCount()); + reportDiagnosticCount("Types", checker.getTypeCount()); + reportDiagnosticTime("Parse time", bindStart - parseStart); + reportDiagnosticTime("Bind time", checkStart - bindStart); + reportDiagnosticTime("Check time", emitStart - checkStart); + reportDiagnosticTime("Emit time", reportStart - emitStart); + reportDiagnosticTime("Total time", reportStart - parseStart); + } + return hasReportedErrors ? 1 : 0; + } +} + +ts.executeCommandLine(sys.args); diff --git a/src/compiler/types.ts b/src/compiler/types.ts new file mode 100644 index 0000000000000..c09d3a0cee2c5 --- /dev/null +++ b/src/compiler/types.ts @@ -0,0 +1,1075 @@ +/// +/// + +module ts { + + export interface TextRange { + pos: number; + end: number; + } + + // token > SyntaxKind.Identifer => token is a keyword + export enum SyntaxKind { + Unknown, + EndOfFileToken, + // Literals + NumericLiteral, + StringLiteral, + RegularExpressionLiteral, + // Punctuation + OpenBraceToken, + CloseBraceToken, + OpenParenToken, + CloseParenToken, + OpenBracketToken, + CloseBracketToken, + DotToken, + DotDotDotToken, + SemicolonToken, + CommaToken, + LessThanToken, + GreaterThanToken, + LessThanEqualsToken, + GreaterThanEqualsToken, + EqualsEqualsToken, + ExclamationEqualsToken, + EqualsEqualsEqualsToken, + ExclamationEqualsEqualsToken, + EqualsGreaterThanToken, + PlusToken, + MinusToken, + AsteriskToken, + SlashToken, + PercentToken, + PlusPlusToken, + MinusMinusToken, + LessThanLessThanToken, + GreaterThanGreaterThanToken, + GreaterThanGreaterThanGreaterThanToken, + AmpersandToken, + BarToken, + CaretToken, + ExclamationToken, + TildeToken, + AmpersandAmpersandToken, + BarBarToken, + QuestionToken, + ColonToken, + // Assignments + EqualsToken, + PlusEqualsToken, + MinusEqualsToken, + AsteriskEqualsToken, + SlashEqualsToken, + PercentEqualsToken, + LessThanLessThanEqualsToken, + GreaterThanGreaterThanEqualsToken, + GreaterThanGreaterThanGreaterThanEqualsToken, + AmpersandEqualsToken, + BarEqualsToken, + CaretEqualsToken, + // Identifiers + Identifier, + // Reserved words + BreakKeyword, + CaseKeyword, + CatchKeyword, + ClassKeyword, + ConstKeyword, + ContinueKeyword, + DebuggerKeyword, + DefaultKeyword, + DeleteKeyword, + DoKeyword, + ElseKeyword, + EnumKeyword, + ExportKeyword, + ExtendsKeyword, + FalseKeyword, + FinallyKeyword, + ForKeyword, + FunctionKeyword, + IfKeyword, + ImportKeyword, + InKeyword, + InstanceOfKeyword, + NewKeyword, + NullKeyword, + ReturnKeyword, + SuperKeyword, + SwitchKeyword, + ThisKeyword, + ThrowKeyword, + TrueKeyword, + TryKeyword, + TypeOfKeyword, + VarKeyword, + VoidKeyword, + WhileKeyword, + WithKeyword, + // Strict mode reserved words + ImplementsKeyword, + InterfaceKeyword, + LetKeyword, + PackageKeyword, + PrivateKeyword, + ProtectedKeyword, + PublicKeyword, + StaticKeyword, + YieldKeyword, + // TypeScript keywords + AnyKeyword, + BooleanKeyword, + ConstructorKeyword, + DeclareKeyword, + GetKeyword, + ModuleKeyword, + RequireKeyword, + NumberKeyword, + SetKeyword, + StringKeyword, + // Parse tree nodes + Missing, + // Names + QualifiedName, + // Signature elements + TypeParameter, + Parameter, + // TypeMember + Property, + Method, + Constructor, + GetAccessor, + SetAccessor, + CallSignature, + ConstructSignature, + IndexSignature, + // Type + TypeReference, + TypeQuery, + TypeLiteral, + ArrayType, + // Expression + ArrayLiteral, + ObjectLiteral, + PropertyAssignment, + PropertyAccess, + IndexedAccess, + CallExpression, + NewExpression, + TypeAssertion, + ParenExpression, + FunctionExpression, + ArrowFunction, + PrefixOperator, + PostfixOperator, + BinaryExpression, + ConditionalExpression, + OmittedExpression, + // Element + Block, + VariableStatement, + EmptyStatement, + ExpressionStatement, + IfStatement, + DoStatement, + WhileStatement, + ForStatement, + ForInStatement, + ContinueStatement, + BreakStatement, + ReturnStatement, + WithStatement, + SwitchStatement, + CaseClause, + DefaultClause, + LabelledStatement, + ThrowStatement, + TryStatement, + TryBlock, + CatchBlock, + FinallyBlock, + DebuggerStatement, + VariableDeclaration, + FunctionDeclaration, + FunctionBlock, + ClassDeclaration, + InterfaceDeclaration, + EnumDeclaration, + ModuleDeclaration, + ModuleBlock, + ImportDeclaration, + ExportAssignment, + // Enum + EnumMember, + // Top-level nodes + SourceFile, + Program, + // Synthesized list + SyntaxList, + // Enum value count + Count, + // Markers + FirstAssignment = EqualsToken, + LastAssignment = CaretEqualsToken, + FirstReservedWord = BreakKeyword, + LastReservedWord = WithKeyword, + FirstKeyword = BreakKeyword, + LastKeyword = StringKeyword + } + + export enum NodeFlags { + Export = 0x00000001, // Declarations + Ambient = 0x00000002, // Declarations + QuestionMark = 0x00000004, // Parameter/Property/Method + Rest = 0x00000008, // Parameter + Public = 0x00000010, // Property/Method + Private = 0x00000020, // Property/Method + Static = 0x00000040, // Property/Method + MultiLine = 0x00000080, // Multi-line array or object literal + Synthetic = 0x00000100, // Synthetic node (for full fidelity) + DeclarationFile = 0x00000200, // Node is a .d.ts file + ExternalModule = 0x00000400, // Node is an external module + + Modifier = Export | Ambient | Public | Private | Static + } + + export interface Node extends TextRange { + kind: SyntaxKind; + flags: NodeFlags; + id?: number; // Unique id (used to look up NodeLinks) + parent?: Node; // Parent node (initialized by binding) + symbol?: Symbol; // Symbol declared by node (initialized by binding) + locals?: SymbolTable; // Locals associated with node (initialized by binding) + } + + export interface NodeArray extends Array, TextRange { } + + export interface Identifier extends Node { + text: string; // Text of identifier (with escapes converted to characters) + } + + export interface QualifiedName extends Node { + // Must have same layout as PropertyAccess + left: EntityName; + right: Identifier; + } + + export interface EntityName extends Node { + // Identifier, QualifiedName, or Missing + } + + export interface ParsedSignature { + typeParameters?: NodeArray; + parameters: NodeArray; + type?: TypeNode; + } + + export interface Declaration extends Node { + name?: Identifier; + } + + export interface TypeParameterDeclaration extends Declaration { + constraint?: TypeNode; + } + + export interface SignatureDeclaration extends Declaration, ParsedSignature { } + + export interface VariableDeclaration extends Declaration { + type?: TypeNode; + initializer?: Expression; + } + + export interface PropertyDeclaration extends VariableDeclaration { } + + export interface ParameterDeclaration extends VariableDeclaration { } + + export interface FunctionDeclaration extends Declaration, ParsedSignature { + body?: Node; // Block or Expression + } + + export interface MethodDeclaration extends FunctionDeclaration { } + + export interface ConstructorDeclaration extends FunctionDeclaration { } + + export interface AccessorDeclaration extends FunctionDeclaration { } + + export interface TypeNode extends Node { } + + export interface TypeReferenceNode extends TypeNode { + typeName: EntityName; + typeArguments?: NodeArray; + } + + export interface TypeQueryNode extends TypeNode { + exprName: EntityName; + } + + export interface TypeLiteralNode extends TypeNode { + members: NodeArray; + } + + export interface ArrayTypeNode extends TypeNode { + elementType: TypeNode; + } + + export interface StringLiteralTypeNode extends TypeNode { + text: string; + } + + export interface Expression extends Node { } + + export interface UnaryExpression extends Expression { + operator: SyntaxKind; + operand: Expression; + } + + export interface BinaryExpression extends Expression { + left: Expression; + operator: SyntaxKind; + right: Expression; + } + + export interface ConditionalExpression extends Expression { + condition: Expression; + whenTrue: Expression; + whenFalse: Expression; + } + + export interface FunctionExpression extends Expression, FunctionDeclaration { } + + // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral + // this means quotes have been removed and escapes have been converted to actual characters. For a NumericLiteral, the + // stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". + export interface LiteralExpression extends Expression { + text: string; + } + + export interface ParenExpression extends Expression { + expression: Expression; + } + + export interface ArrayLiteral extends Expression { + elements: NodeArray; + } + + export interface ObjectLiteral extends Expression { + properties: NodeArray; + } + + export interface PropertyAccess extends Expression { + left: Expression; + right: Identifier; + } + + export interface IndexedAccess extends Expression { + object: Expression; + index: Expression; + } + + export interface CallExpression extends Expression { + func: Expression; + typeArguments?: NodeArray; + arguments: NodeArray; + } + + export interface NewExpression extends CallExpression { } + + export interface TypeAssertion extends Expression { + type: TypeNode; + operand: Expression; + } + + export interface Statement extends Node { } + + export interface Block extends Statement { + statements: NodeArray; + } + + export interface VariableStatement extends Statement { + declarations: NodeArray; + } + + export interface ExpressionStatement extends Statement { + expression: Expression; + } + + export interface IfStatement extends Statement { + expression: Expression; + thenStatement: Statement; + elseStatement?: Statement; + } + + export interface DoStatement extends Statement { + statement: Statement; + expression: Expression; + } + + export interface WhileStatement extends Statement { + statement: Statement; + expression: Expression; + } + + export interface ForStatement extends Statement { + declarations?: NodeArray; + initializer?: Expression; + condition?: Expression; + iterator?: Expression; + statement: Statement; + } + + export interface ForInStatement extends Statement { + declaration?: VariableDeclaration; + variable?: Expression; + expression: Expression; + statement: Statement; + } + + export interface BreakOrContinueStatement extends Statement { + label?: Identifier; + } + + export interface ReturnStatement extends Statement { + expression?: Expression; + } + + export interface WithStatement extends Statement { + expression: Expression; + statement: Statement; + } + + export interface SwitchStatement extends Statement { + expression: Expression; + clauses: NodeArray; + } + + export interface CaseOrDefaultClause extends Node { + expression?: Expression; + statements: NodeArray; + } + + export interface LabelledStatement extends Statement { + label: Identifier; + statement: Statement; + } + + export interface ThrowStatement extends Statement { + expression: Expression; + } + + export interface TryStatement extends Statement { + tryBlock: Block; + catchBlock?: CatchBlock; + finallyBlock?: Block; + } + + export interface CatchBlock extends Block { + variable: Identifier; + } + + export interface ClassDeclaration extends Declaration { + typeParameters?: NodeArray; + baseType?: TypeReferenceNode; + implementedTypes?: NodeArray; + members: NodeArray; + } + + export interface InterfaceDeclaration extends Declaration { + typeParameters?: NodeArray; + baseTypes?: NodeArray; + members: NodeArray; + } + + export interface EnumMember extends Declaration { + initializer?: Expression; + } + + export interface EnumDeclaration extends Declaration { + members: NodeArray; + } + + export interface ModuleDeclaration extends Declaration { + body: Node; // Block or ModuleDeclaration + } + + export interface ImportDeclaration extends Declaration { + entityName?: EntityName; + externalModuleName?: LiteralExpression; + } + + export interface ExportAssignment extends Statement { + exportName: Identifier; + } + + export interface FileReference extends TextRange { + filename: string; + } + + export interface SourceFile extends Block { + filename: string; + text: string; + getLineAndCharacterFromPosition(position: number): { line: number; character: number }; + amdDependencies: string[]; + referencedFiles: FileReference[]; + syntacticErrors: Diagnostic[]; + semanticErrors: Diagnostic[]; + hasNoDefaultLib: boolean; + nodeCount: number; + identifierCount: number; + symbolCount: number; + } + + export interface Program { + getSourceFile(filename: string): SourceFile; + getSourceFiles(): SourceFile[]; + getCompilerOptions(): CompilerOptions; + getCompilerHost(): CompilerHost; + getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getGlobalDiagnostics(): Diagnostic[]; + getTypeChecker(): TypeChecker; + getCommonSourceDirectory(): string; + } + + export interface SourceMapSpan { + /** Line number in the js file*/ + emittedLine: number; + /** Column number in the js file */ + emittedColumn: number; + /** Line number in the ts file */ + sourceLine: number; + /** Column number in the ts file */ + sourceColumn: number; + /** Optional name (index into names array) associated with this span */ + nameIndex?: number; + /** ts file (index into sources array) associated with this span*/ + sourceIndex: number; + } + + export interface SourceMapData { + /** Where the sourcemap file is written */ + sourceMapFilePath: string; + /** source map url written in the js file */ + jsSourceMappingURL: string; + /** Source map's file field - js file name*/ + sourceMapFile: string; + /** Source map's sourceRoot field - location where the sources will be present if not "" */ + sourceMapSourceRoot: string; + /** Source map's sources field - list of sources that can be indexed in this source map*/ + sourceMapSources: string[]; + /** input source file (which one can use on program to get the file) + this is one to one mapping with the sourceMapSources list*/ + inputSourceFileNames: string[]; + /** Source map's names field - list of names that can be indexed in this source map*/ + sourceMapNames?: string[]; + /** Source map's mapping field - encoded source map spans*/ + sourceMapMappings: string; + /** Raw source map spans that were encoded into the sourceMapMappings*/ + sourceMapDecodedMappings: SourceMapSpan[]; + } + + export interface TypeChecker { + getProgram(): Program; + getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getGlobalDiagnostics(): Diagnostic[]; + getNodeCount(): number; + getIdentifierCount(): number; + getSymbolCount(): number; + getTypeCount(): number; + checkProgram(): void; + emitFiles(): SourceMapData[]; // returns list of sourceMapData if compiler emitted sourcemaps + getSymbolOfNode(node: Node): Symbol; + getParentOfSymbol(symbol: Symbol): Symbol; + getTypeOfSymbol(symbol: Symbol): Type; + getDeclaredTypeOfSymbol(symbol: Symbol): Type; + getPropertiesOfType(type: Type): Symbol[]; + getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; + getIndexTypeOfType(type: Type, kind: IndexKind): Type; + getReturnTypeOfSignature(signature: Signature): Type; + resolveEntityName(location: Node, name: EntityName, meaning: SymbolFlags): Symbol; + getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; + getSymbolOfIdentifier(identifier: Identifier): Symbol; + } + + export interface EmitResolver { + getProgram(): Program; + getModuleObjectName(node: ModuleDeclaration): string; + getExpressionNamePrefix(node: Identifier): string; + getPropertyAccessSubstitution(node: PropertyAccess): string; + getExportAssignmentName(node: SourceFile): string; + isReferencedImportDeclaration(node: ImportDeclaration): boolean; + isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean; + getNodeCheckFlags(node: Node): NodeCheckFlags; + getEnumMemberValue(node: EnumMember): number; + shouldEmitDeclarations(): boolean; + } + + export enum SymbolFlags { + Variable = 0x00000001, // Variable or parameter + Property = 0x00000002, // Property or enum member + EnumMember = 0x00000004, // Enum member + Function = 0x00000008, // Function + Class = 0x00000010, // Class + Interface = 0x00000020, // Interface + Enum = 0x00000040, // Enum + ValueModule = 0x00000080, // Instantiated module + NamespaceModule = 0x00000100, // Uninstantiated module + TypeLiteral = 0x00000200, // Type Literal + ObjectLiteral = 0x00000400, // Object Literal + Method = 0x00000800, // Method + Constructor = 0x00001000, // Constructor + GetAccessor = 0x00002000, // Get accessor + SetAccessor = 0x00004000, // Set accessor + CallSignature = 0x00008000, // Call signature + ConstructSignature = 0x00010000, // Construct signature + IndexSignature = 0x00020000, // Index signature + TypeParameter = 0x00040000, // Type parameter + + // Export markers (see comment in declareModuleMember in binder) + ExportValue = 0x00080000, // Exported value marker + ExportType = 0x00100000, // Exported type marker + ExportNamespace = 0x00200000, // Exported namespace marker + + Import = 0x00400000, // Import + Instantiated = 0x00800000, // Instantiated symbol + Merged = 0x01000000, // Merged symbol (created during program binding) + Transient = 0x02000000, // Transient symbol (created during type check) + Prototype = 0x04000000, // Symbol for the prototype property (without source code representation) + + Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor, + Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter, + Namespace = ValueModule | NamespaceModule, + Module = ValueModule | NamespaceModule, + Accessor = GetAccessor | SetAccessor, + Signature = CallSignature | ConstructSignature | IndexSignature, + + ParameterExcludes = Value, + VariableExcludes = Value & ~Variable, + PropertyExcludes = Value, + EnumMemberExcludes = Value, + FunctionExcludes = Value & ~(Function | ValueModule), + ClassExcludes = (Value | Type) & ~ValueModule, + InterfaceExcludes = Type & ~Interface, + EnumExcludes = (Value | Type) & ~(Enum | ValueModule), + ValueModuleExcludes = Value & ~(Function | Class | Enum | ValueModule), + NamespaceModuleExcludes = 0, + MethodExcludes = Value & ~Method, + GetAccessorExcludes = Value & ~SetAccessor, + SetAccessorExcludes = Value & ~GetAccessor, + TypeParameterExcludes = Type & ~TypeParameter, + + // Imports collide with all other imports with the same name. + ImportExcludes = Import, + + ModuleMember = Variable | Function | Class | Interface | Enum | Module | Import, + + ExportHasLocal = Function | Class | Enum | ValueModule, + + HasLocals = Function | Module | Method | Constructor | Accessor | Signature, + HasExports = Class | Enum | Module, + HasMembers = Class | Interface | TypeLiteral | ObjectLiteral, + + IsContainer = HasLocals | HasExports | HasMembers, + PropertyOrAccessor = Property | Accessor, + } + + export interface Symbol { + flags: SymbolFlags; // Symbol flags + name: string; // Name of symbol + id?: number; // Unique id (used to look up SymbolLinks) + mergeId?: number; // Merge id (used to look up merged symbol) + declarations?: Declaration[]; // Declarations associated with this symbol + parent?: Symbol; // Parent symbol + members?: SymbolTable; // Class, interface or literal instance members + exports?: SymbolTable; // Module exports + exportSymbol?: Symbol; // Exported symbol associated with this symbol + exportAssignSymbol?: Symbol; // Symbol exported from external module + valueDeclaration?: Declaration // First value declaration of the symbol + } + + export interface SymbolLinks { + target?: Symbol; // Resolved (non-alias) target of an alias + type?: Type; // Type of value symbol + declaredType?: Type; // Type of class, interface, enum, or type parameter + mapper?: TypeMapper; // Type mapper for instantiation alias + typeChecked?: boolean; // True if symbol has been type checked + referenced?: boolean; // True if alias symbol has been referenced as a value + } + + export interface TransientSymbol extends Symbol, SymbolLinks { } + + export interface SymbolTable { + [index: string]: Symbol; + } + + export enum NodeCheckFlags { + TypeChecked = 0x00000001, // Node has been type checked + LexicalThis = 0x00000002, // Lexical 'this' reference + CaptureThis = 0x00000004, // Lexical 'this' used in body + EmitExtends = 0x00000008, // Emit __extends + SuperInstance = 0x00000010, // Instance 'super' reference + SuperStatic = 0x00000020, // Static 'super' reference + } + + export interface NodeLinks { + resolvedType?: Type; // Cached type of type node + resolvedSignature?: Signature; // Cached signature of signature node + resolvedSymbol?: Symbol; // Cached name resolution result + flags?: NodeCheckFlags; // Set of flags specific to Node + enumMemberValue?: number; // Constant value of enum member + isIllegalTypeReferenceInConstraint?: boolean; // Is type reference in constraint refers to the type parameter from the same list + } + + export enum TypeFlags { + Any = 0x00000001, + String = 0x00000002, + Number = 0x00000004, + Boolean = 0x00000008, + Void = 0x00000010, + Undefined = 0x00000020, + Null = 0x00000040, + Enum = 0x00000080, // Enum type + StringLiteral = 0x00000100, // String literal type + TypeParameter = 0x00000200, // Type parameter + Class = 0x00000400, // Class + Interface = 0x00000800, // Interface + Reference = 0x00001000, // Generic type reference + Anonymous = 0x00002000, // Anonymous + FromSignature = 0x00004000, // Created for signature assignment check + + Intrinsic = Any | String | Number | Boolean | Void | Undefined | Null, + StringLike = String | StringLiteral, + NumberLike = Number | Enum, + ObjectType = Class | Interface | Reference | Anonymous + } + + // Properties common to all types + export interface Type { + flags: TypeFlags; // Flags + id: number; // Unique ID + symbol?: Symbol; // Symbol associated with type (if any) + } + + // Intrinsic types (TypeFlags.Intrinsic) + export interface IntrinsicType extends Type { + intrinsicName: string; // Name of intrinsic type + } + + // String literal types (TypeFlags.StringLiteral) + export interface StringLiteralType extends Type { + text: string; // Text of string literal + } + + // Object types (TypeFlags.ObjectType) + export interface ObjectType extends Type { } + + export interface ApparentType extends Type { + // This property is not used. It is just to make the type system think ApparentType + // is a strict subtype of Type. + _apparentTypeBrand: any; + } + + // Class and interface types (TypeFlags.Class and TypeFlags.Interface) + export interface InterfaceType extends ObjectType { + typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) + baseTypes: ObjectType[]; // Base types + declaredProperties: Symbol[]; // Declared members + declaredCallSignatures: Signature[]; // Declared call signatures + declaredConstructSignatures: Signature[]; // Declared construct signatures + declaredStringIndexType: Type; // Declared string index type + declaredNumberIndexType: Type; // Declared numeric index type + } + + // Type references (TypeFlags.Reference) + export interface TypeReference extends ObjectType { + target: GenericType; // Type reference target + typeArguments: Type[]; // Type reference type arguments + } + + // Generic class and interface types + export interface GenericType extends InterfaceType, TypeReference { + instantiations: Map; // Generic instantiation cache + openReferenceTargets: GenericType[]; // Open type reference targets + openReferenceChecks: Map; // Open type reference check cache + } + + // Resolved object type + export interface ResolvedObjectType extends ObjectType { + members: SymbolTable; // Properties by name + properties: Symbol[]; // Properties + callSignatures: Signature[]; // Call signatures of type + constructSignatures: Signature[]; // Construct signatures of type + stringIndexType: Type; // String index type + numberIndexType: Type; // Numeric index type + } + + // Type parameters (TypeFlags.TypeParameter) + export interface TypeParameter extends Type { + constraint: Type; // Constraint + target?: TypeParameter; // Instantiation target + mapper?: TypeMapper; // Instantiation mapper + } + + export enum SignatureKind { + Call, + Construct, + } + + export interface Signature { + declaration: SignatureDeclaration; // Originating declaration + typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) + parameters: Symbol[]; // Parameters + resolvedReturnType: Type; // Resolved return type + minArgumentCount: number; // Number of non-optional parameters + hasRestParameter: boolean; // True if last parameter is rest parameter + hasStringLiterals: boolean; // True if instantiated + target?: Signature; // Instantiation target + mapper?: TypeMapper; // Instantiation mapper + erasedSignatureCache?: Signature; // Erased version of signature (deferred) + isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison + } + + export enum IndexKind { + String, + Number, + } + + export interface TypeMapper { + (t: Type): Type; + } + + export interface InferenceContext { + typeParameters: TypeParameter[]; + inferences: Type[][]; + inferredTypes: Type[]; + } + + export interface DiagnosticMessage { + key: string; + category: DiagnosticCategory; + code: number; + } + + // A linked list of formatted diagnostic messages to be used as part of a multiline message. + // It is built from the bottom up, leaving the head to be the "main" diagnostic. + // While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, + // the difference is that messages are all preformatted in DMC. + export interface DiagnosticMessageChain { + messageText: string; + category: DiagnosticCategory; + code: number; + next?: DiagnosticMessageChain; + } + + export interface Diagnostic { + file: SourceFile; + start: number; + length: number; + messageText: string; + category: DiagnosticCategory; + code: number; + } + + export enum DiagnosticCategory { + Warning, + Error, + Message, + NoPrefix + } + + export interface CompilerOptions { + codepage?: number; + declaration?: boolean; + diagnostics?: boolean; + help?: boolean; + locale?: string; + mapRoot?: string; + module?: ModuleKind; + noImplicitAny?: boolean; + noLib?: boolean; + noLibCheck?: boolean; + noResolve?: boolean; + out?: string; + outDir?: string; + removeComments?: boolean; + sourceMap?: boolean; + sourceRoot?: string; + target?: ScriptTarget; + version?: boolean; + + [option: string]: any; + } + + export enum ModuleKind { + None, + CommonJS, + AMD, + } + + export enum ScriptTarget { + ES3, + ES5, + } + + export interface ParsedCommandLine { + options: CompilerOptions; + filenames: string[]; + errors: Diagnostic[]; + } + + export interface CommandLineOption { + name: string; + type: any; + error?: DiagnosticMessage; + } + + export enum CharacterCodes { + nullCharacter = 0, + maxAsciiCharacter = 0x7F, + + lineFeed = 0x0A, // \n + carriageReturn = 0x0D, // \r + lineSeparator = 0x2028, + paragraphSeparator = 0x2029, + + // REVIEW: do we need to support this? The scanner doesn't, but our IText does. This seems + // like an odd disparity? (Or maybe it's completely fine for them to be different). + nextLine = 0x0085, + + // Unicode 3.0 space characters + space = 0x0020, // " " + nonBreakingSpace = 0x00A0, // + enQuad = 0x2000, + emQuad = 0x2001, + enSpace = 0x2002, + emSpace = 0x2003, + threePerEmSpace = 0x2004, + fourPerEmSpace = 0x2005, + sixPerEmSpace = 0x2006, + figureSpace = 0x2007, + punctuationSpace = 0x2008, + thinSpace = 0x2009, + hairSpace = 0x200A, + zeroWidthSpace = 0x200B, + narrowNoBreakSpace = 0x202F, + ideographicSpace = 0x3000, + mathematicalSpace = 0x205F, + ogham = 0x1680, + + _ = 0x5F, + $ = 0x24, + + _0 = 0x30, + _1 = 0x31, + _2 = 0x32, + _3 = 0x33, + _4 = 0x34, + _5 = 0x35, + _6 = 0x36, + _7 = 0x37, + _8 = 0x38, + _9 = 0x39, + + a = 0x61, + b = 0x62, + c = 0x63, + d = 0x64, + e = 0x65, + f = 0x66, + g = 0x67, + h = 0x68, + i = 0x69, + j = 0x6A, + k = 0x6B, + l = 0x6C, + m = 0x6D, + n = 0x6E, + o = 0x6F, + p = 0x70, + q = 0x71, + r = 0x72, + s = 0x73, + t = 0x74, + u = 0x75, + v = 0x76, + w = 0x77, + x = 0x78, + y = 0x79, + z = 0x7A, + + A = 0x41, + B = 0x42, + C = 0x43, + D = 0x44, + E = 0x45, + F = 0x46, + G = 0x47, + H = 0x48, + I = 0x49, + J = 0x4A, + K = 0x4B, + L = 0x4C, + M = 0x4D, + N = 0x4E, + O = 0x4F, + P = 0x50, + Q = 0x51, + R = 0x52, + S = 0x53, + T = 0x54, + U = 0x55, + V = 0x56, + W = 0x57, + X = 0x58, + Y = 0x59, + Z = 0x5a, + + ampersand = 0x26, // & + asterisk = 0x2A, // * + at = 0x40, // @ + backslash = 0x5C, // \ + bar = 0x7C, // | + caret = 0x5E, // ^ + closeBrace = 0x7D, // } + closeBracket = 0x5D, // ] + closeParen = 0x29, // ) + colon = 0x3A, // : + comma = 0x2C, // , + dot = 0x2E, // . + doubleQuote = 0x22, // " + equals = 0x3D, // = + exclamation = 0x21, // ! + greaterThan = 0x3E, // > + lessThan = 0x3C, // < + minus = 0x2D, // - + openBrace = 0x7B, // { + openBracket = 0x5B, // [ + openParen = 0x28, // ( + percent = 0x25, // % + plus = 0x2B, // + + question = 0x3F, // ? + semicolon = 0x3B, // ; + singleQuote = 0x27, // ' + slash = 0x2F, // / + tilde = 0x7E, // ~ + + backspace = 0x08, // \b + formFeed = 0x0C, // \f + byteOrderMark = 0xFEFF, + tab = 0x09, // \t + verticalTab = 0x0B, // \v + } + + export interface CancellationToken { + isCancellationRequested(): boolean; + } + + export interface CompilerHost { + getSourceFile(filename: string, languageVersion: ScriptTarget): SourceFile; + getDefaultLibFilename(): string; + getCancellationToken? (): CancellationToken; + writeFile(filename: string, data: string): void; + getCurrentDirectory(): string; + getCanonicalFileName(fileName: string): string; + useCaseSensitiveFileNames(): boolean; + } +} diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts new file mode 100644 index 0000000000000..8ba8f287184f5 --- /dev/null +++ b/src/harness/compilerRunner.ts @@ -0,0 +1,468 @@ +/// +/// +/// +/// + +enum CompilerTestType { + Conformance, + Regressions, + Test262 +} + +class CompilerBaselineRunner extends RunnerBase { + private basePath = 'tests/cases'; + private errors: boolean; + private emit: boolean; + private decl: boolean; + private output: boolean; + + public options: string; + + constructor(public testType?: CompilerTestType) { + super(); + this.errors = true; + this.emit = true; + this.decl = true; + this.output = true; + if (testType === CompilerTestType.Conformance) { + this.basePath += '/conformance'; + } + else if (testType === CompilerTestType.Regressions) { + this.basePath += '/compiler'; + } + else if (testType === CompilerTestType.Test262) { + this.basePath += '/test262'; + } else { + this.basePath += '/compiler'; // default to this for historical reasons + } + } + + public checkTestCodeOutput(fileName: string) { + describe('compiler tests for ' + fileName, () => { + // strips the fileName from the path. + var justName = fileName.replace(/^.*[\\\/]/, ''); + var content = Harness.IO.readFile(fileName); + var testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName); + + var units = testCaseContent.testUnitData; + var tcSettings = testCaseContent.settings; + var createNewInstance = false; + + var lastUnit = units[units.length - 1]; + + var result: Harness.Compiler.CompilerResult; + var options: ts.CompilerOptions; + // equivalent to the files that will be passed on the command line + var toBeCompiled: { unitName: string; content: string }[]; + // equivalent to other files on the file system not directly passed to the compiler (ie things that are referenced by other files) + var otherFiles: { unitName: string; content: string }[]; + var harnessCompiler: Harness.Compiler.HarnessCompiler; + + var createNewInstance = false; + + before(() => { + harnessCompiler = Harness.Compiler.getCompiler(); + // We need to assemble the list of input files for the compiler and other related files on the 'filesystem' (ie in a multi-file test) + // If the last file in a test uses require or a triple slash reference we'll assume all other files will be brought in via references, + // otherwise, assume all files are just meant to be in the same compilation session without explicit references to one another. + toBeCompiled = []; + otherFiles = []; + var rootDir = lastUnit.originalFilePath.indexOf('conformance') === -1 ? 'tests/cases/compiler/' : lastUnit.originalFilePath.substring(0, lastUnit.originalFilePath.lastIndexOf('/')) + '/'; + if (/require\(/.test(lastUnit.content) || /reference\spath/.test(lastUnit.content)) { + toBeCompiled.push({ unitName: rootDir + lastUnit.name, content: lastUnit.content }); + units.forEach(unit => { + if (unit.name !== lastUnit.name) { + otherFiles.push({ unitName: rootDir + unit.name, content: unit.content }); + } + }); + } else { + toBeCompiled = units.map(unit => { + return { unitName: rootDir + unit.name, content: unit.content }; + }); + } + + options = harnessCompiler.compileFiles(toBeCompiled, otherFiles, function (compileResult) { + result = compileResult; + }, function (settings) { + harnessCompiler.setCompilerSettings(tcSettings); + }); + }); + + beforeEach(() => { + /* The compiler doesn't handle certain flags flipping during a single compilation setting. Tests on these flags will need + a fresh compiler instance for themselves and then create a fresh one for the next test. Would be nice to get dev fixes + eventually to remove this limitation. */ + for (var i = 0; i < tcSettings.length; ++i) { + if (!createNewInstance && (tcSettings[i].flag == "noimplicitany" || tcSettings[i].flag === 'target')) { + harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: tcSettings[i].flag === "noimplicitany" } + }); + harnessCompiler.setCompilerSettings(tcSettings); + createNewInstance = true; + } + } + }); + + afterEach(() => { + if (createNewInstance) { + harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } + }); + createNewInstance = false; + } + }); + + // check errors + it('Correct errors for ' + fileName, () => { + if (this.errors) { + Harness.Baseline.runBaseline('Correct errors for ' + fileName, justName.replace(/\.ts$/, '.errors.txt'), (): string => { + if (result.errors.length === 0) return null; + + var outputLines: string[] = []; + // Count up all the errors we find so we don't miss any + var totalErrorsReported = 0; + + // 'merge' the lines of each input file with any errors associated with it + toBeCompiled.concat(otherFiles).forEach(inputFile => { + // Filter down to the errors in the file + // TODO/REVIEW: this doesn't work quite right in the browser if a multi file test has files whose names are just the right length relative to one another + var fileErrors = result.errors.filter(e => { + var errFn = e.filename; + return errFn && errFn.indexOf(inputFile.unitName) === errFn.length - inputFile.unitName.length; + }); + + // Add this to the number of errors we've seen so far + totalErrorsReported += fileErrors.length; + + // Header + outputLines.push('==== ' + inputFile.unitName + ' (' + fileErrors.length + ' errors) ===='); + + // Make sure we emit something for every error + var markedErrorCount = 0; + // For each line, emit the line followed by any error squiggles matching this line + // Note: IE JS engine incorrectly handles consecutive delimiters here when using RegExp split, so + // we have to string-based splitting instead and try to figure out the delimiting chars + + // var fileLineMap = TypeScript.LineMap1.fromString(inputFile.content); + var lines = inputFile.content.split('\n'); + var currentLineStart = 0; + lines.forEach((line, lineIndex) => { + if (line.length > 0 && line.charAt(line.length - 1) === '\r') { + line = line.substr(0, line.length - 1); + } + + var thisLineStart = currentLineStart; //fileLineMap.getLineStartPosition(lineIndex); + var nextLineStart: number; + // On the last line of the file, fake the next line start number so that we handle errors on the last character of the file correctly + if (lineIndex === lines.length - 1) { + nextLineStart = inputFile.content.length; + } else { + nextLineStart = currentLineStart + line.length + 1; //fileLineMap.getLineStartPosition(lineIndex + 1); + } + // Emit this line from the original file + outputLines.push(' ' + line); + fileErrors.forEach(err => { + // Does any error start or continue on to this line? Emit squiggles + if ((err.end >= thisLineStart) && ((err.start < nextLineStart) || (lineIndex === lines.length - 1))) { + // How many characters from the start of this line the error starts at (could be positive or negative) + var relativeOffset = err.start - thisLineStart; + // How many characters of the error are on this line (might be longer than this line in reality) + var length = (err.end - err.start) - Math.max(0, thisLineStart - err.start); + // Calculate the start of the squiggle + var squiggleStart = Math.max(0, relativeOffset); + // TODO/REVIEW: this doesn't work quite right in the browser if a multi file test has files whose names are just the right length relative to one another + outputLines.push(' ' + line.substr(0, squiggleStart).replace(/[^\s]/g, ' ') + new Array(Math.min(length, line.length - squiggleStart) + 1).join('~')); + + // If the error ended here, or we're at the end of the file, emit its message + if ((lineIndex === lines.length - 1) || nextLineStart > err.end) { + // Just like above, we need to do a split on a string instead of on a regex + // because the JS engine does regexes wrong + + var errLines = RunnerBase.removeFullPaths(err.message) + .split('\n') + .map(s => s.length > 0 && s.charAt(s.length - 1) === '\r' ? s.substr(0, s.length - 1) : s) + .filter(s => s.length > 0) + .map(s => '!!! ' + s); + errLines.forEach(e => outputLines.push(e)); + markedErrorCount++; + } + } + }); + currentLineStart += line.length + 1; // +1 for the \n character + }); + + // Verify we didn't miss any errors in this file + assert.equal(markedErrorCount, fileErrors.length, 'count of errors in ' + inputFile.unitName); + }); + + // Verify we didn't miss any errors in total + // NEWTODO: Re-enable this -- somehow got broken + // assert.equal(totalErrorsReported, result.errors.length, 'total number of errors'); + + return outputLines.join('\r\n'); + }); + } + }); + + // Source maps? + it('Correct sourcemap content for ' + fileName, () => { + if (result.sourceMapRecord) { + Harness.Baseline.runBaseline('Correct sourcemap content for ' + fileName, justName.replace(/\.ts$/, '.sourcemap.txt'), () => { + return result.sourceMapRecord; + }); + } + }); + + /* + it(".d.ts compiles without error", () => { + // if the .d.ts is non-empty, confirm it compiles correctly as well + if (this.decl && result.declFilesCode.length > 0 && result.errors.length === 0) { + + var declErrors: string[] = undefined; + + var declOtherFiles: { unitName: string; content: string }[] = []; + + // use other files if it is dts + for (var i = 0; i < otherFiles.length; i++) { + if (TypeScript.isDTSFile(otherFiles[i].unitName)) { + declOtherFiles.push(otherFiles[i]); + } + } + + for (var i = 0; i < result.declFilesCode.length; i++) { + var declCode = result.declFilesCode[i]; + // don't want to use the fullpath for the unitName or the file won't be resolved correctly + // TODO: wrong path for conformance tests? + + var declFile = { unitName: 'tests/cases/compiler/' + Harness.getFileName(declCode.fileName), content: declCode.code }; + if (i != result.declFilesCode.length - 1) { + declOtherFiles.push(declFile); + } + } + + harnessCompiler.compileFiles( + [declFile], + declOtherFiles, + (result) => { + declErrors = result.errors.map(err => err.message + "\r\n"); + }, + function (settings) { + harnessCompiler.setCompilerSettings(tcSettings); + }); + + if (declErrors && declErrors.length) { + throw new Error('.d.ts file output of ' + fileName + ' did not compile. Errors: ' + declErrors.map(err => JSON.stringify(err)).join('\r\n')); + } + } + }); + */ + + it('Correct JS output for ' + fileName, () => { + if (!ts.fileExtensionIs(lastUnit.name, '.d.ts') && this.emit) { + if (result.files.length === 0 && result.errors.length === 0) { + throw new Error('Expected at least one js file to be emitted or at least one error to be created.'); + } + + // check js output + Harness.Baseline.runBaseline('Correct JS output for ' + fileName, justName.replace(/\.ts/, '.js'), () => { + var tsCode = ''; + var tsSources = otherFiles.concat(toBeCompiled); + if (tsSources.length > 1) { + tsCode += '//// [' + fileName + '] ////\r\n\r\n'; + } + for (var i = 0; i < tsSources.length; i++) { + tsCode += '//// [' + Harness.Path.getFileName(tsSources[i].unitName) + ']\r\n'; + tsCode += tsSources[i].content + (i < (tsSources.length - 1) ? '\r\n' : ''); + } + + var jsCode = ''; + for (var i = 0; i < result.files.length; i++) { + jsCode += '//// [' + Harness.Path.getFileName(result.files[i].fileName) + ']\r\n'; + jsCode += result.files[i].code; + // Re-enable this if we want to do another comparison of old vs new compiler baselines + // jsCode += SyntacticCleaner.clean(result.files[i].code); + } + + if (result.declFilesCode.length > 0) { + jsCode += '\r\n\r\n'; + for (var i = 0; i < result.files.length; i++) { + jsCode += '//// [' + Harness.Path.getFileName(result.declFilesCode[i].fileName) + ']\r\n'; + jsCode += result.declFilesCode[i].code; + } + } + + if (jsCode.length > 0) { + return tsCode + '\r\n\r\n' + jsCode; + } else { + return null; + } + }); + } + }); + + it('Correct Sourcemap output for ' + fileName, () => { + if (options.sourceMap) { + if (result.sourceMaps.length !== result.files.length) { + throw new Error('Number of sourcemap files should be same as js files.'); + } + + Harness.Baseline.runBaseline('Correct Sourcemap output for ' + fileName, justName.replace(/\.ts/, '.js.map'), () => { + var sourceMapCode = ''; + for (var i = 0; i < result.sourceMaps.length; i++) { + sourceMapCode += '//// [' + Harness.Path.getFileName(result.sourceMaps[i].fileName) + ']\r\n'; + sourceMapCode += result.sourceMaps[i].code; + } + + return sourceMapCode; + }); + } + }); + + it('Correct type baselines for ' + fileName, () => { + // NEWTODO: Type baselines + if (/* ! */ false && /* ! */ result.errors.length === 0) { + Harness.Baseline.runBaseline('Correct expression types for ' + fileName, justName.replace(/\.ts/, '.types'), () => { + // TODO: Rewrite this part + //var compiler = new TypeScript.TypeScriptCompiler( + // new TypeScript.NullLogger(), TypeScript.ImmutableCompilationSettings.defaultSettings()); + + //compiler.addFile('lib.d.ts', TypeScript.ScriptSnapshot.fromString(Harness.Compiler.libTextMinimal), + // TypeScript.ByteOrderMark.None, /*version:*/ "0", /*isOpen:*/ true); + + //var allFiles = toBeCompiled.concat(otherFiles); + //allFiles.forEach(file => { + // compiler.addFile(file.unitName, TypeScript.ScriptSnapshot.fromString(file.content), + // TypeScript.ByteOrderMark.None, /*version:*/ "0", /*isOpen:*/ true); + //}); + + var allFiles: any[] = []; + var compiler: any = undefined; + + var typeBaselineText = ''; + var typeLines: string[] = []; + var typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {}; + allFiles.forEach(file => { + var codeLines = file.content.split('\n'); + var walker = new TypeWriterWalker(file.unitName, compiler); + walker.run(); + walker.results.forEach(result => { + var formattedLine = result.identifierName + " : " + result.type; + if (!typeMap[file.unitName]) { + typeMap[file.unitName] = {} + } + + var typeInfo = [formattedLine]; + var existingTypeInfo = typeMap[file.unitName][result.line]; + if (existingTypeInfo) { + typeInfo = existingTypeInfo.concat(typeInfo); + } + typeMap[file.unitName][result.line] = typeInfo; + }); + + var typeBaselineText = ''; + var typeLines: string[] = []; + var typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {}; + allFiles.forEach(file => { + var codeLines = file.content.split('\n'); + var walker = new TypeWriterWalker(file.unitName, compiler); + walker.run(); + walker.results.forEach(result => { + var formattedLine = result.identifierName + " : " + result.type; + if (!typeMap[file.unitName]) { + typeMap[file.unitName] = {} + } else { + typeLines.push('No type information for this code.'); + } + }); + }); + + typeLines.push('=== ' + file.unitName + ' ===\r\n'); + for (var i = 0; i < codeLines.length; i++) { + var currentCodeLine = codeLines[i]; + var lastLine = typeLines[typeLines.length]; + typeLines.push(currentCodeLine + '\r\n'); + if (typeMap[file.unitName]) { + var typeInfo = typeMap[file.unitName][i]; + if (typeInfo) { + var leadingSpaces = ''; + typeInfo.forEach(ty => { + typeLines.push('>' + ty + '\r\n'); + }); + if (i + 1 < codeLines.length && (codeLines[i + 1].match(/^\s*[{|}]\s*$/) || codeLines[i + 1].trim() === '')) { + } else { + typeLines.push('\r\n'); + } + } + } else { + typeLines.push('No type information for this code.'); + } + } + }); + + return typeLines.join(''); + }); + } + }); + }); + } + + public initializeTests() { + describe("Setup compiler for compiler baselines", () => { + var harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } + }); + this.parseOptions(); + }); + + // this will set up a series of describe/it blocks to run between the setup and cleanup phases + if (this.tests.length === 0) { + var testFiles = this.enumerateFiles(this.basePath, /\.ts$/, { recursive: true }); + testFiles.forEach(fn => { + fn = fn.replace(/\\/g, "/"); + this.checkTestCodeOutput(fn); + }); + } + else { + this.tests.forEach(test => this.checkTestCodeOutput(test)); + } + + describe("Cleanup after compiler baselines", () => { + var harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } + }); + }); + } + + private parseOptions() { + if (this.options && this.options.length > 0) { + this.errors = false; + this.emit = false; + this.decl = false; + this.output = false; + + var opts = this.options.split(','); + for (var i = 0; i < opts.length; i++) { + switch (opts[i]) { + case 'error': + this.errors = true; + break; + case 'emit': + this.emit = true; + break; + case 'decl': + this.decl = true; + break; + case 'output': + this.output = true; + break; + default: + throw new Error('unsupported flag'); + } + } + } + } +} \ No newline at end of file diff --git a/src/harness/exec.ts b/src/harness/exec.ts new file mode 100644 index 0000000000000..702a8079fed2d --- /dev/null +++ b/src/harness/exec.ts @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Allows for executing a program with command-line arguments and reading the result +interface IExec { + exec: (fileName: string, cmdLineArgs: string[], handleResult: (ExecResult: ExecResult) => void) => void; +} + +class ExecResult { + public stdout = ""; + public stderr = ""; + public exitCode: number; +} + +class WindowsScriptHostExec implements IExec { + public exec(fileName: string, cmdLineArgs: string[], handleResult: (ExecResult: ExecResult) => void) : void { + var result = new ExecResult(); + var shell = new ActiveXObject('WScript.Shell'); + try { + var process = shell.Exec(fileName + ' ' + cmdLineArgs.join(' ')); + } catch(e) { + result.stderr = e.message; + result.exitCode = 1 + handleResult(result); + return; + } + // Wait for it to finish running + while (process.Status != 0) { /* todo: sleep? */ } + + + result.exitCode = process.ExitCode; + if(!process.StdOut.AtEndOfStream) result.stdout = process.StdOut.ReadAll(); + if(!process.StdErr.AtEndOfStream) result.stderr = process.StdErr.ReadAll(); + + handleResult(result); + } +} + +class NodeExec implements IExec { + public exec(fileName: string, cmdLineArgs: string[], handleResult: (ExecResult: ExecResult) => void) : void { + var nodeExec = require('child_process').exec; + + var result = new ExecResult(); + result.exitCode = null; + var cmdLine = fileName + ' ' + cmdLineArgs.join(' '); + var process = nodeExec(cmdLine, function(error: any, stdout: string, stderr: string) { + result.stdout = stdout; + result.stderr = stderr; + result.exitCode = error ? error.code : 0; + handleResult(result); + }); + } +} + +var Exec: IExec = function() : IExec { + var global = Function("return this;").call(null); + if(typeof global.ActiveXObject !== "undefined") { + return new WindowsScriptHostExec(); + } else { + return new NodeExec(); + } +}(); \ No newline at end of file diff --git a/src/harness/external/chai.d.ts b/src/harness/external/chai.d.ts new file mode 100644 index 0000000000000..814de75e7b254 --- /dev/null +++ b/src/harness/external/chai.d.ts @@ -0,0 +1,175 @@ +// Type definitions for chai 1.7.2 +// Project: http://chaijs.com/ +// Definitions by: Jed Hunsaker +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + + +declare module chai { + + function expect(target: any, message?: string): Expect; + + // Provides a way to extend the internals of Chai + function use(fn: (chai: any, utils: any) => void): any; + + interface ExpectStatic { + (target: any): Expect; + } + + interface Assertions { + attr(name: string, value?: string): any; + css(name: string, value?: string): any; + data(name: string, value?: string): any; + class(className: string): any; + id(id: string): any; + html(html: string): any; + text(text: string): any; + value(value: string): any; + visible: any; + hidden: any; + selected: any; + checked: any; + disabled: any; + empty: any; + exist: any; + } + + interface Expect extends LanguageChains, NumericComparison, TypeComparison, Assertions { + not: Expect; + deep: Deep; + a: TypeComparison; + an: TypeComparison; + include: Include; + contain: Include; + ok: Expect; + true: Expect; + false: Expect; + null: Expect; + undefined: Expect; + exist: Expect; + empty: Expect; + arguments: Expect; + Arguments: Expect; + equal: Equal; + equals: Equal; + eq: Equal; + eql: Equal; + eqls: Equal; + property: Property; + ownProperty: OwnProperty; + haveOwnProperty: OwnProperty; + length: Length; + lengthOf: Length; + match(RegularExpression: RegExp, message?: string): Expect; + string(string: string, message?: string): Expect; + keys: Keys; + key(string: string): Expect; + throw: Throw; + throws: Throw; + Throw: Throw; + respondTo(method: string, message?: string): Expect; + itself: Expect; + satisfy(matcher: Function, message?: string): Expect; + closeTo(expected: number, delta: number, message?: string): Expect; + members: Members; + } + + interface LanguageChains { + to: Expect; + be: Expect; + been: Expect; + is: Expect; + that: Expect; + and: Expect; + have: Expect; + with: Expect; + at: Expect; + of: Expect; + same: Expect; + } + + interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; + least: NumberComparer; + gte: NumberComparer; + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; + most: NumberComparer; + lte: NumberComparer; + within(start: number, finish: number, message?: string): Expect; + } + + interface NumberComparer { + (value: number, message?: string): Expect; + } + + interface TypeComparison { + (type: string, message?: string): Expect; + instanceof: InstanceOf; + instanceOf: InstanceOf; + } + + interface InstanceOf { + (constructor: Object, message?: string): Expect; + } + + interface Deep { + equal: Equal; + property: Property; + } + + interface Equal { + (value: any, message?: string): Expect; + } + + interface Property { + (name: string, value?: any, message?: string): Expect; + } + + interface OwnProperty { + (name: string, message?: string): Expect; + } + + interface Length extends LanguageChains, NumericComparison { + (length: number, message?: string): Expect; + } + + interface Include { + (value: Object, message?: string): Expect; + (value: string, message?: string): Expect; + (value: number, message?: string): Expect; + keys: Keys; + members: Members; + } + + interface Keys { + (...keys: string[]): Expect; + (keys: any[]): Expect; + } + + interface Members { + (set: any[], message?: string): Expect; + } + + interface Throw { + (): Expect; + (expected: string, message?: string): Expect; + (expected: RegExp, message?: string): Expect; + (constructor: Error, expected?: string, message?: string): Expect; + (constructor: Error, expected?: RegExp, message?: string): Expect; + (constructor: Function, expected?: string, message?: string): Expect; + (constructor: Function, expected?: RegExp, message?: string): Expect; + } + + function assert(expression: any, message?: string): void; + module assert { + function equal(actual: any, expected: any, message?: string): void; + function notEqual(actual: any, expected: any, message?: string): void; + function isTrue(value: any, message?: string): void; + function isFalse(value: any, message?: string): void; + function isNull(value: any, message?: string): void; + function isNotNull(value: any, message?: string): void; + } +} \ No newline at end of file diff --git a/src/harness/external/es5compat.js b/src/harness/external/es5compat.js new file mode 100644 index 0000000000000..0fa88ee36850a --- /dev/null +++ b/src/harness/external/es5compat.js @@ -0,0 +1,225 @@ +if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g, ''); + }; +} + +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (searchElement, fromIndex) { + "use strict"; + if (this == null) { + throw new TypeError(); + } + var t = Object(this); + var len = t.length >>> 0; + if (len === 0) { + return -1; + } + var n = 0; + if (arguments.length > 0) { + n = Number(arguments[1]); + if (n != n) { + n = 0; + } else if (n != 0 && n != Infinity && n != -Infinity) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + } + if (n >= len) { + return -1; + } + var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); + for (; k < len; k++) { + if (k in t && t[k] === searchElement) { + return k; + } + } + return -1; + }; +} + +if (!Array.prototype.filter) { + Array.prototype.filter = function (fun, thisp) { + "use strict"; + + if (this == null) + throw new TypeError(); + + var t = Object(this); + var len = t.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var res = []; + for (var i = 0; i < len; i++) { + if (i in t) { + var val = t[i]; + if (fun.call(thisp, val, i, t)) + res.push(val); + } + } + + return res; + }; +} + +if (!Array.prototype.map) { + Array.prototype.map = function (callback, thisArg) { + var T = undefined, A, k; + + if (this == null) { + throw new TypeError(" this is null or not defined"); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + if ({}.toString.call(callback) != "[object Function]") { + throw new TypeError(callback + " is not a function"); + } + + if (thisArg) { + T = thisArg; + } + + // 6. Let A be a new array created as if by the expression new Array(len) where Array is + // the standard built-in constructor with that name and len is the value of len. + A = new Array(len); + + // 7. Let k be 0 + k = 0; + + while (k < len) { + var kValue, mappedValue; + + if (k in O) { + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Let mappedValue be the result of calling the Call internal method of callback + // with T as the this value and argument list containing kValue, k, and O. + mappedValue = callback.call(T, kValue, k, O); + + // iii. Call the DefineOwnProperty internal method of A with arguments + // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true}, + // and false. + // In browsers that support Object.defineProperty, use the following: + // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true }); + // For best browser support, use the following: + A[k] = mappedValue; + } + + // d. Increase k by 1. + k++; + } + + // 9. return A + return A; + }; +} + +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(accumulator) { + if (this === null || this === undefined) + throw new TypeError("Object is null or undefined"); + var i = 0, l = this.length >> 0, curr; + + if (typeof accumulator !== "function") + throw new TypeError("First argument is not callable"); + + if (arguments.length < 2) { + if (l === 0) + throw new TypeError("Array length is 0 and no second argument"); + curr = this[0]; + i = 1; + } else + curr = arguments[1]; + + while (i < l) { + if (i in this) + curr = accumulator.call(undefined, curr, this[i], i, this); + ++i; + } + + return curr; + }; +} + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function (callback, thisArg) { + var T, k; + + if (this == null) { + throw new TypeError(" this is null or not defined"); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + if ({}.toString.call(callback) != "[object Function]") { + throw new TypeError(callback + " is not a function"); + } + + if (thisArg) { + T = thisArg; + } else { + T = undefined; + } + + // 6. Let k be 0 + k = 0; + + while (k < len) { + var kValue; + + if (k in O) { + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Call the Call internal method of callback with T as the this value and + // argument list containing kValue, k, and O. + callback.call(T, kValue, k, O); + } + + // d. Increase k by 1. + k++; + } + // 8. return undefined + }; +} + +if (!Date.now) { + Date.now = function () { + return (new Date()).getTime(); + }; +} + +if (!Array.prototype.some) { + Array.prototype.some = function (fun/*, thisp */ ) { + "use strict"; + + if (this == null) + throw new TypeError(); + + var t = Object(this); + var len = t.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + var idx = i.toString(); + if (idx in t && fun.call(thisp, t[i], i, t)) + return true; + } + + return false; + }; +} diff --git a/src/harness/external/es5compat.ts b/src/harness/external/es5compat.ts new file mode 100644 index 0000000000000..1cd6a50905aaa --- /dev/null +++ b/src/harness/external/es5compat.ts @@ -0,0 +1,354 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/*----------------- ThirdPartyNotices ------------------------------------------------------- + +This file is based on or incorporates material from the projects listed below +(collectively "Third Party Code"). Microsoft is not the original author of the +Third Party Code. The original copyright notice and the license, under which +Microsoft received such Third Party Code, are set forth below. Such license and +notices are provided for informational purposes only. Microsoft licenses the Third +Party Code to you under the terms of the Apache 2.0 License. + +-- +Array filter Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter + +Array forEach Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach + +Array indexOf Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf + +Array map Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map + +Array Reduce Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce + +Array some Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/some + +String Trim Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim + +Date now Compatibility Method, +Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now + +Copyright (c) 2007 - 2012 Mozilla Developer Network and individual contributors + +Licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you +may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR +CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions and +limitations under the License. + +-- +Original License provided for Informational Purposes Only +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------- End of ThirdPartyNotices --------------------------------------------------- */ + + +// Compatibility with non ES5 compliant engines +if (!String.prototype.trim) { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; +} + +// Compatibility with non ES5 compliant engines +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (searchElement: any, fromIndex?: any) { + "use strict"; + if (this == null) { + throw new TypeError(); + } + var t = Object(this); + var len: any = t.length >>> 0; + if (len === 0) { + return -1; + } + var n: any = 0; + if (arguments.length > 0) { + n = Number(arguments[1]); + if (n != n) { // shortcut for verifying if it's NaN + n = 0; + } + else if (n != 0 && n != Infinity && n != -Infinity) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + } + if (n >= len) { + return -1; + } + var k: any = n >= 0 ? n : Math.max(len - Math.abs(n), 0); + for (; k < len; k++) { + if (k in t && t[k] === searchElement) { + return k; + } + } + return -1; + } +} + +if (!Array.prototype.filter) +{ + Array.prototype.filter = function(fun: any, thisp?: any) + { + "use strict"; + + if (this == null) + throw new TypeError(); + + var t = Object(this); + var len = t.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var res: any[] = []; + for (var i = 0; i < len; i++) + { + if (i in t) + { + var val = t[i]; // in case fun mutates this + if (fun.call(thisp, val, i, t)) + res.push(val); + } + } + + return res; + }; +} + +// Production steps of ECMA-262, Edition 5, 15.4.4.19 +// Reference: http://es5.github.com/#x15.4.4.19 +if (!Array.prototype.map) { + Array.prototype.map = function(callback: any, thisArg?: any) { + + var T: any = undefined, A: any, k: any; + + if (this == null) { + throw new TypeError(" this is null or not defined"); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if ({}.toString.call(callback) != "[object Function]") { + throw new TypeError(callback + " is not a function"); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (thisArg) { + T = thisArg; + } + + // 6. Let A be a new array created as if by the expression new Array(len) where Array is + // the standard built-in constructor with that name and len is the value of len. + A = new Array(len); + + // 7. Let k be 0 + k = 0; + + // 8. Repeat, while k < len + while(k < len) { + + var kValue: any, mappedValue: any; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[ k ]; + + // ii. Let mappedValue be the result of calling the Call internal method of callback + // with T as the this value and argument list containing kValue, k, and O. + mappedValue = callback.call(T, kValue, k, O); + + // iii. Call the DefineOwnProperty internal method of A with arguments + // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true}, + // and false. + + // In browsers that support Object.defineProperty, use the following: + // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true }); + + // For best browser support, use the following: + A[ k ] = mappedValue; + } + // d. Increase k by 1. + k++; + } + + // 9. return A + return A; + }; +} + +if (!Array.prototype.reduce) { + Array.prototype.reduce = function reduce(accumulator: any){ + if (this===null || this===undefined) throw new TypeError("Object is null or undefined"); + var i = 0, l = this.length >> 0, curr: any; + + if(typeof accumulator !== "function") // ES5 : "If IsCallable(callbackfn) is false, throw a TypeError exception." + throw new TypeError("First argument is not callable"); + + if(arguments.length < 2) { + if (l === 0) throw new TypeError("Array length is 0 and no second argument"); + curr = this[0]; + i = 1; // start accumulating at the second element + } + else + curr = arguments[1]; + + while (i < l) { + if(i in this) curr = accumulator.call(undefined, curr, this[i], i, this); + ++i; + } + + return curr; + }; +} + +// Compatibility with non ES5 compliant engines +// Production steps of ECMA-262, Edition 5, 15.4.4.18 +// Reference: http://es5.github.com/#x15.4.4.18 +if (!Array.prototype.forEach) { + Array.prototype.forEach = function(callback: any, thisArg?: any) { + + var T: any, k: any; + + if (this == null) { + throw new TypeError(" this is null or not defined"); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; // Hack to convert O.length to a UInt32 + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if ({ }.toString.call(callback) != "[object Function]") { + throw new TypeError(callback + " is not a function"); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (thisArg) { + T = thisArg; + } + else { + T = undefined; // added to stop definite assignment error + } + + // 6. Let k be 0 + k = 0; + + // 7. Repeat, while k < len + while (k < len) { + + var kValue: any; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Call the Call internal method of callback with T as the this value and + // argument list containing kValue, k, and O. + callback.call(T, kValue, k, O); + } + // d. Increase k by 1. + k++; + } + // 8. return undefined + }; +} + +// Compatibility with non ES5 compliant engines +if (!Date.now) { + Date.now = function() { + return (new Date()).getTime(); + }; +} + +// Compatibility with non ES5 compliant engines +// Production steps of ECMA-262, Edition 5.1, 15.4.4.17 +if (!Array.prototype.some) +{ + Array.prototype.some = function(fun: any /*, thisp */) + { + "use strict"; + + if (this == null) + throw new TypeError(); + + var t = Object(this); + var len = t.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var thisp = arguments[1]; + for (var i = 0; i < len; i++) + { + var idx = i.toString(); // REVIEW: this line is not from the Mozilla page, necessary to avoid our compile time checks against non-string/any types in an in expression + if (idx in t && fun.call(thisp, t[i], i, t)) + return true; + } + + return false; + }; +} \ No newline at end of file diff --git a/src/harness/external/json2.js b/src/harness/external/json2.js new file mode 100644 index 0000000000000..0fe3388d253d8 --- /dev/null +++ b/src/harness/external/json2.js @@ -0,0 +1,486 @@ +/* + json2.js + 2013-05-26 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the value + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. +*/ + +/*jslint evil: true, regexp: true */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +if (typeof JSON !== 'object') { + JSON = {}; +} + +(function () { + 'use strict'; + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + if (typeof Date.prototype.toJSON !== 'function') { + + Date.prototype.toJSON = function () { + + return isFinite(this.valueOf()) + ? this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z' + : null; + }; + + String.prototype.toJSON = + Number.prototype.toJSON = + Boolean.prototype.toJSON = function () { + return this.valueOf(); + }; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' + ? c + : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + + function str(key, holder) { + +// Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 + ? '[]' + : gap + ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' + : '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + if (typeof rep[i] === 'string') { + k = rep[i]; + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 + ? '{}' + : gap + ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' + : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value, replacer, space) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } + + +// If the JSON object does not yet have a parse method, give it one. + + if (typeof JSON.parse !== 'function') { + JSON.parse = function (text, reviver) { + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' + ? walk({'': j}, '') + : j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + } +}()); diff --git a/src/harness/external/json2.ts b/src/harness/external/json2.ts new file mode 100644 index 0000000000000..4645a0476af1b --- /dev/null +++ b/src/harness/external/json2.ts @@ -0,0 +1,486 @@ +/* + json2.js + 2013-05-26 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the value + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. +*/ + +/*jslint evil: true, regexp: true */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +if (typeof JSON !== 'object') { + JSON = {}; +} + +(function () { + 'use strict'; + + function f(n: any) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + if (typeof Date.prototype.toJSON !== 'function') { + + Date.prototype.toJSON = function () { + + return isFinite(this.valueOf()) + ? this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z' + : null; + }; + + (String.prototype).toJSON = + (Number.prototype).toJSON = + (Boolean.prototype).toJSON = function () { + return this.valueOf(); + }; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap: any, + indent: any, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep: any; + + + function quote(string: string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' + ? c + : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + + function str(key: any, holder: any) { + +// Produce a string from holder[key]. + + var i: any, // The loop counter. + k: any, // The member key. + v: any, // The member value. + length: number, + mind = gap, + partial: any, + value = holder[key]; + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 + ? '[]' + : gap + ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' + : '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + if (typeof rep[i] === 'string') { + k = rep[i]; + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 + ? '{}' + : gap + ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' + : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value: any, replacer: any, space: any) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i: any; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } + + +// If the JSON object does not yet have a parse method, give it one. + + if (typeof JSON.parse !== 'function') { + JSON.parse = function (text, reviver) { + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j: any; + + function walk(holder: any, key: any) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k: any, v: any, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' + ? walk({'': j}, '') + : j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + } +}()); diff --git a/src/harness/external/mocha.d.ts b/src/harness/external/mocha.d.ts new file mode 100644 index 0000000000000..c498eb080b661 --- /dev/null +++ b/src/harness/external/mocha.d.ts @@ -0,0 +1,45 @@ +// Type definitions for mocha 1.9.0 +// Project: http://visionmedia.github.io/mocha/ +// Definitions by: Kazi Manzur Rashid +// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + +declare var describe : { + (description: string, spec: () => void): void; + only(description: string, spec: () => void): void; + skip(description: string, spec: () => void): void; + timeout(ms: number): void; +} + +declare var it: { + (expectation: string, assertion?: () => void): void; + (expectation: string, assertion?: (done: () => void) => void): void; + only(expectation: string, assertion?: () => void): void; + only(expectation: string, assertion?: (done: () => void) => void): void; + skip(expectation: string, assertion?: () => void): void; + skip(expectation: string, assertion?: (done: () => void) => void): void; + timeout(ms: number): void; +}; + +/** Runs once before any 'it' blocks in the current 'describe' are run */ +declare function before(action: () => void): void; + +/** Runs once before any 'it' blocks in the current 'describe' are run */ +declare function before(action: (done: () => void) => void): void; + +/** Runs once after all 'it' blocks in the current 'describe' are run */ +declare function after(action: () => void): void; + +/** Runs once after all 'it' blocks in the current 'describe' are run */ +declare function after(action: (done: () => void) => void): void; + +/** Runs before each individual 'it' block in the current 'describe' is run */ +declare function beforeEach(action: () => void): void; + +/** Runs before each individual 'it' block in the current 'describe' is run */ +declare function beforeEach(action: (done: () => void) => void): void; + +/** Runs after each individual 'it' block in the current 'describe' is run */ +declare function afterEach(action: () => void): void; + +/** Runs after each individual 'it' block in the current 'describe' is run */ +declare function afterEach(action: (done: () => void) => void): void; \ No newline at end of file diff --git a/src/harness/external/node.d.ts b/src/harness/external/node.d.ts new file mode 100644 index 0000000000000..a62e1f6741a9a --- /dev/null +++ b/src/harness/external/node.d.ts @@ -0,0 +1,1296 @@ +// Type definitions for Node.js v0.10.1 +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript , DefinitelyTyped +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/************************************************ +* * +* Node.js v0.10.1 API * +* * +************************************************/ + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: any; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare function clearImmediate(immediateId: any): void; + +declare var require: { + (id: string): any; + resolve(id:string): string; + cache: any; + extensions: any; + main: any; +}; + +declare var module: { + exports: any; + require(id: string): any; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; +}; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new (str: string, encoding?: string): Buffer; + new (size: number): Buffer; + new (array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + + +// Buffer class +interface Buffer extends NodeBuffer {} +declare var Buffer: { + new (str: string, encoding?: string): Buffer; + new (size: number): Buffer; + new (array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare module NodeJS { + export interface ErrnoException extends Error { + errno?: any; + code?: string; + path?: string; + syscall?: string; + } + + export interface EventEmitter { + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): void; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): ReadableStream; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream {} + + export interface Process extends EventEmitter { + stdout: WritableStream; + stderr: WritableStream; + stdin: ReadableStream; + argv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + env: any; + exit(code?: number): void; + getgid(): number; + setgid(id: number): void; + setgid(id: string): void; + getuid(): number; + setuid(id: number): void; + setuid(id: string): void; + version: string; + versions: { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + openssl: string; + }; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string): void; + pid: number; + title: string; + arch: string; + platform: string; + memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; + nextTick(callback: Function): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?:number[]): number[]; + + // Worker + send?(message: any, sendHandle?: any): void; + } + + export interface Timer { + ref() : void; + unref() : void; + } +} + +/** + * @deprecated + */ +interface NodeBuffer { + [index: number]: number; + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): any; + length: number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + readUInt8(offset: number, noAsset?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + writeUInt8(value: number, offset: number, noAssert?: boolean): void; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): void; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): void; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): void; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): void; + writeInt8(value: number, offset: number, noAssert?: boolean): void; + writeInt16LE(value: number, offset: number, noAssert?: boolean): void; + writeInt16BE(value: number, offset: number, noAssert?: boolean): void; + writeInt32LE(value: number, offset: number, noAssert?: boolean): void; + writeInt32BE(value: number, offset: number, noAssert?: boolean): void; + writeFloatLE(value: number, offset: number, noAssert?: boolean): void; + writeFloatBE(value: number, offset: number, noAssert?: boolean): void; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; + fill(value: any, offset?: number, end?: number): void; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; +} + +declare module "querystring" { + export function stringify(obj: any, sep?: string, eq?: string): string; + export function parse(str: string, sep?: string, eq?: string, options?: { maxKeys?: number; }): any; + export function escape(): any; + export function unescape(): any; +} + +declare module "events" { + export class EventEmitter implements NodeJS.EventEmitter { + static listenerCount(emitter: EventEmitter, event: string): number; + + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): void; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + } +} + +declare module "http" { + import events = require("events"); + import net = require("net"); + import stream = require("stream"); + + export interface Server extends events.EventEmitter { + listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; + listen(path: string, callback?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(cb?: any): Server; + address(): { port: number; family: string; address: string; }; + maxHeadersCount: number; + } + export interface ServerRequest extends events.EventEmitter, stream.Readable { + method: string; + url: string; + headers: any; + trailers: string; + httpVersion: string; + setEncoding(encoding?: string): void; + pause(): void; + resume(): void; + connection: net.Socket; + } + export interface ServerResponse extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + writeContinue(): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; + writeHead(statusCode: number, headers?: any): void; + statusCode: number; + setHeader(name: string, value: string): void; + sendDate: boolean; + getHeader(name: string): string; + removeHeader(name: string): void; + write(chunk: any, encoding?: string): any; + addTrailers(headers: any): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface ClientRequest extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + write(chunk: any, encoding?: string): void; + abort(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface ClientResponse extends events.EventEmitter, stream.Readable { + statusCode: number; + httpVersion: string; + headers: any; + trailers: any; + setEncoding(encoding?: string): void; + pause(): void; + resume(): void; + } + export interface Agent { maxSockets: number; sockets: any; requests: any; } + + export var STATUS_CODES: { + [errorCode: number]: string; + [errorCode: string]: string; + }; + export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; + export function createClient(port?: number, host?: string): any; + export function request(options: any, callback?: Function): ClientRequest; + export function get(options: any, callback?: Function): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import child = require("child_process"); + import events = require("events"); + + export interface ClusterSettings { + exec?: string; + args?: string[]; + silent?: boolean; + } + + export class Worker extends events.EventEmitter { + id: string; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any): void; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + } + + export var settings: ClusterSettings; + export var isMaster: boolean; + export var isWorker: boolean; + export function setupMaster(settings?: ClusterSettings): void; + export function fork(env?: any): Worker; + export function disconnect(callback?: Function): void; + export var worker: Worker; + export var workers: Worker[]; + + // Event emitter + export function addListener(event: string, listener: Function): void; + export function on(event: string, listener: Function): any; + export function once(event: string, listener: Function): void; + export function removeListener(event: string, listener: Function): void; + export function removeAllListeners(event?: string): void; + export function setMaxListeners(n: number): void; + export function listeners(event: string): Function[]; + export function emit(event: string, ...args: any[]): boolean; +} + +declare module "zlib" { + import stream = require("stream"); + export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } + + export interface Gzip extends stream.Transform { } + export interface Gunzip extends stream.Transform { } + export interface Deflate extends stream.Transform { } + export interface Inflate extends stream.Transform { } + export interface DeflateRaw extends stream.Transform { } + export interface InflateRaw extends stream.Transform { } + export interface Unzip extends stream.Transform { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; + export var Z_NULL: number; +} + +declare module "os" { + export function tmpDir(): string; + export function hostname(): string; + export function type(): string; + export function platform(): string; + export function arch(): string; + export function release(): string; + export function uptime(): number; + export function loadavg(): number[]; + export function totalmem(): number; + export function freemem(): number; + export function cpus(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; + export function networkInterfaces(): any; + export var EOL: string; +} + +declare module "https" { + import tls = require("tls"); + import events = require("events"); + import http = require("http"); + + export interface ServerOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + crl?: any; + ciphers?: string; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; + SNICallback?: (servername: string) => any; + } + + export interface RequestOptions { + host?: string; + hostname?: string; + port?: number; + path?: string; + method?: string; + headers?: any; + auth?: string; + agent?: any; + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + } + + export interface Agent { + maxSockets: number; + sockets: any; + requests: any; + } + export var Agent: { + new (options?: RequestOptions): Agent; + }; + export interface Server extends tls.Server { } + export function createServer(options: ServerOptions, requestListener?: Function): Server; + export function request(options: RequestOptions, callback?: (res: events.EventEmitter) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: events.EventEmitter) =>void ): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): string; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import stream = require("stream"); + import events = require("events"); + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + } + export function start(options: ReplOptions): events.EventEmitter; +} + +declare module "readline" { + import events = require("events"); + import stream = require("stream"); + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string, length: number): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: Function): void; + pause(): void; + resume(): void; + close(): void; + write(data: any, key?: any): void; + } + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output: NodeJS.WritableStream; + completer?: Function; + terminal?: boolean; + } + export function createInterface(options: ReadLineOptions): ReadLine; +} + +declare module "vm" { + export interface Context { } + export interface Script { + runInThisContext(): void; + runInNewContext(sandbox?: Context): void; + } + export function runInThisContext(code: string, filename?: string): void; + export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; + export function runInContext(code: string, context: Context, filename?: string): void; + export function createContext(initSandbox?: Context): Context; + export function createScript(code: string, filename?: string): Script; +} + +declare module "child_process" { + import events = require("events"); + import stream = require("stream"); + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + pid: number; + kill(signal?: string): void; + send(message: any, sendHandle: any): void; + disconnect(): void; + } + + export function spawn(command: string, args?: string[], options?: { + cwd?: string; + stdio?: any; + custom?: any; + env?: any; + detached?: boolean; + }): ChildProcess; + export function exec(command: string, options: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + }, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args: string[], options: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: string; + killSignal?: string; + }, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function fork(modulePath: string, args?: string[], options?: { + cwd?: string; + env?: any; + encoding?: string; + }): ChildProcess; +} + +declare module "url" { + export interface Url { + href: string; + protocol: string; + auth: string; + hostname: string; + port: string; + host: string; + pathname: string; + search: string; + query: string; + slashes: boolean; + hash?: string; + path?: string; + } + + export interface UrlOptions { + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: any; + hash?: string; + path?: string; + } + + export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; + export function format(url: UrlOptions): string; + export function resolve(from: string, to: string): string; +} + +declare module "dns" { + export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; + export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; + export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; +} + +declare module "net" { + import stream = require("stream"); + + export interface Socket extends stream.Duplex { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + connect(port: number, host?: string, connectionListener?: Function): void; + connect(path: string, connectionListener?: Function): void; + bufferSize: number; + setEncoding(encoding?: string): void; + write(data: any, encoding?: string, callback?: Function): void; + destroy(): void; + pause(): void; + resume(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setKeepAlive(enable?: boolean, initialDelay?: number): void; + address(): { port: number; family: string; address: string; }; + remoteAddress: string; + remotePort: number; + bytesRead: number; + bytesWritten: number; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + + export var Socket: { + new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + }; + + export interface Server extends Socket { + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + maxConnections: number; + connections: number; + } + export function createServer(connectionListener?: (socket: Socket) =>void ): Server; + export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; + export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import events = require("events"); + + export function createSocket(type: string, callback?: Function): Socket; + + interface Socket extends events.EventEmitter { + send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: Function): void; + bind(port: number, address?: string): void; + close(): void; + address: { address: string; family: string; port: number; }; + setBroadcast(flag: boolean): void; + setMulticastTTL(ttl: number): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + } +} + +declare module "fs" { + import stream = require("stream"); + import events = require("events"); + + interface Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atime: Date; + mtime: Date; + ctime: Date; + } + + interface FSWatcher extends events.EventEmitter { + close(): void; + } + + export interface ReadStream extends stream.Readable {} + export interface WriteStream extends stream.Writable {} + + export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function renameSync(oldPath: string, newPath: string): void; + export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncateSync(path: string, len?: number): void; + export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncateSync(fd: number, len?: number): void; + export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chownSync(path: string, uid: number, gid: number): void; + export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchownSync(fd: number, uid: number, gid: number): void; + export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchownSync(path: string, uid: number, gid: number): void; + export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmodSync(path: string, mode: number): void; + export function chmodSync(path: string, mode: string): void; + export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmodSync(fd: number, mode: number): void; + export function fchmodSync(fd: number, mode: string): void; + export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmodSync(path: string, mode: number): void; + export function lchmodSync(path: string, mode: string): void; + export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function statSync(path: string): Stats; + export function lstatSync(path: string): Stats; + export function fstatSync(fd: number): Stats; + export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function linkSync(srcpath: string, dstpath: string): void; + export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; + export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + export function readlinkSync(path: string): string; + export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; + export function realpathSync(path: string, cache?: {[path: string]: string}): string; + export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function unlinkSync(path: string): void; + export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function rmdirSync(path: string): void; + export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function mkdirSync(path: string, mode?: number): void; + export function mkdirSync(path: string, mode?: string): void; + export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdirSync(path: string): string[]; + export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function closeSync(fd: number): void; + export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function openSync(path: string, flags: string, mode?: number): number; + export function openSync(path: string, flags: string, mode?: string): number; + export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimesSync(path: string, atime: number, mtime: number): void; + export function utimesSync(path: string, atime: Date, mtime: Date): void; + export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimesSync(fd: number, atime: number, mtime: number): void; + export function futimesSync(fd: number, atime: Date, mtime: Date): void; + export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fsyncSync(fd: number): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; + export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void ): void; + export function readFileSync(filename: string, encoding: string): string; + export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; + export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; + export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; + export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; + export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; + export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; + export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; + export function exists(path: string, callback?: (exists: boolean) => void): void; + export function existsSync(path: string): boolean; + export function createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: string; + mode?: number; + bufferSize?: number; + }): ReadStream; + export function createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: string; + mode?: string; + bufferSize?: number; + }): ReadStream; + export function createWriteStream(path: string, options?: { + flags?: string; + encoding?: string; + string?: string; + }): WriteStream; +} + +declare module "path" { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + detectIncompleteChar(buffer: Buffer): number; + } + export var StringDecoder: { + new (encoding: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import crypto = require("crypto"); + import net = require("net"); + import stream = require("stream"); + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface TlsOptions { + pfx?: any; //string or buffer + key?: any; //string or buffer + passphrase?: string; + cert?: any; + ca?: any; //string or buffer + crl?: any; //string or string array + ciphers?: string; + honorCipherOrder?: any; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; //array or Buffer; + SNICallback?: (servername: string) => any; + } + + export interface ConnectionOptions { + host?: string; + port?: number; + socket?: net.Socket; + pfx?: any; //string | Buffer + key?: any; //string | Buffer + passphrase?: string; + cert?: any; //string | Buffer + ca?: any; //Array of string | Buffer + rejectUnauthorized?: boolean; + NPNProtocols?: any; //Array of string | Buffer + servername?: string; + } + + export interface Server extends net.Server { + // Extended base methods + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + + listen(port: number, host?: string, callback?: Function): Server; + close(): Server; + address(): { port: number; family: string; address: string; }; + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + maxConnections: number; + connections: number; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; + export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; +} + +declare module "crypto" { + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: any; //string | string array + crl: any; //string | string array + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string): Hmac; + interface Hash { + update(data: any, input_encoding?: string): Hash; + digest(encoding?: string): string; + } + interface Hmac { + update(data: any, input_encoding?: string): Hmac; + digest(encoding?: string): string; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + interface Cipher { + update(data: any, input_encoding?: string, output_encoding?: string): string; + final(output_encoding?: string): string; + setAutoPadding(auto_padding: boolean): void; + createDecipher(algorithm: string, password: any): Decipher; + createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + } + interface Decipher { + update(data: any, input_encoding?: string, output_encoding?: string): void; + final(output_encoding?: string): string; + setAutoPadding(auto_padding: boolean): void; + } + export function createSign(algorithm: string): Signer; + interface Signer { + update(data: any): void; + sign(private_key: string, output_format: string): string; + } + export function createVerify(algorith: string): Verify; + interface Verify { + update(data: any): void; + verify(object: string, signature: string, signature_format?: string): boolean; + } + export function createDiffieHellman(prime_length: number): DiffieHellman; + export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; + interface DiffieHellman { + generateKeys(encoding?: string): string; + computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; + getPrime(encoding?: string): string; + getGenerator(encoding: string): string; + getPublicKey(encoding?: string): string; + getPrivateKey(encoding?: string): string; + setPublicKey(public_key: string, encoding?: string): void; + setPrivateKey(public_key: string, encoding?: string): void; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void; + export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; +} + +declare module "stream" { + import events = require("events"); + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + } + + export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { + readable: boolean; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + } + + export class Writable extends events.EventEmitter implements NodeJS.WritableStream { + writable: boolean; + constructor(opts?: WritableOptions); + _write(data: Buffer, encoding: string, callback: Function): void; + _write(data: string, encoding: string, callback: Function): void; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements NodeJS.ReadWriteStream { + writable: boolean; + constructor(opts?: DuplexOptions); + _write(data: Buffer, encoding: string, callback: Function): void; + _write(data: string, encoding: string, callback: Function): void; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface TransformOptions extends ReadableOptions, WritableOptions {} + + // Note: Transform lacks the _read and _write methods of Readable/Writable. + export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { + readable: boolean; + writable: boolean; + constructor(opts?: TransformOptions); + _transform(chunk: Buffer, encoding: string, callback: Function): void; + _transform(chunk: string, encoding: string, callback: Function): void; + _flush(callback: Function): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): void; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export class PassThrough extends Transform {} +} + +declare module "util" { + export interface InspectOptions { + showHidden?: boolean; + depth?: number; + colors?: boolean; + customInspect?: boolean; + } + + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; + export function inspect(object: any, options: InspectOptions): string; + export function isArray(object: any): boolean; + export function isRegExp(object: any): boolean; + export function isDate(object: any): boolean; + export function isError(object: any): boolean; + export function inherits(constructor: any, superConstructor: any): void; +} + +declare module "assert" { + function internal (value: any, message?: string): void; + module internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: {message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function}); + } + + export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export var throws: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export var doesNotThrow: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import net = require("net"); + + export function isatty(fd: number): boolean; + export interface ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + } + export interface WriteStream extends net.Socket { + columns: number; + rows: number; + } +} + +declare module "domain" { + import events = require("events"); + + export class Domain extends events.EventEmitter { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + + addListener(event: string, listener: Function): Domain; + on(event: string, listener: Function): Domain; + once(event: string, listener: Function): Domain; + removeListener(event: string, listener: Function): Domain; + removeAllListeners(event?: string): Domain; + } + + export function create(): Domain; +} \ No newline at end of file diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts new file mode 100644 index 0000000000000..3037971471af9 --- /dev/null +++ b/src/harness/fourslash.ts @@ -0,0 +1,2340 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// +/// + +module FourSlash { + // Represents a parsed source file with metadata + export interface FourSlashFile { + // The contents of the file (with markers, etc stripped out) + content: string; + + fileName: string; + + // File-specific options (name/value pairs) + fileOptions: { [index: string]: string; }; + } + + // Represents a set of parsed source files and options + export interface FourSlashData { + // Global options (name/value pairs) + globalOptions: { [index: string]: string; }; + + files: FourSlashFile[]; + + // A mapping from marker names to name/position pairs + markerPositions: { [index: string]: Marker; }; + + markers: Marker[]; + + ranges: Range[]; + } + + export interface TestXmlData { + invalidReason: string; + originalName: string; + actions: string[]; + } + + interface MemberListData { + result: { + maybeInaccurate: boolean; + isMemberCompletion: boolean; + entries: { + name: string; + type: string; + kind: string; + kindModifiers: string; + }[]; + }; + } + + export interface Marker { + fileName: string; + position: number; + data?: any; + } + + interface MarkerMap { + [index: string]: Marker; + } + + export interface Range { + fileName: string; + start: number; + end: number; + marker?: Marker; + } + + interface ILocationInformation { + position: number; + sourcePosition: number; + sourceLine: number; + sourceColumn: number; + } + + interface IRangeLocationInformation extends ILocationInformation { + marker?: Marker; + } + + export interface TextSpan { + start: number; + end: number; + } + + export enum IncrementalEditValidation { + None, + SyntacticOnly, + Complete + } + + export enum TypingFidelity { + /// Performs typing and formatting (if formatting is enabled) + Low, + /// Performs typing, checks completion lists, signature help, and formatting (if enabled) + High + } + + var entityMap: TypeScript.IIndexable = { + '&': '&', + '"': '"', + "'": ''', + '/': '/', + '<': '<', + '>': '>' + }; + + export function escapeXmlAttributeValue(s: string) { + return s.replace(/[&<>"'\/]/g, ch => entityMap[ch]); + } + + // List of allowed metadata names + var fileMetadataNames = ['Filename']; + var globalMetadataNames = ['Module', 'Target', 'BaselineFile']; // Note: Only BaselineFile is actually supported at the moment + + export var currentTestState: TestState = null; + + export class TestCancellationToken implements TypeScript.ICancellationToken { + // 0 - cancelled + // >0 - not cancelled + // <0 - not cancelled and value denotes number of isCancellationRequested after which token become cancelled + private static NotCancelled: number = -1; + private numberOfCallsBeforeCancellation: number = TestCancellationToken.NotCancelled; + public isCancellationRequested(): boolean { + + if (this.numberOfCallsBeforeCancellation < 0) { + return false; + } + + if (this.numberOfCallsBeforeCancellation > 0) { + this.numberOfCallsBeforeCancellation--; + return false; + } + + return true; + } + + public setCancelled(numberOfCalls: number = 0): void { + TypeScript.Debug.assert(numberOfCalls >= 0); + this.numberOfCallsBeforeCancellation = numberOfCalls; + } + + public resetCancelled(): void { + this.numberOfCallsBeforeCancellation = TestCancellationToken.NotCancelled; + } + } + + export function verifyOperationIsCancelled(f: () => void) { + try { + f(); + } + catch (e) { + if (e instanceof TypeScript.OperationCanceledException) { + return; + } + } + + throw new Error("Operation should be cancelled"); + } + + export class TestState { + // Language service instance + public languageServiceShimHost: Harness.TypeScriptLS = null; + private languageService: TypeScript.Services.ILanguageService = null; + private newLanguageService: ts.LanguageService = null; + + // A reference to the language service's compiler state's compiler instance + private compiler: () => { getSyntaxTree(fileName: string): TypeScript.SyntaxTree; getSourceUnit(fileName: string): TypeScript.SourceUnitSyntax; }; + + // The current caret position in the active file + public currentCaretPosition = 0; + public lastKnownMarker: string = ""; + + // The file that's currently 'opened' + public activeFile: FourSlashFile = null; + + // Whether or not we should format on keystrokes + public enableFormatting = true; + + public formatCodeOptions: TypeScript.Services.FormatCodeOptions = null; + + public cancellationToken: TestCancellationToken; + + public editValidation = IncrementalEditValidation.Complete; + public typingFidelity = TypingFidelity.Low; + + private scenarioActions: string[] = []; + private taoInvalidReason: string = null; + + constructor(public testData: FourSlashData) { + // Initialize the language service with all the scripts + this.cancellationToken = new TestCancellationToken(); + this.languageServiceShimHost = new Harness.TypeScriptLS(this.cancellationToken); + + var harnessCompiler = Harness.Compiler.getCompiler(); + var inputFiles: { unitName: string; content: string }[] = []; + + testData.files.forEach(file => { + var fixedPath = file.fileName.substr(file.fileName.indexOf('tests/')); + harnessCompiler.addInputFile({ unitName: fixedPath, content: file.content }); + }); + + // If the last unit contains require( or /// reference then consider it the only input file + // and the rest will be added via resolution. If not, then assume we have multiple files + // with 0 references in any of them. We could be smarter here to allow scenarios like + // 2 files without references and 1 file with a reference but we have 0 tests like that + // at the moment and an exhaustive search of the test files for that content could be quite slow. + var lastFile = testData.files[testData.files.length - 1]; + if (/require\(/.test(lastFile.content) || /reference\spath/.test(lastFile.content)) { + inputFiles.push({ unitName: lastFile.fileName, content: lastFile.content }); + } else { + inputFiles = testData.files.map(file => { + return { unitName: file.fileName, content: file.content }; + }); + } + + // NEWTODO: Re-implement commented-out section + // harnessCompiler.addInputFiles(inputFiles); + try { + // var resolvedFiles = harnessCompiler.resolve(); + + //resolvedFiles.forEach(file => { + // if (!Harness.isLibraryFile(file.path)) { + // var fixedPath = file.path.substr(file.path.indexOf('tests/')); + // var content = harnessCompiler.getContentForFile(fixedPath); + // this.languageServiceShimHost.addScript(fixedPath, content); + // } + //}); + + // NEWTODO: For now do not resolve, just use the input files + inputFiles.forEach(file => { + if (!Harness.isLibraryFile(file.unitName)) { + this.languageServiceShimHost.addScript(file.unitName, file.content); + } + }); + + this.languageServiceShimHost.addScript('lib.d.ts', Harness.Compiler.libTextMinimal); + } + finally { + // harness no longer needs the results of the above work, make sure the next test operations are in a clean state + //harnessCompiler.reset(); + } + + // Sneak into the language service and get its compiler so we can examine the syntax trees + this.languageService = this.languageServiceShimHost.getLanguageService().languageService; + this.newLanguageService = this.languageServiceShimHost.newLS; + var compilerState = (this.languageService).compiler; + this.compiler = () => compilerState.compiler; + + this.formatCodeOptions = new TypeScript.Services.FormatCodeOptions(); + + this.testData.files.forEach(file => { + var filename = file.fileName.replace(Harness.IO.directoryName(file.fileName), '').substr(1); + var filenameWithoutExtension = filename.substr(0, filename.lastIndexOf(".")); + this.scenarioActions.push(''); + }); + + // Open the first file by default + this.openFile(0); + } + + // Entry points from fourslash.ts + public goToMarker(name = '') { + var marker = this.getMarkerByName(name); + if (this.activeFile.fileName !== marker.fileName) { + this.openFile(marker.fileName); + } + + var scriptSnapshot = this.languageServiceShimHost.getScriptSnapshot(marker.fileName); + if (marker.position === -1 || marker.position > scriptSnapshot.getLength()) { + throw new Error('Marker "' + name + '" has been invalidated by unrecoverable edits to the file.'); + } + this.lastKnownMarker = name; + this.goToPosition(marker.position); + } + + public goToPosition(pos: number) { + this.currentCaretPosition = pos; + + var lineCharPos = TypeScript.LineMap1.fromString(this.getCurrentFileContent()).getLineAndCharacterFromPosition(pos); + this.scenarioActions.push(''); + } + + public moveCaretRight(count = 1) { + this.currentCaretPosition += count; + this.currentCaretPosition = Math.min(this.currentCaretPosition, this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength()); + if (count > 0) { + this.scenarioActions.push(''); + } else { + this.scenarioActions.push(''); + } + } + + // Opens a file given its 0-based index or fileName + public openFile(index: number): void; + public openFile(name: string): void; + public openFile(indexOrName: any) { + var fileToOpen: FourSlashFile = this.findFile(indexOrName); + fileToOpen.fileName = Harness.Path.switchToForwardSlashes(fileToOpen.fileName); + this.activeFile = fileToOpen; + var filename = fileToOpen.fileName.replace(Harness.IO.directoryName(fileToOpen.fileName), '').substr(1); + this.scenarioActions.push(''); + } + + public verifyErrorExistsBetweenMarkers(startMarkerName: string, endMarkerName: string, negative: boolean) { + var startMarker = this.getMarkerByName(startMarkerName); + var endMarker = this.getMarkerByName(endMarkerName); + var predicate = function (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) { + // NEWTODO: make this more specific again + //return ((errorMinChar === startPos) && (errorLimChar === endPos)) ? true : false; + return ((errorMinChar >= startPos) && (errorLimChar <= endPos)) ? true : false; + }; + + var exists = this.anyErrorInRange(predicate, startMarker, endMarker); + + this.taoInvalidReason = 'verifyErrorExistsBetweenMarkers NYI'; + + if (exists !== negative) { + this.new_printErrorLog(negative, this.new_getAllDiagnostics()); + throw new Error("Failure between markers: " + startMarkerName + ", " + endMarkerName); + } + } + + private getDiagnostics(fileName: string): TypeScript.Diagnostic[] { + var syntacticErrors = this.languageService.getSyntacticDiagnostics(fileName); + var semanticErrors = this.languageService.getSemanticDiagnostics(fileName); + + var diagnostics: TypeScript.Diagnostic[] = []; + diagnostics.push.apply(diagnostics, syntacticErrors); + diagnostics.push.apply(diagnostics, semanticErrors); + + return diagnostics; + } + + + private new_getDiagnostics(fileName: string): ts.Diagnostic[] { + var syntacticErrors = this.newLanguageService.getSyntacticDiagnostics(fileName); + var semanticErrors = this.newLanguageService.getSemanticDiagnostics(fileName); + + + var diagnostics: ts.Diagnostic[] = []; + diagnostics.push.apply(diagnostics, syntacticErrors); + diagnostics.push.apply(diagnostics, semanticErrors); + + return diagnostics; + } + + + private getAllDiagnostics(): TypeScript.Diagnostic[] { + var diagnostics: TypeScript.Diagnostic[] = []; + + var fileNames = JSON.parse(this.languageServiceShimHost.getScriptFileNames()); + for (var i = 0, n = fileNames.length; i < n; i++) { + diagnostics.push.apply(this.getDiagnostics(fileNames[i])); + } + + return diagnostics; + } + + private new_getAllDiagnostics(): ts.Diagnostic[] { + var diagnostics: ts.Diagnostic[] = []; + + var fileNames = JSON.parse(this.languageServiceShimHost.getScriptFileNames()); + for (var i = 0, n = fileNames.length; i < n; i++) { + diagnostics.push.apply(this.new_getDiagnostics(fileNames[i])); + } + + return diagnostics; + } + + public verifyErrorExistsAfterMarker(markerName: string, negative: boolean, after: boolean) { + var marker: Marker = this.getMarkerByName(markerName); + var predicate: (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => boolean; + + if (after) { + predicate = function (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) { + return ((errorMinChar >= startPos) && (errorLimChar >= startPos)) ? true : false; + }; + } else { + predicate = function (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) { + return ((errorMinChar <= startPos) && (errorLimChar <= startPos)) ? true : false; + }; + } + + this.taoInvalidReason = 'verifyErrorExistsAfterMarker NYI'; + + var exists = this.anyErrorInRange(predicate, marker); + var diagnostics = this.new_getAllDiagnostics(); + + if (exists !== negative) { + this.new_printErrorLog(negative, diagnostics); + throw new Error("Failure at marker: " + markerName); + } + } + + private anyErrorInRange(predicate: (errorMinChar: number, errorLimChar: number, startPos: number, endPos: number) => boolean, startMarker: Marker, endMarker?: Marker) { + + var errors = this.new_getDiagnostics(startMarker.fileName); + var exists = false; + + var startPos = startMarker.position; + if (endMarker !== undefined) { + var endPos = endMarker.position; + } + + errors.forEach((error)=> { + if (predicate(error.start, error.start + error.length, startPos, endPos)) { + exists = true; + } + }); + + return exists; + } + + private printErrorLog(expectErrors: boolean, errors: TypeScript.Diagnostic[]) { + if (expectErrors) { + Harness.IO.log("Expected error not found. Error list is:"); + } else { + Harness.IO.log("Unexpected error(s) found. Error list is:"); + } + + errors.forEach(function (error: TypeScript.Diagnostic) { + Harness.IO.log(" minChar: " + error.start() + ", limChar: " + (error.start() + error.length()) + ", message: " + error.message() + "\n"); + }); + } + + private new_printErrorLog(expectErrors: boolean, errors: ts.Diagnostic[]) { + if (expectErrors) { + Harness.IO.log("Expected error not found. Error list is:"); + } else { + Harness.IO.log("Unexpected error(s) found. Error list is:"); + } + + errors.forEach(error => { + Harness.IO.log(" minChar: " + error.start + ", limChar: " + (error.start + error.length) + ", message: " + error.messageText + "\n"); + }); + } + + public verifyNumberOfErrorsInCurrentFile(expected: number) { + var errors = this.getDiagnostics(this.activeFile.fileName); + var actual = errors.length; + + this.scenarioActions.push(''); + + if (actual !== expected) { + var errorMsg = "Actual number of errors (" + actual + ") does not match expected number (" + expected + ")"; + Harness.IO.log(errorMsg); + throw new Error(errorMsg); + } + } + + public verifyEval(expr: string, value: any) { + var emit = this.languageService.getEmitOutput(this.activeFile.fileName); + if (emit.outputFiles.length !== 1) { + throw new Error("Expected exactly one output from emit of " + this.activeFile.fileName); + } + + this.taoInvalidReason = 'verifyEval impossible'; + + var evaluation = new Function(emit.outputFiles[0].text + ';\r\nreturn (' + expr + ');')(); + if (evaluation !== value) { + throw new Error('Expected evaluation of expression "' + expr + '" to equal "' + value + '", but got "' + evaluation + '"'); + } + } + + public verifyMemberListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + + if (type || docComment || fullSymbolName || kind) { + this.taoInvalidReason = 'verifyMemberListContains only supports the "symbol" parameter'; + } + + var members = this.getMemberListAtCaret(); + if (members) { + this.assertItemInCompletionList(members.entries, symbol, type, docComment, fullSymbolName, kind); + } + else { + throw new Error("Expected a member list, but none was provided") + } + } + + public verifyMemberListCount(expectedCount: number, negative: boolean) { + if (expectedCount === 0) { + if (negative) { + this.verifyMemberListIsEmpty(false); + return; + } else { + this.scenarioActions.push(''); + } + } else { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + } + + var members = this.getMemberListAtCaret(); + + if (members) { + var match = members.entries.length === expectedCount; + + if ((!match && !negative) || (match && negative)) { + throw new Error("Member list count was " + members.entries.length + ". Expected " + expectedCount); + } + } + else if (expectedCount) { + throw new Error("Member list count was 0. Expected " + expectedCount); + } + } + + public verifyMemberListDoesNotContain(symbol: string) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + + var members = this.getMemberListAtCaret(); + if (members.entries.filter(e => e.name === symbol).length !== 0) { + throw new Error('Member list did contain ' + symbol); + } + } + + public verifyCompletionListItemsCountIsGreaterThan(count: number) { + this.taoInvalidReason = 'verifyCompletionListItemsCountIsGreaterThan NYI'; + + var completions = this.getCompletionListAtCaret(); + var itemsCount = completions.entries.length; + + if (itemsCount <= count) { + throw new Error('Expected completion list items count to be greater than ' + count + ', but is actually ' + itemsCount); + } + } + + public verifyMemberListIsEmpty(negative: boolean) { + if (negative) { + this.scenarioActions.push(''); + } else { + this.scenarioActions.push(''); + } + + var members = this.getMemberListAtCaret(); + if ((!members || members.entries.length === 0) && negative) { + throw new Error("Member list is empty at Caret"); + } else if ((members && members.entries.length !== 0) && !negative) { + + var errorMsg = "\n" + "Member List contains: [" + members.entries[0].name; + for (var i = 1; i < members.entries.length; i++) { + errorMsg += ", " + members.entries[i].name; + } + errorMsg += "]\n"; + + Harness.IO.log(errorMsg); + throw new Error("Member list is not empty at Caret"); + + } + } + + public verifyCompletionListIsEmpty(negative: boolean) { + this.scenarioActions.push(''); + + var completions = this.getCompletionListAtCaret(); + if ((!completions || completions.entries.length === 0) && negative) { + throw new Error("Completion list is empty at Caret"); + } else if ((completions && completions.entries.length !== 0) && !negative) { + + var errorMsg = "\n" + "Completion List contains: [" + completions.entries[0].name; + for (var i = 1; i < completions.entries.length; i++) { + errorMsg += ", " + completions.entries[i].name; + } + errorMsg += "]\n"; + + Harness.IO.log(errorMsg); + throw new Error("Completion list is not empty at Caret"); + + } + } + + public verifyCompletionListContains(symbol: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + var completions = this.getCompletionListAtCaret(); + this.assertItemInCompletionList(completions.entries, symbol, type, docComment, fullSymbolName, kind); + } + + public verifyCompletionListDoesNotContain(symbol: string) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + + var completions = this.getCompletionListAtCaret(); + if (completions && completions.entries && completions.entries.filter(e => e.name === symbol).length !== 0) { + throw new Error('Completion list did contain ' + symbol); + } + } + + public verifyCompletionEntryDetails(entryName: string, type: string, docComment?: string, fullSymbolName?: string, kind?: string) { + this.taoInvalidReason = 'verifyCompletionEntryDetails NYI'; + + var details = this.getCompletionEntryDetails(entryName); + + assert.equal(details.type, type); + + if (docComment != undefined) { + assert.equal(details.docComment, docComment); + } + + if (fullSymbolName !== undefined) { + assert.equal(details.fullSymbolName, fullSymbolName); + } + + if (kind !== undefined) { + assert.equal(details.kind, kind); + } + } + + public verifyReferencesCountIs(count: number, localFilesOnly: boolean = true) { + this.taoInvalidReason = 'verifyReferences NYI'; + + var references = this.getReferencesAtCaret(); + var referencesCount = 0; + + if (localFilesOnly) { + var localFiles = this.testData.files.map(file => file.fileName); + // Count only the references in local files. Filter the ones in lib and other files. + references.forEach((entry) => { + if (localFiles.some((filename) => filename === entry.fileName)) { + ++referencesCount; + } + }); + } + else { + referencesCount = references.length; + } + + if (referencesCount !== count) { + var condition = localFilesOnly ? "excluding libs" : "including libs"; + throw new Error("Expected references count (" + condition + ") to be " + count + ", but is actually " + references.length); + } + } + + public verifyImplementorsCountIs(count: number, localFilesOnly: boolean = true) { + var implementors = this.getImplementorsAtCaret(); + var implementorsCount = 0; + + if (localFilesOnly) { + var localFiles = this.testData.files.map(file => file.fileName); + // Count only the references in local files. Filter the ones in lib and other files. + implementors.forEach((entry) => { + if (localFiles.some((filename) => filename === entry.fileName)) { + ++implementorsCount; + } + }); + } + else { + implementorsCount = implementors.length; + } + + if (implementorsCount !== count) { + var condition = localFilesOnly ? "excluding libs" : "including libs"; + throw new Error("Expected implementors count (" + condition + ") to be " + count + ", but is actually " + implementors.length); + } + } + + private getMemberListAtCaret() { + return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, true); + } + + private getCompletionListAtCaret() { + return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, false); + } + + private getCompletionEntryDetails(entryName: string) { + return this.languageService.getCompletionEntryDetails(this.activeFile.fileName, this.currentCaretPosition, entryName); + } + + private getReferencesAtCaret() { + return this.languageService.getReferencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); + } + + private getImplementorsAtCaret() { + return this.languageService.getImplementorsAtPosition(this.activeFile.fileName, this.currentCaretPosition); + } + + public verifyQuickInfo(negative: boolean, expectedTypeName?: string, docComment?: string, symbolName?: string, kind?: string) { + [expectedTypeName, docComment, symbolName, kind].forEach(str => { + if (str) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + } + }); + + var actualQuickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); + var actualQuickInfoMemberName = actualQuickInfo ? actualQuickInfo.memberName.toString() : ""; + var actualQuickInfoDocComment = actualQuickInfo ? actualQuickInfo.docComment : ""; + var actualQuickInfoSymbolName = actualQuickInfo ? actualQuickInfo.fullSymbolName : ""; + var actualQuickInfoKind = actualQuickInfo ? actualQuickInfo.kind : ""; + + function assertionMessage(name: string, actualValue: string, expectedValue: string) { + return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; + } + + if (negative) { + if (expectedTypeName !== undefined) { + assert.notEqual(actualQuickInfoMemberName, expectedTypeName, assertionMessage("quick info member name", actualQuickInfoMemberName, expectedTypeName)); + } + if (docComment != undefined) { + assert.notEqual(actualQuickInfoDocComment, docComment, assertionMessage("quick info doc comment", actualQuickInfoDocComment, docComment)); + } + if (symbolName !== undefined) { + assert.notEqual(actualQuickInfoSymbolName, symbolName, assertionMessage("quick info symbol name", actualQuickInfoSymbolName, symbolName)); + } + if (kind !== undefined) { + assert.notEqual(actualQuickInfoKind, kind, assertionMessage("quick info kind", actualQuickInfoKind, kind)); + } + } else { + if (expectedTypeName !== undefined) { + assert.equal(actualQuickInfoMemberName, expectedTypeName, assertionMessage("quick info member", actualQuickInfoMemberName, expectedTypeName)); + } + if (docComment != undefined) { + assert.equal(actualQuickInfoDocComment, docComment, assertionMessage("quick info doc", actualQuickInfoDocComment, docComment)); + } + if (symbolName !== undefined) { + assert.equal(actualQuickInfoSymbolName, symbolName, assertionMessage("quick info symbol name", actualQuickInfoSymbolName, symbolName)); + } + if (kind !== undefined) { + assert.equal(actualQuickInfoKind, kind, assertionMessage("quick info kind", actualQuickInfoKind, kind)); + } + } + } + + public verifyQuickInfoExists(negative: number) { + this.taoInvalidReason = 'verifyQuickInfoExists NYI'; + + var actualQuickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); + if (negative) { + if (actualQuickInfo) { + throw new Error('verifyQuickInfoExists failed. Expected quick info NOT to exist'); + } + } + else { + if (!actualQuickInfo) { + throw new Error('verifyQuickInfoExists failed. Expected quick info to exist'); + } + } + } + + public verifyCurrentSignatureHelpIs(expected: string) { + this.taoInvalidReason = 'verifyCurrentSignatureHelpIs NYI'; + + var help = this.getActiveSignatureHelp(); + assert.equal(help.prefix + help.parameters.map(p => p.display).join(help.separator) + help.suffix, expected); + } + + public verifyCurrentParameterIsVariable(isVariable: boolean) { + this.taoInvalidReason = 'verifyCurrentParameterIsVariable NYI'; + + var signature = this.getActiveSignatureHelp(); + assert.isNotNull(signature); + assert.equal(isVariable, signature.isVariadic); + } + + public verifyCurrentParameterHelpName(name: string) { + this.taoInvalidReason = 'verifyCurrentParameterHelpName NYI'; + + var activeParameter = this.getActiveParameter(); + var activeParameterName = activeParameter.name; + assert.equal(activeParameterName, name); + } + + public verifyCurrentParameterSpanIs(parameter: string) { + this.taoInvalidReason = 'verifyCurrentParameterSpanIs NYI'; + + var activeSignature = this.getActiveSignatureHelp(); + var activeParameter = this.getActiveParameter(); + assert.equal(activeParameter.display, parameter); + } + + public verifyCurrentParameterHelpDocComment(docComment: string) { + this.taoInvalidReason = 'verifyCurrentParameterHelpDocComment NYI'; + + var activeParameter = this.getActiveParameter(); + var activeParameterDocComment = activeParameter.documentation; + assert.equal(activeParameterDocComment, docComment); + } + + public verifyCurrentSignatureHelpParameterCount(expectedCount: number) { + this.taoInvalidReason = 'verifyCurrentSignatureHelpParameterCount NYI'; + + assert.equal(this.getActiveSignatureHelp().parameters.length, expectedCount); + } + + public verifyCurrentSignatureHelpTypeParameterCount(expectedCount: number) { + this.taoInvalidReason = 'verifyCurrentSignatureHelpTypeParameterCount NYI'; + + // assert.equal(this.getActiveSignatureHelp().typeParameters.length, expectedCount); + } + + public verifyCurrentSignatureHelpDocComment(docComment: string) { + this.taoInvalidReason = 'verifyCurrentSignatureHelpDocComment NYI'; + + var actualDocComment = this.getActiveSignatureHelp().documentation; + assert.equal(actualDocComment, docComment); + } + + public verifySignatureHelpCount(expected: number) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + + var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + var actual = help && help.items ? help.items.length : 0; + assert.equal(actual, expected); + } + + public verifySignatureHelpPresent(shouldBePresent = true) { + this.taoInvalidReason = 'verifySignatureHelpPresent NYI'; + + var actual = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + if (shouldBePresent) { + if (!actual) { + throw new Error("Expected signature help to be present, but it wasn't"); + } + } else { + if (actual) { + throw new Error("Expected no signature help, but got '" + JSON.stringify(actual) + "'"); + } + } + } + + //private getFormalParameter() { + // var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + // return help.formal; + //} + + private getActiveSignatureHelp() { + var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + + // If the signature hasn't been narrowed down yet (e.g. no parameters have yet been entered), + // 'activeFormal' will be -1 (even if there is only 1 signature). Signature help will show the + // first signature in the signature group, so go with that + var index = help.selectedItemIndex < 0 ? 0 : help.selectedItemIndex; + + return help.items[index]; + } + + private getActiveParameter(): TypeScript.Services.SignatureHelpParameter { + var currentSig = this.getActiveSignatureHelp(); + var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + + var item = help.items[help.selectedItemIndex]; + var state = this.languageService.getSignatureHelpCurrentArgumentState(this.activeFile.fileName, this.currentCaretPosition, help.applicableSpan.start()); + + // Same logic as in getActiveSignatureHelp - this value might be -1 until a parameter value actually gets typed + var currentParam = state === null ? 0 : state.argumentIndex; + return item.parameters[currentParam]; + } + + public getBreakpointStatementLocation(pos: number) { + this.taoInvalidReason = 'getBreakpointStatementLocation NYI'; + + var spanInfo = this.languageService.getBreakpointStatementAtPosition(this.activeFile.fileName, pos); + var resultString = "\n**Pos: " + pos + " SpanInfo: " + JSON.stringify(spanInfo) + "\n** Statement: "; + if (spanInfo !== null) { + resultString = resultString + this.activeFile.content.substr(spanInfo.start(), spanInfo.length()); + } + return resultString; + } + + public baselineCurrentFileBreakpointLocations() { + this.taoInvalidReason = 'baselineCurrentFileBreakpointLocations impossible'; + + Harness.Baseline.runBaseline( + "Breakpoint Locations for " + this.activeFile.fileName, + this.testData.globalOptions['BaselineFile'], + () => { + var fileLength = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); + var resultString = ""; + for (var pos = 0; pos < fileLength; pos++) { + resultString = resultString + this.getBreakpointStatementLocation(pos); + } + return resultString; + }); + } + + public printBreakpointLocation(pos: number) { + Harness.IO.log(this.getBreakpointStatementLocation(pos)); + } + + public printBreakpointAtCurrentLocation() { + this.printBreakpointLocation(this.currentCaretPosition); + } + + public printCurrentParameterHelp() { + var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition); + Harness.IO.log(JSON.stringify(help)); + } + + public printCurrentQuickInfo() { + var quickInfo = this.languageService.getTypeAtPosition(this.activeFile.fileName, this.currentCaretPosition); + Harness.IO.log(JSON.stringify(quickInfo)); + } + + public printErrorList() { + Harness.IO.log("--------------"); + Harness.IO.log("Old Errors"); + Harness.IO.log("--------------"); + + var syntacticErrors = this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); + var semanticErrors = this.languageService.getSemanticDiagnostics(this.activeFile.fileName); + var errorList = syntacticErrors.concat(semanticErrors); + Harness.IO.log('Error list (' + errorList.length + ' errors)'); + + if (errorList.length) { + errorList.forEach(err => { + Harness.IO.log("start: " + err.start() + ", length: " + err.length() + ", message: " + err.message()); + }); + } + + Harness.IO.log("--------------"); + Harness.IO.log("New Errors"); + Harness.IO.log("--------------"); + this.new_printErrorList(); + } + + public new_printErrorList() { + var syntacticErrors = this.newLanguageService.getSyntacticDiagnostics(this.activeFile.fileName); + var semanticErrors = this.newLanguageService.getSemanticDiagnostics(this.activeFile.fileName); + var errorList = syntacticErrors.concat(semanticErrors); + Harness.IO.log('Error list (' + errorList.length + ' errors)'); + + + if (errorList.length) { + errorList.forEach(error => { + Harness.IO.log("start: " + error.start + ", length: " + error.length + + ", message: " + error.messageText); + }); + } + } + + public printCurrentFileState(makeWhitespaceVisible = false, makeCaretVisible = true) { + for (var i = 0; i < this.testData.files.length; i++) { + var file = this.testData.files[i]; + var active = (this.activeFile === file); + Harness.IO.log('=== Script (' + file.fileName + ') ' + (active ? '(active, cursor at |)' : '') + ' ==='); + var snapshot = this.languageServiceShimHost.getScriptSnapshot(file.fileName); + var content = snapshot.getText(0, snapshot.getLength()); + if (active) { + content = content.substr(0, this.currentCaretPosition) + (makeCaretVisible ? '|' : "") + content.substr(this.currentCaretPosition); + } + if (makeWhitespaceVisible) { + content = TestState.makeWhitespaceVisible(content); + } + Harness.IO.log(content); + } + } + + public printCurrentSignatureHelp() { + var sigHelp = this.getActiveSignatureHelp(); + Harness.IO.log(JSON.stringify(sigHelp)); + } + + public printMemberListMembers() { + var members = this.getMemberListAtCaret(); + Harness.IO.log(JSON.stringify(members)); + } + + public printCompletionListMembers() { + var completions = this.getCompletionListAtCaret(); + Harness.IO.log(JSON.stringify(completions)); + } + + private editCheckpoint(filename: string) { + // TODO: What's this for? It is being called by deleteChar + // this.languageService.getScriptLexicalStructure(filename); + } + + public deleteChar(count = 1) { + this.scenarioActions.push(''); + + var offset = this.currentCaretPosition; + var ch = ""; + + for (var i = 0; i < count; i++) { + // Make the edit + this.languageServiceShimHost.editScript(this.activeFile.fileName, offset, offset + 1, ch); + this.updateMarkersForEdit(this.activeFile.fileName, offset, offset + 1, ch); + this.editCheckpoint(this.activeFile.fileName); + + // Handle post-keystroke formatting + if (this.enableFormatting) { + var edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); + offset += this.applyEdits(this.activeFile.fileName, edits, true); + } + } + + // Move the caret to wherever we ended up + this.currentCaretPosition = offset; + + this.fixCaretPosition(); + this.checkPostEditInvariants(); + } + + public replace(start: number, length: number, text: string) { + this.taoInvalidReason = 'replace NYI'; + + this.languageServiceShimHost.editScript(this.activeFile.fileName, start, start + length, text); + this.updateMarkersForEdit(this.activeFile.fileName, start, start + length, text); + this.editCheckpoint(this.activeFile.fileName); + + this.checkPostEditInvariants(); + } + + public deleteCharBehindMarker(count = 1) { + this.scenarioActions.push(''); + + var offset = this.currentCaretPosition; + var ch = ""; + + for (var i = 0; i < count; i++) { + offset--; + // Make the edit + this.languageServiceShimHost.editScript(this.activeFile.fileName, offset, offset + 1, ch); + this.updateMarkersForEdit(this.activeFile.fileName, offset, offset + 1, ch); + this.editCheckpoint(this.activeFile.fileName); + + // Handle post-keystroke formatting + if (this.enableFormatting) { + var edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); + offset += this.applyEdits(this.activeFile.fileName, edits, true); + this.editCheckpoint(this.activeFile.fileName); + } + } + + // Move the caret to wherever we ended up + this.currentCaretPosition = offset; + + this.fixCaretPosition(); + + this.checkPostEditInvariants(); + } + + // Enters lines of text at the current caret position + public type(text: string) { + if (text === '') { + this.taoInvalidReason = 'Test used empty-insert workaround.'; + } else { + this.scenarioActions.push(''); + } + + if (this.typingFidelity === TypingFidelity.Low) { + return this.typeLowFidelity(text); + } else { + return this.typeHighFidelity(text); + } + } + + private typeLowFidelity(text: string) { + var offset = this.currentCaretPosition; + for (var i = 0; i < text.length; i++) { + // Make the edit + var ch = text.charAt(i); + this.languageServiceShimHost.editScript(this.activeFile.fileName, offset, offset, ch); + this.updateMarkersForEdit(this.activeFile.fileName, offset, offset, ch); + this.editCheckpoint(this.activeFile.fileName); + offset++; + + // Handle post-keystroke formatting + if (this.enableFormatting) { + var edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); + offset += this.applyEdits(this.activeFile.fileName, edits, true); + this.editCheckpoint(this.activeFile.fileName); + } + } + + // Move the caret to wherever we ended up + this.currentCaretPosition = offset; + + this.fixCaretPosition(); + + this.checkPostEditInvariants(); + } + + // Enters lines of text at the current caret position, invoking + // language service APIs to mimic Visual Studio's behavior + // as much as possible + private typeHighFidelity(text: string, errorCadence = 5) { + var offset = this.currentCaretPosition; + var prevChar = ' '; + for (var i = 0; i < text.length; i++) { + // Make the edit + var ch = text.charAt(i); + this.languageServiceShimHost.editScript(this.activeFile.fileName, offset, offset, ch); + this.updateMarkersForEdit(this.activeFile.fileName, offset, offset, ch); + this.editCheckpoint(this.activeFile.fileName); + offset++; + + if (ch === '(' || ch === ',') { + // Signature help + this.languageService.getSignatureHelpItems(this.activeFile.fileName, offset); + } else if (prevChar === ' ' && /A-Za-z_/.test(ch)) { + // Completions + this.languageService.getCompletionsAtPosition(this.activeFile.fileName, offset, false); + } + + if (i % errorCadence === 0) { + this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); + this.languageService.getSemanticDiagnostics(this.activeFile.fileName); + } + + // Handle post-keystroke formatting + if (this.enableFormatting) { + var edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions); + offset += this.applyEdits(this.activeFile.fileName, edits, true); + this.editCheckpoint(this.activeFile.fileName); + } + } + + // Move the caret to wherever we ended up + this.currentCaretPosition = offset; + + this.fixCaretPosition(); + + this.checkPostEditInvariants(); + } + + // Enters text as if the user had pasted it + public paste(text: string) { + this.scenarioActions.push(''); + + var start = this.currentCaretPosition; + var offset = this.currentCaretPosition; + this.languageServiceShimHost.editScript(this.activeFile.fileName, offset, offset, text); + this.updateMarkersForEdit(this.activeFile.fileName, offset, offset, text); + this.editCheckpoint(this.activeFile.fileName); + offset += text.length; + + // Handle formatting + if (this.enableFormatting) { + var edits = this.languageService.getFormattingEditsForRange(this.activeFile.fileName, start, offset, this.formatCodeOptions); + offset += this.applyEdits(this.activeFile.fileName, edits, true); + this.editCheckpoint(this.activeFile.fileName); + } + + // Move the caret to wherever we ended up + this.currentCaretPosition = offset; + this.fixCaretPosition(); + + this.checkPostEditInvariants(); + } + + private checkPostEditInvariants() { + if (this.editValidation === IncrementalEditValidation.None) { + return; + } + + // Get syntactic errors (to force a refresh) + var incrSyntaxErrs = JSON.stringify(this.languageService.getSyntacticDiagnostics(this.activeFile.fileName)); + + // Check syntactic structure + var compilationSettings = new TypeScript.CompilationSettings(); + compilationSettings.codeGenTarget = TypeScript.LanguageVersion.EcmaScript5; + var immutableSettings = TypeScript.ImmutableCompilationSettings.fromCompilationSettings(compilationSettings); + + var parseOptions = immutableSettings.codeGenTarget(); + var snapshot = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName); + var content = snapshot.getText(0, snapshot.getLength()); + var refSyntaxTree = TypeScript.Parser.parse(this.activeFile.fileName, TypeScript.SimpleText.fromString(content), parseOptions, TypeScript.isDTSFile(this.activeFile.fileName)); + var fullSyntaxErrs = JSON.stringify(refSyntaxTree.diagnostics()); + + if (incrSyntaxErrs !== fullSyntaxErrs) { + throw new Error('Mismatched incremental/full syntactic errors for file ' + this.activeFile.fileName + '.\n=== Incremental errors ===\n' + incrSyntaxErrs + '\n=== Full Errors ===\n' + fullSyntaxErrs); + } + + if (this.editValidation !== IncrementalEditValidation.SyntacticOnly) { + var compiler = new TypeScript.TypeScriptCompiler(); + for (var i = 0; i < this.testData.files.length; i++) { + snapshot = this.languageServiceShimHost.getScriptSnapshot(this.testData.files[i].fileName); + compiler.addFile(this.testData.files[i].fileName, TypeScript.ScriptSnapshot.fromString(snapshot.getText(0, snapshot.getLength())), TypeScript.ByteOrderMark.None, "0", true); + } + + compiler.addFile('lib.d.ts', TypeScript.ScriptSnapshot.fromString(Harness.Compiler.libTextMinimal), TypeScript.ByteOrderMark.None, "0", true); + + for (var i = 0; i < this.testData.files.length; i++) { + var refSemanticErrs = JSON.stringify(compiler.getSemanticDiagnostics(this.testData.files[i].fileName)); + var incrSemanticErrs = JSON.stringify(this.languageService.getSemanticDiagnostics(this.testData.files[i].fileName)); + + if (incrSemanticErrs !== refSemanticErrs) { + throw new Error('Mismatched incremental/full semantic errors for file ' + this.testData.files[i].fileName + '\n=== Incremental errors ===\n' + incrSemanticErrs + '\n=== Full Errors ===\n' + refSemanticErrs); + } + } + } + } + + private fixCaretPosition() { + // The caret can potentially end up between the \r and \n, which is confusing. If + // that happens, move it back one character + if (this.currentCaretPosition > 0) { + var ch = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(this.currentCaretPosition - 1, this.currentCaretPosition); + if (ch === '\r') { + this.currentCaretPosition--; + } + }; + } + + private applyEdits(fileName: string, edits: TypeScript.Services.TextChange[], isFormattingEdit = false): number { + // We get back a set of edits, but langSvc.editScript only accepts one at a time. Use this to keep track + // of the incremental offest from each edit to the next. Assumption is that these edit ranges don't overlap + var runningOffset = 0; + edits = edits.sort((a, b) => a.span.start() - b.span.start()); + // Get a snapshot of the content of the file so we can make sure any formatting edits didn't destroy non-whitespace characters + var snapshot = this.languageServiceShimHost.getScriptSnapshot(fileName); + var oldContent = snapshot.getText(0, snapshot.getLength()); + for (var j = 0; j < edits.length; j++) { + this.languageServiceShimHost.editScript(fileName, edits[j].span.start() + runningOffset, edits[j].span.end() + runningOffset, edits[j].newText); + this.updateMarkersForEdit(fileName, edits[j].span.start() + runningOffset, edits[j].span.end() + runningOffset, edits[j].newText); + var change = (edits[j].span.start() - edits[j].span.end()) + edits[j].newText.length; + runningOffset += change; + // TODO: Consider doing this at least some of the time for higher fidelity. Currently causes a failure (bug 707150) + // this.languageService.getScriptLexicalStructure(fileName); + } + + if (isFormattingEdit) { + snapshot = this.languageServiceShimHost.getScriptSnapshot(fileName); + var newContent = snapshot.getText(0, snapshot.getLength()); + + if (newContent.replace(/\s/g, '') !== oldContent.replace(/\s/g, '')) { + throw new Error('Formatting operation destroyed non-whitespace content'); + } + } + return runningOffset; + } + + public formatDocument() { + this.scenarioActions.push(''); + + var edits = this.languageService.getFormattingEditsForDocument(this.activeFile.fileName, this.formatCodeOptions); + this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, true); + this.fixCaretPosition(); + } + + public formatSelection(start: number, end: number) { + this.taoInvalidReason = 'formatSelection NYI'; + + var edits = this.languageService.getFormattingEditsForRange(this.activeFile.fileName, start, end, this.formatCodeOptions); + this.currentCaretPosition += this.applyEdits(this.activeFile.fileName, edits, true); + this.fixCaretPosition(); + } + + private updateMarkersForEdit(fileName: string, minChar: number, limChar: number, text: string) { + for (var i = 0; i < this.testData.markers.length; i++) { + var marker = this.testData.markers[i]; + if (marker.fileName === fileName) { + if (marker.position > minChar) { + if (marker.position < limChar) { + // Marker is inside the edit - mark it as invalidated (?) + marker.position = -1; + } else { + // Move marker back/forward by the appropriate amount + marker.position += (minChar - limChar) + text.length; + } + } + } + } + } + + public goToBOF() { + this.goToPosition(0); + } + + public goToEOF() { + var len = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); + this.goToPosition(len); + } + + public goToDefinition(definitionIndex: number) { + if (definitionIndex === 0) { + this.scenarioActions.push(''); + } else { + this.taoInvalidReason = 'GoToDefinition not supported for non-zero definition indices'; + } + + var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + if (!definitions || !definitions.length) { + throw new Error('goToDefinition failed - expected to at least one defintion location but got 0'); + } + + if (definitionIndex >= definitions.length) { + throw new Error('goToDefinition failed - definitionIndex value (' + definitionIndex + ') exceeds definition list size (' + definitions.length + ')'); + } + + var definition = definitions[definitionIndex]; + this.openFile(definition.fileName); + this.currentCaretPosition = definition.textSpan.start(); + } + + public verifyDefinitionLocationExists(negative: boolean) { + this.taoInvalidReason = 'verifyDefinitionLocationExists NYI'; + + var definitions = this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition); + + var foundDefinitions = definitions && definitions.length; + + if (foundDefinitions && negative) { + throw new Error('goToDefinition - expected to 0 defintion locations but got ' + definitions.length); + } + else if (!foundDefinitions && !negative) { + throw new Error('goToDefinition - expected to at least one defintion location but got 0'); + } + } + + public getMarkers(): Marker[] { + // Return a copy of the list + return this.testData.markers.slice(0); + } + + public getRanges(): Range[] { + // Return a copy of the list + return this.testData.ranges.slice(0); + } + + public verifyCaretAtMarker(markerName = '') { + this.taoInvalidReason = 'verifyCaretAtMarker NYI'; + + var pos = this.getMarkerByName(markerName); + if (pos.fileName !== this.activeFile.fileName) { + throw new Error('verifyCaretAtMarker failed - expected to be in file "' + pos.fileName + '", but was in file "' + this.activeFile.fileName + '"'); + } + if (pos.position !== this.currentCaretPosition) { + throw new Error('verifyCaretAtMarker failed - expected to be at marker "/*' + markerName + '*' + '/, but was at position ' + this.currentCaretPosition + '(' + this.getLineColStringAtCaret() + ')'); + } + } + + private getIndentation(fileName: string, position: number): number { + return this.languageService.getIndentationAtPosition(fileName, position, this.formatCodeOptions); + } + + public verifyIndentationAtCurrentPosition(numberOfSpaces: number) { + this.taoInvalidReason = 'verifyIndentationAtCurrentPosition NYI'; + + var actual = this.getIndentation(this.activeFile.fileName, this.currentCaretPosition); + if (actual != numberOfSpaces) { + throw new Error('verifyIndentationAtCurrentPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); + } + } + + public verifyIndentationAtPosition(fileName: string, position: number, numberOfSpaces: number) { + this.taoInvalidReason = 'verifyIndentationAtPosition NYI'; + + var actual = this.getIndentation(fileName, position); + if (actual !== numberOfSpaces) { + throw new Error('verifyIndentationAtPosition failed - expected: ' + numberOfSpaces + ', actual: ' + actual); + } + } + + public verifyCurrentLineContent(text: string) { + this.taoInvalidReason = 'verifyCurrentLineContent NYI'; + + var actual = this.getCurrentLineContent(); + if (actual !== text) { + throw new Error('verifyCurrentLineContent\n' + + '\tExpected: "' + text + '"\n' + + '\t Actual: "' + actual + '"'); + } + } + + public verifyCurrentFileContent(text: string) { + this.taoInvalidReason = 'verifyCurrentFileContent NYI'; + + var actual = this.getCurrentFileContent(); + var replaceNewlines = (str: string) => str.replace(/\r\n/g, "\n"); + if (replaceNewlines(actual) !== replaceNewlines(text)) { + throw new Error('verifyCurrentFileContent\n' + + '\tExpected: "' + text + '"\n' + + '\t Actual: "' + actual + '"'); + } + } + + public verifyTextAtCaretIs(text: string) { + this.taoInvalidReason = 'verifyCurrentFileContent NYI'; + + var actual = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(this.currentCaretPosition, this.currentCaretPosition + text.length); + if (actual !== text) { + throw new Error('verifyTextAtCaretIs\n' + + '\tExpected: "' + text + '"\n' + + '\t Actual: "' + actual + '"'); + } + } + + public verifyCurrentNameOrDottedNameSpanText(text: string) { + this.taoInvalidReason = 'verifyCurrentNameOrDottedNameSpanText NYI'; + + var span = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, this.currentCaretPosition, this.currentCaretPosition); + if (span === null) { + throw new Error('verifyCurrentNameOrDottedNameSpanText\n' + + '\tExpected: "' + text + '"\n' + + '\t Actual: null'); + } + + var actual = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(span.start(), span.end()); + if (actual !== text) { + throw new Error('verifyCurrentNameOrDottedNameSpanText\n' + + '\tExpected: "' + text + '"\n' + + '\t Actual: "' + actual + '"'); + } + } + + private getNameOrDottedNameSpan(pos: number) { + var spanInfo = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, pos, pos); + var resultString = "\n**Pos: " + pos + " SpanInfo: " + JSON.stringify(spanInfo) + "\n** Statement: "; + if (spanInfo !== null) { + resultString = resultString + this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getText(spanInfo.start(), spanInfo.end()); + } + return resultString; + } + + public baselineCurrentFileNameOrDottedNameSpans() { + this.taoInvalidReason = 'baselineCurrentFileNameOrDottedNameSpans impossible'; + + Harness.Baseline.runBaseline( + "Name OrDottedNameSpans for " + this.activeFile.fileName, + this.testData.globalOptions['BaselineFile'], + () => { + var fileLength = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); + var resultString = ""; + for (var pos = 0; pos < fileLength; pos++) { + resultString = resultString + this.getNameOrDottedNameSpan(pos); + } + return resultString; + }); + } + + public printNameOrDottedNameSpans(pos: number) { + Harness.IO.log(this.getNameOrDottedNameSpan(pos)); + } + + public verifyOutliningSpans(spans: TextSpan[]) { + this.taoInvalidReason = 'verifyOutliningSpans NYI'; + + var actual = this.languageService.getOutliningSpans(this.activeFile.fileName); + + if (actual.length !== spans.length) { + throw new Error('verifyOutliningSpans failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); + } + + for (var i = 0; i < spans.length; i++) { + var expectedSpan = spans[i]; + var actualSpan = actual[i]; + if (expectedSpan.start !== actualSpan.textSpan.start() || expectedSpan.end !== actualSpan.textSpan.end()) { + throw new Error('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualSpan.textSpan.start() + ',' + actualSpan.textSpan.end() + ')'); + } + } + } + + public verifyTodoComments(descriptors: string[], spans: TextSpan[]) { + var actual = this.languageService.getTodoComments(this.activeFile.fileName, + descriptors.map(d => new TypeScript.Services.TodoCommentDescriptor(d, 0))); + + if (actual.length !== spans.length) { + throw new Error('verifyTodoComments failed - expected total spans to be ' + spans.length + ', but was ' + actual.length); + } + + for (var i = 0; i < spans.length; i++) { + var expectedSpan = spans[i]; + var actualComment = actual[i]; + var actualCommentSpan = new TypeScript.TextSpan(actualComment.position, actualComment.message.length); + + if (expectedSpan.start !== actualCommentSpan.start() || expectedSpan.end !== actualCommentSpan.end()) { + throw new Error('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualCommentSpan.start() + ',' + actualCommentSpan.end() + ')'); + } + } + } + + public verifyMatchingBracePosition(bracePosition: number, expectedMatchPosition: number) { + this.taoInvalidReason = 'verifyMatchingBracePosition NYI'; + + var actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); + + if (actual.length !== 2) { + throw new Error('verifyMatchingBracePosition failed - expected result to contain 2 spans, but it had ' + actual.length); + } + + var actualMatchPosition = -1; + if (bracePosition == actual[0].start()) { + actualMatchPosition = actual[1].start(); + } else if (bracePosition == actual[1].start()) { + actualMatchPosition = actual[0].start(); + } else { + throw new Error('verifyMatchingBracePosition failed - could not find the brace position: ' + bracePosition + ' in the returned list: (' + actual[0].start() + ',' + actual[0].end() + ') and (' + actual[1].start() + ',' + actual[1].end() + ')'); + } + + if (actualMatchPosition !== expectedMatchPosition) { + throw new Error('verifyMatchingBracePosition failed - expected: ' + actualMatchPosition + ', actual: ' + expectedMatchPosition); + } + } + + public verifyNoMatchingBracePosition(bracePosition: number) { + this.taoInvalidReason = 'verifyNoMatchingBracePosition NYI'; + + var actual = this.languageService.getBraceMatchingAtPosition(this.activeFile.fileName, bracePosition); + + if (actual.length !== 0) { + throw new Error('verifyNoMatchingBracePosition failed - expected: 0 spans, actual: ' + actual.length); + } + } + + public verifyTypesAgainstFullCheckAtPositions(positions: number[]) { + this.taoInvalidReason = 'verifyTypesAgainstFullCheckAtPositions impossible'; + + // Create a from-scratch LS to check against + var referenceLanguageServiceShimHost = new Harness.TypeScriptLS(); + var referenceLanguageServiceShim = referenceLanguageServiceShimHost.getLanguageService(); + var referenceLanguageService = referenceLanguageServiceShim.languageService; + + // Add lib.d.ts to the reference language service + referenceLanguageServiceShimHost.addScript('lib.d.ts', Harness.Compiler.libTextMinimal); + + for (var i = 0; i < this.testData.files.length; i++) { + var file = this.testData.files[i]; + + var snapshot = this.languageServiceShimHost.getScriptSnapshot(file.fileName); + var content = snapshot.getText(0, snapshot.getLength()); + referenceLanguageServiceShimHost.addScript(this.testData.files[i].fileName, content); + } + + for (i = 0; i < positions.length; i++) { + var nameOf = (type: TypeScript.Services.TypeInfo) => type ? type.fullSymbolName : '(none)'; + + var pullName: string, refName: string; + var anyFailed = false; + + var errMsg = ''; + + try { + var pullType = this.languageService.getTypeAtPosition(this.activeFile.fileName, positions[i]); + pullName = nameOf(pullType); + } catch (err1) { + errMsg = 'Failed to get pull type check. Exception: ' + err1 + '\r\n'; + if (err1.stack) errMsg = errMsg + err1.stack; + pullName = '(failed)'; + anyFailed = true; + } + + try { + var referenceType = referenceLanguageService.getTypeAtPosition(this.activeFile.fileName, positions[i]); + refName = nameOf(referenceType); + } catch (err2) { + errMsg = 'Failed to get full type check. Exception: ' + err2 + '\r\n'; + if (err2.stack) errMsg = errMsg + err2.stack; + refName = '(failed)'; + anyFailed = true; + } + + var failure = anyFailed || (refName !== pullName); + if (failure) { + snapshot = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName); + content = snapshot.getText(0, snapshot.getLength()); + var textAtPosition = content.substr(positions[i], 10); + var positionDescription = 'Position ' + positions[i] + ' ("' + textAtPosition + '"...)'; + + if (anyFailed) { + throw new Error('Exception thrown in language service for ' + positionDescription + '\r\n' + errMsg); + } else if (refName !== pullName) { + throw new Error('Pull/Full disagreement failed at ' + positionDescription + ' - expected full typecheck type "' + refName + '" to equal pull type "' + pullName + '".'); + } + } + } + } + + /// Check number of navigationItems which match both searchValue and matchKind. + /// Report an error if expected value and actual value do not match. + public verifyNavigationItemsCount(expected: number, searchValue: string, matchKind?: string) { + this.taoInvalidReason = 'verifyNavigationItemsCount NYI'; + + var items = this.languageService.getNavigateToItems(searchValue); + var actual = 0; + var item: TypeScript.Services.NavigateToItem = null; + + // Count only the match that match the same MatchKind + for (var i = 0; i < items.length; ++i) { + item = items[i]; + if (!matchKind || item.matchKind === matchKind) { + actual++; + } + } + + if (expected != actual) { + throw new Error('verifyNavigationItemsCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); + } + } + + /// Verify that returned navigationItems from getNavigateToItems have matched searchValue, matchKind, and kind. + /// Report an error if getNavigateToItems does not find any matched searchValue. + public verifyNavigationItemsListContains( + name: string, + kind: string, + searchValue: string, + matchKind: string, + fileName?: string, + parentName?: string) { + this.taoInvalidReason = 'verifyNavigationItemsListContains NYI'; + + var items = this.languageService.getNavigateToItems(searchValue); + + if (!items || items.length === 0) { + throw new Error('verifyNavigationItemsListContains failed - found 0 navigation items, expected at least one.'); + } + + for (var i = 0; i < items.length; i++) { + var item = items[i]; + if (item && item.name === name && item.kind === kind && + (matchKind === undefined || item.matchKind === matchKind) && + (fileName === undefined || item.fileName === fileName) && + (parentName === undefined || item.containerName === parentName)) { + return; + } + } + + // if there was an explicit match kind specified, then it should be validated. + if (matchKind !== undefined) { + var missingItem = { name: name, kind: kind, searchValue: searchValue, matchKind: matchKind, fileName: fileName, parentName: parentName }; + throw new Error('verifyNavigationItemsListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); + } + } + + public verifyGetScriptLexicalStructureListCount(expected: number) { + this.taoInvalidReason = 'verifyNavigationItemsListContains impossible'; + + var items = this.languageService.getNavigationBarItems(this.activeFile.fileName); + var actual = this.getNavigationBarItemsCount(items); + + if (expected != actual) { + throw new Error('verifyGetScriptLexicalStructureListCount failed - found: ' + actual + ' navigation items, expected: ' + expected + '.'); + } + } + + private getNavigationBarItemsCount(items: TypeScript.Services.NavigationBarItem[]) { + var result = 0; + if (items) { + for (var i = 0, n = items.length; i < n; i++) { + result++; + result += this.getNavigationBarItemsCount(items[i].childItems); + } + } + + return result; + } + + public verifGetScriptLexicalStructureListContains( + name: string, + kind: string, + markerPosition?: number) { + this.taoInvalidReason = 'verifGetScriptLexicalStructureListContains impossible'; + + var items = this.languageService.getNavigationBarItems(this.activeFile.fileName); + + if (!items || items.length === 0) { + throw new Error('verifyGetScriptLexicalStructureListContains failed - found 0 navigation items, expected at least one.'); + } + + if (this.navigationBarItemsContains(items, name, kind)) { + return; + } + + var missingItem = { name: name, kind: kind }; + throw new Error('verifyGetScriptLexicalStructureListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(items) + ')'); + } + + private navigationBarItemsContains(items: TypeScript.Services.NavigationBarItem[], name: string, kind: string) { + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + if (item && item.text === name && item.kind === kind) { + return true; + } + + if (this.navigationBarItemsContains(item.childItems, name, kind)) { + return true; + } + } + } + + return false; + } + + public printNavigationItems(searchValue: string) { + var items = this.languageService.getNavigateToItems(searchValue); + var length = items && items.length; + + Harness.IO.log('NavigationItems list (' + length + ' items)'); + + for (var i = 0; i < length; i++) { + var item = items[i]; + Harness.IO.log('name: ' + item.name + ', kind: ' + item.kind + ', parentName: ' + item.containerName + ', fileName: ' + item.fileName); + } + } + + public printScriptLexicalStructureItems() { + var items = this.languageService.getNavigationBarItems(this.activeFile.fileName); + var length = items && items.length; + + Harness.IO.log('NavigationItems list (' + length + ' items)'); + + for (var i = 0; i < length; i++) { + var item = items[i]; + Harness.IO.log('name: ' + item.text + ', kind: ' + item.kind); + } + } + + private getOccurancesAtCurrentPosition() { + return this.languageService.getOccurrencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); + } + + public verifyOccurrencesAtPositionListContains(fileName: string, start: number, end: number, isWriteAccess?: boolean) { + this.taoInvalidReason = 'verifyOccurrencesAtPositionListContains NYI'; + + var occurances = this.getOccurancesAtCurrentPosition(); + + if (!occurances || occurances.length === 0) { + throw new Error('verifyOccurancesAtPositionListContains failed - found 0 references, expected at least one.'); + } + + for (var i = 0; i < occurances.length; i++) { + var occurance = occurances[i]; + if (occurance && occurance.fileName === fileName && occurance.textSpan.start() === start && occurance.textSpan.end() === end) { + if (typeof isWriteAccess !== "undefined" && occurance.isWriteAccess !== isWriteAccess) { + throw new Error('verifyOccurancesAtPositionListContains failed - item isWriteAccess value doe not match, actual: ' + occurance.isWriteAccess + ', expected: ' + isWriteAccess + '.'); + } + return; + } + } + + var missingItem = { fileName: fileName, start: start, end: end, isWriteAccess: isWriteAccess }; + throw new Error('verifyOccurancesAtPositionListContains failed - could not find the item: ' + JSON.stringify(missingItem) + ' in the returned list: (' + JSON.stringify(occurances) + ')'); + } + + public verifyOccurrencesAtPositionListCount(expectedCount: number) { + this.taoInvalidReason = 'verifyOccurrencesAtPositionListCount NYI'; + + var occurances = this.getOccurancesAtCurrentPosition(); + var actualCount = occurances ? occurances.length : 0; + if (expectedCount !== actualCount) { + throw new Error('verifyOccurrencesAtPositionListCount failed - actual: ' + actualCount + ', expected:' + expectedCount); + } + } + + private getBOF(): number { + return 0; + } + + private getEOF(): number { + return this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); + } + + // Get the text of the entire line the caret is currently at + private getCurrentLineContent() { + // The current caret position (in line/col terms) + var line = this.getCurrentCaretFilePosition().line; + // The line/col of the start of this line + var pos = this.languageServiceShimHost.lineColToPosition(this.activeFile.fileName, line, 1); + // The index of the current file + + // The text from the start of the line to the end of the file + var snapshot = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName); + var text = snapshot.getText(pos, snapshot.getLength()); + + // Truncate to the first newline + var newlinePos = text.indexOf('\n'); + if (newlinePos === -1) { + return text; + } else { + if (text.charAt(newlinePos - 1) === '\r') { + newlinePos--; + } + return text.substr(0, newlinePos); + } + } + + private getCurrentFileContent() { + var snapshot = this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName); + return snapshot.getText(0, snapshot.getLength()); + } + + private getCurrentCaretFilePosition() { + var result = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition); + if (result.line >= 0) { + result.line++; + } + + if (result.character >= 0) { + result.character++; + } + + return result; + } + + private assertItemInCompletionList(items: TypeScript.Services.CompletionEntry[], name: string, type?: string, docComment?: string, fullSymbolName?: string, kind?: string) { + this.scenarioActions.push(''); + this.scenarioActions.push(''); + + if (type || docComment || fullSymbolName || kind) { + this.taoInvalidReason = 'assertItemInCompletionList only supports the "name" parameter'; + } + + for (var i = 0; i < items.length; i++) { + var item = items[i]; + if (item.name == name) { + if (docComment != undefined || type !== undefined || fullSymbolName !== undefined) { + var details = this.getCompletionEntryDetails(item.name); + + if (docComment != undefined) { + assert.equal(details.docComment, docComment); + } + if (type !== undefined) { + assert.equal(details.type, type); + } + if (fullSymbolName !== undefined) { + assert.equal(details.fullSymbolName, fullSymbolName); + } + } + + if (kind !== undefined) { + assert.equal(item.kind, kind); + } + + return; + } + } + + var itemsString = items.map((item) => JSON.stringify({ name: item.name, kind: item.kind })).join(",\n"); + + throw new Error("Marker: " + currentTestState.lastKnownMarker + "\n" + 'Expected "' + JSON.stringify({ name: name, type: type, docComment: docComment, fullSymbolName: fullSymbolName, kind: kind }) + '" to be in list [' + itemsString + ']'); + } + + private findFile(indexOrName: any) { + var result: FourSlashFile = null; + if (typeof indexOrName === 'number') { + var index = indexOrName; + if (index >= this.testData.files.length) { + throw new Error('File index (' + index + ') in openFile was out of range. There are only ' + this.testData.files.length + ' files in this test.'); + } else { + result = this.testData.files[index]; + } + } else if (typeof indexOrName === 'string') { + var name = indexOrName; + // names are stored in the compiler with this relative path, this allows people to use goTo.file on just the filename + name = name.indexOf('/') === -1 ? 'tests/cases/fourslash/' + name : name; + var availableNames: string[] = []; + var foundIt = false; + for (var i = 0; i < this.testData.files.length; i++) { + var fn = this.testData.files[i].fileName; + if (fn) { + if (fn === name) { + result = this.testData.files[i]; + foundIt = true; + break; + } + availableNames.push(fn); + } + } + + if (!foundIt) { + throw new Error('No test file named "' + name + '" exists. Available file names are:' + availableNames.join(', ')); + } + } else { + throw new Error('Unknown argument type'); + } + + return result; + } + + private getCurrentLineNumberZeroBased() { + return this.getCurrentLineNumberOneBased() - 1; + } + + private getCurrentLineNumberOneBased() { + return this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition).line + 1; + } + + private getLineColStringAtCaret() { + var pos = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition); + return 'line ' + (pos.line + 1) + ', col ' + pos.character; + } + + private getMarkerByName(markerName: string) { + var markerPos = this.testData.markerPositions[markerName]; + if (markerPos === undefined) { + var markerNames: string[] = []; + for (var m in this.testData.markerPositions) markerNames.push(m); + throw new Error('Unknown marker "' + markerName + '" Available markers: ' + markerNames.map(m => '"' + m + '"').join(', ')); + } else { + return markerPos; + } + } + + private static makeWhitespaceVisible(text: string) { + return text.replace(/ /g, '\u00B7').replace(/\r/g, '\u00B6').replace(/\n/g, '\u2193\n').replace(/\t/g, '\u2192\ '); + } + + public getTestXmlData(): TestXmlData { + return { + actions: this.scenarioActions, + invalidReason: this.taoInvalidReason, + originalName: '' + }; + } + } + + // TOOD: should these just use the Harness's stdout/stderr? + var fsOutput = new Harness.Compiler.WriterAggregator(); + var fsErrors = new Harness.Compiler.WriterAggregator(); + export var xmlData: TestXmlData[] = []; + export function runFourSlashTest(fileName: string) { + var content = Harness.IO.readFile(fileName); + var xml = runFourSlashTestContent(content, fileName); + xmlData.push(xml); + } + + export function runFourSlashTestContent(content: string, fileName: string): TestXmlData { + // Parse out the files and their metadata + var testData = parseTestData(content, fileName); + + currentTestState = new TestState(testData); + + var result = ''; + var tsFn = 'tests/cases/fourslash/fourslash.ts'; + + fsOutput.reset(); + fsErrors.reset(); + + var harnessCompiler = Harness.Compiler.getCompiler(); + harnessCompiler.reset(); + + var filesToAdd = [ + { unitName: tsFn, content: Harness.IO.readFile(tsFn) }, + { unitName: fileName, content: Harness.IO.readFile(fileName) } + ]; + harnessCompiler.addInputFiles(filesToAdd); + harnessCompiler.compile(); + + var emitterIOHost: Harness.Compiler.IEmitterIOHost = { + writeFile: (path: string, contents: string, writeByteOrderMark: boolean) => fsOutput.Write(contents), + resolvePath: (s: string) => s + } + + harnessCompiler.emitAll(emitterIOHost); + fsOutput.Close(); + fsErrors.Close(); + + if (fsErrors.lines.length > 0) { + throw new Error('Error compiling ' + fileName + ': ' + fsErrors.lines.join('\r\n')); + } + + result = fsOutput.lines.join('\r\n'); + + // Compile and execute the test + try { + eval(result); + } catch (err) { + // Debugging: FourSlash.currentTestState.printCurrentFileState(); + throw err; + } finally { + harnessCompiler.reset(); + } + + var xmlData = currentTestState.getTestXmlData(); + xmlData.originalName = fileName; + return xmlData; + } + + function chompLeadingSpace(content: string) { + var lines = content.split("\n"); + for (var i = 0; i < lines.length; i++) { + if ((lines[i].length !== 0) && (lines[i].charAt(0) !== ' ')) { + return content; + } + } + + return lines.map(s => s.substr(1)).join('\n'); + } + + function parseTestData(contents: string, fileName: string): FourSlashData { + // Regex for parsing options in the format "@Alpha: Value of any sort" + var optionRegex = /^\s*@(\w+): (.*)\s*/; + + // List of all the subfiles we've parsed out + var files: FourSlashFile[] = []; + // Global options + var opts: { [s: string]: string; } = {}; + // Marker positions + + // Split up the input file by line + // Note: IE JS engine incorrectly handles consecutive delimiters here when using RegExp split, so + // we have to string-based splitting instead and try to figure out the delimiting chars + var lines = contents.split('\n'); + + var markerMap: MarkerMap = {}; + var markers: Marker[] = []; + var ranges: Range[] = []; + + // Stuff related to the subfile we're parsing + var currentFileContent: string = null; + var currentFileName = fileName; + var currentFileOptions: { [s: string]: string } = {}; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + var lineLength = line.length; + + if (lineLength > 0 && line.charAt(lineLength - 1) === '\r') { + line = line.substr(0, lineLength - 1); + } + + if (line.substr(0, 4) === '////') { + // Subfile content line + + // Append to the current subfile content, inserting a newline needed + if (currentFileContent === null) { + currentFileContent = ''; + } else { + // End-of-line + currentFileContent = currentFileContent + '\n'; + } + + currentFileContent = currentFileContent + line.substr(4); + } else if (line.substr(0, 2) === '//') { + // Comment line, check for global/file @options and record them + var match = optionRegex.exec(line.substr(2)); + if (match) { + var globalNameIndex = globalMetadataNames.indexOf(match[1]); + var fileNameIndex = fileMetadataNames.indexOf(match[1]); + if (globalNameIndex === -1) { + if (fileNameIndex === -1) { + throw new Error('Unrecognized metadata name "' + match[1] + '". Available global metadata names are: ' + globalMetadataNames.join(', ') + '; file metadata names are: ' + fileMetadataNames.join(', ')); + } else { + // Found an @Filename directive, if this is not the first then create a new subfile + if (currentFileContent) { + var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + file.fileOptions = currentFileOptions; + + // Store result file + files.push(file); + + // Reset local data + currentFileContent = null; + currentFileOptions = {}; + currentFileName = fileName; + } + + currentFileName = 'tests/cases/fourslash/' + match[2]; + currentFileOptions[match[1]] = match[2]; + } + } else { + opts[match[1]] = match[2]; + } + } + } else if (line == '' || lineLength === 0) { + // Previously blank lines between fourslash content caused it to be considered as 2 files, + // Remove this behavior since it just causes errors now + } else { + // Empty line or code line, terminate current subfile if there is one + if (currentFileContent) { + var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + file.fileOptions = currentFileOptions; + + // Store result file + files.push(file); + + // Reset local data + currentFileContent = null; + currentFileOptions = {}; + currentFileName = fileName; + } + } + } + + return { + markerPositions: markerMap, + markers: markers, + globalOptions: opts, + files: files, + ranges: ranges + } + } + + enum State { + none, + inSlashStarMarker, + inObjectMarker + } + + function reportError(fileName: string, line: number, col: number, message: string) { + var errorMessage = fileName + "(" + line + "," + col + "): " + message; + throw new Error(errorMessage); + } + + function recordObjectMarker(fileName: string, location: ILocationInformation, text: string, markerMap: MarkerMap, markers: Marker[]): Marker { + var markerValue: any = undefined; + try { + // Attempt to parse the marker value as JSON + markerValue = JSON.parse("{ " + text + " }"); + } catch (e) { + reportError(fileName, location.sourceLine, location.sourceColumn, "Unable to parse marker text " + e.message); + } + + if (markerValue === undefined) { + reportError(fileName, location.sourceLine, location.sourceColumn, "Object markers can not be empty"); + return null; + } + + var marker: Marker = { + fileName: fileName, + position: location.position, + data: markerValue + }; + + // Object markers can be anonymous + if (markerValue.name) { + markerMap[markerValue.name] = marker; + } + + markers.push(marker); + + return marker; + } + + function recordMarker(fileName: string, location: ILocationInformation, name: string, markerMap: MarkerMap, markers: Marker[]): Marker { + var marker: Marker = { + fileName: fileName, + position: location.position + }; + + // Verify markers for uniqueness + if (markerMap[name] !== undefined) { + var message = "Marker '" + name + "' is duplicated in the source file contents."; + reportError(marker.fileName, location.sourceLine, location.sourceColumn, message); + return null; + } else { + markerMap[name] = marker; + markers.push(marker); + return marker; + } + } + + function parseFileContent(content: string, fileName: string, markerMap: MarkerMap, markers: Marker[], ranges: Range[]): FourSlashFile { + content = chompLeadingSpace(content); + + // Any slash-star comment with a character not in this string is not a marker. + var validMarkerChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz$1234567890_'; + + /// The file content (minus metacharacters) so far + var output: string = ""; + + /// The current marker (or maybe multi-line comment?) we're parsing, possibly + var openMarker: ILocationInformation = null; + + /// A stack of the open range markers that are still unclosed + var openRanges: IRangeLocationInformation[] = []; + + /// A list of ranges we've collected so far */ + var localRanges: Range[] = []; + + /// The latest position of the start of an unflushed plaintext area + var lastNormalCharPosition: number = 0; + + /// The total number of metacharacters removed from the file (so far) + var difference: number = 0; + + /// The fourslash file state object we are generating + var state: State = State.none; + + /// Current position data + var line: number = 1; + var column: number = 1; + + var flush = (lastSafeCharIndex: number) => { + if (lastSafeCharIndex === undefined) { + output = output + content.substr(lastNormalCharPosition); + } else { + output = output + content.substr(lastNormalCharPosition, lastSafeCharIndex - lastNormalCharPosition); + } + }; + + if (content.length > 0) { + var previousChar = content.charAt(0); + for (var i = 1; i < content.length; i++) { + var currentChar = content.charAt(i); + switch (state) { + case State.none: + if (previousChar === "[" && currentChar === "|") { + // found a range start + openRanges.push({ + position: (i - 1) - difference, + sourcePosition: i - 1, + sourceLine: line, + sourceColumn: column, + }); + // copy all text up to marker position + flush(i - 1); + lastNormalCharPosition = i + 1; + difference += 2; + } else if (previousChar === "|" && currentChar === "]") { + // found a range end + var rangeStart = openRanges.pop(); + if (!rangeStart) { + reportError(fileName, line, column, "Found range end with no matching start."); + } + + var range: Range = { + fileName: fileName, + start: rangeStart.position, + end: (i - 1) - difference, + marker: rangeStart.marker + }; + localRanges.push(range); + + // copy all text up to range marker position + flush(i - 1); + lastNormalCharPosition = i + 1; + difference += 2; + } else if (previousChar === "/" && currentChar === "*") { + // found a possible marker start + state = State.inSlashStarMarker; + openMarker = { + position: (i - 1) - difference, + sourcePosition: i - 1, + sourceLine: line, + sourceColumn: column, + }; + } else if (previousChar === "{" && currentChar === "|") { + // found an object marker start + state = State.inObjectMarker; + openMarker = { + position: (i - 1) - difference, + sourcePosition: i - 1, + sourceLine: line, + sourceColumn: column, + }; + flush(i - 1); + } + break; + + case State.inObjectMarker: + // Object markers are only ever terminated by |} and have no content restrictions + if (previousChar === "|" && currentChar === "}") { + // Record the marker + var objectMarkerNameText = content.substring(openMarker.sourcePosition + 2, i - 1).trim(); + var marker = recordObjectMarker(fileName, openMarker, objectMarkerNameText, markerMap, markers); + + if (openRanges.length > 0) { + openRanges[openRanges.length - 1].marker = marker; + } + + // Set the current start to point to the end of the current marker to ignore its text + lastNormalCharPosition = i + 1; + difference += i + 1 - openMarker.sourcePosition; + + // Reset the state + openMarker = null; + state = State.none; + } + break; + + case State.inSlashStarMarker: + if (previousChar === "*" && currentChar === "/") { + // Record the marker + // start + 2 to ignore the */, -1 on the end to ignore the * (/ is next) + var markerNameText = content.substring(openMarker.sourcePosition + 2, i - 1).trim(); + var marker = recordMarker(fileName, openMarker, markerNameText, markerMap, markers); + + if (openRanges.length > 0) { + openRanges[openRanges.length - 1].marker = marker; + } + + // Set the current start to point to the end of the current marker to ignore its text + flush(openMarker.sourcePosition); + lastNormalCharPosition = i + 1; + difference += i + 1 - openMarker.sourcePosition; + + // Reset the state + openMarker = null; + state = State.none; + } else if (validMarkerChars.indexOf(currentChar) < 0) { + if (currentChar === '*' && i < content.length - 1 && content.charAt(i + 1) === '/') { + // The marker is about to be closed, ignore the 'invalid' char + } else { + // We've hit a non-valid marker character, so we were actually in a block comment + // Bail out the text we've gathered so far back into the output + flush(i); + lastNormalCharPosition = i; + openMarker = null; + + state = State.none; + } + } + break; + } + + if (currentChar === '\n' && previousChar === '\r') { + // Ignore trailing \n after a \r + continue; + } else if (currentChar === '\n' || currentChar === '\r') { + line++; + column = 1; + continue; + } + + column++; + previousChar = currentChar; + } + } + + // Add the remaining text + flush(undefined); + + if (openRanges.length > 0) { + var openRange = openRanges[0]; + reportError(fileName, openRange.sourceLine, openRange.sourceColumn, "Unterminated range."); + } + + if (openMarker !== null) { + reportError(fileName, openMarker.sourceLine, openMarker.sourceColumn, "Unterminated marker."); + } + + // put ranges in the correct order + localRanges = localRanges.sort((a, b) => a.start < b.start ? -1 : 1); + localRanges.forEach((r) => { ranges.push(r); }); + + return { + content: output, + fileOptions: {}, + version: 0, + fileName: fileName + }; + } +} diff --git a/src/harness/fourslashRun.ts b/src/harness/fourslashRun.ts new file mode 100644 index 0000000000000..28f0b2dd63754 --- /dev/null +++ b/src/harness/fourslashRun.ts @@ -0,0 +1,48 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// + +var testList: string[] = []; + +if (IO.arguments.length === 0) { + IO.dir(Harness.userSpecifiedroot + 'tests/ls/fourslash', /\.ts$/).forEach(fn => { + if (!fn.match(/fourslash.ts$/i)) { + testList.push(fn); + } + }); +} else { + IO.arguments.forEach(tests => tests.split(',').forEach(test => { + testList.push(test); + })); +} + +var passCount = 0, failCount = 0; +testList.forEach(test => { + try { + IO.print('Running ' + test.substr(IO.dirName(test).length + 1) + '... '); + FourSlash.runFourSlashTest(test); + IO.printLine('passed.'); + passCount++; + } catch (e) { + IO.printLine(e); + if (e.stack) { + IO.printLine(e.stack); + } + failCount++; + } +}); + +IO.printLine(passCount + ' passed, ' + failCount + ' failed.'); \ No newline at end of file diff --git a/src/harness/fourslashRunner.ts b/src/harness/fourslashRunner.ts new file mode 100644 index 0000000000000..676cb604800d8 --- /dev/null +++ b/src/harness/fourslashRunner.ts @@ -0,0 +1,98 @@ +/// +/// +/// + +class FourslashRunner extends RunnerBase { + public basePath = 'tests/cases/fourslash'; + + constructor() { + super(); + } + + public initializeTests() { + if (this.tests.length === 0) { + this.tests = this.enumerateFiles(this.basePath); + } + + describe("fourslash tests", () => { + before(() => { + Harness.Compiler.getCompiler({ useExistingInstance: false }); + }); + + this.tests.forEach((fn: string) => { + fn = Harness.Path.switchToForwardSlashes(fn); + var justName = fn.replace(/^.*[\\\/]/, ''); + + // Convert to relative path + var testIndex = fn.indexOf('tests/'); + if (testIndex >= 0) fn = fn.substr(testIndex); + + if (justName && !justName.match(/fourslash\.ts$/i) && !justName.match(/\.d\.ts$/i)) { + it('FourSlash test ' + justName + ' runs correctly', function () { + FourSlash.runFourSlashTest(fn); + }); + } + }); + + after(() => { + Harness.Compiler.getCompiler({ useExistingInstance: false }); + }); + }); + + describe('Generate Tao XML', () => { + var invalidReasons: any = {}; + FourSlash.xmlData.forEach(xml => { + if (xml.invalidReason !== null) { + invalidReasons[xml.invalidReason] = (invalidReasons[xml.invalidReason] || 0) + 1; + } + }); + var invalidReport: { reason: string; count: number }[] = []; + for (var reason in invalidReasons) { + if (invalidReasons.hasOwnProperty(reason)) { + invalidReport.push({ reason: reason, count: invalidReasons[reason] }); + } + } + invalidReport.sort((lhs, rhs) => lhs.count > rhs.count ? -1 : lhs.count === rhs.count ? 0 : 1); + + var lines: string[] = []; + lines.push(''); + lines.push(''); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + FourSlash.xmlData.forEach(xml => { + if (xml.invalidReason !== null) { + lines.push(''); + } else { + lines.push(' '); + xml.actions.forEach(action => { + lines.push(' ' + action); + }); + lines.push(' '); + } + }); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(' '); + lines.push(''); + Harness.IO.writeFile('built/local/fourslash.xml', lines.join('\r\n')); + }); + } +} + +class GeneratedFourslashRunner extends FourslashRunner { + constructor() { + super(); + this.basePath += '/generated/'; + } +} \ No newline at end of file diff --git a/src/harness/harness.ts b/src/harness/harness.ts new file mode 100644 index 0000000000000..25be918b22ed7 --- /dev/null +++ b/src/harness/harness.ts @@ -0,0 +1,1113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// +/// +/// +/// +/// +/// + +// this will work in the browser via browserify +var _chai: typeof chai = require('chai'); +var assert: typeof _chai.assert = _chai.assert; +declare var __dirname: any; // Node-specific +var global = Function("return this").call(null); + +module Utils { + var global = Function("return this").call(null); + + // Setup some globals based on the current environment + export enum ExecutionEnvironment { + Node, + Browser, + CScript + } + + export function getExecutionEnvironment() { + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return ExecutionEnvironment.CScript; + } else if (process && (process).execPath && (process).execPath.indexOf("node") !== -1) { + return ExecutionEnvironment.Node; + } else { + return ExecutionEnvironment.Browser; + } + } + + export var currentExecutionEnvironment = getExecutionEnvironment(); + + export function evalFile(fileContents: string, filename: string, nodeContext?: any) { + var environment = getExecutionEnvironment(); + switch (environment) { + case ExecutionEnvironment.CScript: + case ExecutionEnvironment.Browser: + eval(fileContents); + break; + case ExecutionEnvironment.Node: + var vm = require('vm'); + if (nodeContext) { + vm.runInNewContext(fileContents, nodeContext, filename); + } else { + vm.runInThisContext(fileContents, filename); + } + break; + default: + throw new Error('Unknown context'); + } + } + + /** Splits the given string on \r\n or on only \n if that fails */ + export function splitContentByNewlines(content: string) { + // Split up the input file by line + // Note: IE JS engine incorrectly handles consecutive delimiters here when using RegExp split, so + // we have to string-based splitting instead and try to figure out the delimiting chars + var lines = content.split('\r\n'); + if (lines.length === 1) { + lines = content.split('\n'); + } + return lines; + } + + /** Reads a file under /tests */ + export function readTestFile(path: string) { + if (path.indexOf('tests') < 0) { + path = "tests/" + path; + } + + try { + var content = sys.readFile(Harness.userSpecifiedroot + path); + } + catch (err) { + return undefined; + } + + return content; + } + + export function memoize(f: T): T { + var cache: { [idx: string]: any } = {}; + + return (() => { + var key = Array.prototype.join.call(arguments); + var cachedResult = cache[key]; + if (cachedResult) { + return cachedResult; + } else { + return cache[key] = f.apply(this, arguments); + } + }) + } +} + +module Harness.Path { + export function getFileName(fullPath: string) { + return fullPath.replace(/^.*[\\\/]/, ''); + } + + export function filePath(fullPath: string) { + fullPath = switchToForwardSlashes(fullPath); + var components = fullPath.split("/"); + var path: string[] = components.slice(0, components.length - 1); + return path.join("/") + "/"; + } + + export function switchToForwardSlashes(path: string) { + return path.replace(/\\/g, "/").replace(/\/\//g, '/'); + } +} + +module Harness { + export interface IO { + readFile(path: string): string; + writeFile(path: string, contents: string): void; + directoryName(path: string): string; + createDirectory(path: string): void; + fileExists(filename: string): boolean; + directoryExists(path: string): boolean; + deleteFile(filename: string): void; + listFiles(path: string, filter: RegExp, options?: { recursive?: boolean }): string[]; + log(text: string): void; + } + + module IOImpl { + declare class Enumerator { + public atEnd(): boolean; + public moveNext(): boolean; + public item(): any; + constructor(o: any); + } + + export module CScript { + var fso: any; + if (global.ActiveXObject) { + fso = new global.ActiveXObject("Scripting.FileSystemObject"); + } else { + fso = {}; + } + + export var readFile: typeof IO.readFile = sys.readFile; + export var writeFile: typeof IO.writeFile = sys.writeFile; + export var directoryName: typeof IO.directoryName = fso.GetParentFolderName; + export var directoryExists: typeof IO.directoryExists = fso.FolderExists; + export var fileExists: typeof IO.fileExists = fso.FileExists; + export var log: typeof IO.log = global.WScript && global.WScript.StdOut.WriteLine; + + export function createDirectory(path: string) { + if (directoryExists(path)) { + fso.CreateFolder(path); + } + } + + export function deleteFile(path: string) { + if (fileExists(path)) { + fso.DeleteFile(path, true); // true: delete read-only files + } + } + + export var listFiles: typeof IO.listFiles = (path, spec?, options?) => { + options = options || <{ recursive?: boolean; }>{}; + function filesInFolder(folder: any, root: string): string[] { + var paths: string[] = []; + var fc: any; + + if (options.recursive) { + fc = new Enumerator(folder.subfolders); + + for (; !fc.atEnd(); fc.moveNext()) { + paths = paths.concat(filesInFolder(fc.item(), root + "\\" + fc.item().Name)); + } + } + + fc = new Enumerator(folder.files); + + for (; !fc.atEnd(); fc.moveNext()) { + if (!spec || fc.item().Name.match(spec)) { + paths.push(root + "\\" + fc.item().Name); + } + } + + return paths; + } + + var folder: any = fso.GetFolder(path); + var paths: string[] = []; + + return filesInFolder(folder, path); + + } + } + + export module Node { + declare var require: any; + var fs: any, pathModule: any; + if (require) { + fs = require('fs'); + pathModule = require('path'); + } else { + fs = pathModule = {}; + } + + export var readFile: typeof IO.readFile = sys.readFile; + export var writeFile: typeof IO.writeFile = sys.writeFile; + export var fileExists: typeof IO.fileExists = fs.existsSync; + export var log: typeof IO.log = console.log; + + export function createDirectory(path: string) { + if (!directoryExists(path)) { + fs.mkdirSync(path); + } + } + + export function deleteFile(path: string) { + try { + fs.unlinkSync(path); + } catch (e) { + } + } + + export function directoryExists(path: string): boolean { + return fs.existsSync(path) && fs.statSync(path).isDirectory(); + } + + export function directoryName(path: string) { + var dirPath = pathModule.dirname(path); + + // Node will just continue to repeat the root path, rather than return null + if (dirPath === path) { + dirPath = null; + } else { + return dirPath; + } + } + + export var listFiles: typeof IO.listFiles = (path, spec?, options?) => { + options = options || <{ recursive?: boolean; }>{}; + + function filesInFolder(folder: string): string[] { + var paths: string[] = []; + + var files = fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var pathToFile = pathModule.join(folder, files[i]); + var stat = fs.statSync(pathToFile); + if (options.recursive && stat.isDirectory()) { + paths = paths.concat(filesInFolder(pathToFile)); + } + else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(pathToFile); + } + } + + return paths; + } + + return filesInFolder(path); + } + } + + export module Network { + var serverRoot = "http://localhost:8888/"; + + // Unused? + var newLine = '\r\n'; + var currentDirectory = () => ''; + var supportsCodePage = () => false; + + module Http { + function waitForXHR(xhr: XMLHttpRequest) { + while (xhr.readyState !== 4) { } + return { status: xhr.status, responseText: xhr.responseText }; + } + + /// Ask the server to use node's path.resolve to resolve the given path + function getResolvedPathFromServer(path: string) { + var xhr = new XMLHttpRequest(); + try { + xhr.open("GET", path + "?resolve", false); + xhr.send(); + } + catch (e) { + return { status: 404, responseText: null }; + } + + return waitForXHR(xhr); + } + + export interface XHRResponse { + status: number; + responseText: string; + } + + /// Ask the server for the contents of the file at the given URL via a simple GET request + export function getFileFromServerSync(url: string): XHRResponse { + var xhr = new XMLHttpRequest(); + try { + xhr.open("GET", url, false); + xhr.send(); + } + catch (e) { + return { status: 404, responseText: null }; + } + + return waitForXHR(xhr); + } + + /// Submit a POST request to the server to do the given action (ex WRITE, DELETE) on the provided URL + export function writeToServerSync(url: string, action: string, contents?: string): XHRResponse { + var xhr = new XMLHttpRequest(); + try { + var action = '?action=' + action; + xhr.open('POST', url + action, false); + xhr.setRequestHeader('Access-Control-Allow-Origin', '*'); + xhr.send(contents); + } + catch (e) { + return { status: 500, responseText: null }; + } + + return waitForXHR(xhr); + } + } + + export function createDirectory(path: string) { + // Do nothing (?) + } + + export function deleteFile(path: string) { + Http.writeToServerSync(serverRoot + path, 'DELETE', null); + } + + export function directoryExists(path: string): boolean { + return false; + } + + function directoryNameImpl(path: string) { + var dirPath = path; + // root of the server + if (dirPath.match(/localhost:\d+$/) || dirPath.match(/localhost:\d+\/$/)) { + dirPath = null; + // path + filename + } else if (dirPath.indexOf('.') === -1) { + dirPath = dirPath.substring(0, dirPath.lastIndexOf('/')); + // path + } else { + // strip any trailing slash + if (dirPath.match(/.*\/$/)) { + dirPath = dirPath.substring(0, dirPath.length - 2); + } + var dirPath = dirPath.substring(0, dirPath.lastIndexOf('/')); + } + + return dirPath; + } + export var directoryName: typeof IO.directoryName = Utils.memoize(directoryNameImpl); + + export function fileExists(path: string): boolean { + var response = Http.getFileFromServerSync(serverRoot + path); + return response.status === 200; + } + + export function _listFilesImpl(path: string, spec?: RegExp, options?: any) { + var response = Http.getFileFromServerSync(serverRoot + path); + if (response.status === 200) { + var results = response.responseText.split(','); + if (spec) { + return results.filter(file => spec.test(file)); + } else { + return results; + } + } + else { + return ['']; + } + }; + export var listFiles = Utils.memoize(_listFilesImpl); + + export var log = console.log; + + export function readFile(file: string) { + var response = Http.getFileFromServerSync(serverRoot + file); + if (response.status === 200) { + return response.responseText; + } else { + return null; + } + } + + export function writeFile(path: string, contents: string) { + Http.writeToServerSync(serverRoot + path, 'WRITE', contents); + } + } + } + + export var IO: IO; + switch (Utils.getExecutionEnvironment()) { + case Utils.ExecutionEnvironment.CScript: + IO = IOImpl.CScript; + break; + case Utils.ExecutionEnvironment.Node: + IO = IOImpl.Node; + break; + case Utils.ExecutionEnvironment.Browser: + IO = IOImpl.Network; + break; + } +} + + + +module Harness { + var typescriptServiceFileName = "typescriptServices.js"; + // Services files are exported because we need to eval them at global scope in order for them to be available everywhere + export var typescriptServiceFile: string; + + var tcServicesFilename = "services.js"; + + export var libFolder: string; + switch (Utils.getExecutionEnvironment()) { + case Utils.ExecutionEnvironment.CScript: + libFolder = Path.filePath(global['WScript'].ScriptFullName); + tcServicesFilename = "built/local/services.js"; + break; + case Utils.ExecutionEnvironment.Node: + libFolder = (__dirname + '/'); + tcServicesFilename = "built/local/services.js"; + break; + case Utils.ExecutionEnvironment.Browser: + libFolder = "bin/"; + tcServicesFilename = "built/local/services.js"; + break; + default: + throw new Error('Unknown context'); + } + export var tcServicesFile = IO.readFile(tcServicesFilename); + + export interface SourceMapEmitterCallback { + (emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string): void; + } + + // Settings + export var userSpecifiedroot = ""; + + /** Functionality for compiling TypeScript code */ + export module Compiler { + /** Aggregate various writes into a single array of lines. Useful for passing to the + * TypeScript compiler to fill with source code or errors. + */ + export class WriterAggregator implements ITextWriter { + public lines: string[] = []; + public currentLine = undefined; + + public Write(str: string) { + // out of memory usage concerns avoid using + or += if we're going to do any manipulation of this string later + this.currentLine = [(this.currentLine || ''), str].join(''); + } + + public WriteLine(str: string) { + // out of memory usage concerns avoid using + or += if we're going to do any manipulation of this string later + this.lines.push([(this.currentLine || ''), str].join('')); + this.currentLine = undefined; + } + + public Close() { + if (this.currentLine !== undefined) { this.lines.push(this.currentLine); } + this.currentLine = undefined; + } + + public reset() { + this.lines = []; + this.currentLine = undefined; + } + } + + export interface IEmitterIOHost { + writeFile(path: string, contents: string, writeByteOrderMark: boolean): void; + resolvePath(path: string): string; + } + + /** Mimics having multiple files, later concatenated to a single file. */ + export class EmitterIOHost implements IEmitterIOHost { + private fileCollection: any = {}; + + /** create file gets the whole path to create, so this works as expected with the --out parameter */ + public writeFile(s: string, contents: string, writeByteOrderMark: boolean): void { + var writer: ITextWriter; + if (this.fileCollection[s]) { + writer = this.fileCollection[s]; + } + else { + writer = new Harness.Compiler.WriterAggregator(); + this.fileCollection[s] = writer; + } + + writer.Write(contents); + writer.Close(); + } + + public resolvePath(s: string) { return s; } + + public reset() { this.fileCollection = {}; } + + public toArray(): { fileName: string; file: WriterAggregator; }[] { + var result: { fileName: string; file: WriterAggregator; }[] = []; + for (var p in this.fileCollection) { + if (this.fileCollection.hasOwnProperty(p)) { + var current = this.fileCollection[p]; + if (current.lines.length > 0) { + if (p.indexOf('.d.ts') !== -1) { current.lines.unshift(['////[', Path.getFileName(p), ']'].join('')); } + result.push({ fileName: p, file: this.fileCollection[p] }); + } + } + } + return result; + } + } + + export var libText = IO.readFile(libFolder + "lib.d.ts"); + export var libTextMinimal = IO.readFile('bin/lib.core.d.ts'); + + export function createCompilerHost(filemap: { [filename: string]: ts.SourceFile; }, writeFile: (fn: string, contents: string) => void): ts.CompilerHost { + return { + getCurrentDirectory: sys.getCurrentDirectory, + getCancellationToken: (): any => undefined, + getSourceFile: (fn, languageVersion) => { + if (fn in filemap) { + return filemap[fn]; + } else { + var lib = 'lib.d.ts'; + if (fn.substr(fn.length - lib.length) === lib) { + return filemap[fn] = ts.createSourceFile('lib.d.ts', libTextMinimal, languageVersion); + } + // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC + return null; + } + }, + getDefaultLibFilename: () => 'lib.d.ts', + writeFile: writeFile, + getCanonicalFileName: getCanonicalFileName, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + } + } + + export class HarnessCompiler { + private inputFiles: { unitName: string; content: string }[] = []; + private compileOptions: ts.CompilerOptions; + private settings: Harness.TestCaseParser.CompilerSetting[] = []; + + private lastErrors: MinimalDiagnostic[]; + + public reset() { + this.inputFiles = []; + this.settings = []; + this.lastErrors = []; + } + + public emitAllDeclarations() { + // NEWTODO: Do something here? + } + + public reportCompilationErrors() { + return this.lastErrors; + } + + public setCompilerSettingsFromOptions(tcSettings: ts.CompilerOptions) { + this.settings = Object.keys(tcSettings).map(k => ({ flag: k, value: (tcSettings)[k] })); + } + + public setCompilerSettings(tcSettings: Harness.TestCaseParser.CompilerSetting[]) { + this.settings = tcSettings; + } + + public addInputFiles(files: { unitName: string; content: string }[]) { + files.forEach(file => this.addInputFile(file)); + } + + public addInputFile(file: { unitName: string; content: string }) { + this.inputFiles.push(file); + } + + public compile(options?: ts.CompilerOptions) { + this.compileOptions = options || { noResolve: false }; + } + + public emitAll(ioHost?: IEmitterIOHost) { + this.compileFiles(this.inputFiles, [], (result) => { + result.files.forEach(file => { + ioHost.writeFile(file.fileName, file.code, false); + }); + }, () => { }, this.compileOptions); + } + + public compileFiles(inputFiles: { unitName: string; content: string }[], + otherFiles: { unitName: string; content?: string }[], + onComplete: (result: CompilerResult) => void, + settingsCallback?: (settings: ts.CompilerOptions) => void, + options?: ts.CompilerOptions) { + + options = options || { noResolve: false }; + options.target = options.target || ts.ScriptTarget.ES3; + + if (settingsCallback) { + settingsCallback(null); + } + + this.settings.forEach(setting => { + switch (setting.flag.toLowerCase()) { + // "filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve" + case "module": + case "modulegentarget": + if (typeof setting.value === 'string') { + if (setting.value.toLowerCase() === 'amd') { + options.module = ts.ModuleKind.AMD; + } else if (setting.value.toLowerCase() === 'commonjs') { + options.module = ts.ModuleKind.CommonJS; + } else if (setting.value.toLowerCase() === 'unspecified') { + options.module = ts.ModuleKind.None; + } else { + throw new Error('Unknown module type ' + setting.value); + } + } else { + options.module = setting.value; + } + break; + + case "target": + case 'codegentarget': + if (typeof setting.value === 'string') { + if (setting.value.toLowerCase() === 'es3') { + options.target = ts.ScriptTarget.ES3; + } else if (setting.value.toLowerCase() === 'es5') { + options.target = ts.ScriptTarget.ES5; + } else { + throw new Error('Unknown compile target ' + setting.value); + } + } else { + options.target = setting.value; + } + break; + + case 'noresolve': + options.noResolve = !!setting.value; + break; + + case 'noimplicitany': + options.noImplicitAny = !!setting.value; + break; + + case 'nolib': + options.noLib = !!setting.value; + break; + + case 'out': + case 'outfileoption': + options.out = setting.value; + break; + + case 'outdiroption': + case 'outdir': + options.outDir = setting.value; + break; + + case 'sourceroot': + options.sourceRoot = setting.value; + break; + + case 'sourcemap': + options.sourceMap = !!setting.value; + break; + + case 'declaration': + options.declaration = !!setting.value; + break; + + case 'mapsourcefiles': + case 'maproot': + case 'generatedeclarationfiles': + case 'usecasesensitivefileresolution': + case 'gatherDiagnostics': + case 'codepage': + case 'createFileLog': + case 'comments': + case 'filename': + case 'propagateenumconstants': + case 'removecomments': + case 'watch': + case 'allowautomaticsemicoloninsertion': + case 'locale': + // Not supported yet + break; + + default: + throw new Error('Unsupported compiler setting ' + setting.flag); + } + }); + + var filemap: { [name: string]: ts.SourceFile; } = {}; + var register = (file: { unitName: string; content: string; }) => { + var filename = Path.switchToForwardSlashes(file.unitName); + filemap[filename] = ts.createSourceFile(filename, file.content, options.target || ts.ScriptTarget.ES3); + }; + inputFiles.forEach(register); + otherFiles.forEach(register); + + var fileOutputs: { + fileName: string; + file: string; + }[] = []; + + var programFiles = inputFiles.map(file => file.unitName); + var program = ts.createProgram(programFiles, options, createCompilerHost(filemap, (fn, contents) => fileOutputs.push({ fileName: fn, file: contents }))); + + var hadParseErrors = program.getDiagnostics().length > 0; + + var checker = program.getTypeChecker(); + checker.checkProgram(); + + // only emit if there weren't parse errors + var sourceMapData: ts.SourceMapData[]; + if (!hadParseErrors) { + sourceMapData = checker.emitFiles(); + } + + var errors: MinimalDiagnostic[] = []; + program.getDiagnostics().concat(checker.getDiagnostics()).forEach(err => { + // TODO: new compiler formats errors after this point to add . and newlines so we'll just do it manually for now + errors.push({ filename: err.file && err.file.filename, start: err.start, end: err.start + err.length, line: 0, character: 0, message: err.messageText }); + }); + this.lastErrors = errors; + + var result = new CompilerResult(fileOutputs, errors, []); + // Covert the source Map data into the baseline + result.updateSourceMapRecord(program, sourceMapData); + onComplete(result); + return options; + } + } + + /* TODO: Delete? + export function makeDefaultCompilerSettings(options?: { useMinimalDefaultLib: boolean; noImplicitAny: boolean; }) { + var useMinimalDefaultLib = options ? options.useMinimalDefaultLib : true; + var noImplicitAny = options ? options.noImplicitAny : false; + var settings = new TypeScript.CompilationSettings(); + settings.codeGenTarget = TypeScript.LanguageVersion.EcmaScript5; + settings.moduleGenTarget = TypeScript.ModuleGenTarget.Synchronous; + settings.noLib = useMinimalDefaultLib; + settings.noResolve = false; + settings.noImplicitAny = noImplicitAny; + return settings; + } + */ + + /** Recreate the harness compiler instance to its default settings */ + export function recreate(options?: { useMinimalDefaultLib: boolean; noImplicitAny: boolean; }) { + } + + /** The harness' compiler instance used when tests are actually run. Reseting or changing settings of this compiler instance must be done within a testcase (i.e., describe/it) */ + var harnessCompiler: HarnessCompiler; + + /** Returns the singleton harness compiler instance for generating and running tests. + If required a fresh compiler instance will be created, otherwise the existing singleton will be re-used. + */ + export function getCompiler(opts?: { useExistingInstance: boolean; optionsForFreshInstance?: { useMinimalDefaultLib: boolean; noImplicitAny: boolean; } }) { + return harnessCompiler = harnessCompiler || new HarnessCompiler(); + } + + // This does not need to exist strictly speaking, but many tests will need to be updated if it's removed + export function compileString(code: string, unitName: string, callback: (result: CompilerResult) => void) { + // NEWTODO: Re-implement 'compileString' + throw new Error('compileString NYI'); + //var harnessCompiler = Harness.Compiler.getCompiler(Harness.Compiler.CompilerInstance.RunTime); + //harnessCompiler.compileString(code, unitName, callback); + } + + export interface MinimalDiagnostic { + filename: string; + start: number; + end: number; + line: number; + character: number; + message: string; + } + + export interface GeneratedFile { + fileName: string; + code: string; + } + + export function stringEndsWith(str: string, end: string) { + return str.substr(str.length - end.length) === end; + } + + /** Contains the code and errors of a compilation and some helper methods to check its status. */ + export class CompilerResult { + public files: GeneratedFile[] = []; + public errors: MinimalDiagnostic[] = []; + public declFilesCode: GeneratedFile[] = []; + public sourceMaps: GeneratedFile[] = []; + public sourceMapRecord: string; + + /** @param fileResults an array of strings for the fileName and an ITextWriter with its code */ + constructor(fileResults: { fileName: string; file: string; }[], errors: MinimalDiagnostic[], sourceMapRecordLines: string[]) { + var lines: string[] = []; + + fileResults.forEach(emittedFile => { + var fileObj = { fileName: emittedFile.fileName, code: emittedFile.file }; + if (stringEndsWith(emittedFile.fileName, '.d.ts')) { + // .d.ts file, add to declFiles emit + this.declFilesCode.push(fileObj); + } else if (stringEndsWith(emittedFile.fileName, '.js')) { + // .js file, add to files + this.files.push(fileObj); + } else if (stringEndsWith(emittedFile.fileName, '.js.map')) { + this.sourceMaps.push(fileObj); + } else { + throw new Error('Unrecognized file extension for file ' + emittedFile.fileName); + } + }); + + this.errors = errors; + this.sourceMapRecord = sourceMapRecordLines.join('\r\n'); + } + + public updateSourceMapRecord(program: ts.Program, sourceMapData: ts.SourceMapData[]) { + if (sourceMapData) { + this.sourceMapRecord = Harness.SourceMapRecoder.getSourceMapRecord(sourceMapData, program, this.files); + } + } + + public isErrorAt(line: number, column: number, message: string) { + for (var i = 0; i < this.errors.length; i++) { + if ((this.errors[i].line + 1) === line && (this.errors[i].character + 1) === column && this.errors[i].message === message) + return true; + } + + return false; + } + } + } + + export module TestCaseParser { + /** all the necesarry information to set the right compiler settings */ + export interface CompilerSetting { + flag: string; + value: string; + } + + /** All the necessary information to turn a multi file test into useful units for later compilation */ + export interface TestUnitData { + content: string; + name: string; + fileOptions: any; + originalFilePath: string; + references: string[]; + } + + // Regex for parsing options in the format "@Alpha: Value of any sort" + var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines + + // List of allowed metadata names + var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve"]; + + function extractCompilerSettings(content: string): CompilerSetting[] { + + var opts: CompilerSetting[] = []; + + var match: RegExpExecArray; + while ((match = optionRegex.exec(content)) != null) { + opts.push({ flag: match[1], value: match[2] }); + } + + return opts; + } + + /** Given a test file containing // @Filename directives, return an array of named units of code to be added to an existing compiler instance */ + export function makeUnitsFromTest(code: string, fileName: string): { settings: CompilerSetting[]; testUnitData: TestUnitData[]; } { + var settings = extractCompilerSettings(code); + + // List of all the subfiles we've parsed out + var files: TestUnitData[] = []; + + var lines = Utils.splitContentByNewlines(code); + + // Stuff related to the subfile we're parsing + var currentFileContent: string = null; + var currentFileOptions: any = {}; + var currentFileName: any = null; + var refs: string[] = []; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + var testMetaData = optionRegex.exec(line); + if (testMetaData) { + // Comment line, check for global/file @options and record them + optionRegex.lastIndex = 0; + var fileNameIndex = fileMetadataNames.indexOf(testMetaData[1].toLowerCase()); + if (fileNameIndex === -1) { + throw new Error('Unrecognized metadata name "' + testMetaData[1] + '". Available file metadata names are: ' + fileMetadataNames.join(', ')); + } else if (fileNameIndex === 0) { + currentFileOptions[testMetaData[1]] = testMetaData[2]; + } else { + continue; + } + + // New metadata statement after having collected some code to go with the previous metadata + if (currentFileName) { + // Store result file + var newTestFile = + { + content: currentFileContent, + name: currentFileName, + fileOptions: currentFileOptions, + originalFilePath: fileName, + references: refs + }; + files.push(newTestFile); + + // Reset local data + currentFileContent = null; + currentFileOptions = {}; + currentFileName = testMetaData[2]; + refs = []; + } else { + // First metadata marker in the file + currentFileName = testMetaData[2]; + } + } else { + // Subfile content line + // Append to the current subfile content, inserting a newline needed + if (currentFileContent === null) { + currentFileContent = ''; + } else { + // End-of-line + currentFileContent = currentFileContent + '\n'; + } + currentFileContent = currentFileContent + line; + } + } + + // normalize the fileName for the single file case + currentFileName = files.length > 0 ? currentFileName : Path.getFileName(fileName); + + // EOF, push whatever remains + var newTestFile2 = { + content: currentFileContent || '', + name: currentFileName, + fileOptions: currentFileOptions, + originalFilePath: fileName, + references: refs + }; + files.push(newTestFile2); + + return { settings: settings, testUnitData: files }; + } + } + + /** Support class for baseline files */ + export module Baseline { + var firstRun = true; + + export interface BaselineOptions { + LineEndingSensitive?: boolean; + Subfolder?: string; + } + + export function localPath(fileName: string, subfolder?: string) { + return baselinePath(fileName, 'local', subfolder); + } + + function referencePath(fileName: string, subfolder?: string) { + return baselinePath(fileName, 'reference', subfolder); + } + + function baselinePath(fileName: string, type: string, subfolder?: string) { + if (subfolder !== undefined) { + return Harness.userSpecifiedroot + 'tests/baselines/' + subfolder + '/' + type + '/' + fileName; + } else { + return Harness.userSpecifiedroot + 'tests/baselines/' + type + '/' + fileName; + } + } + + var fileCache: { [idx: string]: boolean } = {} + function generateActual(actualFilename: string, generateContent: () => string): string { + // For now this is written using TypeScript, because sys is not available when running old test cases. + // But we need to move to sys once we have + // Creates the directory including its parent if not already present + function createDirectoryStructure(dirName: string) { + if (fileCache[dirName] || IO.directoryExists(dirName)) { + fileCache[dirName] = true; + return; + } + + var parentDirectory = IO.directoryName(dirName); + if (parentDirectory != "") { + createDirectoryStructure(parentDirectory); + } + IO.createDirectory(dirName); + fileCache[dirName] = true; + } + var parentDir = IO.directoryName(actualFilename); // .../tests/baselines/local + var parentParentDir = IO.directoryName(IO.directoryName(actualFilename)) // .../tests/baselines + // Create folders if needed + createDirectoryStructure(Harness.IO.directoryName(actualFilename)); + + // Delete the actual file in case it fails + if (IO.fileExists(actualFilename)) { + IO.deleteFile(actualFilename); + } + + var actual = generateContent(); + + if (actual === undefined) { + throw new Error('The generated content was "undefined". Return "null" if no baselining is required."'); + } + + // Store the content in the 'local' folder so we + // can accept it later (manually) + if (actual !== null) { + IO.writeFile(actualFilename, actual); + } + + return actual; + } + + function compareToBaseline(actual: string, relativeFilename: string, opts: BaselineOptions) { + // actual is now either undefined (the generator had an error), null (no file requested), + // or some real output of the function + if (actual === undefined) { + // Nothing to do + return; + } + + var refFilename = referencePath(relativeFilename, opts && opts.Subfolder); + + if (actual === null) { + actual = ''; + } + + var expected = ''; + if (IO.fileExists(refFilename)) { + expected = IO.readFile(refFilename); + } + + var lineEndingSensitive = opts && opts.LineEndingSensitive; + + if (!lineEndingSensitive) { + expected = expected.replace(/\r\n?/g, '\n') + actual = actual.replace(/\r\n?/g, '\n') + } + + return { expected: expected, actual: actual }; + } + + function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { + if (expected != actual) { + // Overwrite & issue error + var errMsg = 'The baseline file ' + relativeFilename + ' has changed'; + throw new Error(errMsg); + } + } + + export function runBaseline( + descriptionForDescribe: string, + relativeFilename: string, + generateContent: () => string, + runImmediately = false, + opts?: BaselineOptions): void { + + var actual = undefined; + var actualFilename = localPath(relativeFilename, opts && opts.Subfolder); + + if (runImmediately) { + actual = generateActual(actualFilename, generateContent); + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + } else { + actual = generateActual(actualFilename, generateContent); + + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + } + } + } + + export function isLibraryFile(filePath: string): boolean { + return filePath.indexOf('lib.d.ts') >= 0 || filePath.indexOf('lib.core.d.ts') >= 0; + } + + if (Error) (Error).stackTraceLimit = 100; +} + +// TODO: not sure why Utils.evalFile isn't working with this, eventually will concat it like old compiler instead of eval +eval(Harness.tcServicesFile); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts new file mode 100644 index 0000000000000..c9075949dd6ef --- /dev/null +++ b/src/harness/harnessLanguageService.ts @@ -0,0 +1,385 @@ +module Harness.LanguageService { + export class ScriptInfo { + public version: number = 1; + public editRanges: { length: number; textChangeRange: TypeScript.TextChangeRange; }[] = []; + public lineMap: TypeScript.LineMap = null; + + constructor(public fileName: string, public content: string, public isOpen = true, public byteOrderMark: TypeScript.ByteOrderMark = TypeScript.ByteOrderMark.None) { + this.setContent(content); + } + + private setContent(content: string): void { + this.content = content; + this.lineMap = TypeScript.LineMap1.fromString(content); + } + + public updateContent(content: string): void { + this.editRanges = []; + this.setContent(content); + this.version++; + } + + public editContent(minChar: number, limChar: number, newText: string): void { + // Apply edits + var prefix = this.content.substring(0, minChar); + var middle = newText; + var suffix = this.content.substring(limChar); + this.setContent(prefix + middle + suffix); + + // Store edit range + new length of script + this.editRanges.push({ + length: this.content.length, + textChangeRange: new TypeScript.TextChangeRange( + TypeScript.TextSpan.fromBounds(minChar, limChar), newText.length) + }); + + // Update version # + this.version++; + } + + public getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): TypeScript.TextChangeRange { + if (startVersion === endVersion) { + // No edits! + return TypeScript.TextChangeRange.unchanged; + } + + var initialEditRangeIndex = this.editRanges.length - (this.version - startVersion); + var lastEditRangeIndex = this.editRanges.length - (this.version - endVersion); + + var entries = this.editRanges.slice(initialEditRangeIndex, lastEditRangeIndex); + return TypeScript.TextChangeRange.collapseChangesAcrossMultipleVersions(entries.map(e => e.textChangeRange)); + } + } + + class ScriptSnapshotShim implements TypeScript.Services.IScriptSnapshotShim { + private lineMap: TypeScript.LineMap = null; + private textSnapshot: string; + private version: number; + + constructor(private scriptInfo: ScriptInfo) { + this.textSnapshot = scriptInfo.content; + this.version = scriptInfo.version; + } + + public getText(start: number, end: number): string { + return this.textSnapshot.substring(start, end); + } + + public getLength(): number { + return this.textSnapshot.length; + } + + public getLineStartPositions(): string { + if (this.lineMap === null) { + this.lineMap = TypeScript.LineMap1.fromString(this.textSnapshot); + } + + return JSON.stringify(this.lineMap.lineStarts()); + } + + public getChangeRange(oldScript: TypeScript.Services.IScriptSnapshotShim): string { + var oldShim = oldScript; + var range = this.scriptInfo.getTextChangeRangeBetweenVersions(oldShim.version, this.version); + if (range === null) { + return null; + } + + return JSON.stringify({ span: { start: range.span().start(), length: range.span().length() }, newLength: range.newLength() }); + } + } + + export class TypeScriptLS implements TypeScript.Services.ILanguageServiceShimHost { + IO = TypeScript.Environment ? TypeScript.Environment : Network.getEnvironment(); + private ls: TypeScript.Services.ILanguageServiceShim = null; + public newLS: ts.LanguageService; + + private fileNameToScript = new TypeScript.StringHashTable(); + + constructor(private cancellationToken: TypeScript.ICancellationToken = TypeScript.CancellationToken.None) { + } + + public addDefaultLibrary() { + this.addScript("lib.d.ts", Harness.Compiler.libText); + } + + public getHostIdentifier(): string { + return "TypeScriptLS"; + } + + public addFile(fileName: string) { + var code = Harness.Environment.readFile(fileName); + this.addScript(fileName, code); + } + + private getScriptInfo(fileName: string): ScriptInfo { + return this.fileNameToScript.lookup(fileName); + } + + public addScript(fileName: string, content: string) { + var script = new ScriptInfo(fileName, content); + this.fileNameToScript.add(fileName, script); + } + + public updateScript(fileName: string, content: string) { + var script = this.getScriptInfo(fileName); + if (script !== null) { + script.updateContent(content); + return; + } + + this.addScript(fileName, content); + } + + public editScript(fileName: string, minChar: number, limChar: number, newText: string) { + var script = this.getScriptInfo(fileName); + if (script !== null) { + script.editContent(minChar, limChar, newText); + return; + } + + throw new Error("No script with name '" + fileName + "'"); + } + + ////////////////////////////////////////////////////////////////////// + // ILogger implementation + // + public information(): boolean { return false; } + public debug(): boolean { return true; } + public warning(): boolean { return true; } + public error(): boolean { return true; } + public fatal(): boolean { return true; } + + public log(s: string): void { + // For debugging... + //TypeScript.Environment.standardOut.WriteLine("TypeScriptLS:" + s); + } + + ////////////////////////////////////////////////////////////////////// + // ILanguageServiceShimHost implementation + // + + /// Returns json for Tools.CompilationSettings + public getCompilationSettings(): string { + return ""; // i.e. default settings + } + + public getCancellationToken(): TypeScript.ICancellationToken { + return this.cancellationToken; + } + + public getScriptFileNames(): string { + return JSON.stringify(this.fileNameToScript.getAllKeys()); + } + + public getScriptSnapshot(fileName: string): TypeScript.Services.IScriptSnapshotShim { + return new ScriptSnapshotShim(this.getScriptInfo(fileName)); + } + + public getScriptVersion(fileName: string): string { + return this.getScriptInfo(fileName).version.toString(); + } + + public getScriptIsOpen(fileName: string): boolean { + return this.getScriptInfo(fileName).isOpen; + } + + public getScriptByteOrderMark(fileName: string): TypeScript.ByteOrderMark { + return this.getScriptInfo(fileName).byteOrderMark; + } + + public getDiagnosticsObject(): TypeScript.Services.ILanguageServicesDiagnostics { + return new LanguageServicesDiagnostics(""); + } + + public getLocalizedDiagnosticMessages(): string { + return ""; + } + + public fileExists(s: string) { + return this.IO.fileExists(s); + } + + public directoryExists(s: string) { + return this.IO.directoryExists(s); + } + + public resolveRelativePath(path: string, directory: string): string { + if (TypeScript.isRooted(path) || !directory) { + return this.IO.absolutePath(path); + } + else { + return this.IO.absolutePath(TypeScript.IOUtils.combine(directory, path)); + } + } + + public getParentDirectory(path: string): string { + return this.IO.directoryName(path); + } + + /** Return a new instance of the language service shim, up-to-date wrt to typecheck. + * To access the non-shim (i.e. actual) language service, use the "ls.languageService" property. + */ + public getLanguageService(): TypeScript.Services.ILanguageServiceShim { + var ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this); + this.ls = ls; + var hostAdapter = new ts.LanguageServiceShimHostAdapter(this); + this.newLS = ts.createLanguageService(hostAdapter); + return ls; + } + + /** Parse file given its source text */ + public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { + var compilationSettings = new TypeScript.CompilationSettings(); + compilationSettings.codeGenTarget = TypeScript.LanguageVersion.EcmaScript5; + + var settings = TypeScript.ImmutableCompilationSettings.fromCompilationSettings(compilationSettings); + var parseOptions = settings.codeGenTarget(); + return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), parseOptions, TypeScript.isDTSFile(fileName)).sourceUnit(); + } + + /** Parse a file on disk given its fileName */ + public parseFile(fileName: string) { + var sourceText = TypeScript.ScriptSnapshot.fromString(this.IO.readFile(fileName, /*codepage:*/ null).contents) + return this.parseSourceText(fileName, sourceText); + } + + /** + * @param line 1 based index + * @param col 1 based index + */ + public lineColToPosition(fileName: string, line: number, col: number): number { + var script: ScriptInfo = this.fileNameToScript.lookup(fileName); + assert.isNotNull(script); + assert.isTrue(line >= 1); + assert.isTrue(col >= 1); + + return script.lineMap.getPosition(line - 1, col - 1); + } + + /** + * @param line 0 based index + * @param col 0 based index + */ + public positionToZeroBasedLineCol(fileName: string, position: number): TypeScript.ILineAndCharacter { + var script: ScriptInfo = this.fileNameToScript.lookup(fileName); + assert.isNotNull(script); + + var result = script.lineMap.getLineAndCharacterFromPosition(position); + + assert.isTrue(result.line() >= 0); + assert.isTrue(result.character() >= 0); + return { line: result.line(), character: result.character() }; + } + + /** Verify that applying edits to sourceFileName result in the content of the file baselineFileName */ + public checkEdits(sourceFileName: string, baselineFileName: string, edits: TypeScript.Services.TextChange[]) { + var script = Utils.readFile(sourceFileName); + var formattedScript = this.applyEdits(script.contents, edits); + var baseline = Utils.readFile(baselineFileName).contents; + + function noDiff(text1: string, text2: string) { + text1 = text1.replace(/^\s+|\s+$/g, "").replace(/\r\n?/g, "\n"); + text2 = text2.replace(/^\s+|\s+$/g, "").replace(/\r\n?/g, "\n"); + + if (text1 !== text2) { + var errorString = ""; + var text1Lines = text1.split(/\n/); + var text2Lines = text2.split(/\n/); + for (var i = 0; i < text1Lines.length; i++) { + if (text1Lines[i] !== text2Lines[i]) { + errorString += "Difference at line " + (i + 1) + ":\n"; + errorString += " Left File: " + text1Lines[i] + "\n"; + errorString += " Right File: " + text2Lines[i] + "\n\n"; + } + } + throw (new Error(errorString)); + } + } + assert.isTrue(noDiff(formattedScript, baseline)); + assert.equal(formattedScript, baseline); + } + + + /** Apply an array of text edits to a string, and return the resulting string. */ + public applyEdits(content: string, edits: TypeScript.Services.TextChange[]): string { + var result = content; + edits = this.normalizeEdits(edits); + + for (var i = edits.length - 1; i >= 0; i--) { + var edit = edits[i]; + var prefix = result.substring(0, edit.span.start()); + var middle = edit.newText; + var suffix = result.substring(edit.span.end()); + result = prefix + middle + suffix; + } + return result; + } + + /** Normalize an array of edits by removing overlapping entries and sorting entries on the minChar position. */ + private normalizeEdits(edits: TypeScript.Services.TextChange[]): TypeScript.Services.TextChange[] { + var result: TypeScript.Services.TextChange[] = []; + + function mapEdits(edits: TypeScript.Services.TextChange[]): { edit: TypeScript.Services.TextChange; index: number; }[] { + var result: { edit: TypeScript.Services.TextChange; index: number; }[] = []; + for (var i = 0; i < edits.length; i++) { + result.push({ edit: edits[i], index: i }); + } + return result; + } + + var temp = mapEdits(edits).sort(function (a, b) { + var result = a.edit.span.start() - b.edit.span.start(); + if (result === 0) + result = a.index - b.index; + return result; + }); + + var current = 0; + var next = 1; + while (current < temp.length) { + var currentEdit = temp[current].edit; + + // Last edit + if (next >= temp.length) { + result.push(currentEdit); + current++; + continue; + } + var nextEdit = temp[next].edit; + + var gap = nextEdit.span.start() - currentEdit.span.end(); + + // non-overlapping edits + if (gap >= 0) { + result.push(currentEdit); + current = next; + next++; + continue; + } + + // overlapping edits: for now, we only support ignoring an next edit + // entirely contained in the current edit. + if (currentEdit.span.end() >= nextEdit.span.end()) { + next++; + continue; + } + else { + throw new Error("Trying to apply overlapping edits"); + } + } + + return result; + } + } + + export class LanguageServicesDiagnostics implements TypeScript.Services.ILanguageServicesDiagnostics { + + constructor(private destination: string) { } + + public log(content: string): void { + //Imitates the LanguageServicesDiagnostics object when not in Visual Studio + } + + } +} + \ No newline at end of file diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts new file mode 100644 index 0000000000000..5dfd10dfa02ca --- /dev/null +++ b/src/harness/loggedIO.ts @@ -0,0 +1,279 @@ +/// + +interface FileInformation { + contents: string; + codepage: number; +} + +interface FindFileResult { + +} + +interface IOLog { + arguments: string[]; + executingPath: string; + currentDirectory: string; + filesRead: { + path: string; + codepage: number; + result?: FileInformation; + }[]; + filesWritten: { + path: string; + contents: string; + bom: boolean; + }[]; + filesDeleted: string[]; + filesAppended: { + path: string; + contents: string; + }[]; + fileExists: { + path: string; + result?: boolean; + }[]; + filesFound: { + path: string; + pattern: string; + result?: FindFileResult; + }[]; + dirs: { + path: string; + re: string; + re_m: boolean; + re_g: boolean; + re_i: boolean; + opts: { recursive?: boolean; }; + result?: string[]; + }[]; + dirExists: { + path: string; + result?: boolean; + }[]; + dirsCreated: string[]; + pathsResolved: { + path: string; + result?: string; + }[]; +} + +interface PlaybackControl { + startReplayFromFile(logFilename: string): void; + startReplayFromString(logContents: string): void; + startReplayFromData(log: IOLog): void; + endReplay(): void; + startRecord(logFilename: string): void; + endRecord(): void; +} + +module Playback { + var recordLog: IOLog = undefined; + var replayLog: IOLog = undefined; + var recordLogFilenameBase = ''; + + interface Memoized { + (s: string): T; + reset(): void; + } + + function memoize(func: (s: string) => T): Memoized { + var lookup: { [s: string]: T } = {}; + var run: Memoized = >((s: string) => { + if (lookup.hasOwnProperty(s)) return lookup[s]; + return lookup[s] = func(s); + }); + run.reset = () => { + lookup = null; + }; + + return run; + } + + export interface PlaybackSystem extends System, PlaybackControl { } + + function createEmptyLog(): IOLog { + return { + arguments: [], + currentDirectory: '', + filesRead: [], + filesWritten: [], + filesDeleted: [], + filesAppended: [], + fileExists: [], + filesFound: [], + dirs: [], + dirExists: [], + dirsCreated: [], + pathsResolved: [], + executingPath: '' + }; + } + + function initWrapper(wrapper: PlaybackControl, underlying: T) { + Object.keys(underlying).forEach(prop => { + (wrapper)[prop] = (underlying)[prop]; + }); + + wrapper.startReplayFromString = logString => { + wrapper.startReplayFromData(JSON.parse(logString)); + }; + wrapper.startReplayFromData = log => { + replayLog = log; + }; + + wrapper.endReplay = () => { + replayLog = undefined; + }; + + wrapper.startRecord = (filenameBase) => { + recordLogFilenameBase = filenameBase; + recordLog = createEmptyLog(); + }; + } + + function recordReplay(original: T, underlying: any) { + function createWrapper(record: T, replay: T): T { + return (() => { + if (replayLog !== undefined) { + return replay.apply(undefined, arguments); + } else if (recordLog !== undefined) { + return record.apply(undefined, arguments); + } else { + return original.apply(underlying, arguments); + } + }); + } + return createWrapper; + } + + function callAndRecord(underlyingResult: T, logArray: U[], logEntry: U): T { + if (underlyingResult !== undefined) { + (logEntry).result = underlyingResult; + } + logArray.push(logEntry); + return underlyingResult; + } + + function findResultByFields(logArray: { result?: T }[], expectedFields: {}, defaultValue?: T): T { + var predicate = (entry: { result?: T }) => { + return Object.getOwnPropertyNames(expectedFields).every((name) => (entry)[name] === (expectedFields)[name]); + }; + var results = logArray.filter(entry => predicate(entry)); + if (results.length === 0) { + if (defaultValue !== undefined) { + return defaultValue; + } else { + throw new Error('No matching result in log array for: ' + JSON.stringify(expectedFields)); + } + } + return results[0].result; + } + + function findResultByPath(wrapper: { resolvePath(s: string): string }, logArray: { path: string; result?: T }[], expectedPath: string, defaultValue?: T): T { + var results = logArray.filter(e => pathsAreEquivalent(e.path, expectedPath, wrapper)); + if (results.length === 0) { + if (defaultValue === undefined) { + console.log('Resolved path: ' + wrapper.resolvePath(expectedPath)); + console.log('Filenames were: ' + logArray.map(x => x.path).join(', ')); + throw new Error('No matching result in log array for path: ' + expectedPath); + } else { + return defaultValue; + } + } + return results[0].result; + } + + function pathsAreEquivalent(left: string, right: string, wrapper: { resolvePath(s: string): string }) { + function areSame(a: string, b: string) { + return Harness.Path.switchToForwardSlashes(a).toLowerCase() === Harness.Path.switchToForwardSlashes(b).toLowerCase(); + } + return areSame(left, right) || areSame(wrapper.resolvePath(left), right) || areSame(left, wrapper.resolvePath(right)) || areSame(wrapper.resolvePath(left), wrapper.resolvePath(right)); + } + + function noOpReplay(name: string) { + console.log("Swallowed write operation during replay: " + name); + } + + export function wrapSystem(underlying: System): PlaybackSystem { + var wrapper: PlaybackSystem = {}; + initWrapper(wrapper, underlying); + + wrapper.startReplayFromFile = logFn => { + wrapper.startReplayFromString(underlying.readFile(logFn)); + }; + wrapper.endRecord = () => { + if (recordLog !== undefined) { + var i = 0; + var fn = () => recordLogFilenameBase + i + '.json'; + while (underlying.fileExists(fn())) i++; + underlying.writeFile(fn(), JSON.stringify(recordLog)); + recordLog = undefined; + } + }; + + Object.defineProperty(wrapper, 'args', { + get() { + if (replayLog !== undefined) { + return replayLog.arguments; + } else if (recordLog !== undefined) { + recordLog.arguments = underlying.args; + } + return underlying.args; + } + }); + + + wrapper.fileExists = recordReplay(wrapper.fileExists, underlying)( + (path) => callAndRecord(underlying.fileExists(path), recordLog.fileExists, { path: path }), + memoize((path) => { + // If we read from the file, it must exist + if (findResultByPath(wrapper, replayLog.filesRead, path, null) !== null) { + return true; + } else { + return findResultByFields(replayLog.fileExists, { path: path }, false); + } + }) + ); + + wrapper.getExecutingFilePath = () => { + if (replayLog !== undefined) { + return replayLog.executingPath; + } else if (recordLog !== undefined) { + return recordLog.executingPath = underlying.getExecutingFilePath(); + } else { + return underlying.getExecutingFilePath(); + } + }; + + wrapper.getCurrentDirectory = () => { + if (replayLog !== undefined) { + return replayLog.currentDirectory || ''; + } else if (recordLog !== undefined) { + return recordLog.currentDirectory = underlying.getCurrentDirectory(); + } else { + return underlying.getCurrentDirectory(); + } + }; + + wrapper.resolvePath = recordReplay(wrapper.resolvePath, underlying)( + (path) => callAndRecord(underlying.resolvePath(path), recordLog.pathsResolved, { path: path }), + memoize((path) => findResultByFields(replayLog.pathsResolved, { path: path }, replayLog.currentDirectory ? replayLog.currentDirectory + '/' + path : path))); + + wrapper.readFile = recordReplay(wrapper.readFile, underlying)( + (path) => callAndRecord(underlying.readFile(path), recordLog.filesRead, { path: path, codepage: 0 }), + memoize((path) => findResultByPath(wrapper, replayLog.filesRead, path).contents)); + + wrapper.writeFile = recordReplay(wrapper.writeFile, underlying)( + (path, contents) => callAndRecord(underlying.writeFile(path, contents), recordLog.filesWritten, { path: path, contents: contents, bom: false }), + (path, contents) => noOpReplay('writeFile')); + + wrapper.exit = (exitCode) => { + if (recordLog !== undefined) { + wrapper.endRecord(); + } + underlying.exit(exitCode); + }; + + return wrapper; + } +} \ No newline at end of file diff --git a/src/harness/project.ts b/src/harness/project.ts new file mode 100644 index 0000000000000..d94cbd576d560 --- /dev/null +++ b/src/harness/project.ts @@ -0,0 +1,19 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// +/// +/// +/// diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts new file mode 100644 index 0000000000000..eddff4a9bd6c8 --- /dev/null +++ b/src/harness/projectsRunner.ts @@ -0,0 +1,381 @@ +/// +/// + +// Test case is json of below type in tests/cases/project/ +interface ProjectRunnerTestCase { + scenario: string; + projectRoot: string; // project where it lives - this also is the current dictory when compiling + inputFiles: string[]; // list of input files to be given to program + out?: string; // --out + outDir?: string; // --outDir + sourceMap?: boolean; // --map + mapRoot?: string; // --mapRoot + resolveMapRoot?: boolean; // should we resolve this map root and give compiler the absolute disk path as map root? + sourceRoot?: string; // --sourceRoot + resolveSourceRoot?: boolean; // should we resolve this source root and give compiler the absolute disk path as map root? + declaration?: boolean; // --d + baselineCheck?: boolean; // Verify the baselines of output files, if this is false, we will write to output to the disk but there is no verification of baselines + runTest?: boolean; // Run the resulting test + bug?: string; // If there is any bug associated with this test case +} + +interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { + // Apart from actual test case the results of the resolution + resolvedInputFiles: string[]; // List of files that were asked to read by compiler + emittedFiles: string[]; // List of files that wre emitted by the compiler +} + +interface BatchCompileProjectTestCaseEmittedFile { + emittedFileName: string; + code: string; + fileName: string; +} + +interface BatchCompileProjectTestCaseResult { + moduleKind: ts.ModuleKind; + program: ts.Program; + readInputFiles: ts.SourceFile[]; + sourceMapData: ts.SourceMapData[]; + outputFiles: BatchCompileProjectTestCaseEmittedFile[]; + errors: ts.Diagnostic[]; + nonSubfolderDiskFiles: number; +} + +class ProjectRunner extends RunnerBase { + public initializeTests() { + if (this.tests.length === 0) { + var testFiles = this.enumerateFiles("tests/cases/project", /\.json$/, { recursive: true }); + testFiles.forEach(fn => { + fn = fn.replace(/\\/g, "/"); + this.runProjectTestCase(fn); + }); + } + else { + this.tests.forEach(test => this.runProjectTestCase(test)); + } + } + + private runProjectTestCase(testCaseFileName: string) { + var testCase: ProjectRunnerTestCase; + + try { + var testFileText = sys.readFile(testCaseFileName); + } + catch (e) { + assert(false, "Unable to open testcase file: " + testCaseFileName + ": " + e.message); + } + + try { + testCase = JSON.parse(testFileText); + } + catch (e) { + assert(false, "Testcase: " + testCaseFileName + " doesnt not contain valid json format: " + e.message); + } + var testCaseJustName = testCaseFileName.replace(/^.*[\\\/]/, '').replace(/\.json/, ""); + + function moduleNameToString(moduleKind: ts.ModuleKind) { + return moduleKind === ts.ModuleKind.AMD + ? "amd" + : moduleKind === ts.ModuleKind.CommonJS + ? "node" + : "none"; + } + + // Project baselines verified go in project/testCaseName/moduleKind/ + function getBaselineFolder(moduleKind: ts.ModuleKind) { + return "project/" + testCaseJustName + "/" + moduleNameToString(moduleKind) + "/"; + } + + // When test case output goes to tests/baselines/local/projectOutput/testCaseName/moduleKind/ + // We have these two separate locations because when compairing baselines the baseline verifier will delete the existing file + // so even if it was created by compiler in that location, the file will be deleted by verified before we can read it + // so lets keep these two locations separate + function getProjectOutputFolder(filename: string, moduleKind: ts.ModuleKind) { + return Harness.Baseline.localPath("projectOutput/" + testCaseJustName + "/" + moduleNameToString(moduleKind) + "/" + filename); + } + + function cleanProjectUrl(url: string) { + var diskProjectPath = ts.normalizeSlashes(sys.resolvePath(testCase.projectRoot)); + var projectRootUrl = "file:///" + diskProjectPath; + var normalizedProjectRoot = ts.normalizeSlashes(testCase.projectRoot); + diskProjectPath = diskProjectPath.substr(0, diskProjectPath.lastIndexOf(normalizedProjectRoot)); + projectRootUrl = projectRootUrl.substr(0, projectRootUrl.lastIndexOf(normalizedProjectRoot)); + if (url && url.length) { + if (url.indexOf(projectRootUrl) === 0) { + // replace the disk specific project url path into project root url + url = "file:///" + url.substr(projectRootUrl.length); + } + else if (url.indexOf(diskProjectPath) === 0) { + // Replace the disk specific path into the project root path + url = url.substr(diskProjectPath.length); + if (url.charCodeAt(0) != ts.CharacterCodes.slash) { + url = "/" + url; + } + } + } + + return url; + } + + function batchCompilerProjectTestCase(moduleKind: ts.ModuleKind): BatchCompileProjectTestCaseResult{ + var nonSubfolderDiskFiles = 0; + + var readInputFiles: ts.SourceFile[] = []; + var sourceMapData: ts.SourceMapData[] = null; + var outputFiles: BatchCompileProjectTestCaseEmittedFile[] = []; + + function createCompilerOptions(): ts.CompilerOptions { + return { + declaration: !!testCase.declaration, + sourceMap: !!testCase.sourceMap, + out: testCase.out, + outDir: testCase.outDir, + mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, + sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, + module: moduleKind + }; + } + + function getSourceFile(filename: string, languageVersion: ts.ScriptTarget): ts.SourceFile { + var sourceFile: ts.SourceFile = undefined; + if (filename === 'lib.d.ts') { + sourceFile = ts.createSourceFile('lib.d.ts', Harness.Compiler.libTextMinimal, languageVersion); + } + else { + assert.isTrue(!ts.filter(readInputFiles, sourceFile => sourceFile.filename == filename).length, "Compiler trying to read same file again: " + filename); + + try { + var text = sys.readFile(ts.isRootedDiskPath(filename) + ? filename + : ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(filename)); + } + catch (e) { + // text doesn't get defined. + } + + if (text !== undefined) { + sourceFile = ts.createSourceFile(filename, text, languageVersion) + } + } + + if (sourceFile) { + readInputFiles.push(sourceFile); + } + return sourceFile; + } + + function writeFile(filename: string, data: string) { + var diskFileName = ts.isRootedDiskPath(filename) + ? filename + : ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(filename); + + var diskRelativeName = ts.getRelativePathToDirectoryOrUrl(testCase.projectRoot, diskFileName, getCurrentDirectory(), false); + if (ts.isRootedDiskPath(diskRelativeName) || diskRelativeName.substr(0, 3) === "../") { + // If the generated output file recides in the parent folder or is rooted path, + // we need to instead create files that can live in the project reference folder + // but make sure extension of these files matches with the filename the compiler asked to write + diskRelativeName = "diskFile" + nonSubfolderDiskFiles++ + + (Harness.Compiler.stringEndsWith(filename, ".d.ts") ? ".d.ts" : + Harness.Compiler.stringEndsWith(filename, ".js") ? ".js" : ".js.map"); + } + + if (Harness.Compiler.stringEndsWith(filename, ".js")) { + // Make sure if there is URl we have it cleaned up + var indexOfSourceMapUrl = data.lastIndexOf("//# sourceMappingURL="); + if (indexOfSourceMapUrl != -1) { + data = data.substring(0, indexOfSourceMapUrl + 21) + cleanProjectUrl(data.substring(indexOfSourceMapUrl + 21)); + } + } + else if (Harness.Compiler.stringEndsWith(filename, ".js.map")) { + // Make sure sources list is cleaned + var sourceMapData = JSON.parse(data); + for (var i = 0; i < sourceMapData.sources.length; i++) { + sourceMapData.sources[i] = cleanProjectUrl(sourceMapData.sources[i]); + } + sourceMapData.sourceRoot = cleanProjectUrl(sourceMapData.sourceRoot); + data = JSON.stringify(sourceMapData); + } + + var outputFilePath = getProjectOutputFolder(diskRelativeName, moduleKind); + // Actual writing of file as in tc.ts + function ensureDirectoryStructure(directoryname: string) { + if (directoryname) { + if (!sys.directoryExists(directoryname)) { + ensureDirectoryStructure(ts.getDirectoryPath(directoryname)); + sys.createDirectory(directoryname); + } + } + } + ensureDirectoryStructure(ts.getDirectoryPath(ts.normalizePath(outputFilePath))); + sys.writeFile(outputFilePath, data); + + outputFiles.push({ emittedFileName: filename, code: data, fileName: diskRelativeName }); + } + + function getCurrentDirectory() { + return sys.resolvePath(testCase.projectRoot); + } + + function createCompilerHost(): ts.CompilerHost { + return { + getSourceFile: getSourceFile, + getDefaultLibFilename: () => "lib.d.ts", + writeFile: writeFile, + getCurrentDirectory: getCurrentDirectory, + getCanonicalFileName: getCanonicalFileName, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + }; + } + + var program = ts.createProgram(testCase.inputFiles, createCompilerOptions(), createCompilerHost()); + var errors = program.getDiagnostics(); + if (!errors.length) { + var checker = program.getTypeChecker(); + errors = checker.getDiagnostics(); + sourceMapData = checker.emitFiles(); + + // Clean up source map data that will be used in baselining + if (sourceMapData) { + for (var i = 0; i < sourceMapData.length; i++) { + for (var j = 0; j < sourceMapData[i].sourceMapSources.length; j++) { + sourceMapData[i].sourceMapSources[j] = cleanProjectUrl(sourceMapData[i].sourceMapSources[j]); + } + sourceMapData[i].jsSourceMappingURL = cleanProjectUrl(sourceMapData[i].jsSourceMappingURL); + sourceMapData[i].sourceMapSourceRoot = cleanProjectUrl(sourceMapData[i].sourceMapSourceRoot); + } + } + } + + return { + moduleKind: moduleKind, + program: program, + readInputFiles: readInputFiles, + sourceMapData: sourceMapData, + outputFiles: outputFiles, + errors: errors, + nonSubfolderDiskFiles: nonSubfolderDiskFiles, + }; + } + + describe('Compiling project for ' + testCase.scenario +': testcase ' + testCaseFileName, () => { + function verifyCompilerResults(compilerResult: BatchCompileProjectTestCaseResult) { + function getCompilerResolutionInfo() { + var resolutionInfo: ProjectRunnerTestCaseResolutionInfo = { + scenario: testCase.scenario, + projectRoot: testCase.projectRoot, + inputFiles: testCase.inputFiles, + out: testCase.out, + outDir: testCase.outDir, + sourceMap: testCase.sourceMap, + mapRoot: testCase.mapRoot, + resolveMapRoot: testCase.resolveMapRoot, + sourceRoot: testCase.sourceRoot, + resolveSourceRoot: testCase.resolveSourceRoot, + declaration: testCase.declaration, + baselineCheck: testCase.baselineCheck, + runTest: testCase.runTest, + bug: testCase.bug, + resolvedInputFiles: ts.map(compilerResult.readInputFiles, inputFile => inputFile.filename), + emittedFiles: ts.map(compilerResult.outputFiles, outputFile => outputFile.emittedFileName) + }; + + return resolutionInfo; + } + + it('Resolution information of (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + assert.equal(compilerResult.program.getSourceFiles().length, compilerResult.readInputFiles.length, "Compiler missing/has extra source files that were read during compilation"); + Harness.Baseline.runBaseline('Resolution information of (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.json', () => { + return JSON.stringify(getCompilerResolutionInfo(), undefined, " "); + }); + }); + + if (compilerResult.errors.length) { + it('Errors for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + Harness.Baseline.runBaseline('Errors for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.errors.txt', () => { + // This is copied from tc.ts's reportError to replicate what tc does + var errors = ""; + for (var i = 0; i < compilerResult.errors.length; i++) { + var error = compilerResult.errors[i]; + // TODO(jfreeman): Remove assert + ts.Debug.assert(error.messageText.indexOf("{NL}") < 0); + if (error.file) { + var loc = error.file.getLineAndCharacterFromPosition(error.start); + errors += error.file.filename + "(" + loc.line + "," + loc.character + "): " + error.messageText + sys.newLine; + } + else { + errors += error.messageText + sys.newLine; + } + } + + return errors; + }); + }); + } + + if (testCase.baselineCheck) { + ts.forEach(compilerResult.outputFiles, outputFile => { + it('Baseline of emitted result (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + Harness.Baseline.runBaseline('Baseline of emitted result (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + outputFile.fileName, () => { + try { + return sys.readFile(getProjectOutputFolder(outputFile.fileName, compilerResult.moduleKind)); + } + catch (e) { + return undefined; + } + }); + }); + }); + + if (compilerResult.sourceMapData) { + it('SourceMapRecord for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, () => { + Harness.Baseline.runBaseline('SourceMapRecord for (' + moduleNameToString(compilerResult.moduleKind) + '): ' + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + '.sourcemap.txt', () => { + return Harness.SourceMapRecoder.getSourceMapRecord(compilerResult.sourceMapData, compilerResult.program, + ts.filter(compilerResult.outputFiles, outputFile => Harness.Compiler.stringEndsWith(outputFile.emittedFileName, ".js"))); + }); + }); + } + } + } + + // Compile using node + var nodeCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.CommonJS); + verifyCompilerResults(nodeCompilerResult); + + // Compile using amd + var amdCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.AMD); + verifyCompilerResults(amdCompilerResult); + + if (testCase.runTest) { + //TODO(ryanca/danquirk): Either support this or remove this option from the interface as well as test case json files + // Node results + assert.isTrue(!nodeCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path"); + //it("runs without error: (" + moduleNameToString(nodeCompilerResult.moduleKind) + ')', function (done: any) { + // Exec.exec("node.exe", ['"' + baseLineLocalPath(nodeCompilerResult.outputFiles[0].diskRelativeName, nodeCompilerResult.moduleKind) + '"'], function (res) { + // Harness.Assert.equal(res.stdout, ""); + // Harness.Assert.equal(res.stderr, ""); + // done(); + // }) + //}); + + // Amd results + assert.isTrue(!amdCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path"); + //var amdDriverTemplate = "var requirejs = require('../r.js');\n\n" + + // "requirejs.config({\n" + + // " nodeRequire: require\n" + + // "});\n\n" + + // "requirejs(['{0}'],\n" + + // "function ({0}) {\n" + + // "});"; + //var moduleName = baseLineLocalPath(amdCompilerResult.outputFiles[0].diskRelativeName, amdCompilerResult.moduleKind).replace(/\.js$/, ""); + //sys.writeFile(testCase.projectRoot + '/driver.js', amdDriverTemplate.replace(/\{0}/g, moduleName)); + //it("runs without error (" + moduleNameToString(amdCompilerResult.moduleKind) + ')', function (done: any) { + // Exec.exec("node.exe", ['"' + testCase.projectRoot + '/driver.js"'], function (res) { + // Harness.Assert.equal(res.stdout, ""); + // Harness.Assert.equal(res.stderr, ""); + // done(); + // }) + //}); + } + }); + } +} \ No newline at end of file diff --git a/src/harness/runner.ts b/src/harness/runner.ts new file mode 100644 index 0000000000000..ab77778588f8b --- /dev/null +++ b/src/harness/runner.ts @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// +// TODO: re-enable +// /// +/// +/// +/// + +function runTests(runners: RunnerBase[]) { + if (reverse) { + runners = runners.reverse(); + } + for (var i = iterations; i > 0; i--) { + for (var j = 0; j < runners.length; j++) { + runners[j].initializeTests(); + } + } +} + +var runners: RunnerBase[] = []; +global.runners = runners; +var reverse: boolean = false; +var iterations: number = 1; + +// users can define tests to run in mytest.config that will override cmd line args, otherwise use cmd line args (test.config), otherwise no options +var mytestconfig = 'mytest.config'; +var testconfig = 'test.config'; +var testConfigFile = + Harness.IO.fileExists(mytestconfig) ? Harness.IO.readFile(mytestconfig) : + (Harness.IO.fileExists(testconfig) ? Harness.IO.readFile(testconfig) : '') + +if (testConfigFile !== '') { + // TODO: not sure why this is crashing mocha + //var testConfig = JSON.parse(testConfigRaw); + var testConfig = testConfigFile.match(/test:\s\['(.*)'\]/); + var options = testConfig ? [testConfig[1]] : []; + for (var i = 0; i < options.length; i++) { + switch (options[i]) { + case 'compiler': + runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); + runners.push(new CompilerBaselineRunner(CompilerTestType.Regressions)); + runners.push(new ProjectRunner()); + break; + case 'conformance': + runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); + break; + case 'project': + runners.push(new ProjectRunner()); + break; + case 'fourslash': + // TODO: Re-enable Fourslash tests + // runners.push(new FourslashRunner()); + break; + case 'fourslash-generated': + // TODO: Re-enable Fourslash tests + // runners.push(new GeneratedFourslashRunner()); + break; + case 'unittests': + runners.push(new UnitTestRunner(UnittestTestType.Compiler)); + break; + case 'rwc': + runners.push(new RWCRunner()); + break; + case 'ls': + runners.push(new UnitTestRunner(UnittestTestType.LanguageService)); + break; + case 'services': + runners.push(new UnitTestRunner(UnittestTestType.Services)); + break; + case 'reverse': + reverse = true; + break; + } + } +} + +if (runners.length === 0) { + // compiler + runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); + runners.push(new CompilerBaselineRunner(CompilerTestType.Regressions)); + + // TODO: project tests don't work in the browser yet + if (Utils.getExecutionEnvironment() !== Utils.ExecutionEnvironment.Browser) { + runners.push(new ProjectRunner()); + } + + //// language services + // TODO: Re-enable Fourslash runner + // runners.push(new FourslashRunner()); + // runners.push(new GeneratedFourslashRunner()); +} + +runTests(runners); diff --git a/src/harness/runnerbase.ts b/src/harness/runnerbase.ts new file mode 100644 index 0000000000000..d22048db996b6 --- /dev/null +++ b/src/harness/runnerbase.ts @@ -0,0 +1,41 @@ +/// + +class RunnerBase { + constructor() { } + + // contains the tests to run + public tests: string[] = []; + + /** Add a source file to the runner's list of tests that need to be initialized with initializeTests */ + public addTest(fileName: string) { + this.tests.push(fileName); + } + + public enumerateFiles(folder: string, regex?: RegExp, options?: { recursive: boolean }): string[] { + return Harness.IO.listFiles(Harness.userSpecifiedroot + folder, regex, { recursive: (options ? options.recursive : false) }); + } + + /** Setup the runner's tests so that they are ready to be executed by the harness + * The first test should be a describe/it block that sets up the harness's compiler instance appropriately + */ + public initializeTests(): void { + throw new Error('method not implemented'); + } + + /** Replaces instances of full paths with filenames only */ + static removeFullPaths(path: string) { + var fixedPath = path; + + // full paths either start with a drive letter or / for *nix, shouldn't have \ in the path at this point + var fullPath = /(\w+:|\/)?([\w+\-\.]|\/)*\.ts/g; + var fullPathList = fixedPath.match(fullPath); + if (fullPathList) { + fullPathList.forEach((match: string) => fixedPath = fixedPath.replace(match, Harness.Path.getFileName(match))); + } + + // when running in the browser the 'full path' is the host name, shows up in error baselines + var localHost = /http:\/localhost:\d+/g; + fixedPath = fixedPath.replace(localHost, ''); + return fixedPath; + } +} \ No newline at end of file diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts new file mode 100644 index 0000000000000..ce7fc34f7f51d --- /dev/null +++ b/src/harness/rwcRunner.ts @@ -0,0 +1,223 @@ +/// +/// +/// +/// +/// + +module RWC { + class RWCEmitter implements Harness.Compiler.IEmitterIOHost { + public outputs: { [filename: string]: string; } = {}; + + constructor() { } + + writeFile(path: string, contents: string, writeByteOrderMark: boolean) { + if (path in this.outputs) throw new Error('Emitter attempted to write to "' + path + '" twice'); + this.outputs[path] = contents; + } + + directoryExists(s: string) { + return false; + } + fileExists(s: string) { + return true; + } + resolvePath(s: string) { + return s; + } + } + + function runWithIOLog(ioLog: IOLog, fn: () => void) { + var oldSys = sys; + + var wrappedSys = Playback.wrapSystem(sys); + wrappedSys.startReplayFromData(ioLog); + sys = wrappedSys; + + try { + fn(); + } finally { + wrappedSys.endReplay(); + sys = oldSys; + } + } + + function collateOutputs(emitterIOHost: RWCEmitter, fnTest: (s: string) => {}, clean?: (s: string) => string) { + // Collect, test, and sort the filenames + var files: string[] = []; + for (var fn in emitterIOHost.outputs) { + if (emitterIOHost.outputs.hasOwnProperty(fn) && fnTest(fn)) { + files.push(fn); + } + } + function cleanName(fn: string) { + var lastSlash = Harness.Path.switchToForwardSlashes(fn).lastIndexOf('/'); + return fn.substr(lastSlash + 1).toLowerCase(); + } + files.sort((a, b) => cleanName(a).localeCompare(cleanName(b))); + + // Emit them + var result = ''; + files.forEach(fn => { + // Some extra spacing if this isn't the first file + if (result.length) result = result + '\r\n\r\n'; + + // Filename header + content + result = result + '/*====== ' + fn + ' ======*/\r\n'; + if (clean) { + result = result + clean(emitterIOHost.outputs[fn]); + } else { + result = result + emitterIOHost.outputs[fn]; + } + }); + return result; + } + + export function runRWCTest(jsonPath: string) { + var harnessCompiler = Harness.Compiler.getCompiler(); + var opts: ts.ParsedCommandLine; + + var ioLog: IOLog = JSON.parse(Harness.IO.readFile(jsonPath)); + var errors = ''; + + it('has parsable options', () => { + runWithIOLog(ioLog, () => { + opts = ts.parseCommandLine(ioLog.arguments); + assert.equal(opts.errors.length, 0); + }); + }); + + var emitterIOHost = new RWCEmitter(); + it('can compile', () => { + runWithIOLog(ioLog, () => { + harnessCompiler.reset(); + var inputList: string[] = opts.filenames; + var noDefaultLib = false; + var libPath = Harness.IO.directoryName(sys.getExecutingFilePath()) + '/lib.d.ts'; + + if (!opts.options.noResolve) { + var filemap: any = {}; + var host: ts.CompilerHost = { + getCurrentDirectory: () => sys.getCurrentDirectory(), + getCancellationToken: (): any => undefined, + getSourceFile: (fileName, languageVersion) => { + var fileContents: string; + try { + fileContents = sys.readFile(fileName); + } + catch (e) { + // Leave fileContents undefined; + } + return ts.createSourceFile(fileName, fileContents, languageVersion); + }, + getDefaultLibFilename: () => libPath, + writeFile: (fn, contents) => emitterIOHost.writeFile(fn, contents, false), + getCanonicalFileName: getCanonicalFileName, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + }; + + var resolvedProgram = ts.createProgram(opts.filenames, opts.options, host); + resolvedProgram.getSourceFiles().forEach(sourceFile => { + noDefaultLib = noDefaultLib || sourceFile.hasNoDefaultLib; + if (inputList.indexOf(sourceFile.filename) === -1) { + inputList.push(sourceFile.filename); + } + }); + } + + if (!opts.options.noLib && !noDefaultLib) { + inputList.push(libPath); + } + + harnessCompiler.reset(); + harnessCompiler.setCompilerSettingsFromOptions(opts.options); + + // Load the files + inputList.forEach((item: string) => { + var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(item)); + try { + var content = sys.readFile(resolvedPath); + } + catch (e) { + // Leave content undefined. + } + harnessCompiler.addInputFile({ unitName: resolvedPath, content: content }); + }); + + harnessCompiler.compile(); + + // Emit the results + harnessCompiler.emitAll(emitterIOHost); + harnessCompiler.emitAllDeclarations(); + + var compilationErrors = harnessCompiler.reportCompilationErrors(); + + // Create an error baseline + compilationErrors.forEach(err => { + errors += err.filename + ' line ' + err.line + ': ' + err.message + '\r\n'; + }); + }); + }); + + // Baselines + var baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: 'rwc' }; + var baseName = /(.*)\/(.*).json/.exec(Harness.Path.switchToForwardSlashes(jsonPath))[2]; + + it('has the expected emitted code', () => { + Harness.Baseline.runBaseline('has the expected emitted code', baseName + '.output.js', () => { + return collateOutputs(emitterIOHost, fn => fn.substr(fn.length - '.js'.length) === '.js', s => SyntacticCleaner.clean(s)); + }, false, baselineOpts); + }); + + it('has the expected declaration file content', () => { + Harness.Baseline.runBaseline('has the expected declaration file content', baseName + '.d.ts', () => { + var result = collateOutputs(emitterIOHost, fn => fn.substr(fn.length - '.d.ts'.length) === '.d.ts'); + return result.length > 0 ? result : null; + }, false, baselineOpts); + }); + + /* + it('has the expected source maps', () => { + Harness.Baseline.runBaseline('has the expected source maps', baseName + '.map', () => { + var result = collateOutputs(emitterIOHost, fn => fn.substr(fn.length - '.map'.length) === '.map'); + return result.length > 0 ? result : null; + }, false, baselineOpts); + }); + */ + + it('has the expected errors', () => { + Harness.Baseline.runBaseline('has the expected errors', baseName + '.errors.txt', () => { + return errors.length > 0 ? errors : null; + }, false, baselineOpts); + }); + + // TODO: Type baselines (need to refactor out from compilerRunner) + } +} + +class RWCRunner extends RunnerBase { + private runnerPath = "tests/runners/rwc"; + private sourcePath = "tests/cases/rwc/"; + + private harnessCompiler: Harness.Compiler.HarnessCompiler; + + /** Setup the runner's tests so that they are ready to be executed by the harness + * The first test should be a describe/it block that sets up the harness's compiler instance appropriately + */ + public initializeTests(): void { + // Recreate the compiler with the default lib + Harness.Compiler.recreate({ useMinimalDefaultLib: false, noImplicitAny: false }); + this.harnessCompiler = Harness.Compiler.getCompiler(); + + // Read in and evaluate the test list + var testList = Harness.IO.listFiles(this.sourcePath, /.+\.json$/); + for (var i = 0; i < testList.length; i++) { + this.runTest(testList[i]); + } + } + + private runTest(jsonFilename: string) { + describe("Testing a RWC project: " + jsonFilename, () => { + RWC.runRWCTest(jsonFilename); + }); + } +} \ No newline at end of file diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts new file mode 100644 index 0000000000000..f7a6bdbf3e52a --- /dev/null +++ b/src/harness/sourceMapRecorder.ts @@ -0,0 +1,460 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// + +module Harness.SourceMapRecoder { + + interface SourceMapSpanWithDecodeErrors { + sourceMapSpan: ts.SourceMapSpan; + decodeErrors: string[]; + } + + module SourceMapDecoder { + var sourceMapMappings: string; + var sourceMapNames: string[]; + var decodingIndex: number; + var prevNameIndex: number; + var decodeOfEncodedMapping: ts.SourceMapSpan; + var errorDecodeOfEncodedMapping: string; + + export function initializeSourceMapDecoding(sourceMapData: ts.SourceMapData) { + sourceMapMappings = sourceMapData.sourceMapMappings; + sourceMapNames = sourceMapData.sourceMapNames; + decodingIndex = 0; + prevNameIndex = 0; + decodeOfEncodedMapping = { + emittedLine: 1, + emittedColumn: 1, + sourceLine: 1, + sourceColumn: 1, + sourceIndex: 0, + }; + errorDecodeOfEncodedMapping = undefined; + } + + function isSourceMappingSegmentEnd() { + if (decodingIndex == sourceMapMappings.length) { + return true; + } + + if (sourceMapMappings.charAt(decodingIndex) == ',') { + return true; + } + + if (sourceMapMappings.charAt(decodingIndex) == ';') { + return true; + } + + return false; + } + + export function decodeNextEncodedSourceMapSpan() { + errorDecodeOfEncodedMapping = undefined; + + function createErrorIfCondition(condition: boolean, errormsg: string) { + if (errorDecodeOfEncodedMapping) { + // there was existing error: + return true; + } + + if (condition) { + errorDecodeOfEncodedMapping = errormsg; + } + + return condition; + } + + function base64VLQFormatDecode() { + function base64FormatDecode() { + return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(sourceMapMappings.charAt(decodingIndex)); + } + + var moreDigits = true; + var shiftCount = 0; + var value = 0; + + for (; moreDigits; decodingIndex++) { + if (createErrorIfCondition(decodingIndex >= sourceMapMappings.length, "Error in decoding base64VLQFormatDecode, past the mapping string")) { + return; + } + + // 6 digit number + var currentByte = base64FormatDecode(); + + // If msb is set, we still have more bits to continue + moreDigits = (currentByte & 32) != 0; + + // least significant 5 bits are the next msbs in the final value. + value = value | ((currentByte & 31) << shiftCount); + shiftCount += 5; + } + + // Least significant bit if 1 represents negative and rest of the msb is actual absolute value + if ((value & 1) == 0) { + // + number + value = value >> 1; + } + else { + // - number + value = value >> 1; + value = -value; + } + + return value; + } + + while (decodingIndex < sourceMapMappings.length) { + if (sourceMapMappings.charAt(decodingIndex) == ';') { + // New line + decodeOfEncodedMapping.emittedLine++; + decodeOfEncodedMapping.emittedColumn = 1; + decodingIndex++; + continue; + } + + if (sourceMapMappings.charAt(decodingIndex) == ',') { + // Next entry is on same line - no action needed + decodingIndex++; + continue; + } + + // Read the current span + // 1. Column offset from prev read jsColumn + decodeOfEncodedMapping.emittedColumn += base64VLQFormatDecode(); + // Incorrect emittedColumn dont support this map + if (createErrorIfCondition(decodeOfEncodedMapping.emittedColumn < 1, "Invalid emittedColumn found")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + // Dont support reading mappings that dont have information about original source and its line numbers + if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after emitted column")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + + // 2. Relative sourceIndex + decodeOfEncodedMapping.sourceIndex += base64VLQFormatDecode(); + // Incorrect sourceIndex dont support this map + if (createErrorIfCondition(decodeOfEncodedMapping.sourceIndex < 0, "Invalid sourceIndex found")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + // Dont support reading mappings that dont have information about original source span + if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after sourceIndex")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + + // 3. Relative sourceLine 0 based + decodeOfEncodedMapping.sourceLine += base64VLQFormatDecode(); + // Incorrect sourceLine dont support this map + if (createErrorIfCondition(decodeOfEncodedMapping.sourceLine < 1, "Invalid sourceLine found")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + // Dont support reading mappings that dont have information about original source and its line numbers + if (createErrorIfCondition(isSourceMappingSegmentEnd(), "Unsupported Error Format: No entries after emitted Line")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + + // 4. Relative sourceColumn 0 based + decodeOfEncodedMapping.sourceColumn += base64VLQFormatDecode(); + // Incorrect sourceColumn dont support this map + if (createErrorIfCondition(decodeOfEncodedMapping.sourceColumn < 1, "Invalid sourceLine found")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + // 5. Check if there is name: + decodeOfEncodedMapping.nameIndex = -1; + if (!isSourceMappingSegmentEnd()) { + prevNameIndex += base64VLQFormatDecode(); + decodeOfEncodedMapping.nameIndex = prevNameIndex; + // Incorrect nameIndex dont support this map + if (createErrorIfCondition(decodeOfEncodedMapping.nameIndex < 0 || decodeOfEncodedMapping.nameIndex >= sourceMapNames.length, "Invalid name index for the source map entry")) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + } + // Dont support reading mappings that dont have information about original source and its line numbers + if (createErrorIfCondition(!isSourceMappingSegmentEnd(), "Unsupported Error Format: There are more entries after " + (decodeOfEncodedMapping.nameIndex == -1 ? "sourceColumn" : "nameIndex"))) { + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + + // Populated the entry + return { error: errorDecodeOfEncodedMapping, sourceMapSpan: decodeOfEncodedMapping }; + } + + createErrorIfCondition(true, "No encoded entry found"); + } + + export function hasCompletedDecoding() { + return decodingIndex === sourceMapMappings.length; + } + + export function getRemainingDecodeString() { + return sourceMapMappings.substr(decodingIndex); + } + } + + module SourceMapSpanWriter { + var sourceMapRecoder: Compiler.WriterAggregator; + var sourceMapSources: string[]; + var sourceMapNames: string[]; + + var jsFile: Compiler.GeneratedFile; + var jsLineMap: number[]; + var tsCode: string; + var tsLineMap: number[]; + + var spansOnSingleLine: SourceMapSpanWithDecodeErrors[]; + var prevWrittenSourcePos: number; + var prevWrittenJsLine: number; + var spanMarkerContinues: boolean; + + export function intializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: Compiler.GeneratedFile) { + sourceMapRecoder = sourceMapRecordWriter; + sourceMapSources = sourceMapData.sourceMapSources; + sourceMapNames = sourceMapData.sourceMapNames; + + jsFile = currentJsFile; + jsLineMap = ts.getLineStarts(jsFile.code); + + spansOnSingleLine = []; + prevWrittenSourcePos = 0; + prevWrittenJsLine = 0; + spanMarkerContinues = false; + + SourceMapDecoder.initializeSourceMapDecoding(sourceMapData); + + sourceMapRecoder.WriteLine("==================================================================="); + sourceMapRecoder.WriteLine("JsFile: " + sourceMapData.sourceMapFile); + sourceMapRecoder.WriteLine("mapUrl: " + sourceMapData.jsSourceMappingURL); + sourceMapRecoder.WriteLine("sourceRoot: " + sourceMapData.sourceMapSourceRoot); + sourceMapRecoder.WriteLine("sources: " + sourceMapData.sourceMapSources); + sourceMapRecoder.WriteLine("==================================================================="); + } + + function getSourceMapSpanString(mapEntry: ts.SourceMapSpan, getAbsentNameIndex?: boolean) { + var mapString = "Emitted(" + mapEntry.emittedLine + ", " + mapEntry.emittedColumn + ") Source(" + mapEntry.sourceLine + ", " + mapEntry.sourceColumn + ") + SourceIndex(" + mapEntry.sourceIndex + ")"; + if (mapEntry.nameIndex >= 0 && mapEntry.nameIndex < sourceMapNames.length) { + mapString += " name (" + sourceMapNames[mapEntry.nameIndex] + ")"; + } + else { + if (mapEntry.nameIndex != -1 || getAbsentNameIndex) { + mapString += " nameIndex (" + mapEntry.nameIndex + ")"; + } + } + + return mapString; + } + + export function recordSourceMapSpan(sourceMapSpan: ts.SourceMapSpan) { + // verify the decoded span is same as the new span + var decodeResult = SourceMapDecoder.decodeNextEncodedSourceMapSpan(); + var decodedErrors: string[]; + if (decodeResult.error + || decodeResult.sourceMapSpan.emittedLine != sourceMapSpan.emittedLine + || decodeResult.sourceMapSpan.emittedColumn != sourceMapSpan.emittedColumn + || decodeResult.sourceMapSpan.sourceLine != sourceMapSpan.sourceLine + || decodeResult.sourceMapSpan.sourceColumn != sourceMapSpan.sourceColumn + || decodeResult.sourceMapSpan.sourceIndex != sourceMapSpan.sourceIndex + || decodeResult.sourceMapSpan.nameIndex != sourceMapSpan.nameIndex) { + if (decodeResult.error) { + decodedErrors = ["!!^^ !!^^ There was decoding error in the sourcemap at this location: " + decodeResult.error]; + } + else { + decodedErrors = ["!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:"]; + } + decodedErrors.push("!!^^ !!^^ Decoded span from sourcemap's mappings entry: " + getSourceMapSpanString(decodeResult.sourceMapSpan, /*getAbsentNameIndex*/ true) + " Span encoded by the emitter:" + getSourceMapSpanString(sourceMapSpan, /*getAbsentNameIndex*/ true)); + } + + if (spansOnSingleLine.length && spansOnSingleLine[0].sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine) { + // On different line from the one that we have been recording till now, + writeRecordedSpans(); + spansOnSingleLine = [{ sourceMapSpan: sourceMapSpan, decodeErrors: decodedErrors }]; + } + else { + spansOnSingleLine.push({ sourceMapSpan: sourceMapSpan, decodeErrors: decodedErrors }); + } + } + + export function recordNewSourceFileSpan(sourceMapSpan: ts.SourceMapSpan, newSourceFileCode: string) { + assert.isTrue(spansOnSingleLine.length == 0 || spansOnSingleLine[0].sourceMapSpan.emittedLine !== sourceMapSpan.emittedLine, "new file source map span should be on new line. We currently handle only that scenario"); + recordSourceMapSpan(sourceMapSpan); + + assert.isTrue(spansOnSingleLine.length === 1); + sourceMapRecoder.WriteLine("-------------------------------------------------------------------"); + sourceMapRecoder.WriteLine("emittedFile:" + jsFile.fileName); + sourceMapRecoder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]); + sourceMapRecoder.WriteLine("-------------------------------------------------------------------"); + + tsLineMap = ts.getLineStarts(newSourceFileCode); + tsCode = newSourceFileCode; + prevWrittenSourcePos = 0; + } + + export function close() { + // Write the lines pending on the single line + writeRecordedSpans(); + + if (!SourceMapDecoder.hasCompletedDecoding()) { + sourceMapRecoder.WriteLine("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded"); + sourceMapRecoder.WriteLine("!!!! **** Remaining decoded string: " + SourceMapDecoder.getRemainingDecodeString()); + + } + + // write remaining js lines + writeJsFileLines(jsLineMap.length); + } + + function getTextOfLine(line: number, lineMap: number[], code: string) { + var startPos = lineMap[line]; + var endPos = lineMap[line + 1]; + return code.substring(startPos, endPos); + } + + function writeJsFileLines(endJsLine: number) { + for (; prevWrittenJsLine < endJsLine; prevWrittenJsLine++) { + sourceMapRecoder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.code)); + } + } + + function writeRecordedSpans() { + function getMarkerId(markerIndex: number) { + var markerId = ""; + if (spanMarkerContinues) { + assert.isTrue(markerIndex === 0); + markerId = "1->"; + } + else { + var markerId = "" + (markerIndex + 1); + if (markerId.length < 2) { + markerId = markerId + " "; + } + markerId += ">"; + } + return markerId; + } + + var prevEmittedCol: number; + function iterateSpans(fn: (currentSpan: SourceMapSpanWithDecodeErrors, index: number) => void) { + prevEmittedCol = 1; + for (var i = 0; i < spansOnSingleLine.length; i++) { + fn(spansOnSingleLine[i], i); + prevEmittedCol = spansOnSingleLine[i].sourceMapSpan.emittedColumn; + } + } + + function writeSourceMapIndent(indentLength: number, indentPrefix: string) { + sourceMapRecoder.Write(indentPrefix); + for (var i = 1; i < indentLength; i++) { + sourceMapRecoder.Write(" "); + } + } + + function writeSourceMapMarker(currentSpan: SourceMapSpanWithDecodeErrors, index: number, endColumn = currentSpan.sourceMapSpan.emittedColumn, endContinues?: boolean) { + var markerId = getMarkerId(index); + markerIds.push(markerId); + + writeSourceMapIndent(prevEmittedCol, markerId); + + for (var i = prevEmittedCol; i < endColumn; i++) { + sourceMapRecoder.Write("^"); + } + if (endContinues) { + sourceMapRecoder.Write("->"); + } + sourceMapRecoder.WriteLine(""); + spanMarkerContinues = endContinues; + } + + function writeSourceMapSourceText(currentSpan: SourceMapSpanWithDecodeErrors, index: number) { + var sourcePos = tsLineMap[currentSpan.sourceMapSpan.sourceLine - 1] + (currentSpan.sourceMapSpan.sourceColumn - 1); + var sourceText = ""; + if (prevWrittenSourcePos < sourcePos) { + // Position that goes forward, get text + sourceText = tsCode.substring(prevWrittenSourcePos, sourcePos); + } + + if (currentSpan.decodeErrors) { + // If there are decode errors, write + for (var i = 0; i < currentSpan.decodeErrors.length; i++) { + writeSourceMapIndent(prevEmittedCol, markerIds[index]); + sourceMapRecoder.WriteLine(currentSpan.decodeErrors[i]); + } + } + + var tsCodeLineMap = ts.getLineStarts(sourceText); + for (var i = 0; i < tsCodeLineMap.length; i++) { + writeSourceMapIndent(prevEmittedCol, i == 0 ? markerIds[index] : " >"); + sourceMapRecoder.Write(getTextOfLine(i, tsCodeLineMap, sourceText)); + if (i == tsCodeLineMap.length - 1) { + sourceMapRecoder.WriteLine(""); + } + } + + prevWrittenSourcePos = sourcePos; + } + + function writeSpanDetails(currentSpan: SourceMapSpanWithDecodeErrors, index: number) { + sourceMapRecoder.WriteLine(markerIds[index] + getSourceMapSpanString(currentSpan.sourceMapSpan)); + } + + if (spansOnSingleLine.length) { + var currentJsLine = spansOnSingleLine[0].sourceMapSpan.emittedLine; + + // Write js line + writeJsFileLines(currentJsLine); + + // Emit markers + var markerIds: string[] = []; + iterateSpans(writeSourceMapMarker); + + var jsFileText = getTextOfLine(currentJsLine, jsLineMap, jsFile.code); + if (prevEmittedCol < jsFileText.length) { + // There is remaining text on this line that will be part of next source span so write marker that continues + writeSourceMapMarker(undefined, spansOnSingleLine.length, /*endColumn*/ jsFileText.length, /*endContinues*/ true); + } + + // Emit Source text + iterateSpans(writeSourceMapSourceText); + + // Emit column number etc + iterateSpans(writeSpanDetails); + + sourceMapRecoder.WriteLine("---"); + } + } + } + + export function getSourceMapRecord(sourceMapDataList: ts.SourceMapData[], program: ts.Program, jsFiles: Compiler.GeneratedFile[]) { + var sourceMapRecoder = new Compiler.WriterAggregator(); + + for (var i = 0; i < sourceMapDataList.length; i++) { + var sourceMapData = sourceMapDataList[i]; + var prevSourceFile: ts.SourceFile = null; + + SourceMapSpanWriter.intializeSourceMapSpanWriter(sourceMapRecoder, sourceMapData, jsFiles[i]); + for (var j = 0; j < sourceMapData.sourceMapDecodedMappings.length; j++) { + var decodedSourceMapping = sourceMapData.sourceMapDecodedMappings[j]; + var currentSourceFile = program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex]); + if (currentSourceFile != prevSourceFile) { + SourceMapSpanWriter.recordNewSourceFileSpan(decodedSourceMapping, currentSourceFile.text); + prevSourceFile = currentSourceFile; + } + else { + SourceMapSpanWriter.recordSourceMapSpan(decodedSourceMapping); + } + } + SourceMapSpanWriter.close();// If the last spans werent emitted, emit them + } + sourceMapRecoder.Close(); + return sourceMapRecoder.lines.join('\r\n'); + } +} diff --git a/src/harness/syntacticCleaner.ts b/src/harness/syntacticCleaner.ts new file mode 100644 index 0000000000000..05b4295124626 --- /dev/null +++ b/src/harness/syntacticCleaner.ts @@ -0,0 +1,30 @@ +// Use this to get emitter-agnostic baselines + +class SyntacticCleaner { + static clean(sourceFileContents: string) { + return sourceFileContents; + } +} + +/* TODO: Re-implement or maybe delete +class SyntacticCleaner extends TypeScript.SyntaxWalker { + private emit: string[] = []; + + public visitToken(token: TypeScript.ISyntaxToken): void { + this.emit.push(token.text()); + if (token.kind() === TypeScript.SyntaxKind.SemicolonToken) { + this.emit.push('\r\n'); + } else { + this.emit.push(' '); + + } + } + + static clean(sourceFileContents: string): string { + var parsed = TypeScript.Parser.parse('_emitted.ts', TypeScript.SimpleText.fromString(sourceFileContents), TypeScript.LanguageVersion.EcmaScript5, false); + var cleaner = new SyntacticCleaner(); + cleaner.visitSourceUnit(parsed.sourceUnit()); + return cleaner.emit.join(''); + } +} +*/ diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts new file mode 100644 index 0000000000000..b8501850ac71e --- /dev/null +++ b/src/harness/typeWriter.ts @@ -0,0 +1,180 @@ + +/** TODO: Rewrite entirely **/ +class TypeWriterWalker { + constructor(public filename: string, public compiler: any) { + } + public run() { } + public results: any[]; +} + +/* +class TypeWriterWalker extends TypeScript.SyntaxWalker { + private document: TypeScript.Document; + private syntaxTree: TypeScript.SyntaxTree; + private text: TypeScript.ISimpleText; + private currentPosition = 0; + + public results: { + line: number; + column: number; + syntaxKind: string; + identifierName: string; + type: string; + }[] = []; + + constructor(public filename: string, public compiler: TypeScript.TypeScriptCompiler) { + super(); + + this.document = compiler.getDocument(filename); + this.syntaxTree = this.document.syntaxTree(); + this.text = this.syntaxTree.text; + } + + public run() { + TypeScript.visitNodeOrToken(this, this.syntaxTree.sourceUnit()); + } + + private isName(token: TypeScript.ISyntaxToken) { + var parent = token.parent; + + switch (parent.kind()) { + case TypeScript.SyntaxKind.ContinueStatement: + return (parent).identifier === token; + case TypeScript.SyntaxKind.BreakStatement: + return (parent).identifier === token; + case TypeScript.SyntaxKind.LabeledStatement: + return (parent).identifier === token; + } + return false; + } + + public visitToken(token: TypeScript.ISyntaxToken) { + if (token.kind() === TypeScript.SyntaxKind.IdentifierName) { + if (!this.isName(token)) { + this.log(token); + } + } else if (token.kind() === TypeScript.SyntaxKind.ThisKeyword) { + this.log(token); + } + return super.visitToken(token); + } + + public visitNode(node: TypeScript.ISyntaxNode) { + return super.visitNode(node); + } + + private getAstForElement(element: TypeScript.ISyntaxElement) { + if (!TypeScript.isShared(element)) { + return element; + } + } + + private getEnclosingScopeSymbol(ast: TypeScript.ISyntaxElement): TypeScript.PullSymbol { + var enclosingScopeAST = TypeScript.DeclarationEmitter.getEnclosingContainer(ast); + if (enclosingScopeAST) { + var typeInfo = this.compiler.pullGetSymbolInformationFromAST(enclosingScopeAST, this.document); + return typeInfo ? typeInfo.symbol : null; + } + + return null; + } + + private getTypeOfElement(element: TypeScript.ISyntaxElement) { + var ast = this.getAstForElement(element); + if (ast) { + var typeInfo = this.compiler.pullGetSymbolInformationFromAST(ast, this.document); + if (typeInfo.symbol && typeInfo.symbol.type) { + var enclosingScope = this.getEnclosingScopeSymbol(ast); + return typeInfo.symbol.type.toString(enclosingScope); + } + } + + return ""; + } + + public visitPrefixUnaryExpression(node: TypeScript.PrefixUnaryExpressionSyntax) { + this.log(node); + return super.visitPrefixUnaryExpression(node); + } + public visitArrayLiteralExpression(node: TypeScript.ArrayLiteralExpressionSyntax) { + this.log(node); + return super.visitArrayLiteralExpression(node); + } + public visitOmittedExpression(node: TypeScript.OmittedExpressionSyntax) { + this.log(node); + return super.visitOmittedExpression(node); + } + public visitParenthesizedExpression(node: TypeScript.ParenthesizedExpressionSyntax) { + this.log(node); + return super.visitParenthesizedExpression(node); + } + public visitSimpleArrowFunctionExpression(node: TypeScript.SimpleArrowFunctionExpressionSyntax) { + this.log(node); + return super.visitSimpleArrowFunctionExpression(node); + } + public visitParenthesizedArrowFunctionExpression(node: TypeScript.ParenthesizedArrowFunctionExpressionSyntax) { + this.log(node); + return super.visitParenthesizedArrowFunctionExpression(node); + } + public visitObjectCreationExpression(node: TypeScript.ObjectCreationExpressionSyntax) { + this.log(node); + return super.visitObjectCreationExpression(node); + } + public visitCastExpression(node: TypeScript.CastExpressionSyntax) { + this.log(node); + return super.visitCastExpression(node); + } + public visitObjectLiteralExpression(node: TypeScript.ObjectLiteralExpressionSyntax) { + this.log(node); + return super.visitObjectLiteralExpression(node); + } + public visitFunctionExpression(node: TypeScript.FunctionExpressionSyntax) { + this.log(node); + return super.visitFunctionExpression(node); + } + public visitTypeOfExpression(node: TypeScript.TypeOfExpressionSyntax) { + this.log(node); + return super.visitTypeOfExpression(node); + } + public visitDeleteExpression(node: TypeScript.DeleteExpressionSyntax) { + this.log(node); + return super.visitDeleteExpression(node); + } + public visitVoidExpression(node: TypeScript.VoidExpressionSyntax) { + this.log(node); + return super.visitVoidExpression(node); + } + public visitMemberAccessExpression(node: TypeScript.MemberAccessExpressionSyntax) { + this.log(node); + return super.visitMemberAccessExpression(node); + } + public visitPostfixUnaryExpression(node: TypeScript.PostfixUnaryExpressionSyntax) { + this.log(node); + return super.visitPostfixUnaryExpression(node); + } + public visitElementAccessExpression(node: TypeScript.ElementAccessExpressionSyntax) { + this.log(node); + return super.visitElementAccessExpression(node); + } + public visitInvocationExpression(node: TypeScript.InvocationExpressionSyntax) { + this.log(node); + return super.visitInvocationExpression(node); + } + public visitBinaryExpression(node: TypeScript.BinaryExpressionSyntax) { + this.log(node); + return super.visitBinaryExpression(node); + } + public visitConditionalExpression(node: TypeScript.ConditionalExpressionSyntax) { + this.log(node); + return super.visitConditionalExpression(node); + } + + public log(node: TypeScript.ISyntaxNodeOrToken) { + var _fullStart = TypeScript.fullStart(node); + if (_fullStart >= 0) { + var pos = this.document.lineMap().getLineAndCharacterFromPosition(_fullStart); + this.results.push({ line: pos.line(), column: pos.character(), syntaxKind: TypeScript.SyntaxKind[node.kind()], identifierName: TypeScript.fullText(node, this.text).trim(), type: this.getTypeOfElement(node) }); + } + } +} +*/ \ No newline at end of file diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts new file mode 100644 index 0000000000000..451c868a82844 --- /dev/null +++ b/src/harness/unittestrunner.ts @@ -0,0 +1,89 @@ +/// +/// + +enum UnittestTestType { + Compiler, + LanguageService, + Services, +} + +class UnitTestRunner extends RunnerBase { + constructor(public testType?: UnittestTestType) { + super(); + } + + public initializeTests() { + switch (this.testType) { + case UnittestTestType.Compiler: + this.tests = this.enumerateFiles('tests/cases/unittests/compiler'); + break; + case UnittestTestType.LanguageService: + this.tests = this.enumerateFiles('tests/cases/unittests/ls'); + break; + default: + if (this.tests.length === 0) { + throw new Error('Unsupported test cases: ' + this.testType); + } + break; + } + + var outfile = new Harness.Compiler.WriterAggregator() + var outerr = new Harness.Compiler.WriterAggregator(); + // note this is running immediately to generate tests to be run later inside describe/it + // need a fresh instance so that the previous runner's last test is not hanging around + var harnessCompiler = Harness.Compiler.getCompiler({ useExistingInstance: false }); + + var toBeAdded = this.tests.map(test => { + return { unitName: test, content: Harness.IO.readFile(test) } + }); + harnessCompiler.addInputFiles(toBeAdded); + harnessCompiler.compile({ noResolve: true }); + + var stdout = new Harness.Compiler.EmitterIOHost(); + var emitDiagnostics = harnessCompiler.emitAll(stdout); + var results = stdout.toArray(); + var lines: string[] = []; + results.forEach(v => lines = lines.concat(v.file.lines)); + var code = lines.join("\n") + + var nodeContext: any = undefined; + if (Utils.getExecutionEnvironment() === Utils.ExecutionEnvironment.Node) { + nodeContext = { + require: require, + process: process, + describe: describe, + it: it, + assert: assert, + beforeEach: beforeEach, + afterEach: afterEach, + before: before, + after: after, + Harness: Harness, + IO: Harness.IO + // FourSlash: FourSlash + }; + } + + describe("Setup compiler for compiler unittests", () => { + // ensures a clean compiler instance when tests are eventually executed following this describe block + harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } + }); + }); + + // this generated code is a series of top level describe/it blocks that will run in between the setup and cleanup blocks in this file + Utils.evalFile(code, "generated_test_code.js", nodeContext); + + describe("Cleanup after unittests", () => { + var harnessCompiler = Harness.Compiler.getCompiler({ + useExistingInstance: false, + optionsForFreshInstance: { useMinimalDefaultLib: true, noImplicitAny: false } + }); + }); + + // note this runs immediately (ie before this same code in the describe block above) + // to make sure the next runner doesn't include the previous one's stuff + harnessCompiler = Harness.Compiler.getCompiler({ useExistingInstance: false }); + } +} \ No newline at end of file diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts new file mode 100644 index 0000000000000..c37efa0340a4e --- /dev/null +++ b/src/lib/core.d.ts @@ -0,0 +1,1128 @@ +/// + +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: any, properties?: PropertyDescriptorMap): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: any): any; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: any): any; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: any): any; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(thisArg: any, ...argArray: any[]): any; + + prototype: any; + length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +declare var Function: { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + prototype: Function; +} + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string): string[]; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. + */ + match(regexp: RegExp): string[]; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: string, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string): number; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string, limit?: number): string[]; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + [index: number]: string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: { + new (value?: any): String; + (value?: any): string; + prototype: String; + fromCharCode(...codes: number[]): string; +} + +interface Boolean { +} +declare var Boolean: { + new (value?: any): Boolean; + (value?: any): boolean; + prototype: Boolean; +} + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: { + new (value?: any): Number; + (value?: any): number; + prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + POSITIVE_INFINITY: number; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + E: number; + /** The natural logarithm of 10. */ + LN10: number; + /** The natural logarithm of 2. */ + LN2: number; + /** The base-2 logarithm of e. */ + LOG2E: number; + /** The base-10 logarithm of e. */ + LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + SQRT1_2: number; + /** The square root of 2. */ + SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point (y,x). + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +declare var Date: { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +interface RegExpExecArray { + [index: number]: string; + length: number; + + index: number; + input: string; + + toString(): string; + toLocaleString(): string; + concat(...items: string[][]): string[]; + join(separator?: string): string; + pop(): string; + push(...items: string[]): number; + reverse(): string[]; + shift(): string; + slice(start?: number, end?: number): string[]; + sort(compareFn?: (a: string, b: string) => number): string[]; + splice(start: number): string[]; + splice(start: number, deleteCount: number, ...items: string[]): string[]; + unshift(...items: string[]): number; + + indexOf(searchElement: string, fromIndex?: number): number; + lastIndexOf(searchElement: string, fromIndex?: number): number; + every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void; + map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; + filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; + reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; + reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; +} + + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): RegExp; +} +declare var RegExp: { + new (pattern: string, flags?: string): RegExp; + (pattern: string, flags?: string): RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +interface Error { + name: string; + message: string; +} +declare var Error: { + new (message?: string): Error; + (message?: string): Error; + prototype: Error; +} + +interface EvalError extends Error { +} +declare var EvalError: { + new (message?: string): EvalError; + (message?: string): EvalError; + prototype: EvalError; +} + +interface RangeError extends Error { +} +declare var RangeError: { + new (message?: string): RangeError; + (message?: string): RangeError; + prototype: RangeError; +} + +interface ReferenceError extends Error { +} +declare var ReferenceError: { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + prototype: ReferenceError; +} + +interface SyntaxError extends Error { +} +declare var SyntaxError: { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + prototype: SyntaxError; +} + +interface TypeError extends Error { +} +declare var TypeError: { + new (message?: string): TypeError; + (message?: string): TypeError; + prototype: TypeError; +} + +interface URIError extends Error { +} +declare var URIError: { + new (message?: string): URIError; + (message?: string): URIError; + prototype: URIError; +} + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + */ + stringify(value: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + */ + stringify(value: any, replacer: (key: string, value: any) => any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + */ + stringify(value: any, replacer: any[]): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: any[], space: any): string; +} +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface Array { + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + */ + splice(start: number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + + [n: number]: T; +} +declare var Array: { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): boolean; + prototype: Array; +} diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts new file mode 100644 index 0000000000000..cdb6a48fcb1c1 --- /dev/null +++ b/src/lib/dom.generated.d.ts @@ -0,0 +1,12193 @@ +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface AlgorithmParameters { +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface Algorithm { + name?: string; + params?: AlgorithmParameters; +} + +interface MouseEventInit { + bubbles?: boolean; + cancelable?: boolean; + view?: Window; + detail?: number; + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface WebGLContextAttributes { + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { + hidden: any; + readyState: any; + onmouseleave: (ev: MouseEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + onmove: (ev: MSEventObj) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onhelp: (ev: Event) => any; + ondragleave: (ev: DragEvent) => any; + className: string; + onfocusin: (ev: FocusEvent) => any; + onseeked: (ev: Event) => any; + recordNumber: any; + title: string; + parentTextEdit: Element; + outerHTML: string; + ondurationchange: (ev: Event) => any; + offsetHeight: number; + all: HTMLCollection; + onblur: (ev: FocusEvent) => any; + dir: string; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + ondeactivate: (ev: UIEvent) => any; + ondatasetchanged: (ev: MSEventObj) => any; + onrowsdelete: (ev: MSEventObj) => any; + sourceIndex: number; + onloadstart: (ev: Event) => any; + onlosecapture: (ev: MSEventObj) => any; + ondragenter: (ev: DragEvent) => any; + oncontrolselect: (ev: MSEventObj) => any; + onsubmit: (ev: Event) => any; + behaviorUrns: MSBehaviorUrnsCollection; + scopeName: string; + onchange: (ev: Event) => any; + id: string; + onlayoutcomplete: (ev: MSEventObj) => any; + uniqueID: string; + onbeforeactivate: (ev: UIEvent) => any; + oncanplaythrough: (ev: Event) => any; + onbeforeupdate: (ev: MSEventObj) => any; + onfilterchange: (ev: MSEventObj) => any; + offsetParent: Element; + ondatasetcomplete: (ev: MSEventObj) => any; + onsuspend: (ev: Event) => any; + onmouseenter: (ev: MouseEvent) => any; + innerText: string; + onerrorupdate: (ev: MSEventObj) => any; + onmouseout: (ev: MouseEvent) => any; + parentElement: HTMLElement; + onmousewheel: (ev: MouseWheelEvent) => any; + onvolumechange: (ev: Event) => any; + oncellchange: (ev: MSEventObj) => any; + onrowexit: (ev: MSEventObj) => any; + onrowsinserted: (ev: MSEventObj) => any; + onpropertychange: (ev: MSEventObj) => any; + filters: any; + children: HTMLCollection; + ondragend: (ev: DragEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + offsetTop: number; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + innerHTML: string; + onmouseover: (ev: MouseEvent) => any; + lang: string; + uniqueNumber: number; + onpause: (ev: Event) => any; + tagUrn: string; + onmousedown: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + onwaiting: (ev: Event) => any; + onresizestart: (ev: MSEventObj) => any; + offsetLeft: number; + isTextEdit: boolean; + isDisabled: boolean; + onpaste: (ev: DragEvent) => any; + canHaveHTML: boolean; + onmoveend: (ev: MSEventObj) => any; + language: string; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + style: MSStyleCSSProperties; + isContentEditable: boolean; + onbeforeeditfocus: (ev: MSEventObj) => any; + onratechange: (ev: Event) => any; + contentEditable: string; + tabIndex: number; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: MouseEvent) => any; + onloadedmetadata: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + onerror: (ev: ErrorEvent) => any; + onplay: (ev: Event) => any; + onresizeend: (ev: MSEventObj) => any; + onplaying: (ev: Event) => any; + isMultiLine: boolean; + onfocusout: (ev: FocusEvent) => any; + onabort: (ev: UIEvent) => any; + ondataavailable: (ev: MSEventObj) => any; + hideFocus: boolean; + onreadystatechange: (ev: Event) => any; + onkeypress: (ev: KeyboardEvent) => any; + onloadeddata: (ev: Event) => any; + onbeforedeactivate: (ev: UIEvent) => any; + outerText: string; + disabled: boolean; + onactivate: (ev: UIEvent) => any; + accessKey: string; + onmovestart: (ev: MSEventObj) => any; + onselectstart: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + oncut: (ev: DragEvent) => any; + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + offsetWidth: number; + oncopy: (ev: DragEvent) => any; + onended: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onrowenter: (ev: MSEventObj) => any; + onload: (ev: Event) => any; + canHaveChildren: boolean; + oninput: (ev: Event) => any; + onmscontentzoom: (ev: MSEventObj) => any; + oncuechange: (ev: Event) => any; + spellcheck: boolean; + classList: DOMTokenList; + onmsmanipulationstatechanged: (ev: any) => any; + draggable: boolean; + dataset: DOMStringMap; + dragDrop(): boolean; + scrollIntoView(top?: boolean): void; + addFilter(filter: any): void; + setCapture(containerCapture?: boolean): void; + focus(): void; + getAdjacentText(where: string): string; + insertAdjacentText(where: string, text: string): void; + getElementsByClassName(classNames: string): NodeList; + setActive(): void; + removeFilter(filter: any): void; + blur(): void; + clearAttributes(): void; + releaseCapture(): void; + createControlRange(): ControlRangeCollection; + removeBehavior(cookie: number): boolean; + contains(child: HTMLElement): boolean; + click(): void; + insertAdjacentElement(position: string, insertedElement: Element): Element; + mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; + replaceAdjacentText(where: string, newText: string): string; + applyElement(apply: Element, where?: string): Element; + addBehavior(bstrUrl: string, factory?: any): number; + insertAdjacentHTML(where: string, html: string): void; + msGetInputContext(): MSInputMethodContext; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + */ + compatible: MSCompatibleInfoCollection; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollection; + /** + * Fires when the user presses the F1 key while the browser is the active window. + * @param ev The event. + */ + onhelp: (ev: Event) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Fires for an element just prior to setting focus on that element. + * @param ev The focus event + */ + onfocusin: (ev: FocusEvent) => any; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + security: string; + /** + * Contains the title of the document. + */ + title: string; + /** + * Retrieves a collection of namespace objects. + */ + namespaces: MSNamespaceInfoCollection; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + styleSheets: StyleSheetList; + /** + * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. + */ + frames: Window; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Returns a reference to the collection of elements contained by the object. + */ + all: HTMLCollection; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollection; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (ev: Event) => any; + /** + * Fires when the data set exposed by a data source object changes. + * @param ev The event. + */ + ondatasetchanged: (ev: MSEventObj) => any; + /** + * Fires when rows are about to be deleted from the recordset. + * @param ev The event + */ + onrowsdelete: (ev: MSEventObj) => any; + Script: MSScriptHost; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + URLUnencoded: string; + defaultView: Window; + /** + * Fires when the user is about to make a control selection of the object. + * @param ev The event. + */ + oncontrolselect: (ev: MSEventObj) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + activeElement: Element; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (ev: Event) => any; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Retrieves an autogenerated, unique identifier for the object. + */ + uniqueID: string; + /** + * Sets or gets the URL for the current document. + */ + URL: string; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + head: HTMLHeadElement; + cookie: string; + xmlEncoding: string; + oncanplaythrough: (ev: Event) => any; + /** + * Retrieves the document compatibility mode of the document. + */ + documentMode: number; + characterSet: string; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + onbeforeupdate: (ev: MSEventObj) => any; + /** + * Fires to indicate that all data is available from the data source object. + * @param ev The event. + */ + ondatasetcomplete: (ev: MSEventObj) => any; + plugins: HTMLCollection; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (ev: Event) => any; + /** + * Gets the root svg element in the document hierarchy. + */ + rootElement: SVGSVGElement; + /** + * Retrieves a value that indicates the current state of the object. + */ + readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + referrer: string; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Fires on a databound object when an error occurs while updating the associated data in the data source object. + * @param ev The event. + */ + onerrorupdate: (ev: MSEventObj) => any; + /** + * Gets a reference to the container object of the window. + */ + parentWindow: Window; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Fires when data changes in the data provider. + * @param ev The event. + */ + oncellchange: (ev: MSEventObj) => any; + /** + * Fires just before the data source control changes the current row in the object. + * @param ev The event. + */ + onrowexit: (ev: MSEventObj) => any; + /** + * Fires just after new rows are inserted in the current recordset. + * @param ev The event. + */ + onrowsinserted: (ev: MSEventObj) => any; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string; + msCapsLockWarningOff: boolean; + /** + * Fires when a property changes on the object. + * @param ev The event. + */ + onpropertychange: (ev: MSEventObj) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (ev: DragEvent) => any; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (ev: DragEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (ev: MouseEvent) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + xmlStandalone: boolean; + /** + * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. + */ + selection: MSSelection; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. + * @param ev The event. + */ + onbeforeeditfocus: (ev: MSEventObj) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (ev: MouseEvent) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + media: string; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: ErrorEvent) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + onafterupdate: (ev: MSEventObj) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: UIEvent) => any; + /** + * Fires for the current element with focus immediately after moving focus to another element. + * @param ev The event. + */ + onfocusout: (ev: FocusEvent) => any; + /** + * Fires when the selection state of a document changes. + * @param ev The event. + */ + onselectionchange: (ev: Event) => any; + /** + * Fires when a local DOM Storage area is written to disk. + * @param ev The event. + */ + onstoragecommit: (ev: StorageEvent) => any; + /** + * Fires periodically as data arrives from data source objects that asynchronously transmit their data. + * @param ev The event. + */ + ondataavailable: (ev: MSEventObj) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: Event) => any; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Fires to indicate that the current row has changed in the data source and new data values are available on the object. + * @param ev The event. + */ + onrowenter: (ev: MSEventObj) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + oninput: (ev: Event) => any; + onmspointerdown: (ev: any) => any; + msHidden: boolean; + msVisibilityState: string; + onmsgesturedoubletap: (ev: any) => any; + visibilityState: string; + onmsmanipulationstatechanged: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmscontentzoom: (ev: MSEventObj) => any; + onmspointermove: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + msCSSOMElementFloatMetrics: boolean; + onmspointerover: (ev: any) => any; + hidden: boolean; + onmspointerup: (ev: any) => any; + msFullscreenEnabled: boolean; + onmsfullscreenerror: (ev: any) => any; + onmspointerenter: (ev: any) => any; + msFullscreenElement: Element; + onmsfullscreenchange: (ev: any) => any; + onmspointerleave: (ev: any) => any; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + adoptNode(source: Node): Node; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + createCDATASection(data: string): CDATASection; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: "a"): HTMLAnchorElement; + createElement(tagName: "abbr"): HTMLPhraseElement; + createElement(tagName: "acronym"): HTMLPhraseElement; + createElement(tagName: "address"): HTMLBlockElement; + createElement(tagName: "applet"): HTMLAppletElement; + createElement(tagName: "area"): HTMLAreaElement; + createElement(tagName: "article"): HTMLElement; + createElement(tagName: "aside"): HTMLElement; + createElement(tagName: "audio"): HTMLAudioElement; + createElement(tagName: "b"): HTMLPhraseElement; + createElement(tagName: "base"): HTMLBaseElement; + createElement(tagName: "basefont"): HTMLBaseFontElement; + createElement(tagName: "bdo"): HTMLPhraseElement; + createElement(tagName: "bgsound"): HTMLBGSoundElement; + createElement(tagName: "big"): HTMLPhraseElement; + createElement(tagName: "blockquote"): HTMLBlockElement; + createElement(tagName: "body"): HTMLBodyElement; + createElement(tagName: "br"): HTMLBRElement; + createElement(tagName: "button"): HTMLButtonElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: "caption"): HTMLTableCaptionElement; + createElement(tagName: "center"): HTMLBlockElement; + createElement(tagName: "cite"): HTMLPhraseElement; + createElement(tagName: "code"): HTMLPhraseElement; + createElement(tagName: "col"): HTMLTableColElement; + createElement(tagName: "colgroup"): HTMLTableColElement; + createElement(tagName: "datalist"): HTMLDataListElement; + createElement(tagName: "dd"): HTMLDDElement; + createElement(tagName: "del"): HTMLModElement; + createElement(tagName: "dfn"): HTMLPhraseElement; + createElement(tagName: "dir"): HTMLDirectoryElement; + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "dl"): HTMLDListElement; + createElement(tagName: "dt"): HTMLDTElement; + createElement(tagName: "em"): HTMLPhraseElement; + createElement(tagName: "embed"): HTMLEmbedElement; + createElement(tagName: "fieldset"): HTMLFieldSetElement; + createElement(tagName: "figcaption"): HTMLElement; + createElement(tagName: "figure"): HTMLElement; + createElement(tagName: "font"): HTMLFontElement; + createElement(tagName: "footer"): HTMLElement; + createElement(tagName: "form"): HTMLFormElement; + createElement(tagName: "frame"): HTMLFrameElement; + createElement(tagName: "frameset"): HTMLFrameSetElement; + createElement(tagName: "h1"): HTMLHeadingElement; + createElement(tagName: "h2"): HTMLHeadingElement; + createElement(tagName: "h3"): HTMLHeadingElement; + createElement(tagName: "h4"): HTMLHeadingElement; + createElement(tagName: "h5"): HTMLHeadingElement; + createElement(tagName: "h6"): HTMLHeadingElement; + createElement(tagName: "head"): HTMLHeadElement; + createElement(tagName: "header"): HTMLElement; + createElement(tagName: "hgroup"): HTMLElement; + createElement(tagName: "hr"): HTMLHRElement; + createElement(tagName: "html"): HTMLHtmlElement; + createElement(tagName: "i"): HTMLPhraseElement; + createElement(tagName: "iframe"): HTMLIFrameElement; + createElement(tagName: "img"): HTMLImageElement; + createElement(tagName: "input"): HTMLInputElement; + createElement(tagName: "ins"): HTMLModElement; + createElement(tagName: "isindex"): HTMLIsIndexElement; + createElement(tagName: "kbd"): HTMLPhraseElement; + createElement(tagName: "keygen"): HTMLBlockElement; + createElement(tagName: "label"): HTMLLabelElement; + createElement(tagName: "legend"): HTMLLegendElement; + createElement(tagName: "li"): HTMLLIElement; + createElement(tagName: "link"): HTMLLinkElement; + createElement(tagName: "listing"): HTMLBlockElement; + createElement(tagName: "map"): HTMLMapElement; + createElement(tagName: "mark"): HTMLElement; + createElement(tagName: "marquee"): HTMLMarqueeElement; + createElement(tagName: "menu"): HTMLMenuElement; + createElement(tagName: "meta"): HTMLMetaElement; + createElement(tagName: "nav"): HTMLElement; + createElement(tagName: "nextid"): HTMLNextIdElement; + createElement(tagName: "nobr"): HTMLPhraseElement; + createElement(tagName: "noframes"): HTMLElement; + createElement(tagName: "noscript"): HTMLElement; + createElement(tagName: "object"): HTMLObjectElement; + createElement(tagName: "ol"): HTMLOListElement; + createElement(tagName: "optgroup"): HTMLOptGroupElement; + createElement(tagName: "option"): HTMLOptionElement; + createElement(tagName: "p"): HTMLParagraphElement; + createElement(tagName: "param"): HTMLParamElement; + createElement(tagName: "plaintext"): HTMLBlockElement; + createElement(tagName: "pre"): HTMLPreElement; + createElement(tagName: "progress"): HTMLProgressElement; + createElement(tagName: "q"): HTMLQuoteElement; + createElement(tagName: "rt"): HTMLPhraseElement; + createElement(tagName: "ruby"): HTMLPhraseElement; + createElement(tagName: "s"): HTMLPhraseElement; + createElement(tagName: "samp"): HTMLPhraseElement; + createElement(tagName: "script"): HTMLScriptElement; + createElement(tagName: "section"): HTMLElement; + createElement(tagName: "select"): HTMLSelectElement; + createElement(tagName: "small"): HTMLPhraseElement; + createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "strike"): HTMLPhraseElement; + createElement(tagName: "strong"): HTMLPhraseElement; + createElement(tagName: "style"): HTMLStyleElement; + createElement(tagName: "sub"): HTMLPhraseElement; + createElement(tagName: "sup"): HTMLPhraseElement; + createElement(tagName: "table"): HTMLTableElement; + createElement(tagName: "tbody"): HTMLTableSectionElement; + createElement(tagName: "td"): HTMLTableDataCellElement; + createElement(tagName: "textarea"): HTMLTextAreaElement; + createElement(tagName: "tfoot"): HTMLTableSectionElement; + createElement(tagName: "th"): HTMLTableHeaderCellElement; + createElement(tagName: "thead"): HTMLTableSectionElement; + createElement(tagName: "title"): HTMLTitleElement; + createElement(tagName: "tr"): HTMLTableRowElement; + createElement(tagName: "track"): HTMLTrackElement; + createElement(tagName: "tt"): HTMLPhraseElement; + createElement(tagName: "u"): HTMLPhraseElement; + createElement(tagName: "ul"): HTMLUListElement; + createElement(tagName: "var"): HTMLPhraseElement; + createElement(tagName: "video"): HTMLVideoElement; + createElement(tagName: "wbr"): HTMLElement; + createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; + createElement(tagName: "xmp"): HTMLBlockElement; + createElement(tagName: string): HTMLElement; + /** + * Removes mouse capture from the object in the current document. + */ + releaseCapture(): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + createElementNS(namespaceURI: string, qualifiedName: string): Element; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): any; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + getElementsByClassName(classNames: string): NodeList; + importNode(importedNode: Node, deep: boolean): Node; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Fires a specified event on the object. + * @param eventName Specifies the name of the event to fire. + * @param eventObj Object that specifies the event object from which to obtain event object properties. + */ + fireEvent(eventName: string, eventObj?: any): boolean; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates a style sheet for the document. + * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. + * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. + */ + createStyleSheet(href?: string, index?: number): CSSStyleSheet; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; + /** + * Generates an event object to pass event context information when you use the fireEvent method. + * @param eventObj An object that specifies an existing event object on which to base the new object. + */ + createEventObject(eventObj?: any): MSEventObj; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + clear(): void; + msExitFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Document: { + prototype: Document; + new(): Document; +} + +interface Console { + info(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + profile(reportName?: string): void; + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + clear(): void; + dir(value?: any, ...optionalParams: any[]): void; + profileEnd(): void; + count(countTitle?: string): void; + groupEnd(): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + group(groupTitle?: string): void; + dirxml(value: any): void; + debug(message?: string, ...optionalParams: any[]): void; + groupCollapsed(groupTitle?: string): void; + select(element: Element): void; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface MSEventObj extends Event { + nextPage: string; + keyCode: number; + toElement: Element; + returnValue: any; + dataFld: string; + y: number; + dataTransfer: DataTransfer; + propertyName: string; + url: string; + offsetX: number; + recordset: any; + screenX: number; + buttonID: number; + wheelDelta: number; + reason: number; + origin: string; + data: string; + srcFilter: any; + boundElements: HTMLCollection; + cancelBubble: boolean; + altLeft: boolean; + behaviorCookie: number; + bookmarks: BookmarkCollection; + type: string; + repeat: boolean; + srcElement: Element; + source: Window; + fromElement: Element; + offsetY: number; + x: number; + behaviorPart: number; + qualifier: string; + altKey: boolean; + ctrlKey: boolean; + clientY: number; + shiftKey: boolean; + shiftLeft: boolean; + contentOverflow: boolean; + screenY: number; + ctrlLeft: boolean; + button: number; + srcUrn: string; + clientX: number; + actionURL: string; + getAttribute(strAttributeName: string, lFlags?: number): any; + setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; + removeAttribute(strAttributeName: string, lFlags?: number): boolean; +} +declare var MSEventObj: { + prototype: MSEventObj; + new(): MSEventObj; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: string, ...args: any[]): any; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; +} +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { + ondragend: (ev: DragEvent) => any; + onkeydown: (ev: KeyboardEvent) => any; + ondragover: (ev: DragEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onreset: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrag: (ev: DragEvent) => any; + screenX: number; + onmouseover: (ev: MouseEvent) => any; + ondragleave: (ev: DragEvent) => any; + history: History; + pageXOffset: number; + name: string; + onafterprint: (ev: Event) => any; + onpause: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + top: Window; + onmousedown: (ev: MouseEvent) => any; + onseeked: (ev: Event) => any; + opener: Window; + onclick: (ev: MouseEvent) => any; + innerHeight: number; + onwaiting: (ev: Event) => any; + ononline: (ev: Event) => any; + ondurationchange: (ev: Event) => any; + frames: Window; + onblur: (ev: FocusEvent) => any; + onemptied: (ev: Event) => any; + onseeking: (ev: Event) => any; + oncanplay: (ev: Event) => any; + outerWidth: number; + onstalled: (ev: Event) => any; + onmousemove: (ev: MouseEvent) => any; + innerWidth: number; + onoffline: (ev: Event) => any; + length: number; + screen: Screen; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onratechange: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onloadstart: (ev: Event) => any; + ondragenter: (ev: DragEvent) => any; + onsubmit: (ev: Event) => any; + self: Window; + document: Document; + onprogress: (ev: ProgressEvent) => any; + ondblclick: (ev: MouseEvent) => any; + pageYOffset: number; + oncontextmenu: (ev: MouseEvent) => any; + onchange: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onplay: (ev: Event) => any; + onerror: ErrorEventHandler; + onplaying: (ev: Event) => any; + parent: Window; + location: Location; + oncanplaythrough: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onreadystatechange: (ev: Event) => any; + outerHeight: number; + onkeypress: (ev: KeyboardEvent) => any; + frameElement: Element; + onloadeddata: (ev: Event) => any; + onsuspend: (ev: Event) => any; + window: Window; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + ontimeupdate: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onselect: (ev: UIEvent) => any; + navigator: Navigator; + styleMedia: StyleMedia; + ondrop: (ev: DragEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onended: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onunload: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + screenY: number; + onmousewheel: (ev: MouseWheelEvent) => any; + onload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + oninput: (ev: Event) => any; + performance: Performance; + onmspointerdown: (ev: any) => any; + animationStartTime: number; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + msAnimationStartTime: number; + applicationCache: ApplicationCache; + onmsinertiastart: (ev: any) => any; + onmspointerover: (ev: any) => any; + onpopstate: (ev: PopStateEvent) => any; + onmspointerup: (ev: any) => any; + onpageshow: (ev: PageTransitionEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + devicePixelRatio: number; + msCrypto: Crypto; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + doNotTrack: string; + onmspointerenter: (ev: any) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onmspointerleave: (ev: any) => any; + alert(message?: any): void; + scroll(x?: number, y?: number): void; + focus(): void; + scrollTo(x?: number, y?: number): void; + print(): void; + prompt(message?: string, _default?: string): string; + toString(): string; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; + scrollBy(x?: number, y?: number): void; + confirm(message?: string): boolean; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; + showModalDialog(url?: string, argument?: any, options?: any): any; + blur(): void; + getSelection(): Selection; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + msCancelRequestAnimationFrame(handle: number): void; + matchMedia(mediaQuery: string): MediaQueryList; + cancelAnimationFrame(handle: number): void; + msIsStaticHTML(html: string): boolean; + msMatchMedia(mediaQuery: string): MediaQueryList; + requestAnimationFrame(callback: FrameRequestCallback): number; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Window: { + prototype: Window; + new(): Window; +} + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; + product: string; + vendor: string; +} + +interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Retrieves a collection of all cells in the table row or in the entire table. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; +} +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface TreeWalker { + whatToShow: number; + filter: NodeFilter; + root: Node; + currentNode: Node; + expandEntityReferences: boolean; + previousSibling(): Node; + lastChild(): Node; + nextSibling(): Node; + nextNode(): Node; + parentNode(): Node; + firstChild(): Node; + previousNode(): Node; +} +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + getEntriesByType(entryType: string): any; + toJSON(): any; + getMeasures(measureName?: string): any; + clearMarks(markName?: string): void; + getMarks(markName?: string): any; + clearResourceTimings(): void; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + getEntriesByName(name: string, entryType?: string): any; + getEntries(): any; + clearMeasures(measureName?: string): void; + setResourceTimingBufferSize(maxSize: number): void; + now(): number; +} +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface MSDataBindingTableExtensions { + dataPageSize: number; + nextPage(): void; + firstPage(): void; + refresh(): void; + previousPage(): void; + lastPage(): void; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} +declare var CompositionEvent: { + prototype: CompositionEvent; + new(): CompositionEvent; +} + +interface WindowTimers extends WindowTimersExtension { + clearTimeout(handle: number): void; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; + clearInterval(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { + orientType: SVGAnimatedEnumeration; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + markerHeight: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + refY: SVGAnimatedLength; + refX: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKER_ORIENT_UNKNOWN: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; +} + +interface CSSStyleDeclaration { + backgroundAttachment: string; + visibility: string; + textAlignLast: string; + borderRightStyle: string; + counterIncrement: string; + orphans: string; + cssText: string; + borderStyle: string; + pointerEvents: string; + borderTopColor: string; + markerEnd: string; + textIndent: string; + listStyleImage: string; + cursor: string; + listStylePosition: string; + wordWrap: string; + borderTopStyle: string; + alignmentBaseline: string; + opacity: string; + direction: string; + strokeMiterlimit: string; + maxWidth: string; + color: string; + clip: string; + borderRightWidth: string; + verticalAlign: string; + overflow: string; + mask: string; + borderLeftStyle: string; + emptyCells: string; + stopOpacity: string; + paddingRight: string; + parentRule: CSSRule; + background: string; + boxSizing: string; + textJustify: string; + height: string; + paddingTop: string; + length: number; + right: string; + baselineShift: string; + borderLeft: string; + widows: string; + lineHeight: string; + left: string; + textUnderlinePosition: string; + glyphOrientationHorizontal: string; + display: string; + textAnchor: string; + cssFloat: string; + strokeDasharray: string; + rubyAlign: string; + fontSizeAdjust: string; + borderLeftColor: string; + backgroundImage: string; + listStyleType: string; + strokeWidth: string; + textOverflow: string; + fillRule: string; + borderBottomColor: string; + zIndex: string; + position: string; + listStyle: string; + msTransformOrigin: string; + dominantBaseline: string; + overflowY: string; + fill: string; + captionSide: string; + borderCollapse: string; + boxShadow: string; + quotes: string; + tableLayout: string; + unicodeBidi: string; + borderBottomWidth: string; + backgroundSize: string; + textDecoration: string; + strokeDashoffset: string; + fontSize: string; + border: string; + pageBreakBefore: string; + borderTopRightRadius: string; + msTransform: string; + borderBottomLeftRadius: string; + textTransform: string; + rubyPosition: string; + strokeLinejoin: string; + clipPath: string; + borderRightColor: string; + fontFamily: string; + clear: string; + content: string; + backgroundClip: string; + marginBottom: string; + counterReset: string; + outlineWidth: string; + marginRight: string; + paddingLeft: string; + borderBottom: string; + wordBreak: string; + marginTop: string; + top: string; + fontWeight: string; + borderRight: string; + width: string; + kerning: string; + pageBreakAfter: string; + borderBottomStyle: string; + fontStretch: string; + padding: string; + strokeOpacity: string; + markerStart: string; + bottom: string; + borderLeftWidth: string; + clipRule: string; + backgroundPosition: string; + backgroundColor: string; + pageBreakInside: string; + backgroundOrigin: string; + strokeLinecap: string; + borderTopWidth: string; + outlineStyle: string; + borderTop: string; + outlineColor: string; + paddingBottom: string; + marginLeft: string; + font: string; + outline: string; + wordSpacing: string; + maxHeight: string; + fillOpacity: string; + letterSpacing: string; + borderSpacing: string; + backgroundRepeat: string; + borderRadius: string; + borderWidth: string; + borderBottomRightRadius: string; + whiteSpace: string; + fontStyle: string; + minWidth: string; + stopColor: string; + borderTopLeftRadius: string; + borderColor: string; + marker: string; + glyphOrientationVertical: string; + markerMid: string; + fontVariant: string; + minHeight: string; + stroke: string; + rubyOverhang: string; + overflowX: string; + textAlign: string; + margin: string; + animationFillMode: string; + floodColor: string; + animationIterationCount: string; + textShadow: string; + backfaceVisibility: string; + msAnimationIterationCount: string; + animationDelay: string; + animationTimingFunction: string; + columnWidth: any; + msScrollSnapX: string; + columnRuleColor: any; + columnRuleWidth: any; + transitionDelay: string; + transition: string; + msFlowFrom: string; + msScrollSnapType: string; + msContentZoomSnapType: string; + msGridColumns: string; + msAnimationName: string; + msGridRowAlign: string; + msContentZoomChaining: string; + msGridColumn: any; + msHyphenateLimitZone: any; + msScrollRails: string; + msAnimationDelay: string; + enableBackground: string; + msWrapThrough: string; + columnRuleStyle: string; + msAnimation: string; + msFlexFlow: string; + msScrollSnapY: string; + msHyphenateLimitLines: any; + msTouchAction: string; + msScrollLimit: string; + animation: string; + transform: string; + filter: string; + colorInterpolationFilters: string; + transitionTimingFunction: string; + msBackfaceVisibility: string; + animationPlayState: string; + transformOrigin: string; + msScrollLimitYMin: any; + msFontFeatureSettings: string; + msContentZoomLimitMin: any; + columnGap: any; + transitionProperty: string; + msAnimationDuration: string; + msAnimationFillMode: string; + msFlexDirection: string; + msTransitionDuration: string; + fontFeatureSettings: string; + breakBefore: string; + msFlexWrap: string; + perspective: string; + msFlowInto: string; + msTransformStyle: string; + msScrollTranslation: string; + msTransitionProperty: string; + msUserSelect: string; + msOverflowStyle: string; + msScrollSnapPointsY: string; + animationDirection: string; + animationDuration: string; + msFlex: string; + msTransitionTimingFunction: string; + animationName: string; + columnRule: string; + msGridColumnSpan: any; + msFlexNegative: string; + columnFill: string; + msGridRow: any; + msFlexOrder: string; + msFlexItemAlign: string; + msFlexPositive: string; + msContentZoomLimitMax: any; + msScrollLimitYMax: any; + msGridColumnAlign: string; + perspectiveOrigin: string; + lightingColor: string; + columns: string; + msScrollChaining: string; + msHyphenateLimitChars: string; + msTouchSelect: string; + floodOpacity: string; + msAnimationDirection: string; + msAnimationPlayState: string; + columnSpan: string; + msContentZooming: string; + msPerspective: string; + msFlexPack: string; + msScrollSnapPointsX: string; + msContentZoomSnapPoints: string; + msGridRowSpan: any; + msContentZoomSnap: string; + msScrollLimitXMin: any; + breakInside: string; + msHighContrastAdjust: string; + msFlexLinePack: string; + msGridRows: string; + transitionDuration: string; + msHyphens: string; + breakAfter: string; + msTransition: string; + msPerspectiveOrigin: string; + msContentZoomLimit: string; + msScrollLimitXMax: any; + msFlexAlign: string; + msWrapMargin: any; + columnCount: any; + msAnimationTimingFunction: string; + msTransitionDelay: string; + transformStyle: string; + msWrapFlow: string; + msFlexPreferredSize: string; + alignItems: string; + borderImageSource: string; + flexBasis: string; + borderImageWidth: string; + borderImageRepeat: string; + order: string; + flex: string; + alignContent: string; + msImeAlign: string; + flexShrink: string; + flexGrow: string; + borderImageSlice: string; + flexWrap: string; + borderImageOutset: string; + flexDirection: string; + touchAction: string; + flexFlow: string; + borderImage: string; + justifyContent: string; + alignSelf: string; + msTextCombineHorizontal: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + removeProperty(propertyName: string): string; + item(index: number): string; + [index: number]: string; + setProperty(propertyName: string, value: string, priority?: string): void; +} +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface MSStyleCSSProperties extends MSCSSProperties { + pixelWidth: number; + posHeight: number; + posLeft: number; + pixelTop: number; + pixelBottom: number; + textDecorationNone: boolean; + pixelLeft: number; + posTop: number; + posBottom: number; + textDecorationOverline: boolean; + posWidth: number; + textDecorationLineThrough: boolean; + pixelHeight: number; + textDecorationBlink: boolean; + posRight: number; + pixelRight: number; + textDecorationUnderline: boolean; +} +declare var MSStyleCSSProperties: { + prototype: MSStyleCSSProperties; + new(): MSStyleCSSProperties; +} + +interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { + msMaxTouchPoints: number; + msPointerEnabled: boolean; + msManipulationViewsEnabled: boolean; + pointerEnabled: boolean; + maxTouchPoints: number; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; +} +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGZoomEvent extends UIEvent { + zoomRectScreen: SVGRect; + previousScale: number; + newScale: number; + previousTranslate: SVGPoint; + newTranslate: SVGPoint; +} +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface NodeSelector { + querySelectorAll(selectors: string): NodeList; + querySelector(selectors: string): Element; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; +} +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface ClientRect { + left: number; + width: number; + right: number; + top: number; + bottom: number; + height: number; +} +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface PositionErrorCallback { + (error: PositionError): void; +} + +interface DOMImplementation { + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + hasFeature(feature: string, version?: string): boolean; + createHTMLDocument(title: string): Document; +} +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { + scrollTop: number; + clientLeft: number; + scrollLeft: number; + tagName: string; + clientWidth: number; + scrollWidth: number; + clientHeight: number; + clientTop: number; + scrollHeight: number; + msRegionOverflow: string; + onmspointerdown: (ev: any) => any; + onmsgotpointercapture: (ev: any) => any; + onmsgesturedoubletap: (ev: any) => any; + onmspointerhover: (ev: any) => any; + onmsgesturehold: (ev: any) => any; + onmspointermove: (ev: any) => any; + onmsgesturechange: (ev: any) => any; + onmsgesturestart: (ev: any) => any; + onmspointercancel: (ev: any) => any; + onmsgestureend: (ev: any) => any; + onmsgesturetap: (ev: any) => any; + onmspointerout: (ev: any) => any; + onmsinertiastart: (ev: any) => any; + onmslostpointercapture: (ev: any) => any; + onmspointerover: (ev: any) => any; + msContentZoomFactor: number; + onmspointerup: (ev: any) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmspointerenter: (ev: any) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onmspointerleave: (ev: any) => any; + getAttribute(name?: string): string; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + getBoundingClientRect(): ClientRect; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + msMatchesSelector(selectors: string): boolean; + hasAttribute(name: string): boolean; + removeAttribute(name?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + getAttributeNode(name: string): Attr; + fireEvent(eventName: string, eventObj?: any): boolean; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "bgsound"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + getClientRects(): ClientRectList; + setAttributeNode(newAttr: Attr): Attr; + removeAttributeNode(oldAttr: Attr): Attr; + setAttribute(name?: string, value?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + msGetRegionContent(): MSRangeCollection; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + setPointerCapture(pointerId: number): void; + msGetUntransformedBounds(): ClientRect; + releasePointerCapture(pointerId: number): void; + msRequestFullscreen(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Element: { + prototype: Element; + new(): Element; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; +} +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Removes an element from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: any): void; +} +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface Node extends EventTarget { + nodeType: number; + previousSibling: Node; + localName: string; + namespaceURI: string; + textContent: string; + parentNode: Node; + nextSibling: Node; + nodeValue: string; + lastChild: Node; + childNodes: NodeList; + nodeName: string; + ownerDocument: Document; + attributes: NamedNodeMap; + firstChild: Node; + prefix: string; + removeChild(oldChild: Node): Node; + appendChild(newChild: Node): Node; + isSupported(feature: string, version: string): boolean; + isEqualNode(arg: Node): boolean; + lookupPrefix(namespaceURI: string): string; + isDefaultNamespace(namespaceURI: string): boolean; + compareDocumentPosition(other: Node): number; + normalize(): void; + isSameNode(other: Node): boolean; + hasAttributes(): boolean; + lookupNamespaceURI(prefix: string): string; + cloneNode(deep?: boolean): Node; + hasChildNodes(): boolean; + replaceChild(newChild: Node, oldChild: Node): Node; + insertBefore(newChild: Node, refChild?: Node): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} +declare var Node: { + prototype: Node; + new(): Node; + ENTITY_REFERENCE_NODE: number; + ATTRIBUTE_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + TEXT_NODE: number; + ELEMENT_NODE: number; + COMMENT_NODE: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_TYPE_NODE: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_NODE: number; + ENTITY_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + CDATA_SECTION_NODE: number; + NOTATION_NODE: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_PRECEDING: number; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface DOML2DeprecatedListSpaceReduction { + compact: boolean; +} + +interface MSScriptHost { +} +declare var MSScriptHost: { + prototype: MSScriptHost; + new(): MSScriptHost; +} + +interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + clipPathUnits: SVGAnimatedEnumeration; +} +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface MouseEvent extends UIEvent { + toElement: Element; + layerY: number; + fromElement: Element; + which: number; + pageX: number; + offsetY: number; + x: number; + y: number; + metaKey: boolean; + altKey: boolean; + ctrlKey: boolean; + offsetX: number; + screenX: number; + clientY: number; + shiftKey: boolean; + layerX: number; + screenY: number; + relatedTarget: EventTarget; + button: number; + pageY: number; + buttons: number; + clientX: number; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; + getModifierState(keyArg: string): boolean; +} +declare var MouseEvent: { + prototype: MouseEvent; + new(): MouseEvent; +} + +interface RangeException { + code: number; + message: string; + name: string; + toString(): string; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} +declare var RangeException: { + prototype: RangeException; + new(): RangeException; + INVALID_NODE_TYPE_ERR: number; + BAD_BOUNDARYPOINTS_ERR: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + y: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + dy: SVGAnimatedLengthList; + x: SVGAnimatedLengthList; + dx: SVGAnimatedLengthList; +} +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + width: number; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + object: string; + form: HTMLFormElement; + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; +} +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface TextMetrics { + width: number; +} +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface DocumentEvent { + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "HTMLEvents"): Event; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface: "NavigationEvent"): NavigationEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PointerEvent"): MSPointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface: "TextEvent"): TextEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * The starting number. + */ + start: number; +} +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface CDATASection extends Text { +} +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface StyleMedia { + type: string; + matchMedium(mediaquery: string): boolean; +} +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { + options: HTMLSelectElement; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: any): void; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface TextRange { + boundingLeft: number; + htmlText: string; + offsetLeft: number; + boundingWidth: number; + boundingHeight: number; + boundingTop: number; + text: string; + offsetTop: number; + moveToPoint(x: number, y: number): void; + queryCommandValue(cmdID: string): any; + getBookmark(): string; + move(unit: string, count?: number): number; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(fStart?: boolean): void; + findText(string: string, count?: number, flags?: number): boolean; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + getBoundingClientRect(): ClientRect; + moveToBookmark(bookmark: string): boolean; + isEqual(range: TextRange): boolean; + duplicate(): TextRange; + collapse(start?: boolean): void; + queryCommandText(cmdID: string): string; + select(): void; + pasteHTML(html: string): void; + inRange(range: TextRange): boolean; + moveEnd(unit: string, count?: number): number; + getClientRects(): ClientRectList; + moveStart(unit: string, count?: number): number; + parentElement(): Element; + queryCommandState(cmdID: string): boolean; + compareEndPoints(how: string, sourceRange: TextRange): number; + execCommandShowHelp(cmdID: string): boolean; + moveToElementText(element: Element): void; + expand(Unit: string): boolean; + queryCommandSupported(cmdID: string): boolean; + setEndPoint(how: string, SourceRange: TextRange): void; + queryCommandEnabled(cmdID: string): boolean; +} +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface SVGTests { + requiredFeatures: SVGStringList; + requiredExtensions: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface CSSStyleSheet extends StyleSheet { + owningElement: Element; + imports: StyleSheetList; + isAlternate: boolean; + rules: MSCSSRuleList; + isPrefAlternate: boolean; + readOnly: boolean; + cssText: string; + ownerRule: CSSRule; + href: string; + cssRules: CSSRuleList; + id: string; + pages: StyleSheetPageList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + insertRule(rule: string, index?: number): number; + removeRule(lIndex: number): void; + deleteRule(index?: number): void; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + removeImport(lIndex: number): void; +} +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface MSSelection { + type: string; + typeDetail: string; + createRange(): TextRange; + clear(): void; + createRangeCollection(): TextRangeCollection; + empty(): void; +} +declare var MSSelection: { + prototype: MSSelection; + new(): MSSelection; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; +} +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { + patternUnits: SVGAnimatedEnumeration; + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + height: SVGAnimatedLength; +} +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface Selection { + isCollapsed: boolean; + anchorNode: Node; + focusNode: Node; + anchorOffset: number; + focusOffset: number; + rangeCount: number; + addRange(range: Range): void; + collapseToEnd(): void; + toString(): string; + selectAllChildren(parentNode: Node): void; + getRangeAt(index: number): Range; + collapse(parentNode: Node, offset: number): void; + removeAllRanges(): void; + collapseToStart(): void; + deleteFromDocument(): void; + removeRange(range: Range): void; +} +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; +} +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; +} + +interface MSDataBindingRecordSetReadonlyExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface CSSStyleRule extends CSSRule { + selectorText: string; + style: MSStyleCSSProperties; + readOnly: boolean; +} +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface NodeIterator { + whatToShow: number; + filter: NodeFilter; + root: Node; + expandEntityReferences: boolean; + nextNode(): Node; + detach(): void; + previousNode(): Node; +} +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { + viewTarget: SVGStringList; +} +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; +} +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getTransformToElement(element: SVGElement): SVGMatrix; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; +} +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { +} +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface ControlRangeCollection { + length: number; + queryCommandValue(cmdID: string): any; + remove(index: number): void; + add(item: Element): void; + queryCommandIndeterm(cmdID: string): boolean; + scrollIntoView(varargStart?: any): void; + item(index: number): Element; + [index: number]: Element; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + addElement(item: Element): void; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandEnabled(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + select(): void; +} +declare var ControlRangeCollection: { + prototype: ControlRangeCollection; + new(): ControlRangeCollection; +} + +interface MSNamespaceInfo extends MSEventAttachmentTarget { + urn: string; + onreadystatechange: (ev: Event) => any; + name: string; + readyState: string; + doImport(implementationUrl: string): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSNamespaceInfo: { + prototype: MSNamespaceInfo; + new(): MSNamespaceInfo; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; +} +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; +} +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { + type: string; +} +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface SVGFitToViewBox { + viewBox: SVGAnimatedRect; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} + +interface SVGPointList { + numberOfItems: number; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; + getItem(index: number): SVGPoint; + clear(): void; + appendItem(newItem: SVGPoint): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + removeItem(index: number): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; +} +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface MSSiteModeEvent extends Event { + buttonID: number; + actionURL: string; +} +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface DOML2DeprecatedTextFlowControl { + clear: string; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface MSCSSProperties extends CSSStyleDeclaration { + scrollbarShadowColor: string; + scrollbarHighlightColor: string; + layoutGridChar: string; + layoutGridType: string; + textAutospace: string; + textKashidaSpace: string; + writingMode: string; + scrollbarFaceColor: string; + backgroundPositionY: string; + lineBreak: string; + imeMode: string; + msBlockProgression: string; + layoutGridLine: string; + scrollbarBaseColor: string; + layoutGrid: string; + layoutFlow: string; + textKashida: string; + filter: string; + zoom: string; + scrollbarArrowColor: string; + behavior: string; + backgroundPositionX: string; + accelerator: string; + layoutGridMode: string; + textJustifyTrim: string; + scrollbar3dLightColor: string; + msInterpolationMode: string; + scrollbarTrackColor: string; + scrollbarDarkShadowColor: string; + styleFloat: string; + getAttribute(attributeName: string, flags?: number): any; + setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; + removeAttribute(attributeName: string, flags?: number): boolean; +} +declare var MSCSSProperties: { + prototype: MSCSSProperties; + new(): MSCSSProperties; +} + +interface HTMLCollection extends MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Contains the hypertext reference (HREF) of the URL. + */ + href: string; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + crossOrigin: string; + msPlayToPreferredSourceUri: string; +} +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface SVGAngle { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; +} + +interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; + msKeySystem: string; +} +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface KeyboardEvent extends UIEvent { + location: number; + keyCode: number; + shiftKey: boolean; + which: number; + locale: string; + key: string; + altKey: boolean; + metaKey: boolean; + char: string; + ctrlKey: boolean; + repeat: boolean; + charCode: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(): KeyboardEvent; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_MOBILE: number; +} + +interface MessageEvent extends Event { + source: Window; + origin: string; + data: any; + ports: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface SVGElement extends Element { + onmouseover: (ev: MouseEvent) => any; + viewportElement: SVGElement; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onfocusin: (ev: FocusEvent) => any; + xmlbase: string; + onmousedown: (ev: MouseEvent) => any; + onload: (ev: Event) => any; + onmouseup: (ev: MouseEvent) => any; + onclick: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + id: string; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface HTMLScriptElement extends HTMLElement { + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + async: boolean; +} +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLElement; +} +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface CanvasRenderingContext2D { + miterLimit: number; + font: string; + globalCompositeOperation: string; + msFillRule: string; + lineCap: string; + msImageSmoothingEnabled: boolean; + lineDashOffset: number; + shadowColor: string; + lineJoin: string; + shadowOffsetX: number; + lineWidth: number; + canvas: HTMLCanvasElement; + strokeStyle: any; + globalAlpha: number; + shadowOffsetY: number; + fillStyle: any; + shadowBlur: number; + textAlign: string; + textBaseline: string; + restore(): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + save(): void; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + measureText(text: string): TextMetrics; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + rotate(angle: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + translate(x: number, y: number): void; + scale(x: number, y: number): void; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + lineTo(x: number, y: number): void; + getLineDash(): number[]; + fill(fillRule?: string): void; + createImageData(imageDataOrSw: any, sh?: number): ImageData; + createPattern(image: HTMLElement, repetition: string): CanvasPattern; + closePath(): void; + rect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + clearRect(x: number, y: number, w: number, h: number): void; + moveTo(x: number, y: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + fillRect(x: number, y: number, w: number, h: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + setLineDash(segments: number[]): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + beginPath(): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; +} +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface MSCSSRuleList { + length: number; + item(index?: number): CSSStyleRule; + [index: number]: CSSStyleRule; +} +declare var MSCSSRuleList: { + prototype: MSCSSRuleList; + new(): MSCSSRuleList; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGTransformList { + numberOfItems: number; + getItem(index: number): SVGTransform; + consolidate(): SVGTransform; + clear(): void; + appendItem(newItem: SVGTransform): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + removeItem(index: number): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; +} +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedPoints { + points: SVGPointList; + animatedPoints: SVGPointList; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface CSSMediaRule extends CSSRule { + media: MediaList; + cssRules: CSSRuleList; + insertRule(rule: string, index?: number): number; + deleteRule(index?: number): void; +} +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface WindowModal { + dialogArguments: any; + returnValue: any; +} + +interface XMLHttpRequest extends EventTarget { + responseBody: any; + status: number; + readyState: number; + responseText: string; + responseXML: any; + ontimeout: (ev: Event) => any; + statusText: string; + onreadystatechange: (ev: Event) => any; + timeout: number; + onload: (ev: Event) => any; + response: any; + withCredentials: boolean; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + onloadstart: (ev: Event) => any; + msCaching: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + overrideMimeType(mime: string): void; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + create(): XMLHttpRequest; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { +} +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface MSDataBindingExtensions { + dataSrc: string; + dataFormatAs: string; + dataFld: string; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + ry: SVGAnimatedLength; + cx: SVGAnimatedLength; + rx: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; +} +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface HTMLFrameSetElement extends HTMLElement { + ononline: (ev: Event) => any; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + onerror: (ev: ErrorEvent) => any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + onresize: (ev: UIEvent) => any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + border: string; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onstorage: (ev: StorageEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface Screen extends EventTarget { + width: number; + deviceXDPI: number; + fontSmoothingEnabled: boolean; + bufferDepth: number; + logicalXDPI: number; + systemXDPI: number; + availHeight: number; + height: number; + logicalYDPI: number; + systemYDPI: number; + updateInterval: number; + colorDepth: number; + availWidth: number; + deviceYDPI: number; + pixelDepth: number; + msOrientation: string; + onmsorientationchange: (ev: any) => any; + msLockOrientation(orientation: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface Coordinates { + altitudeAccuracy: number; + longitude: number; + latitude: number; + speed: number; + heading: number; + altitude: number; + accuracy: number; +} +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorContentUtils { +} + +interface EventListener { + (evt: Event): void; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface DataTransfer { + effectAllowed: string; + dropEffect: string; + types: DOMStringList; + files: FileList; + clearData(format?: string): boolean; + setData(format: string, data: string): boolean; + getData(format: string): string; +} +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} +declare var FocusEvent: { + prototype: FocusEvent; + new(): FocusEvent; +} + +interface Range { + startOffset: number; + collapsed: boolean; + endOffset: number; + startContainer: Node; + endContainer: Node; + commonAncestorContainer: Node; + setStart(refNode: Node, offset: number): void; + setEndBefore(refNode: Node): void; + setStartBefore(refNode: Node): void; + selectNode(refNode: Node): void; + detach(): void; + getBoundingClientRect(): ClientRect; + toString(): string; + compareBoundaryPoints(how: number, sourceRange: Range): number; + insertNode(newNode: Node): void; + collapse(toStart: boolean): void; + selectNodeContents(refNode: Node): void; + cloneContents(): DocumentFragment; + setEnd(refNode: Node, offset: number): void; + cloneRange(): Range; + getClientRects(): ClientRectList; + surroundContents(newParent: Node): void; + deleteContents(): void; + setStartAfter(refNode: Node): void; + extractContents(): DocumentFragment; + setEndAfter(refNode: Node): void; + createContextualFragment(fragment: string): DocumentFragment; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + START_TO_START: number; + START_TO_END: number; + END_TO_START: number; +} + +interface SVGPoint { + y: number; + x: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { + width: SVGAnimatedLength; + x: SVGAnimatedLength; + contentStyleType: string; + onzoom: (ev: any) => any; + y: SVGAnimatedLength; + viewport: SVGRect; + onerror: (ev: ErrorEvent) => any; + pixelUnitToMillimeterY: number; + onresize: (ev: UIEvent) => any; + screenPixelToMillimeterY: number; + height: SVGAnimatedLength; + onabort: (ev: UIEvent) => any; + contentScriptType: string; + pixelUnitToMillimeterX: number; + currentTranslate: SVGPoint; + onunload: (ev: Event) => any; + currentScale: number; + onscroll: (ev: UIEvent) => any; + screenPixelToMillimeterX: number; + setCurrentTime(seconds: number): void; + createSVGLength(): SVGLength; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + unpauseAnimations(): void; + createSVGRect(): SVGRect; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + unsuspendRedrawAll(): void; + pauseAnimations(): void; + suspendRedraw(maxWaitMilliseconds: number): number; + deselectAll(): void; + createSVGAngle(): SVGAngle; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + createSVGTransform(): SVGTransform; + unsuspendRedraw(suspendHandleID: number): void; + forceRedraw(): void; + getCurrentTime(): number; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + createSVGMatrix(): SVGMatrix; + createSVGPoint(): SVGPoint; + createSVGNumber(): SVGNumber; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getElementById(elementId: string): Element; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface MSResourceMetadata { + protocol: string; + fileSize: string; + fileUpdatedDate: string; + nameProp: string; + fileCreatedDate: string; + fileModifiedDate: string; + mimeType: string; +} + +interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { +} +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface MSStorageExtensions { + remainingSpace: number; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + type: string; + title: string; +} +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface MSCurrentStyleCSSProperties extends MSCSSProperties { + blockDirection: string; + clipBottom: string; + clipLeft: string; + clipRight: string; + clipTop: string; + hasLayout: string; +} +declare var MSCurrentStyleCSSProperties: { + prototype: MSCurrentStyleCSSProperties; + new(): MSCurrentStyleCSSProperties; +} + +interface MSHTMLCollectionExtensions { + urns(urn: any): any; + tags(tagName: any): any; +} + +interface Storage extends MSStorageExtensions { + length: number; + getItem(key: string): any; + [key: string]: any; + setItem(key: string, data: string): void; + clear(): void; + removeItem(key: string): void; + key(index: number): string; + [index: number]: string; +} +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + scroll: string; + ononline: (ev: Event) => any; + onblur: (ev: FocusEvent) => any; + noWrap: boolean; + onfocus: (ev: FocusEvent) => any; + onmessage: (ev: MessageEvent) => any; + text: any; + onerror: (ev: ErrorEvent) => any; + bgProperties: string; + onresize: (ev: UIEvent) => any; + link: any; + aLink: any; + bottomMargin: any; + topMargin: any; + onafterprint: (ev: Event) => any; + vLink: any; + onbeforeprint: (ev: Event) => any; + onoffline: (ev: Event) => any; + onunload: (ev: Event) => any; + onhashchange: (ev: Event) => any; + onload: (ev: Event) => any; + rightMargin: any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + leftMargin: any; + onstorage: (ev: StorageEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpagehide: (ev: PageTransitionEvent) => any; + createTextRange(): TextRange; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface DocumentType extends Node { + name: string; + notations: NamedNodeMap; + systemId: string; + internalSubset: string; + entities: NamedNodeMap; + publicId: string; +} +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; +} +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface MutationEvent extends Event { + newValue: string; + attrChange: number; + attrName: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + MODIFICATION: number; + REMOVAL: number; + ADDITION: number; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Moves a table row to a new position. + * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. + * @param indexTo Number that specifies where the row is moved within the rows collection. + */ + moveRow(indexFrom?: number, indexTo?: number): any; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface DOML2DeprecatedListNumberingAndBulletStyle { + type: string; +} + +interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + status: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + indeterminate: boolean; + readOnly: boolean; + size: number; + loop: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. + */ + vrml: string; + /** + * Sets or retrieves a lower resolution image to display. + */ + lowsrc: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + dynsrc: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + start: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + Methods: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + protocolLong: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + nameProp: string; + urn: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + type: string; + mimeType: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface PerformanceTiming { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + msFirstPaint: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + toJSON(): any; +} +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; +} +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface EventException { + code: number; + message: string; + name: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface MSNavigatorDoNotTrack { + msDoNotTrack: string; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface SVGMetadataElement extends SVGElement { +} +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + y: number; + sweepFlag: boolean; + r2: number; + x: number; + angle: number; + r1: number; + largeArcFlag: boolean; +} +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGStringList { + numberOfItems: number; + replaceItem(newItem: string, index: number): string; + getItem(index: number): string; + clear(): void; + appendItem(newItem: string): string; + initialize(newItem: string): string; + removeItem(index: number): string; + insertItemBefore(newItem: string, index: number): string; +} +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface XDomainRequest { + timeout: number; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: Event) => any; + responseText: string; + contentType: string; + open(method: string, url: string): void; + abort(): void; + send(data?: any): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XDomainRequest: { + prototype: XDomainRequest; + new(): XDomainRequest; + create(): XDomainRequest; +} + +interface DOML2DeprecatedBackgroundColorStyle { + bgColor: any; +} + +interface ElementTraversal { + childElementCount: number; + previousElementSibling: Element; + lastElementChild: Element; + nextElementSibling: Element; + firstElementChild: Element; +} + +interface SVGLength { + valueAsString: string; + valueInSpecifiedUnits: number; + value: number; + unitType: number; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + convertToSpecifiedUnits(unitType: number): void; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; + SVG_LENGTHTYPE_EXS: number; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface NavigatorStorageUtils { +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + textLength: SVGAnimatedLength; + lengthAdjust: SVGAnimatedEnumeration; + getCharNumAtPosition(point: SVGPoint): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getComputedTextLength(): number; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getEndPositionOfChar(charnum: number): SVGPoint; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface Location { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + reload(flag?: boolean): void; + replace(url: string): void; + assign(url: string): void; + toString(): string; +} +declare var Location: { + prototype: Location; + new(): Location; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; +} +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; +} +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface PerformanceEntry { + name: string; + startTime: number; + duration: number; + entryType: string; +} +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface SVGTransform { + type: number; + angle: number; + matrix: SVGMatrix; + setTranslate(tx: number, ty: number): void; + setScale(sx: number, sy: number): void; + setMatrix(matrix: SVGMatrix): void; + setSkewY(angle: number): void; + setRotate(angle: number, cx: number, cy: number): void; + setSkewX(angle: number): void; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_UNKNOWN: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SKEWY: number; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} +declare var UIEvent: { + prototype: UIEvent; + new(): UIEvent; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_MOVETO_REL: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_UNKNOWN: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_ARC_ABS: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; +} + +interface WheelEvent extends MouseEvent { + deltaZ: number; + deltaX: number; + deltaMode: number; + deltaY: number; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + getCurrentPoint(element: Element): void; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} +declare var WheelEvent: { + prototype: WheelEvent; + new(): WheelEvent; + DOM_DELTA_PIXEL: number; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; +} + +interface MSEventAttachmentTarget { + attachEvent(event: string, listener: EventListener): boolean; + detachEvent(event: string, listener: EventListener): void; +} + +interface SVGNumber { + value: number; +} +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + getTotalLength(): number; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; +} +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface MSCompatibleInfo { + version: string; + userAgent: string; +} +declare var MSCompatibleInfo: { + prototype: MSCompatibleInfo; + new(): MSCompatibleInfo; +} + +interface Text extends CharacterData, MSNodeExtensions { + wholeText: string; + splitText(offset: number): Text; + replaceWholeText(content: string): Text; +} +declare var Text: { + prototype: Text; + new(): Text; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface SVGPathSegList { + numberOfItems: number; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; + getItem(index: number): SVGPathSeg; + clear(): void; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; +} +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { +} +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface MSImageResourceExtensions { + dynsrc: string; + vrml: string; + lowsrc: string; + start: string; + loop: number; +} + +interface PositionError { + code: number; + message: string; + toString(): string; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + POSITION_UNAVAILABLE: number; + PERMISSION_DENIED: number; + TIMEOUT: number; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + cellIndex: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorLight: any; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + */ + borderColorDark: any; +} +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface SVGElementInstance extends EventTarget { + previousSibling: SVGElementInstance; + parentNode: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + childNodes: SVGElementInstanceList; + correspondingUseElement: SVGUseElement; + correspondingElement: SVGElement; + firstChild: SVGElementInstance; +} +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface MSNamespaceInfoCollection { + length: number; + add(namespace?: string, urn?: string, implementationUrl?: any): any; + item(index: any): any; + // [index: any]: any; +} +declare var MSNamespaceInfoCollection: { + prototype: MSNamespaceInfoCollection; + new(): MSNamespaceInfoCollection; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + r: SVGAnimatedLength; + cy: SVGAnimatedLength; +} +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface CSSImportRule extends CSSRule { + styleSheet: CSSStyleSheet; + href: string; + media: MediaList; +} +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} +declare var CustomEvent: { + prototype: CustomEvent; + new(): CustomEvent; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; +} +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface DOML2DeprecatedMarginStyle { + vspace: number; + hspace: number; +} + +interface MSWindowModeless { + dialogTop: any; + dialogLeft: any; + dialogWidth: any; + dialogHeight: any; + menuArguments: any; +} + +interface DOML2DeprecatedAlignmentStyle { + align: string; +} + +interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { + width: string; + onbounce: (ev: Event) => any; + vspace: number; + trueSpeed: boolean; + scrollAmount: number; + scrollDelay: number; + behavior: string; + height: string; + loop: number; + direction: string; + hspace: number; + onstart: (ev: Event) => any; + onfinish: (ev: Event) => any; + stop(): void; + start(): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface SVGRect { + y: number; + width: number; + x: number; + height: number; +} +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface MSNodeExtensions { + swapNode(otherNode: Node): Node; + removeNode(deep?: boolean): Node; + replaceNode(replacement: Node): Node; +} + +interface History { + length: number; + state: any; + back(distance?: any): void; + forward(distance?: any): void; + go(delta?: any): void; + replaceState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title: string, url?: string): void; +} +declare var History: { + prototype: History; + new(): History; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + y: number; + y1: number; + x2: number; + x: number; + x1: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + y: number; + y1: number; + x: number; + x1: number; +} +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface TimeRanges { + length: number; + start(index: number): number; + end(index: number): number; +} +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface CSSRule { + cssText: string; + parentStyleSheet: CSSStyleSheet; + parentRule: CSSRule; + type: number; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + IMPORT_RULE: number; + MEDIA_RULE: number; + STYLE_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + UNKNOWN_RULE: number; + FONT_FACE_RULE: number; + CHARSET_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + VIEWPORT_RULE: number; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; + /** + * Sets or retrieves reference information about the object. + */ + cite: string; +} +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface SVGMatrix { + e: number; + c: number; + a: number; + b: number; + d: number; + f: number; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + flipY(): SVGMatrix; + skewY(angle: number): SVGMatrix; + inverse(): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + rotate(angle: number): SVGMatrix; + flipX(): SVGMatrix; + translate(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + skewX(angle: number): SVGMatrix; +} +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface MSPopupWindow { + document: Document; + isOpen: boolean; + show(x: number, y: number, w: number, h: number, element?: any): void; + hide(): void; +} +declare var MSPopupWindow: { + prototype: MSPopupWindow; + new(): MSPopupWindow; +} + +interface BeforeUnloadEvent extends Event { + returnValue: string; +} +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + animatedInstanceRoot: SVGElementInstance; + instanceRoot: SVGElementInstance; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface Event { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + cancelBubble: boolean; + target: EventTarget; + eventPhase: number; + cancelable: boolean; + type: string; + srcElement: Element; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the width of the object. + */ + width: any; + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; +} +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface SVGException { + code: number; + message: string; + name: string; + toString(): string; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} +declare var SVGException: { + prototype: SVGException; + new(): SVGException; + SVG_MATRIX_NOT_INVERTABLE: number; + SVG_WRONG_TYPE_ERR: number; + SVG_INVALID_VALUE_ERR: number; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + y1: SVGAnimatedLength; + x2: SVGAnimatedLength; + x1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { +} +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + ry: SVGAnimatedLength; + rx: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface ErrorEventHandler { + (event: Event, source: string, fileno: number, columnNumber: number): void; +} + +interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface DOML2DeprecatedBorderStyle { + border: string; +} + +interface NamedNodeMap { + length: number; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + [index: number]: Attr; + removeNamedItem(name: string): Attr; + getNamedItem(name: string): Attr; + // [name: string]: Attr; + setNamedItem(arg: Attr): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItemNS(arg: Attr): Attr; +} +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface MediaList { + length: number; + mediaText: string; + deleteMedium(oldMedium: string): void; + appendMedium(newMedium: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + y: number; + x2: number; + x: number; + y2: number; +} +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGLengthList { + numberOfItems: number; + replaceItem(newItem: SVGLength, index: number): SVGLength; + getItem(index: number): SVGLength; + clear(): void; + appendItem(newItem: SVGLength): SVGLength; + initialize(newItem: SVGLength): SVGLength; + removeItem(index: number): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; +} +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface ProcessingInstruction extends Node { + target: string; + data: string; +} +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface MSWindowExtensions { + status: string; + onmouseleave: (ev: MouseEvent) => any; + screenLeft: number; + offscreenBuffering: any; + maxConnectionsPerServer: number; + onmouseenter: (ev: MouseEvent) => any; + clipboardData: DataTransfer; + defaultStatus: string; + clientInformation: Navigator; + closed: boolean; + onhelp: (ev: Event) => any; + external: External; + event: MSEventObj; + onfocusout: (ev: FocusEvent) => any; + screenTop: number; + onfocusin: (ev: FocusEvent) => any; + showModelessDialog(url?: string, argument?: any, options?: any): Window; + navigate(url: string): void; + resizeBy(x?: number, y?: number): void; + item(index: any): any; + resizeTo(x?: number, y?: number): void; + createPopup(arguments?: any): MSPopupWindow; + toStaticHTML(html: string): string; + execScript(code: string, language?: string): any; + msWriteProfilerMark(profilerMarkName: string): void; + moveTo(x?: number, y?: number): void; + moveBy(x?: number, y?: number): void; + showHelp(url: string, helpArg?: any, features?: string): void; + captureEvents(): void; + releaseEvents(): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSBehaviorUrnsCollection { + length: number; + item(index: number): string; +} +declare var MSBehaviorUrnsCollection: { + prototype: MSBehaviorUrnsCollection; + new(): MSBehaviorUrnsCollection; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface DOML2DeprecatedBackgroundStyle { + background: string; +} + +interface TextEvent extends UIEvent { + inputMethod: number; + data: string; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_VOICE: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_MULTIMODAL: number; +} + +interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { +} +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface Position { + timestamp: Date; + coords: Coordinates; +} +declare var Position: { + prototype: Position; + new(): Position; +} + +interface BookmarkCollection { + length: number; + item(index: number): any; + [index: number]: any; +} +declare var BookmarkCollection: { + prototype: BookmarkCollection; + new(): BookmarkCollection; +} + +interface PerformanceMark extends PerformanceEntry { +} +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selectorText: string; + selector: string; + style: CSSStyleDeclaration; +} +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface MSNavigatorExtensions { + userLanguage: string; + plugins: MSPluginsCollection; + cookieEnabled: boolean; + appCodeName: string; + cpuClass: string; + appMinorVersion: string; + connectionSpeed: number; + browserLanguage: string; + mimeTypes: MSMimeTypesCollection; + systemLanguage: string; + language: string; + javaEnabled(): boolean; + taintEnabled(): boolean; +} + +interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { +} +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; +} +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + [name: string]: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; +} +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface SVGZoomAndPan { + zoomAndPan: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; + SVG_ZOOMANDPAN_DISABLE: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface HTMLMediaElement extends HTMLElement { + /** + * Gets the earliest possible position, in seconds, that the playback can begin. + */ + initialTime: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + readyState: any; + /** + * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. + */ + autobuffer: boolean; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + /** + * Gets the current network activity for the element. + */ + networkState: number; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + textTracks: TextTrackList; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_METADATA: number; + HAVE_CURRENT_DATA: number; + HAVE_NOTHING: number; + NETWORK_NO_SOURCE: number; + HAVE_ENOUGH_DATA: number; + NETWORK_EMPTY: number; + NETWORK_LOADING: number; + NETWORK_IDLE: number; + HAVE_FUTURE_DATA: number; +} + +interface ElementCSSInlineStyle { + runtimeStyle: MSStyleCSSProperties; + currentStyle: MSCurrentStyleCSSProperties; + doScroll(component?: any): void; + componentFromPoint(x: number, y: number): string; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface MSMimeTypesCollection { + length: number; +} +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface StyleSheet { + disabled: boolean; + ownerNode: Node; + parentStyleSheet: StyleSheet; + href: string; + media: MediaList; + type: string; + title: string; +} +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + startOffset: SVGAnimatedLength; + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_METHODTYPE_ALIGN: number; +} + +interface HTMLDTElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface PerformanceMeasure extends PerformanceEntry { +} +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { + spreadMethod: SVGAnimatedEnumeration; + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_UNKNOWN: number; + SVG_SPREADMETHOD_REPEAT: number; +} + +interface NodeFilter { + acceptNode(n: Node): number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_ENTITY: number; + SHOW_DOCUMENT: number; + SHOW_PROCESSING_INSTRUCTION: number; + FILTER_REJECT: number; + SHOW_CDATA_SECTION: number; + FILTER_ACCEPT: number; + SHOW_ALL: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_TEXT: number; + SHOW_ELEMENT: number; + SHOW_COMMENT: number; + FILTER_SKIP: number; + SHOW_ATTRIBUTE: number; + SHOW_DOCUMENT_FRAGMENT: number; +} +declare var NodeFilter: NodeFilter; + +interface SVGNumberList { + numberOfItems: number; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; + getItem(index: number): SVGNumber; + clear(): void; + appendItem(newItem: SVGNumber): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + removeItem(index: number): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; +} +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MEDIA_ERR_DECODE: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLBGSoundElement extends HTMLElement { + /** + * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. + */ + balance: any; + /** + * Sets or gets the volume setting for the sound. + */ + volume: any; + /** + * Sets or gets the URL of a sound to play. + */ + src: string; + /** + * Sets or retrieves the number of times a sound or video clip will loop when activated. + */ + loop: number; +} +declare var HTMLBGSoundElement: { + prototype: HTMLBGSoundElement; + new(): HTMLBGSoundElement; +} + +interface Comment extends CharacterData { + text: string; +} +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + redirectStart: number; + redirectEnd: number; + domainLookupEnd: number; + responseStart: number; + domainLookupStart: number; + fetchStart: number; + requestStart: number; + connectEnd: number; + connectStart: number; + initiatorType: string; + responseEnd: number; +} +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface CanvasPattern { +} +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the width of the object. + */ + width: number; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; +} +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the contained object. + */ + object: any; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the class identifier for the object. + */ + classid: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + declare: boolean; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: number; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Retrieves the palette used for the embedded document. + */ + palette: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + hidden: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + readyState: string; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; +} +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface StorageEvent extends Event { + oldValue: any; + newValue: any; + url: string; + storageArea: Storage; + key: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface CharacterData extends Node { + length: number; + data: string; + deleteData(offset: number, count: number): void; + replaceData(offset: number, count: number, arg: string): void; + appendData(arg: string): void; + insertData(offset: number, arg: string): void; + substringData(offset: number, count: number): string; +} +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; +} +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + prompt: string; +} +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + y: number; + x: number; +} +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface MSCompatibleInfoCollection { + length: number; + item(index: number): MSCompatibleInfo; +} +declare var MSCompatibleInfoCollection: { + prototype: MSCompatibleInfoCollection; + new(): MSCompatibleInfoCollection; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { +} +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; + SVG_MEETORSLICE_MEET: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_MEETORSLICE_SLICE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +} + +interface Attr extends Node { + expando: boolean; + specified: boolean; + ownerElement: Element; + value: string; + name: string; +} +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_RELOAD: number; + TYPE_RESERVED: number; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; +} +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface PositionCallback { + (position: Position): void; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { +} +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface MSDataBindingRecordSetExtensions { + recordset: any; + namedRecordset(dataMember: string, hierarchy?: any): any; +} + +interface LinkStyle { + styleSheet: StyleSheet; + sheet: StyleSheet; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the width of the video element. + */ + width: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets or sets the height of the video element. + */ + height: number; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + onMSVideoOptimalLayoutChanged: (ev: any) => any; + onMSVideoFrameStepCompleted: (ev: any) => any; + msStereo3DRenderMode: string; + msIsLayoutOptimalForPlayback: boolean; + msHorizontalMirror: boolean; + onMSVideoFormatChanged: (ev: any) => any; + msZoom: boolean; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + msFrameStep(forward: boolean): void; + getVideoPlaybackQuality(): VideoPlaybackQuality; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + maskUnits: SVGAnimatedEnumeration; + maskContentUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; +} +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface External { +} +declare var External: { + prototype: External; + new(): External; +} + +interface MSGestureEvent extends UIEvent { + offsetY: number; + translationY: number; + velocityExpansion: number; + velocityY: number; + velocityAngular: number; + translationX: number; + velocityX: number; + hwTimestamp: number; + offsetX: number; + screenX: number; + rotation: number; + expansion: number; + clientY: number; + screenY: number; + scale: number; + gestureObject: any; + clientX: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + error: any; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + filterResX: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + primitiveUnits: SVGAnimatedEnumeration; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + filterResY: SVGAnimatedInteger; + setFilterRes(filterResX: number, filterResY: number): void; +} +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface TrackEvent extends Event { + track: any; +} +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface TextTrackCue extends EventTarget { + onenter: (ev: Event) => any; + track: TextTrack; + endTime: number; + text: string; + pauseOnExit: boolean; + id: string; + startTime: number; + onexit: (ev: Event) => any; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface DOMTokenList { + length: number; + contains(token: string): boolean; + remove(token: string): void; + toggle(token: string): boolean; + add(token: string): void; + item(index: number): string; + [index: number]: string; + toString(): string; +} +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_LIGHTEN: number; +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +} +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface TransitionEvent extends Event { + propertyName: string; + elapsedTime: number; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface MediaQueryList { + matches: boolean; + media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + extensions: string; + onmessage: (ev: MessageEvent) => any; + onclose: (ev: CloseEvent) => any; + onerror: (ev: ErrorEvent) => any; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface SVGFEPointLightElement extends SVGElement { + y: SVGAnimatedNumber; + x: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + stdDeviationX: SVGAnimatedNumber; + in1: SVGAnimatedString; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; +} +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + y: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + height: SVGAnimatedLength; + result: SVGAnimatedString; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; +} +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface URL { + revokeObjectURL(url: string): void; + createObjectURL(object: any, options?: ObjectURLOptions): string; +} +declare var URL: URL; + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + ontimeout: (ev: Event) => any; + onabort: (ev: UIEvent) => any; + onloadstart: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface IDBEnvironment { + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; +} + +interface AudioTrackList extends EventTarget { + length: number; + onchange: (ev: Event) => any; + onaddtrack: (ev: TrackEvent) => any; + onremovetrack: (ev: any /*PluginArray*/) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + [index: number]: AudioTrack; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + readyState: number; + onabort: (ev: UIEvent) => any; + onloadend: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onloadstart: (ev: Event) => any; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface WindowTimersExtension { + msSetImmediate(expression: any, ...args: any[]): number; + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + setImmediate(expression: any, ...args: any[]): number; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in2: SVGAnimatedString; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + scale: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_B: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_UNKNOWN: number; + SVG_CHANNEL_A: number; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + tableValues: SVGAnimatedNumberList; + slope: SVGAnimatedNumber; + type: SVGAnimatedEnumeration; + exponent: SVGAnimatedNumber; + amplitude: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; +} + +interface AudioTrack { + kind: string; + language: string; + id: string; + label: string; + enabled: boolean; + sourceBuffer: SourceBuffer; +} +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + orderY: SVGAnimatedInteger; + kernelUnitLengthY: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + kernelMatrix: SVGAnimatedNumberList; + edgeMode: SVGAnimatedEnumeration; + kernelUnitLengthX: SVGAnimatedNumber; + bias: SVGAnimatedNumber; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + divisor: SVGAnimatedNumber; + in1: SVGAnimatedString; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_WRAP: number; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_NONE: number; +} + +interface TextTrackCueList { + length: number; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; + getCueById(id: string): TextTrackCue; +} +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface CSSKeyframesRule extends CSSRule { + name: string; + cssRules: CSSRuleList; + findRule(rule: string): CSSKeyframeRule; + deleteRule(rule: string): void; + appendRule(rule: string): void; +} +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + type: SVGAnimatedEnumeration; + baseFrequencyY: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + seed: SVGAnimatedNumber; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_STITCHTYPE_STITCH: number; +} + +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + [index: number]: TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; +} + +interface SVGFESpotLightElement extends SVGElement { + pointsAtY: SVGAnimatedNumber; + y: SVGAnimatedNumber; + limitingConeAngle: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + z: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; +} +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: UIEvent) => any; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + onblocked: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface MSLaunchUriCallback { + (): void; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + dx: SVGAnimatedNumber; +} +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface TextTrack extends EventTarget { + language: string; + mode: any; + readyState: number; + activeCues: TextTrackCueList; + cues: TextTrackCueList; + oncuechange: (ev: Event) => any; + kind: string; + onload: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + label: string; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + ERROR: number; + SHOWING: number; + LOADING: number; + LOADED: number; + NONE: number; + HIDDEN: number; + DISABLED: number; +} + +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + readyState: string; + result: any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new(): Blob; +} + +interface ApplicationCache extends EventTarget { + status: number; + ondownloading: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onupdateready: (ev: Event) => any; + oncached: (ev: Event) => any; + onobsolete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onchecking: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + swapCache(): void; + abort(): void; + update(): void; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + UNCACHED: number; + UPDATEREADY: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; +} + +interface FrameRequestCallback { + (time: number): void; +} + +interface PopStateEvent extends Event { + state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} +declare var PopStateEvent: { + prototype: PopStateEvent; + new(): PopStateEvent; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface MSPointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(): MSPointerEvent; + MSPOINTER_TYPE_PEN: number; + MSPOINTER_TYPE_MOUSE: number; + MSPOINTER_TYPE_TOUCH: number; +} + +interface MSManipulationEvent extends UIEvent { + lastState: number; + currentState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_STOPPED: number; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_CANCELLED: number; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; +} +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; +} +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + operator: SVGAnimatedEnumeration; + in2: SVGAnimatedString; + k2: SVGAnimatedNumber; + k1: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + in1: SVGAnimatedString; + k4: SVGAnimatedNumber; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; +} + +interface ValidityState { + customError: boolean; + valueMissing: boolean; + stepMismatch: boolean; + rangeUnderflow: boolean; + rangeOverflow: boolean; + typeMismatch: boolean; + patternMismatch: boolean; + tooLong: boolean; + valid: boolean; +} +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface HTMLTrackElement extends HTMLElement { + kind: string; + src: string; + srclang: string; + track: TextTrack; + label: string; + default: boolean; + readyState: number; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADING: number; + LOADED: number; + NONE: number; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; + getViewOpener(): MSAppView; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + createNewView(uri: string): MSAppView; + getCurrentPriority(): string; + NORMAL: string; + HIGH: string; + IDLE: string; + CURRENT: string; +} +declare var MSApp: MSApp; + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; +} +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + diffuseConstant: SVGAnimatedNumber; +} +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface MSCSSMatrix { + m24: number; + m34: number; + a: number; + d: number; + m32: number; + m41: number; + m11: number; + f: number; + e: number; + m23: number; + m14: number; + m33: number; + m22: number; + m21: number; + c: number; + m12: number; + b: number; + m42: number; + m31: number; + m43: number; + m13: number; + m44: number; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + setMatrixValue(value: string): void; + inverse(): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + toString(): string; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + translate(x: number, y: number, z?: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + skewX(angle: number): MSCSSMatrix; +} +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; +} + +interface Worker extends AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} + +interface MSGraphicsTrust { + status: string; + constrictionActive: boolean; +} +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface SubtleCrypto { + unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; + encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; + verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; + deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; + exportKey(format: string, key: Key): KeyOperation; + generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; + sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; + decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; +} +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Crypto extends RandomSource { + subtle: SubtleCrypto; +} +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface VideoPlaybackQuality { + totalFrameDelay: number; + creationTime: number; + totalVideoFrames: number; + droppedVideoFrames: number; +} +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface GlobalEventHandlers { + onpointerenter: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onpointercancel: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface Key { + algorithm: Algorithm; + type: string; + extractable: boolean; + keyUsage: string[]; +} +declare var Key: { + prototype: Key; + new(): Key; +} + +interface DeviceAcceleration { + y: number; + x: number; + z: number; +} +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; + // [name: string]: Element; +} +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface AesGcmEncryptResult { + ciphertext: ArrayBuffer; + tag: ArrayBuffer; +} +declare var AesGcmEncryptResult: { + prototype: AesGcmEncryptResult; + new(): AesGcmEncryptResult; +} + +interface NavigationCompletedEvent extends NavigationEvent { + webErrorStatus: number; + isSuccess: boolean; +} +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface MutationRecord { + oldValue: string; + previousSibling: Node; + addedNodes: NodeList; + attributeName: string; + removedNodes: NodeList; + target: Node; + nextSibling: Node; + attributeNamespace: string; + type: string; +} +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(type: string): Plugin; + // [type: string]: Plugin; +} +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface KeyOperation extends EventTarget { + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + result: any; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var KeyOperation: { + prototype: KeyOperation; + new(): KeyOperation; +} + +interface DOMStringMap { +} +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DeviceOrientationEvent extends Event { + gamma: number; + alpha: number; + absolute: boolean; + beta: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSHTMLWebViewElement extends HTMLElement { + documentTitle: string; + width: number; + src: string; + canGoForward: boolean; + height: number; + canGoBack: boolean; + navigateWithHttpRequestMessage(requestMessage: any): void; + goBack(): void; + navigate(uri: string): void; + stop(): void; + navigateToString(contents: string): void; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + refresh(): void; + goForward(): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; +} +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface NavigationEvent extends Event { + uri: string; +} +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SourceBuffer extends EventTarget { + updating: boolean; + appendWindowStart: number; + appendWindowEnd: number; + buffered: TimeRanges; + timestampOffset: number; + audioTracks: AudioTrackList; + appendBuffer(data: ArrayBuffer): void; + remove(start: number, end: number): void; + abort(): void; + appendStream(stream: MSStream, maxSize?: number): void; +} +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface MSInputMethodContext extends EventTarget { + oncandidatewindowshow: (ev: any) => any; + target: HTMLElement; + compositionStartOffset: number; + oncandidatewindowhide: (ev: any) => any; + oncandidatewindowupdate: (ev: any) => any; + compositionEndOffset: number; + getCompositionAlternatives(): string[]; + getCandidateWindowClientRect(): ClientRect; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface DeviceRotationRate { + gamma: number; + alpha: number; + beta: number; +} +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface PluginArray { + length: number; + refresh(reload?: boolean): void; + item(index: number): Plugin; + [index: number]: Plugin; + namedItem(name: string): Plugin; + // [name: string]: Plugin; +} +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface MSMediaKeyError { + systemCode: number; + code: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_UNKNOWN: number; + MS_MEDIA_KEYERR_CLIENT: number; +} + +interface Plugin { + length: number; + filename: string; + version: string; + name: string; + description: string; + item(index: number): MimeType; + [index: number]: MimeType; + namedItem(type: string): MimeType; + // [type: string]: MimeType; +} +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface MediaSource extends EventTarget { + sourceBuffers: SourceBufferList; + duration: number; + readyState: string; + activeSourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface SourceBufferList extends EventTarget { + length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface XMLDocument extends Document { +} +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface DeviceMotionEvent extends Event { + rotationRate: DeviceRotationRate; + acceleration: DeviceAcceleration; + interval: number; + accelerationIncludingGravity: DeviceAcceleration; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface MimeType { + enabledPlugin: Plugin; + suffixes: string; + type: string; + description: string; +} +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface PointerEvent extends MouseEvent { + width: number; + rotation: number; + pressure: number; + pointerType: any; + isPrimary: boolean; + tiltY: number; + height: number; + intermediatePoints: any; + currentPoint: any; + tiltX: number; + hwTimestamp: number; + pointerId: number; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; +} +declare var PointerEvent: { + prototype: PointerEvent; + new(): PointerEvent; +} + +interface MSDocumentExtensions { + captureEvents(): void; + releaseEvents(): void; +} + +interface MutationObserver { + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; + disconnect(): void; +} +declare var MutationObserver: { + prototype: MutationObserver; + new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +} + +interface MSWebViewAsyncOperation extends EventTarget { + target: MSHTMLWebViewElement; + oncomplete: (ev: Event) => any; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + readyState: number; + type: number; + result: any; + start(): void; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + ERROR: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + COMPLETED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + STARTED: number; +} + +interface ScriptNotifyEvent extends Event { + value: string; + callingUri: string; +} +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + redirectStart: number; + domainLookupEnd: number; + responseStart: number; + domComplete: number; + domainLookupStart: number; + loadEventStart: number; + unloadEventEnd: number; + fetchStart: number; + requestStart: number; + domInteractive: number; + navigationStart: number; + connectEnd: number; + loadEventEnd: number; + connectStart: number; + responseEnd: number; + domLoading: number; + redirectEnd: number; + redirectCount: number; + unloadEventStart: number; + domContentLoadedEventStart: number; + domContentLoadedEventEnd: number; + type: string; +} +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface LongRunningScriptDetectedEvent extends Event { + stopPageScriptExecution: boolean; + executionTime: number; +} +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSAppView { + viewId: number; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; +} +declare var MSAppView: { + prototype: MSAppView; + new(): MSAppView; +} + +interface PerfWidgetExternal { + maxCpuSpeed: number; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + performanceCounter: number; + averagePaintTime: number; + activeNetworkRequestCount: number; + paintRequestsPerSecond: number; + extraInformationEnabled: boolean; + performanceCounterFrequency: number; + averageFrameTime: number; + repositionWindow(x: number, y: number): void; + getRecentMemoryUsage(last: number): any; + getMemoryUsage(): number; + resizeWindow(width: number, height: number): void; + getProcessCpuUsage(): number; + removeEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentCpuUsage(last: number): any; + addEventListener(eventType: string, callback: (ev: any) => any): void; + getRecentFrames(last: number): any; + getRecentPaintRequests(last: number): any; +} +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} + +interface HTMLDocument extends Document { +} +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface KeyPair { + privateKey: Key; + publicKey: Key; +} +declare var KeyPair: { + prototype: KeyPair; + new(): KeyPair; +} + +interface MSMediaKeySession extends EventTarget { + sessionId: string; + error: MSMediaKeyError; + keySystem: string; + close(): void; + update(key: Uint8Array): void; +} +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface UnviewableContentIdentifiedEvent extends NavigationEvent { + referrer: string; +} +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface CryptoOperation extends EventTarget { + algorithm: Algorithm; + oncomplete: (ev: Event) => any; + onerror: (ev: ErrorEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: UIEvent) => any; + key: Key; + result: any; + abort(): void; + finish(): void; + process(buffer: ArrayBufferView): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var CryptoOperation: { + prototype: CryptoOperation; + new(): CryptoOperation; +} + +interface WebGLTexture extends WebGLObject { +} +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface OES_texture_float { +} +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface WebGLContextEvent extends Event { + statusMessage: string; +} +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLRenderbuffer extends WebGLObject { +} +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLUniformLocation { +} +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebGLActiveInfo { + name: string; + type: number; + size: number; +} +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WebGLRenderingContext { + drawingBufferWidth: number; + drawingBufferHeight: number; + canvas: HTMLCanvasElement; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + bindTexture(target: number, texture: WebGLTexture): void; + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferData(target: number, data: ArrayBuffer, usage: number): void; + bufferData(target: number, size: number, usage: number): void; + depthMask(flag: boolean): void; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + vertexAttrib3fv(indx: number, values: number[]): void; + vertexAttrib3fv(indx: number, values: Float32Array): void; + linkProgram(program: WebGLProgram): void; + getSupportedExtensions(): string[]; + bufferSubData(target: number, offset: number, data: ArrayBuffer): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + polygonOffset(factor: number, units: number): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + createTexture(): WebGLTexture; + hint(target: number, mode: number): void; + getVertexAttrib(index: number, pname: number): any; + enableVertexAttribArray(index: number): void; + depthRange(zNear: number, zFar: number): void; + cullFace(mode: number): void; + createFramebuffer(): WebGLFramebuffer; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + getExtension(name: string): any; + createProgram(): WebGLProgram; + deleteShader(shader: WebGLShader): void; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + enable(cap: number): void; + blendEquation(mode: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + createBuffer(): WebGLBuffer; + deleteTexture(texture: WebGLTexture): void; + useProgram(program: WebGLProgram): void; + vertexAttrib2fv(indx: number, values: number[]): void; + vertexAttrib2fv(indx: number, values: Float32Array): void; + checkFramebufferStatus(target: number): number; + frontFace(mode: number): void; + getBufferParameter(target: number, pname: number): any; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + getVertexAttribOffset(index: number, pname: number): number; + disableVertexAttribArray(index: number): void; + blendFunc(sfactor: number, dfactor: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + uniform3iv(location: WebGLUniformLocation, v: number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + lineWidth(width: number): void; + getShaderInfoLog(shader: WebGLShader): string; + getTexParameter(target: number, pname: number): any; + getParameter(pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getContextAttributes(): WebGLContextAttributes; + vertexAttrib1f(indx: number, x: number): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + isContextLost(): boolean; + uniform1iv(location: WebGLUniformLocation, v: number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + getRenderbufferParameter(target: number, pname: number): any; + uniform2fv(location: WebGLUniformLocation, v: number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; + isTexture(texture: WebGLTexture): boolean; + getError(): number; + shaderSource(shader: WebGLShader, source: string): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + stencilMask(mask: number): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + getAttribLocation(program: WebGLProgram, name: string): number; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + clear(mask: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + scissor(x: number, y: number, width: number, height: number): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getShaderSource(shader: WebGLShader): string; + generateMipmap(target: number): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + uniform1fv(location: WebGLUniformLocation, v: number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; + uniform2iv(location: WebGLUniformLocation, v: number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + uniform4fv(location: WebGLUniformLocation, v: number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; + vertexAttrib1fv(indx: number, values: number[]): void; + vertexAttrib1fv(indx: number, values: Float32Array): void; + flush(): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + deleteProgram(program: WebGLProgram): void; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + uniform1i(location: WebGLUniformLocation, x: number): void; + getProgramParameter(program: WebGLProgram, pname: number): any; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + stencilFunc(func: number, ref: number, mask: number): void; + pixelStorei(pname: number, param: number): void; + disable(cap: number): void; + vertexAttrib4fv(indx: number, values: number[]): void; + vertexAttrib4fv(indx: number, values: Float32Array): void; + createRenderbuffer(): WebGLRenderbuffer; + isBuffer(buffer: WebGLBuffer): boolean; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + sampleCoverage(value: number, invert: boolean): void; + depthFunc(func: number): void; + texParameterf(target: number, pname: number, param: number): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + drawArrays(mode: number, first: number, count: number): void; + texParameteri(target: number, pname: number, param: number): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + getShaderParameter(shader: WebGLShader, pname: number): any; + clearDepth(depth: number): void; + activeTexture(texture: number): void; + viewport(x: number, y: number, width: number, height: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; + deleteBuffer(buffer: WebGLBuffer): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + uniform3fv(location: WebGLUniformLocation, v: number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; + stencilMaskSeparate(face: number, mask: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + compileShader(shader: WebGLShader): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + isShader(shader: WebGLShader): boolean; + clearStencil(s: number): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + finish(): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + getProgramInfoLog(program: WebGLProgram): string; + validateProgram(program: WebGLProgram): void; + isEnabled(cap: number): boolean; + vertexAttrib2f(indx: number, x: number, y: number): void; + isProgram(program: WebGLProgram): boolean; + createShader(type: number): WebGLShader; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + uniform4iv(location: WebGLUniformLocation, v: number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + DEPTH_FUNC: number; + DEPTH_COMPONENT16: number; + REPLACE: number; + REPEAT: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + STENCIL_BUFFER_BIT: number; + RENDERER: number; + STENCIL_BACK_REF: number; + TEXTURE26: number; + RGB565: number; + DITHER: number; + CONSTANT_COLOR: number; + GENERATE_MIPMAP_HINT: number; + POINTS: number; + DECR: number; + INT_VEC3: number; + TEXTURE28: number; + ONE_MINUS_CONSTANT_ALPHA: number; + BACK: number; + RENDERBUFFER_STENCIL_SIZE: number; + UNPACK_FLIP_Y_WEBGL: number; + BLEND: number; + TEXTURE9: number; + ARRAY_BUFFER_BINDING: number; + MAX_VIEWPORT_DIMS: number; + INVALID_FRAMEBUFFER_OPERATION: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE31: number; + TEXTURE24: number; + HIGH_INT: number; + RENDERBUFFER_BINDING: number; + BLEND_COLOR: number; + FASTEST: number; + STENCIL_WRITEMASK: number; + ALIASED_POINT_SIZE_RANGE: number; + TEXTURE12: number; + DST_ALPHA: number; + BLEND_EQUATION_RGB: number; + FRAMEBUFFER_COMPLETE: number; + NEAREST_MIPMAP_NEAREST: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + TEXTURE3: number; + DEPTH_WRITEMASK: number; + CONTEXT_LOST_WEBGL: number; + INVALID_VALUE: number; + TEXTURE_MAG_FILTER: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + NOTEQUAL: number; + ALPHA: number; + DEPTH_STENCIL: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + DEPTH_COMPONENT: number; + RENDERBUFFER_RED_SIZE: number; + TEXTURE20: number; + RED_BITS: number; + RENDERBUFFER_BLUE_SIZE: number; + SCISSOR_BOX: number; + VENDOR: number; + FRONT_AND_BACK: number; + CONSTANT_ALPHA: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + NEAREST: number; + CULL_FACE: number; + ALIASED_LINE_WIDTH_RANGE: number; + TEXTURE19: number; + FRONT: number; + DEPTH_CLEAR_VALUE: number; + GREEN_BITS: number; + TEXTURE29: number; + TEXTURE23: number; + MAX_RENDERBUFFER_SIZE: number; + STENCIL_ATTACHMENT: number; + TEXTURE27: number; + BOOL_VEC2: number; + OUT_OF_MEMORY: number; + MIRRORED_REPEAT: number; + POLYGON_OFFSET_UNITS: number; + TEXTURE_MIN_FILTER: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + LINE_LOOP: number; + FLOAT_MAT3: number; + TEXTURE14: number; + LINEAR: number; + RGB5_A1: number; + ONE_MINUS_SRC_COLOR: number; + SAMPLE_COVERAGE_INVERT: number; + DONT_CARE: number; + FRAMEBUFFER_BINDING: number; + RENDERBUFFER_ALPHA_SIZE: number; + STENCIL_REF: number; + ZERO: number; + DECR_WRAP: number; + SAMPLE_COVERAGE: number; + STENCIL_BACK_FUNC: number; + TEXTURE30: number; + VIEWPORT: number; + STENCIL_BITS: number; + FLOAT: number; + COLOR_WRITEMASK: number; + SAMPLE_COVERAGE_VALUE: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + STENCIL_BACK_FAIL: number; + FLOAT_MAT4: number; + UNSIGNED_SHORT_4_4_4_4: number; + TEXTURE6: number; + RENDERBUFFER_WIDTH: number; + RGBA4: number; + ALWAYS: number; + BLEND_EQUATION_ALPHA: number; + COLOR_BUFFER_BIT: number; + TEXTURE_CUBE_MAP: number; + DEPTH_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + BLEND_EQUATION: number; + RENDERBUFFER_GREEN_SIZE: number; + NEAREST_MIPMAP_LINEAR: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + INCR_WRAP: number; + ONE_MINUS_DST_COLOR: number; + HIGH_FLOAT: number; + BYTE: number; + FRONT_FACE: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + CCW: number; + TEXTURE13: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_WRAP_T: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + FLOAT_VEC2: number; + LUMINANCE: number; + GREATER: number; + INT_VEC2: number; + VALIDATE_STATUS: number; + FRAMEBUFFER: number; + FRAMEBUFFER_UNSUPPORTED: number; + TEXTURE5: number; + FUNC_SUBTRACT: number; + BLEND_DST_ALPHA: number; + SAMPLER_CUBE: number; + ONE_MINUS_DST_ALPHA: number; + LESS: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + BLUE_BITS: number; + DEPTH_TEST: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + DELETE_STATUS: number; + TEXTURE18: number; + POLYGON_OFFSET_FACTOR: number; + UNSIGNED_INT: number; + TEXTURE_2D: number; + DST_COLOR: number; + FLOAT_MAT2: number; + COMPRESSED_TEXTURE_FORMATS: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + DEPTH_STENCIL_ATTACHMENT: number; + LUMINANCE_ALPHA: number; + CW: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + LINEAR_MIPMAP_LINEAR: number; + BUFFER_SIZE: number; + SAMPLE_BUFFERS: number; + TEXTURE15: number; + ACTIVE_TEXTURE: number; + VERTEX_SHADER: number; + TEXTURE22: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + INCR: number; + COMPILE_STATUS: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + TEXTURE7: number; + UNSIGNED_SHORT_5_5_5_1: number; + DEPTH_BITS: number; + RGBA: number; + TRIANGLE_STRIP: number; + COLOR_CLEAR_VALUE: number; + BROWSER_DEFAULT_WEBGL: number; + INVALID_ENUM: number; + SCISSOR_TEST: number; + LINE_STRIP: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + STENCIL_FUNC: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + RENDERBUFFER_HEIGHT: number; + TEXTURE8: number; + TRIANGLES: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + STENCIL_BACK_VALUE_MASK: number; + TEXTURE25: number; + RENDERBUFFER: number; + LEQUAL: number; + TEXTURE1: number; + STENCIL_INDEX8: number; + FUNC_ADD: number; + STENCIL_FAIL: number; + BLEND_SRC_ALPHA: number; + BOOL: number; + ALPHA_BITS: number; + LOW_INT: number; + TEXTURE10: number; + SRC_COLOR: number; + MAX_VARYING_VECTORS: number; + BLEND_DST_RGB: number; + TEXTURE_BINDING_CUBE_MAP: number; + STENCIL_INDEX: number; + TEXTURE_BINDING_2D: number; + MEDIUM_INT: number; + SHADER_TYPE: number; + POLYGON_OFFSET_FILL: number; + DYNAMIC_DRAW: number; + TEXTURE4: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STREAM_DRAW: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + TEXTURE17: number; + TRIANGLE_FAN: number; + UNPACK_ALIGNMENT: number; + CURRENT_PROGRAM: number; + LINES: number; + INVALID_OPERATION: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + LINEAR_MIPMAP_NEAREST: number; + CLAMP_TO_EDGE: number; + RENDERBUFFER_DEPTH_SIZE: number; + TEXTURE_WRAP_S: number; + ELEMENT_ARRAY_BUFFER: number; + UNSIGNED_SHORT_5_6_5: number; + ACTIVE_UNIFORMS: number; + FLOAT_VEC3: number; + NO_ERROR: number; + ATTACHED_SHADERS: number; + DEPTH_ATTACHMENT: number; + TEXTURE11: number; + STENCIL_TEST: number; + ONE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + STATIC_DRAW: number; + GEQUAL: number; + BOOL_VEC4: number; + COLOR_ATTACHMENT0: number; + PACK_ALIGNMENT: number; + MAX_TEXTURE_SIZE: number; + STENCIL_PASS_DEPTH_FAIL: number; + CULL_FACE_MODE: number; + TEXTURE16: number; + STENCIL_BACK_WRITEMASK: number; + SRC_ALPHA: number; + UNSIGNED_SHORT: number; + TEXTURE21: number; + FUNC_REVERSE_SUBTRACT: number; + SHADING_LANGUAGE_VERSION: number; + EQUAL: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + BOOL_VEC3: number; + SAMPLER_2D: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + MAX_TEXTURE_IMAGE_UNITS: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + STENCIL_VALUE_MASK: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + ARRAY_BUFFER: number; + DEPTH_RANGE: number; + NICEST: number; + ACTIVE_ATTRIBUTES: number; + NEVER: number; + FLOAT_VEC4: number; + CURRENT_VERTEX_ATTRIB: number; + STENCIL_PASS_DEPTH_PASS: number; + INVERT: number; + LINK_STATUS: number; + RGB: number; + INT_VEC4: number; + TEXTURE2: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + MEDIUM_FLOAT: number; + SRC_ALPHA_SATURATE: number; + BUFFER_USAGE: number; + SHORT: number; + NONE: number; + UNSIGNED_BYTE: number; + INT: number; + SUBPIXEL_BITS: number; + KEEP: number; + SAMPLES: number; + FRAGMENT_SHADER: number; + LINE_WIDTH: number; + BLEND_SRC_RGB: number; + LOW_FLOAT: number; + VERSION: number; +} + +interface WebGLProgram extends WebGLObject { +} +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface WebGLFramebuffer extends WebGLObject { +} +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLShader extends WebGLObject { +} +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface OES_texture_float_linear { +} +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface WebGLObject { +} +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLBuffer extends WebGLObject { +} +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLShaderPrecisionFormat { + rangeMin: number; + rangeMax: number; + precision: number; +} +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface EXT_texture_filter_anisotropic { + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + TEXTURE_MAX_ANISOTROPY_EXT: number; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; +declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; +declare var Audio: { new(src?: string): HTMLAudioElement; }; + +declare var ondragend: (ev: DragEvent) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var screenX: number; +declare var onmouseover: (ev: MouseEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var history: History; +declare var pageXOffset: number; +declare var name: string; +declare var onafterprint: (ev: Event) => any; +declare var onpause: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var top: Window; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var opener: Window; +declare var onclick: (ev: MouseEvent) => any; +declare var innerHeight: number; +declare var onwaiting: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var ondurationchange: (ev: Event) => any; +declare var frames: Window; +declare var onblur: (ev: FocusEvent) => any; +declare var onemptied: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var oncanplay: (ev: Event) => any; +declare var outerWidth: number; +declare var onstalled: (ev: Event) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var innerWidth: number; +declare var onoffline: (ev: Event) => any; +declare var length: number; +declare var screen: Screen; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onloadstart: (ev: Event) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var self: Window; +declare var document: Document; +declare var onprogress: (ev: ProgressEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var pageYOffset: number; +declare var oncontextmenu: (ev: MouseEvent) => any; +declare var onchange: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onplaying: (ev: Event) => any; +declare var parent: Window; +declare var location: Location; +declare var oncanplaythrough: (ev: Event) => any; +declare var onabort: (ev: UIEvent) => any; +declare var onreadystatechange: (ev: Event) => any; +declare var outerHeight: number; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var frameElement: Element; +declare var onloadeddata: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var window: Window; +declare var onfocus: (ev: FocusEvent) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onselect: (ev: UIEvent) => any; +declare var navigator: Navigator; +declare var styleMedia: StyleMedia; +declare var ondrop: (ev: DragEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onended: (ev: Event) => any; +declare var onhashchange: (ev: Event) => any; +declare var onunload: (ev: Event) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var screenY: number; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var oninput: (ev: Event) => any; +declare var performance: Performance; +declare var onmspointerdown: (ev: any) => any; +declare var animationStartTime: number; +declare var onmsgesturedoubletap: (ev: any) => any; +declare var onmspointerhover: (ev: any) => any; +declare var onmsgesturehold: (ev: any) => any; +declare var onmspointermove: (ev: any) => any; +declare var onmsgesturechange: (ev: any) => any; +declare var onmsgesturestart: (ev: any) => any; +declare var onmspointercancel: (ev: any) => any; +declare var onmsgestureend: (ev: any) => any; +declare var onmsgesturetap: (ev: any) => any; +declare var onmspointerout: (ev: any) => any; +declare var msAnimationStartTime: number; +declare var applicationCache: ApplicationCache; +declare var onmsinertiastart: (ev: any) => any; +declare var onmspointerover: (ev: any) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onmspointerup: (ev: any) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var devicePixelRatio: number; +declare var msCrypto: Crypto; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var doNotTrack: string; +declare var onmspointerenter: (ev: any) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onmspointerleave: (ev: any) => any; +declare function alert(message?: any): void; +declare function scroll(x?: number, y?: number): void; +declare function focus(): void; +declare function scrollTo(x?: number, y?: number): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; +declare function toString(): string; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; +declare function scrollBy(x?: number, y?: number): void; +declare function confirm(message?: string): boolean; +declare function close(): void; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function showModalDialog(url?: string, argument?: any, options?: any): any; +declare function blur(): void; +declare function getSelection(): Selection; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function cancelAnimationFrame(handle: number): void; +declare function msIsStaticHTML(html: string): boolean; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function attachEvent(event: string, listener: EventListener): boolean; +declare function detachEvent(event: string, listener: EventListener): void; +declare var localStorage: Storage; +declare var status: string; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var screenLeft: number; +declare var offscreenBuffering: any; +declare var maxConnectionsPerServer: number; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var clipboardData: DataTransfer; +declare var defaultStatus: string; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var onhelp: (ev: Event) => any; +declare var external: External; +declare var event: MSEventObj; +declare var onfocusout: (ev: FocusEvent) => any; +declare var screenTop: number; +declare var onfocusin: (ev: FocusEvent) => any; +declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; +declare function navigate(url: string): void; +declare function resizeBy(x?: number, y?: number): void; +declare function item(index: any): any; +declare function resizeTo(x?: number, y?: number): void; +declare function createPopup(arguments?: any): MSPopupWindow; +declare function toStaticHTML(html: string): string; +declare function execScript(code: string, language?: string): any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function moveTo(x?: number, y?: number): void; +declare function moveBy(x?: number, y?: number): void; +declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare function captureEvents(): void; +declare function releaseEvents(): void; +declare var sessionStorage: Storage; +declare function clearTimeout(handle: number): void; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearInterval(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function msClearImmediate(handle: number): void; +declare function setImmediate(expression: any, ...args: any[]): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare var console: Console; +declare var onpointerenter: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onpointercancel: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerleave: (ev: PointerEvent) => any; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; diff --git a/src/lib/extensions.d.ts b/src/lib/extensions.d.ts new file mode 100644 index 0000000000000..62f3bc88c8010 --- /dev/null +++ b/src/lib/extensions.d.ts @@ -0,0 +1,818 @@ + +///////////////////////////// +/// IE10 ECMAScript Extensions +///////////////////////////// + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + byteLength: number; +} + +declare var ArrayBuffer: { + prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; +} + +interface ArrayBufferView { + buffer: ArrayBuffer; + byteOffset: number; + byteLength: number; +} + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; +} +declare var Int8Array: { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; +} +declare var Uint8Array: { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; +} +declare var Int16Array: { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint16Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; +} +declare var Uint16Array: { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; +} +declare var Int32Array: { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; +} +declare var Uint32Array: { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float32Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float32Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; +} +declare var Float32Array: { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + BYTES_PER_ELEMENT: number; +} + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + */ +interface Float64Array extends ArrayBufferView { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The length of the array. + */ + length: number; + [index: number]: number; + + /** + * Gets the element at the specified index. + * @param index The index at which to get the element of the array. + */ + get(index: number): number; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float64Array, offset?: number): void; + + /** + * Sets a value or an array of values. + * @param A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: number[], offset?: number): void; + + /** + * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; +} +declare var Float64Array: { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + BYTES_PER_ELEMENT: number; +} + +/** + * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. + */ +interface DataView extends ArrayBufferView { + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian?: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian?: boolean): number; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; +} +declare var DataView: { + prototype: DataView; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; +} + +///////////////////////////// +/// IE11 ECMAScript Extensions +///////////////////////////// + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): Map; + size: number; +} +declare var Map: { + new (): Map; +} + +interface WeakMap { + clear(): void; + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value: V): WeakMap; +} +declare var WeakMap: { + new (): WeakMap; +} + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; +} +declare var Set: { + new (): Set; +} + +declare module Intl { + + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string[], options?: CollatorOptions): Collator; + new (locale?: string, options?: CollatorOptions): Collator; + (locales?: string[], options?: CollatorOptions): Collator; + (locale?: string, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; + supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + } + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumintegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string[], options?: NumberFormatOptions): Collator; + new (locale?: string, options?: NumberFormatOptions): Collator; + (locales?: string[], options?: NumberFormatOptions): Collator; + (locale?: string, options?: NumberFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + } + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12: boolean; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date: number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string[], options?: DateTimeFormatOptions): Collator; + new (locale?: string, options?: DateTimeFormatOptions): Collator; + (locales?: string[], options?: DateTimeFormatOptions): Collator; + (locale?: string, options?: DateTimeFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + } +} + +interface String { + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; + + /** + * Converts a number to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a date to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; +} + diff --git a/src/lib/importcore.d.ts b/src/lib/importcore.d.ts new file mode 100644 index 0000000000000..94e599fb842c6 --- /dev/null +++ b/src/lib/importcore.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts new file mode 100644 index 0000000000000..2639739e5d655 --- /dev/null +++ b/src/lib/scriptHost.d.ts @@ -0,0 +1,22 @@ + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + +declare var ActiveXObject: { new (s: string): any; }; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +declare var WScript: { + Echo(s: any): void; + StdErr: ITextWriter; + StdOut: ITextWriter; + Arguments: { length: number; Item(n: number): string; }; + ScriptFullName: string; + Quit(exitCode?: number): number; +} diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts new file mode 100644 index 0000000000000..5dfaa2f646fe7 --- /dev/null +++ b/src/lib/webworker.generated.d.ts @@ -0,0 +1,803 @@ +///////////////////////////// +/// IE Worker APIs +///////////////////////////// + + +interface Console { + info(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + profile(reportName?: string): void; + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: any): boolean; + clear(): void; + dir(value?: any, ...optionalParams: any[]): void; + profileEnd(): void; + count(countTitle?: string): void; + groupEnd(): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + group(groupTitle?: string): void; + dirxml(value: any): void; + debug(message?: string, ...optionalParams: any[]): void; + groupCollapsed(groupTitle?: string): void; + select(element: any): void; +} +declare var Console: { + prototype: Console; + new(): Console; +} + +interface NavigatorID { + appVersion: string; + appName: string; + userAgent: string; + platform: string; + product: string; + vendor: string; +} + +interface EventTarget { + removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; +} + +interface MessageEvent extends Event { + source: any; + origin: string; + data: any; + ports: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; +} +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface XMLHttpRequest extends EventTarget { + responseBody: any; + status: number; + readyState: number; + responseText: string; + responseXML: any; + ontimeout: (ev: Event) => any; + statusText: string; + onreadystatechange: (ev: Event) => any; + timeout: number; + onload: (ev: Event) => any; + response: any; + withCredentials: boolean; + onprogress: (ev: ProgressEvent) => any; + onabort: (ev: any) => any; + responseType: string; + onloadend: (ev: ProgressEvent) => any; + upload: XMLHttpRequestEventTarget; + onerror: (ev: ErrorEvent) => any; + onloadstart: (ev: Event) => any; + msCaching: string; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: any): void; + abort(): void; + getAllResponseHeaders(): string; + setRequestHeader(header: string, value: string): void; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + overrideMimeType(mime: string): void; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + LOADING: number; + DONE: number; + UNSENT: number; + OPENED: number; + HEADERS_RECEIVED: number; + create(): XMLHttpRequest; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventException { + code: number; + message: string; + name: string; + toString(): string; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} +declare var EventException: { + prototype: EventException; + new(): EventException; + DISPATCH_REQUEST_ERR: number; + UNSPECIFIED_EVENT_TYPE_ERR: number; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface Event { + timeStamp: number; + defaultPrevented: boolean; + isTrusted: boolean; + currentTarget: EventTarget; + cancelBubble: boolean; + target: EventTarget; + eventPhase: number; + cancelable: boolean; + type: string; + srcElement: any; + bubbles: boolean; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} +declare var Event: { + prototype: Event; + new(): Event; + CAPTURING_PHASE: number; + AT_TARGET: number; + BUBBLING_PHASE: number; +} + +interface ImageData { + width: number; + data: number[]; + height: number; +} +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + HIERARCHY_REQUEST_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + INVALID_MODIFICATION_ERR: number; + NAMESPACE_ERR: number; + INVALID_CHARACTER_ERR: number; + TYPE_MISMATCH_ERR: number; + ABORT_ERR: number; + INVALID_STATE_ERR: number; + SECURITY_ERR: number; + NETWORK_ERR: number; + WRONG_DOCUMENT_ERR: number; + QUOTA_EXCEEDED_ERR: number; + INDEX_SIZE_ERR: number; + DOMSTRING_SIZE_ERR: number; + SYNTAX_ERR: number; + SERIALIZE_ERR: number; + VALIDATION_ERR: number; + NOT_FOUND_ERR: number; + URL_MISMATCH_ERR: number; + PARSE_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NOT_SUPPORTED_ERR: number; + INVALID_ACCESS_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_NODE_TYPE_ERR: number; + DATA_CLONE_ERR: number; + TIMEOUT_ERR: number; +} + +interface ErrorEvent extends Event { + colno: number; + filename: string; + error: any; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface MSStreamReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; +} +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MessageChannel { + port2: MessagePort; + port1: MessagePort; +} +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface DOMError { + name: string; + toString(): string; +} +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface CloseEvent extends Event { + wasClean: boolean; + reason: string; + code: number; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface WebSocket extends EventTarget { + protocol: string; + readyState: number; + bufferedAmount: number; + onopen: (ev: Event) => any; + extensions: string; + onmessage: (ev: MessageEvent) => any; + onclose: (ev: CloseEvent) => any; + onerror: (ev: ErrorEvent) => any; + binaryType: string; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: string[]): WebSocket; + OPEN: number; + CLOSING: number; + CONNECTING: number; + CLOSED: number; +} + +interface ProgressEvent extends Event { + loaded: number; + lengthComputable: boolean; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + name: string; + transaction: IDBTransaction; + keyPath: string; + count(key?: any): IDBRequest; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + put(value: any, key?: any): IDBRequest; + openCursor(range?: any, direction?: string): IDBRequest; + deleteIndex(indexName: string): void; + index(name: string): IDBIndex; + get(key: any): IDBRequest; + delete(key: any): IDBRequest; +} +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface IDBIndex { + unique: boolean; + name: string; + keyPath: string; + objectStore: IDBObjectStore; + count(key?: any): IDBRequest; + getKey(key: any): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + get(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface IDBCursor { + source: any; + direction: string; + key: any; + primaryKey: any; + advance(count: number): void; + delete(): IDBRequest; + continue(key?: any): void; + update(value: any): IDBRequest; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + PREV: string; + PREV_NO_DUPLICATE: string; + NEXT: string; + NEXT_NO_DUPLICATE: string; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} +declare var File: { + prototype: File; + new(): File; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface XMLHttpRequestEventTarget extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + ontimeout: (ev: Event) => any; + onabort: (ev: any) => any; + onloadstart: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var XMLHttpRequestEventTarget: { + prototype: XMLHttpRequestEventTarget; + new(): XMLHttpRequestEventTarget; +} + +interface MSBaseReader extends EventTarget { + onprogress: (ev: ProgressEvent) => any; + readyState: number; + onabort: (ev: any) => any; + onloadend: (ev: ProgressEvent) => any; + onerror: (ev: ErrorEvent) => any; + onload: (ev: Event) => any; + onloadstart: (ev: Event) => any; + result: any; + abort(): void; + LOADING: number; + EMPTY: number; + DONE: number; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface IDBKeyRange { + upper: any; + upperOpen: boolean; + lower: any; + lowerOpen: boolean; +} +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface WindowConsole { + console: Console; +} + +interface IDBTransaction extends EventTarget { + oncomplete: (ev: Event) => any; + db: IDBDatabase; + mode: string; + error: DOMError; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: any) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + VERSION_CHANGE: string; + READ_WRITE: string; +} + +interface WindowBase64 { + btoa(rawString: string): string; + atob(encodedString: string): string; +} + +interface IDBDatabase extends EventTarget { + version: string; + name: string; + objectStoreNames: DOMStringList; + onerror: (ev: ErrorEvent) => any; + onabort: (ev: any) => any; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + close(): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + deleteObjectStore(name: string): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface IDBOpenDBRequest extends IDBRequest { + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + onblocked: (ev: Event) => any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface MSUnsafeFunctionCallback { + (): any; +} + +interface IDBRequest extends EventTarget { + source: any; + onsuccess: (ev: Event) => any; + error: DOMError; + transaction: IDBTransaction; + onerror: (ev: ErrorEvent) => any; + readyState: string; + result: any; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface FileReader extends MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; +} +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface Blob { + type: string; + size: number; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; + msClose(): void; +} +declare var Blob: { + prototype: Blob; + new(): Blob; +} + +interface MSStream { + type: string; + msDetachStream(): any; + msClose(): void; +} +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface IDBFactory { + open(name: string, version?: number): IDBOpenDBRequest; + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; +} +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} + +interface MSApp { + createFileFromStorageFile(storageFile: any): File; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + terminateApp(exceptionObject: any): void; + createDataPackage(object: any): any; + execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; + getHtmlPrintDocumentSource(htmlDoc: any): any; + addPublicLocalApplicationUri(uri: string): void; + createDataPackageFromSelection(): any; + getViewOpener(): MSAppView; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + createNewView(uri: string): MSAppView; + getCurrentPriority(): string; + NORMAL: string; + HIGH: string; + IDLE: string; + CURRENT: string; +} +declare var MSApp: MSApp; + +interface Worker extends AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +} +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} + +interface MSAppView { + viewId: number; + close(): void; + postMessage(message: any, targetOrigin: string, ports?: any): void; +} +declare var MSAppView: { + prototype: MSAppView; + new(): MSAppView; +} + +interface WorkerLocation { + hash: string; + protocol: string; + search: string; + href: string; + hostname: string; + port: string; + pathname: string; + host: string; + toString(): string; +} +declare var WorkerLocation: { + prototype: WorkerLocation; + new(): WorkerLocation; +} + +interface FileReaderSync { + readAsArrayBuffer(blob: Blob): any; + readAsDataURL(blob: Blob): string; + readAsText(blob: Blob, encoding?: string): string; +} +declare var FileReaderSync: { + prototype: FileReaderSync; + new(): FileReaderSync; +} + +interface WorkerGlobalScope extends EventTarget, DedicatedWorkerGlobalScope, WindowConsole, WorkerUtils { + location: WorkerLocation; + self: WorkerGlobalScope; + onerror: (ev: ErrorEvent) => any; + msWriteProfilerMark(profilerMarkName: string): void; + close(): void; + toString(): string; +} +declare var WorkerGlobalScope: { + prototype: WorkerGlobalScope; + new(): WorkerGlobalScope; +} + +interface DedicatedWorkerGlobalScope { + onmessage: (ev: MessageEvent) => any; + postMessage(data: any): void; +} + +interface WorkerNavigator extends NavigatorID, NavigatorOnLine { +} +declare var WorkerNavigator: { + prototype: WorkerNavigator; + new(): WorkerNavigator; +} + +interface WorkerUtils extends WindowBase64 { + navigator: WorkerNavigator; + msIndexedDB: IDBFactory; + indexedDB: IDBFactory; + clearImmediate(handle: number): void; + importScripts(...urls: string[]): void; + clearTimeout(handle: number): void; + setImmediate(handler: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; + clearInterval(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; +} + + +declare var location: WorkerLocation; +declare var self: WorkerGlobalScope; +declare var onerror: (ev: ErrorEvent) => any; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function close(): void; +declare function toString(): string; +declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare var onmessage: (ev: MessageEvent) => any; +declare function postMessage(data: any): void; +declare var console: Console; +declare var navigator: WorkerNavigator; +declare var msIndexedDB: IDBFactory; +declare var indexedDB: IDBFactory; +declare function clearImmediate(handle: number): void; +declare function importScripts(...urls: string[]): void; +declare function clearTimeout(handle: number): void; +declare function setImmediate(handler: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearInterval(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function btoa(rawString: string): string; +declare function atob(encodedString: string): string; diff --git a/src/lib/webworker.importscripts.d.ts b/src/lib/webworker.importscripts.d.ts new file mode 100644 index 0000000000000..f48f75ee87a82 --- /dev/null +++ b/src/lib/webworker.importscripts.d.ts @@ -0,0 +1,6 @@ + +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; diff --git a/src/services/services.ts b/src/services/services.ts new file mode 100644 index 0000000000000..69685d79fc09a --- /dev/null +++ b/src/services/services.ts @@ -0,0 +1,439 @@ +/// +/// +/// +/// +/// + +module ts { + + export interface Node { + getSourceFile(): SourceFile; + getChildCount(): number; + getChildAt(index: number): Node; + getChildren(): Node[]; + getFullWidth(): number; + getTriviaWidth(): number; + getFullText(): string; + getFirstToken(): Node; + getLastToken(): Node; + } + + export interface Symbol { + getFlags(): SymbolFlags; + getName(): string; + getDeclarations(): Declaration[]; + } + + export interface Type { + getFlags(): TypeFlags; + getSymbol(): Symbol; + getProperties(): Symbol[]; + getCallSignatures(): Signature[]; + getConstructSignatures(): Signature[]; + getStringIndexType(): Type; + getNumberIndexType(): Type; + } + + export interface Signature { + getDeclaration(): SignatureDeclaration; + getTypeParameters(): Type[]; + getParameters(): Symbol[]; + getReturnType(): Type; + } + + interface HostFileInformation { + version: string; + isOpen: boolean; + byteOrderMark: ByteOrderMark; + sourceText?: IScriptSnapshot; + } + + // + // Public services of a language service instance associated + // with a language service host instance + // + export interface LanguageService { + getSyntacticDiagnostics(filename: string): Diagnostic[]; + getSemanticDiagnostics(filename: string): Diagnostic[]; + } + + // + // Public interface of the host of a language service instance. + // + export interface LanguageServiceHost { + log(s: string): void; + + getCompilationSettings(): CompilerOptions; + + getScriptFileNames(): string[]; + getScriptVersion(filename: string): string; + getScriptIsOpen(filename: string): boolean; + getScriptByteOrderMark(filename: string): ByteOrderMark; + getScriptSnapshot(filename: string): IScriptSnapshot; + getLocalizedDiagnosticMessages(): any; + //getCancellationToken(): CancellationToken; + } + + // Represents an immutable snapshot of a script at a specified time. Once acquired, the + // snapshot is observably immutable. i.e. the same calls with the same parameters will return + // the same values. + export interface IScriptSnapshot { + // Get's a portion of the script snapshot specified by [start, end). + getText(start: number, end: number): string; + + // Get's the length of this script snapshot. + getLength(): number; + + // This call returns the array containing the start position of every line. + // i.e."[0, 10, 55]". TODO: consider making this optional. The language service could + // always determine this (albeit in a more expensive manner). + getLineStartPositions(): number[]; + + // Gets the TextChangeRange that describe how the text changed between this text and + // an older version. This informatoin is used by the incremental parser to determine + // what sections of the script need to be reparsed. 'null' can be returned if the + // change range cannot be determined. However, in that case, incremental parsing will + // not happen and the entire document will be reparsed. + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; + } + + export interface Span { + start(): number; + end(): number; + } + + export interface TextChange { + span: Span; + newText: string; + } + + export interface TextChangeRange { + span(): Span; + newLength(): number; + } + + export enum ByteOrderMark { + None = 0, + Utf8 = 1, + Utf16BigEndian = 2, + Utf16LittleEndian = 3, + } + + export interface CancellationToken { + isCancellationRequested(): boolean; + } + + var scanner: Scanner = createScanner(ScriptTarget.ES5); + + var emptyArray: any [] = []; + + function createNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags, parent?: Node): NodeObject { + var node = new (getNodeConstructor(kind))(); + node.pos = pos; + node.end = end; + node.flags = flags; + node.parent = parent; + return node; + } + + class NodeObject implements Node { + + public kind: SyntaxKind; + public pos: number; + public end: number; + public flags: NodeFlags; + public parent: Node; + private _children: Node[]; + + public getSourceFile(): SourceFile { + var node: Node = this; + while (node.kind !== SyntaxKind.SourceFile) node = node.parent; + return node; + } + + public getTextPos(): number { + return getTokenPosOfNode(this); + } + + public getFullWidth(): number { + return this.end - this.pos; + } + + public getTriviaWidth(): number { + return getTokenPosOfNode(this) - this.pos; + } + + public getFullText(): string { + return this.getSourceFile().text.substring(this.pos, this.end); + } + + private addSyntheticNodes(nodes: Node[], pos: number, end: number): number { + scanner.setTextPos(pos); + while (pos < end) { + var token = scanner.scan(); + var textPos = scanner.getTextPos(); + var node = nodes.push(createNode(token, pos, textPos, NodeFlags.Synthetic, this)); + pos = textPos; + } + return pos; + } + + private createSyntaxList(nodes: NodeArray): Node { + var list = createNode(SyntaxKind.SyntaxList, nodes.pos, nodes.end, NodeFlags.Synthetic, this); + list._children = []; + var pos = nodes.pos; + for (var i = 0, len = nodes.length; i < len; i++) { + var node = nodes[i]; + if (pos < node.pos) { + pos = this.addSyntheticNodes(list._children, pos, node.pos); + } + list._children.push(node); + pos = node.end; + } + if (pos < nodes.end) { + this.addSyntheticNodes(list._children, pos, nodes.end); + } + return list; + } + + private createChildren() { + if (this.kind > SyntaxKind.Missing) { + scanner.setText(this.getSourceFile().text); + var children: Node[] = []; + var pos = this.pos; + var processNode = (node: Node) => { + if (pos < node.pos) { + pos = this.addSyntheticNodes(children, pos, node.pos); + } + children.push(node); + pos = node.end; + }; + var processNodes = (nodes: NodeArray) => { + if (pos < nodes.pos) { + pos = this.addSyntheticNodes(children, pos, nodes.pos); + } + children.push(this.createSyntaxList(>nodes)); + pos = nodes.end; + }; + forEachChild(this, processNode, processNodes); + if (pos < this.end) { + this.addSyntheticNodes(children, pos, this.end); + } + scanner.setText(undefined); + } + this._children = children || emptyArray; + } + + public getChildCount(): number { + if (!this._children) this.createChildren(); + return this._children.length; + } + + public getChildAt(index: number): Node { + if (!this._children) this.createChildren(); + return this._children[index]; + } + + public getChildren(): Node[] { + if (!this._children) this.createChildren(); + return this._children; + } + + public getFirstToken(): Node { + var children = this.getChildren(); + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (child.kind < SyntaxKind.Missing) return child; + if (child.kind > SyntaxKind.Missing) return child.getFirstToken(); + } + } + + public getLastToken(): Node { + var children = this.getChildren(); + for (var i = children.length - 1; i >= 0; i--) { + var child = children[i]; + if (child.kind < SyntaxKind.Missing) return child; + if (child.kind > SyntaxKind.Missing) return child.getLastToken(); + } + } + } + + class SymbolObject implements Symbol { + flags: SymbolFlags; + name: string; + declarations: Declaration[]; + constructor(flags: SymbolFlags, name: string) { + this.flags = flags; + this.name = name; + } + getFlags(): SymbolFlags { + return this.flags; + } + getName(): string { + return this.name; + } + getDeclarations(): Declaration[] { + return this.declarations; + } + } + + class TypeObject implements Type { + checker: TypeChecker; + flags: TypeFlags; + id: number; + symbol: Symbol; + constructor(checker: TypeChecker, flags: TypeFlags) { + this.checker = checker; + this.flags = flags; + } + getFlags(): TypeFlags { + return this.flags; + } + getSymbol(): Symbol { + return this.symbol; + } + getProperties(): Symbol[] { + return this.checker.getPropertiesOfType(this); + } + getCallSignatures(): Signature[] { + return this.checker.getSignaturesOfType(this, SignatureKind.Call); + } + getConstructSignatures(): Signature[] { + return this.checker.getSignaturesOfType(this, SignatureKind.Construct); + } + getStringIndexType(): Type { + return this.checker.getIndexTypeOfType(this, IndexKind.String); + } + getNumberIndexType(): Type { + return this.checker.getIndexTypeOfType(this, IndexKind.Number); + } + } + + class SignatureObject implements Signature { + checker: TypeChecker; + declaration: SignatureDeclaration; + typeParameters: TypeParameter[]; + parameters: Symbol[]; + resolvedReturnType: Type; + minArgumentCount: number; + hasRestParameter: boolean; + hasStringLiterals: boolean; + constructor(checker: TypeChecker) { + this.checker = checker; + } + getDeclaration(): SignatureDeclaration { + return this.declaration; + } + getTypeParameters(): Type[] { + return this.typeParameters; + } + getParameters(): Symbol[] { + return this.parameters; + } + getReturnType(): Type { + return this.checker.getReturnTypeOfSignature(this); + } + } + + export function createLanguageService(host: LanguageServiceHost): LanguageService { + + var program: Program; + var typeChecker: TypeChecker; + var filesByName: Map; + + function createCompilerHost(): CompilerHost { + return { + getSourceFile: (filename, languageVersion) => { + var hostFile = filesByName[filename]; + + // TODO use the document registry to get or update + + if (!hostFile.sourceText) { + hostFile.sourceText = host.getScriptSnapshot(filename); + } + + // TODO add support for IScriptSnapshot in the parser + return createSourceFile(filename, hostFile.sourceText.getText(0, hostFile.sourceText.getLength()), languageVersion); + }, + // Need something that doesn't depend on sys.ts here + getDefaultLibFilename: () => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), "lib.d.ts"), + getCancellationToken: (): CancellationToken => undefined, + writeFile: (fileName, data) => { + throw Error("TODO: write file"); + }, + getCurrentDirectory: (): string => { + throw Error("TODO: getCurrentDirectory"); + }, + getCanonicalFileName: getCanonicalFileName, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + }; + } + + function synchronizeHostData(): void { + // Build the cache + filesByName = {}; + var files = host.getScriptFileNames(); + forEach(files, (f) => { + filesByName[f] = { + version: host.getScriptVersion(f), + isOpen: host.getScriptIsOpen(f), + byteOrderMark: host.getScriptByteOrderMark(f) + }; + }); + + var currentProgram = program; + + var options = host.getCompilationSettings(); + + // update the program + program = createProgram(files, options, createCompilerHost()); + + // Update the typeChecker + typeChecker = program.getTypeChecker(); + + // TODO release old sources from the registry + if (currentProgram) { + + } + } + + function getSyntacticDiagnostics(filename: string): Diagnostic[] { + synchronizeHostData(); + var sourceFile = program.getSourceFile(filename); + return sourceFile ? program.getDiagnostics(sourceFile) : []; + } + + function getSemanticDiagnostics(filename: string): Diagnostic[] { + synchronizeHostData(); + var sourceFile = program.getSourceFile(filename); + return sourceFile ? typeChecker.getDiagnostics(sourceFile) : []; + } + + return { + getSyntacticDiagnostics: getSyntacticDiagnostics, + getSemanticDiagnostics: getSemanticDiagnostics, + }; + } + + function initializeServices() { + objectAllocator = { + getNodeConstructor: kind => { + function Node() { + } + var proto = new NodeObject(); + proto.kind = kind; + proto.pos = 0; + proto.end = 0; + proto.flags = 0; + proto.parent = undefined; + Node.prototype = proto; + return Node; + }, + getSymbolConstructor: () => SymbolObject, + getTypeConstructor: () => TypeObject, + getSignatureConstructor: () => SignatureObject, + }; + } + + initializeServices(); +} diff --git a/src/services/shims.ts b/src/services/shims.ts new file mode 100644 index 0000000000000..68e15ff6095d4 --- /dev/null +++ b/src/services/shims.ts @@ -0,0 +1,145 @@ +/// + +module ts { + export interface LanguageServiceShimHost { + log(s: string): void; + getCompilationSettings(): string; + getScriptFileNames(): string; + getScriptVersion(fileName: string): string; + getScriptIsOpen(fileName: string): boolean; + getScriptByteOrderMark(fileName: string): number; + getScriptSnapshot(fileName: string): ScriptSnapshotShim; + getLocalizedDiagnosticMessages(): string; + // getCancellationToken(): CancellationToken + } + + export interface ScriptSnapshotShim { + // Get's a portion of the script snapshot specified by [start, end). + getText(start: number, end: number): string; + + // Get's the length of this script snapshot. + getLength(): number; + + // This call returns the JSON encoded array of the type: + // number[] + getLineStartPositions(): string; + + // Returns a JSON encoded value of the type: + // { span: { start: number; length: number }; newLength: number } + // + // Or null value if there was no change. + getChangeRange(oldSnapshot: ScriptSnapshotShim): string; + } + + class ScriptSnapshotShimAdapter implements IScriptSnapshot { + private lineStartPositions: number[] = null; + + constructor(private scriptSnapshotShim: ScriptSnapshotShim) { + } + + public getText(start: number, end: number): string { + return this.scriptSnapshotShim.getText(start, end); + } + + public getLength(): number { + return this.scriptSnapshotShim.getLength(); + } + + public getLineStartPositions(): number[] { + if (this.lineStartPositions == null) { + this.lineStartPositions = JSON.parse(this.scriptSnapshotShim.getLineStartPositions()); + } + + return this.lineStartPositions; + } + + + public getChangeRange(scriptSnapshot: IScriptSnapshot): TextChangeRange { + function createTextRange(start: number, length: number) { + function createSpan(start: number, length: number) { + return { + start: () => start, + end: () => start + length, + lenth: () => length, + isEmpty: () => length === 0 + }; + } + + return { + span: () => createSpan(start, length), + newLength: () => length, + newSpan: () => createSpan(start, length), + isUnchanged: () => length === 0 + }; + } + + var encoded = this.scriptSnapshotShim.getChangeRange((scriptSnapshot).scriptSnapshotShim); + if (encoded == null) { + return null; + } + + var decoded: { span: { start: number; length: number; }; newLength: number; } = JSON.parse(encoded); + + return createTextRange(decoded.span.start, decoded.span.length); + } + } + + export class LanguageServiceShimHostAdapter implements LanguageServiceHost { + constructor(private shimHost: LanguageServiceShimHost) { + } + + public log(s: string): void { + this.shimHost.log(s); + } + + public getCompilationSettings(): CompilerOptions { + var settingsJson = this.shimHost.getCompilationSettings(); + if (settingsJson == null || settingsJson == "") { + return {}; + } + var settings: CompilerOptions = JSON.parse(settingsJson); + return settings; + } + + public getScriptFileNames(): string[] { + var encoded = this.shimHost.getScriptFileNames(); + return JSON.parse(encoded); + } + + public getScriptSnapshot(fileName: string): IScriptSnapshot { + return new ScriptSnapshotShimAdapter(this.shimHost.getScriptSnapshot(fileName)); + } + + public getScriptVersion(fileName: string): string { + return this.shimHost.getScriptVersion(fileName); + } + + public getScriptIsOpen(fileName: string): boolean { + return this.shimHost.getScriptIsOpen(fileName); + } + + public getScriptByteOrderMark(fileName: string): ByteOrderMark { + return this.shimHost.getScriptByteOrderMark(fileName); + } + + public getLocalizedDiagnosticMessages(): any { + var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); + if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { + return null; + } + try { + return JSON.parse(diagnosticMessagesJson); + } + catch (e) { + this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format"); + return null; + } + } + + //public getCancellationToken(): CancellationToken { + // return this.shimHost.getCancellationToken(); + //} + + + } +} \ No newline at end of file diff --git a/tests/baselines/reference/2dArrays.js b/tests/baselines/reference/2dArrays.js new file mode 100644 index 0000000000000..7840f3d8c5473 --- /dev/null +++ b/tests/baselines/reference/2dArrays.js @@ -0,0 +1,38 @@ +//// [2dArrays.ts] +class Cell { +} + +class Ship { + isSunk: boolean; +} + +class Board { + ships: Ship[]; + cells: Cell[]; + + private allShipsSunk() { + return this.ships.every(function (val) { return val.isSunk; }); + } +} + +//// [2dArrays.js] +var Cell = (function () { + function Cell() { + } + return Cell; +})(); +var Ship = (function () { + function Ship() { + } + return Ship; +})(); +var Board = (function () { + function Board() { + } + Board.prototype.allShipsSunk = function () { + return this.ships.every(function (val) { + return val.isSunk; + }); + }; + return Board; +})(); diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..fe910c120b7b2 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.ts] //// + +//// [module.d.ts] +declare module Point { + export var Origin: { x: number; y: number; } +} + +//// [function.d.ts] +declare function Point(): { x: number; y: number; } + +//// [test.ts] +var cl: { x: number; y: number; } +var cl = Point(); +var cl = Point.Origin; + +//// [test.js] +var cl; +var cl = Point(); +var cl = Point.Origin; diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..461b844eab1ba --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js @@ -0,0 +1,31 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndAmbientWithSameNameAndCommonRoot.ts] //// + +//// [module.d.ts] +declare module A { + export module Point { + export var Origin: { + x: number; + y: number; + } + } +} + +//// [class.d.ts] +declare module A { + export class Point { + constructor(x: number, y: number); + x: number; + y: number; + } +} + +//// [test.ts] +var p: { x: number; y: number; } +var p = A.Point.Origin; +var p = new A.Point(0, 0); // unexpected error here, bug 840000 + + +//// [test.js] +var p; +var p = A.Point.Origin; +var p = new A.Point(0, 0); diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..b067168a38770 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.ts] //// + +//// [module.d.ts] +declare module A { + export module Point { + export var Origin: { + x: number; + y: number; + } + } +} + +//// [classPoint.ts] +module A { + export class Point { + constructor(public x: number, public y: number) { } + } +} + +//// [test.ts] +var p: { x: number; y: number; } +var p = A.Point.Origin; +var p = new A.Point(0, 0); // unexpected error here, bug 840000 + +//// [classPoint.js] +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Point = Point; +})(A || (A = {})); +//// [test.js] +var p; +var p = A.Point.Origin; +var p = new A.Point(0, 0); diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..90bed5cfd914d --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.ts] //// + +//// [module.d.ts] +declare module Point { + export var Origin: { x: number; y: number; } +} + +//// [function.ts] +function Point() { + return { x: 0, y: 0 }; +} + +//// [test.ts] +var cl: { x: number; y: number; } +var cl = Point(); +var cl = Point.Origin; + +//// [function.js] +function Point() { + return { x: 0, y: 0 }; +} +//// [test.js] +var cl; +var cl = Point(); +var cl = Point.Origin; diff --git a/tests/baselines/reference/ArrowFunctionExpression1.errors.txt b/tests/baselines/reference/ArrowFunctionExpression1.errors.txt new file mode 100644 index 0000000000000..25c9af3d28655 --- /dev/null +++ b/tests/baselines/reference/ArrowFunctionExpression1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/ArrowFunctionExpression1.ts (1 errors) ==== + var v = (public x: string) => { }; + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. \ No newline at end of file diff --git a/tests/baselines/reference/ArrowFunctionExpression1.js b/tests/baselines/reference/ArrowFunctionExpression1.js new file mode 100644 index 0000000000000..baa75809f6570 --- /dev/null +++ b/tests/baselines/reference/ArrowFunctionExpression1.js @@ -0,0 +1,6 @@ +//// [ArrowFunctionExpression1.ts] +var v = (public x: string) => { }; + +//// [ArrowFunctionExpression1.js] +var v = function (x) { +}; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt new file mode 100644 index 0000000000000..f7d6aafc0173d --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (5 errors) ==== + // all expected to be errors + + class clodule1{ + + id: string; + value: T; + } + + module clodule1 { + function f(x: T) { } + ~ +!!! Cannot find name 'T'. + } + + class clodule2{ + + id: string; + value: T; + } + + module clodule2 { + var x: T; + ~ +!!! Cannot find name 'T'. + + class D{ + ~ +!!! Cannot find name 'T'. + id: string; + value: U; + } + } + + class clodule3{ + + id: string; + value: T; + } + + module clodule3 { + export var y = { id: T }; + ~ +!!! Cannot find name 'T'. + } + + class clodule4{ + + id: string; + value: T; + } + + module clodule4 { + class D { + name: T; + ~ +!!! Cannot find name 'T'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js new file mode 100644 index 0000000000000..233c50baa8b29 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js @@ -0,0 +1,98 @@ +//// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts] +// all expected to be errors + +class clodule1{ + + id: string; + value: T; +} + +module clodule1 { + function f(x: T) { } +} + +class clodule2{ + + id: string; + value: T; +} + +module clodule2 { + var x: T; + + class D{ + id: string; + value: U; + } +} + +class clodule3{ + + id: string; + value: T; +} + +module clodule3 { + export var y = { id: T }; +} + +class clodule4{ + + id: string; + value: T; +} + +module clodule4 { + class D { + name: T; + } +} + + +//// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js] +var clodule1 = (function () { + function clodule1() { + } + return clodule1; +})(); +var clodule1; +(function (clodule1) { + function f(x) { + } +})(clodule1 || (clodule1 = {})); +var clodule2 = (function () { + function clodule2() { + } + return clodule2; +})(); +var clodule2; +(function (clodule2) { + var x; + var D = (function () { + function D() { + } + return D; + })(); +})(clodule2 || (clodule2 = {})); +var clodule3 = (function () { + function clodule3() { + } + return clodule3; +})(); +var clodule3; +(function (clodule3) { + clodule3.y = { id: T }; +})(clodule3 || (clodule3 = {})); +var clodule4 = (function () { + function clodule4() { + } + return clodule4; +})(); +var clodule4; +(function (clodule4) { + var D = (function () { + function D() { + } + return D; + })(); +})(clodule4 || (clodule4 = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt new file mode 100644 index 0000000000000..dad412363f733 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (1 errors) ==== + class clodule { + id: string; + value: T; + + static fn(id: U) { } + } + + module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): T { + ~~ +!!! Duplicate identifier 'fn'. + return x; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js new file mode 100644 index 0000000000000..dc14c15a81e74 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js @@ -0,0 +1,32 @@ +//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts] +class clodule { + id: string; + value: T; + + static fn(id: U) { } +} + +module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): T { + return x; + } +} + + + +//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js] +var clodule = (function () { + function clodule() { + } + clodule.fn = function (id) { + }; + return clodule; +})(); +var clodule; +(function (clodule) { + function fn(x, y) { + return x; + } + clodule.fn = fn; +})(clodule || (clodule = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt new file mode 100644 index 0000000000000..c45ffab41566f --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (1 errors) ==== + class clodule { + id: string; + value: T; + + static fn(id: string) { } + } + + module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): T { + ~~ +!!! Duplicate identifier 'fn'. + return x; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js new file mode 100644 index 0000000000000..5c8fd4dda33e0 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js @@ -0,0 +1,32 @@ +//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts] +class clodule { + id: string; + value: T; + + static fn(id: string) { } +} + +module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): T { + return x; + } +} + + + +//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js] +var clodule = (function () { + function clodule() { + } + clodule.fn = function (id) { + }; + return clodule; +})(); +var clodule; +(function (clodule) { + function fn(x, y) { + return x; + } + clodule.fn = fn; +})(clodule || (clodule = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt new file mode 100644 index 0000000000000..c38333f973278 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ==== + class clodule { + id: string; + value: T; + + private static sfn(id: string) { return 42; } + } + + module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): number { + return clodule.sfn('a'); + ~~~~~~~~~~~ +!!! Property 'clodule.sfn' is inaccessible. + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js new file mode 100644 index 0000000000000..49907748fc7af --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js @@ -0,0 +1,33 @@ +//// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts] +class clodule { + id: string; + value: T; + + private static sfn(id: string) { return 42; } +} + +module clodule { + // error: duplicate identifier expected + export function fn(x: T, y: T): number { + return clodule.sfn('a'); + } +} + + + +//// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js] +var clodule = (function () { + function clodule() { + } + clodule.sfn = function (id) { + return 42; + }; + return clodule; +})(); +var clodule; +(function (clodule) { + function fn(x, y) { + return clodule.sfn('a'); + } + clodule.fn = fn; +})(clodule || (clodule = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt new file mode 100644 index 0000000000000..eb2ef95f795ca --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (2 errors) ==== + class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 + } + + module Point { + export function Origin() { return null; } //expected duplicate identifier error + ~~~~~~ +!!! Duplicate identifier 'Origin'. + } + + + module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 + } + + export module Point { + export function Origin() { return ""; }//expected duplicate identifier error + ~~~~~~ +!!! Duplicate identifier 'Origin'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js new file mode 100644 index 0000000000000..b9386b28f9b69 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -0,0 +1,63 @@ +//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts] +class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 +} + +module Point { + export function Origin() { return null; } //expected duplicate identifier error +} + + +module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 + } + + export module Point { + export function Origin() { return ""; }//expected duplicate identifier error + } +} + +//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js] +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = function () { + return { x: 0, y: 0 }; + }; + return Point; +})(); +var Point; +(function (Point) { + function Origin() { + return null; + } + Point.Origin = Origin; +})(Point || (Point = {})); +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = function () { + return { x: 0, y: 0 }; + }; + return Point; + })(); + A.Point = Point; + (function (Point) { + function Origin() { + return ""; + } + Point.Origin = Origin; + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js new file mode 100644 index 0000000000000..79e1784b4fa36 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -0,0 +1,61 @@ +//// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts] +class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } +} + +module Point { + function Origin() { return ""; }// not an error, since not exported +} + + +module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } + } + + export module Point { + function Origin() { return ""; }// not an error since not exported + } +} + +//// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js] +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = function () { + return { x: 0, y: 0 }; + }; + return Point; +})(); +var Point; +(function (Point) { + function Origin() { + return ""; + } +})(Point || (Point = {})); +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = function () { + return { x: 0, y: 0 }; + }; + return Point; + })(); + A.Point = Point; + (function (Point) { + function Origin() { + return ""; + } + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt new file mode 100644 index 0000000000000..ad395751ebf7d --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (2 errors) ==== + class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + module Point { + export var Origin = ""; //expected duplicate identifier error + ~~~~~~ +!!! Duplicate identifier 'Origin'. + } + + + module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + export module Point { + export var Origin = ""; //expected duplicate identifier error + ~~~~~~ +!!! Duplicate identifier 'Origin'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js new file mode 100644 index 0000000000000..9323f83a1ec1d --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -0,0 +1,53 @@ +//// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts] +class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; +} + +module Point { + export var Origin = ""; //expected duplicate identifier error +} + + +module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + export module Point { + export var Origin = ""; //expected duplicate identifier error + } +} + +//// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js] +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = { x: 0, y: 0 }; + return Point; +})(); +var Point; +(function (Point) { + Point.Origin = ""; +})(Point || (Point = {})); +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = { x: 0, y: 0 }; + return Point; + })(); + A.Point = Point; + (function (Point) { + Point.Origin = ""; + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js new file mode 100644 index 0000000000000..9864d9d4eb0cb --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -0,0 +1,53 @@ +//// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts] +class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; +} + +module Point { + var Origin = ""; // not an error, since not exported +} + + +module A { + export class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + export module Point { + var Origin = ""; // not an error since not exported + } +} + +//// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js] +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = { x: 0, y: 0 }; + return Point; +})(); +var Point; +(function (Point) { + var Origin = ""; +})(Point || (Point = {})); +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.Origin = { x: 0, y: 0 }; + return Point; + })(); + A.Point = Point; + (function (Point) { + var Origin = ""; + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js new file mode 100644 index 0000000000000..d687b5ffa0ea3 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js @@ -0,0 +1,4 @@ +//// [ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts] + + +//// [ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js] diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..994da294ea973 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js @@ -0,0 +1,84 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleWithSameNameAndCommonRoot.ts] //// + +//// [class.ts] +module X.Y { + export class Point { + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + x: number; + y: number; + } +} + +//// [module.ts] +module X.Y { + export module Point { + export var Origin = new Point(0, 0); + } +} + +//// [test.ts] +//var cl: { x: number; y: number; } +var cl = new X.Y.Point(1,1); +var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? + + +//// [simple.ts] +class A { + id: string; +} + +module A { + export var Instance = new A(); +} + +// ensure merging works as expected +var a = A.Instance; +var a = new A(); +var a: { id: string }; + + +//// [class.js] +var X; +(function (X) { + (function (Y) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + Y.Point = Point; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +//// [module.js] +var X; +(function (X) { + (function (Y) { + (function (Point) { + Point.Origin = new Point(0, 0); + })(Y.Point || (Y.Point = {})); + var Point = Y.Point; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +//// [test.js] +var cl = new X.Y.Point(1, 1); +var cl = X.Y.Point.Origin; +//// [simple.js] +var A = (function () { + function A() { + } + return A; +})(); +var A; +(function (A) { + A.Instance = new A(); +})(A || (A = {})); +var a = A.Instance; +var a = new A(); +var a; diff --git a/tests/baselines/reference/ClassDeclaration10.errors.txt b/tests/baselines/reference/ClassDeclaration10.errors.txt new file mode 100644 index 0000000000000..e6da67e4f2ab2 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration10.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/ClassDeclaration10.ts (2 errors) ==== + class C { + constructor(); + ~~~~~~~~~~~~~~ +!!! Constructor implementation expected. + foo(); + ~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration10.js b/tests/baselines/reference/ClassDeclaration10.js new file mode 100644 index 0000000000000..3b1ae507e874f --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration10.js @@ -0,0 +1,12 @@ +//// [ClassDeclaration10.ts] +class C { + constructor(); + foo(); +} + +//// [ClassDeclaration10.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration11.errors.txt b/tests/baselines/reference/ClassDeclaration11.errors.txt new file mode 100644 index 0000000000000..dd121f25ad965 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration11.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ClassDeclaration11.ts (1 errors) ==== + class C { + constructor(); + ~~~~~~~~~~~~~~ +!!! Constructor implementation expected. + foo() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration11.js b/tests/baselines/reference/ClassDeclaration11.js new file mode 100644 index 0000000000000..6c4ba4ac6ec89 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration11.js @@ -0,0 +1,14 @@ +//// [ClassDeclaration11.ts] +class C { + constructor(); + foo() { } +} + +//// [ClassDeclaration11.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration13.errors.txt b/tests/baselines/reference/ClassDeclaration13.errors.txt new file mode 100644 index 0000000000000..d4794f73042cf --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration13.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ClassDeclaration13.ts (1 errors) ==== + class C { + foo(); + ~~~~~~ +!!! Function implementation expected. + bar() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration13.js b/tests/baselines/reference/ClassDeclaration13.js new file mode 100644 index 0000000000000..4c4324eb1e1b5 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration13.js @@ -0,0 +1,14 @@ +//// [ClassDeclaration13.ts] +class C { + foo(); + bar() { } +} + +//// [ClassDeclaration13.js] +var C = (function () { + function C() { + } + C.prototype.bar = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration14.errors.txt b/tests/baselines/reference/ClassDeclaration14.errors.txt new file mode 100644 index 0000000000000..afac27ca995ed --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration14.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/ClassDeclaration14.ts (2 errors) ==== + class C { + foo(); + ~~~~~~ +!!! Function implementation expected. + constructor(); + ~~~~~~~~~~~~~~ +!!! Constructor implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration14.js b/tests/baselines/reference/ClassDeclaration14.js new file mode 100644 index 0000000000000..7ae79132b9e55 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration14.js @@ -0,0 +1,12 @@ +//// [ClassDeclaration14.ts] +class C { + foo(); + constructor(); +} + +//// [ClassDeclaration14.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration15.errors.txt b/tests/baselines/reference/ClassDeclaration15.errors.txt new file mode 100644 index 0000000000000..e2ae4582bebf6 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration15.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ClassDeclaration15.ts (1 errors) ==== + class C { + foo(); + ~~~~~~ +!!! Function implementation expected. + constructor() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration15.js b/tests/baselines/reference/ClassDeclaration15.js new file mode 100644 index 0000000000000..d40b5855bba06 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration15.js @@ -0,0 +1,12 @@ +//// [ClassDeclaration15.ts] +class C { + foo(); + constructor() { } +} + +//// [ClassDeclaration15.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration21.errors.txt b/tests/baselines/reference/ClassDeclaration21.errors.txt new file mode 100644 index 0000000000000..1afcbb3265363 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration21.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ClassDeclaration21.ts (1 errors) ==== + class C { + 0(); + ~~~~ +!!! Function implementation expected. + 1() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration21.js b/tests/baselines/reference/ClassDeclaration21.js new file mode 100644 index 0000000000000..94cf3587c8daa --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration21.js @@ -0,0 +1,14 @@ +//// [ClassDeclaration21.ts] +class C { + 0(); + 1() { } +} + +//// [ClassDeclaration21.js] +var C = (function () { + function C() { + } + C.prototype[1] = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration22.errors.txt b/tests/baselines/reference/ClassDeclaration22.errors.txt new file mode 100644 index 0000000000000..6336ee0f6aa77 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration22.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ClassDeclaration22.ts (1 errors) ==== + class C { + "foo"(); + ~~~~~~~~ +!!! Function implementation expected. + "bar"() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration22.js b/tests/baselines/reference/ClassDeclaration22.js new file mode 100644 index 0000000000000..c44ba4ba43b92 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration22.js @@ -0,0 +1,14 @@ +//// [ClassDeclaration22.ts] +class C { + "foo"(); + "bar"() { } +} + +//// [ClassDeclaration22.js] +var C = (function () { + function C() { + } + C.prototype["bar"] = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration24.errors.txt b/tests/baselines/reference/ClassDeclaration24.errors.txt new file mode 100644 index 0000000000000..a64ad6589916a --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration24.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/ClassDeclaration24.ts (1 errors) ==== + class any { + ~~~ +!!! Class name cannot be 'any' + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration24.js b/tests/baselines/reference/ClassDeclaration24.js new file mode 100644 index 0000000000000..2043c6c163c80 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration24.js @@ -0,0 +1,10 @@ +//// [ClassDeclaration24.ts] +class any { +} + +//// [ClassDeclaration24.js] +var any = (function () { + function any() { + } + return any; +})(); diff --git a/tests/baselines/reference/ClassDeclaration25.errors.txt b/tests/baselines/reference/ClassDeclaration25.errors.txt new file mode 100644 index 0000000000000..cd247fc491d56 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration25.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/ClassDeclaration25.ts (2 errors) ==== + interface IList { + data(): T; + next(): string; + } + class List implements IList { + data(): U; + ~~~~~~~~~~ +!!! Function implementation expected. + next(): string; + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration25.js b/tests/baselines/reference/ClassDeclaration25.js new file mode 100644 index 0000000000000..c39aa39eeed0e --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration25.js @@ -0,0 +1,17 @@ +//// [ClassDeclaration25.ts] +interface IList { + data(): T; + next(): string; +} +class List implements IList { + data(): U; + next(): string; +} + + +//// [ClassDeclaration25.js] +var List = (function () { + function List() { + } + return List; +})(); diff --git a/tests/baselines/reference/ClassDeclaration8.errors.txt b/tests/baselines/reference/ClassDeclaration8.errors.txt new file mode 100644 index 0000000000000..a98453f35dfd6 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration8.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/ClassDeclaration8.ts (1 errors) ==== + class C { + constructor(); + ~~~~~~~~~~~~~~ +!!! Constructor implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration8.js b/tests/baselines/reference/ClassDeclaration8.js new file mode 100644 index 0000000000000..320fdf76205eb --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration8.js @@ -0,0 +1,11 @@ +//// [ClassDeclaration8.ts] +class C { + constructor(); +} + +//// [ClassDeclaration8.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/ClassDeclaration9.errors.txt b/tests/baselines/reference/ClassDeclaration9.errors.txt new file mode 100644 index 0000000000000..7ae1173947628 --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration9.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/ClassDeclaration9.ts (1 errors) ==== + class C { + foo(); + ~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration9.js b/tests/baselines/reference/ClassDeclaration9.js new file mode 100644 index 0000000000000..102715d8c165e --- /dev/null +++ b/tests/baselines/reference/ClassDeclaration9.js @@ -0,0 +1,11 @@ +//// [ClassDeclaration9.ts] +class C { + foo(); +} + +//// [ClassDeclaration9.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/CommentsOnObjectLiteral1.errors.txt b/tests/baselines/reference/CommentsOnObjectLiteral1.errors.txt new file mode 100644 index 0000000000000..dd737b2b54a0e --- /dev/null +++ b/tests/baselines/reference/CommentsOnObjectLiteral1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/commentsOnObjectLiteral1.ts (1 errors) ==== + var Person = makeClass( + ~~~~~~~~~ +!!! Cannot find name 'makeClass'. + /** + @scope Person + */ + { + } + ); \ No newline at end of file diff --git a/tests/baselines/reference/CommentsOnObjectLiteral2.errors.txt b/tests/baselines/reference/CommentsOnObjectLiteral2.errors.txt new file mode 100644 index 0000000000000..37c312a18e050 --- /dev/null +++ b/tests/baselines/reference/CommentsOnObjectLiteral2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/commentsOnObjectLiteral2.ts (1 errors) ==== + var Person = makeClass( + ~~~~~~~~~ +!!! Cannot find name 'makeClass'. + { + /** + This is just another way to define a constructor. + @constructs + @param {string} name The name of the person. + */ + initialize: function(name) { + this.name = name; + }, + } + ); \ No newline at end of file diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..d9fdb511fa213 --- /dev/null +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js @@ -0,0 +1,39 @@ +//// [EnumAndModuleWithSameNameAndCommonRoot.ts] +enum enumdule { + Red, Blue +} + +module enumdule { + + export class Point { + constructor(public x: number, public y: number) { } + } +} + +var x: enumdule; +var x = enumdule.Red; + +var y: { x: number; y: number }; +var y = new enumdule.Point(0, 0); + +//// [EnumAndModuleWithSameNameAndCommonRoot.js] +var enumdule; +(function (enumdule) { + enumdule[enumdule["Red"] = 0] = "Red"; + enumdule[enumdule["Blue"] = 1] = "Blue"; +})(enumdule || (enumdule = {})); +var enumdule; +(function (enumdule) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + enumdule.Point = Point; +})(enumdule || (enumdule = {})); +var x; +var x = 0 /* Red */; +var y; +var y = new enumdule.Point(0, 0); diff --git a/tests/baselines/reference/ExportAssignment7.errors.txt b/tests/baselines/reference/ExportAssignment7.errors.txt new file mode 100644 index 0000000000000..721f5ef264221 --- /dev/null +++ b/tests/baselines/reference/ExportAssignment7.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ==== + export class C { + ~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + export = B; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + ~~~~~~~~~~~ +!!! Cannot find name 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/ExportAssignment7.js b/tests/baselines/reference/ExportAssignment7.js new file mode 100644 index 0000000000000..ce4f5d7bf09c0 --- /dev/null +++ b/tests/baselines/reference/ExportAssignment7.js @@ -0,0 +1,13 @@ +//// [ExportAssignment7.ts] +export class C { +} + +export = B; + +//// [ExportAssignment7.js] +var C = (function () { + function C() { + } + return C; +})(); +exports.C = C; diff --git a/tests/baselines/reference/ExportAssignment8.errors.txt b/tests/baselines/reference/ExportAssignment8.errors.txt new file mode 100644 index 0000000000000..96110dc37b880 --- /dev/null +++ b/tests/baselines/reference/ExportAssignment8.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ==== + export = B; + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + ~~~~~~~~~~~ +!!! Cannot find name 'B'. + + export class C { + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportAssignment8.js b/tests/baselines/reference/ExportAssignment8.js new file mode 100644 index 0000000000000..2f7ac9ee69f7d --- /dev/null +++ b/tests/baselines/reference/ExportAssignment8.js @@ -0,0 +1,13 @@ +//// [ExportAssignment8.ts] +export = B; + +export class C { +} + +//// [ExportAssignment8.js] +var C = (function () { + function C() { + } + return C; +})(); +exports.C = C; diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js new file mode 100644 index 0000000000000..5ee537f568eea --- /dev/null +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js @@ -0,0 +1,36 @@ +//// [ExportClassWhichExtendsInterfaceWithInaccessibleType.ts] +module A { + + interface Point { + x: number; + y: number; + + fromOrigin(p: Point): number; + } + + export class Point2d implements Point { + constructor(public x: number, public y: number) { } + + fromOrigin(p: Point) { + return 1; + } + } +} + + + +//// [ExportClassWhichExtendsInterfaceWithInaccessibleType.js] +var A; +(function (A) { + var Point2d = (function () { + function Point2d(x, y) { + this.x = x; + this.y = y; + } + Point2d.prototype.fromOrigin = function (p) { + return 1; + }; + return Point2d; + })(); + A.Point2d = Point2d; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js new file mode 100644 index 0000000000000..bfa243937d646 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -0,0 +1,56 @@ +//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts] +module A { + + export class Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + } +} + + +//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; + A.Origin = { x: 0, y: 0 }; + var Point3d = (function (_super) { + __extends(Point3d, _super); + function Point3d() { + _super.apply(this, arguments); + } + return Point3d; + })(Point); + A.Point3d = Point3d; + A.Origin3d = { x: 0, y: 0, z: 0 }; + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + return Line; + })(); + A.Line = Line; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js new file mode 100644 index 0000000000000..687600364fc3a --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js @@ -0,0 +1,32 @@ +//// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts] +module A { + + class Point { + x: number; + y: number; + } + + export class points { + + [idx: number]: Point; + [idx: string]: Point; + } +} + + + +//// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + var points = (function () { + function points() { + } + return points; + })(); + A.points = points; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js new file mode 100644 index 0000000000000..71a43788c55b4 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -0,0 +1,62 @@ +//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts] +module A { + + class Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + + static fromorigin2d(p: Point): Line{ + return null; + } + } +} + + +//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Origin = { x: 0, y: 0 }; + var Point3d = (function (_super) { + __extends(Point3d, _super); + function Point3d() { + _super.apply(this, arguments); + } + return Point3d; + })(Point); + A.Point3d = Point3d; + A.Origin3d = { x: 0, y: 0, z: 0 }; + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + Line.fromorigin2d = function (p) { + return null; + }; + return Line; + })(); + A.Line = Line; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js new file mode 100644 index 0000000000000..21d969d242c79 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js @@ -0,0 +1,39 @@ +//// [ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts] +module A { + + export class Point { + x: number; + y: number; + } + + export class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } +} + +//// [ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + return Line; + })(); + A.Line = Line; + function fromOrigin(p) { + return new Line({ x: 0, y: 0 }, p); + } + A.fromOrigin = fromOrigin; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js new file mode 100644 index 0000000000000..99831f106299d --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js @@ -0,0 +1,38 @@ +//// [ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts] +module A { + + class Point { + x: number; + y: number; + } + + export class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } +} + +//// [ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + return Line; + })(); + A.Line = Line; + function fromOrigin(p) { + return new Line({ x: 0, y: 0 }, p); + } + A.fromOrigin = fromOrigin; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js new file mode 100644 index 0000000000000..3037e33d88007 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js @@ -0,0 +1,38 @@ +//// [ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts] +module A { + + export class Point { + x: number; + y: number; + } + + class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } +} + +//// [ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + return Line; + })(); + function fromOrigin(p) { + return new Line({ x: 0, y: 0 }, p); + } + A.fromOrigin = fromOrigin; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js new file mode 100644 index 0000000000000..e2b32a3bca409 --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -0,0 +1,30 @@ +//// [ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts] +module A { + + export interface Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export interface Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export interface Line{ + new (start: TPoint, end: TPoint); + start: TPoint; + end: TPoint; + } +} + + +//// [ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] +var A; +(function (A) { + A.Origin = { x: 0, y: 0 }; + A.Origin3d = { x: 0, y: 0, z: 0 }; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js new file mode 100644 index 0000000000000..8f5df1d3fceba --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js @@ -0,0 +1,18 @@ +//// [ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts] +module A { + + interface Point { + x: number; + y: number; + } + + export interface points { + + [idx: number]: Point; + [idx: string]: Point; + } +} + + + +//// [ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js] diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js new file mode 100644 index 0000000000000..7625500a1d0a4 --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js @@ -0,0 +1,31 @@ +//// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts] +module A { + + interface Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export interface Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export interface Line{ + new (start: TPoint, end: TPoint); + + start: TPoint; + end: TPoint; + } +} + + +//// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js] +var A; +(function (A) { + A.Origin = { x: 0, y: 0 }; + A.Origin3d = { x: 0, y: 0, z: 0 }; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js new file mode 100644 index 0000000000000..e44c511d8dabf --- /dev/null +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js @@ -0,0 +1,47 @@ +//// [ExportModuleWithAccessibleTypesOnItsExportedMembers.ts] +module A { + + export class Point { + constructor(public x: number, public y: number) { } + } + + export module B { + export var Origin: Point = new Point(0, 0); + + export class Line { + constructor(start: Point, end: Point) { + + } + + static fromOrigin(p: Point) { + return new Line({ x: 0, y: 0 }, p); + } + } + } +} + +//// [ExportModuleWithAccessibleTypesOnItsExportedMembers.js] +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Point = Point; + (function (B) { + B.Origin = new Point(0, 0); + var Line = (function () { + function Line(start, end) { + } + Line.fromOrigin = function (p) { + return new Line({ x: 0, y: 0 }, p); + }; + return Line; + })(); + B.Line = Line; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js new file mode 100644 index 0000000000000..46361dd41bb97 --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js @@ -0,0 +1,26 @@ +//// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts] +module A { + + class Point { + constructor(public x: number, public y: number) { } + } + + export var Origin: Point = { x: 0, y: 0 }; + + export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; +} + + +//// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js] +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Origin = { x: 0, y: 0 }; + A.Unity = { start: new Point(0, 0), end: new Point(1, 0) }; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..b56c3a9fe93ab --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (3 errors) ==== + module A { + + class Point { + constructor(public x: number, public y: number) { } + } + + export var UnitSquare : { + top: { left: Point, right: Point }, + ~ +!!! ';' expected. + ~ +!!! ';' expected. + bottom: { left: Point, right: Point } + ~ +!!! ';' expected. + } = null; + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js new file mode 100644 index 0000000000000..cb1e18d094e04 --- /dev/null +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js @@ -0,0 +1,21 @@ +//// [ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts] +module A { + class B { + id: number; + } + + export var beez: Array; + export var beez2 = new Array(); +} + +//// [ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js] +var A; +(function (A) { + var B = (function () { + function B() { + } + return B; + })(); + A.beez; + A.beez2 = new Array(); +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js new file mode 100644 index 0000000000000..e23d7ae14561b --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js @@ -0,0 +1,18 @@ +//// [ExportVariableWithAccessibleTypeInTypeAnnotation.ts] +module A { + + export interface Point { + x: number; + y: number; + } + + // valid since Point is exported + export var Origin: Point = { x: 0, y: 0 }; +} + + +//// [ExportVariableWithAccessibleTypeInTypeAnnotation.js] +var A; +(function (A) { + A.Origin = { x: 0, y: 0 }; +})(A || (A = {})); diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js new file mode 100644 index 0000000000000..f6e60e3f4ab4d --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js @@ -0,0 +1,26 @@ +//// [ExportVariableWithInaccessibleTypeInTypeAnnotation.ts] +module A { + + export interface Point { + x: number; + y: number; + } + + // valid since Point is exported + export var Origin: Point = { x: 0, y: 0 }; + + interface Point3d extends Point { + z: number; + } + + // invalid Point3d is not exported + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +} + + +//// [ExportVariableWithInaccessibleTypeInTypeAnnotation.js] +var A; +(function (A) { + A.Origin = { x: 0, y: 0 }; + A.Origin3d = { x: 0, y: 0, z: 0 }; +})(A || (A = {})); diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..f2168a9056fcc --- /dev/null +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/function.ts (0 errors) ==== + module A { + export function Point() { + return { x: 0, y: 0 }; + } + } + +==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (0 errors) ==== + module A { + export module Point { + export var Origin = { x: 0, y: 0 }; + } + } + +==== tests/cases/conformance/internalModules/DeclarationMerging/test.ts (1 errors) ==== + var fn: () => { x: number; y: number }; + var fn = A.Point; + ~~ +!!! Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. + + var cl: { x: number; y: number; } + var cl = A.Point(); + var cl = A.Point.Origin; // not expected to be an error. + + +==== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts (1 errors) ==== + module B { + + export function Point() { + return { x: 0, y: 0 }; + } + + export module Point { + export var Origin = { x: 0, y: 0 }; + } + } + + var fn: () => { x: number; y: number }; + var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected + ~~ +!!! Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. + + var cl: { x: number; y: number; } + var cl = B.Point(); + var cl = B.Point.Origin; + \ No newline at end of file diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..e0ea0bd07ce04 --- /dev/null +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js @@ -0,0 +1,84 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/FunctionAndModuleWithSameNameAndCommonRoot.ts] //// + +//// [function.ts] +module A { + export function Point() { + return { x: 0, y: 0 }; + } +} + +//// [module.ts] +module A { + export module Point { + export var Origin = { x: 0, y: 0 }; + } +} + +//// [test.ts] +var fn: () => { x: number; y: number }; +var fn = A.Point; + +var cl: { x: number; y: number; } +var cl = A.Point(); +var cl = A.Point.Origin; // not expected to be an error. + + +//// [simple.ts] +module B { + + export function Point() { + return { x: 0, y: 0 }; + } + + export module Point { + export var Origin = { x: 0, y: 0 }; + } +} + +var fn: () => { x: number; y: number }; +var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected + +var cl: { x: number; y: number; } +var cl = B.Point(); +var cl = B.Point.Origin; + + +//// [function.js] +var A; +(function (A) { + function Point() { + return { x: 0, y: 0 }; + } + A.Point = Point; +})(A || (A = {})); +//// [module.js] +var A; +(function (A) { + (function (Point) { + Point.Origin = { x: 0, y: 0 }; + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); +//// [test.js] +var fn; +var fn = A.Point; +var cl; +var cl = A.Point(); +var cl = A.Point.Origin; +//// [simple.js] +var B; +(function (B) { + function Point() { + return { x: 0, y: 0 }; + } + B.Point = Point; + (function (Point) { + Point.Origin = { x: 0, y: 0 }; + })(B.Point || (B.Point = {})); + var Point = B.Point; +})(B || (B = {})); +var fn; +var fn = B.Point; +var cl; +var cl = B.Point(); +var cl = B.Point.Origin; diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js new file mode 100644 index 0000000000000..2ce4ea31010c0 --- /dev/null +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/FunctionAndModuleWithSameNameAndDifferentCommonRoot.ts] //// + +//// [function.ts] +module A { + export function Point() { + return { x: 0, y: 0 }; + } +} + +//// [module.ts] +module B { + export module Point { + export var Origin = { x: 0, y: 0 }; + } +} + +//// [test.ts] +var fn: () => { x: number; y: number }; +var fn = A.Point; + +var cl: { x: number; y: number; } +var cl = B.Point.Origin; + + +//// [function.js] +var A; +(function (A) { + function Point() { + return { x: 0, y: 0 }; + } + A.Point = Point; +})(A || (A = {})); +//// [module.js] +var B; +(function (B) { + (function (Point) { + Point.Origin = { x: 0, y: 0 }; + })(B.Point || (B.Point = {})); + var Point = B.Point; +})(B || (B = {})); +//// [test.js] +var fn; +var fn = A.Point; +var cl; +var cl = B.Point.Origin; diff --git a/tests/baselines/reference/FunctionDeclaration3.errors.txt b/tests/baselines/reference/FunctionDeclaration3.errors.txt new file mode 100644 index 0000000000000..a0f2601c3a818 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/FunctionDeclaration3.ts (1 errors) ==== + function foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3.js b/tests/baselines/reference/FunctionDeclaration3.js new file mode 100644 index 0000000000000..b77c1f4fe8227 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3.js @@ -0,0 +1,4 @@ +//// [FunctionDeclaration3.ts] +function foo(); + +//// [FunctionDeclaration3.js] diff --git a/tests/baselines/reference/FunctionDeclaration4.errors.txt b/tests/baselines/reference/FunctionDeclaration4.errors.txt new file mode 100644 index 0000000000000..1c03570a8fbd6 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/FunctionDeclaration4.ts (1 errors) ==== + function foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + function bar() { } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration4.js b/tests/baselines/reference/FunctionDeclaration4.js new file mode 100644 index 0000000000000..53e040b28fc5c --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration4.ts] +function foo(); +function bar() { } + +//// [FunctionDeclaration4.js] +function bar() { +} diff --git a/tests/baselines/reference/FunctionDeclaration6.errors.txt b/tests/baselines/reference/FunctionDeclaration6.errors.txt new file mode 100644 index 0000000000000..056ad27c3fda4 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/FunctionDeclaration6.ts (1 errors) ==== + { + function foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + function bar() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6.js b/tests/baselines/reference/FunctionDeclaration6.js new file mode 100644 index 0000000000000..093fac7ed7c5e --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6.js @@ -0,0 +1,11 @@ +//// [FunctionDeclaration6.ts] +{ + function foo(); + function bar() { } +} + +//// [FunctionDeclaration6.js] +{ + function bar() { + } +} diff --git a/tests/baselines/reference/FunctionDeclaration7.errors.txt b/tests/baselines/reference/FunctionDeclaration7.errors.txt new file mode 100644 index 0000000000000..cf6ee375de538 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/FunctionDeclaration7.ts (1 errors) ==== + module M { + function foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7.js b/tests/baselines/reference/FunctionDeclaration7.js new file mode 100644 index 0000000000000..545d9f236cae0 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7.js @@ -0,0 +1,9 @@ +//// [FunctionDeclaration7.ts] +module M { + function foo(); +} + +//// [FunctionDeclaration7.js] +var M; +(function (M) { +})(M || (M = {})); diff --git a/tests/baselines/reference/InterfaceDeclaration8.errors.txt b/tests/baselines/reference/InterfaceDeclaration8.errors.txt new file mode 100644 index 0000000000000..eba4ccd7023fb --- /dev/null +++ b/tests/baselines/reference/InterfaceDeclaration8.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/InterfaceDeclaration8.ts (1 errors) ==== + interface string { + ~~~~~~ +!!! Interface name cannot be 'string' + } \ No newline at end of file diff --git a/tests/baselines/reference/InterfaceDeclaration8.js b/tests/baselines/reference/InterfaceDeclaration8.js new file mode 100644 index 0000000000000..69e98947a0276 --- /dev/null +++ b/tests/baselines/reference/InterfaceDeclaration8.js @@ -0,0 +1,5 @@ +//// [InterfaceDeclaration8.ts] +interface string { +} + +//// [InterfaceDeclaration8.js] diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt new file mode 100644 index 0000000000000..c32511eba0d66 --- /dev/null +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts (2 errors) ==== + module M { + export interface Point { x: number; y: number } + } + + var m = M; // Error, not instantiated can not be used as var + ~ +!!! Cannot find name 'M'. + + var x: typeof M; // Error only a namespace + ~ +!!! Cannot find name 'M'. + \ No newline at end of file diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.js b/tests/baselines/reference/InvalidNonInstantiatedModule.js new file mode 100644 index 0000000000000..0f6c7fe62cb6a --- /dev/null +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.js @@ -0,0 +1,13 @@ +//// [InvalidNonInstantiatedModule.ts] +module M { + export interface Point { x: number; y: number } +} + +var m = M; // Error, not instantiated can not be used as var + +var x: typeof M; // Error only a namespace + + +//// [InvalidNonInstantiatedModule.js] +var m = M; +var x; diff --git a/tests/baselines/reference/LogicalNotExpression1.errors.txt b/tests/baselines/reference/LogicalNotExpression1.errors.txt new file mode 100644 index 0000000000000..b38a05bb31fe5 --- /dev/null +++ b/tests/baselines/reference/LogicalNotExpression1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/logicalNotExpression1.ts (1 errors) ==== + !foo; + ~~~ +!!! Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt new file mode 100644 index 0000000000000..c96547e0aa73f --- /dev/null +++ b/tests/baselines/reference/MemberAccessorDeclaration15.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/MemberAccessorDeclaration15.ts (2 errors) ==== + class C { + set Foo(public a: number) { } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..5a7def7ab700b --- /dev/null +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js @@ -0,0 +1,69 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndClassWithSameNameAndCommonRoot.ts] //// + +//// [module.ts] +module X.Y { + export module Point { + export var Origin = new Point(0, 0); + } +} + +//// [classPoint.ts] +module X.Y { + // duplicate identifier + export class Point { + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + x: number; + y: number; + } +} + +//// [simple.ts] +module A { + export var Instance = new A(); +} + +// duplicate identifier +class A { + id: string; +} + + +//// [module.js] +var X; +(function (X) { + (function (Y) { + (function (Point) { + Point.Origin = new Point(0, 0); + })(Y.Point || (Y.Point = {})); + var Point = Y.Point; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +//// [classPoint.js] +var X; +(function (X) { + (function (Y) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + Y.Point = Point; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +//// [simple.js] +var A; +(function (A) { + A.Instance = new A(); +})(A || (A = {})); +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..533843d294732 --- /dev/null +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js @@ -0,0 +1,39 @@ +//// [ModuleAndEnumWithSameNameAndCommonRoot.ts] +module enumdule { + + export class Point { + constructor(public x: number, public y: number) { } + } +} + +enum enumdule { + Red, Blue +} + +var x: enumdule; +var x = enumdule.Red; + +var y: { x: number; y: number }; +var y = new enumdule.Point(0, 0); + +//// [ModuleAndEnumWithSameNameAndCommonRoot.js] +var enumdule; +(function (enumdule) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + enumdule.Point = Point; +})(enumdule || (enumdule = {})); +var enumdule; +(function (enumdule) { + enumdule[enumdule["Red"] = 0] = "Red"; + enumdule[enumdule["Blue"] = 1] = "Blue"; +})(enumdule || (enumdule = {})); +var x; +var x = 0 /* Red */; +var y; +var y = new enumdule.Point(0, 0); diff --git a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js new file mode 100644 index 0000000000000..2dd9f25a3b517 --- /dev/null +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndFunctionWithSameNameAndCommonRoot.ts] //// + +//// [module.ts] +module A { + export module Point { + export var Origin = { x: 0, y: 0 }; + } +} + +//// [function.ts] +module A { + // duplicate identifier error + export function Point() { + return { x: 0, y: 0 }; + } +} + +//// [simple.ts] +module B { + + export module Point { + export var Origin = { x: 0, y: 0 }; + } + + // duplicate identifier error + export function Point() { + return { x: 0, y: 0 }; + } +} + + +//// [module.js] +var A; +(function (A) { + (function (Point) { + Point.Origin = { x: 0, y: 0 }; + })(A.Point || (A.Point = {})); + var Point = A.Point; +})(A || (A = {})); +//// [function.js] +var A; +(function (A) { + function Point() { + return { x: 0, y: 0 }; + } + A.Point = Point; +})(A || (A = {})); +//// [simple.js] +var B; +(function (B) { + (function (Point) { + Point.Origin = { x: 0, y: 0 }; + })(B.Point || (B.Point = {})); + var Point = B.Point; + function Point() { + return { x: 0, y: 0 }; + } + B.Point = Point; +})(B || (B = {})); diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt new file mode 100644 index 0000000000000..d87dbe1a1636f --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedClasses.ts (2 errors) ==== + module A { + export class A { + id: number; + name: string; + } + + export class AG{ + id: T; + name: U; + } + + class A2 { + id: number; + name: string; + } + + class AG2{ + id: T; + name: U; + } + } + + // no errors expected, these are all exported + var a: { id: number; name: string }; + var a = new A.A(); + + var AG = new A.AG() + + // errors expected, these are not exported + var a2 = new A.A2(); + ~~ +!!! Property 'A2' does not exist on type 'typeof A'. + var ag2 = new A.A2(); + ~~ +!!! Property 'A2' does not exist on type 'typeof A'. + + \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js new file mode 100644 index 0000000000000..c4d189bf76b8b --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js @@ -0,0 +1,66 @@ +//// [ModuleWithExportedAndNonExportedClasses.ts] +module A { + export class A { + id: number; + name: string; + } + + export class AG{ + id: T; + name: U; + } + + class A2 { + id: number; + name: string; + } + + class AG2{ + id: T; + name: U; + } +} + +// no errors expected, these are all exported +var a: { id: number; name: string }; +var a = new A.A(); + +var AG = new A.AG() + +// errors expected, these are not exported +var a2 = new A.A2(); +var ag2 = new A.A2(); + + + +//// [ModuleWithExportedAndNonExportedClasses.js] +var A; +(function (A) { + var A = (function () { + function A() { + } + return A; + })(); + A.A = A; + var AG = (function () { + function AG() { + } + return AG; + })(); + A.AG = AG; + var A2 = (function () { + function A2() { + } + return A2; + })(); + var AG2 = (function () { + function AG2() { + } + return AG2; + })(); +})(A || (A = {})); +var a; +var a = new A.A(); +var AG = new A.AG(); +var a2 = new A.A2(); +var ag2 = new A.A2(); diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt new file mode 100644 index 0000000000000..59cbd67c9160a --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedEnums.ts (1 errors) ==== + module A { + export enum Color { Red, Blue } + enum Day { Monday, Tuesday } + } + + // not an error since exported + var a: A.Color = A.Color.Red; + + // error not exported + var b = A.Day.Monday; + ~~~ +!!! Property 'Day' does not exist on type 'typeof A'. + \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js new file mode 100644 index 0000000000000..6a147257323b5 --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js @@ -0,0 +1,29 @@ +//// [ModuleWithExportedAndNonExportedEnums.ts] +module A { + export enum Color { Red, Blue } + enum Day { Monday, Tuesday } +} + +// not an error since exported +var a: A.Color = A.Color.Red; + +// error not exported +var b = A.Day.Monday; + + +//// [ModuleWithExportedAndNonExportedEnums.js] +var A; +(function (A) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Blue"] = 1] = "Blue"; + })(A.Color || (A.Color = {})); + var Color = A.Color; + var Day; + (function (Day) { + Day[Day["Monday"] = 0] = "Monday"; + Day[Day["Tuesday"] = 1] = "Tuesday"; + })(Day || (Day = {})); +})(A || (A = {})); +var a = 0 /* Red */; +var b = A.Day.Monday; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt new file mode 100644 index 0000000000000..dc3b4833463ca --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedFunctions.ts (2 errors) ==== + module A { + + export function fn(s: string) { + return true; + } + + export function fng(s: T): U { + return null; + } + + function fn2(s: string) { + return false; + } + + function fng2(s: T): U { + return null; + } + } + + // these should not be errors since the functions are exported + var fn: (s: string) => boolean; + var fn = A.fn; + + var fng: (s: T) => U; + var fng = A.fng; // bug 838015 + + // these should be errors since the functions are not exported + var fn2 = A.fn2; + ~~~ +!!! Property 'fn2' does not exist on type 'typeof A'. + var fng2 = A.fng2; + ~~~~ +!!! Property 'fng2' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js new file mode 100644 index 0000000000000..35b5959bfcd9c --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js @@ -0,0 +1,55 @@ +//// [ModuleWithExportedAndNonExportedFunctions.ts] +module A { + + export function fn(s: string) { + return true; + } + + export function fng(s: T): U { + return null; + } + + function fn2(s: string) { + return false; + } + + function fng2(s: T): U { + return null; + } +} + +// these should not be errors since the functions are exported +var fn: (s: string) => boolean; +var fn = A.fn; + +var fng: (s: T) => U; +var fng = A.fng; // bug 838015 + +// these should be errors since the functions are not exported +var fn2 = A.fn2; +var fng2 = A.fng2; + +//// [ModuleWithExportedAndNonExportedFunctions.js] +var A; +(function (A) { + function fn(s) { + return true; + } + A.fn = fn; + function fng(s) { + return null; + } + A.fng = fng; + function fn2(s) { + return false; + } + function fng2(s) { + return null; + } +})(A || (A = {})); +var fn; +var fn = A.fn; +var fng; +var fng = A.fng; +var fn2 = A.fn2; +var fng2 = A.fng2; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt new file mode 100644 index 0000000000000..07233c96782d5 --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt @@ -0,0 +1,42 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedImportAlias.ts (1 errors) ==== + module A { + export interface Point { + x: number; + y: number; + } + + interface Point3d extends Point { + z: number; + } + } + + module B { + export class Line { + constructor(public start: A.Point, public end: A.Point) { } + } + } + + module Geometry { + export import Points = A; + import Lines = B; + + export var Origin: Points.Point = { x: 0, y: 0 }; + + // this is valid since B.Line _is_ visible outside Geometry + export var Unit: Lines.Line = new Lines.Line(Origin, { x: 1, y: 0 }); + } + + // expected to work since all are exported + var p: { x: number; y: number }; + var p: Geometry.Points.Point; + var p = Geometry.Origin; + + var line: { start: { x: number; y: number }; end: { x: number; y: number; } }; + var line = Geometry.Unit; + + // not expected to work since non are exported + var line = Geometry.Lines.Line; + ~~~~~ +!!! Property 'Lines' does not exist on type 'typeof Geometry'. + + \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js new file mode 100644 index 0000000000000..101031740ccb0 --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js @@ -0,0 +1,65 @@ +//// [ModuleWithExportedAndNonExportedImportAlias.ts] +module A { + export interface Point { + x: number; + y: number; + } + + interface Point3d extends Point { + z: number; + } +} + +module B { + export class Line { + constructor(public start: A.Point, public end: A.Point) { } + } +} + +module Geometry { + export import Points = A; + import Lines = B; + + export var Origin: Points.Point = { x: 0, y: 0 }; + + // this is valid since B.Line _is_ visible outside Geometry + export var Unit: Lines.Line = new Lines.Line(Origin, { x: 1, y: 0 }); +} + +// expected to work since all are exported +var p: { x: number; y: number }; +var p: Geometry.Points.Point; +var p = Geometry.Origin; + +var line: { start: { x: number; y: number }; end: { x: number; y: number; } }; +var line = Geometry.Unit; + +// not expected to work since non are exported +var line = Geometry.Lines.Line; + + + +//// [ModuleWithExportedAndNonExportedImportAlias.js] +var B; +(function (B) { + var Line = (function () { + function Line(start, end) { + this.start = start; + this.end = end; + } + return Line; + })(); + B.Line = Line; +})(B || (B = {})); +var Geometry; +(function (Geometry) { + var Lines = B; + Geometry.Origin = { x: 0, y: 0 }; + Geometry.Unit = new Lines.Line(Geometry.Origin, { x: 1, y: 0 }); +})(Geometry || (Geometry = {})); +var p; +var p; +var p = Geometry.Origin; +var line; +var line = Geometry.Unit; +var line = Geometry.Lines.Line; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt new file mode 100644 index 0000000000000..737ec677339c3 --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedVariables.ts (1 errors) ==== + module A { + export var x = 'hello world' + var y = 12; + } + + + var x: string; + var x = A.x; + + // Error, since y is not exported + var y = A.y; + ~ +!!! Property 'y' does not exist on type 'typeof A'. + \ No newline at end of file diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js new file mode 100644 index 0000000000000..2563aafd95aa0 --- /dev/null +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js @@ -0,0 +1,23 @@ +//// [ModuleWithExportedAndNonExportedVariables.ts] +module A { + export var x = 'hello world' + var y = 12; +} + + +var x: string; +var x = A.x; + +// Error, since y is not exported +var y = A.y; + + +//// [ModuleWithExportedAndNonExportedVariables.js] +var A; +(function (A) { + A.x = 'hello world'; + var y = 12; +})(A || (A = {})); +var x; +var x = A.x; +var y = A.y; diff --git a/tests/baselines/reference/OverloadResolutionOnDefaultConstructor1.errors.txt b/tests/baselines/reference/OverloadResolutionOnDefaultConstructor1.errors.txt new file mode 100644 index 0000000000000..c99351408185e --- /dev/null +++ b/tests/baselines/reference/OverloadResolutionOnDefaultConstructor1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/overloadResolutionOnDefaultConstructor1.ts (1 errors) ==== + class Bar { + public clone() { + return new Bar(0); + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList13.errors.txt b/tests/baselines/reference/ParameterList13.errors.txt new file mode 100644 index 0000000000000..63f41b0e230cf --- /dev/null +++ b/tests/baselines/reference/ParameterList13.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/ParameterList13.ts (1 errors) ==== + interface I { + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList13.js b/tests/baselines/reference/ParameterList13.js new file mode 100644 index 0000000000000..3c27c9c1a0ad1 --- /dev/null +++ b/tests/baselines/reference/ParameterList13.js @@ -0,0 +1,6 @@ +//// [ParameterList13.ts] +interface I { + new (public x); +} + +//// [ParameterList13.js] diff --git a/tests/baselines/reference/ParameterList4.errors.txt b/tests/baselines/reference/ParameterList4.errors.txt new file mode 100644 index 0000000000000..e669cbfec68ca --- /dev/null +++ b/tests/baselines/reference/ParameterList4.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/ParameterList4.ts (1 errors) ==== + function F(public A) { + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList4.js b/tests/baselines/reference/ParameterList4.js new file mode 100644 index 0000000000000..90a89cef2ae06 --- /dev/null +++ b/tests/baselines/reference/ParameterList4.js @@ -0,0 +1,7 @@ +//// [ParameterList4.ts] +function F(public A) { +} + +//// [ParameterList4.js] +function F(A) { +} diff --git a/tests/baselines/reference/ParameterList5.errors.txt b/tests/baselines/reference/ParameterList5.errors.txt new file mode 100644 index 0000000000000..37487b5c3199d --- /dev/null +++ b/tests/baselines/reference/ParameterList5.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ParameterList5.ts (2 errors) ==== + function A(): (public B) => C { + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~ +!!! Cannot find name 'C'. + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList5.js b/tests/baselines/reference/ParameterList5.js new file mode 100644 index 0000000000000..bcdfe02864050 --- /dev/null +++ b/tests/baselines/reference/ParameterList5.js @@ -0,0 +1,7 @@ +//// [ParameterList5.ts] +function A(): (public B) => C { +} + +//// [ParameterList5.js] +function A() { +} diff --git a/tests/baselines/reference/ParameterList6.errors.txt b/tests/baselines/reference/ParameterList6.errors.txt new file mode 100644 index 0000000000000..c7037a3bb9a6e --- /dev/null +++ b/tests/baselines/reference/ParameterList6.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/ParameterList6.ts (1 errors) ==== + class C { + constructor(C: (public A) => any) { + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList6.js b/tests/baselines/reference/ParameterList6.js new file mode 100644 index 0000000000000..824b288572f21 --- /dev/null +++ b/tests/baselines/reference/ParameterList6.js @@ -0,0 +1,12 @@ +//// [ParameterList6.ts] +class C { + constructor(C: (public A) => any) { + } +} + +//// [ParameterList6.js] +var C = (function () { + function C(C) { + } + return C; +})(); diff --git a/tests/baselines/reference/ParameterList7.errors.txt b/tests/baselines/reference/ParameterList7.errors.txt new file mode 100644 index 0000000000000..6179eff50c71f --- /dev/null +++ b/tests/baselines/reference/ParameterList7.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/ParameterList7.ts (2 errors) ==== + class C1 { + constructor(public p1:string); // ERROR + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(private p2:number); // ERROR + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public p3:any) {} // OK + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList7.js b/tests/baselines/reference/ParameterList7.js new file mode 100644 index 0000000000000..725baa0740eb9 --- /dev/null +++ b/tests/baselines/reference/ParameterList7.js @@ -0,0 +1,14 @@ +//// [ParameterList7.ts] +class C1 { + constructor(public p1:string); // ERROR + constructor(private p2:number); // ERROR + constructor(public p3:any) {} // OK +} + +//// [ParameterList7.js] +var C1 = (function () { + function C1(p3) { + this.p3 = p3; + } + return C1; +})(); diff --git a/tests/baselines/reference/ParameterList8.errors.txt b/tests/baselines/reference/ParameterList8.errors.txt new file mode 100644 index 0000000000000..950dfaaffa42a --- /dev/null +++ b/tests/baselines/reference/ParameterList8.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/ParameterList8.ts (3 errors) ==== + declare class C2 { + constructor(public p1:string); // ERROR + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(private p2:number); // ERROR + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public p3:any); // ERROR + ~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList8.js b/tests/baselines/reference/ParameterList8.js new file mode 100644 index 0000000000000..4ea4ac05f748a --- /dev/null +++ b/tests/baselines/reference/ParameterList8.js @@ -0,0 +1,8 @@ +//// [ParameterList8.ts] +declare class C2 { + constructor(public p1:string); // ERROR + constructor(private p2:number); // ERROR + constructor(public p3:any); // ERROR +} + +//// [ParameterList8.js] diff --git a/tests/baselines/reference/PrivateAccessInSubclass1.errors.txt b/tests/baselines/reference/PrivateAccessInSubclass1.errors.txt new file mode 100644 index 0000000000000..27e56c8b5c146 --- /dev/null +++ b/tests/baselines/reference/PrivateAccessInSubclass1.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/privateAccessInSubclass1.ts (1 errors) ==== + class Base { + private options: any; + } + + class D extends Base { + myMethod() { + this.options; + ~~~~~~~~~~~~ +!!! Property 'Base.options' is inaccessible. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/PropertyAccessibility2.errors.txt b/tests/baselines/reference/PropertyAccessibility2.errors.txt new file mode 100644 index 0000000000000..6557a66ff612e --- /dev/null +++ b/tests/baselines/reference/PropertyAccessibility2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/propertyAccessibility2.ts (1 errors) ==== + class C { + private static x = 1; + } + var c = C.x; + ~~~ +!!! Property 'C.x' is inaccessible. + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js new file mode 100644 index 0000000000000..670c15add7961 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js @@ -0,0 +1,96 @@ +//// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts] +module A { + export class Point { + x: number; + y: number; + } +} + +module A { + class Point { + fromCarthesian(p: A.Point) { + return { x: p.x, y: p.y }; + } + } +} + +// ensure merges as expected +var p: { x: number; y: number; }; +var p: A.Point; + +module X.Y.Z { + export class Line { + length: number; + } +} + +module X { + export module Y { + export module Z { + class Line { + name: string; + } + } + } +} + +// ensure merges as expected +var l: { length: number; } +var l: X.Y.Z.Line; + + + +//// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; +})(A || (A = {})); +var A; +(function (A) { + var Point = (function () { + function Point() { + } + Point.prototype.fromCarthesian = function (p) { + return { x: p.x, y: p.y }; + }; + return Point; + })(); +})(A || (A = {})); +var p; +var p; +var X; +(function (X) { + (function (Y) { + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + Z.Line = Line; + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var X; +(function (X) { + (function (Y) { + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var l; +var l; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js new file mode 100644 index 0000000000000..d18d8fe7a26f0 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js @@ -0,0 +1,44 @@ +//// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts] +module A { + export interface Point { + x: number; + y: number; + toCarth(): Point; + } +} + +module A { + interface Point { + fromCarth(): Point; + } +} + +// ensure merges as expected +var p: { x: number; y: number; toCarth(): A.Point; }; +var p: A.Point; + +module X.Y.Z { + export interface Line { + new (start: A.Point, end: A.Point); + } +} + +module X { + export module Y.Z { + interface Line { + start: A.Point; + end: A.Point; + } + } +} + +// ensure merges as expected +var l: { new (s: A.Point, e: A.Point); } +var l: X.Y.Z.Line; + + +//// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js] +var p; +var p; +var l; +var l; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js new file mode 100644 index 0000000000000..809b4e64896cd --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js @@ -0,0 +1,79 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.ts] //// + +//// [part1.ts] +module A { + export interface Point { + x: number; + y: number; + } + + export module Utils { + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + export var Origin: Point = { x: 0, y: 0 }; +} + +//// [part2.ts] +module A { + // not a collision, since we don't export + var Origin: string = "0,0"; + + export module Utils { + export class Plane { + constructor(public tl: Point, public br: Point) { } + } + } +} + +//// [part3.ts] +// test the merging actually worked + +var o: { x: number; y: number }; +var o: A.Point; +var o = A.Origin; +var o = A.Utils.mirror(o); + +var p: { tl: A.Point; br: A.Point }; +var p: A.Utils.Plane; +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); + + + +//// [part1.js] +var A; +(function (A) { + (function (Utils) { + function mirror(p) { + return { x: p.y, y: p.x }; + } + Utils.mirror = mirror; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; + A.Origin = { x: 0, y: 0 }; +})(A || (A = {})); +//// [part2.js] +var A; +(function (A) { + var Origin = "0,0"; + (function (Utils) { + var Plane = (function () { + function Plane(tl, br) { + this.tl = tl; + this.br = br; + } + return Plane; + })(); + Utils.Plane = Plane; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; +})(A || (A = {})); +//// [part3.js] +var o; +var o; +var o = A.Origin; +var o = A.Utils.mirror(o); +var p; +var p; +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..2540e2a071f80 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (2 errors) ==== + module A { + export class Point { + x: number; + y: number; + } + } + + module A{ + // expected error + export class Point { + ~~~~~ +!!! Duplicate identifier 'Point'. + origin: number; + angle: number; + } + } + + module X.Y.Z { + export class Line { + length: number; + } + } + + module X { + export module Y { + export module Z { + // expected error + export class Line { + ~~~~ +!!! Duplicate identifier 'Line'. + name: string; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js new file mode 100644 index 0000000000000..485ce1b8288ec --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js @@ -0,0 +1,83 @@ +//// [TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts] +module A { + export class Point { + x: number; + y: number; + } +} + +module A{ + // expected error + export class Point { + origin: number; + angle: number; + } +} + +module X.Y.Z { + export class Line { + length: number; + } +} + +module X { + export module Y { + export module Z { + // expected error + export class Line { + name: string; + } + } + } +} + + +//// [TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js] +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; +})(A || (A = {})); +var A; +(function (A) { + var Point = (function () { + function Point() { + } + return Point; + })(); + A.Point = Point; +})(A || (A = {})); +var X; +(function (X) { + (function (Y) { + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + Z.Line = Line; + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var X; +(function (X) { + (function (Y) { + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + Z.Line = Line; + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js new file mode 100644 index 0000000000000..0f77987ee9232 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js @@ -0,0 +1,44 @@ +//// [TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts] +module A { + export interface Point { + x: number; + y: number; + toCarth(): Point; + } +} + +module A { + export interface Point { + fromCarth(): Point; + } +} + +// ensure merges as expected +var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; +var p: A.Point; + +module X.Y.Z { + export interface Line { + new (start: A.Point, end: A.Point); + } +} + +module X { + export module Y.Z { + export interface Line { + start: A.Point; + end: A.Point; + } + } +} + +// ensure merges as expected +var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); } +var l: X.Y.Z.Line; + + +//// [TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js] +var p; +var p; +var l; +var l; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt new file mode 100644 index 0000000000000..38ce33c2c4419 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (1 errors) ==== + export module A { + ~~~~~~~~~~~~~~~~~ + export interface Point { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + x: number; + ~~~~~~~~~~~~~~~~~~ + y: number; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + + + export module Utils { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + export function mirror(p: T) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return { x: p.y, y: p.x }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ + + + export var Origin: Point = { x: 0, y: 0 }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts (3 errors) ==== + export module A { + // collision with 'Origin' var in other part of merged module + export var Origin: Point = { x: 0, y: 0 }; + ~~~~~ +!!! Cannot find name 'Point'. + + export module Utils { + export class Plane { + constructor(public tl: Point, public br: Point) { } + ~~~~~ +!!! Cannot find name 'Point'. + ~~~~~ +!!! Cannot find name 'Point'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js new file mode 100644 index 0000000000000..7712193af4724 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.js @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.ts] //// + +//// [part1.ts] +export module A { + export interface Point { + x: number; + y: number; + } + + export module Utils { + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + + export var Origin: Point = { x: 0, y: 0 }; +} + +//// [part2.ts] +export module A { + // collision with 'Origin' var in other part of merged module + export var Origin: Point = { x: 0, y: 0 }; + + export module Utils { + export class Plane { + constructor(public tl: Point, public br: Point) { } + } + } +} + + +//// [part1.js] +(function (A) { + (function (Utils) { + function mirror(p) { + return { x: p.y, y: p.x }; + } + Utils.mirror = mirror; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; + A.Origin = { x: 0, y: 0 }; +})(exports.A || (exports.A = {})); +var A = exports.A; +//// [part2.js] +(function (A) { + A.Origin = { x: 0, y: 0 }; + (function (Utils) { + var Plane = (function () { + function Plane(tl, br) { + this.tl = tl; + this.br = br; + } + return Plane; + })(); + Utils.Plane = Plane; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; +})(exports.A || (exports.A = {})); +var A = exports.A; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js new file mode 100644 index 0000000000000..06881ce3ef675 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js @@ -0,0 +1,85 @@ +//// [TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts] +module A.B { + export var x: number; +} + +module A{ + module B { + export var x: string; + } +} + +// ensure the right var decl is exported +var x: number; +var x = A.B.x; + +module X.Y.Z { + export class Line { + length: number; + } +} + +module X { + export module Y { + module Z { + export class Line { + name: string; + } + } + } +} + +// make sure merging works as expected +var l: { length: number }; +var l: X.Y.Z.Line; + + +//// [TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js] +var A; +(function (A) { + (function (B) { + B.x; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var A; +(function (A) { + var B; + (function (B) { + B.x; + })(B || (B = {})); +})(A || (A = {})); +var x; +var x = A.B.x; +var X; +(function (X) { + (function (Y) { + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + Z.Line = Line; + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var X; +(function (X) { + (function (Y) { + var Z; + (function (Z) { + var Line = (function () { + function Line() { + } + return Line; + })(); + Z.Line = Line; + })(Z || (Z = {})); + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var l; +var l; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js new file mode 100644 index 0000000000000..bb44fdfdd376b --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.ts] //// + +//// [part1.ts] +module Root { + export module A { + export interface Point { + x: number; + y: number; + } + + export module Utils { + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + } +} + +//// [part2.ts] +module otherRoot { + export module A { + // have to be fully qualified since in different root + export var Origin: Root.A.Point = { x: 0, y: 0 }; + + export module Utils { + export class Plane { + constructor(public tl: Root.A.Point, public br: Root.A.Point) { } + } + } + } +} + +//// [part1.js] +var Root; +(function (Root) { + (function (A) { + (function (Utils) { + function mirror(p) { + return { x: p.y, y: p.x }; + } + Utils.mirror = mirror; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; + })(Root.A || (Root.A = {})); + var A = Root.A; +})(Root || (Root = {})); +//// [part2.js] +var otherRoot; +(function (otherRoot) { + (function (A) { + A.Origin = { x: 0, y: 0 }; + (function (Utils) { + var Plane = (function () { + function Plane(tl, br) { + this.tl = tl; + this.br = br; + } + return Plane; + })(); + Utils.Plane = Plane; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; + })(otherRoot.A || (otherRoot.A = {})); + var A = otherRoot.A; +})(otherRoot || (otherRoot = {})); diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js new file mode 100644 index 0000000000000..ae716b2db55b4 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js @@ -0,0 +1,76 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesWithTheSameNameAndSameCommonRoot.ts] //// + +//// [part1.ts] +module A { + export interface Point { + x: number; + y: number; + } + + export module Utils { + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } +} + +//// [part2.ts] +module A { + export var Origin: Point = { x: 0, y: 0 }; + + export module Utils { + export class Plane { + constructor(public tl: Point, public br: Point) { } + } + } +} + +//// [part3.ts] +// test the merging actually worked + +var o: { x: number; y: number }; +var o: A.Point; +var o = A.Origin; +var o = A.Utils.mirror(o); + +var p: { tl: A.Point; br: A.Point }; +var p: A.Utils.Plane; +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); + + + +//// [part1.js] +var A; +(function (A) { + (function (Utils) { + function mirror(p) { + return { x: p.y, y: p.x }; + } + Utils.mirror = mirror; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; +})(A || (A = {})); +//// [part2.js] +var A; +(function (A) { + A.Origin = { x: 0, y: 0 }; + (function (Utils) { + var Plane = (function () { + function Plane(tl, br) { + this.tl = tl; + this.br = br; + } + return Plane; + })(); + Utils.Plane = Plane; + })(A.Utils || (A.Utils = {})); + var Utils = A.Utils; +})(A || (A = {})); +//// [part3.js] +var o; +var o; +var o = A.Origin; +var o = A.Utils.mirror(o); +var p; +var p; +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); diff --git a/tests/baselines/reference/UnaryOperators1.errors.txt b/tests/baselines/reference/UnaryOperators1.errors.txt new file mode 100644 index 0000000000000..5ec4595c5d080 --- /dev/null +++ b/tests/baselines/reference/UnaryOperators1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/unaryOperators1.ts (3 errors) ==== + +foo; + ~~~ +!!! Cannot find name 'foo'. + -bar; + ~~~ +!!! Cannot find name 'bar'. + ~quux; + ~~~~ +!!! Cannot find name 'quux'. \ No newline at end of file diff --git a/tests/baselines/reference/acceptableAlias1.js b/tests/baselines/reference/acceptableAlias1.js new file mode 100644 index 0000000000000..d93b2f8791f6f --- /dev/null +++ b/tests/baselines/reference/acceptableAlias1.js @@ -0,0 +1,13 @@ +//// [acceptableAlias1.ts] +module M { + export module N { + } + export import X = N; +} + +import r = M.X; + +//// [acceptableAlias1.js] +var M; +(function (M) { +})(M || (M = {})); diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js new file mode 100644 index 0000000000000..b6817ed76215a --- /dev/null +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -0,0 +1,45 @@ +//// [accessOverriddenBaseClassMember1.ts] +class Point { + constructor(public x: number, public y: number) { } + public toString() { + return "x=" + this.x + " y=" + this.y; + } +} +class ColoredPoint extends Point { + constructor(x: number, y: number, public color: string) { + super(x, y); + } + public toString() { + return super.toString() + " color=" + this.color; + } +} + + +//// [accessOverriddenBaseClassMember1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.toString = function () { + return "x=" + this.x + " y=" + this.y; + }; + return Point; +})(); +var ColoredPoint = (function (_super) { + __extends(ColoredPoint, _super); + function ColoredPoint(x, y, color) { + _super.call(this, x, y); + this.color = color; + } + ColoredPoint.prototype.toString = function () { + return _super.prototype.toString.call(this) + " color=" + this.color; + }; + return ColoredPoint; +})(Point); diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt new file mode 100644 index 0000000000000..df4fe1ecf9ed3 --- /dev/null +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (4 errors) ==== + + class C { + set X(public v) { } + ~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + static set X(public v2) { } + ~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES3.errors.txt b/tests/baselines/reference/accessorWithES3.errors.txt new file mode 100644 index 0000000000000..a16d23d28c2e0 --- /dev/null +++ b/tests/baselines/reference/accessorWithES3.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ==== + + // error to use accessors in ES3 mode + + class C { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + } + + class D { + set x(v) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + var x = { + get a() { return 1 } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + var y = { + set b(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES5.js b/tests/baselines/reference/accessorWithES5.js new file mode 100644 index 0000000000000..1a3690556e039 --- /dev/null +++ b/tests/baselines/reference/accessorWithES5.js @@ -0,0 +1,54 @@ +//// [accessorWithES5.ts] + +class C { + get x() { + return 1; + } +} + +class D { + set x(v) { + } +} + +var x = { + get a() { return 1 } +} + +var y = { + set b(v) { } +} + +//// [accessorWithES5.js] +var C = (function () { + function C() { + } + Object.defineProperty(C.prototype, "x", { + get: function () { + return 1; + }, + enumerable: true, + configurable: true + }); + return C; +})(); +var D = (function () { + function D() { + } + Object.defineProperty(D.prototype, "x", { + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return D; +})(); +var x = { + get a() { + return 1; + } +}; +var y = { + set b(v) { + } +}; diff --git a/tests/baselines/reference/accessorWithInitializer.errors.txt b/tests/baselines/reference/accessorWithInitializer.errors.txt new file mode 100644 index 0000000000000..127bfdc8d82dd --- /dev/null +++ b/tests/baselines/reference/accessorWithInitializer.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/accessorWithInitializer.ts (2 errors) ==== + + class C { + set X(v = 0) { } + ~ +!!! A 'set' accessor parameter cannot have an initializer. + static set X(v2 = 0) { } + ~ +!!! A 'set' accessor parameter cannot have an initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithRestParam.errors.txt b/tests/baselines/reference/accessorWithRestParam.errors.txt new file mode 100644 index 0000000000000..10f4633805fd7 --- /dev/null +++ b/tests/baselines/reference/accessorWithRestParam.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/accessorWithRestParam.ts (2 errors) ==== + + class C { + set X(...v) { } + ~ +!!! A 'set' accessor cannot have rest parameter. + static set X(...v2) { } + ~ +!!! A 'set' accessor cannot have rest parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt new file mode 100644 index 0000000000000..b108ea940a3c6 --- /dev/null +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorsAreNotContextuallyTyped.ts (2 errors) ==== + // accessors are not contextually typed + + class C { + set x(v: (a: string) => string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return (x: string) => ""; + } + } + + var c: C; + var r = c.x(''); // string \ No newline at end of file diff --git a/tests/baselines/reference/accessorsEmit.errors.txt b/tests/baselines/reference/accessorsEmit.errors.txt new file mode 100644 index 0000000000000..54bfafec6481b --- /dev/null +++ b/tests/baselines/reference/accessorsEmit.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/accessorsEmit.ts (2 errors) ==== + class Result { } + + class Test { + get Property(): Result { + ~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = 1; + return null; + } + } + + class Test2 { + get Property() { + ~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = 1; + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorsInAmbientContext.errors.txt b/tests/baselines/reference/accessorsInAmbientContext.errors.txt new file mode 100644 index 0000000000000..fe7dfb361f9c9 --- /dev/null +++ b/tests/baselines/reference/accessorsInAmbientContext.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/accessorsInAmbientContext.ts (8 errors) ==== + + declare module M { + class C { + get X() { return 1; } + ~ +!!! An accessor cannot be declared in an ambient context. + set X(v) { } + ~ +!!! An accessor cannot be declared in an ambient context. + + static get Y() { return 1; } + ~ +!!! An accessor cannot be declared in an ambient context. + static set Y(v) { } + ~ +!!! An accessor cannot be declared in an ambient context. + } + } + + declare class C { + get X() { return 1; } + ~ +!!! An accessor cannot be declared in an ambient context. + set X(v) { } + ~ +!!! An accessor cannot be declared in an ambient context. + + static get Y() { return 1; } + ~ +!!! An accessor cannot be declared in an ambient context. + static set Y(v) { } + ~ +!!! An accessor cannot be declared in an ambient context. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt new file mode 100644 index 0000000000000..3233ba9b5ee3e --- /dev/null +++ b/tests/baselines/reference/accessorsNotAllowedInES3.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/accessorsNotAllowedInES3.ts (2 errors) ==== + + class C { + get x(): number { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + var y = { get foo() { return 3; } }; + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + \ No newline at end of file diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt new file mode 100644 index 0000000000000..be2d5d10ef363 --- /dev/null +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ==== + class LanguageSpec_section_4_5_error_cases { + public set AnnotatedSetter_SetterFirst(a: number) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public get AnnotatedSetter_SetterFirst() { return ""; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! Type 'string' is not assignable to type 'number'. + + public get AnnotatedSetter_SetterLast() { return ""; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! Type 'string' is not assignable to type 'number'. + public set AnnotatedSetter_SetterLast(a: number) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public get AnnotatedGetter_GetterFirst(): string { return ""; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set AnnotatedGetter_GetterFirst(aStr) { aStr = 0; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~ +!!! Type 'number' is not assignable to type 'string'. + + public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~ +!!! Type 'number' is not assignable to type 'string'. + public get AnnotatedGetter_GetterLast(): string { return ""; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt new file mode 100644 index 0000000000000..6f30cec38e489 --- /dev/null +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/compiler/accessors_spec_section-4.5_inference.ts (12 errors) ==== + class A { } + class B extends A { } + + class LanguageSpec_section_4_5_inference { + + public set InferredGetterFromSetterAnnotation(a: A) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public get InferredGetterFromSetterAnnotation() { return new B(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public get InferredGetterFromSetterAnnotation_GetterFirst() { return new B(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set InferredGetterFromSetterAnnotation_GetterFirst(a: A) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + + public get InferredFromGetter() { return new B(); } + ~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set InferredFromGetter(a) { } + ~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public set InferredFromGetter_SetterFirst(a) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public get InferredFromGetter_SetterFirst() { return new B(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public set InferredSetterFromGetterAnnotation(a) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public get InferredSetterFromGetterAnnotation() : A { return new B(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public get InferredSetterFromGetterAnnotation_GetterFirst() : A { return new B(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set InferredSetterFromGetterAnnotation_GetterFirst(a) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js new file mode 100644 index 0000000000000..a08a0f4ba7594 --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js @@ -0,0 +1,16 @@ +//// [addMoreCallSignaturesToBaseSignature.ts] +interface Foo { + (): string; +} + +interface Bar extends Foo { + (key: string): string; +} + +var a: Bar; +var kitty = a(); + + +//// [addMoreCallSignaturesToBaseSignature.js] +var a; +var kitty = a(); diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js new file mode 100644 index 0000000000000..73f7316dedc3c --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js @@ -0,0 +1,15 @@ +//// [addMoreCallSignaturesToBaseSignature2.ts] +interface Foo { + (bar:number): string; +} + +interface Bar extends Foo { + (key: string): string; +} + +var a: Bar; +var kitty = a(1); + +//// [addMoreCallSignaturesToBaseSignature2.js] +var a; +var kitty = a(1); diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt new file mode 100644 index 0000000000000..36b45612631de --- /dev/null +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/addMoreOverloadsToBaseSignature.ts (1 errors) ==== + interface Foo { + f(): string; + } + + interface Bar extends Foo { + ~~~ +!!! Interface 'Bar' incorrectly extends interface 'Foo': +!!! Types of property 'f' are incompatible: +!!! Type '(key: string) => string' is not assignable to type '() => string'. + f(key: string): string; + } + \ No newline at end of file diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.js b/tests/baselines/reference/addMoreOverloadsToBaseSignature.js new file mode 100644 index 0000000000000..3a821da7382f4 --- /dev/null +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.js @@ -0,0 +1,11 @@ +//// [addMoreOverloadsToBaseSignature.ts] +interface Foo { + f(): string; +} + +interface Bar extends Foo { + f(key: string): string; +} + + +//// [addMoreOverloadsToBaseSignature.js] diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js new file mode 100644 index 0000000000000..b6fa51ae5de6d --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js @@ -0,0 +1,88 @@ +//// [additionOperatorWithAnyAndEveryType.ts] +function foo() { } +class C { + public a: string; + static foo() { } +} +enum E { a, b, c } +module M { export var a } + +var a: any; +var b: boolean; +var c: number; +var d: string; +var e: Object; + +// any as left operand, result is type Any except plusing string +var r1 = a + a; +var r2 = a + b; +var r3 = a + c; +var r4 = a + d; +var r5 = a + e; + +// any as right operand, result is type Any except plusing string +var r6 = b + a; +var r7 = c + a; +var r8 = d + a; +var r9 = e + a; + +// other cases +var r10 = a + foo; +var r11 = a + foo(); +var r12 = a + C; +var r13 = a + new C(); +var r14 = a + E; +var r15 = a + E.a; +var r16 = a + M; +var r17 = a + ''; +var r18 = a + 123; +var r19 = a + { a: '' }; +var r20 = a + ((a: string) => { return a }); + +//// [additionOperatorWithAnyAndEveryType.js] +function foo() { +} +var C = (function () { + function C() { + } + C.foo = function () { + }; + return C; +})(); +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var M; +(function (M) { + M.a; +})(M || (M = {})); +var a; +var b; +var c; +var d; +var e; +var r1 = a + a; +var r2 = a + b; +var r3 = a + c; +var r4 = a + d; +var r5 = a + e; +var r6 = b + a; +var r7 = c + a; +var r8 = d + a; +var r9 = e + a; +var r10 = a + foo; +var r11 = a + foo(); +var r12 = a + C; +var r13 = a + new C(); +var r14 = a + E; +var r15 = a + 0 /* a */; +var r16 = a + M; +var r17 = a + ''; +var r18 = a + 123; +var r19 = a + { a: '' }; +var r20 = a + (function (a) { + return a; +}); diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..607a76b1034a8 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt @@ -0,0 +1,79 @@ +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts (19 errors) ==== + function foo() { } + class C { + public a: string; + static foo() { } + } + enum E { a, b, c } + module M { export var a } + + var a: boolean; + var b: number; + var c: Object; + var d: Number; + + // boolean + every type except any and string + var r1 = a + a; + ~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r2 = a + b; + ~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'number'. + var r3 = a + c; + ~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'Object'. + + // number + every type except any and string + var r4 = b + a; + ~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'boolean'. + var r5 = b + b; // number + number is valid + var r6 = b + c; + ~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'Object'. + + // object + every type except any and string + var r7 = c + a; + ~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'boolean'. + var r8 = c + b; + ~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'number'. + var r9 = c + c; + ~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'Object'. + + // other cases + var r10 = a + true; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r11 = true + false; + ~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r12 = true + 123; + ~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'number'. + var r13 = {} + {}; + ~~~~~~~ +!!! Operator '+' cannot be applied to types '{}' and '{}'. + var r14 = b + d; + ~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'Number'. + var r15 = b + foo; + ~~~~~~~ +!!! Operator '+' cannot be applied to types 'number' and '() => void'. + var r16 = b + foo(); + ~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'void'. + var r17 = b + C; + ~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'typeof C'. + var r18 = E.a + new C(); + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'E' and 'C'. + var r19 = E.a + C.foo(); + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'E' and 'void'. + var r20 = E.a + M; + ~~~~~~~ +!!! Operator '+' cannot be applied to types 'E' and 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.js b/tests/baselines/reference/additionOperatorWithInvalidOperands.js new file mode 100644 index 0000000000000..038094a64ddc5 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.js @@ -0,0 +1,86 @@ +//// [additionOperatorWithInvalidOperands.ts] +function foo() { } +class C { + public a: string; + static foo() { } +} +enum E { a, b, c } +module M { export var a } + +var a: boolean; +var b: number; +var c: Object; +var d: Number; + +// boolean + every type except any and string +var r1 = a + a; +var r2 = a + b; +var r3 = a + c; + +// number + every type except any and string +var r4 = b + a; +var r5 = b + b; // number + number is valid +var r6 = b + c; + +// object + every type except any and string +var r7 = c + a; +var r8 = c + b; +var r9 = c + c; + +// other cases +var r10 = a + true; +var r11 = true + false; +var r12 = true + 123; +var r13 = {} + {}; +var r14 = b + d; +var r15 = b + foo; +var r16 = b + foo(); +var r17 = b + C; +var r18 = E.a + new C(); +var r19 = E.a + C.foo(); +var r20 = E.a + M; + +//// [additionOperatorWithInvalidOperands.js] +function foo() { +} +var C = (function () { + function C() { + } + C.foo = function () { + }; + return C; +})(); +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var M; +(function (M) { + M.a; +})(M || (M = {})); +var a; +var b; +var c; +var d; +var r1 = a + a; +var r2 = a + b; +var r3 = a + c; +var r4 = b + a; +var r5 = b + b; +var r6 = b + c; +var r7 = c + a; +var r8 = c + b; +var r9 = c + c; +var r10 = a + true; +var r11 = true + false; +var r12 = true + 123; +var r13 = {} + {}; +var r14 = b + d; +var r15 = b + foo; +var r16 = b + foo(); +var r17 = b + C; +var r18 = 0 /* a */ + new C(); +var r19 = 0 /* a */ + C.foo(); +var r20 = 0 /* a */ + M; diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt new file mode 100644 index 0000000000000..230210c2586b5 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts (11 errors) ==== + // If one operand is the null or undefined value, it is treated as having the type of the other operand. + + function foo(): void { return undefined } + + var a: boolean; + var b: Object; + var c: void; + var d: Number; + + // null + boolean/Object + var r1 = null + a; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r2 = null + b; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'Object'. + var r3 = null + c; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + var r4 = a + null; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r5 = b + null; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'Object'. + var r6 = null + c; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + + // other cases + var r7 = null + d; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Number' and 'Number'. + var r8 = null + true; + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r9 = null + { a: '' }; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. + var r10 = null + foo(); + ~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + var r11 = null + (() => { }); + ~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js new file mode 100644 index 0000000000000..61ac4a9fc8836 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js @@ -0,0 +1,45 @@ +//// [additionOperatorWithNullValueAndInvalidOperator.ts] +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +function foo(): void { return undefined } + +var a: boolean; +var b: Object; +var c: void; +var d: Number; + +// null + boolean/Object +var r1 = null + a; +var r2 = null + b; +var r3 = null + c; +var r4 = a + null; +var r5 = b + null; +var r6 = null + c; + +// other cases +var r7 = null + d; +var r8 = null + true; +var r9 = null + { a: '' }; +var r10 = null + foo(); +var r11 = null + (() => { }); + +//// [additionOperatorWithNullValueAndInvalidOperator.js] +function foo() { + return undefined; +} +var a; +var b; +var c; +var d; +var r1 = null + a; +var r2 = null + b; +var r3 = null + c; +var r4 = a + null; +var r5 = b + null; +var r6 = null + c; +var r7 = null + d; +var r8 = null + true; +var r9 = null + { a: '' }; +var r10 = null + foo(); +var r11 = null + (function () { +}); diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js new file mode 100644 index 0000000000000..ed3d2b6a9925e --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js @@ -0,0 +1,59 @@ +//// [additionOperatorWithNullValueAndValidOperator.ts] +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +enum E { a, b, c } + +var a: any; +var b: number; +var c: E; +var d: string; + +// null + any +var r1: any = null + a; +var r2: any = a + null; + +// null + number/enum +var r3 = null + b; +var r4 = null + 1; +var r5 = null + c; +var r6 = null + E.a; +var r7 = null + E['a']; +var r8 = b + null; +var r9 = 1 + null; +var r10 = c + null +var r11 = E.a + null; +var r12 = E['a'] + null; + +// null + string +var r13 = null + d; +var r14 = null + ''; +var r15 = d + null; +var r16 = '' + null; + +//// [additionOperatorWithNullValueAndValidOperator.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var r1 = null + a; +var r2 = a + null; +var r3 = null + b; +var r4 = null + 1; +var r5 = null + c; +var r6 = null + 0 /* a */; +var r7 = null + E['a']; +var r8 = b + null; +var r9 = 1 + null; +var r10 = c + null; +var r11 = 0 /* a */ + null; +var r12 = E['a'] + null; +var r13 = null + d; +var r14 = null + ''; +var r15 = d + null; +var r16 = '' + null; diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js new file mode 100644 index 0000000000000..63e038265d64c --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js @@ -0,0 +1,32 @@ +//// [additionOperatorWithNumberAndEnum.ts] +enum E { a, b } + +var a: number; +var b: E; + +var r1 = a + a; +var r2 = a + b; +var r3 = b + a; +var r4 = b + b; + +var r5 = 0 + a; +var r6 = E.a + 0; +var r7 = E.a + E.b; +var r8 = E['a'] + E['b']; + +//// [additionOperatorWithNumberAndEnum.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var r1 = a + a; +var r2 = a + b; +var r3 = b + a; +var r4 = b + b; +var r5 = 0 + a; +var r6 = 0 /* a */ + 0; +var r7 = 0 /* a */ + 1 /* b */; +var r8 = E['a'] + E['b']; diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt new file mode 100644 index 0000000000000..fad515948be06 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithOnlyNullValueOrUndefinedValue.ts (4 errors) ==== + // bug 819721 + var r1 = null + null; + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var r2 = null + undefined; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var r3 = undefined + null; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var r4 = undefined + undefined; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js new file mode 100644 index 0000000000000..4e1200d876b00 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js @@ -0,0 +1,12 @@ +//// [additionOperatorWithOnlyNullValueOrUndefinedValue.ts] +// bug 819721 +var r1 = null + null; +var r2 = null + undefined; +var r3 = undefined + null; +var r4 = undefined + undefined; + +//// [additionOperatorWithOnlyNullValueOrUndefinedValue.js] +var r1 = null + null; +var r2 = null + undefined; +var r3 = undefined + null; +var r4 = undefined + undefined; diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.js b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js new file mode 100644 index 0000000000000..549ce5aafb12c --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js @@ -0,0 +1,75 @@ +//// [additionOperatorWithStringAndEveryType.ts] +enum E { a, b, c } + +var a: any; +var b: boolean; +var c: number; +var d: string; +var e: Object; +var f: void; +var g: E; + +var x: string; + +// string could plus every type, and the result is always string +// string as left operand +var r1 = x + a; +var r2 = x + b; +var r3 = x + c; +var r4 = x + d; +var r5 = x + e; +var r6 = x + f; +var r7 = x + g; + +// string as right operand +var r8 = a + x; +var r9 = b + x; +var r10 = c + x; +var r11 = d + x; +var r12 = e + x; +var r13 = f + x; +var r14 = g + x; + +// other cases +var r15 = x + E; +var r16 = x + E.a; +var r17 = x + ''; +var r18 = x + 0; +var r19 = x + { a: '' }; +var r20 = x + []; + +//// [additionOperatorWithStringAndEveryType.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var f; +var g; +var x; +var r1 = x + a; +var r2 = x + b; +var r3 = x + c; +var r4 = x + d; +var r5 = x + e; +var r6 = x + f; +var r7 = x + g; +var r8 = a + x; +var r9 = b + x; +var r10 = c + x; +var r11 = d + x; +var r12 = e + x; +var r13 = f + x; +var r14 = g + x; +var r15 = x + E; +var r16 = x + 0 /* a */; +var r17 = x + ''; +var r18 = x + 0; +var r19 = x + { a: '' }; +var r20 = x + []; diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt new file mode 100644 index 0000000000000..5b08447724136 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt @@ -0,0 +1,71 @@ +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithTypeParameter.ts (16 errors) ==== + // type parameter type is not a valid operand of addition operator + enum E { a, b } + + function foo(t: T, u: U) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: Object; + var g: E; + var f: void; + + // type parameter as left operand + var r1: any = t + a; // ok, one operand is any + var r2 = t + b; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'boolean'. + var r3 = t + c; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'number'. + var r4 = t + d; // ok, one operand is string + var r5 = t + e; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'Object'. + var r6 = t + g; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'E'. + var r7 = t + f; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'void'. + + // type parameter as right operand + var r8 = a + t; // ok, one operand is any + var r9 = b + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'T'. + var r10 = c + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'number' and 'T'. + var r11 = d + t; // ok, one operand is string + var r12 = e + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'T'. + var r13 = g + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'E' and 'T'. + var r14 = f + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'T'. + + // other cases + var r15 = t + null; + ~~~~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'T'. + var r16 = t + undefined; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'T'. + var r17 = t + t; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'T'. + var r18 = t + u; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'U'. + var r19 = t + (() => { }); + ~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'T' and '() => void'. + var r20 = t + []; + ~~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'undefined[]'. + } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.js b/tests/baselines/reference/additionOperatorWithTypeParameter.js new file mode 100644 index 0000000000000..d08ac3cc62e0f --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.js @@ -0,0 +1,76 @@ +//// [additionOperatorWithTypeParameter.ts] +// type parameter type is not a valid operand of addition operator +enum E { a, b } + +function foo(t: T, u: U) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: Object; + var g: E; + var f: void; + + // type parameter as left operand + var r1: any = t + a; // ok, one operand is any + var r2 = t + b; + var r3 = t + c; + var r4 = t + d; // ok, one operand is string + var r5 = t + e; + var r6 = t + g; + var r7 = t + f; + + // type parameter as right operand + var r8 = a + t; // ok, one operand is any + var r9 = b + t; + var r10 = c + t; + var r11 = d + t; // ok, one operand is string + var r12 = e + t; + var r13 = g + t; + var r14 = f + t; + + // other cases + var r15 = t + null; + var r16 = t + undefined; + var r17 = t + t; + var r18 = t + u; + var r19 = t + (() => { }); + var r20 = t + []; +} + +//// [additionOperatorWithTypeParameter.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +function foo(t, u) { + var a; + var b; + var c; + var d; + var e; + var g; + var f; + var r1 = t + a; + var r2 = t + b; + var r3 = t + c; + var r4 = t + d; + var r5 = t + e; + var r6 = t + g; + var r7 = t + f; + var r8 = a + t; + var r9 = b + t; + var r10 = c + t; + var r11 = d + t; + var r12 = e + t; + var r13 = g + t; + var r14 = f + t; + var r15 = t + null; + var r16 = t + undefined; + var r17 = t + t; + var r18 = t + u; + var r19 = t + (function () { + }); + var r20 = t + []; +} diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt new file mode 100644 index 0000000000000..95b1f4055a7b5 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts (11 errors) ==== + // If one operand is the null or undefined value, it is treated as having the type of the other operand. + + function foo(): void { return undefined } + + var a: boolean; + var b: Object; + var c: void; + var d: Number; + + // undefined + boolean/Object + var r1 = undefined + a; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r2 = undefined + b; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'Object'. + var r3 = undefined + c; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + var r4 = a + undefined; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r5 = b + undefined; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Object' and 'Object'. + var r6 = undefined + c; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + + // other cases + var r7 = undefined + d; + ~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'Number' and 'Number'. + var r8 = undefined + true; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'boolean'. + var r9 = undefined + { a: '' }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. + var r10 = undefined + foo(); + ~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'void' and 'void'. + var r11 = undefined + (() => { }); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types '() => void' and '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js new file mode 100644 index 0000000000000..4eb725958511c --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js @@ -0,0 +1,45 @@ +//// [additionOperatorWithUndefinedValueAndInvalidOperands.ts] +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +function foo(): void { return undefined } + +var a: boolean; +var b: Object; +var c: void; +var d: Number; + +// undefined + boolean/Object +var r1 = undefined + a; +var r2 = undefined + b; +var r3 = undefined + c; +var r4 = a + undefined; +var r5 = b + undefined; +var r6 = undefined + c; + +// other cases +var r7 = undefined + d; +var r8 = undefined + true; +var r9 = undefined + { a: '' }; +var r10 = undefined + foo(); +var r11 = undefined + (() => { }); + +//// [additionOperatorWithUndefinedValueAndInvalidOperands.js] +function foo() { + return undefined; +} +var a; +var b; +var c; +var d; +var r1 = undefined + a; +var r2 = undefined + b; +var r3 = undefined + c; +var r4 = a + undefined; +var r5 = b + undefined; +var r6 = undefined + c; +var r7 = undefined + d; +var r8 = undefined + true; +var r9 = undefined + { a: '' }; +var r10 = undefined + foo(); +var r11 = undefined + (function () { +}); diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js new file mode 100644 index 0000000000000..a5d3037ae3892 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js @@ -0,0 +1,59 @@ +//// [additionOperatorWithUndefinedValueAndValidOperator.ts] +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +enum E { a, b, c } + +var a: any; +var b: number; +var c: E; +var d: string; + +// undefined + any +var r1: any = undefined + a; +var r2: any = a + undefined; + +// undefined + number/enum +var r3 = undefined + b; +var r4 = undefined + 1; +var r5 = undefined + c; +var r6 = undefined + E.a; +var r7 = undefined + E['a']; +var r8 = b + undefined; +var r9 = 1 + undefined; +var r10 = c + undefined +var r11 = E.a + undefined; +var r12 = E['a'] + undefined; + +// undefined + string +var r13 = undefined + d; +var r14 = undefined + ''; +var r15 = d + undefined; +var r16 = '' + undefined; + +//// [additionOperatorWithUndefinedValueAndValidOperator.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var r1 = undefined + a; +var r2 = a + undefined; +var r3 = undefined + b; +var r4 = undefined + 1; +var r5 = undefined + c; +var r6 = undefined + 0 /* a */; +var r7 = undefined + E['a']; +var r8 = b + undefined; +var r9 = 1 + undefined; +var r10 = c + undefined; +var r11 = 0 /* a */ + undefined; +var r12 = E['a'] + undefined; +var r13 = undefined + d; +var r14 = undefined + ''; +var r15 = d + undefined; +var r16 = '' + undefined; diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt new file mode 100644 index 0000000000000..d75b8d5145140 --- /dev/null +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ==== + import moduleA = require("aliasAssignments_moduleA"); + var x = moduleA; + x = 1; // Should be error + ~ +!!! Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': +!!! Property 'someClass' is missing in type 'Number'. + var y = 1; + y = moduleA; // should be error + ~ +!!! Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. + +==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ==== + export class someClass { + public someData: string; + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasAssignments.js b/tests/baselines/reference/aliasAssignments.js new file mode 100644 index 0000000000000..6e9a98c85d157 --- /dev/null +++ b/tests/baselines/reference/aliasAssignments.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/aliasAssignments.ts] //// + +//// [aliasAssignments_moduleA.ts] +export class someClass { + public someData: string; +} + +//// [aliasAssignments_1.ts] +import moduleA = require("aliasAssignments_moduleA"); +var x = moduleA; +x = 1; // Should be error +var y = 1; +y = moduleA; // should be error + + +//// [aliasAssignments_moduleA.js] +var someClass = (function () { + function someClass() { + } + return someClass; +})(); +exports.someClass = someClass; +//// [aliasAssignments_1.js] +var moduleA = require("aliasAssignments_moduleA"); +var x = moduleA; +x = 1; +var y = 1; +y = moduleA; diff --git a/tests/baselines/reference/aliasBug.errors.txt b/tests/baselines/reference/aliasBug.errors.txt new file mode 100644 index 0000000000000..1e7434c19b68f --- /dev/null +++ b/tests/baselines/reference/aliasBug.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/aliasBug.ts (1 errors) ==== + + module foo { + export class Provide { + } + + export module bar { export module baz {export class boo {}}} + } + + import provide = foo; + import booz = foo.bar.baz; + + var p = new provide.Provide(); + + function use() { + var p1: provide.Provide; // error here, but should be okay + var p2: foo.Provide; + var p3:booz.bar; + ~~~~~~~~ +!!! Module 'foo.bar.baz' has no exported member 'bar'. + var p22 = new provide.Provide(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasBug.js b/tests/baselines/reference/aliasBug.js new file mode 100644 index 0000000000000..a8320d2ec9d31 --- /dev/null +++ b/tests/baselines/reference/aliasBug.js @@ -0,0 +1,53 @@ +//// [aliasBug.ts] + +module foo { + export class Provide { + } + + export module bar { export module baz {export class boo {}}} +} + +import provide = foo; +import booz = foo.bar.baz; + +var p = new provide.Provide(); + +function use() { + var p1: provide.Provide; // error here, but should be okay + var p2: foo.Provide; + var p3:booz.bar; + var p22 = new provide.Provide(); +} + + +//// [aliasBug.js] +var foo; +(function (foo) { + var Provide = (function () { + function Provide() { + } + return Provide; + })(); + foo.Provide = Provide; + (function (bar) { + (function (baz) { + var boo = (function () { + function boo() { + } + return boo; + })(); + baz.boo = boo; + })(bar.baz || (bar.baz = {})); + var baz = bar.baz; + })(foo.bar || (foo.bar = {})); + var bar = foo.bar; +})(foo || (foo = {})); +var provide = foo; +var booz = foo.bar.baz; +var p = new provide.Provide(); +function use() { + var p1; + var p2; + var p3; + var p22 = new provide.Provide(); +} diff --git a/tests/baselines/reference/aliasErrors.errors.txt b/tests/baselines/reference/aliasErrors.errors.txt new file mode 100644 index 0000000000000..4407771ce563d --- /dev/null +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/compiler/aliasErrors.ts (7 errors) ==== + module foo { + export class Provide { + } + export module bar { export module baz {export class boo {}}} + } + + import provide = foo; + import booz = foo.bar.baz; + import beez = foo.bar; + + import m = no; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'no'. + import m2 = no.mod; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'no'. + import n = 5; + ~ +!!! Identifier expected. + import o = "s"; + ~~~ +!!! Identifier expected. + import q = null; + ~~~~ +!!! Identifier expected. + import r = undefined; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'undefined'. + + + var p = new provide.Provide(); + + function use() { + + beez.baz.boo; + var p1: provide.Provide; + var p2: foo.Provide; + var p3:booz.bar; + ~~~~~~~~ +!!! Module 'foo.bar.baz' has no exported member 'bar'. + var p22 = new provide.Provide(); + } + + \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule.js b/tests/baselines/reference/aliasInaccessibleModule.js new file mode 100644 index 0000000000000..a0ecf3361fc1f --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule.js @@ -0,0 +1,11 @@ +//// [aliasInaccessibleModule.ts] +module M { + module N { + } + export import X = N; +} + +//// [aliasInaccessibleModule.js] +var M; +(function (M) { +})(M || (M = {})); diff --git a/tests/baselines/reference/aliasInaccessibleModule2.js b/tests/baselines/reference/aliasInaccessibleModule2.js new file mode 100644 index 0000000000000..b8b824d92ad9e --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule2.js @@ -0,0 +1,25 @@ +//// [aliasInaccessibleModule2.ts] +module M { + module N { + class C { + } + + } + import R = N; + export import X = R; +} + +//// [aliasInaccessibleModule2.js] +var M; +(function (M) { + var N; + (function (N) { + var C = (function () { + function C() { + } + return C; + })(); + })(N || (N = {})); + var R = N; + M.X = R; +})(M || (M = {})); diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt new file mode 100644 index 0000000000000..8736a2e7ae767 --- /dev/null +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/aliasOnMergedModuleInterface_1.ts (1 errors) ==== + /// + import foo = require("foo") + var z: foo; + z.bar("hello"); // This should be ok + var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error + ~~~ +!!! Cannot find name 'foo'. + +==== tests/cases/compiler/aliasOnMergedModuleInterface_0.ts (0 errors) ==== + declare module "foo" + { + module B { + export interface A { + } + } + interface B { + bar(name: string): B.A; + } + export = B; + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.js b/tests/baselines/reference/aliasOnMergedModuleInterface.js new file mode 100644 index 0000000000000..73f0b3de6ce9f --- /dev/null +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/aliasOnMergedModuleInterface.ts] //// + +//// [aliasOnMergedModuleInterface_0.ts] +declare module "foo" +{ + module B { + export interface A { + } + } + interface B { + bar(name: string): B.A; + } + export = B; +} + +//// [aliasOnMergedModuleInterface_1.ts] +/// +import foo = require("foo") +var z: foo; +z.bar("hello"); // This should be ok +var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error + + +//// [aliasOnMergedModuleInterface_0.js] +//// [aliasOnMergedModuleInterface_1.js] +var z; +z.bar("hello"); +var x = foo.bar("hello"); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt b/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt new file mode 100644 index 0000000000000..2fdccc7f49ad1 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/aliasUsage1_main.ts (2 errors) ==== + import Backbone = require("aliasUsage1_backbone"); + import moduleA = require("aliasUsage1_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + class C2 { + x: IHasVisualizationModel; + get A() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.x; + } + set A(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + x = moduleA; + } + } +==== tests/cases/compiler/aliasUsage1_backbone.ts (0 errors) ==== + export class Model { + public someData: string; + } + +==== tests/cases/compiler/aliasUsage1_moduleA.ts (0 errors) ==== + import Backbone = require("aliasUsage1_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js new file mode 100644 index 0000000000000..5712abf3443d2 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -0,0 +1,50 @@ +//// [tests/cases/compiler/aliasUsageInArray.ts] //// + +//// [aliasUsageInArray_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInArray_moduleA.ts] +import Backbone = require("aliasUsageInArray_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInArray_main.ts] +import Backbone = require("aliasUsageInArray_backbone"); +import moduleA = require("aliasUsageInArray_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} + +var xs: IHasVisualizationModel[] = [moduleA]; +var xs2: typeof moduleA[] = [moduleA]; + +//// [aliasUsageInArray_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInArray_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInArray_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInArray_main.js] +var moduleA = require("aliasUsageInArray_moduleA"); +var xs = [moduleA]; +var xs2 = [moduleA]; diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js new file mode 100644 index 0000000000000..661c8fd91e7af --- /dev/null +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -0,0 +1,49 @@ +//// [tests/cases/compiler/aliasUsageInFunctionExpression.ts] //// + +//// [aliasUsageInFunctionExpression_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInFunctionExpression_moduleA.ts] +import Backbone = require("aliasUsageInFunctionExpression_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInFunctionExpression_main.ts] +import Backbone = require("aliasUsageInFunctionExpression_backbone"); +import moduleA = require("aliasUsageInFunctionExpression_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +var f = (x: IHasVisualizationModel) => x; +f = (x) => moduleA; + +//// [aliasUsageInFunctionExpression_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInFunctionExpression_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInFunctionExpression_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInFunctionExpression_main.js] +var moduleA = require("aliasUsageInFunctionExpression_moduleA"); +var f = function (x) { return x; }; +f = function (x) { return moduleA; }; diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js new file mode 100644 index 0000000000000..1070036adea44 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -0,0 +1,56 @@ +//// [tests/cases/compiler/aliasUsageInGenericFunction.ts] //// + +//// [aliasUsageInGenericFunction_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInGenericFunction_moduleA.ts] +import Backbone = require("aliasUsageInGenericFunction_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInGenericFunction_main.ts] +import Backbone = require("aliasUsageInGenericFunction_backbone"); +import moduleA = require("aliasUsageInGenericFunction_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +function foo(x: T) { + return x; +} +var r = foo({ a: moduleA }); +var r2 = foo({ a: null }); + + +//// [aliasUsageInGenericFunction_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInGenericFunction_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInGenericFunction_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInGenericFunction_main.js] +var moduleA = require("aliasUsageInGenericFunction_moduleA"); +function foo(x) { + return x; +} +var r = foo({ a: moduleA }); +var r2 = foo({ a: null }); diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js new file mode 100644 index 0000000000000..dfbb1982ca9f4 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -0,0 +1,63 @@ +//// [tests/cases/compiler/aliasUsageInIndexerOfClass.ts] //// + +//// [aliasUsageInIndexerOfClass_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInIndexerOfClass_moduleA.ts] +import Backbone = require("aliasUsageInIndexerOfClass_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInIndexerOfClass_main.ts] +import Backbone = require("aliasUsageInIndexerOfClass_backbone"); +import moduleA = require("aliasUsageInIndexerOfClass_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +class N { + [idx: string]: IHasVisualizationModel + x = moduleA; +} +class N2 { + [idx: string]: typeof moduleA + x: IHasVisualizationModel; +} + +//// [aliasUsageInIndexerOfClass_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInIndexerOfClass_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInIndexerOfClass_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInIndexerOfClass_main.js] +var N = (function () { + function N() { + this.x = moduleA; + } + return N; +})(); +var N2 = (function () { + function N2() { + } + return N2; +})(); diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js new file mode 100644 index 0000000000000..50ccfaf944dce --- /dev/null +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -0,0 +1,51 @@ +//// [tests/cases/compiler/aliasUsageInObjectLiteral.ts] //// + +//// [aliasUsageInObjectLiteral_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInObjectLiteral_moduleA.ts] +import Backbone = require("aliasUsageInObjectLiteral_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInObjectLiteral_main.ts] +import Backbone = require("aliasUsageInObjectLiteral_backbone"); +import moduleA = require("aliasUsageInObjectLiteral_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +var a: { x: typeof moduleA } = { x: moduleA }; +var b: { x: IHasVisualizationModel } = { x: moduleA }; +var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } }; + +//// [aliasUsageInObjectLiteral_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInObjectLiteral_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInObjectLiteral_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInObjectLiteral_main.js] +var moduleA = require("aliasUsageInObjectLiteral_moduleA"); +var a = { x: moduleA }; +var b = { x: moduleA }; +var c = { y: { z: moduleA } }; diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js new file mode 100644 index 0000000000000..07a382ebca11a --- /dev/null +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -0,0 +1,57 @@ +//// [tests/cases/compiler/aliasUsageInOrExpression.ts] //// + +//// [aliasUsageInOrExpression_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInOrExpression_moduleA.ts] +import Backbone = require("aliasUsageInOrExpression_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInOrExpression_main.ts] +import Backbone = require("aliasUsageInOrExpression_backbone"); +import moduleA = require("aliasUsageInOrExpression_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +var i: IHasVisualizationModel; +var d1 = i || moduleA; +var d2: IHasVisualizationModel = i || moduleA; +var d2: IHasVisualizationModel = moduleA || i; +var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; +var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; + +//// [aliasUsageInOrExpression_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInOrExpression_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInOrExpression_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInOrExpression_main.js] +var moduleA = require("aliasUsageInOrExpression_moduleA"); +var i; +var d1 = i || moduleA; +var d2 = i || moduleA; +var d2 = moduleA || i; +var e = null || { x: moduleA }; +var f = null ? { x: moduleA } : null; diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js new file mode 100644 index 0000000000000..7161d06552891 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -0,0 +1,70 @@ +//// [tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause.ts] //// + +//// [aliasUsageInTypeArgumentOfExtendsClause_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts] +import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInTypeArgumentOfExtendsClause_main.ts] +import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); +import moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +class C { + x: T; +} +class D extends C { + x = moduleA; +} + +//// [aliasUsageInTypeArgumentOfExtendsClause_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInTypeArgumentOfExtendsClause_main.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA"); +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + this.x = moduleA; + } + return D; +})(C); diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js new file mode 100644 index 0000000000000..31d976f6ef269 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/aliasUsageInVarAssignment.ts] //// + +//// [aliasUsageInVarAssignment_backbone.ts] +export class Model { + public someData: string; +} + +//// [aliasUsageInVarAssignment_moduleA.ts] +import Backbone = require("aliasUsageInVarAssignment_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [aliasUsageInVarAssignment_main.ts] +import Backbone = require("aliasUsageInVarAssignment_backbone"); +import moduleA = require("aliasUsageInVarAssignment_moduleA"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +var i: IHasVisualizationModel; +var m: typeof moduleA = i; + +//// [aliasUsageInVarAssignment_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [aliasUsageInVarAssignment_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("aliasUsageInVarAssignment_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [aliasUsageInVarAssignment_main.js] +var i; +var m = i; diff --git a/tests/baselines/reference/aliasUsedAsNameValue.js b/tests/baselines/reference/aliasUsedAsNameValue.js new file mode 100644 index 0000000000000..af9ab422ab572 --- /dev/null +++ b/tests/baselines/reference/aliasUsedAsNameValue.js @@ -0,0 +1,33 @@ +//// [tests/cases/compiler/aliasUsedAsNameValue.ts] //// + +//// [aliasUsedAsNameValue_0.ts] +export var id: number; + +//// [aliasUsedAsNameValue_1.ts] +export function b(a: any): any { return null; } + +//// [aliasUsedAsNameValue_2.ts] +/// +/// +import mod = require("aliasUsedAsNameValue_0"); +import b = require("aliasUsedAsNameValue_1"); + +export var a = function () { + //var x = mod.id; // TODO needed hack that mod is loaded + b.b(mod); +} + + +//// [aliasUsedAsNameValue_0.js] +exports.id; +//// [aliasUsedAsNameValue_1.js] +function b(a) { + return null; +} +exports.b = b; +//// [aliasUsedAsNameValue_2.js] +var mod = require("aliasUsedAsNameValue_0"); +var b = require("aliasUsedAsNameValue_1"); +exports.a = function () { + b.b(mod); +}; diff --git a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt new file mode 100644 index 0000000000000..3185336f8f7bc --- /dev/null +++ b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.ts (1 errors) ==== + import moduleA = require("aliasWithInterfaceExportAssignmentUsedInVarInitializer_0"); + var d = b.q3; + ~ +!!! Cannot find name 'b'. +==== tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.ts (0 errors) ==== + interface c { + q3: number; + } + export = c; + \ No newline at end of file diff --git a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.js b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.js new file mode 100644 index 0000000000000..bd76945438fed --- /dev/null +++ b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.js @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer.ts] //// + +//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.ts] +interface c { + q3: number; +} +export = c; + +//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.ts] +import moduleA = require("aliasWithInterfaceExportAssignmentUsedInVarInitializer_0"); +var d = b.q3; + +//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.js] +//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.js] +var d = b.q3; diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.js b/tests/baselines/reference/ambientClassDeclarationWithExtends.js new file mode 100644 index 0000000000000..5fd4d5b4b28ea --- /dev/null +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.js @@ -0,0 +1,6 @@ +//// [ambientClassDeclarationWithExtends.ts] +declare class A { } +declare class B extends A { } + + +//// [ambientClassDeclarationWithExtends.js] diff --git a/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt b/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt new file mode 100644 index 0000000000000..ed00c2a4a1662 --- /dev/null +++ b/tests/baselines/reference/ambientClassOverloadForFunction.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/ambientClassOverloadForFunction.ts (1 errors) ==== + declare class foo{}; + function foo() { return null; } + ~~~ +!!! Duplicate identifier 'foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/ambientClassOverloadForFunction.js b/tests/baselines/reference/ambientClassOverloadForFunction.js new file mode 100644 index 0000000000000..cf3a59a465d50 --- /dev/null +++ b/tests/baselines/reference/ambientClassOverloadForFunction.js @@ -0,0 +1,10 @@ +//// [ambientClassOverloadForFunction.ts] +declare class foo{}; +function foo() { return null; } + + +//// [ambientClassOverloadForFunction.js] +; +function foo() { + return null; +} diff --git a/tests/baselines/reference/ambientDeclarations.js b/tests/baselines/reference/ambientDeclarations.js new file mode 100644 index 0000000000000..8d03ac0a60032 --- /dev/null +++ b/tests/baselines/reference/ambientDeclarations.js @@ -0,0 +1,82 @@ +//// [ambientDeclarations.ts] +// Ambient variable without type annotation +declare var n; + +// Ambient variable with type annotation +declare var m: string; + +// Ambient function with no type annotations +declare function fn1(); + +// Ambient function with type annotations +declare function fn2(n: string): number; + +// Ambient function with valid overloads +declare function fn3(n: string): number; +declare function fn4(n: number, y: number): string; + +// Ambient function with optional parameters +declare function fn5(x, y?); +declare function fn6(e?); +declare function fn7(x, y?, ...z); +declare function fn8(y?, ...z: number[]); +declare function fn9(...q: {}[]); +declare function fn10(...q: T[]); + +// Ambient class +declare class cls { + constructor(); + method(): cls; + static static(p): number; + static q; + private fn(); + private static fns(); +} + +// Ambient enum +declare enum E1 { + x, + y, + z +} + +// Ambient enum with integer literal initializer +declare enum E2 { + q, + a = 1, + b, + c = 2, + d +} + +// Ambient enum members are always exported with or without export keyword +declare enum E3 { + A +} +declare module E3 { + var B; +} +var x = E3.B; + +// Ambient module +declare module M1 { + var x; + function fn(): number; +} + +// Ambient module members are always exported with or without export keyword +var p = M1.x; +var q = M1.fn(); + +// Ambient external module in the global module +// Ambient external module with a string literal name that is a top level external module name +declare module 'external1' { + var q; +} + + + +//// [ambientDeclarations.js] +var x = E3.B; +var p = M1.x; +var q = M1.fn(); diff --git a/tests/baselines/reference/ambientDeclarationsExternal.errors.txt b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt new file mode 100644 index 0000000000000..94b3c770d6048 --- /dev/null +++ b/tests/baselines/reference/ambientDeclarationsExternal.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/conformance/ambient/consumer.ts (1 errors) ==== + /// + import imp1 = require('equ'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + + // Ambient external module members are always exported with or without export keyword when module lacks export assignment + import imp3 = require('equ2'); + var n = imp3.x; + var n: number; + +==== tests/cases/conformance/ambient/decls.ts (0 errors) ==== + + // Ambient external module with export assignment + declare module 'equ' { + var x; + export = x; + } + + declare module 'equ2' { + var x: number; + } + + // Ambient external import declaration referencing ambient external module using top level module name \ No newline at end of file diff --git a/tests/baselines/reference/ambientDeclarationsExternal.js b/tests/baselines/reference/ambientDeclarationsExternal.js new file mode 100644 index 0000000000000..09b5e00fa3352 --- /dev/null +++ b/tests/baselines/reference/ambientDeclarationsExternal.js @@ -0,0 +1,31 @@ +//// [tests/cases/conformance/ambient/ambientDeclarationsExternal.ts] //// + +//// [decls.ts] + +// Ambient external module with export assignment +declare module 'equ' { + var x; + export = x; +} + +declare module 'equ2' { + var x: number; +} + +// Ambient external import declaration referencing ambient external module using top level module name +//// [consumer.ts] +/// +import imp1 = require('equ'); + + +// Ambient external module members are always exported with or without export keyword when module lacks export assignment +import imp3 = require('equ2'); +var n = imp3.x; +var n: number; + + +//// [decls.js] +//// [consumer.js] +var imp3 = require('equ2'); +var n = imp3.x; +var n; diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.js b/tests/baselines/reference/ambientEnumElementInitializer1.js new file mode 100644 index 0000000000000..8a4801f48f594 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer1.js @@ -0,0 +1,6 @@ +//// [ambientEnumElementInitializer1.ts] +declare enum E { + e = 3 +} + +//// [ambientEnumElementInitializer1.js] diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.js b/tests/baselines/reference/ambientEnumElementInitializer2.js new file mode 100644 index 0000000000000..536b05a8f8b1f --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer2.js @@ -0,0 +1,6 @@ +//// [ambientEnumElementInitializer2.ts] +declare enum E { + e = -3 // Negative +} + +//// [ambientEnumElementInitializer2.js] diff --git a/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt b/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt new file mode 100644 index 0000000000000..159204675e998 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer3.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/ambientEnumElementInitializer3.ts (1 errors) ==== + declare enum E { + e = 3.3 // Decimal + ~ +!!! Ambient enum elements can only have integer literal initializers. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.js b/tests/baselines/reference/ambientEnumElementInitializer4.js new file mode 100644 index 0000000000000..634c641f6b641 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer4.js @@ -0,0 +1,6 @@ +//// [ambientEnumElementInitializer4.ts] +declare enum E { + e = 0xA +} + +//// [ambientEnumElementInitializer4.js] diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.js b/tests/baselines/reference/ambientEnumElementInitializer5.js new file mode 100644 index 0000000000000..5f2c0c59daa30 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer5.js @@ -0,0 +1,6 @@ +//// [ambientEnumElementInitializer5.ts] +declare enum E { + e = -0xA +} + +//// [ambientEnumElementInitializer5.js] diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.js b/tests/baselines/reference/ambientEnumElementInitializer6.js new file mode 100644 index 0000000000000..cc4001aba1b41 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer6.js @@ -0,0 +1,8 @@ +//// [ambientEnumElementInitializer6.ts] +declare module M { + enum E { + e = 3 + } +} + +//// [ambientEnumElementInitializer6.js] diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt new file mode 100644 index 0000000000000..07c0259860bf4 --- /dev/null +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -0,0 +1,92 @@ +==== tests/cases/conformance/ambient/ambientErrors.ts (16 errors) ==== + // Ambient variable with an initializer + declare var x = 4; + ~ +!!! Initializers are not allowed in ambient contexts. + + // Ambient functions with invalid overloads + declare function fn(x: number): string; + declare function fn(x: 'foo'): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + + // Ambient functions with duplicate signatures + declare function fn1(x: number): string; + declare function fn1(x: number): string; + + // Ambient function overloads that differ only by return type + declare function fn2(x: number): string; + declare function fn2(x: number): number; + + // Ambient function with default parameter values + declare function fn3(x = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + + // Ambient function with function body + declare function fn4() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + + // Ambient enum with non - integer literal constant member + declare enum E1 { + y = 4.23 + ~ +!!! Ambient enum elements can only have integer literal initializers. + } + + // Ambient enum with computer member + declare enum E2 { + x = 'foo'.length + ~ +!!! Ambient enum elements can only have integer literal initializers. + } + + // Ambient module with initializers for values, bodies for functions / classes + declare module M1 { + var x = 3; + ~ +!!! Initializers are not allowed in ambient contexts. + function fn() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + class C { + static x = 3; + ~ +!!! Initializers are not allowed in ambient contexts. + y = 4; + ~ +!!! Initializers are not allowed in ambient contexts. + constructor() { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + fn() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static sfn() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + } + } + + // Ambient external module not in the global module + module M2 { + declare module 'nope' { } + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + + // Ambient external module with a string literal name that isn't a top level external module name + declare module '../foo' { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Ambient external module declaration cannot specify relative module name. + + // Ambient external module with export assignment and other exported members + declare module 'bar' { + var n; + export var q; + export = n; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + } + \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt new file mode 100644 index 0000000000000..769f440b2db06 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts (2 errors) ==== + + class D { } + export = D; + + declare module "ext" { + ~~~~~~~~~~~~~~~~~~~~~~ + export class C { } + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + // Cannot resolve this ext module reference + import ext = require("ext"); + ~~~~~ +!!! Cannot find external module 'ext'. + var x = ext; \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js new file mode 100644 index 0000000000000..ea97c54213459 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.js @@ -0,0 +1,23 @@ +//// [ambientExternalModuleInAnotherExternalModule.ts] + +class D { } +export = D; + +declare module "ext" { + export class C { } +} + +// Cannot resolve this ext module reference +import ext = require("ext"); +var x = ext; + +//// [ambientExternalModuleInAnotherExternalModule.js] +define(["require", "exports", "ext"], function (require, exports, ext) { + var D = (function () { + function D() { + } + return D; + })(); + var x = ext; + return D; +}); diff --git a/tests/baselines/reference/ambientExternalModuleReopen.js b/tests/baselines/reference/ambientExternalModuleReopen.js new file mode 100644 index 0000000000000..85a37da411620 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleReopen.js @@ -0,0 +1,9 @@ +//// [ambientExternalModuleReopen.ts] +declare module "fs" { + var x: string; +} +declare module 'fs' { + var y: number; +} + +//// [ambientExternalModuleReopen.js] diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js new file mode 100644 index 0000000000000..bfcde56cfed35 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration.ts] //// + +//// [ambientExternalModuleWithInternalImportDeclaration_0.ts] +declare module 'M' { + module C { + export var f: number; + } + class C { + foo(): void; + } + import X = C; + export = X; + +} + +//// [ambientExternalModuleWithInternalImportDeclaration_1.ts] +/// +import A = require('M'); +var c = new A(); + +//// [ambientExternalModuleWithInternalImportDeclaration_0.js] +//// [ambientExternalModuleWithInternalImportDeclaration_1.js] +define(["require", "exports", 'M'], function (require, exports, A) { + var c = new A(); +}); diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt new file mode 100644 index 0000000000000..2f4779ebfacaa --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts (2 errors) ==== + declare module "OuterModule" { + import m2 = require("./SubModule"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declaration in an ambient external module declaration cannot reference external module through relative external module name. + ~~~~~~~~~~~~~ +!!! Cannot find external module './SubModule'. + class SubModule { + public static StaticVar: number; + public InstanceVar: number; + public x: m2.c; + constructor(); + } + export = SubModule; + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js new file mode 100644 index 0000000000000..07a9ad96b9ddc --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js @@ -0,0 +1,13 @@ +//// [ambientExternalModuleWithRelativeExternalImportDeclaration.ts] +declare module "OuterModule" { + import m2 = require("./SubModule"); + class SubModule { + public static StaticVar: number; + public InstanceVar: number; + public x: m2.c; + constructor(); + } + export = SubModule; +} + +//// [ambientExternalModuleWithRelativeExternalImportDeclaration.js] diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt new file mode 100644 index 0000000000000..290199b02420a --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts (2 errors) ==== + declare module "./relativeModule" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var x: string; + ~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Ambient external module declaration cannot specify relative module name. + + declare module ".\\relativeModule" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var x: string; + ~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Ambient external module declaration cannot specify relative module name. \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js new file mode 100644 index 0000000000000..9a4622a1b7e97 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js @@ -0,0 +1,10 @@ +//// [ambientExternalModuleWithRelativeModuleName.ts] +declare module "./relativeModule" { + var x: string; +} + +declare module ".\\relativeModule" { + var x: string; +} + +//// [ambientExternalModuleWithRelativeModuleName.js] diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js new file mode 100644 index 0000000000000..db6be7be8fc76 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration.ts] //// + +//// [ambientExternalModuleWithoutInternalImportDeclaration_0.ts] +declare module 'M' { + module C { + export var f: number; + } + class C { + foo(): void; + } + export = C; + +} + +//// [ambientExternalModuleWithoutInternalImportDeclaration_1.ts] +/// +import A = require('M'); +var c = new A(); + +//// [ambientExternalModuleWithoutInternalImportDeclaration_0.js] +//// [ambientExternalModuleWithoutInternalImportDeclaration_1.js] +define(["require", "exports", 'M'], function (require, exports, A) { + var c = new A(); +}); diff --git a/tests/baselines/reference/ambientFundule.js b/tests/baselines/reference/ambientFundule.js new file mode 100644 index 0000000000000..85193977eda6f --- /dev/null +++ b/tests/baselines/reference/ambientFundule.js @@ -0,0 +1,6 @@ +//// [ambientFundule.ts] +declare function f(); +declare module f { var x } +declare function f(x); + +//// [ambientFundule.js] diff --git a/tests/baselines/reference/ambientGetters.errors.txt b/tests/baselines/reference/ambientGetters.errors.txt new file mode 100644 index 0000000000000..a09ef7cf8cfc5 --- /dev/null +++ b/tests/baselines/reference/ambientGetters.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/ambientGetters.ts (3 errors) ==== + + declare class A { + get length() : number; + ~ +!!! '{' expected. + } + ~ +!!! Declaration or statement expected. + + declare class B { + get length() { return 0; } + ~~~~~~ +!!! An accessor cannot be declared in an ambient context. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientModuleExports.js b/tests/baselines/reference/ambientModuleExports.js new file mode 100644 index 0000000000000..59c608a717469 --- /dev/null +++ b/tests/baselines/reference/ambientModuleExports.js @@ -0,0 +1,28 @@ +//// [ambientModuleExports.ts] +declare module Foo { + function a():void; + var b:number; + class C {} +} + +Foo.a(); +Foo.b; +var c = new Foo.C(); + +declare module Foo2 { + export function a(): void; + export var b: number; + export class C { } +} + +Foo2.a(); +Foo2.b; +var c2 = new Foo2.C(); + +//// [ambientModuleExports.js] +Foo.a(); +Foo.b; +var c = new Foo.C(); +Foo2.a(); +Foo2.b; +var c2 = new Foo2.C(); diff --git a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js new file mode 100644 index 0000000000000..4061095edff49 --- /dev/null +++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js @@ -0,0 +1,7 @@ +//// [ambientModuleWithClassDeclarationWithExtends.ts] +declare module foo { + class A { } + class B extends A { } +} + +//// [ambientModuleWithClassDeclarationWithExtends.js] diff --git a/tests/baselines/reference/ambientModules.js b/tests/baselines/reference/ambientModules.js new file mode 100644 index 0000000000000..7551ff2c6a2c3 --- /dev/null +++ b/tests/baselines/reference/ambientModules.js @@ -0,0 +1,7 @@ +//// [ambientModules.ts] +declare module Foo.Bar { export var foo; }; +Foo.Bar.foo = 5; + +//// [ambientModules.js] +; +Foo.Bar.foo = 5; diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt new file mode 100644 index 0000000000000..f201851049195 --- /dev/null +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -0,0 +1,56 @@ +==== tests/cases/compiler/ambientWithStatements.ts (14 errors) ==== + declare module M { + break; + ~~~~~ +!!! Statements are not allowed in ambient contexts. + continue; + ~~~~~~~~ +!!! Statements are not allowed in ambient contexts. + debugger; + ~~~~~~~~ +!!! Statements are not allowed in ambient contexts. + do { } while (true); + ~~ +!!! Statements are not allowed in ambient contexts. + var x; + for (x in null) { } + ~~~ +!!! Statements are not allowed in ambient contexts. + ~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + if (true) { } else { } + ~~ +!!! Statements are not allowed in ambient contexts. + 1; + ~ +!!! Statements are not allowed in ambient contexts. + L: var y; + ~ +!!! Statements are not allowed in ambient contexts. + return; + ~~~~~~ +!!! Statements are not allowed in ambient contexts. + switch (x) { + ~~~~~~ +!!! Statements are not allowed in ambient contexts. + case 1: + break; + default: + break; + } + throw "nooo"; + ~~~~~ +!!! Statements are not allowed in ambient contexts. + try { + ~~~ +!!! Statements are not allowed in ambient contexts. + } + catch (e) { + } + finally { + } + with (x) { + ~~~~ +!!! Statements are not allowed in ambient contexts. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js new file mode 100644 index 0000000000000..2144c55c3bd1a --- /dev/null +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js @@ -0,0 +1,52 @@ +//// [ambiguousCallsWhereReturnTypesAgree.ts] +class TestClass { + public bar(x: string): void; + public bar(x: string[]): void; + public bar(x: any): void { + + } + + public foo(x: string): void; + public foo(x: string[]): void; + public foo(x: any): void { + this.bar(x); // should not error + } +} + +class TestClass2 { + public bar(x: string): number; + public bar(x: string[]): number; + public bar(x: any): number { + return 0; + } + + public foo(x: string): number; + public foo(x: string[]): number; + public foo(x: any): number { + return this.bar(x); // should not error + } +} + + +//// [ambiguousCallsWhereReturnTypesAgree.js] +var TestClass = (function () { + function TestClass() { + } + TestClass.prototype.bar = function (x) { + }; + TestClass.prototype.foo = function (x) { + this.bar(x); + }; + return TestClass; +})(); +var TestClass2 = (function () { + function TestClass2() { + } + TestClass2.prototype.bar = function (x) { + return 0; + }; + TestClass2.prototype.foo = function (x) { + return this.bar(x); + }; + return TestClass2; +})(); diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt new file mode 100644 index 0000000000000..5547ccb63f71a --- /dev/null +++ b/tests/baselines/reference/ambiguousGenericAssertion1.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/ambiguousGenericAssertion1.ts (5 errors) ==== + function f(x: T): T { return null; } + var r = (x: T) => x; + var r2 = < (x: T) => T>f; // valid + var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operation + ~~ +!!! Expression expected. + ~ +!!! ')' expected. + ~ +!!! ',' expected. + ~~ +!!! ';' expected. + ~ +!!! Cannot find name 'x'. + \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousOverload.errors.txt b/tests/baselines/reference/ambiguousOverload.errors.txt new file mode 100644 index 0000000000000..7848f01b4d61e --- /dev/null +++ b/tests/baselines/reference/ambiguousOverload.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/ambiguousOverload.ts (2 errors) ==== + function foof(bar: string, y): number; + function foof(bar: string, x): string; + function foof(bar: any): any { return bar }; + var x: number = foof("s", null); + var y: string = foof("s", null); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + + function foof2(bar: string, x): string; + function foof2(bar: string, y): number; + function foof2(bar: any): any { return bar }; + var x2: string = foof2("s", null); + var y2: number = foof2("s", null); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/ambiguousOverload.js b/tests/baselines/reference/ambiguousOverload.js new file mode 100644 index 0000000000000..fd373c075a2f0 --- /dev/null +++ b/tests/baselines/reference/ambiguousOverload.js @@ -0,0 +1,26 @@ +//// [ambiguousOverload.ts] +function foof(bar: string, y): number; +function foof(bar: string, x): string; +function foof(bar: any): any { return bar }; +var x: number = foof("s", null); +var y: string = foof("s", null); + +function foof2(bar: string, x): string; +function foof2(bar: string, y): number; +function foof2(bar: any): any { return bar }; +var x2: string = foof2("s", null); +var y2: number = foof2("s", null); + +//// [ambiguousOverload.js] +function foof(bar) { + return bar; +} +; +var x = foof("s", null); +var y = foof("s", null); +function foof2(bar) { + return bar; +} +; +var x2 = foof2("s", null); +var y2 = foof2("s", null); diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js new file mode 100644 index 0000000000000..966c9f1462807 --- /dev/null +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -0,0 +1,31 @@ +//// [ambiguousOverloadResolution.ts] +class A { } +class B extends A { x: number; } + +declare function f(p: A, q: B): number; +declare function f(p: B, q: A): string; + +var x: B; +var t: number = f(x, x); // Not an error + +//// [ambiguousOverloadResolution.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var x; +var t = f(x, x); diff --git a/tests/baselines/reference/amdDependencyComment1.errors.txt b/tests/baselines/reference/amdDependencyComment1.errors.txt new file mode 100644 index 0000000000000..97ce60ff1b87b --- /dev/null +++ b/tests/baselines/reference/amdDependencyComment1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/amdDependencyComment1.ts (1 errors) ==== + /// + + import m1 = require("m2") + ~~~~ +!!! Cannot find external module 'm2'. + m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyComment1.js b/tests/baselines/reference/amdDependencyComment1.js new file mode 100644 index 0000000000000..18fa8147e54ba --- /dev/null +++ b/tests/baselines/reference/amdDependencyComment1.js @@ -0,0 +1,9 @@ +//// [amdDependencyComment1.ts] +/// + +import m1 = require("m2") +m1.f(); + +//// [amdDependencyComment1.js] +var m1 = require("m2"); +m1.f(); diff --git a/tests/baselines/reference/amdDependencyComment2.errors.txt b/tests/baselines/reference/amdDependencyComment2.errors.txt new file mode 100644 index 0000000000000..edab2e9c955c1 --- /dev/null +++ b/tests/baselines/reference/amdDependencyComment2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/amdDependencyComment2.ts (1 errors) ==== + /// + + import m1 = require("m2") + ~~~~ +!!! Cannot find external module 'm2'. + m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyComment2.js b/tests/baselines/reference/amdDependencyComment2.js new file mode 100644 index 0000000000000..835e5921689da --- /dev/null +++ b/tests/baselines/reference/amdDependencyComment2.js @@ -0,0 +1,10 @@ +//// [amdDependencyComment2.ts] +/// + +import m1 = require("m2") +m1.f(); + +//// [amdDependencyComment2.js] +define(["require", "exports", "m2", "bar"], function (require, exports, m1) { + m1.f(); +}); diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.js b/tests/baselines/reference/amdImportAsPrimaryExpression.js new file mode 100644 index 0000000000000..4704b32d9891c --- /dev/null +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/externalModules/amdImportAsPrimaryExpression.ts] //// + +//// [foo_0.ts] +export enum E1 { + A,B,C +} + +//// [foo_1.ts] +import foo = require("./foo_0"); +if(foo.E1.A === 0){ + // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. +} + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + (function (E1) { + E1[E1["A"] = 0] = "A"; + E1[E1["B"] = 1] = "B"; + E1[E1["C"] = 2] = "C"; + })(exports.E1 || (exports.E1 = {})); + var E1 = exports.E1; +}); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + if (0 /* A */ === 0) { + } +}); diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.js b/tests/baselines/reference/amdImportNotAsPrimaryExpression.js new file mode 100644 index 0000000000000..c80da50da143a --- /dev/null +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.js @@ -0,0 +1,58 @@ +//// [tests/cases/conformance/externalModules/amdImportNotAsPrimaryExpression.ts] //// + +//// [foo_0.ts] +export class C1 { + m1 = 42; + static s1 = true; +} + +export interface I1 { + name: string; + age: number; +} + +export module M1 { + export interface I2 { + foo: string; + } +} + +export enum E1 { + A,B,C +} + +//// [foo_1.ts] +import foo = require("./foo_0"); +// None of the below should cause a runtime dependency on foo_0 +import f = foo.M1; +var i: f.I2; +var x: foo.C1 = <{m1: number}>{}; +var y: typeof foo.C1.s1 = false; +var z: foo.M1.I2; +var e: number = 0; + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + var C1 = (function () { + function C1() { + this.m1 = 42; + } + C1.s1 = true; + return C1; + })(); + exports.C1 = C1; + (function (E1) { + E1[E1["A"] = 0] = "A"; + E1[E1["B"] = 1] = "B"; + E1[E1["C"] = 2] = "C"; + })(exports.E1 || (exports.E1 = {})); + var E1 = exports.E1; +}); +//// [foo_1.js] +define(["require", "exports"], function (require, exports) { + var i; + var x = {}; + var y = false; + var z; + var e = 0; +}); diff --git a/tests/baselines/reference/anonterface.js b/tests/baselines/reference/anonterface.js new file mode 100644 index 0000000000000..59d055b29d732 --- /dev/null +++ b/tests/baselines/reference/anonterface.js @@ -0,0 +1,33 @@ +//// [anonterface.ts] +module M { + export class C { + m(fn:{ (n:number):string; },n2:number):string { + return fn(n2); + } + } +} + +var c=new M.C(); +c.m(function(n) { return "hello: "+n; },18); + + + + + +//// [anonterface.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + C.prototype.m = function (fn, n2) { + return fn(n2); + }; + return C; + })(); + M.C = C; +})(M || (M = {})); +var c = new M.C(); +c.m(function (n) { + return "hello: " + n; +}, 18); diff --git a/tests/baselines/reference/anonymousModules.errors.txt b/tests/baselines/reference/anonymousModules.errors.txt new file mode 100644 index 0000000000000..bebc718c007a9 --- /dev/null +++ b/tests/baselines/reference/anonymousModules.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/anonymousModules.ts (12 errors) ==== + module { + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. + export var foo = 1; + ~~~~~~ +!!! Statement expected. + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + module { + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. + export var bar = 1; + ~~~~~~ +!!! Statement expected. + } + ~ +!!! Declaration or statement expected. + + var bar = 2; + ~~~ +!!! Duplicate identifier 'bar'. + + module { + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. + var x = bar; + } + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/anyAsConstructor.errors.txt b/tests/baselines/reference/anyAsConstructor.errors.txt new file mode 100644 index 0000000000000..ffd31da40451b --- /dev/null +++ b/tests/baselines/reference/anyAsConstructor.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/types/any/anyAsConstructor.ts (1 errors) ==== + // any is considered an untyped function call + // can be called except with type arguments which is an error + + var x: any; + var a = new x(); + var b = new x('hello'); + var c = new x(x); + + // grammar allows this for constructors + var d = new x(x); // no error + ~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/anyAsConstructor.js b/tests/baselines/reference/anyAsConstructor.js new file mode 100644 index 0000000000000..1924a2bd28504 --- /dev/null +++ b/tests/baselines/reference/anyAsConstructor.js @@ -0,0 +1,18 @@ +//// [anyAsConstructor.ts] +// any is considered an untyped function call +// can be called except with type arguments which is an error + +var x: any; +var a = new x(); +var b = new x('hello'); +var c = new x(x); + +// grammar allows this for constructors +var d = new x(x); // no error + +//// [anyAsConstructor.js] +var x; +var a = new x(); +var b = new x('hello'); +var c = new x(x); +var d = new x(x); diff --git a/tests/baselines/reference/anyAsFunctionCall.js b/tests/baselines/reference/anyAsFunctionCall.js new file mode 100644 index 0000000000000..468c0a98f4da2 --- /dev/null +++ b/tests/baselines/reference/anyAsFunctionCall.js @@ -0,0 +1,14 @@ +//// [anyAsFunctionCall.ts] +// any is considered an untyped function call +// can be called except with type arguments which is an error + +var x: any; +var a = x(); +var b = x('hello'); +var c = x(x); + +//// [anyAsFunctionCall.js] +var x; +var a = x(); +var b = x('hello'); +var c = x(x); diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt new file mode 100644 index 0000000000000..7fbe17d0e185b --- /dev/null +++ b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts (4 errors) ==== + // any is considered an untyped function call + // can be called except with type arguments which is an error + + var x: any; + var a = x(); + ~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + var b = x('hello'); + ~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + + class C { foo: string; } + var c = x(x); + ~~~~~~~ +!!! Untyped function calls may not accept type arguments. + var d = x(x); + ~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.js b/tests/baselines/reference/anyAsGenericFunctionCall.js new file mode 100644 index 0000000000000..6d61470bd175f --- /dev/null +++ b/tests/baselines/reference/anyAsGenericFunctionCall.js @@ -0,0 +1,23 @@ +//// [anyAsGenericFunctionCall.ts] +// any is considered an untyped function call +// can be called except with type arguments which is an error + +var x: any; +var a = x(); +var b = x('hello'); + +class C { foo: string; } +var c = x(x); +var d = x(x); + +//// [anyAsGenericFunctionCall.js] +var x; +var a = x(); +var b = x('hello'); +var C = (function () { + function C() { + } + return C; +})(); +var c = x(x); +var d = x(x); diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js new file mode 100644 index 0000000000000..a6b26d3890e40 --- /dev/null +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js @@ -0,0 +1,23 @@ +//// [anyAsReturnTypeForNewOnCall.ts] +function Point(x, y) { + + this.x = x; + + this.y = y; + +} + +var o = new Point(3, 4); + +var xx = o.x; + + + + +//// [anyAsReturnTypeForNewOnCall.js] +function Point(x, y) { + this.x = x; + this.y = y; +} +var o = new Point(3, 4); +var xx = o.x; diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js new file mode 100644 index 0000000000000..261768e2981c7 --- /dev/null +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -0,0 +1,138 @@ +//// [anyAssignabilityInInheritance.ts] +// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted + +interface I { + [x: string]: any; + foo: any; // ok, any identical to itself +} + +var a: any; + +declare function foo2(x: number): number; +declare function foo2(x: any): any; +var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload) + +declare function foo3(x: string): string; +declare function foo3(x: any): any; +var r3 = foo3(a); // any + +declare function foo4(x: boolean): boolean; +declare function foo4(x: any): any; +var r3 = foo3(a); // any + +declare function foo5(x: Date): Date; +declare function foo5(x: any): any; +var r3 = foo3(a); // any + +declare function foo6(x: RegExp): RegExp; +declare function foo6(x: any): any; +var r3 = foo3(a); // any + +declare function foo7(x: { bar: number }): { bar: number }; +declare function foo7(x: any): any; +var r3 = foo3(a); // any + +declare function foo8(x: number[]): number[]; +declare function foo8(x: any): any; +var r3 = foo3(a); // any + +interface I8 { foo: string } +declare function foo9(x: I8): I8; +declare function foo9(x: any): any; +var r3 = foo3(a); // any + +class A { foo: number; } +declare function foo10(x: A): A; +declare function foo10(x: any): any; +var r3 = foo3(a); // any + +class A2 { foo: T; } +declare function foo11(x: A2): A2; +declare function foo11(x: any): any; +var r3 = foo3(a); // any + +declare function foo12(x: (x) => number): (x) => number; +declare function foo12(x: any): any; +var r3 = foo3(a); // any + +declare function foo13(x: (x: T) => T): (x: T) => T; +declare function foo13(x: any): any; +var r3 = foo3(a); // any + +enum E { A } +declare function foo14(x: E): E; +declare function foo14(x: any): any; +var r3 = foo3(a); // any + +function f() { } +module f { + export var bar = 1; +} +declare function foo15(x: typeof f): typeof f; +declare function foo15(x: any): any; +var r3 = foo3(a); // any + +class CC { baz: string } +module CC { + export var bar = 1; +} +declare function foo16(x: CC): CC; +declare function foo16(x: any): any; +var r3 = foo3(a); // any + +declare function foo17(x: Object): Object; +declare function foo17(x: any): any; +var r3 = foo3(a); // any + +declare function foo18(x: {}): {}; +declare function foo18(x: any): any; +var r3 = foo3(a); // any + +//// [anyAssignabilityInInheritance.js] +var a; +var r3 = foo2(a); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var A = (function () { + function A() { + } + return A; +})(); +var r3 = foo3(a); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var r3 = foo3(a); +function f() { +} +var f; +(function (f) { + f.bar = 1; +})(f || (f = {})); +var r3 = foo3(a); +var CC = (function () { + function CC() { + } + return CC; +})(); +var CC; +(function (CC) { + CC.bar = 1; +})(CC || (CC = {})); +var r3 = foo3(a); +var r3 = foo3(a); +var r3 = foo3(a); diff --git a/tests/baselines/reference/anyAssignableToEveryType.js b/tests/baselines/reference/anyAssignableToEveryType.js new file mode 100644 index 0000000000000..6c117a5054dc2 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType.js @@ -0,0 +1,85 @@ +//// [anyAssignableToEveryType.ts] +var a: any; + +class C { + foo: string; +} +var ac: C; +interface I { + foo: string; +} +var ai: I; + +enum E { A } +var ae: E; + +var b: number = a; +var c: string = a; +var d: boolean = a; +var e: Date = a; +var f: any = a; +var g: void = a; +var h: Object = a; +var i: {} = a; +var j: () => {} = a; +var k: Function = a; +var l: (x: number) => string = a; +ac = a; +ai = a; +ae = a; +var m: number[] = a; +var n: { foo: string } = a; +var o: (x: T) => T = a; +var p: Number = a; +var q: String = a; + +function foo(x: T, y: U, z: V) { + x = a; + y = a; + z = a; +} + +//function foo(x: T, y: U, z: V) { +// x = a; +// y = a; +// z = a; +//} + +//// [anyAssignableToEveryType.js] +var a; +var C = (function () { + function C() { + } + return C; +})(); +var ac; +var ai; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var ae; +var b = a; +var c = a; +var d = a; +var e = a; +var f = a; +var g = a; +var h = a; +var i = a; +var j = a; +var k = a; +var l = a; +ac = a; +ai = a; +ae = a; +var m = a; +var n = a; +var o = a; +var p = a; +var q = a; +function foo(x, y, z) { + x = a; + y = a; + z = a; +} diff --git a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt new file mode 100644 index 0000000000000..927fe3c62744e --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt @@ -0,0 +1,133 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts (1 errors) ==== + // any is not a subtype of any other types, but is assignable, all the below should work + + interface I { + [x: string]: any; + foo: any; // ok, any identical to itself + } + + + interface I2 { + [x: string]: number; + foo: any; + } + + + interface I3 { + [x: string]: string; + foo: any; + } + + + interface I4 { + [x: string]: boolean; + foo: any; + } + + + interface I5 { + [x: string]: Date; + foo: any; + } + + + interface I6 { + [x: string]: RegExp; + foo: any; + } + + + interface I7 { + [x: string]: { bar: number }; + foo: any; + } + + + interface I8 { + [x: string]: number[]; + foo: any; + } + + + interface I9 { + [x: string]: I8; + foo: any; + } + + class A { foo: number; } + interface I10 { + [x: string]: A; + foo: any; + } + + class A2 { foo: T; } + interface I11 { + [x: string]: A2; + foo: any; + } + + + interface I12 { + [x: string]: (x) => number; + foo: any; + } + + + interface I13 { + [x: string]: (x: T) => T; + foo: any; + } + + + enum E { A } + interface I14 { + [x: string]: E; + foo: any; + } + + + function f() { } + module f { + export var bar = 1; + } + interface I15 { + [x: string]: typeof f; + foo: any; + } + + + class c { baz: string } + module c { + export var bar = 1; + } + interface I16 { + [x: string]: typeof c; + foo: any; + } + + + interface I17 { + [x: string]: T; + foo: any; + } + + + interface I18 { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + [x: string]: U; + foo: any; + } + + + interface I19 { + [x: string]: Object; + foo: any; + } + + + interface I20 { + [x: string]: {}; + foo: any; + } + \ No newline at end of file diff --git a/tests/baselines/reference/anyAssignableToEveryType2.js b/tests/baselines/reference/anyAssignableToEveryType2.js new file mode 100644 index 0000000000000..88eb08d45e786 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType2.js @@ -0,0 +1,162 @@ +//// [anyAssignableToEveryType2.ts] +// any is not a subtype of any other types, but is assignable, all the below should work + +interface I { + [x: string]: any; + foo: any; // ok, any identical to itself +} + + +interface I2 { + [x: string]: number; + foo: any; +} + + +interface I3 { + [x: string]: string; + foo: any; +} + + +interface I4 { + [x: string]: boolean; + foo: any; +} + + +interface I5 { + [x: string]: Date; + foo: any; +} + + +interface I6 { + [x: string]: RegExp; + foo: any; +} + + +interface I7 { + [x: string]: { bar: number }; + foo: any; +} + + +interface I8 { + [x: string]: number[]; + foo: any; +} + + +interface I9 { + [x: string]: I8; + foo: any; +} + +class A { foo: number; } +interface I10 { + [x: string]: A; + foo: any; +} + +class A2 { foo: T; } +interface I11 { + [x: string]: A2; + foo: any; +} + + +interface I12 { + [x: string]: (x) => number; + foo: any; +} + + +interface I13 { + [x: string]: (x: T) => T; + foo: any; +} + + +enum E { A } +interface I14 { + [x: string]: E; + foo: any; +} + + +function f() { } +module f { + export var bar = 1; +} +interface I15 { + [x: string]: typeof f; + foo: any; +} + + +class c { baz: string } +module c { + export var bar = 1; +} +interface I16 { + [x: string]: typeof c; + foo: any; +} + + +interface I17 { + [x: string]: T; + foo: any; +} + + +interface I18 { + [x: string]: U; + foo: any; +} + + +interface I19 { + [x: string]: Object; + foo: any; +} + + +interface I20 { + [x: string]: {}; + foo: any; +} + + +//// [anyAssignableToEveryType2.js] +var A = (function () { + function A() { + } + return A; +})(); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +function f() { +} +var f; +(function (f) { + f.bar = 1; +})(f || (f = {})); +var c = (function () { + function c() { + } + return c; +})(); +var c; +(function (c) { + c.bar = 1; +})(c || (c = {})); diff --git a/tests/baselines/reference/anyDeclare.errors.txt b/tests/baselines/reference/anyDeclare.errors.txt new file mode 100644 index 0000000000000..0bb771b6d912a --- /dev/null +++ b/tests/baselines/reference/anyDeclare.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/anyDeclare.ts (1 errors) ==== + declare var x: any; + module myMod { + var myFn; + function myFn() { } + ~~~~ +!!! Duplicate identifier 'myFn'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/anyDeclare.js b/tests/baselines/reference/anyDeclare.js new file mode 100644 index 0000000000000..a46a2529491f6 --- /dev/null +++ b/tests/baselines/reference/anyDeclare.js @@ -0,0 +1,15 @@ +//// [anyDeclare.ts] +declare var x: any; +module myMod { + var myFn; + function myFn() { } +} + + +//// [anyDeclare.js] +var myMod; +(function (myMod) { + var myFn; + function myFn() { + } +})(myMod || (myMod = {})); diff --git a/tests/baselines/reference/anyIdenticalToItself.errors.txt b/tests/baselines/reference/anyIdenticalToItself.errors.txt new file mode 100644 index 0000000000000..36c31825cb9bf --- /dev/null +++ b/tests/baselines/reference/anyIdenticalToItself.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/anyIdenticalToItself.ts (3 errors) ==== + function foo(x: any); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(x: any); + function foo(x: any, y: number) { } + + class C { + get X(): any { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var y: any; + return y; + } + set X(v: any) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.js b/tests/baselines/reference/anyInferenceAnonymousFunctions.js new file mode 100644 index 0000000000000..e232ec29593c7 --- /dev/null +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.js @@ -0,0 +1,32 @@ +//// [anyInferenceAnonymousFunctions.ts] +var paired: any[]; + +paired.reduce(function (a1, a2) { + + return a1.concat({}); + +} , []); + +paired.reduce((b1, b2) => { + + return b1.concat({}); +} , []); + +paired.reduce((b3, b4) => b3.concat({}), []); + +paired.map((c1) => c1.count); +paired.map(function (c2) { return c2.count; }); + +//// [anyInferenceAnonymousFunctions.js] +var paired; +paired.reduce(function (a1, a2) { + return a1.concat({}); +}, []); +paired.reduce(function (b1, b2) { + return b1.concat({}); +}, []); +paired.reduce(function (b3, b4) { return b3.concat({}); }, []); +paired.map(function (c1) { return c1.count; }); +paired.map(function (c2) { + return c2.count; +}); diff --git a/tests/baselines/reference/anyIsAssignableToObject.js b/tests/baselines/reference/anyIsAssignableToObject.js new file mode 100644 index 0000000000000..fc333cb15e06b --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToObject.js @@ -0,0 +1,10 @@ +//// [anyIsAssignableToObject.ts] +interface P { + p: {}; +} + +interface Q extends P { // Check assignability here. Any is assignable to {} + p: any; +} + +//// [anyIsAssignableToObject.js] diff --git a/tests/baselines/reference/anyIsAssignableToVoid.js b/tests/baselines/reference/anyIsAssignableToVoid.js new file mode 100644 index 0000000000000..75e6e979ac3ff --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToVoid.js @@ -0,0 +1,10 @@ +//// [anyIsAssignableToVoid.ts] +interface P { + p: void; +} + +interface Q extends P { // check assignability here. any is assignable to void. + p: any; +} + +//// [anyIsAssignableToVoid.js] diff --git a/tests/baselines/reference/anyPlusAny1.js b/tests/baselines/reference/anyPlusAny1.js new file mode 100644 index 0000000000000..457688933d7d6 --- /dev/null +++ b/tests/baselines/reference/anyPlusAny1.js @@ -0,0 +1,9 @@ +//// [anyPlusAny1.ts] +var x; +x.name = "hello"; +var z = x + x; + +//// [anyPlusAny1.js] +var x; +x.name = "hello"; +var z = x + x; diff --git a/tests/baselines/reference/anyPropertyAccess.js b/tests/baselines/reference/anyPropertyAccess.js new file mode 100644 index 0000000000000..aa3298acfbe82 --- /dev/null +++ b/tests/baselines/reference/anyPropertyAccess.js @@ -0,0 +1,17 @@ +//// [anyPropertyAccess.ts] +var x: any; +var a = x.foo; +var b = x['foo']; +var c = x['fn'](); +var d = x.bar.baz; +var e = x[0].foo; +var f = x['0'].bar; + +//// [anyPropertyAccess.js] +var x; +var a = x.foo; +var b = x['foo']; +var c = x['fn'](); +var d = x.bar.baz; +var e = x[0].foo; +var f = x['0'].bar; diff --git a/tests/baselines/reference/apparentTypeSubtyping.errors.txt b/tests/baselines/reference/apparentTypeSubtyping.errors.txt new file mode 100644 index 0000000000000..f5725bd07ff69 --- /dev/null +++ b/tests/baselines/reference/apparentTypeSubtyping.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts (1 errors) ==== + // subtype checks use the apparent type of the target type + // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: + + class Base { + x: U; + } + + // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) + class Derived extends Base { // error + ~~~~~~~ +!!! Class 'Derived' incorrectly extends base class 'Base': +!!! Types of property 'x' are incompatible: +!!! Type 'String' is not assignable to type 'string'. + x: String; + } + + class Base2 { + x: String; + static s: String; + } + + // is U extends String (S) a subtype of String (T)? Apparent type of U is String so it succeeds + class Derived2 extends Base2 { // error because of the prototype's not matching, not because of the instance side + x: U; + } \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js new file mode 100644 index 0000000000000..8612107f2903d --- /dev/null +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -0,0 +1,54 @@ +//// [apparentTypeSubtyping.ts] +// subtype checks use the apparent type of the target type +// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: + +class Base { + x: U; +} + +// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) +class Derived extends Base { // error + x: String; +} + +class Base2 { + x: String; + static s: String; +} + +// is U extends String (S) a subtype of String (T)? Apparent type of U is String so it succeeds +class Derived2 extends Base2 { // error because of the prototype's not matching, not because of the instance side + x: U; +} + +//// [apparentTypeSubtyping.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); diff --git a/tests/baselines/reference/apparentTypeSupertype.errors.txt b/tests/baselines/reference/apparentTypeSupertype.errors.txt new file mode 100644 index 0000000000000..a2442d7122297 --- /dev/null +++ b/tests/baselines/reference/apparentTypeSupertype.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts (1 errors) ==== + // subtype checks use the apparent type of the target type + // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: + + class Base { + x: string; + } + + // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) + class Derived extends Base { // error + ~~~~~~~ +!!! Class 'Derived' incorrectly extends base class 'Base': +!!! Types of property 'x' are incompatible: +!!! Type 'U' is not assignable to type 'string'. + x: U; + } \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js new file mode 100644 index 0000000000000..18c2974b3bac9 --- /dev/null +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -0,0 +1,32 @@ +//// [apparentTypeSupertype.ts] +// subtype checks use the apparent type of the target type +// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: + +class Base { + x: string; +} + +// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) +class Derived extends Base { // error + x: U; +} + +//// [apparentTypeSupertype.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); diff --git a/tests/baselines/reference/argsInScope.js b/tests/baselines/reference/argsInScope.js new file mode 100644 index 0000000000000..76b7ab0e99fdb --- /dev/null +++ b/tests/baselines/reference/argsInScope.js @@ -0,0 +1,25 @@ +//// [argsInScope.ts] +class C { + P(ii:number, j:number, k:number) { + for (var i = 0; i < arguments.length; i++) { + // WScript.Echo("param: " + arguments[i]); + } + } +} + +var c = new C(); +c.P(1,2,3); + + +//// [argsInScope.js] +var C = (function () { + function C() { + } + C.prototype.P = function (ii, j, k) { + for (var i = 0; i < arguments.length; i++) { + } + }; + return C; +})(); +var c = new C(); +c.P(1, 2, 3); diff --git a/tests/baselines/reference/arguments.js b/tests/baselines/reference/arguments.js new file mode 100644 index 0000000000000..b19821aa8f106 --- /dev/null +++ b/tests/baselines/reference/arguments.js @@ -0,0 +1,9 @@ +//// [arguments.ts] +function f() { + var x=arguments[12]; +} + +//// [arguments.js] +function f() { + var x = arguments[12]; +} diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt new file mode 100644 index 0000000000000..b894b6193eb83 --- /dev/null +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== + var arguments = 10; + function foo(a) { + arguments = 10; /// This shouldnt be of type number and result in error. + ~~~~~~~~~ +!!! Type 'number' is not assignable to type 'IArguments': +!!! Property 'length' is missing in type 'Number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js new file mode 100644 index 0000000000000..6d021a45eba75 --- /dev/null +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js @@ -0,0 +1,11 @@ +//// [argumentsBindsToFunctionScopeArgumentList.ts] +var arguments = 10; +function foo(a) { + arguments = 10; /// This shouldnt be of type number and result in error. +} + +//// [argumentsBindsToFunctionScopeArgumentList.js] +var arguments = 10; +function foo(a) { + arguments = 10; +} diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js new file mode 100644 index 0000000000000..47edef44ef092 --- /dev/null +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js @@ -0,0 +1,20 @@ +//// [argumentsUsedInObjectLiteralProperty.ts] +class A { + public static createSelectableViewModel(initialState?: any, selectedValue?: any) { + return { + selectedValue: arguments.length + }; + } +} + +//// [argumentsUsedInObjectLiteralProperty.js] +var A = (function () { + function A() { + } + A.createSelectableViewModel = function (initialState, selectedValue) { + return { + selectedValue: arguments.length + }; + }; + return A; +})(); diff --git a/tests/baselines/reference/arithAssignTyping.errors.txt b/tests/baselines/reference/arithAssignTyping.errors.txt new file mode 100644 index 0000000000000..cdeaf94829370 --- /dev/null +++ b/tests/baselines/reference/arithAssignTyping.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/arithAssignTyping.ts (12 errors) ==== + class f { } + + f += ''; // error + ~ +!!! Invalid left-hand side of assignment expression. + f += 1; // error + ~~~~~~ +!!! Operator '+=' cannot be applied to types 'typeof f' and 'number'. + f -= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f *= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f /= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f %= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f &= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f |= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f <<= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f >>= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f >>>= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + f ^= 1; // error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithAssignTyping.js b/tests/baselines/reference/arithAssignTyping.js new file mode 100644 index 0000000000000..5d4776fd99f99 --- /dev/null +++ b/tests/baselines/reference/arithAssignTyping.js @@ -0,0 +1,34 @@ +//// [arithAssignTyping.ts] +class f { } + +f += ''; // error +f += 1; // error +f -= 1; // error +f *= 1; // error +f /= 1; // error +f %= 1; // error +f &= 1; // error +f |= 1; // error +f <<= 1; // error +f >>= 1; // error +f >>>= 1; // error +f ^= 1; // error + +//// [arithAssignTyping.js] +var f = (function () { + function f() { + } + return f; +})(); +f += ''; +f += 1; +f -= 1; +f *= 1; +f /= 1; +f %= 1; +f &= 1; +f |= 1; +f <<= 1; +f >>= 1; +f >>>= 1; +f ^= 1; diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt new file mode 100644 index 0000000000000..caa8c959d6fea --- /dev/null +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/arithmeticOnInvalidTypes.ts (7 errors) ==== + var x: Number; + var y: Number; + var z = x + y; + ~~~~~ +!!! Operator '+' cannot be applied to types 'Number' and 'Number'. + var z2 = x - y; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var z3 = x * y; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var z4 = x / y; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes.js b/tests/baselines/reference/arithmeticOnInvalidTypes.js new file mode 100644 index 0000000000000..f9cf056ba2353 --- /dev/null +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.js @@ -0,0 +1,15 @@ +//// [arithmeticOnInvalidTypes.ts] +var x: Number; +var y: Number; +var z = x + y; +var z2 = x - y; +var z3 = x * y; +var z4 = x / y; + +//// [arithmeticOnInvalidTypes.js] +var x; +var y; +var z = x + y; +var z2 = x - y; +var z3 = x * y; +var z4 = x / y; diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt b/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt new file mode 100644 index 0000000000000..5cb6824846d0d --- /dev/null +++ b/tests/baselines/reference/arithmeticOnInvalidTypes2.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/arithmeticOnInvalidTypes2.ts (7 errors) ==== + var obj = function f(a: T, b: T) { + var z1 = a + b; + ~~~~~ +!!! Operator '+' cannot be applied to types 'T' and 'T'. + var z2 = a - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var z3 = a * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var z4 = a / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + return a; + }; \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes2.js b/tests/baselines/reference/arithmeticOnInvalidTypes2.js new file mode 100644 index 0000000000000..38a54d6615f70 --- /dev/null +++ b/tests/baselines/reference/arithmeticOnInvalidTypes2.js @@ -0,0 +1,17 @@ +//// [arithmeticOnInvalidTypes2.ts] +var obj = function f(a: T, b: T) { + var z1 = a + b; + var z2 = a - b; + var z3 = a * b; + var z4 = a / b; + return a; +}; + +//// [arithmeticOnInvalidTypes2.js] +var obj = function f(a, b) { + var z1 = a + b; + var z2 = a - b; + var z3 = a * b; + var z4 = a / b; + return a; +}; diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js new file mode 100644 index 0000000000000..0bb27138c2374 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js @@ -0,0 +1,187 @@ +//// [arithmeticOperatorWithAnyAndNumber.ts] +var a: any; +var b: number; + +// operator * +var ra1 = a * a; +var ra2 = a * b; +var ra3 = a * 0; +var ra4 = 0 * a; +var ra5 = 0 * 0; +var ra6 = b * 0; +var ra7 = 0 * b; +var ra8 = b * b; + +// operator / +var rb1 = a / a; +var rb2 = a / b; +var rb3 = a / 0; +var rb4 = 0 / a; +var rb5 = 0 / 0; +var rb6 = b / 0; +var rb7 = 0 / b; +var rb8 = b / b; + +// operator % +var rc1 = a % a; +var rc2 = a % b; +var rc3 = a % 0; +var rc4 = 0 % a; +var rc5 = 0 % 0; +var rc6 = b % 0; +var rc7 = 0 % b; +var rc8 = b % b; + +// operator - +var rd1 = a - a; +var rd2 = a - b; +var rd3 = a - 0; +var rd4 = 0 - a; +var rd5 = 0 - 0; +var rd6 = b - 0; +var rd7 = 0 - b; +var rd8 = b - b; + +// operator << +var re1 = a << a; +var re2 = a << b; +var re3 = a << 0; +var re4 = 0 << a; +var re5 = 0 << 0; +var re6 = b << 0; +var re7 = 0 << b; +var re8 = b << b; + +// operator >> +var rf1 = a >> a; +var rf2 = a >> b; +var rf3 = a >> 0; +var rf4 = 0 >> a; +var rf5 = 0 >> 0; +var rf6 = b >> 0; +var rf7 = 0 >> b; +var rf8 = b >> b; + +// operator >>> +var rg1 = a >>> a; +var rg2 = a >>> b; +var rg3 = a >>> 0; +var rg4 = 0 >>> a; +var rg5 = 0 >>> 0; +var rg6 = b >>> 0; +var rg7 = 0 >>> b; +var rg8 = b >>> b; + +// operator & +var rh1 = a & a; +var rh2 = a & b; +var rh3 = a & 0; +var rh4 = 0 & a; +var rh5 = 0 & 0; +var rh6 = b & 0; +var rh7 = 0 & b; +var rh8 = b & b; + +// operator ^ +var ri1 = a ^ a; +var ri2 = a ^ b; +var ri3 = a ^ 0; +var ri4 = 0 ^ a; +var ri5 = 0 ^ 0; +var ri6 = b ^ 0; +var ri7 = 0 ^ b; +var ri8 = b ^ b; + +// operator | +var rj1 = a | a; +var rj2 = a | b; +var rj3 = a | 0; +var rj4 = 0 | a; +var rj5 = 0 | 0; +var rj6 = b | 0; +var rj7 = 0 | b; +var rj8 = b | b; + +//// [arithmeticOperatorWithAnyAndNumber.js] +var a; +var b; +var ra1 = a * a; +var ra2 = a * b; +var ra3 = a * 0; +var ra4 = 0 * a; +var ra5 = 0 * 0; +var ra6 = b * 0; +var ra7 = 0 * b; +var ra8 = b * b; +var rb1 = a / a; +var rb2 = a / b; +var rb3 = a / 0; +var rb4 = 0 / a; +var rb5 = 0 / 0; +var rb6 = b / 0; +var rb7 = 0 / b; +var rb8 = b / b; +var rc1 = a % a; +var rc2 = a % b; +var rc3 = a % 0; +var rc4 = 0 % a; +var rc5 = 0 % 0; +var rc6 = b % 0; +var rc7 = 0 % b; +var rc8 = b % b; +var rd1 = a - a; +var rd2 = a - b; +var rd3 = a - 0; +var rd4 = 0 - a; +var rd5 = 0 - 0; +var rd6 = b - 0; +var rd7 = 0 - b; +var rd8 = b - b; +var re1 = a << a; +var re2 = a << b; +var re3 = a << 0; +var re4 = 0 << a; +var re5 = 0 << 0; +var re6 = b << 0; +var re7 = 0 << b; +var re8 = b << b; +var rf1 = a >> a; +var rf2 = a >> b; +var rf3 = a >> 0; +var rf4 = 0 >> a; +var rf5 = 0 >> 0; +var rf6 = b >> 0; +var rf7 = 0 >> b; +var rf8 = b >> b; +var rg1 = a >>> a; +var rg2 = a >>> b; +var rg3 = a >>> 0; +var rg4 = 0 >>> a; +var rg5 = 0 >>> 0; +var rg6 = b >>> 0; +var rg7 = 0 >>> b; +var rg8 = b >>> b; +var rh1 = a & a; +var rh2 = a & b; +var rh3 = a & 0; +var rh4 = 0 & a; +var rh5 = 0 & 0; +var rh6 = b & 0; +var rh7 = 0 & b; +var rh8 = b & b; +var ri1 = a ^ a; +var ri2 = a ^ b; +var ri3 = a ^ 0; +var ri4 = 0 ^ a; +var ri5 = 0 ^ 0; +var ri6 = b ^ 0; +var ri7 = 0 ^ b; +var ri8 = b ^ b; +var rj1 = a | a; +var rj2 = a | b; +var rj3 = a | 0; +var rj4 = 0 | a; +var rj5 = 0 | 0; +var rj6 = b | 0; +var rj7 = 0 | b; +var rj8 = b | b; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.js b/tests/baselines/reference/arithmeticOperatorWithEnum.js new file mode 100644 index 0000000000000..ac2bfb233ede7 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.js @@ -0,0 +1,281 @@ +//// [arithmeticOperatorWithEnum.ts] +// operands of an enum type are treated as having the primitive type Number. + +enum E { + a, + b +} + +var a: any; +var b: number; +var c: E; + +// operator * +var ra1 = c * a; +var ra2 = c * b; +var ra3 = c * c; +var ra4 = a * c; +var ra5 = b * c; +var ra6 = E.a * a; +var ra7 = E.a * b; +var ra8 = E.a * E.b; +var ra9 = E.a * 1; +var ra10 = a * E.b; +var ra11 = b * E.b; +var ra12 = 1 * E.b; + +// operator / +var rb1 = c / a; +var rb2 = c / b; +var rb3 = c / c; +var rb4 = a / c; +var rb5 = b / c; +var rb6 = E.a / a; +var rb7 = E.a / b; +var rb8 = E.a / E.b; +var rb9 = E.a / 1; +var rb10 = a / E.b; +var rb11 = b / E.b; +var rb12 = 1 / E.b; + +// operator % +var rc1 = c % a; +var rc2 = c % b; +var rc3 = c % c; +var rc4 = a % c; +var rc5 = b % c; +var rc6 = E.a % a; +var rc7 = E.a % b; +var rc8 = E.a % E.b; +var rc9 = E.a % 1; +var rc10 = a % E.b; +var rc11 = b % E.b; +var rc12 = 1 % E.b; + +// operator - +var rd1 = c - a; +var rd2 = c - b; +var rd3 = c - c; +var rd4 = a - c; +var rd5 = b - c; +var rd6 = E.a - a; +var rd7 = E.a - b; +var rd8 = E.a - E.b; +var rd9 = E.a - 1; +var rd10 = a - E.b; +var rd11 = b - E.b; +var rd12 = 1 - E.b; + +// operator << +var re1 = c << a; +var re2 = c << b; +var re3 = c << c; +var re4 = a << c; +var re5 = b << c; +var re6 = E.a << a; +var re7 = E.a << b; +var re8 = E.a << E.b; +var re9 = E.a << 1; +var re10 = a << E.b; +var re11 = b << E.b; +var re12 = 1 << E.b; + +// operator >> +var rf1 = c >> a; +var rf2 = c >> b; +var rf3 = c >> c; +var rf4 = a >> c; +var rf5 = b >> c; +var rf6 = E.a >> a; +var rf7 = E.a >> b; +var rf8 = E.a >> E.b; +var rf9 = E.a >> 1; +var rf10 = a >> E.b; +var rf11 = b >> E.b; +var rf12 = 1 >> E.b; + +// operator >>> +var rg1 = c >>> a; +var rg2 = c >>> b; +var rg3 = c >>> c; +var rg4 = a >>> c; +var rg5 = b >>> c; +var rg6 = E.a >>> a; +var rg7 = E.a >>> b; +var rg8 = E.a >>> E.b; +var rg9 = E.a >>> 1; +var rg10 = a >>> E.b; +var rg11 = b >>> E.b; +var rg12 = 1 >>> E.b; + +// operator & +var rh1 = c & a; +var rh2 = c & b; +var rh3 = c & c; +var rh4 = a & c; +var rh5 = b & c; +var rh6 = E.a & a; +var rh7 = E.a & b; +var rh8 = E.a & E.b; +var rh9 = E.a & 1; +var rh10 = a & E.b; +var rh11 = b & E.b; +var rh12 = 1 & E.b; + +// operator ^ +var ri1 = c ^ a; +var ri2 = c ^ b; +var ri3 = c ^ c; +var ri4 = a ^ c; +var ri5 = b ^ c; +var ri6 = E.a ^ a; +var ri7 = E.a ^ b; +var ri8 = E.a ^ E.b; +var ri9 = E.a ^ 1; +var ri10 = a ^ E.b; +var ri11 = b ^ E.b; +var ri12 = 1 ^ E.b; + +// operator | +var rj1 = c | a; +var rj2 = c | b; +var rj3 = c | c; +var rj4 = a | c; +var rj5 = b | c; +var rj6 = E.a | a; +var rj7 = E.a | b; +var rj8 = E.a | E.b; +var rj9 = E.a | 1; +var rj10 = a | E.b; +var rj11 = b | E.b; +var rj12 = 1 | E.b; + +//// [arithmeticOperatorWithEnum.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var c; +var ra1 = c * a; +var ra2 = c * b; +var ra3 = c * c; +var ra4 = a * c; +var ra5 = b * c; +var ra6 = 0 /* a */ * a; +var ra7 = 0 /* a */ * b; +var ra8 = 0 /* a */ * 1 /* b */; +var ra9 = 0 /* a */ * 1; +var ra10 = a * 1 /* b */; +var ra11 = b * 1 /* b */; +var ra12 = 1 * 1 /* b */; +var rb1 = c / a; +var rb2 = c / b; +var rb3 = c / c; +var rb4 = a / c; +var rb5 = b / c; +var rb6 = 0 /* a */ / a; +var rb7 = 0 /* a */ / b; +var rb8 = 0 /* a */ / 1 /* b */; +var rb9 = 0 /* a */ / 1; +var rb10 = a / 1 /* b */; +var rb11 = b / 1 /* b */; +var rb12 = 1 / 1 /* b */; +var rc1 = c % a; +var rc2 = c % b; +var rc3 = c % c; +var rc4 = a % c; +var rc5 = b % c; +var rc6 = 0 /* a */ % a; +var rc7 = 0 /* a */ % b; +var rc8 = 0 /* a */ % 1 /* b */; +var rc9 = 0 /* a */ % 1; +var rc10 = a % 1 /* b */; +var rc11 = b % 1 /* b */; +var rc12 = 1 % 1 /* b */; +var rd1 = c - a; +var rd2 = c - b; +var rd3 = c - c; +var rd4 = a - c; +var rd5 = b - c; +var rd6 = 0 /* a */ - a; +var rd7 = 0 /* a */ - b; +var rd8 = 0 /* a */ - 1 /* b */; +var rd9 = 0 /* a */ - 1; +var rd10 = a - 1 /* b */; +var rd11 = b - 1 /* b */; +var rd12 = 1 - 1 /* b */; +var re1 = c << a; +var re2 = c << b; +var re3 = c << c; +var re4 = a << c; +var re5 = b << c; +var re6 = 0 /* a */ << a; +var re7 = 0 /* a */ << b; +var re8 = 0 /* a */ << 1 /* b */; +var re9 = 0 /* a */ << 1; +var re10 = a << 1 /* b */; +var re11 = b << 1 /* b */; +var re12 = 1 << 1 /* b */; +var rf1 = c >> a; +var rf2 = c >> b; +var rf3 = c >> c; +var rf4 = a >> c; +var rf5 = b >> c; +var rf6 = 0 /* a */ >> a; +var rf7 = 0 /* a */ >> b; +var rf8 = 0 /* a */ >> 1 /* b */; +var rf9 = 0 /* a */ >> 1; +var rf10 = a >> 1 /* b */; +var rf11 = b >> 1 /* b */; +var rf12 = 1 >> 1 /* b */; +var rg1 = c >>> a; +var rg2 = c >>> b; +var rg3 = c >>> c; +var rg4 = a >>> c; +var rg5 = b >>> c; +var rg6 = 0 /* a */ >>> a; +var rg7 = 0 /* a */ >>> b; +var rg8 = 0 /* a */ >>> 1 /* b */; +var rg9 = 0 /* a */ >>> 1; +var rg10 = a >>> 1 /* b */; +var rg11 = b >>> 1 /* b */; +var rg12 = 1 >>> 1 /* b */; +var rh1 = c & a; +var rh2 = c & b; +var rh3 = c & c; +var rh4 = a & c; +var rh5 = b & c; +var rh6 = 0 /* a */ & a; +var rh7 = 0 /* a */ & b; +var rh8 = 0 /* a */ & 1 /* b */; +var rh9 = 0 /* a */ & 1; +var rh10 = a & 1 /* b */; +var rh11 = b & 1 /* b */; +var rh12 = 1 & 1 /* b */; +var ri1 = c ^ a; +var ri2 = c ^ b; +var ri3 = c ^ c; +var ri4 = a ^ c; +var ri5 = b ^ c; +var ri6 = 0 /* a */ ^ a; +var ri7 = 0 /* a */ ^ b; +var ri8 = 0 /* a */ ^ 1 /* b */; +var ri9 = 0 /* a */ ^ 1; +var ri10 = a ^ 1 /* b */; +var ri11 = b ^ 1 /* b */; +var ri12 = 1 ^ 1 /* b */; +var rj1 = c | a; +var rj2 = c | b; +var rj3 = c | c; +var rj4 = a | c; +var rj5 = b | c; +var rj6 = 0 /* a */ | a; +var rj7 = 0 /* a */ | b; +var rj8 = 0 /* a */ | 1 /* b */; +var rj9 = 0 /* a */ | 1; +var rj10 = a | 1 /* b */; +var rj11 = b | 1 /* b */; +var rj12 = 1 | 1 /* b */; diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..359d6c8095a84 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.errors.txt @@ -0,0 +1,1702 @@ +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts (560 errors) ==== + // these operators require their operands to be of type Any, the Number primitive type, or + // an enum type + enum E { a, b, c } + + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: { a: number }; + var f: Number; + + // All of the below should be an error unless otherwise noted + // operator * + var r1a1 = a * a; //ok + var r1a2 = a * b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = a * c; //ok + var r1a4 = a * d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a5 = a * e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a6 = a * f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = b * a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = b * c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b4 = b * d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b5 = b * e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b6 = b * f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = c * a; //ok + var r1c2 = c * b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = c * c; //ok + var r1c4 = c * d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c5 = c * e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c6 = c * f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = d * a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = d * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = d * c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d4 = d * d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d5 = d * e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d6 = d * f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1e1 = e * a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e2 = e * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e3 = e * c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e4 = e * d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e5 = e * e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e6 = e * f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1f1 = f * a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f2 = f * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f3 = f * c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f4 = f * d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f5 = f * e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f6 = f * f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1g1 = E.a * a; //ok + var r1g2 = E.a * b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g3 = E.a * c; //ok + var r1g4 = E.a * d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g5 = E.a * e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1g6 = E.a * f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1h1 = a * E.b; //ok + var r1h2 = b * E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h3 = c * E.b; //ok + var r1h4 = d * E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h5 = e * E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1h6 = f * E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator / + var r2a1 = a / a; //ok + var r2a2 = a / b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a3 = a / c; //ok + var r2a4 = a / d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a5 = a / e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a6 = a / f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2b1 = b / a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b2 = b / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b3 = b / c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b4 = b / d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b5 = b / e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b6 = b / f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2c1 = c / a; //ok + var r2c2 = c / b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c3 = c / c; //ok + var r2c4 = c / d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c5 = c / e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c6 = c / f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2d1 = d / a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d2 = d / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d3 = d / c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d4 = d / d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d5 = d / e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d6 = d / f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2e1 = e / a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e2 = e / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e3 = e / c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e4 = e / d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e5 = e / e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e6 = e / f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2f1 = f / a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2f2 = f / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2f3 = f / c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2f4 = f / d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2f5 = f / e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2f6 = f / f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2g1 = E.a / a; //ok + var r2g2 = E.a / b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2g3 = E.a / c; //ok + var r2g4 = E.a / d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2g5 = E.a / e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2g6 = E.a / f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2h1 = a / E.b; //ok + var r2h2 = b / E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2h3 = c / E.b; //ok + var r2h4 = d / E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2h5 = e / E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2h6 = f / E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator % + var r3a1 = a % a; //ok + var r3a2 = a % b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a3 = a % c; //ok + var r3a4 = a % d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a5 = a % e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a6 = a % f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3b1 = b % a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b2 = b % b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b3 = b % c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b4 = b % d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b5 = b % e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b6 = b % f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3c1 = c % a; //ok + var r3c2 = c % b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c3 = c % c; //ok + var r3c4 = c % d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c5 = c % e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c6 = c % f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3d1 = d % a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d2 = d % b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d3 = d % c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d4 = d % d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d5 = d % e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d6 = d % f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3e1 = e % a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3e2 = e % b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3e3 = e % c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3e4 = e % d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3e5 = e % e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3e6 = e % f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3f1 = f % a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3f2 = f % b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3f3 = f % c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3f4 = f % d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3f5 = f % e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3f6 = f % f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3g1 = E.a % a; //ok + var r3g2 = E.a % b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3g3 = E.a % c; //ok + var r3g4 = E.a % d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3g5 = E.a % e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3g6 = E.a % f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3h1 = a % E.b; //ok + var r3h2 = b % E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3h3 = c % E.b; //ok + var r3h4 = d % E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3h5 = e % E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3h6 = f % E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator - + var r4a1 = a - a; //ok + var r4a2 = a - b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a3 = a - c; //ok + var r4a4 = a - d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a5 = a - e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a6 = a - f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4b1 = b - a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b2 = b - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b3 = b - c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b4 = b - d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b5 = b - e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b6 = b - f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4c1 = c - a; //ok + var r4c2 = c - b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c3 = c - c; //ok + var r4c4 = c - d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c5 = c - e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c6 = c - f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4d1 = d - a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d2 = d - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d3 = d - c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d4 = d - d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d5 = d - e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d6 = d - f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4e1 = e - a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4e2 = e - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4e3 = e - c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4e4 = e - d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4e5 = e - e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4e6 = e - f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4f1 = f - a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4f2 = f - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4f3 = f - c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4f4 = f - d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4f5 = f - e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4f6 = f - f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4g1 = E.a - a; //ok + var r4g2 = E.a - b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4g3 = E.a - c; //ok + var r4g4 = E.a - d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4g5 = E.a - e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4g6 = E.a - f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4h1 = a - E.b; //ok + var r4h2 = b - E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4h3 = c - E.b; //ok + var r4h4 = d - E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4h5 = e - E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4h6 = f - E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator << + var r5a1 = a << a; //ok + var r5a2 = a << b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a3 = a << c; //ok + var r5a4 = a << d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a5 = a << e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a6 = a << f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5b1 = b << a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b2 = b << b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b3 = b << c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b4 = b << d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b5 = b << e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b6 = b << f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5c1 = c << a; //ok + var r5c2 = c << b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c3 = c << c; //ok + var r5c4 = c << d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c5 = c << e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c6 = c << f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5d1 = d << a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d2 = d << b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d3 = d << c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d4 = d << d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d5 = d << e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d6 = d << f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5e1 = e << a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5e2 = e << b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5e3 = e << c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5e4 = e << d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5e5 = e << e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5e6 = e << f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5f1 = f << a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5f2 = f << b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5f3 = f << c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5f4 = f << d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5f5 = f << e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5f6 = f << f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5g1 = E.a << a; //ok + var r5g2 = E.a << b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5g3 = E.a << c; //ok + var r5g4 = E.a << d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5g5 = E.a << e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5g6 = E.a << f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5h1 = a << E.b; //ok + var r5h2 = b << E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5h3 = c << E.b; //ok + var r5h4 = d << E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5h5 = e << E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5h6 = f << E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >> + var r6a1 = a >> a; //ok + var r6a2 = a >> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a3 = a >> c; //ok + var r6a4 = a >> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a5 = a >> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a6 = a >> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6b1 = b >> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b2 = b >> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b3 = b >> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b4 = b >> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b5 = b >> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b6 = b >> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6c1 = c >> a; //ok + var r6c2 = c >> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c3 = c >> c; //ok + var r6c4 = c >> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c5 = c >> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c6 = c >> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6d1 = d >> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d2 = d >> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d3 = d >> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d4 = d >> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d5 = d >> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d6 = d >> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6e1 = e >> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6e2 = e >> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6e3 = e >> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6e4 = e >> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6e5 = e >> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6e6 = e >> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6f1 = f >> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6f2 = f >> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6f3 = f >> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6f4 = f >> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6f5 = f >> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6f6 = f >> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6g1 = E.a >> a; //ok + var r6g2 = E.a >> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6g3 = E.a >> c; //ok + var r6g4 = E.a >> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6g5 = E.a >> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6g6 = E.a >> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6h1 = a >> E.b; //ok + var r6h2 = b >> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6h3 = c >> E.b; //ok + var r6h4 = d >> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6h5 = e >> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6h6 = f >> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >>> + var r7a1 = a >>> a; //ok + var r7a2 = a >>> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a3 = a >>> c; //ok + var r7a4 = a >>> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a5 = a >>> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a6 = a >>> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7b1 = b >>> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b2 = b >>> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b3 = b >>> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b4 = b >>> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b5 = b >>> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b6 = b >>> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7c1 = c >>> a; //ok + var r7c2 = c >>> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c3 = c >>> c; //ok + var r7c4 = c >>> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c5 = c >>> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c6 = c >>> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7d1 = d >>> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d2 = d >>> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d3 = d >>> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d4 = d >>> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d5 = d >>> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d6 = d >>> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7e1 = e >>> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7e2 = e >>> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7e3 = e >>> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7e4 = e >>> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7e5 = e >>> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7e6 = e >>> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7f1 = f >>> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7f2 = f >>> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7f3 = f >>> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7f4 = f >>> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7f5 = f >>> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7f6 = f >>> f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7g1 = E.a >>> a; //ok + var r7g2 = E.a >>> b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7g3 = E.a >>> c; //ok + var r7g4 = E.a >>> d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7g5 = E.a >>> e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7g6 = E.a >>> f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7h1 = a >>> E.b; //ok + var r7h2 = b >>> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7h3 = c >>> E.b; //ok + var r7h4 = d >>> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7h5 = e >>> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7h6 = f >>> E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator & + var r8a1 = a & a; //ok + var r8a2 = a & b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a3 = a & c; //ok + var r8a4 = a & d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a5 = a & e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a6 = a & f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8b1 = b & a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b2 = b & b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b3 = b & c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b4 = b & d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b5 = b & e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b6 = b & f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8c1 = c & a; //ok + var r8c2 = c & b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c3 = c & c; //ok + var r8c4 = c & d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c5 = c & e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c6 = c & f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8d1 = d & a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d2 = d & b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d3 = d & c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d4 = d & d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d5 = d & e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d6 = d & f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8e1 = e & a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8e2 = e & b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8e3 = e & c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8e4 = e & d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8e5 = e & e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8e6 = e & f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8f1 = f & a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8f2 = f & b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8f3 = f & c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8f4 = f & d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8f5 = f & e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8f6 = f & f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8g1 = E.a & a; //ok + var r8g2 = E.a & b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8g3 = E.a & c; //ok + var r8g4 = E.a & d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8g5 = E.a & e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8g6 = E.a & f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8h1 = a & E.b; //ok + var r8h2 = b & E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8h3 = c & E.b; //ok + var r8h4 = d & E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8h5 = e & E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8h6 = f & E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator ^ + var r9a1 = a ^ a; //ok + var r9a2 = a ^ b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a3 = a ^ c; //ok + var r9a4 = a ^ d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a5 = a ^ e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a6 = a ^ f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9b1 = b ^ a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b2 = b ^ b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b3 = b ^ c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b4 = b ^ d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b5 = b ^ e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b6 = b ^ f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9c1 = c ^ a; //ok + var r9c2 = c ^ b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c3 = c ^ c; //ok + var r9c4 = c ^ d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c5 = c ^ e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c6 = c ^ f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9d1 = d ^ a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d2 = d ^ b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d3 = d ^ c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d4 = d ^ d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d5 = d ^ e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d6 = d ^ f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9e1 = e ^ a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9e2 = e ^ b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9e3 = e ^ c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9e4 = e ^ d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9e5 = e ^ e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9e6 = e ^ f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9f1 = f ^ a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9f2 = f ^ b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9f3 = f ^ c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9f4 = f ^ d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9f5 = f ^ e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9f6 = f ^ f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9g1 = E.a ^ a; //ok + var r9g2 = E.a ^ b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9g3 = E.a ^ c; //ok + var r9g4 = E.a ^ d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9g5 = E.a ^ e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9g6 = E.a ^ f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9h1 = a ^ E.b; //ok + var r9h2 = b ^ E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9h3 = c ^ E.b; //ok + var r9h4 = d ^ E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9h5 = e ^ E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9h6 = f ^ E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator | + var r10a1 = a | a; //ok + var r10a2 = a | b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a3 = a | c; //ok + var r10a4 = a | d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a5 = a | e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a6 = a | f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10b1 = b | a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b2 = b | b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b3 = b | c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b4 = b | d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b5 = b | e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b6 = b | f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10c1 = c | a; //ok + var r10c2 = c | b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c3 = c | c; //ok + var r10c4 = c | d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c5 = c | e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c6 = c | f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10d1 = d | a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d2 = d | b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d3 = d | c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d4 = d | d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d5 = d | e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d6 = d | f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10e1 = e | a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10e2 = e | b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10e3 = e | c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10e4 = e | d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10e5 = e | e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10e6 = e | f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10f1 = f | a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10f2 = f | b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10f3 = f | c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10f4 = f | d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10f5 = f | e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10f6 = f | f; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10g1 = E.a | a; //ok + var r10g2 = E.a | b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10g3 = E.a | c; //ok + var r10g4 = E.a | d; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10g5 = E.a | e; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10g6 = E.a | f; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10h1 = a | E.b; //ok + var r10h2 = b | E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10h3 = c | E.b; //ok + var r10h4 = d | E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10h5 = e | E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10h6 = f | E.b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js new file mode 100644 index 0000000000000..6e4fb872d1e2d --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js @@ -0,0 +1,1076 @@ +//// [arithmeticOperatorWithInvalidOperands.ts] +// these operators require their operands to be of type Any, the Number primitive type, or +// an enum type +enum E { a, b, c } + +var a: any; +var b: boolean; +var c: number; +var d: string; +var e: { a: number }; +var f: Number; + +// All of the below should be an error unless otherwise noted +// operator * +var r1a1 = a * a; //ok +var r1a2 = a * b; +var r1a3 = a * c; //ok +var r1a4 = a * d; +var r1a5 = a * e; +var r1a6 = a * f; + +var r1b1 = b * a; +var r1b2 = b * b; +var r1b3 = b * c; +var r1b4 = b * d; +var r1b5 = b * e; +var r1b6 = b * f; + +var r1c1 = c * a; //ok +var r1c2 = c * b; +var r1c3 = c * c; //ok +var r1c4 = c * d; +var r1c5 = c * e; +var r1c6 = c * f; + +var r1d1 = d * a; +var r1d2 = d * b; +var r1d3 = d * c; +var r1d4 = d * d; +var r1d5 = d * e; +var r1d6 = d * f; + +var r1e1 = e * a; +var r1e2 = e * b; +var r1e3 = e * c; +var r1e4 = e * d; +var r1e5 = e * e; +var r1e6 = e * f; + +var r1f1 = f * a; +var r1f2 = f * b; +var r1f3 = f * c; +var r1f4 = f * d; +var r1f5 = f * e; +var r1f6 = f * f; + +var r1g1 = E.a * a; //ok +var r1g2 = E.a * b; +var r1g3 = E.a * c; //ok +var r1g4 = E.a * d; +var r1g5 = E.a * e; +var r1g6 = E.a * f; + +var r1h1 = a * E.b; //ok +var r1h2 = b * E.b; +var r1h3 = c * E.b; //ok +var r1h4 = d * E.b; +var r1h5 = e * E.b; +var r1h6 = f * E.b; + +// operator / +var r2a1 = a / a; //ok +var r2a2 = a / b; +var r2a3 = a / c; //ok +var r2a4 = a / d; +var r2a5 = a / e; +var r2a6 = a / f; + +var r2b1 = b / a; +var r2b2 = b / b; +var r2b3 = b / c; +var r2b4 = b / d; +var r2b5 = b / e; +var r2b6 = b / f; + +var r2c1 = c / a; //ok +var r2c2 = c / b; +var r2c3 = c / c; //ok +var r2c4 = c / d; +var r2c5 = c / e; +var r2c6 = c / f; + +var r2d1 = d / a; +var r2d2 = d / b; +var r2d3 = d / c; +var r2d4 = d / d; +var r2d5 = d / e; +var r2d6 = d / f; + +var r2e1 = e / a; +var r2e2 = e / b; +var r2e3 = e / c; +var r2e4 = e / d; +var r2e5 = e / e; +var r2e6 = e / f; + +var r2f1 = f / a; +var r2f2 = f / b; +var r2f3 = f / c; +var r2f4 = f / d; +var r2f5 = f / e; +var r2f6 = f / f; + +var r2g1 = E.a / a; //ok +var r2g2 = E.a / b; +var r2g3 = E.a / c; //ok +var r2g4 = E.a / d; +var r2g5 = E.a / e; +var r2g6 = E.a / f; + +var r2h1 = a / E.b; //ok +var r2h2 = b / E.b; +var r2h3 = c / E.b; //ok +var r2h4 = d / E.b; +var r2h5 = e / E.b; +var r2h6 = f / E.b; + +// operator % +var r3a1 = a % a; //ok +var r3a2 = a % b; +var r3a3 = a % c; //ok +var r3a4 = a % d; +var r3a5 = a % e; +var r3a6 = a % f; + +var r3b1 = b % a; +var r3b2 = b % b; +var r3b3 = b % c; +var r3b4 = b % d; +var r3b5 = b % e; +var r3b6 = b % f; + +var r3c1 = c % a; //ok +var r3c2 = c % b; +var r3c3 = c % c; //ok +var r3c4 = c % d; +var r3c5 = c % e; +var r3c6 = c % f; + +var r3d1 = d % a; +var r3d2 = d % b; +var r3d3 = d % c; +var r3d4 = d % d; +var r3d5 = d % e; +var r3d6 = d % f; + +var r3e1 = e % a; +var r3e2 = e % b; +var r3e3 = e % c; +var r3e4 = e % d; +var r3e5 = e % e; +var r3e6 = e % f; + +var r3f1 = f % a; +var r3f2 = f % b; +var r3f3 = f % c; +var r3f4 = f % d; +var r3f5 = f % e; +var r3f6 = f % f; + +var r3g1 = E.a % a; //ok +var r3g2 = E.a % b; +var r3g3 = E.a % c; //ok +var r3g4 = E.a % d; +var r3g5 = E.a % e; +var r3g6 = E.a % f; + +var r3h1 = a % E.b; //ok +var r3h2 = b % E.b; +var r3h3 = c % E.b; //ok +var r3h4 = d % E.b; +var r3h5 = e % E.b; +var r3h6 = f % E.b; + +// operator - +var r4a1 = a - a; //ok +var r4a2 = a - b; +var r4a3 = a - c; //ok +var r4a4 = a - d; +var r4a5 = a - e; +var r4a6 = a - f; + +var r4b1 = b - a; +var r4b2 = b - b; +var r4b3 = b - c; +var r4b4 = b - d; +var r4b5 = b - e; +var r4b6 = b - f; + +var r4c1 = c - a; //ok +var r4c2 = c - b; +var r4c3 = c - c; //ok +var r4c4 = c - d; +var r4c5 = c - e; +var r4c6 = c - f; + +var r4d1 = d - a; +var r4d2 = d - b; +var r4d3 = d - c; +var r4d4 = d - d; +var r4d5 = d - e; +var r4d6 = d - f; + +var r4e1 = e - a; +var r4e2 = e - b; +var r4e3 = e - c; +var r4e4 = e - d; +var r4e5 = e - e; +var r4e6 = e - f; + +var r4f1 = f - a; +var r4f2 = f - b; +var r4f3 = f - c; +var r4f4 = f - d; +var r4f5 = f - e; +var r4f6 = f - f; + +var r4g1 = E.a - a; //ok +var r4g2 = E.a - b; +var r4g3 = E.a - c; //ok +var r4g4 = E.a - d; +var r4g5 = E.a - e; +var r4g6 = E.a - f; + +var r4h1 = a - E.b; //ok +var r4h2 = b - E.b; +var r4h3 = c - E.b; //ok +var r4h4 = d - E.b; +var r4h5 = e - E.b; +var r4h6 = f - E.b; + +// operator << +var r5a1 = a << a; //ok +var r5a2 = a << b; +var r5a3 = a << c; //ok +var r5a4 = a << d; +var r5a5 = a << e; +var r5a6 = a << f; + +var r5b1 = b << a; +var r5b2 = b << b; +var r5b3 = b << c; +var r5b4 = b << d; +var r5b5 = b << e; +var r5b6 = b << f; + +var r5c1 = c << a; //ok +var r5c2 = c << b; +var r5c3 = c << c; //ok +var r5c4 = c << d; +var r5c5 = c << e; +var r5c6 = c << f; + +var r5d1 = d << a; +var r5d2 = d << b; +var r5d3 = d << c; +var r5d4 = d << d; +var r5d5 = d << e; +var r5d6 = d << f; + +var r5e1 = e << a; +var r5e2 = e << b; +var r5e3 = e << c; +var r5e4 = e << d; +var r5e5 = e << e; +var r5e6 = e << f; + +var r5f1 = f << a; +var r5f2 = f << b; +var r5f3 = f << c; +var r5f4 = f << d; +var r5f5 = f << e; +var r5f6 = f << f; + +var r5g1 = E.a << a; //ok +var r5g2 = E.a << b; +var r5g3 = E.a << c; //ok +var r5g4 = E.a << d; +var r5g5 = E.a << e; +var r5g6 = E.a << f; + +var r5h1 = a << E.b; //ok +var r5h2 = b << E.b; +var r5h3 = c << E.b; //ok +var r5h4 = d << E.b; +var r5h5 = e << E.b; +var r5h6 = f << E.b; + +// operator >> +var r6a1 = a >> a; //ok +var r6a2 = a >> b; +var r6a3 = a >> c; //ok +var r6a4 = a >> d; +var r6a5 = a >> e; +var r6a6 = a >> f; + +var r6b1 = b >> a; +var r6b2 = b >> b; +var r6b3 = b >> c; +var r6b4 = b >> d; +var r6b5 = b >> e; +var r6b6 = b >> f; + +var r6c1 = c >> a; //ok +var r6c2 = c >> b; +var r6c3 = c >> c; //ok +var r6c4 = c >> d; +var r6c5 = c >> e; +var r6c6 = c >> f; + +var r6d1 = d >> a; +var r6d2 = d >> b; +var r6d3 = d >> c; +var r6d4 = d >> d; +var r6d5 = d >> e; +var r6d6 = d >> f; + +var r6e1 = e >> a; +var r6e2 = e >> b; +var r6e3 = e >> c; +var r6e4 = e >> d; +var r6e5 = e >> e; +var r6e6 = e >> f; + +var r6f1 = f >> a; +var r6f2 = f >> b; +var r6f3 = f >> c; +var r6f4 = f >> d; +var r6f5 = f >> e; +var r6f6 = f >> f; + +var r6g1 = E.a >> a; //ok +var r6g2 = E.a >> b; +var r6g3 = E.a >> c; //ok +var r6g4 = E.a >> d; +var r6g5 = E.a >> e; +var r6g6 = E.a >> f; + +var r6h1 = a >> E.b; //ok +var r6h2 = b >> E.b; +var r6h3 = c >> E.b; //ok +var r6h4 = d >> E.b; +var r6h5 = e >> E.b; +var r6h6 = f >> E.b; + +// operator >>> +var r7a1 = a >>> a; //ok +var r7a2 = a >>> b; +var r7a3 = a >>> c; //ok +var r7a4 = a >>> d; +var r7a5 = a >>> e; +var r7a6 = a >>> f; + +var r7b1 = b >>> a; +var r7b2 = b >>> b; +var r7b3 = b >>> c; +var r7b4 = b >>> d; +var r7b5 = b >>> e; +var r7b6 = b >>> f; + +var r7c1 = c >>> a; //ok +var r7c2 = c >>> b; +var r7c3 = c >>> c; //ok +var r7c4 = c >>> d; +var r7c5 = c >>> e; +var r7c6 = c >>> f; + +var r7d1 = d >>> a; +var r7d2 = d >>> b; +var r7d3 = d >>> c; +var r7d4 = d >>> d; +var r7d5 = d >>> e; +var r7d6 = d >>> f; + +var r7e1 = e >>> a; +var r7e2 = e >>> b; +var r7e3 = e >>> c; +var r7e4 = e >>> d; +var r7e5 = e >>> e; +var r7e6 = e >>> f; + +var r7f1 = f >>> a; +var r7f2 = f >>> b; +var r7f3 = f >>> c; +var r7f4 = f >>> d; +var r7f5 = f >>> e; +var r7f6 = f >>> f; + +var r7g1 = E.a >>> a; //ok +var r7g2 = E.a >>> b; +var r7g3 = E.a >>> c; //ok +var r7g4 = E.a >>> d; +var r7g5 = E.a >>> e; +var r7g6 = E.a >>> f; + +var r7h1 = a >>> E.b; //ok +var r7h2 = b >>> E.b; +var r7h3 = c >>> E.b; //ok +var r7h4 = d >>> E.b; +var r7h5 = e >>> E.b; +var r7h6 = f >>> E.b; + +// operator & +var r8a1 = a & a; //ok +var r8a2 = a & b; +var r8a3 = a & c; //ok +var r8a4 = a & d; +var r8a5 = a & e; +var r8a6 = a & f; + +var r8b1 = b & a; +var r8b2 = b & b; +var r8b3 = b & c; +var r8b4 = b & d; +var r8b5 = b & e; +var r8b6 = b & f; + +var r8c1 = c & a; //ok +var r8c2 = c & b; +var r8c3 = c & c; //ok +var r8c4 = c & d; +var r8c5 = c & e; +var r8c6 = c & f; + +var r8d1 = d & a; +var r8d2 = d & b; +var r8d3 = d & c; +var r8d4 = d & d; +var r8d5 = d & e; +var r8d6 = d & f; + +var r8e1 = e & a; +var r8e2 = e & b; +var r8e3 = e & c; +var r8e4 = e & d; +var r8e5 = e & e; +var r8e6 = e & f; + +var r8f1 = f & a; +var r8f2 = f & b; +var r8f3 = f & c; +var r8f4 = f & d; +var r8f5 = f & e; +var r8f6 = f & f; + +var r8g1 = E.a & a; //ok +var r8g2 = E.a & b; +var r8g3 = E.a & c; //ok +var r8g4 = E.a & d; +var r8g5 = E.a & e; +var r8g6 = E.a & f; + +var r8h1 = a & E.b; //ok +var r8h2 = b & E.b; +var r8h3 = c & E.b; //ok +var r8h4 = d & E.b; +var r8h5 = e & E.b; +var r8h6 = f & E.b; + +// operator ^ +var r9a1 = a ^ a; //ok +var r9a2 = a ^ b; +var r9a3 = a ^ c; //ok +var r9a4 = a ^ d; +var r9a5 = a ^ e; +var r9a6 = a ^ f; + +var r9b1 = b ^ a; +var r9b2 = b ^ b; +var r9b3 = b ^ c; +var r9b4 = b ^ d; +var r9b5 = b ^ e; +var r9b6 = b ^ f; + +var r9c1 = c ^ a; //ok +var r9c2 = c ^ b; +var r9c3 = c ^ c; //ok +var r9c4 = c ^ d; +var r9c5 = c ^ e; +var r9c6 = c ^ f; + +var r9d1 = d ^ a; +var r9d2 = d ^ b; +var r9d3 = d ^ c; +var r9d4 = d ^ d; +var r9d5 = d ^ e; +var r9d6 = d ^ f; + +var r9e1 = e ^ a; +var r9e2 = e ^ b; +var r9e3 = e ^ c; +var r9e4 = e ^ d; +var r9e5 = e ^ e; +var r9e6 = e ^ f; + +var r9f1 = f ^ a; +var r9f2 = f ^ b; +var r9f3 = f ^ c; +var r9f4 = f ^ d; +var r9f5 = f ^ e; +var r9f6 = f ^ f; + +var r9g1 = E.a ^ a; //ok +var r9g2 = E.a ^ b; +var r9g3 = E.a ^ c; //ok +var r9g4 = E.a ^ d; +var r9g5 = E.a ^ e; +var r9g6 = E.a ^ f; + +var r9h1 = a ^ E.b; //ok +var r9h2 = b ^ E.b; +var r9h3 = c ^ E.b; //ok +var r9h4 = d ^ E.b; +var r9h5 = e ^ E.b; +var r9h6 = f ^ E.b; + +// operator | +var r10a1 = a | a; //ok +var r10a2 = a | b; +var r10a3 = a | c; //ok +var r10a4 = a | d; +var r10a5 = a | e; +var r10a6 = a | f; + +var r10b1 = b | a; +var r10b2 = b | b; +var r10b3 = b | c; +var r10b4 = b | d; +var r10b5 = b | e; +var r10b6 = b | f; + +var r10c1 = c | a; //ok +var r10c2 = c | b; +var r10c3 = c | c; //ok +var r10c4 = c | d; +var r10c5 = c | e; +var r10c6 = c | f; + +var r10d1 = d | a; +var r10d2 = d | b; +var r10d3 = d | c; +var r10d4 = d | d; +var r10d5 = d | e; +var r10d6 = d | f; + +var r10e1 = e | a; +var r10e2 = e | b; +var r10e3 = e | c; +var r10e4 = e | d; +var r10e5 = e | e; +var r10e6 = e | f; + +var r10f1 = f | a; +var r10f2 = f | b; +var r10f3 = f | c; +var r10f4 = f | d; +var r10f5 = f | e; +var r10f6 = f | f; + +var r10g1 = E.a | a; //ok +var r10g2 = E.a | b; +var r10g3 = E.a | c; //ok +var r10g4 = E.a | d; +var r10g5 = E.a | e; +var r10g6 = E.a | f; + +var r10h1 = a | E.b; //ok +var r10h2 = b | E.b; +var r10h3 = c | E.b; //ok +var r10h4 = d | E.b; +var r10h5 = e | E.b; +var r10h6 = f | E.b; + +//// [arithmeticOperatorWithInvalidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var f; +var r1a1 = a * a; +var r1a2 = a * b; +var r1a3 = a * c; +var r1a4 = a * d; +var r1a5 = a * e; +var r1a6 = a * f; +var r1b1 = b * a; +var r1b2 = b * b; +var r1b3 = b * c; +var r1b4 = b * d; +var r1b5 = b * e; +var r1b6 = b * f; +var r1c1 = c * a; +var r1c2 = c * b; +var r1c3 = c * c; +var r1c4 = c * d; +var r1c5 = c * e; +var r1c6 = c * f; +var r1d1 = d * a; +var r1d2 = d * b; +var r1d3 = d * c; +var r1d4 = d * d; +var r1d5 = d * e; +var r1d6 = d * f; +var r1e1 = e * a; +var r1e2 = e * b; +var r1e3 = e * c; +var r1e4 = e * d; +var r1e5 = e * e; +var r1e6 = e * f; +var r1f1 = f * a; +var r1f2 = f * b; +var r1f3 = f * c; +var r1f4 = f * d; +var r1f5 = f * e; +var r1f6 = f * f; +var r1g1 = 0 /* a */ * a; +var r1g2 = 0 /* a */ * b; +var r1g3 = 0 /* a */ * c; +var r1g4 = 0 /* a */ * d; +var r1g5 = 0 /* a */ * e; +var r1g6 = 0 /* a */ * f; +var r1h1 = a * 1 /* b */; +var r1h2 = b * 1 /* b */; +var r1h3 = c * 1 /* b */; +var r1h4 = d * 1 /* b */; +var r1h5 = e * 1 /* b */; +var r1h6 = f * 1 /* b */; +var r2a1 = a / a; +var r2a2 = a / b; +var r2a3 = a / c; +var r2a4 = a / d; +var r2a5 = a / e; +var r2a6 = a / f; +var r2b1 = b / a; +var r2b2 = b / b; +var r2b3 = b / c; +var r2b4 = b / d; +var r2b5 = b / e; +var r2b6 = b / f; +var r2c1 = c / a; +var r2c2 = c / b; +var r2c3 = c / c; +var r2c4 = c / d; +var r2c5 = c / e; +var r2c6 = c / f; +var r2d1 = d / a; +var r2d2 = d / b; +var r2d3 = d / c; +var r2d4 = d / d; +var r2d5 = d / e; +var r2d6 = d / f; +var r2e1 = e / a; +var r2e2 = e / b; +var r2e3 = e / c; +var r2e4 = e / d; +var r2e5 = e / e; +var r2e6 = e / f; +var r2f1 = f / a; +var r2f2 = f / b; +var r2f3 = f / c; +var r2f4 = f / d; +var r2f5 = f / e; +var r2f6 = f / f; +var r2g1 = 0 /* a */ / a; +var r2g2 = 0 /* a */ / b; +var r2g3 = 0 /* a */ / c; +var r2g4 = 0 /* a */ / d; +var r2g5 = 0 /* a */ / e; +var r2g6 = 0 /* a */ / f; +var r2h1 = a / 1 /* b */; +var r2h2 = b / 1 /* b */; +var r2h3 = c / 1 /* b */; +var r2h4 = d / 1 /* b */; +var r2h5 = e / 1 /* b */; +var r2h6 = f / 1 /* b */; +var r3a1 = a % a; +var r3a2 = a % b; +var r3a3 = a % c; +var r3a4 = a % d; +var r3a5 = a % e; +var r3a6 = a % f; +var r3b1 = b % a; +var r3b2 = b % b; +var r3b3 = b % c; +var r3b4 = b % d; +var r3b5 = b % e; +var r3b6 = b % f; +var r3c1 = c % a; +var r3c2 = c % b; +var r3c3 = c % c; +var r3c4 = c % d; +var r3c5 = c % e; +var r3c6 = c % f; +var r3d1 = d % a; +var r3d2 = d % b; +var r3d3 = d % c; +var r3d4 = d % d; +var r3d5 = d % e; +var r3d6 = d % f; +var r3e1 = e % a; +var r3e2 = e % b; +var r3e3 = e % c; +var r3e4 = e % d; +var r3e5 = e % e; +var r3e6 = e % f; +var r3f1 = f % a; +var r3f2 = f % b; +var r3f3 = f % c; +var r3f4 = f % d; +var r3f5 = f % e; +var r3f6 = f % f; +var r3g1 = 0 /* a */ % a; +var r3g2 = 0 /* a */ % b; +var r3g3 = 0 /* a */ % c; +var r3g4 = 0 /* a */ % d; +var r3g5 = 0 /* a */ % e; +var r3g6 = 0 /* a */ % f; +var r3h1 = a % 1 /* b */; +var r3h2 = b % 1 /* b */; +var r3h3 = c % 1 /* b */; +var r3h4 = d % 1 /* b */; +var r3h5 = e % 1 /* b */; +var r3h6 = f % 1 /* b */; +var r4a1 = a - a; +var r4a2 = a - b; +var r4a3 = a - c; +var r4a4 = a - d; +var r4a5 = a - e; +var r4a6 = a - f; +var r4b1 = b - a; +var r4b2 = b - b; +var r4b3 = b - c; +var r4b4 = b - d; +var r4b5 = b - e; +var r4b6 = b - f; +var r4c1 = c - a; +var r4c2 = c - b; +var r4c3 = c - c; +var r4c4 = c - d; +var r4c5 = c - e; +var r4c6 = c - f; +var r4d1 = d - a; +var r4d2 = d - b; +var r4d3 = d - c; +var r4d4 = d - d; +var r4d5 = d - e; +var r4d6 = d - f; +var r4e1 = e - a; +var r4e2 = e - b; +var r4e3 = e - c; +var r4e4 = e - d; +var r4e5 = e - e; +var r4e6 = e - f; +var r4f1 = f - a; +var r4f2 = f - b; +var r4f3 = f - c; +var r4f4 = f - d; +var r4f5 = f - e; +var r4f6 = f - f; +var r4g1 = 0 /* a */ - a; +var r4g2 = 0 /* a */ - b; +var r4g3 = 0 /* a */ - c; +var r4g4 = 0 /* a */ - d; +var r4g5 = 0 /* a */ - e; +var r4g6 = 0 /* a */ - f; +var r4h1 = a - 1 /* b */; +var r4h2 = b - 1 /* b */; +var r4h3 = c - 1 /* b */; +var r4h4 = d - 1 /* b */; +var r4h5 = e - 1 /* b */; +var r4h6 = f - 1 /* b */; +var r5a1 = a << a; +var r5a2 = a << b; +var r5a3 = a << c; +var r5a4 = a << d; +var r5a5 = a << e; +var r5a6 = a << f; +var r5b1 = b << a; +var r5b2 = b << b; +var r5b3 = b << c; +var r5b4 = b << d; +var r5b5 = b << e; +var r5b6 = b << f; +var r5c1 = c << a; +var r5c2 = c << b; +var r5c3 = c << c; +var r5c4 = c << d; +var r5c5 = c << e; +var r5c6 = c << f; +var r5d1 = d << a; +var r5d2 = d << b; +var r5d3 = d << c; +var r5d4 = d << d; +var r5d5 = d << e; +var r5d6 = d << f; +var r5e1 = e << a; +var r5e2 = e << b; +var r5e3 = e << c; +var r5e4 = e << d; +var r5e5 = e << e; +var r5e6 = e << f; +var r5f1 = f << a; +var r5f2 = f << b; +var r5f3 = f << c; +var r5f4 = f << d; +var r5f5 = f << e; +var r5f6 = f << f; +var r5g1 = 0 /* a */ << a; +var r5g2 = 0 /* a */ << b; +var r5g3 = 0 /* a */ << c; +var r5g4 = 0 /* a */ << d; +var r5g5 = 0 /* a */ << e; +var r5g6 = 0 /* a */ << f; +var r5h1 = a << 1 /* b */; +var r5h2 = b << 1 /* b */; +var r5h3 = c << 1 /* b */; +var r5h4 = d << 1 /* b */; +var r5h5 = e << 1 /* b */; +var r5h6 = f << 1 /* b */; +var r6a1 = a >> a; +var r6a2 = a >> b; +var r6a3 = a >> c; +var r6a4 = a >> d; +var r6a5 = a >> e; +var r6a6 = a >> f; +var r6b1 = b >> a; +var r6b2 = b >> b; +var r6b3 = b >> c; +var r6b4 = b >> d; +var r6b5 = b >> e; +var r6b6 = b >> f; +var r6c1 = c >> a; +var r6c2 = c >> b; +var r6c3 = c >> c; +var r6c4 = c >> d; +var r6c5 = c >> e; +var r6c6 = c >> f; +var r6d1 = d >> a; +var r6d2 = d >> b; +var r6d3 = d >> c; +var r6d4 = d >> d; +var r6d5 = d >> e; +var r6d6 = d >> f; +var r6e1 = e >> a; +var r6e2 = e >> b; +var r6e3 = e >> c; +var r6e4 = e >> d; +var r6e5 = e >> e; +var r6e6 = e >> f; +var r6f1 = f >> a; +var r6f2 = f >> b; +var r6f3 = f >> c; +var r6f4 = f >> d; +var r6f5 = f >> e; +var r6f6 = f >> f; +var r6g1 = 0 /* a */ >> a; +var r6g2 = 0 /* a */ >> b; +var r6g3 = 0 /* a */ >> c; +var r6g4 = 0 /* a */ >> d; +var r6g5 = 0 /* a */ >> e; +var r6g6 = 0 /* a */ >> f; +var r6h1 = a >> 1 /* b */; +var r6h2 = b >> 1 /* b */; +var r6h3 = c >> 1 /* b */; +var r6h4 = d >> 1 /* b */; +var r6h5 = e >> 1 /* b */; +var r6h6 = f >> 1 /* b */; +var r7a1 = a >>> a; +var r7a2 = a >>> b; +var r7a3 = a >>> c; +var r7a4 = a >>> d; +var r7a5 = a >>> e; +var r7a6 = a >>> f; +var r7b1 = b >>> a; +var r7b2 = b >>> b; +var r7b3 = b >>> c; +var r7b4 = b >>> d; +var r7b5 = b >>> e; +var r7b6 = b >>> f; +var r7c1 = c >>> a; +var r7c2 = c >>> b; +var r7c3 = c >>> c; +var r7c4 = c >>> d; +var r7c5 = c >>> e; +var r7c6 = c >>> f; +var r7d1 = d >>> a; +var r7d2 = d >>> b; +var r7d3 = d >>> c; +var r7d4 = d >>> d; +var r7d5 = d >>> e; +var r7d6 = d >>> f; +var r7e1 = e >>> a; +var r7e2 = e >>> b; +var r7e3 = e >>> c; +var r7e4 = e >>> d; +var r7e5 = e >>> e; +var r7e6 = e >>> f; +var r7f1 = f >>> a; +var r7f2 = f >>> b; +var r7f3 = f >>> c; +var r7f4 = f >>> d; +var r7f5 = f >>> e; +var r7f6 = f >>> f; +var r7g1 = 0 /* a */ >>> a; +var r7g2 = 0 /* a */ >>> b; +var r7g3 = 0 /* a */ >>> c; +var r7g4 = 0 /* a */ >>> d; +var r7g5 = 0 /* a */ >>> e; +var r7g6 = 0 /* a */ >>> f; +var r7h1 = a >>> 1 /* b */; +var r7h2 = b >>> 1 /* b */; +var r7h3 = c >>> 1 /* b */; +var r7h4 = d >>> 1 /* b */; +var r7h5 = e >>> 1 /* b */; +var r7h6 = f >>> 1 /* b */; +var r8a1 = a & a; +var r8a2 = a & b; +var r8a3 = a & c; +var r8a4 = a & d; +var r8a5 = a & e; +var r8a6 = a & f; +var r8b1 = b & a; +var r8b2 = b & b; +var r8b3 = b & c; +var r8b4 = b & d; +var r8b5 = b & e; +var r8b6 = b & f; +var r8c1 = c & a; +var r8c2 = c & b; +var r8c3 = c & c; +var r8c4 = c & d; +var r8c5 = c & e; +var r8c6 = c & f; +var r8d1 = d & a; +var r8d2 = d & b; +var r8d3 = d & c; +var r8d4 = d & d; +var r8d5 = d & e; +var r8d6 = d & f; +var r8e1 = e & a; +var r8e2 = e & b; +var r8e3 = e & c; +var r8e4 = e & d; +var r8e5 = e & e; +var r8e6 = e & f; +var r8f1 = f & a; +var r8f2 = f & b; +var r8f3 = f & c; +var r8f4 = f & d; +var r8f5 = f & e; +var r8f6 = f & f; +var r8g1 = 0 /* a */ & a; +var r8g2 = 0 /* a */ & b; +var r8g3 = 0 /* a */ & c; +var r8g4 = 0 /* a */ & d; +var r8g5 = 0 /* a */ & e; +var r8g6 = 0 /* a */ & f; +var r8h1 = a & 1 /* b */; +var r8h2 = b & 1 /* b */; +var r8h3 = c & 1 /* b */; +var r8h4 = d & 1 /* b */; +var r8h5 = e & 1 /* b */; +var r8h6 = f & 1 /* b */; +var r9a1 = a ^ a; +var r9a2 = a ^ b; +var r9a3 = a ^ c; +var r9a4 = a ^ d; +var r9a5 = a ^ e; +var r9a6 = a ^ f; +var r9b1 = b ^ a; +var r9b2 = b ^ b; +var r9b3 = b ^ c; +var r9b4 = b ^ d; +var r9b5 = b ^ e; +var r9b6 = b ^ f; +var r9c1 = c ^ a; +var r9c2 = c ^ b; +var r9c3 = c ^ c; +var r9c4 = c ^ d; +var r9c5 = c ^ e; +var r9c6 = c ^ f; +var r9d1 = d ^ a; +var r9d2 = d ^ b; +var r9d3 = d ^ c; +var r9d4 = d ^ d; +var r9d5 = d ^ e; +var r9d6 = d ^ f; +var r9e1 = e ^ a; +var r9e2 = e ^ b; +var r9e3 = e ^ c; +var r9e4 = e ^ d; +var r9e5 = e ^ e; +var r9e6 = e ^ f; +var r9f1 = f ^ a; +var r9f2 = f ^ b; +var r9f3 = f ^ c; +var r9f4 = f ^ d; +var r9f5 = f ^ e; +var r9f6 = f ^ f; +var r9g1 = 0 /* a */ ^ a; +var r9g2 = 0 /* a */ ^ b; +var r9g3 = 0 /* a */ ^ c; +var r9g4 = 0 /* a */ ^ d; +var r9g5 = 0 /* a */ ^ e; +var r9g6 = 0 /* a */ ^ f; +var r9h1 = a ^ 1 /* b */; +var r9h2 = b ^ 1 /* b */; +var r9h3 = c ^ 1 /* b */; +var r9h4 = d ^ 1 /* b */; +var r9h5 = e ^ 1 /* b */; +var r9h6 = f ^ 1 /* b */; +var r10a1 = a | a; +var r10a2 = a | b; +var r10a3 = a | c; +var r10a4 = a | d; +var r10a5 = a | e; +var r10a6 = a | f; +var r10b1 = b | a; +var r10b2 = b | b; +var r10b3 = b | c; +var r10b4 = b | d; +var r10b5 = b | e; +var r10b6 = b | f; +var r10c1 = c | a; +var r10c2 = c | b; +var r10c3 = c | c; +var r10c4 = c | d; +var r10c5 = c | e; +var r10c6 = c | f; +var r10d1 = d | a; +var r10d2 = d | b; +var r10d3 = d | c; +var r10d4 = d | d; +var r10d5 = d | e; +var r10d6 = d | f; +var r10e1 = e | a; +var r10e2 = e | b; +var r10e3 = e | c; +var r10e4 = e | d; +var r10e5 = e | e; +var r10e6 = e | f; +var r10f1 = f | a; +var r10f2 = f | b; +var r10f3 = f | c; +var r10f4 = f | d; +var r10f5 = f | e; +var r10f6 = f | f; +var r10g1 = 0 /* a */ | a; +var r10g2 = 0 /* a */ | b; +var r10g3 = 0 /* a */ | c; +var r10g4 = 0 /* a */ | d; +var r10g5 = 0 /* a */ | e; +var r10g6 = 0 /* a */ | f; +var r10h1 = a | 1 /* b */; +var r10h2 = b | 1 /* b */; +var r10h3 = c | 1 /* b */; +var r10h4 = d | 1 /* b */; +var r10h5 = e | 1 /* b */; +var r10h6 = f | 1 /* b */; diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt new file mode 100644 index 0000000000000..43c223bcd48d5 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.errors.txt @@ -0,0 +1,657 @@ +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts (240 errors) ==== + // If one operand is the null or undefined value, it is treated as having the type of the + // other operand. + + var a: boolean; + var b: string; + var c: Object; + + // operator * + var r1a1 = null * a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a2 = null * b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = null * c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = a * null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b * null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = c * null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = null * true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c2 = null * ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = null * {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = true * null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = '' * null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = {} * null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator / + var r2a1 = null / a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a2 = null / b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a3 = null / c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2b1 = a / null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b2 = b / null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b3 = c / null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2c1 = null / true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c2 = null / ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c3 = null / {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2d1 = true / null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d2 = '' / null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d3 = {} / null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator % + var r3a1 = null % a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a2 = null % b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a3 = null % c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3b1 = a % null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b2 = b % null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b3 = c % null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3c1 = null % true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c2 = null % ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c3 = null % {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3d1 = true % null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d2 = '' % null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d3 = {} % null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator - + var r4a1 = null - a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a2 = null - b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a3 = null - c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4b1 = a - null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b2 = b - null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b3 = c - null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4c1 = null - true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c2 = null - ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c3 = null - {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4d1 = true - null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d2 = '' - null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d3 = {} - null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator << + var r5a1 = null << a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a2 = null << b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a3 = null << c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5b1 = a << null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b2 = b << null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b3 = c << null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5c1 = null << true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c2 = null << ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c3 = null << {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5d1 = true << null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d2 = '' << null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d3 = {} << null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >> + var r6a1 = null >> a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a2 = null >> b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a3 = null >> c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6b1 = a >> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b2 = b >> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b3 = c >> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6c1 = null >> true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c2 = null >> ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c3 = null >> {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6d1 = true >> null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d2 = '' >> null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d3 = {} >> null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >>> + var r7a1 = null >>> a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a2 = null >>> b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a3 = null >>> c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7b1 = a >>> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b2 = b >>> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b3 = c >>> null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7c1 = null >>> true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c2 = null >>> ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c3 = null >>> {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7d1 = true >>> null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d2 = '' >>> null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d3 = {} >>> null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator & + var r8a1 = null & a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a2 = null & b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a3 = null & c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8b1 = a & null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b2 = b & null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b3 = c & null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8c1 = null & true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c2 = null & ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c3 = null & {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8d1 = true & null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d2 = '' & null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d3 = {} & null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator ^ + var r9a1 = null ^ a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a2 = null ^ b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a3 = null ^ c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9b1 = a ^ null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b2 = b ^ null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b3 = c ^ null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9c1 = null ^ true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c2 = null ^ ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c3 = null ^ {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9d1 = true ^ null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d2 = '' ^ null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d3 = {} ^ null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator | + var r10a1 = null | a; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a2 = null | b; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a3 = null | c; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10b1 = a | null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b2 = b | null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b3 = c | null; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10c1 = null | true; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c2 = null | ''; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c3 = null | {}; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10d1 = true | null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d2 = '' | null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d3 = {} | null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js new file mode 100644 index 0000000000000..99849fbb81862 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js @@ -0,0 +1,302 @@ +//// [arithmeticOperatorWithNullValueAndInvalidOperands.ts] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator * +var r1a1 = null * a; +var r1a2 = null * b; +var r1a3 = null * c; + +var r1b1 = a * null; +var r1b2 = b * null; +var r1b3 = c * null; + +var r1c1 = null * true; +var r1c2 = null * ''; +var r1c3 = null * {}; + +var r1d1 = true * null; +var r1d2 = '' * null; +var r1d3 = {} * null; + +// operator / +var r2a1 = null / a; +var r2a2 = null / b; +var r2a3 = null / c; + +var r2b1 = a / null; +var r2b2 = b / null; +var r2b3 = c / null; + +var r2c1 = null / true; +var r2c2 = null / ''; +var r2c3 = null / {}; + +var r2d1 = true / null; +var r2d2 = '' / null; +var r2d3 = {} / null; + +// operator % +var r3a1 = null % a; +var r3a2 = null % b; +var r3a3 = null % c; + +var r3b1 = a % null; +var r3b2 = b % null; +var r3b3 = c % null; + +var r3c1 = null % true; +var r3c2 = null % ''; +var r3c3 = null % {}; + +var r3d1 = true % null; +var r3d2 = '' % null; +var r3d3 = {} % null; + +// operator - +var r4a1 = null - a; +var r4a2 = null - b; +var r4a3 = null - c; + +var r4b1 = a - null; +var r4b2 = b - null; +var r4b3 = c - null; + +var r4c1 = null - true; +var r4c2 = null - ''; +var r4c3 = null - {}; + +var r4d1 = true - null; +var r4d2 = '' - null; +var r4d3 = {} - null; + +// operator << +var r5a1 = null << a; +var r5a2 = null << b; +var r5a3 = null << c; + +var r5b1 = a << null; +var r5b2 = b << null; +var r5b3 = c << null; + +var r5c1 = null << true; +var r5c2 = null << ''; +var r5c3 = null << {}; + +var r5d1 = true << null; +var r5d2 = '' << null; +var r5d3 = {} << null; + +// operator >> +var r6a1 = null >> a; +var r6a2 = null >> b; +var r6a3 = null >> c; + +var r6b1 = a >> null; +var r6b2 = b >> null; +var r6b3 = c >> null; + +var r6c1 = null >> true; +var r6c2 = null >> ''; +var r6c3 = null >> {}; + +var r6d1 = true >> null; +var r6d2 = '' >> null; +var r6d3 = {} >> null; + +// operator >>> +var r7a1 = null >>> a; +var r7a2 = null >>> b; +var r7a3 = null >>> c; + +var r7b1 = a >>> null; +var r7b2 = b >>> null; +var r7b3 = c >>> null; + +var r7c1 = null >>> true; +var r7c2 = null >>> ''; +var r7c3 = null >>> {}; + +var r7d1 = true >>> null; +var r7d2 = '' >>> null; +var r7d3 = {} >>> null; + +// operator & +var r8a1 = null & a; +var r8a2 = null & b; +var r8a3 = null & c; + +var r8b1 = a & null; +var r8b2 = b & null; +var r8b3 = c & null; + +var r8c1 = null & true; +var r8c2 = null & ''; +var r8c3 = null & {}; + +var r8d1 = true & null; +var r8d2 = '' & null; +var r8d3 = {} & null; + +// operator ^ +var r9a1 = null ^ a; +var r9a2 = null ^ b; +var r9a3 = null ^ c; + +var r9b1 = a ^ null; +var r9b2 = b ^ null; +var r9b3 = c ^ null; + +var r9c1 = null ^ true; +var r9c2 = null ^ ''; +var r9c3 = null ^ {}; + +var r9d1 = true ^ null; +var r9d2 = '' ^ null; +var r9d3 = {} ^ null; + +// operator | +var r10a1 = null | a; +var r10a2 = null | b; +var r10a3 = null | c; + +var r10b1 = a | null; +var r10b2 = b | null; +var r10b3 = c | null; + +var r10c1 = null | true; +var r10c2 = null | ''; +var r10c3 = null | {}; + +var r10d1 = true | null; +var r10d2 = '' | null; +var r10d3 = {} | null; + +//// [arithmeticOperatorWithNullValueAndInvalidOperands.js] +var a; +var b; +var c; +var r1a1 = null * a; +var r1a2 = null * b; +var r1a3 = null * c; +var r1b1 = a * null; +var r1b2 = b * null; +var r1b3 = c * null; +var r1c1 = null * true; +var r1c2 = null * ''; +var r1c3 = null * {}; +var r1d1 = true * null; +var r1d2 = '' * null; +var r1d3 = {} * null; +var r2a1 = null / a; +var r2a2 = null / b; +var r2a3 = null / c; +var r2b1 = a / null; +var r2b2 = b / null; +var r2b3 = c / null; +var r2c1 = null / true; +var r2c2 = null / ''; +var r2c3 = null / {}; +var r2d1 = true / null; +var r2d2 = '' / null; +var r2d3 = {} / null; +var r3a1 = null % a; +var r3a2 = null % b; +var r3a3 = null % c; +var r3b1 = a % null; +var r3b2 = b % null; +var r3b3 = c % null; +var r3c1 = null % true; +var r3c2 = null % ''; +var r3c3 = null % {}; +var r3d1 = true % null; +var r3d2 = '' % null; +var r3d3 = {} % null; +var r4a1 = null - a; +var r4a2 = null - b; +var r4a3 = null - c; +var r4b1 = a - null; +var r4b2 = b - null; +var r4b3 = c - null; +var r4c1 = null - true; +var r4c2 = null - ''; +var r4c3 = null - {}; +var r4d1 = true - null; +var r4d2 = '' - null; +var r4d3 = {} - null; +var r5a1 = null << a; +var r5a2 = null << b; +var r5a3 = null << c; +var r5b1 = a << null; +var r5b2 = b << null; +var r5b3 = c << null; +var r5c1 = null << true; +var r5c2 = null << ''; +var r5c3 = null << {}; +var r5d1 = true << null; +var r5d2 = '' << null; +var r5d3 = {} << null; +var r6a1 = null >> a; +var r6a2 = null >> b; +var r6a3 = null >> c; +var r6b1 = a >> null; +var r6b2 = b >> null; +var r6b3 = c >> null; +var r6c1 = null >> true; +var r6c2 = null >> ''; +var r6c3 = null >> {}; +var r6d1 = true >> null; +var r6d2 = '' >> null; +var r6d3 = {} >> null; +var r7a1 = null >>> a; +var r7a2 = null >>> b; +var r7a3 = null >>> c; +var r7b1 = a >>> null; +var r7b2 = b >>> null; +var r7b3 = c >>> null; +var r7c1 = null >>> true; +var r7c2 = null >>> ''; +var r7c3 = null >>> {}; +var r7d1 = true >>> null; +var r7d2 = '' >>> null; +var r7d3 = {} >>> null; +var r8a1 = null & a; +var r8a2 = null & b; +var r8a3 = null & c; +var r8b1 = a & null; +var r8b2 = b & null; +var r8b3 = c & null; +var r8c1 = null & true; +var r8c2 = null & ''; +var r8c3 = null & {}; +var r8d1 = true & null; +var r8d2 = '' & null; +var r8d3 = {} & null; +var r9a1 = null ^ a; +var r9a2 = null ^ b; +var r9a3 = null ^ c; +var r9b1 = a ^ null; +var r9b2 = b ^ null; +var r9b3 = c ^ null; +var r9c1 = null ^ true; +var r9c2 = null ^ ''; +var r9c3 = null ^ {}; +var r9d1 = true ^ null; +var r9d2 = '' ^ null; +var r9d3 = {} ^ null; +var r10a1 = null | a; +var r10a2 = null | b; +var r10a3 = null | c; +var r10b1 = a | null; +var r10b2 = b | null; +var r10b3 = c | null; +var r10c1 = null | true; +var r10c2 = null | ''; +var r10c3 = null | {}; +var r10d1 = true | null; +var r10d2 = '' | null; +var r10d3 = {} | null; diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js new file mode 100644 index 0000000000000..1775564bfa282 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js @@ -0,0 +1,200 @@ +//// [arithmeticOperatorWithNullValueAndValidOperands.ts] +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator * +var ra1 = null * a; +var ra2 = null * b; +var ra3 = null * 1; +var ra4 = null * E.a; +var ra5 = a * null; +var ra6 = b * null; +var ra7 = 0 * null; +var ra8 = E.b * null; + +// operator / +var rb1 = null / a; +var rb2 = null / b; +var rb3 = null / 1; +var rb4 = null / E.a; +var rb5 = a / null; +var rb6 = b / null; +var rb7 = 0 / null; +var rb8 = E.b / null; + +// operator % +var rc1 = null % a; +var rc2 = null % b; +var rc3 = null % 1; +var rc4 = null % E.a; +var rc5 = a % null; +var rc6 = b % null; +var rc7 = 0 % null; +var rc8 = E.b % null; + +// operator - +var rd1 = null - a; +var rd2 = null - b; +var rd3 = null - 1; +var rd4 = null - E.a; +var rd5 = a - null; +var rd6 = b - null; +var rd7 = 0 - null; +var rd8 = E.b - null; + +// operator << +var re1 = null << a; +var re2 = null << b; +var re3 = null << 1; +var re4 = null << E.a; +var re5 = a << null; +var re6 = b << null; +var re7 = 0 << null; +var re8 = E.b << null; + +// operator >> +var rf1 = null >> a; +var rf2 = null >> b; +var rf3 = null >> 1; +var rf4 = null >> E.a; +var rf5 = a >> null; +var rf6 = b >> null; +var rf7 = 0 >> null; +var rf8 = E.b >> null; + +// operator >>> +var rg1 = null >>> a; +var rg2 = null >>> b; +var rg3 = null >>> 1; +var rg4 = null >>> E.a; +var rg5 = a >>> null; +var rg6 = b >>> null; +var rg7 = 0 >>> null; +var rg8 = E.b >>> null; + +// operator & +var rh1 = null & a; +var rh2 = null & b; +var rh3 = null & 1; +var rh4 = null & E.a; +var rh5 = a & null; +var rh6 = b & null; +var rh7 = 0 & null; +var rh8 = E.b & null; + +// operator ^ +var ri1 = null ^ a; +var ri2 = null ^ b; +var ri3 = null ^ 1; +var ri4 = null ^ E.a; +var ri5 = a ^ null; +var ri6 = b ^ null; +var ri7 = 0 ^ null; +var ri8 = E.b ^ null; + +// operator | +var rj1 = null | a; +var rj2 = null | b; +var rj3 = null | 1; +var rj4 = null | E.a; +var rj5 = a | null; +var rj6 = b | null; +var rj7 = 0 | null; +var rj8 = E.b | null; + +//// [arithmeticOperatorWithNullValueAndValidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var ra1 = null * a; +var ra2 = null * b; +var ra3 = null * 1; +var ra4 = null * 0 /* a */; +var ra5 = a * null; +var ra6 = b * null; +var ra7 = 0 * null; +var ra8 = 1 /* b */ * null; +var rb1 = null / a; +var rb2 = null / b; +var rb3 = null / 1; +var rb4 = null / 0 /* a */; +var rb5 = a / null; +var rb6 = b / null; +var rb7 = 0 / null; +var rb8 = 1 /* b */ / null; +var rc1 = null % a; +var rc2 = null % b; +var rc3 = null % 1; +var rc4 = null % 0 /* a */; +var rc5 = a % null; +var rc6 = b % null; +var rc7 = 0 % null; +var rc8 = 1 /* b */ % null; +var rd1 = null - a; +var rd2 = null - b; +var rd3 = null - 1; +var rd4 = null - 0 /* a */; +var rd5 = a - null; +var rd6 = b - null; +var rd7 = 0 - null; +var rd8 = 1 /* b */ - null; +var re1 = null << a; +var re2 = null << b; +var re3 = null << 1; +var re4 = null << 0 /* a */; +var re5 = a << null; +var re6 = b << null; +var re7 = 0 << null; +var re8 = 1 /* b */ << null; +var rf1 = null >> a; +var rf2 = null >> b; +var rf3 = null >> 1; +var rf4 = null >> 0 /* a */; +var rf5 = a >> null; +var rf6 = b >> null; +var rf7 = 0 >> null; +var rf8 = 1 /* b */ >> null; +var rg1 = null >>> a; +var rg2 = null >>> b; +var rg3 = null >>> 1; +var rg4 = null >>> 0 /* a */; +var rg5 = a >>> null; +var rg6 = b >>> null; +var rg7 = 0 >>> null; +var rg8 = 1 /* b */ >>> null; +var rh1 = null & a; +var rh2 = null & b; +var rh3 = null & 1; +var rh4 = null & 0 /* a */; +var rh5 = a & null; +var rh6 = b & null; +var rh7 = 0 & null; +var rh8 = 1 /* b */ & null; +var ri1 = null ^ a; +var ri2 = null ^ b; +var ri3 = null ^ 1; +var ri4 = null ^ 0 /* a */; +var ri5 = a ^ null; +var ri6 = b ^ null; +var ri7 = 0 ^ null; +var ri8 = 1 /* b */ ^ null; +var rj1 = null | a; +var rj2 = null | b; +var rj3 = null | 1; +var rj4 = null | 0 /* a */; +var rj5 = a | null; +var rj6 = b | null; +var rj7 = 0 | null; +var rj8 = 1 /* b */ | null; diff --git a/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt new file mode 100644 index 0000000000000..dd63c076c7112 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -0,0 +1,220 @@ +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts (80 errors) ==== + // operator * + var ra1 = null * null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ra2 = null * undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ra3 = undefined * null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ra4 = undefined * undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator / + var rb1 = null / null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rb2 = null / undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rb3 = undefined / null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rb4 = undefined / undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator % + var rc1 = null % null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rc2 = null % undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rc3 = undefined % null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rc4 = undefined % undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator - + var rd1 = null - null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rd2 = null - undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rd3 = undefined - null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rd4 = undefined - undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator << + var re1 = null << null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var re2 = null << undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var re3 = undefined << null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var re4 = undefined << undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >> + var rf1 = null >> null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rf2 = null >> undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rf3 = undefined >> null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rf4 = undefined >> undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >>> + var rg1 = null >>> null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rg2 = null >>> undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rg3 = undefined >>> null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rg4 = undefined >>> undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator & + var rh1 = null & null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rh2 = null & undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rh3 = undefined & null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rh4 = undefined & undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator ^ + var ri1 = null ^ null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ri2 = null ^ undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ri3 = undefined ^ null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var ri4 = undefined ^ undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator | + var rj1 = null | null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rj2 = null | undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rj3 = undefined | null; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var rj4 = undefined | undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js new file mode 100644 index 0000000000000..d0dbdead8c892 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js @@ -0,0 +1,102 @@ +//// [arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts] +// operator * +var ra1 = null * null; +var ra2 = null * undefined; +var ra3 = undefined * null; +var ra4 = undefined * undefined; + +// operator / +var rb1 = null / null; +var rb2 = null / undefined; +var rb3 = undefined / null; +var rb4 = undefined / undefined; + +// operator % +var rc1 = null % null; +var rc2 = null % undefined; +var rc3 = undefined % null; +var rc4 = undefined % undefined; + +// operator - +var rd1 = null - null; +var rd2 = null - undefined; +var rd3 = undefined - null; +var rd4 = undefined - undefined; + +// operator << +var re1 = null << null; +var re2 = null << undefined; +var re3 = undefined << null; +var re4 = undefined << undefined; + +// operator >> +var rf1 = null >> null; +var rf2 = null >> undefined; +var rf3 = undefined >> null; +var rf4 = undefined >> undefined; + +// operator >>> +var rg1 = null >>> null; +var rg2 = null >>> undefined; +var rg3 = undefined >>> null; +var rg4 = undefined >>> undefined; + +// operator & +var rh1 = null & null; +var rh2 = null & undefined; +var rh3 = undefined & null; +var rh4 = undefined & undefined; + +// operator ^ +var ri1 = null ^ null; +var ri2 = null ^ undefined; +var ri3 = undefined ^ null; +var ri4 = undefined ^ undefined; + +// operator | +var rj1 = null | null; +var rj2 = null | undefined; +var rj3 = undefined | null; +var rj4 = undefined | undefined; + +//// [arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js] +var ra1 = null * null; +var ra2 = null * undefined; +var ra3 = undefined * null; +var ra4 = undefined * undefined; +var rb1 = null / null; +var rb2 = null / undefined; +var rb3 = undefined / null; +var rb4 = undefined / undefined; +var rc1 = null % null; +var rc2 = null % undefined; +var rc3 = undefined % null; +var rc4 = undefined % undefined; +var rd1 = null - null; +var rd2 = null - undefined; +var rd3 = undefined - null; +var rd4 = undefined - undefined; +var re1 = null << null; +var re2 = null << undefined; +var re3 = undefined << null; +var re4 = undefined << undefined; +var rf1 = null >> null; +var rf2 = null >> undefined; +var rf3 = undefined >> null; +var rf4 = undefined >> undefined; +var rg1 = null >>> null; +var rg2 = null >>> undefined; +var rg3 = undefined >>> null; +var rg4 = undefined >>> undefined; +var rh1 = null & null; +var rh2 = null & undefined; +var rh3 = undefined & null; +var rh4 = undefined & undefined; +var ri1 = null ^ null; +var ri2 = null ^ undefined; +var ri3 = undefined ^ null; +var ri4 = undefined ^ undefined; +var rj1 = null | null; +var rj2 = null | undefined; +var rj3 = undefined | null; +var rj4 = undefined | undefined; diff --git a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt new file mode 100644 index 0000000000000..afc7a7ee392d1 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.errors.txt @@ -0,0 +1,490 @@ +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithTypeParameter.ts (180 errors) ==== + // type parameter type is not valid for arithmetic operand + function foo(t: T) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: {}; + + var r1a1 = a * t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a2 = a / t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = a % t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a4 = a - t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a5 = a << t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a6 = a >> t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a7 = a >>> t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a8 = a & t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a9 = a ^ t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a10 = a | t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2a1 = t * a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a2 = t / a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a3 = t % a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a4 = t - a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a5 = t << a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a6 = t >> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a7 = t >>> a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a8 = t & a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a9 = t ^ a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a10 = t | a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = b * t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b / t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = b % t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b4 = b - t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b5 = b << t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b6 = b >> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b7 = b >>> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b8 = b & t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b9 = b ^ t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b10 = b | t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2b1 = t * b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b2 = t / b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b3 = t % b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b4 = t - b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b5 = t << b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b6 = t >> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b7 = t >>> b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b8 = t & b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b9 = t ^ b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b10 = t | b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = c * t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c2 = c / t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = c % t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c4 = c - t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c5 = c << t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c6 = c >> t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c7 = c >>> t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c8 = c & t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c9 = c ^ t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c10 = c | t; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2c1 = t * c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c2 = t / c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c3 = t % c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c4 = t - c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c5 = t << c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c6 = t >> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c7 = t >>> c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c8 = t & c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c9 = t ^ c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c10 = t | c; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = d * t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = d / t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = d % t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d4 = d - t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d5 = d << t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d6 = d >> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d7 = d >>> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d8 = d & t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d9 = d ^ t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d10 = d | t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2d1 = t * d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d2 = t / d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d3 = t % d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d4 = t - d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d5 = t << d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d6 = t >> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d7 = t >>> d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d8 = t & d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d9 = t ^ d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d10 = t | d; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1e1 = e * t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e2 = e / t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e3 = e % t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e4 = e - t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e5 = e << t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e6 = e >> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e7 = e >>> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e8 = e & t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e9 = e ^ t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1e10 = e | t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2e1 = t * e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e2 = t / e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e3 = t % e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e4 = t - e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e5 = t << e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e6 = t >> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e7 = t >>> e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e8 = t & e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e9 = t ^ e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2e10 = t | e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1f1 = t * t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f2 = t / t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f3 = t % t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f4 = t - t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f5 = t << t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f6 = t >> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f7 = t >>> t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f8 = t & t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f9 = t ^ t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1f10 = t | t; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + } \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js new file mode 100644 index 0000000000000..e3b823373d7a8 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js @@ -0,0 +1,249 @@ +//// [arithmeticOperatorWithTypeParameter.ts] +// type parameter type is not valid for arithmetic operand +function foo(t: T) { + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: {}; + + var r1a1 = a * t; + var r1a2 = a / t; + var r1a3 = a % t; + var r1a4 = a - t; + var r1a5 = a << t; + var r1a6 = a >> t; + var r1a7 = a >>> t; + var r1a8 = a & t; + var r1a9 = a ^ t; + var r1a10 = a | t; + + var r2a1 = t * a; + var r2a2 = t / a; + var r2a3 = t % a; + var r2a4 = t - a; + var r2a5 = t << a; + var r2a6 = t >> a; + var r2a7 = t >>> a; + var r2a8 = t & a; + var r2a9 = t ^ a; + var r2a10 = t | a; + + var r1b1 = b * t; + var r1b2 = b / t; + var r1b3 = b % t; + var r1b4 = b - t; + var r1b5 = b << t; + var r1b6 = b >> t; + var r1b7 = b >>> t; + var r1b8 = b & t; + var r1b9 = b ^ t; + var r1b10 = b | t; + + var r2b1 = t * b; + var r2b2 = t / b; + var r2b3 = t % b; + var r2b4 = t - b; + var r2b5 = t << b; + var r2b6 = t >> b; + var r2b7 = t >>> b; + var r2b8 = t & b; + var r2b9 = t ^ b; + var r2b10 = t | b; + + var r1c1 = c * t; + var r1c2 = c / t; + var r1c3 = c % t; + var r1c4 = c - t; + var r1c5 = c << t; + var r1c6 = c >> t; + var r1c7 = c >>> t; + var r1c8 = c & t; + var r1c9 = c ^ t; + var r1c10 = c | t; + + var r2c1 = t * c; + var r2c2 = t / c; + var r2c3 = t % c; + var r2c4 = t - c; + var r2c5 = t << c; + var r2c6 = t >> c; + var r2c7 = t >>> c; + var r2c8 = t & c; + var r2c9 = t ^ c; + var r2c10 = t | c; + + var r1d1 = d * t; + var r1d2 = d / t; + var r1d3 = d % t; + var r1d4 = d - t; + var r1d5 = d << t; + var r1d6 = d >> t; + var r1d7 = d >>> t; + var r1d8 = d & t; + var r1d9 = d ^ t; + var r1d10 = d | t; + + var r2d1 = t * d; + var r2d2 = t / d; + var r2d3 = t % d; + var r2d4 = t - d; + var r2d5 = t << d; + var r2d6 = t >> d; + var r2d7 = t >>> d; + var r2d8 = t & d; + var r2d9 = t ^ d; + var r2d10 = t | d; + + var r1e1 = e * t; + var r1e2 = e / t; + var r1e3 = e % t; + var r1e4 = e - t; + var r1e5 = e << t; + var r1e6 = e >> t; + var r1e7 = e >>> t; + var r1e8 = e & t; + var r1e9 = e ^ t; + var r1e10 = e | t; + + var r2e1 = t * e; + var r2e2 = t / e; + var r2e3 = t % e; + var r2e4 = t - e; + var r2e5 = t << e; + var r2e6 = t >> e; + var r2e7 = t >>> e; + var r2e8 = t & e; + var r2e9 = t ^ e; + var r2e10 = t | e; + + var r1f1 = t * t; + var r1f2 = t / t; + var r1f3 = t % t; + var r1f4 = t - t; + var r1f5 = t << t; + var r1f6 = t >> t; + var r1f7 = t >>> t; + var r1f8 = t & t; + var r1f9 = t ^ t; + var r1f10 = t | t; +} + +//// [arithmeticOperatorWithTypeParameter.js] +function foo(t) { + var a; + var b; + var c; + var d; + var e; + var r1a1 = a * t; + var r1a2 = a / t; + var r1a3 = a % t; + var r1a4 = a - t; + var r1a5 = a << t; + var r1a6 = a >> t; + var r1a7 = a >>> t; + var r1a8 = a & t; + var r1a9 = a ^ t; + var r1a10 = a | t; + var r2a1 = t * a; + var r2a2 = t / a; + var r2a3 = t % a; + var r2a4 = t - a; + var r2a5 = t << a; + var r2a6 = t >> a; + var r2a7 = t >>> a; + var r2a8 = t & a; + var r2a9 = t ^ a; + var r2a10 = t | a; + var r1b1 = b * t; + var r1b2 = b / t; + var r1b3 = b % t; + var r1b4 = b - t; + var r1b5 = b << t; + var r1b6 = b >> t; + var r1b7 = b >>> t; + var r1b8 = b & t; + var r1b9 = b ^ t; + var r1b10 = b | t; + var r2b1 = t * b; + var r2b2 = t / b; + var r2b3 = t % b; + var r2b4 = t - b; + var r2b5 = t << b; + var r2b6 = t >> b; + var r2b7 = t >>> b; + var r2b8 = t & b; + var r2b9 = t ^ b; + var r2b10 = t | b; + var r1c1 = c * t; + var r1c2 = c / t; + var r1c3 = c % t; + var r1c4 = c - t; + var r1c5 = c << t; + var r1c6 = c >> t; + var r1c7 = c >>> t; + var r1c8 = c & t; + var r1c9 = c ^ t; + var r1c10 = c | t; + var r2c1 = t * c; + var r2c2 = t / c; + var r2c3 = t % c; + var r2c4 = t - c; + var r2c5 = t << c; + var r2c6 = t >> c; + var r2c7 = t >>> c; + var r2c8 = t & c; + var r2c9 = t ^ c; + var r2c10 = t | c; + var r1d1 = d * t; + var r1d2 = d / t; + var r1d3 = d % t; + var r1d4 = d - t; + var r1d5 = d << t; + var r1d6 = d >> t; + var r1d7 = d >>> t; + var r1d8 = d & t; + var r1d9 = d ^ t; + var r1d10 = d | t; + var r2d1 = t * d; + var r2d2 = t / d; + var r2d3 = t % d; + var r2d4 = t - d; + var r2d5 = t << d; + var r2d6 = t >> d; + var r2d7 = t >>> d; + var r2d8 = t & d; + var r2d9 = t ^ d; + var r2d10 = t | d; + var r1e1 = e * t; + var r1e2 = e / t; + var r1e3 = e % t; + var r1e4 = e - t; + var r1e5 = e << t; + var r1e6 = e >> t; + var r1e7 = e >>> t; + var r1e8 = e & t; + var r1e9 = e ^ t; + var r1e10 = e | t; + var r2e1 = t * e; + var r2e2 = t / e; + var r2e3 = t % e; + var r2e4 = t - e; + var r2e5 = t << e; + var r2e6 = t >> e; + var r2e7 = t >>> e; + var r2e8 = t & e; + var r2e9 = t ^ e; + var r2e10 = t | e; + var r1f1 = t * t; + var r1f2 = t / t; + var r1f3 = t % t; + var r1f4 = t - t; + var r1f5 = t << t; + var r1f6 = t >> t; + var r1f7 = t >>> t; + var r1f8 = t & t; + var r1f9 = t ^ t; + var r1f10 = t | t; +} diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt new file mode 100644 index 0000000000000..9552e5400d4e6 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -0,0 +1,657 @@ +==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts (240 errors) ==== + // If one operand is the undefined or undefined value, it is treated as having the type of the + // other operand. + + var a: boolean; + var b: string; + var c: Object; + + // operator * + var r1a1 = undefined * a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a2 = undefined * b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1a3 = undefined * c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1b1 = a * undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b2 = b * undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1b3 = c * undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1c1 = undefined * true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c2 = undefined * ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1c3 = undefined * {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r1d1 = true * undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d2 = '' * undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r1d3 = {} * undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator / + var r2a1 = undefined / a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a2 = undefined / b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2a3 = undefined / c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2b1 = a / undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b2 = b / undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2b3 = c / undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2c1 = undefined / true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c2 = undefined / ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2c3 = undefined / {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r2d1 = true / undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d2 = '' / undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r2d3 = {} / undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator % + var r3a1 = undefined % a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a2 = undefined % b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3a3 = undefined % c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3b1 = a % undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b2 = b % undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3b3 = c % undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3c1 = undefined % true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c2 = undefined % ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3c3 = undefined % {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r3d1 = true % undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d2 = '' % undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r3d3 = {} % undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator - + var r4a1 = undefined - a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a2 = undefined - b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4a3 = undefined - c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4b1 = a - undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b2 = b - undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4b3 = c - undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4c1 = undefined - true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c2 = undefined - ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4c3 = undefined - {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r4d1 = true - undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d2 = '' - undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r4d3 = {} - undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator << + var r5a1 = undefined << a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a2 = undefined << b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5a3 = undefined << c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5b1 = a << undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b2 = b << undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5b3 = c << undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5c1 = undefined << true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c2 = undefined << ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5c3 = undefined << {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r5d1 = true << undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d2 = '' << undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r5d3 = {} << undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >> + var r6a1 = undefined >> a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a2 = undefined >> b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6a3 = undefined >> c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6b1 = a >> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b2 = b >> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6b3 = c >> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6c1 = undefined >> true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c2 = undefined >> ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6c3 = undefined >> {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r6d1 = true >> undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d2 = '' >> undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r6d3 = {} >> undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator >>> + var r7a1 = undefined >>> a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a2 = undefined >>> b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7a3 = undefined >>> c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7b1 = a >>> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b2 = b >>> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7b3 = c >>> undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7c1 = undefined >>> true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c2 = undefined >>> ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7c3 = undefined >>> {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r7d1 = true >>> undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d2 = '' >>> undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r7d3 = {} >>> undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator & + var r8a1 = undefined & a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a2 = undefined & b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8a3 = undefined & c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8b1 = a & undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b2 = b & undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8b3 = c & undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8c1 = undefined & true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c2 = undefined & ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8c3 = undefined & {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r8d1 = true & undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d2 = '' & undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r8d3 = {} & undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator ^ + var r9a1 = undefined ^ a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a2 = undefined ^ b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9a3 = undefined ^ c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9b1 = a ^ undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b2 = b ^ undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9b3 = c ^ undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9c1 = undefined ^ true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c2 = undefined ^ ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9c3 = undefined ^ {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r9d1 = true ^ undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d2 = '' ^ undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r9d3 = {} ^ undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // operator | + var r10a1 = undefined | a; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a2 = undefined | b; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10a3 = undefined | c; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10b1 = a | undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b2 = b | undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10b3 = c | undefined; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10c1 = undefined | true; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c2 = undefined | ''; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10c3 = undefined | {}; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var r10d1 = true | undefined; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d2 = '' | undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var r10d3 = {} | undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js new file mode 100644 index 0000000000000..4b79d44f1f06b --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js @@ -0,0 +1,302 @@ +//// [arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +var a: boolean; +var b: string; +var c: Object; + +// operator * +var r1a1 = undefined * a; +var r1a2 = undefined * b; +var r1a3 = undefined * c; + +var r1b1 = a * undefined; +var r1b2 = b * undefined; +var r1b3 = c * undefined; + +var r1c1 = undefined * true; +var r1c2 = undefined * ''; +var r1c3 = undefined * {}; + +var r1d1 = true * undefined; +var r1d2 = '' * undefined; +var r1d3 = {} * undefined; + +// operator / +var r2a1 = undefined / a; +var r2a2 = undefined / b; +var r2a3 = undefined / c; + +var r2b1 = a / undefined; +var r2b2 = b / undefined; +var r2b3 = c / undefined; + +var r2c1 = undefined / true; +var r2c2 = undefined / ''; +var r2c3 = undefined / {}; + +var r2d1 = true / undefined; +var r2d2 = '' / undefined; +var r2d3 = {} / undefined; + +// operator % +var r3a1 = undefined % a; +var r3a2 = undefined % b; +var r3a3 = undefined % c; + +var r3b1 = a % undefined; +var r3b2 = b % undefined; +var r3b3 = c % undefined; + +var r3c1 = undefined % true; +var r3c2 = undefined % ''; +var r3c3 = undefined % {}; + +var r3d1 = true % undefined; +var r3d2 = '' % undefined; +var r3d3 = {} % undefined; + +// operator - +var r4a1 = undefined - a; +var r4a2 = undefined - b; +var r4a3 = undefined - c; + +var r4b1 = a - undefined; +var r4b2 = b - undefined; +var r4b3 = c - undefined; + +var r4c1 = undefined - true; +var r4c2 = undefined - ''; +var r4c3 = undefined - {}; + +var r4d1 = true - undefined; +var r4d2 = '' - undefined; +var r4d3 = {} - undefined; + +// operator << +var r5a1 = undefined << a; +var r5a2 = undefined << b; +var r5a3 = undefined << c; + +var r5b1 = a << undefined; +var r5b2 = b << undefined; +var r5b3 = c << undefined; + +var r5c1 = undefined << true; +var r5c2 = undefined << ''; +var r5c3 = undefined << {}; + +var r5d1 = true << undefined; +var r5d2 = '' << undefined; +var r5d3 = {} << undefined; + +// operator >> +var r6a1 = undefined >> a; +var r6a2 = undefined >> b; +var r6a3 = undefined >> c; + +var r6b1 = a >> undefined; +var r6b2 = b >> undefined; +var r6b3 = c >> undefined; + +var r6c1 = undefined >> true; +var r6c2 = undefined >> ''; +var r6c3 = undefined >> {}; + +var r6d1 = true >> undefined; +var r6d2 = '' >> undefined; +var r6d3 = {} >> undefined; + +// operator >>> +var r7a1 = undefined >>> a; +var r7a2 = undefined >>> b; +var r7a3 = undefined >>> c; + +var r7b1 = a >>> undefined; +var r7b2 = b >>> undefined; +var r7b3 = c >>> undefined; + +var r7c1 = undefined >>> true; +var r7c2 = undefined >>> ''; +var r7c3 = undefined >>> {}; + +var r7d1 = true >>> undefined; +var r7d2 = '' >>> undefined; +var r7d3 = {} >>> undefined; + +// operator & +var r8a1 = undefined & a; +var r8a2 = undefined & b; +var r8a3 = undefined & c; + +var r8b1 = a & undefined; +var r8b2 = b & undefined; +var r8b3 = c & undefined; + +var r8c1 = undefined & true; +var r8c2 = undefined & ''; +var r8c3 = undefined & {}; + +var r8d1 = true & undefined; +var r8d2 = '' & undefined; +var r8d3 = {} & undefined; + +// operator ^ +var r9a1 = undefined ^ a; +var r9a2 = undefined ^ b; +var r9a3 = undefined ^ c; + +var r9b1 = a ^ undefined; +var r9b2 = b ^ undefined; +var r9b3 = c ^ undefined; + +var r9c1 = undefined ^ true; +var r9c2 = undefined ^ ''; +var r9c3 = undefined ^ {}; + +var r9d1 = true ^ undefined; +var r9d2 = '' ^ undefined; +var r9d3 = {} ^ undefined; + +// operator | +var r10a1 = undefined | a; +var r10a2 = undefined | b; +var r10a3 = undefined | c; + +var r10b1 = a | undefined; +var r10b2 = b | undefined; +var r10b3 = c | undefined; + +var r10c1 = undefined | true; +var r10c2 = undefined | ''; +var r10c3 = undefined | {}; + +var r10d1 = true | undefined; +var r10d2 = '' | undefined; +var r10d3 = {} | undefined; + +//// [arithmeticOperatorWithUndefinedValueAndInvalidOperands.js] +var a; +var b; +var c; +var r1a1 = undefined * a; +var r1a2 = undefined * b; +var r1a3 = undefined * c; +var r1b1 = a * undefined; +var r1b2 = b * undefined; +var r1b3 = c * undefined; +var r1c1 = undefined * true; +var r1c2 = undefined * ''; +var r1c3 = undefined * {}; +var r1d1 = true * undefined; +var r1d2 = '' * undefined; +var r1d3 = {} * undefined; +var r2a1 = undefined / a; +var r2a2 = undefined / b; +var r2a3 = undefined / c; +var r2b1 = a / undefined; +var r2b2 = b / undefined; +var r2b3 = c / undefined; +var r2c1 = undefined / true; +var r2c2 = undefined / ''; +var r2c3 = undefined / {}; +var r2d1 = true / undefined; +var r2d2 = '' / undefined; +var r2d3 = {} / undefined; +var r3a1 = undefined % a; +var r3a2 = undefined % b; +var r3a3 = undefined % c; +var r3b1 = a % undefined; +var r3b2 = b % undefined; +var r3b3 = c % undefined; +var r3c1 = undefined % true; +var r3c2 = undefined % ''; +var r3c3 = undefined % {}; +var r3d1 = true % undefined; +var r3d2 = '' % undefined; +var r3d3 = {} % undefined; +var r4a1 = undefined - a; +var r4a2 = undefined - b; +var r4a3 = undefined - c; +var r4b1 = a - undefined; +var r4b2 = b - undefined; +var r4b3 = c - undefined; +var r4c1 = undefined - true; +var r4c2 = undefined - ''; +var r4c3 = undefined - {}; +var r4d1 = true - undefined; +var r4d2 = '' - undefined; +var r4d3 = {} - undefined; +var r5a1 = undefined << a; +var r5a2 = undefined << b; +var r5a3 = undefined << c; +var r5b1 = a << undefined; +var r5b2 = b << undefined; +var r5b3 = c << undefined; +var r5c1 = undefined << true; +var r5c2 = undefined << ''; +var r5c3 = undefined << {}; +var r5d1 = true << undefined; +var r5d2 = '' << undefined; +var r5d3 = {} << undefined; +var r6a1 = undefined >> a; +var r6a2 = undefined >> b; +var r6a3 = undefined >> c; +var r6b1 = a >> undefined; +var r6b2 = b >> undefined; +var r6b3 = c >> undefined; +var r6c1 = undefined >> true; +var r6c2 = undefined >> ''; +var r6c3 = undefined >> {}; +var r6d1 = true >> undefined; +var r6d2 = '' >> undefined; +var r6d3 = {} >> undefined; +var r7a1 = undefined >>> a; +var r7a2 = undefined >>> b; +var r7a3 = undefined >>> c; +var r7b1 = a >>> undefined; +var r7b2 = b >>> undefined; +var r7b3 = c >>> undefined; +var r7c1 = undefined >>> true; +var r7c2 = undefined >>> ''; +var r7c3 = undefined >>> {}; +var r7d1 = true >>> undefined; +var r7d2 = '' >>> undefined; +var r7d3 = {} >>> undefined; +var r8a1 = undefined & a; +var r8a2 = undefined & b; +var r8a3 = undefined & c; +var r8b1 = a & undefined; +var r8b2 = b & undefined; +var r8b3 = c & undefined; +var r8c1 = undefined & true; +var r8c2 = undefined & ''; +var r8c3 = undefined & {}; +var r8d1 = true & undefined; +var r8d2 = '' & undefined; +var r8d3 = {} & undefined; +var r9a1 = undefined ^ a; +var r9a2 = undefined ^ b; +var r9a3 = undefined ^ c; +var r9b1 = a ^ undefined; +var r9b2 = b ^ undefined; +var r9b3 = c ^ undefined; +var r9c1 = undefined ^ true; +var r9c2 = undefined ^ ''; +var r9c3 = undefined ^ {}; +var r9d1 = true ^ undefined; +var r9d2 = '' ^ undefined; +var r9d3 = {} ^ undefined; +var r10a1 = undefined | a; +var r10a2 = undefined | b; +var r10a3 = undefined | c; +var r10b1 = a | undefined; +var r10b2 = b | undefined; +var r10b3 = c | undefined; +var r10c1 = undefined | true; +var r10c2 = undefined | ''; +var r10c3 = undefined | {}; +var r10d1 = true | undefined; +var r10d2 = '' | undefined; +var r10d3 = {} | undefined; diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js new file mode 100644 index 0000000000000..41a0900d64adf --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js @@ -0,0 +1,200 @@ +//// [arithmeticOperatorWithUndefinedValueAndValidOperands.ts] +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { + a, + b +} + +var a: any; +var b: number; + +// operator * +var ra1 = undefined * a; +var ra2 = undefined * b; +var ra3 = undefined * 1; +var ra4 = undefined * E.a; +var ra5 = a * undefined; +var ra6 = b * undefined; +var ra7 = 0 * undefined; +var ra8 = E.b * undefined; + +// operator / +var rb1 = undefined / a; +var rb2 = undefined / b; +var rb3 = undefined / 1; +var rb4 = undefined / E.a; +var rb5 = a / undefined; +var rb6 = b / undefined; +var rb7 = 0 / undefined; +var rb8 = E.b / undefined; + +// operator % +var rc1 = undefined % a; +var rc2 = undefined % b; +var rc3 = undefined % 1; +var rc4 = undefined % E.a; +var rc5 = a % undefined; +var rc6 = b % undefined; +var rc7 = 0 % undefined; +var rc8 = E.b % undefined; + +// operator - +var rd1 = undefined - a; +var rd2 = undefined - b; +var rd3 = undefined - 1; +var rd4 = undefined - E.a; +var rd5 = a - undefined; +var rd6 = b - undefined; +var rd7 = 0 - undefined; +var rd8 = E.b - undefined; + +// operator << +var re1 = undefined << a; +var re2 = undefined << b; +var re3 = undefined << 1; +var re4 = undefined << E.a; +var re5 = a << undefined; +var re6 = b << undefined; +var re7 = 0 << undefined; +var re8 = E.b << undefined; + +// operator >> +var rf1 = undefined >> a; +var rf2 = undefined >> b; +var rf3 = undefined >> 1; +var rf4 = undefined >> E.a; +var rf5 = a >> undefined; +var rf6 = b >> undefined; +var rf7 = 0 >> undefined; +var rf8 = E.b >> undefined; + +// operator >>> +var rg1 = undefined >>> a; +var rg2 = undefined >>> b; +var rg3 = undefined >>> 1; +var rg4 = undefined >>> E.a; +var rg5 = a >>> undefined; +var rg6 = b >>> undefined; +var rg7 = 0 >>> undefined; +var rg8 = E.b >>> undefined; + +// operator & +var rh1 = undefined & a; +var rh2 = undefined & b; +var rh3 = undefined & 1; +var rh4 = undefined & E.a; +var rh5 = a & undefined; +var rh6 = b & undefined; +var rh7 = 0 & undefined; +var rh8 = E.b & undefined; + +// operator ^ +var ri1 = undefined ^ a; +var ri2 = undefined ^ b; +var ri3 = undefined ^ 1; +var ri4 = undefined ^ E.a; +var ri5 = a ^ undefined; +var ri6 = b ^ undefined; +var ri7 = 0 ^ undefined; +var ri8 = E.b ^ undefined; + +// operator | +var rj1 = undefined | a; +var rj2 = undefined | b; +var rj3 = undefined | 1; +var rj4 = undefined | E.a; +var rj5 = a | undefined; +var rj6 = b | undefined; +var rj7 = 0 | undefined; +var rj8 = E.b | undefined; + +//// [arithmeticOperatorWithUndefinedValueAndValidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var ra1 = undefined * a; +var ra2 = undefined * b; +var ra3 = undefined * 1; +var ra4 = undefined * 0 /* a */; +var ra5 = a * undefined; +var ra6 = b * undefined; +var ra7 = 0 * undefined; +var ra8 = 1 /* b */ * undefined; +var rb1 = undefined / a; +var rb2 = undefined / b; +var rb3 = undefined / 1; +var rb4 = undefined / 0 /* a */; +var rb5 = a / undefined; +var rb6 = b / undefined; +var rb7 = 0 / undefined; +var rb8 = 1 /* b */ / undefined; +var rc1 = undefined % a; +var rc2 = undefined % b; +var rc3 = undefined % 1; +var rc4 = undefined % 0 /* a */; +var rc5 = a % undefined; +var rc6 = b % undefined; +var rc7 = 0 % undefined; +var rc8 = 1 /* b */ % undefined; +var rd1 = undefined - a; +var rd2 = undefined - b; +var rd3 = undefined - 1; +var rd4 = undefined - 0 /* a */; +var rd5 = a - undefined; +var rd6 = b - undefined; +var rd7 = 0 - undefined; +var rd8 = 1 /* b */ - undefined; +var re1 = undefined << a; +var re2 = undefined << b; +var re3 = undefined << 1; +var re4 = undefined << 0 /* a */; +var re5 = a << undefined; +var re6 = b << undefined; +var re7 = 0 << undefined; +var re8 = 1 /* b */ << undefined; +var rf1 = undefined >> a; +var rf2 = undefined >> b; +var rf3 = undefined >> 1; +var rf4 = undefined >> 0 /* a */; +var rf5 = a >> undefined; +var rf6 = b >> undefined; +var rf7 = 0 >> undefined; +var rf8 = 1 /* b */ >> undefined; +var rg1 = undefined >>> a; +var rg2 = undefined >>> b; +var rg3 = undefined >>> 1; +var rg4 = undefined >>> 0 /* a */; +var rg5 = a >>> undefined; +var rg6 = b >>> undefined; +var rg7 = 0 >>> undefined; +var rg8 = 1 /* b */ >>> undefined; +var rh1 = undefined & a; +var rh2 = undefined & b; +var rh3 = undefined & 1; +var rh4 = undefined & 0 /* a */; +var rh5 = a & undefined; +var rh6 = b & undefined; +var rh7 = 0 & undefined; +var rh8 = 1 /* b */ & undefined; +var ri1 = undefined ^ a; +var ri2 = undefined ^ b; +var ri3 = undefined ^ 1; +var ri4 = undefined ^ 0 /* a */; +var ri5 = a ^ undefined; +var ri6 = b ^ undefined; +var ri7 = 0 ^ undefined; +var ri8 = 1 /* b */ ^ undefined; +var rj1 = undefined | a; +var rj2 = undefined | b; +var rj3 = undefined | 1; +var rj4 = undefined | 0 /* a */; +var rj5 = a | undefined; +var rj6 = b | undefined; +var rj7 = 0 | undefined; +var rj8 = 1 /* b */ | undefined; diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt new file mode 100644 index 0000000000000..db84365bb3edd --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -0,0 +1,152 @@ +==== tests/cases/compiler/arrayAssignmentTest1.ts (19 errors) ==== + interface I1 { + IM1():void[]; + } + + class C1 implements I1 { + IM1():void[] {return null;} + C1M1():C1[] {return null;} + } + class C2 extends C1 { + C2M1():C2[] { return null;} + } + + class C3 { + CM3M1() { return 3;} + } + + + /* + + This behaves unexpectedly with the following types: + + Type 1 of any[]: + + * Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + + * Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + + */ + var a1 : any = null; + var c1 : C1 = new C1(); + var i1 : I1 = c1; + var c2 : C2 = new C2(); + var c3 : C3 = new C3(); + var o1 = {one : 1}; + var f1 = function () { return new C1();} + + var arr_any: any[] = []; + var arr_i1: I1[] = []; + var arr_c1: C1[] = []; + var arr_c2: C2[] = []; + var arr_i1_2: I1[] = []; + var arr_c1_2: C1[] = []; + var arr_c2_2: C2[] = []; + var arr_c3: C3[] = []; + + var i1_error: I1 = []; // should be an error - is + ~~~~~~~~~~~~~~~~~ +!!! Type 'undefined[]' is not assignable to type 'I1': +!!! Property 'IM1' is missing in type 'undefined[]'. + var c1_error: C1 = []; // should be an error - is + ~~~~~~~~~~~~~~~~~ +!!! Type 'undefined[]' is not assignable to type 'C1': +!!! Property 'IM1' is missing in type 'undefined[]'. + var c2_error: C2 = []; // should be an error - is + ~~~~~~~~~~~~~~~~~ +!!! Type 'undefined[]' is not assignable to type 'C2': +!!! Property 'C2M1' is missing in type 'undefined[]'. + var c3_error: C3 = []; // should be an error - is + ~~~~~~~~~~~~~~~~~ +!!! Type 'undefined[]' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'undefined[]'. + + + arr_any = arr_i1; // should be ok - is + arr_any = arr_c1; // should be ok - is + arr_any = arr_c2; // should be ok - is + arr_any = arr_c3; // should be ok - is + + arr_i1 = arr_i1; // should be ok - subtype relationship - is + arr_i1 = arr_c1; // should be ok - subtype relationship - is + arr_i1 = arr_c2; // should be ok - subtype relationship - is + arr_i1 = arr_c3; // should be an error - is + ~~~~~~ +!!! Type 'C3[]' is not assignable to type 'I1[]': +!!! Type 'C3' is not assignable to type 'I1': +!!! Property 'IM1' is missing in type 'C3'. + + arr_c1 = arr_c1; // should be ok - subtype relationship - is + arr_c1 = arr_c2; // should be ok - subtype relationship - is + arr_c1 = arr_i1; // should be an error - is + ~~~~~~ +!!! Type 'I1[]' is not assignable to type 'C1[]': +!!! Type 'I1' is not assignable to type 'C1': +!!! Property 'C1M1' is missing in type 'I1'. + arr_c1 = arr_c3; // should be an error - is + ~~~~~~ +!!! Type 'C3[]' is not assignable to type 'C1[]': +!!! Type 'C3' is not assignable to type 'C1': +!!! Property 'IM1' is missing in type 'C3'. + + arr_c2 = arr_c2; // should be ok - subtype relationship - is + arr_c2 = arr_c1; // should be an error - subtype relationship - is + ~~~~~~ +!!! Type 'C1[]' is not assignable to type 'C2[]': +!!! Type 'C1' is not assignable to type 'C2': +!!! Property 'C2M1' is missing in type 'C1'. + arr_c2 = arr_i1; // should be an error - subtype relationship - is + ~~~~~~ +!!! Type 'I1[]' is not assignable to type 'C2[]': +!!! Type 'I1' is not assignable to type 'C2': +!!! Property 'C2M1' is missing in type 'I1'. + arr_c2 = arr_c3; // should be an error - is + ~~~~~~ +!!! Type 'C3[]' is not assignable to type 'C2[]': +!!! Type 'C3' is not assignable to type 'C2': +!!! Property 'C2M1' is missing in type 'C3'. + + // "clean up bug" occurs at this point + // if you move these three expressions to another file, they raise an error + // something to do with state from the above propagating forward? + arr_c3 = arr_c2_2; // should be an error - is + ~~~~~~ +!!! Type 'C2[]' is not assignable to type 'C3[]': +!!! Type 'C2' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'C2'. + arr_c3 = arr_c1_2; // should be an error - is + ~~~~~~ +!!! Type 'C1[]' is not assignable to type 'C3[]': +!!! Type 'C1' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'C1'. + arr_c3 = arr_i1_2; // should be an error - is + ~~~~~~ +!!! Type 'I1[]' is not assignable to type 'C3[]': +!!! Type 'I1' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'I1'. + + arr_any = f1; // should be an error - is + ~~~~~~~ +!!! Type '() => C1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '() => C1'. + arr_any = o1; // should be an error - is + ~~~~~~~ +!!! Type '{ one: number; }' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '{ one: number; }'. + arr_any = a1; // should be ok - is + arr_any = c1; // should be an error - is + ~~~~~~~ +!!! Type 'C1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C1'. + arr_any = c2; // should be an error - is + ~~~~~~~ +!!! Type 'C2' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C2'. + arr_any = c3; // should be an error - is + ~~~~~~~ +!!! Type 'C3' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C3'. + arr_any = i1; // should be an error - is + ~~~~~~~ +!!! Type 'I1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js new file mode 100644 index 0000000000000..18550d61d5c1f --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -0,0 +1,170 @@ +//// [arrayAssignmentTest1.ts] +interface I1 { + IM1():void[]; +} + +class C1 implements I1 { + IM1():void[] {return null;} + C1M1():C1[] {return null;} + } +class C2 extends C1 { + C2M1():C2[] { return null;} +} + +class C3 { + CM3M1() { return 3;} +} + + +/* + +This behaves unexpectedly with the following types: + +Type 1 of any[]: + +* Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + +* Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + +*/ +var a1 : any = null; +var c1 : C1 = new C1(); +var i1 : I1 = c1; +var c2 : C2 = new C2(); +var c3 : C3 = new C3(); +var o1 = {one : 1}; +var f1 = function () { return new C1();} + +var arr_any: any[] = []; +var arr_i1: I1[] = []; +var arr_c1: C1[] = []; +var arr_c2: C2[] = []; +var arr_i1_2: I1[] = []; +var arr_c1_2: C1[] = []; +var arr_c2_2: C2[] = []; +var arr_c3: C3[] = []; + +var i1_error: I1 = []; // should be an error - is +var c1_error: C1 = []; // should be an error - is +var c2_error: C2 = []; // should be an error - is +var c3_error: C3 = []; // should be an error - is + + +arr_any = arr_i1; // should be ok - is +arr_any = arr_c1; // should be ok - is +arr_any = arr_c2; // should be ok - is +arr_any = arr_c3; // should be ok - is + +arr_i1 = arr_i1; // should be ok - subtype relationship - is +arr_i1 = arr_c1; // should be ok - subtype relationship - is +arr_i1 = arr_c2; // should be ok - subtype relationship - is +arr_i1 = arr_c3; // should be an error - is + +arr_c1 = arr_c1; // should be ok - subtype relationship - is +arr_c1 = arr_c2; // should be ok - subtype relationship - is +arr_c1 = arr_i1; // should be an error - is +arr_c1 = arr_c3; // should be an error - is + +arr_c2 = arr_c2; // should be ok - subtype relationship - is +arr_c2 = arr_c1; // should be an error - subtype relationship - is +arr_c2 = arr_i1; // should be an error - subtype relationship - is +arr_c2 = arr_c3; // should be an error - is + +// "clean up bug" occurs at this point +// if you move these three expressions to another file, they raise an error +// something to do with state from the above propagating forward? +arr_c3 = arr_c2_2; // should be an error - is +arr_c3 = arr_c1_2; // should be an error - is +arr_c3 = arr_i1_2; // should be an error - is + +arr_any = f1; // should be an error - is +arr_any = o1; // should be an error - is +arr_any = a1; // should be ok - is +arr_any = c1; // should be an error - is +arr_any = c2; // should be an error - is +arr_any = c3; // should be an error - is +arr_any = i1; // should be an error - is + +//// [arrayAssignmentTest1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + C1.prototype.IM1 = function () { + return null; + }; + C1.prototype.C1M1 = function () { + return null; + }; + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + C2.prototype.C2M1 = function () { + return null; + }; + return C2; +})(C1); +var C3 = (function () { + function C3() { + } + C3.prototype.CM3M1 = function () { + return 3; + }; + return C3; +})(); +var a1 = null; +var c1 = new C1(); +var i1 = c1; +var c2 = new C2(); +var c3 = new C3(); +var o1 = { one: 1 }; +var f1 = function () { + return new C1(); +}; +var arr_any = []; +var arr_i1 = []; +var arr_c1 = []; +var arr_c2 = []; +var arr_i1_2 = []; +var arr_c1_2 = []; +var arr_c2_2 = []; +var arr_c3 = []; +var i1_error = []; +var c1_error = []; +var c2_error = []; +var c3_error = []; +arr_any = arr_i1; +arr_any = arr_c1; +arr_any = arr_c2; +arr_any = arr_c3; +arr_i1 = arr_i1; +arr_i1 = arr_c1; +arr_i1 = arr_c2; +arr_i1 = arr_c3; +arr_c1 = arr_c1; +arr_c1 = arr_c2; +arr_c1 = arr_i1; +arr_c1 = arr_c3; +arr_c2 = arr_c2; +arr_c2 = arr_c1; +arr_c2 = arr_i1; +arr_c2 = arr_c3; +arr_c3 = arr_c2_2; +arr_c3 = arr_c1_2; +arr_c3 = arr_i1_2; +arr_any = f1; +arr_any = o1; +arr_any = a1; +arr_any = c1; +arr_any = c2; +arr_any = c3; +arr_any = i1; diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt new file mode 100644 index 0000000000000..fd3988ca4d86f --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -0,0 +1,93 @@ +==== tests/cases/compiler/arrayAssignmentTest2.ts (10 errors) ==== + interface I1 { + IM1():void[]; + } + + class C1 implements I1 { + IM1():void[] {return null;} + C1M1():C1[] {return null;} + } + class C2 extends C1 { + C2M1():C2[] { return null;} + } + + class C3 { + CM3M1() { return 3;} + } + + + /* + + This behaves unexpectedly with the following types: + + Type 1 of any[]: + + * Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + + * Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + + */ + var a1 : any = null; + var c1 : C1 = new C1(); + var i1 : I1 = c1; + var c2 : C2 = new C2(); + var c3 : C3 = new C3(); + var o1 = {one : 1}; + var f1 = function () { return new C1();} + + var arr_any: any[] = []; + var arr_i1: I1[] = []; + var arr_c1: C1[] = []; + var arr_c2: C2[] = []; + var arr_i1_2: I1[] = []; + var arr_c1_2: C1[] = []; + var arr_c2_2: C2[] = []; + var arr_c3: C3[] = []; + + // "clean up error" occurs at this point + arr_c3 = arr_c2_2; // should be an error - is + ~~~~~~ +!!! Type 'C2[]' is not assignable to type 'C3[]': +!!! Type 'C2' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'C2'. + arr_c3 = arr_c1_2; // should be an error - is + ~~~~~~ +!!! Type 'C1[]' is not assignable to type 'C3[]': +!!! Type 'C1' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'C1'. + arr_c3 = arr_i1_2; // should be an error - is + ~~~~~~ +!!! Type 'I1[]' is not assignable to type 'C3[]': +!!! Type 'I1' is not assignable to type 'C3': +!!! Property 'CM3M1' is missing in type 'I1'. + + arr_any = f1; // should be an error - is + ~~~~~~~ +!!! Type '() => C1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '() => C1'. + arr_any = function () { return null;} // should be an error - is + ~~~~~~~ +!!! Type '() => any' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '() => any'. + arr_any = o1; // should be an error - is + ~~~~~~~ +!!! Type '{ one: number; }' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '{ one: number; }'. + arr_any = a1; // should be ok - is + arr_any = c1; // should be an error - is + ~~~~~~~ +!!! Type 'C1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C1'. + arr_any = c2; // should be an error - is + ~~~~~~~ +!!! Type 'C2' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C2'. + arr_any = c3; // should be an error - is + ~~~~~~~ +!!! Type 'C3' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C3'. + arr_any = i1; // should be an error - is + ~~~~~~~ +!!! Type 'I1' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'I1'. + \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js new file mode 100644 index 0000000000000..85d65f0ef6a2d --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -0,0 +1,127 @@ +//// [arrayAssignmentTest2.ts] +interface I1 { + IM1():void[]; +} + +class C1 implements I1 { + IM1():void[] {return null;} + C1M1():C1[] {return null;} + } +class C2 extends C1 { + C2M1():C2[] { return null;} +} + +class C3 { + CM3M1() { return 3;} +} + + +/* + +This behaves unexpectedly with the following types: + +Type 1 of any[]: + +* Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + +* Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + +*/ +var a1 : any = null; +var c1 : C1 = new C1(); +var i1 : I1 = c1; +var c2 : C2 = new C2(); +var c3 : C3 = new C3(); +var o1 = {one : 1}; +var f1 = function () { return new C1();} + +var arr_any: any[] = []; +var arr_i1: I1[] = []; +var arr_c1: C1[] = []; +var arr_c2: C2[] = []; +var arr_i1_2: I1[] = []; +var arr_c1_2: C1[] = []; +var arr_c2_2: C2[] = []; +var arr_c3: C3[] = []; + +// "clean up error" occurs at this point +arr_c3 = arr_c2_2; // should be an error - is +arr_c3 = arr_c1_2; // should be an error - is +arr_c3 = arr_i1_2; // should be an error - is + +arr_any = f1; // should be an error - is +arr_any = function () { return null;} // should be an error - is +arr_any = o1; // should be an error - is +arr_any = a1; // should be ok - is +arr_any = c1; // should be an error - is +arr_any = c2; // should be an error - is +arr_any = c3; // should be an error - is +arr_any = i1; // should be an error - is + + +//// [arrayAssignmentTest2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + C1.prototype.IM1 = function () { + return null; + }; + C1.prototype.C1M1 = function () { + return null; + }; + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + C2.prototype.C2M1 = function () { + return null; + }; + return C2; +})(C1); +var C3 = (function () { + function C3() { + } + C3.prototype.CM3M1 = function () { + return 3; + }; + return C3; +})(); +var a1 = null; +var c1 = new C1(); +var i1 = c1; +var c2 = new C2(); +var c3 = new C3(); +var o1 = { one: 1 }; +var f1 = function () { + return new C1(); +}; +var arr_any = []; +var arr_i1 = []; +var arr_c1 = []; +var arr_c2 = []; +var arr_i1_2 = []; +var arr_c1_2 = []; +var arr_c2_2 = []; +var arr_c3 = []; +arr_c3 = arr_c2_2; +arr_c3 = arr_c1_2; +arr_c3 = arr_i1_2; +arr_any = f1; +arr_any = function () { + return null; +}; +arr_any = o1; +arr_any = a1; +arr_any = c1; +arr_any = c2; +arr_any = c3; +arr_any = i1; diff --git a/tests/baselines/reference/arrayAssignmentTest3.errors.txt b/tests/baselines/reference/arrayAssignmentTest3.errors.txt new file mode 100644 index 0000000000000..df36c5d69d831 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest3.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/arrayAssignmentTest3.ts (1 errors) ==== + // The following gives no error + // Michal saw no error if he used number instead of B, + // but I do... + class B {} + + class a { + constructor(public x: string, public y: number, z: B[]) { } + } + + + + var xx = new a(null, 7, new B()); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest3.js b/tests/baselines/reference/arrayAssignmentTest3.js new file mode 100644 index 0000000000000..714e73c8b3d89 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest3.js @@ -0,0 +1,30 @@ +//// [arrayAssignmentTest3.ts] +// The following gives no error +// Michal saw no error if he used number instead of B, +// but I do... +class B {} + +class a { + constructor(public x: string, public y: number, z: B[]) { } +} + + + +var xx = new a(null, 7, new B()); + + + +//// [arrayAssignmentTest3.js] +var B = (function () { + function B() { + } + return B; +})(); +var a = (function () { + function a(x, y, z) { + this.x = x; + this.y = y; + } + return a; +})(); +var xx = new a(null, 7, new B()); diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt new file mode 100644 index 0000000000000..ef56c1b528f5a --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/arrayAssignmentTest4.ts (2 errors) ==== + + + class C3 { + CM3M1() { return 3;} + } + + + /* + + This behaves unexpectedly with teh following types: + + Type 1 of any[]: + + * Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + + * Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + + */ + var c3 : C3 = new C3(); + var o1 = {one : 1}; + + var arr_any: any[] = []; + + arr_any = function () { return null;} // should be an error - is + ~~~~~~~ +!!! Type '() => any' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type '() => any'. + arr_any = c3; // should be an error - is + ~~~~~~~ +!!! Type 'C3' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'C3'. + \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.js b/tests/baselines/reference/arrayAssignmentTest4.js new file mode 100644 index 0000000000000..db40934368b85 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest4.js @@ -0,0 +1,44 @@ +//// [arrayAssignmentTest4.ts] + + +class C3 { + CM3M1() { return 3;} +} + + +/* + +This behaves unexpectedly with teh following types: + +Type 1 of any[]: + +* Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[]. + +* Type 2 of the following doesn't throw an error but should: {one: 1}, new() => SomeClass, SomeClass. + +*/ +var c3 : C3 = new C3(); +var o1 = {one : 1}; + +var arr_any: any[] = []; + +arr_any = function () { return null;} // should be an error - is +arr_any = c3; // should be an error - is + + +//// [arrayAssignmentTest4.js] +var C3 = (function () { + function C3() { + } + C3.prototype.CM3M1 = function () { + return 3; + }; + return C3; +})(); +var c3 = new C3(); +var o1 = { one: 1 }; +var arr_any = []; +arr_any = function () { + return null; +}; +arr_any = c3; diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt new file mode 100644 index 0000000000000..b4772f1c3d663 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/arrayAssignmentTest5.ts (1 errors) ==== + module Test { + interface IState { + } + interface IToken { + startIndex: number; + } + interface IStateToken extends IToken { + state: IState; + } + interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + interface IAction { + } + interface IMode { + onEnter(line:string, state:IState, offset:number):IAction; + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; + } + export class Bug implements IMode { + public onEnter(line:string, state:IState, offset:number):IAction { + var lineTokens:ILineTokens= this.tokenize(line, state, true); + var tokens:IStateToken[]= lineTokens.tokens; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'IToken[]' is not assignable to type 'IStateToken[]': +!!! Type 'IToken' is not assignable to type 'IStateToken': +!!! Property 'state' is missing in type 'IToken'. + if (tokens.length === 0) { + return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) + } + } + public tokenize(line:string, state:IState, includeStates:boolean):ILineTokens { + return null; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.js b/tests/baselines/reference/arrayAssignmentTest5.js new file mode 100644 index 0000000000000..8eb2b65154aa5 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest5.js @@ -0,0 +1,55 @@ +//// [arrayAssignmentTest5.ts] +module Test { + interface IState { + } + interface IToken { + startIndex: number; + } + interface IStateToken extends IToken { + state: IState; + } + interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + interface IAction { + } + interface IMode { + onEnter(line:string, state:IState, offset:number):IAction; + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; + } + export class Bug implements IMode { + public onEnter(line:string, state:IState, offset:number):IAction { + var lineTokens:ILineTokens= this.tokenize(line, state, true); + var tokens:IStateToken[]= lineTokens.tokens; + if (tokens.length === 0) { + return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) + } + } + public tokenize(line:string, state:IState, includeStates:boolean):ILineTokens { + return null; + } + } +} + + +//// [arrayAssignmentTest5.js] +var Test; +(function (Test) { + var Bug = (function () { + function Bug() { + } + Bug.prototype.onEnter = function (line, state, offset) { + var lineTokens = this.tokenize(line, state, true); + var tokens = lineTokens.tokens; + if (tokens.length === 0) { + return this.onEnter(line, tokens, offset); + } + }; + Bug.prototype.tokenize = function (line, state, includeStates) { + return null; + }; + return Bug; + })(); + Test.Bug = Bug; +})(Test || (Test = {})); diff --git a/tests/baselines/reference/arrayAssignmentTest6.js b/tests/baselines/reference/arrayAssignmentTest6.js new file mode 100644 index 0000000000000..b8ee0c3194688 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest6.js @@ -0,0 +1,35 @@ +//// [arrayAssignmentTest6.ts] +module Test { + interface IState { + } + interface IToken { + startIndex: number; + } + interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + interface IMode { + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; + } + export class Bug implements IMode { + public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { + return null; + } + } +} + + +//// [arrayAssignmentTest6.js] +var Test; +(function (Test) { + var Bug = (function () { + function Bug() { + } + Bug.prototype.tokenize = function (line, tokens, includeStates) { + return null; + }; + return Bug; + })(); + Test.Bug = Bug; +})(Test || (Test = {})); diff --git a/tests/baselines/reference/arrayAugment.js b/tests/baselines/reference/arrayAugment.js new file mode 100644 index 0000000000000..b9023a5b15ec1 --- /dev/null +++ b/tests/baselines/reference/arrayAugment.js @@ -0,0 +1,14 @@ +//// [arrayAugment.ts] +interface Array { + split: (parts: number) => T[][]; +} + +var x = ['']; +var y = x.split(4); +var y: string[][]; // Expect no error here + + +//// [arrayAugment.js] +var x = ['']; +var y = x.split(4); +var y; diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js new file mode 100644 index 0000000000000..0a1b29e5e7f7c --- /dev/null +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -0,0 +1,117 @@ +//// [arrayBestCommonTypes.ts] +interface iface { } +class base implements iface { } +class base2 implements iface { } +class derived extends base { } + + +class f { + public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: any, y =false): any { return null; } + + public x() { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + + (this.voidIfAny([[3,4],[null]][0][0])); + + + var t1: { x: number; y: base; }[] = [ { x: 7, y: new derived() }, { x: 5, y: new base() } ]; + var t2: { x: boolean; y: base; }[] = [ { x: true, y: new derived() }, { x: false, y: new base() } ]; + var t3: { x: string; y: base; }[] = [ { x: undefined, y: new base() }, { x: '', y: new derived() } ]; + + var anyObj: any = null; + // Order matters here so test all the variants + var a1 = [ {x: 0, y: 'a'}, {x: 'a', y: 'a'}, {x: anyObj, y: 'a'} ]; + var a2 = [ {x: anyObj, y: 'a'}, {x: 0, y: 'a'}, {x: 'a', y: 'a'} ]; + var a3 = [ {x: 0, y: 'a'}, {x: anyObj, y: 'a'}, {x: 'a', y: 'a'} ]; + + var ifaceObj: iface = null; + var baseObj = new base(); + var base2Obj = new base2(); + + var b1 = [ baseObj, base2Obj, ifaceObj ]; + var b2 = [ base2Obj, baseObj, ifaceObj ]; + var b3 = [ baseObj, ifaceObj, base2Obj ]; + var b4 = [ ifaceObj, baseObj, base2Obj ]; + } +} + + + + +//// [arrayBestCommonTypes.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var base = (function () { + function base() { + } + return base; +})(); +var base2 = (function () { + function base2() { + } + return base2; +})(); +var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + return derived; +})(base); +var f = (function () { + function f() { + } + f.prototype.voidIfAny = function (x, y) { + if (y === void 0) { y = false; } + return null; + }; + f.prototype.x = function () { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + (this.voidIfAny([undefined, 2, 4][0])); + (this.voidIfAny([null, 2, 4][0])); + (this.voidIfAny([2, 4, null][0])); + (this.voidIfAny([undefined, 4, null][0])); + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + (this.voidIfAny([undefined, "q", ''][0])); + (this.voidIfAny([null, "q", ''][0])); + (this.voidIfAny(["q", '', null][0])); + (this.voidIfAny([undefined, '', null][0])); + (this.voidIfAny([[3, 4], [null]][0][0])); + var t1 = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2 = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3 = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + var anyObj = null; + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + var ifaceObj = null; + var baseObj = new base(); + var base2Obj = new base2(); + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + }; + return f; +})(); diff --git a/tests/baselines/reference/arrayCast.errors.txt b/tests/baselines/reference/arrayCast.errors.txt new file mode 100644 index 0000000000000..f081e0008d952 --- /dev/null +++ b/tests/baselines/reference/arrayCast.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/arrayCast.ts (1 errors) ==== + // Should fail. Even though the array is contextually typed with { id: number }[], it still + // has type { foo: string }[], which is not assignable to { id: number }[]. + <{ id: number; }[]>[{ foo: "s" }]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Neither type '{ id: number; }[]' nor type '{ foo: string; }[]' is assignable to the other: +!!! Type '{ id: number; }' is not assignable to type '{ foo: string; }'. + + // Should succeed, as the {} element causes the type of the array to be {}[] + <{ id: number; }[]>[{ foo: "s" }, {}]; \ No newline at end of file diff --git a/tests/baselines/reference/arrayCast.js b/tests/baselines/reference/arrayCast.js new file mode 100644 index 0000000000000..5d3ee9b73f333 --- /dev/null +++ b/tests/baselines/reference/arrayCast.js @@ -0,0 +1,11 @@ +//// [arrayCast.ts] +// Should fail. Even though the array is contextually typed with { id: number }[], it still +// has type { foo: string }[], which is not assignable to { id: number }[]. +<{ id: number; }[]>[{ foo: "s" }]; + +// Should succeed, as the {} element causes the type of the array to be {}[] +<{ id: number; }[]>[{ foo: "s" }, {}]; + +//// [arrayCast.js] +[{ foo: "s" }]; +[{ foo: "s" }, {}]; diff --git a/tests/baselines/reference/arrayConcat2.js b/tests/baselines/reference/arrayConcat2.js new file mode 100644 index 0000000000000..8db2d62e1d357 --- /dev/null +++ b/tests/baselines/reference/arrayConcat2.js @@ -0,0 +1,16 @@ +//// [arrayConcat2.ts] +var a: string[] = []; +a.concat("hello", 'world'); + +a.concat('Hello'); + +var b = new Array(); +b.concat('hello'); + + +//// [arrayConcat2.js] +var a = []; +a.concat("hello", 'world'); +a.concat('Hello'); +var b = new Array(); +b.concat('hello'); diff --git a/tests/baselines/reference/arrayConcatMap.js b/tests/baselines/reference/arrayConcatMap.js new file mode 100644 index 0000000000000..dc7272b72237f --- /dev/null +++ b/tests/baselines/reference/arrayConcatMap.js @@ -0,0 +1,6 @@ +//// [arrayConcatMap.ts] +var x = [].concat([{ a: 1 }], [{ a: 2 }]) + .map(b => b.a); + +//// [arrayConcatMap.js] +var x = [].concat([{ a: 1 }], [{ a: 2 }]).map(function (b) { return b.a; }); diff --git a/tests/baselines/reference/arrayConstructors1.js b/tests/baselines/reference/arrayConstructors1.js new file mode 100644 index 0000000000000..488cf49a3160b --- /dev/null +++ b/tests/baselines/reference/arrayConstructors1.js @@ -0,0 +1,20 @@ +//// [arrayConstructors1.ts] +var x: string[]; +x = new Array(1); +x = new Array('hi', 'bye'); +x = new Array('hi', 'bye'); + +var y: number[]; +y = new Array(1); +y = new Array(1,2); +y = new Array(1, 2); + +//// [arrayConstructors1.js] +var x; +x = new Array(1); +x = new Array('hi', 'bye'); +x = new Array('hi', 'bye'); +var y; +y = new Array(1); +y = new Array(1, 2); +y = new Array(1, 2); diff --git a/tests/baselines/reference/arrayLiteral.js b/tests/baselines/reference/arrayLiteral.js new file mode 100644 index 0000000000000..557b9be6a803d --- /dev/null +++ b/tests/baselines/reference/arrayLiteral.js @@ -0,0 +1,28 @@ +//// [arrayLiteral.ts] +// valid uses of array literals + +var x = []; +var x = new Array(1); + +var y = [1]; +var y = [1, 2]; +var y = new Array(); + +var x2: number[] = []; +var x2: number[] = new Array(1); + +var y2: number[] = [1]; +var y2: number[] = [1, 2]; +var y2: number[] = new Array(); + +//// [arrayLiteral.js] +var x = []; +var x = new Array(1); +var y = [1]; +var y = [1, 2]; +var y = new Array(); +var x2 = []; +var x2 = new Array(1); +var y2 = [1]; +var y2 = [1, 2]; +var y2 = new Array(); diff --git a/tests/baselines/reference/arrayLiteral1.js b/tests/baselines/reference/arrayLiteral1.js new file mode 100644 index 0000000000000..b84e7414f2448 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral1.js @@ -0,0 +1,5 @@ +//// [arrayLiteral1.ts] +var v30 = [1, 2]; + +//// [arrayLiteral1.js] +var v30 = [1, 2]; diff --git a/tests/baselines/reference/arrayLiteral2.js b/tests/baselines/reference/arrayLiteral2.js new file mode 100644 index 0000000000000..fb1b805930510 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral2.js @@ -0,0 +1,5 @@ +//// [arrayLiteral2.ts] +var v30 = [1, 2], v31; + +//// [arrayLiteral2.js] +var v30 = [1, 2], v31; diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt new file mode 100644 index 0000000000000..59137e1c4c1e2 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts (1 errors) ==== + var myCars=new Array(); + var myCars3 = new Array({}); + var myCars4: Array; // error + ~~~~~ +!!! Generic type 'Array' requires 1 type argument(s). + var myCars5: Array[]; + + myCars = myCars3; + myCars = myCars4; + myCars = myCars5; + + myCars3 = myCars; + myCars3 = myCars4; + myCars3 = myCars5; + \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js new file mode 100644 index 0000000000000..879c08073a6be --- /dev/null +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js @@ -0,0 +1,26 @@ +//// [arrayLiteralAndArrayConstructorEquivalence1.ts] +var myCars=new Array(); +var myCars3 = new Array({}); +var myCars4: Array; // error +var myCars5: Array[]; + +myCars = myCars3; +myCars = myCars4; +myCars = myCars5; + +myCars3 = myCars; +myCars3 = myCars4; +myCars3 = myCars5; + + +//// [arrayLiteralAndArrayConstructorEquivalence1.js] +var myCars = new Array(); +var myCars3 = new Array({}); +var myCars4; +var myCars5; +myCars = myCars3; +myCars = myCars4; +myCars = myCars5; +myCars3 = myCars; +myCars3 = myCars4; +myCars3 = myCars5; diff --git a/tests/baselines/reference/arrayLiteralContextualType.errors.txt b/tests/baselines/reference/arrayLiteralContextualType.errors.txt new file mode 100644 index 0000000000000..88ccc93e2764c --- /dev/null +++ b/tests/baselines/reference/arrayLiteralContextualType.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/arrayLiteralContextualType.ts (2 errors) ==== + interface IAnimal { + name: string; + } + + class Giraffe { + name = "Giraffe"; + neckLength = "3m"; + } + + class Elephant { + name = "Elephant"; + trunkDiameter = "20cm"; + } + + function foo(animals: IAnimal[]) { } + function bar(animals: { [n: number]: IAnimal }) { } + + foo([ + new Giraffe(), + new Elephant() + ]); // Legal because of the contextual type IAnimal provided by the parameter + bar([ + new Giraffe(), + new Elephant() + ]); // Legal because of the contextual type IAnimal provided by the parameter + + var arr = [new Giraffe(), new Elephant()]; + foo(arr); // Error because of no contextual type + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + bar(arr); // Error because of no contextual type + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralContextualType.js b/tests/baselines/reference/arrayLiteralContextualType.js new file mode 100644 index 0000000000000..427b14a8800dd --- /dev/null +++ b/tests/baselines/reference/arrayLiteralContextualType.js @@ -0,0 +1,61 @@ +//// [arrayLiteralContextualType.ts] +interface IAnimal { + name: string; +} + +class Giraffe { + name = "Giraffe"; + neckLength = "3m"; +} + +class Elephant { + name = "Elephant"; + trunkDiameter = "20cm"; +} + +function foo(animals: IAnimal[]) { } +function bar(animals: { [n: number]: IAnimal }) { } + +foo([ + new Giraffe(), + new Elephant() +]); // Legal because of the contextual type IAnimal provided by the parameter +bar([ + new Giraffe(), + new Elephant() +]); // Legal because of the contextual type IAnimal provided by the parameter + +var arr = [new Giraffe(), new Elephant()]; +foo(arr); // Error because of no contextual type +bar(arr); // Error because of no contextual type + +//// [arrayLiteralContextualType.js] +var Giraffe = (function () { + function Giraffe() { + this.name = "Giraffe"; + this.neckLength = "3m"; + } + return Giraffe; +})(); +var Elephant = (function () { + function Elephant() { + this.name = "Elephant"; + this.trunkDiameter = "20cm"; + } + return Elephant; +})(); +function foo(animals) { +} +function bar(animals) { +} +foo([ + new Giraffe(), + new Elephant() +]); +bar([ + new Giraffe(), + new Elephant() +]); +var arr = [new Giraffe(), new Elephant()]; +foo(arr); +bar(arr); diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js new file mode 100644 index 0000000000000..57cba07d6bf16 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js @@ -0,0 +1,14 @@ +//// [arrayLiteralInNonVarArgParameter.ts] +function panic(val: string[], ...opt: string[]) { } + +panic([], 'one', 'two'); + + +//// [arrayLiteralInNonVarArgParameter.js] +function panic(val) { + var opt = []; + for (var _i = 1; _i < arguments.length; _i++) { + opt[_i - 1] = arguments[_i]; + } +} +panic([], 'one', 'two'); diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js new file mode 100644 index 0000000000000..28aa143fa61ab --- /dev/null +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -0,0 +1,105 @@ +//// [arrayLiteralTypeInference.ts] +class Action { + id: number; +} + +class ActionA extends Action { + value: string; +} + +class ActionB extends Action { + trueNess: boolean; +} + +var x1: Action[] = [ + { id: 2, trueness: false }, + { id: 3, name: "three" } +] + +var x2: Action[] = [ + new ActionA(), + new ActionB() +] + +var x3: Action[] = [ + new Action(), + new ActionA(), + new ActionB() +] + +var z1: { id: number }[] = + [ + { id: 2, trueness: false }, + { id: 3, name: "three" } + ] + +var z2: { id: number }[] = + [ + new ActionA(), + new ActionB() + ] + +var z3: { id: number }[] = + [ + new Action(), + new ActionA(), + new ActionB() + ] + + + + + + +//// [arrayLiteralTypeInference.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Action = (function () { + function Action() { + } + return Action; +})(); +var ActionA = (function (_super) { + __extends(ActionA, _super); + function ActionA() { + _super.apply(this, arguments); + } + return ActionA; +})(Action); +var ActionB = (function (_super) { + __extends(ActionB, _super); + function ActionB() { + _super.apply(this, arguments); + } + return ActionB; +})(Action); +var x1 = [ + { id: 2, trueness: false }, + { id: 3, name: "three" } +]; +var x2 = [ + new ActionA(), + new ActionB() +]; +var x3 = [ + new Action(), + new ActionA(), + new ActionB() +]; +var z1 = [ + { id: 2, trueness: false }, + { id: 3, name: "three" } +]; +var z2 = [ + new ActionA(), + new ActionB() +]; +var z3 = [ + new Action(), + new ActionA(), + new ActionB() +]; diff --git a/tests/baselines/reference/arrayLiteralWidened.js b/tests/baselines/reference/arrayLiteralWidened.js new file mode 100644 index 0000000000000..11fad71e9f287 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWidened.js @@ -0,0 +1,25 @@ +//// [arrayLiteralWidened.ts] +// array literals are widened upon assignment according to their element type + +var a = []; // any[] + +var a = [null, null]; +var a = [undefined, undefined]; + +var b = [[], [null, null]]; // any[][] +var b = [[], []]; +var b = [[undefined, undefined]]; + +var c = [[[]]]; // any[][][] +var c = [[[null]],[undefined]] + + +//// [arrayLiteralWidened.js] +var a = []; +var a = [null, null]; +var a = [undefined, undefined]; +var b = [[], [null, null]]; +var b = [[], []]; +var b = [[undefined, undefined]]; +var c = [[[]]]; +var c = [[[null]], [undefined]]; diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js new file mode 100644 index 0000000000000..f1720efd41893 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js @@ -0,0 +1,28 @@ +//// [arrayLiteralWithMultipleBestCommonTypes.ts] +// when multiple best common types exist we will choose the first candidate + +var a: { x: number; y?: number }; +var b: { x: number; z?: number }; +var c: { x: number; a?: number }; + +var as = [a, b]; // { x: number; y?: number };[] +var bs = [b, a]; // { x: number; z?: number };[] +var cs = [a, b, c]; // { x: number; y?: number };[] + +var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] +var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] +var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] +var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] + + +//// [arrayLiteralWithMultipleBestCommonTypes.js] +var a; +var b; +var c; +var as = [a, b]; +var bs = [b, a]; +var cs = [a, b, c]; +var ds = [function (x) { return 1; }, function (x) { return 2; }]; +var es = [function (x) { return 2; }, function (x) { return 1; }]; +var fs = [function (a) { return 1; }, function (b) { return 2; }]; +var gs = [function (b) { return 2; }, function (a) { return 1; }]; diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js new file mode 100644 index 0000000000000..e4d9b138b5698 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals.js @@ -0,0 +1,100 @@ +//// [arrayLiterals.ts] +// Empty array literal with no contextual type has type Undefined[] + +var arr1= [[], [1], ['']]; +var arr1: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK + +var arr2 = [[null], [1], ['']]; +var arr2: {}[]; // Bug 825172: Error ({}[] does not match {}[]), but should be OK + + +// Array literal with elements of only EveryType E has type E[] +var stringArrArr = [[''], [""]]; +var stringArrArr: string[][]; + +var stringArr = ['', ""]; +var stringArr: string[]; + +var numberArr = [0, 0.0, 0x00, 1e1]; +var numberArr: number[]; + +var boolArr = [false, true, false, true]; +var boolArr: boolean[]; + +class C { private p; } +var classArr = [new C(), new C()]; +var classArr: C[]; // Should be OK + +var classTypeArray = [C, C, C]; +var classTypeArray: Array; // Should OK, not be a parse error + +// Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] +var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +var context2: Array<{}>; // Should be OK + +// Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] +class Base { private p; } +class Derived1 extends Base { private m }; +class Derived2 extends Base { private n }; +var context3: Base[] = [new Derived1(), new Derived2()]; + +// Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] +var context4: Base[] = [new Derived1(), new Derived1()]; + + + +//// [arrayLiterals.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var arr1 = [[], [1], ['']]; +var arr1; +var arr2 = [[null], [1], ['']]; +var arr2; +var stringArrArr = [[''], [""]]; +var stringArrArr; +var stringArr = ['', ""]; +var stringArr; +var numberArr = [0, 0.0, 0x00, 1e1]; +var numberArr; +var boolArr = [false, true, false, true]; +var boolArr; +var C = (function () { + function C() { + } + return C; +})(); +var classArr = [new C(), new C()]; +var classArr; +var classTypeArray = [C, C, C]; +var classTypeArray; +var context1 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +var context2; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + return Derived1; +})(Base); +; +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +; +var context3 = [new Derived1(), new Derived2()]; +var context4 = [new Derived1(), new Derived1()]; diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js new file mode 100644 index 0000000000000..335446ea3be66 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -0,0 +1,59 @@ +//// [arrayLiteralsWithRecursiveGenerics.ts] +class List { + data: T; + next: List>; +} + +class DerivedList extends List { + foo: U; + // next: List> +} + +class MyList { + data: T; + next: MyList>; +} + +var list: List; +var list2: List; +var myList: MyList; + +var xs = [list, myList]; // {}[] +var ys = [list, list2]; // {}[] +var zs = [list, null]; // List[] + +var myDerivedList: DerivedList; +var as = [list, myDerivedList]; // List[] + +//// [arrayLiteralsWithRecursiveGenerics.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var List = (function () { + function List() { + } + return List; +})(); +var DerivedList = (function (_super) { + __extends(DerivedList, _super); + function DerivedList() { + _super.apply(this, arguments); + } + return DerivedList; +})(List); +var MyList = (function () { + function MyList() { + } + return MyList; +})(); +var list; +var list2; +var myList; +var xs = [list, myList]; +var ys = [list, list2]; +var zs = [list, null]; +var myDerivedList; +var as = [list, myDerivedList]; diff --git a/tests/baselines/reference/arrayOfExportedClass.js b/tests/baselines/reference/arrayOfExportedClass.js new file mode 100644 index 0000000000000..7fde4aa677532 --- /dev/null +++ b/tests/baselines/reference/arrayOfExportedClass.js @@ -0,0 +1,43 @@ +//// [tests/cases/compiler/arrayOfExportedClass.ts] //// + +//// [arrayOfExportedClass_0.ts] +class Car { + foo: string; +} + +export = Car; + +//// [arrayOfExportedClass_1.ts] +/// +import Car = require('arrayOfExportedClass_0'); + +class Road { + + public cars: Car[]; + + public AddCars(cars: Car[]) { + + this.cars = cars; + } +} + +export = Road; + + +//// [arrayOfExportedClass_0.js] +var Car = (function () { + function Car() { + } + return Car; +})(); +module.exports = Car; +//// [arrayOfExportedClass_1.js] +var Road = (function () { + function Road() { + } + Road.prototype.AddCars = function (cars) { + this.cars = cars; + }; + return Road; +})(); +module.exports = Road; diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.js b/tests/baselines/reference/arrayOfFunctionTypes3.js new file mode 100644 index 0000000000000..cf720720195cb --- /dev/null +++ b/tests/baselines/reference/arrayOfFunctionTypes3.js @@ -0,0 +1,52 @@ +//// [arrayOfFunctionTypes3.ts] +// valid uses of arrays of function types + +var x = [() => 1, () => { }]; +var r2 = x[0](); + +class C { + foo: string; +} +var y = [C, C]; +var r3 = new y[0](); + +var a: { (x: number): number; (x: string): string; }; +var b: { (x: number): number; (x: string): string; }; +var c: { (x: number): number; (x: any): any; }; +var z = [a, b, c]; +var r4 = z[0]; +var r5 = r4(''); // any not string +var r5b = r4(1); + +var a2: { (x: T): number; (x: string): string;}; +var b2: { (x: T): number; (x: string): string; }; +var c2: { (x: number): number; (x: T): any; }; + +var z2 = [a2, b2, c2]; +var r6 = z2[0]; +var r7 = r6(''); // any not string + +//// [arrayOfFunctionTypes3.js] +var x = [function () { return 1; }, function () { +}]; +var r2 = x[0](); +var C = (function () { + function C() { + } + return C; +})(); +var y = [C, C]; +var r3 = new y[0](); +var a; +var b; +var c; +var z = [a, b, c]; +var r4 = z[0]; +var r5 = r4(''); +var r5b = r4(1); +var a2; +var b2; +var c2; +var z2 = [a2, b2, c2]; +var r6 = z2[0]; +var r7 = r6(''); diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt new file mode 100644 index 0000000000000..6cffd03f44b69 --- /dev/null +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts (1 errors) ==== + class X { + public f(a: Array) { } + ~~~~~ +!!! Generic type 'Array' requires 1 type argument(s). + } \ No newline at end of file diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js new file mode 100644 index 0000000000000..3b0f2c11aa797 --- /dev/null +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js @@ -0,0 +1,13 @@ +//// [arrayReferenceWithoutTypeArgs.ts] +class X { + public f(a: Array) { } +} + +//// [arrayReferenceWithoutTypeArgs.js] +var X = (function () { + function X() { + } + X.prototype.f = function (a) { + }; + return X; +})(); diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt new file mode 100644 index 0000000000000..2cff4328c0016 --- /dev/null +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/compiler/arraySigChecking.ts (3 errors) ==== + declare module M { + interface iBar { t: any; } + interface iFoo extends iBar { + s: any; + } + + class cFoo { + t: any; + } + + var foo: { [index: any]; }; // expect an error here + ~~~~~ +!!! An index signature parameter type must be 'string' or 'number'. + } + + interface myInt { + voidFn(): void; + } + var myVar: myInt; + var strArray: string[] = [myVar.voidFn()]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'void[]' is not assignable to type 'string[]': +!!! Type 'void' is not assignable to type 'string'. + + + var myArray: number[][][]; + myArray = [[1, 2]]; + ~~~~~~~ +!!! Type 'number[][]' is not assignable to type 'number[][][]': +!!! Type 'number[]' is not assignable to type 'number[][]': +!!! Type 'number' is not assignable to type 'number[]': +!!! Property 'concat' is missing in type 'Number'. + + function isEmpty(l: { length: number }) { + return l.length === 0; + } + + isEmpty([]); + isEmpty(new Array(3)); + isEmpty(new Array(3)); + isEmpty(['a']); + \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js new file mode 100644 index 0000000000000..2082c2c8574e8 --- /dev/null +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js @@ -0,0 +1,28 @@ +//// [arrayTypeInSignatureOfInterfaceAndClass.ts] +declare module WinJS { + class Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + } +} +declare module Data { + export interface IListItem { + itemIndex: number; + key: any; + data: T; + group: any; + isHeader: boolean; + cached: boolean; + isNonSourceData: boolean; + preventAugmentation: boolean; + } + export interface IVirtualList { + //removeIndices: WinJS.Promise[]>; + removeIndices(indices: number[], options?: any): WinJS.Promise[]>; + } + export class VirtualList implements IVirtualList { + //removeIndices: WinJS.Promise[]>; + public removeIndices(indices: number[], options?: any): WinJS.Promise[]>; + } +} + +//// [arrayTypeInSignatureOfInterfaceAndClass.js] diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt b/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt new file mode 100644 index 0000000000000..58b4345bc0248 --- /dev/null +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts (2 errors) ==== + // valid uses of arrays of function types + + var x: () => string[]; + var r = x[1]; + var r2 = r(); + var r2b = new r(); + + var x2: { (): string }[]; + var r3 = x2[1]; + var r4 = r3(); + var r4b = new r3(); // error + ~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + var x3: Array<() => string>; + var r5 = x2[1]; + var r6 = r5(); + var r6b = new r5(); // error + ~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.js b/tests/baselines/reference/arrayTypeOfFunctionTypes.js new file mode 100644 index 0000000000000..355070d48d8a5 --- /dev/null +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.js @@ -0,0 +1,31 @@ +//// [arrayTypeOfFunctionTypes.ts] +// valid uses of arrays of function types + +var x: () => string[]; +var r = x[1]; +var r2 = r(); +var r2b = new r(); + +var x2: { (): string }[]; +var r3 = x2[1]; +var r4 = r3(); +var r4b = new r3(); // error + +var x3: Array<() => string>; +var r5 = x2[1]; +var r6 = r5(); +var r6b = new r5(); // error + +//// [arrayTypeOfFunctionTypes.js] +var x; +var r = x[1]; +var r2 = r(); +var r2b = new r(); +var x2; +var r3 = x2[1]; +var r4 = r3(); +var r4b = new r3(); +var x3; +var r5 = x2[1]; +var r6 = r5(); +var r6b = new r5(); diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt b/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt new file mode 100644 index 0000000000000..fc8cd992cfae8 --- /dev/null +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes2.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes2.ts (1 errors) ==== + // valid uses of arrays of function types + + var x: new () => string[]; + var r = x[1]; + var r2 = new r(); + var r2b = r(); + + var x2: { new(): string }[]; + var r3 = x[1]; + var r4 = new r3(); + var r4b = new r3(); + + var x3: Array string>; + var r5 = x2[1]; + var r6 = new r5(); + var r6b = r5(); + ~~~~ +!!! Value of type 'new () => string' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes2.js b/tests/baselines/reference/arrayTypeOfFunctionTypes2.js new file mode 100644 index 0000000000000..530a826700dd6 --- /dev/null +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes2.js @@ -0,0 +1,31 @@ +//// [arrayTypeOfFunctionTypes2.ts] +// valid uses of arrays of function types + +var x: new () => string[]; +var r = x[1]; +var r2 = new r(); +var r2b = r(); + +var x2: { new(): string }[]; +var r3 = x[1]; +var r4 = new r3(); +var r4b = new r3(); + +var x3: Array string>; +var r5 = x2[1]; +var r6 = new r5(); +var r6b = r5(); + +//// [arrayTypeOfFunctionTypes2.js] +var x; +var r = x[1]; +var r2 = new r(); +var r2b = r(); +var x2; +var r3 = x[1]; +var r4 = new r3(); +var r4b = new r3(); +var x3; +var r5 = x2[1]; +var r6 = new r5(); +var r6b = r5(); diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt new file mode 100644 index 0000000000000..9cc575efbadc9 --- /dev/null +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ==== + // array type cannot use typeof. + + var x = 1; + var xs: typeof x[]; // Not an error. This is equivalent to Array + var xs2: typeof Array; + var xs3: typeof Array; + ~ +!!! '=' expected. + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +!!! Property 'isArray' is missing in type 'Number'. + var xs4: typeof Array; + ~ +!!! '=' expected. + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayconcat.js b/tests/baselines/reference/arrayconcat.js new file mode 100644 index 0000000000000..fd527d87c3c53 --- /dev/null +++ b/tests/baselines/reference/arrayconcat.js @@ -0,0 +1,51 @@ +//// [arrayconcat.ts] +interface IOptions { + name?: string; + flag?: boolean; + short?: string; + usage?: string; + set?: (s: string) => void; + type?: string; + experimental?: boolean; +} + +class parser { + public options: IOptions[]; + + public m() { + this.options = this.options.sort(function(a, b) { + var aName = a.name.toLowerCase(); + var bName = b.name.toLowerCase(); + + if (aName > bName) { + return 1; + } else if (aName < bName) { + return -1; + } else { + return 0; + } + }); + } +} + +//// [arrayconcat.js] +var parser = (function () { + function parser() { + } + parser.prototype.m = function () { + this.options = this.options.sort(function (a, b) { + var aName = a.name.toLowerCase(); + var bName = b.name.toLowerCase(); + if (aName > bName) { + return 1; + } + else if (aName < bName) { + return -1; + } + else { + return 0; + } + }); + }; + return parser; +})(); diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt new file mode 100644 index 0000000000000..35b52144102be --- /dev/null +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -0,0 +1,115 @@ +==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (9 errors) ==== + + // Arrow function used in with statement + with (window) { + ~~~~~~ +!!! Cannot find name 'window'. + var p = () => this; + } + + // Arrow function as argument to super call + class Base { + constructor(n: any) { } + } + + class Derived extends Base { + constructor() { + super(() => this); + } + } + + // Arrow function as function argument + window.setTimeout(() => null, 100); + ~~~~~~ +!!! Cannot find name 'window'. + + // Arrow function as value in array literal + + var obj = (n: number) => ''; + var obj: { (n: number): string; }; // OK + + var arr = [(n: number) => '']; + var arr: { (n: number): string; }[]; // Incorrect error here (bug 829597) + + // Arrow function as enum value + enum E { + x = () => 4, // Error expected + ~~~~~~~ +!!! Type '() => number' is not assignable to type 'E'. + y = (() => this).length // error, can't use this in enum + ~~~~ +!!! 'this' cannot be referenced in current location. + } + + // Arrow function as module variable initializer + module M { + export var a = (s) => ''; + var b = (s) => s; + } + + // Repeat above for module members that are functions? (necessary to redo all of them?) + module M2 { + // Arrow function used in with statement + with (window) { + ~~~~~~ +!!! Cannot find name 'window'. + var p = () => this; + ~~~~ +!!! 'this' cannot be referenced in a module body. + } + + // Arrow function as argument to super call + class Base { + constructor(n: any) { } + } + + class Derived extends Base { + constructor() { + super(() => this); + } + } + + // Arrow function as function argument + window.setTimeout(() => null, 100); + ~~~~~~ +!!! Cannot find name 'window'. + + // Arrow function as value in array literal + + var obj = (n: number) => ''; + var obj: { (n: number): string; }; // OK + + var arr = [(n: number) => '']; + var arr: { (n: number): string; }[]; // Incorrect error here (bug 829597) + + // Arrow function as enum value + enum E { + x = () => 4, // Error expected + ~~~~~~~ +!!! Type '() => number' is not assignable to type 'E'. + y = (() => this).length + ~~~~ +!!! 'this' cannot be referenced in current location. + } + + // Arrow function as module variable initializer + module M { + export var a = (s) => ''; + var b = (s) => s; + } + + } + + // (ParamList) => { ... } is a generic arrow function + var generic1 = (n: T) => [n]; + var generic1: { (n: T): T[] }; // Incorrect error, Bug 829597 + var generic2 = (n: T) => { return [n]; }; + var generic2: { (n: T): T[] }; + + // ((ParamList) => { ... } ) is a type assertion to an arrow function + var asserted1 = ((n) => [n]); + var asserted1: any; + var asserted2 = ((n) => { return n; }); + var asserted2: any; + + \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js new file mode 100644 index 0000000000000..635de47f40297 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -0,0 +1,184 @@ +//// [arrowFunctionContexts.ts] + +// Arrow function used in with statement +with (window) { + var p = () => this; +} + +// Arrow function as argument to super call +class Base { + constructor(n: any) { } +} + +class Derived extends Base { + constructor() { + super(() => this); + } +} + +// Arrow function as function argument +window.setTimeout(() => null, 100); + +// Arrow function as value in array literal + +var obj = (n: number) => ''; +var obj: { (n: number): string; }; // OK + +var arr = [(n: number) => '']; +var arr: { (n: number): string; }[]; // Incorrect error here (bug 829597) + +// Arrow function as enum value +enum E { + x = () => 4, // Error expected + y = (() => this).length // error, can't use this in enum +} + +// Arrow function as module variable initializer +module M { + export var a = (s) => ''; + var b = (s) => s; +} + +// Repeat above for module members that are functions? (necessary to redo all of them?) +module M2 { + // Arrow function used in with statement + with (window) { + var p = () => this; + } + + // Arrow function as argument to super call + class Base { + constructor(n: any) { } + } + + class Derived extends Base { + constructor() { + super(() => this); + } + } + + // Arrow function as function argument + window.setTimeout(() => null, 100); + + // Arrow function as value in array literal + + var obj = (n: number) => ''; + var obj: { (n: number): string; }; // OK + + var arr = [(n: number) => '']; + var arr: { (n: number): string; }[]; // Incorrect error here (bug 829597) + + // Arrow function as enum value + enum E { + x = () => 4, // Error expected + y = (() => this).length + } + + // Arrow function as module variable initializer + module M { + export var a = (s) => ''; + var b = (s) => s; + } + +} + +// (ParamList) => { ... } is a generic arrow function +var generic1 = (n: T) => [n]; +var generic1: { (n: T): T[] }; // Incorrect error, Bug 829597 +var generic2 = (n: T) => { return [n]; }; +var generic2: { (n: T): T[] }; + +// ((ParamList) => { ... } ) is a type assertion to an arrow function +var asserted1 = ((n) => [n]); +var asserted1: any; +var asserted2 = ((n) => { return n; }); +var asserted2: any; + + + +//// [arrowFunctionContexts.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var _this = this; +with (window) { + var p = function () { return _this; }; +} +var Base = (function () { + function Base(n) { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.call(this, function () { return _this; }); + var _this = this; + } + return Derived; +})(Base); +window.setTimeout(function () { return null; }, 100); +var obj = function (n) { return ''; }; +var obj; +var arr = [function (n) { return ''; }]; +var arr; +var E; +(function (E) { + E[E["x"] = function () { return 4; }] = "x"; + E[E["y"] = (function () { return _this; }).length] = "y"; +})(E || (E = {})); +var M; +(function (M) { + M.a = function (s) { return ''; }; + var b = function (s) { return s; }; +})(M || (M = {})); +var M2; +(function (M2) { + var _this = this; + with (window) { + var p = function () { return _this; }; + } + var Base = (function () { + function Base(n) { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.call(this, function () { return _this; }); + var _this = this; + } + return Derived; + })(Base); + window.setTimeout(function () { return null; }, 100); + var obj = function (n) { return ''; }; + var obj; + var arr = [function (n) { return ''; }]; + var arr; + var E; + (function (E) { + E[E["x"] = function () { return 4; }] = "x"; + E[E["y"] = (function () { return _this; }).length] = "y"; + })(E || (E = {})); + var M; + (function (M) { + M.a = function (s) { return ''; }; + var b = function (s) { return s; }; + })(M || (M = {})); +})(M2 || (M2 = {})); +var generic1 = function (n) { return [n]; }; +var generic1; +var generic2 = function (n) { + return [n]; +}; +var generic2; +var asserted1 = (function (n) { return [n]; }); +var asserted1; +var asserted2 = (function (n) { + return n; +}); +var asserted2; diff --git a/tests/baselines/reference/arrowFunctionExpressions.js b/tests/baselines/reference/arrowFunctionExpressions.js new file mode 100644 index 0000000000000..b403f30906ce6 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionExpressions.js @@ -0,0 +1,168 @@ +//// [arrowFunctionExpressions.ts] +// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; } +var a = (p: string) => p.length; +var a = (p: string) => { return p.length; } + +// Identifier => Block is equivalent to(Identifier) => Block +var b = j => { return 0; } +var b = (j) => { return 0; } + +// Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression +var c: number; +var d = n => c = n; +var d = (n) => c = n; +var d: (n: any) => any; + + +// Arrow function used in class member initializer +// Arrow function used in class member function +class MyClass { + m = (n) => n + 1; + p = (n) => n && this; + + fn() { + var m = (n) => n + 1; + var p = (n) => n && this; + } +} + +// Arrow function used in arrow function +var arrrr = () => (m: number) => () => (n: number) => m + n; +var e = arrrr()(3)()(4); +var e: number; + +// Arrow function used in arrow function used in function +function someFn() { + var arr = (n: number) => (p: number) => p * n; + arr(3)(4).toExponential(); +} + +// Arrow function used in function +function someOtherFn() { + var arr = (n: number) => '' + n; + arr(4).charAt(0); +} + +// Arrow function used in nested function in function +function outerFn() { + function innerFn() { + var arrowFn = () => { }; + var p = arrowFn(); + var p: void; + } +} + +// Arrow function used in nested function in arrow function +var f = (n: string) => { + function fn(x: number) { + return () => n + x; + } + return fn(4); +} +var g = f('')(); +var g: string; + + +// Arrow function used in nested function in arrow function in nested function +function someOuterFn() { + var arr = (n: string) => { + function innerFn() { + return () => n.length; + } + return innerFn; + } + return arr; +} +var h = someOuterFn()('')()(); +h.toExponential(); + +// Arrow function used in try/catch/finally in function +function tryCatchFn() { + try { + var x = () => this; + } catch (e) { + var t = () => e + this; + } finally { + var m = () => this + ''; + } +} + + +//// [arrowFunctionExpressions.js] +var a = function (p) { return p.length; }; +var a = function (p) { + return p.length; +}; +var b = function (j) { + return 0; +}; +var b = function (j) { + return 0; +}; +var c; +var d = function (n) { return c = n; }; +var d = function (n) { return c = n; }; +var d; +var MyClass = (function () { + function MyClass() { + var _this = this; + this.m = function (n) { return n + 1; }; + this.p = function (n) { return n && _this; }; + } + MyClass.prototype.fn = function () { + var _this = this; + var m = function (n) { return n + 1; }; + var p = function (n) { return n && _this; }; + }; + return MyClass; +})(); +var arrrr = function () { return function (m) { return function () { return function (n) { return m + n; }; }; }; }; +var e = arrrr()(3)()(4); +var e; +function someFn() { + var arr = function (n) { return function (p) { return p * n; }; }; + arr(3)(4).toExponential(); +} +function someOtherFn() { + var arr = function (n) { return '' + n; }; + arr(4).charAt(0); +} +function outerFn() { + function innerFn() { + var arrowFn = function () { + }; + var p = arrowFn(); + var p; + } +} +var f = function (n) { + function fn(x) { + return function () { return n + x; }; + } + return fn(4); +}; +var g = f('')(); +var g; +function someOuterFn() { + var arr = function (n) { + function innerFn() { + return function () { return n.length; }; + } + return innerFn; + }; + return arr; +} +var h = someOuterFn()('')()(); +h.toExponential(); +function tryCatchFn() { + var _this = this; + try { + var x = function () { return _this; }; + } + catch (e) { + var t = function () { return e + _this; }; + } + finally { + var m = function () { return _this + ''; }; + } +} diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt b/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt new file mode 100644 index 0000000000000..e5f33b3e1eb0e --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/arrowFunctionInConstructorArgument1.ts (1 errors) ==== + class C { + constructor(x: () => void) { } + } + var c = new C(() => { return asdf; } ) // should error + ~~~~ +!!! Cannot find name 'asdf'. + \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js new file mode 100644 index 0000000000000..01645771343ac --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js @@ -0,0 +1,16 @@ +//// [arrowFunctionInConstructorArgument1.ts] +class C { + constructor(x: () => void) { } +} +var c = new C(() => { return asdf; } ) // should error + + +//// [arrowFunctionInConstructorArgument1.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var c = new C(function () { + return asdf; +}); diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.js b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js new file mode 100644 index 0000000000000..9969a28b6cec2 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js @@ -0,0 +1,5 @@ +//// [arrowFunctionInExpressionStatement1.ts] +() => 0; + +//// [arrowFunctionInExpressionStatement1.js] +(function () { return 0; }); diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.js b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js new file mode 100644 index 0000000000000..2cc6aca998ea5 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js @@ -0,0 +1,10 @@ +//// [arrowFunctionInExpressionStatement2.ts] +module M { + () => 0; +} + +//// [arrowFunctionInExpressionStatement2.js] +var M; +(function (M) { + (function () { return 0; }); +})(M || (M = {})); diff --git a/tests/baselines/reference/asiArith.js b/tests/baselines/reference/asiArith.js new file mode 100644 index 0000000000000..6d7b964c8d0dd --- /dev/null +++ b/tests/baselines/reference/asiArith.js @@ -0,0 +1,43 @@ +//// [asiArith.ts] +var x = 1; + +var y = 1; + +var z = + +x + ++ + ++ + ++ + +y + + +var a = 1; + +var b = 1; + +var c = + +x + +- + +- + +- + +y + + + +//// [asiArith.js] +var x = 1; +var y = 1; +var z = x + + +y; +var a = 1; +var b = 1; +var c = x - - -y; diff --git a/tests/baselines/reference/asiInES6Classes.js b/tests/baselines/reference/asiInES6Classes.js new file mode 100644 index 0000000000000..df4b0288d8a80 --- /dev/null +++ b/tests/baselines/reference/asiInES6Classes.js @@ -0,0 +1,36 @@ +//// [asiInES6Classes.ts] +class Foo { + + + + defaults = { + + done: false + + } + + + + bar() { + + return 3; + + } + + + +} + + +//// [asiInES6Classes.js] +var Foo = (function () { + function Foo() { + this.defaults = { + done: false + }; + } + Foo.prototype.bar = function () { + return 3; + }; + return Foo; +})(); diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt new file mode 100644 index 0000000000000..007b23dc47408 --- /dev/null +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/assertInWrapSomeTypeParameter.ts (2 errors) ==== + class C> { + ~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo>(x: U) { + ~ +!!! '>' expected. + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assign1.js b/tests/baselines/reference/assign1.js new file mode 100644 index 0000000000000..fa18c8f287bb7 --- /dev/null +++ b/tests/baselines/reference/assign1.js @@ -0,0 +1,16 @@ +//// [assign1.ts] +module M { + interface I { + salt:number; + pepper:number; + } + + var x:I={salt:2,pepper:0}; +} + + +//// [assign1.js] +var M; +(function (M) { + var x = { salt: 2, pepper: 0 }; +})(M || (M = {})); diff --git a/tests/baselines/reference/assignAnyToEveryType.errors.txt b/tests/baselines/reference/assignAnyToEveryType.errors.txt new file mode 100644 index 0000000000000..a6eadd120380c --- /dev/null +++ b/tests/baselines/reference/assignAnyToEveryType.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/types/any/assignAnyToEveryType.ts (1 errors) ==== + // all of these are valid + + var x: any; + + var a: number = x; + var b: boolean = x; + var c: string = x; + var d: void = x; + var e = null; + e = x; + var f = undefined; + f = x; + + enum E { + A + } + + var g: E = x; + var g2 = E.A; + g2 = x; + + class C { + foo: string; + } + + var h: C = x; + + interface I { + foo: string; + } + + var i: I = x; + + var j: { (): string } = x; + var j2: { (x: T): string } = x; + + module M { + export var foo = 1; + } + + M = x; + ~ +!!! Invalid left-hand side of assignment expression. + + function k(a: T) { + a = x; + } \ No newline at end of file diff --git a/tests/baselines/reference/assignAnyToEveryType.js b/tests/baselines/reference/assignAnyToEveryType.js new file mode 100644 index 0000000000000..483cef6d82b02 --- /dev/null +++ b/tests/baselines/reference/assignAnyToEveryType.js @@ -0,0 +1,81 @@ +//// [assignAnyToEveryType.ts] +// all of these are valid + +var x: any; + +var a: number = x; +var b: boolean = x; +var c: string = x; +var d: void = x; +var e = null; +e = x; +var f = undefined; +f = x; + +enum E { + A +} + +var g: E = x; +var g2 = E.A; +g2 = x; + +class C { + foo: string; +} + +var h: C = x; + +interface I { + foo: string; +} + +var i: I = x; + +var j: { (): string } = x; +var j2: { (x: T): string } = x; + +module M { + export var foo = 1; +} + +M = x; + +function k(a: T) { + a = x; +} + +//// [assignAnyToEveryType.js] +var x; +var a = x; +var b = x; +var c = x; +var d = x; +var e = null; +e = x; +var f = undefined; +f = x; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var g = x; +var g2 = 0 /* A */; +g2 = x; +var C = (function () { + function C() { + } + return C; +})(); +var h = x; +var i = x; +var j = x; +var j2 = x; +var M; +(function (M) { + M.foo = 1; +})(M || (M = {})); +M = x; +function k(a) { + a = x; +} diff --git a/tests/baselines/reference/assignEveryTypeToAny.js b/tests/baselines/reference/assignEveryTypeToAny.js new file mode 100644 index 0000000000000..f082b5c9b76d5 --- /dev/null +++ b/tests/baselines/reference/assignEveryTypeToAny.js @@ -0,0 +1,101 @@ +//// [assignEveryTypeToAny.ts] +// all of these are valid + +var x: any; + +x = 1; +var a = 2; +x = a; + +x = true; +var b = true; +x = b; + +x = ""; +var c = ""; +x = c; + +var d: void; +x = d; + +var e = undefined; +x = e; + +var e2: typeof undefined; +x = e2; + +enum E { + A +} + +x = E.A; +var f = E.A; +x = f; + +interface I { + foo: string; +} + +var g: I; +x = g; + +class C { + bar: string; +} + +var h: C; +x = h; + +var i: { (): string }; +x = i; +x = { f() { return 1; } } +x = { f(x: T) { return x; } } + +function j(a: T) { + x = a; +} + +//// [assignEveryTypeToAny.js] +var x; +x = 1; +var a = 2; +x = a; +x = true; +var b = true; +x = b; +x = ""; +var c = ""; +x = c; +var d; +x = d; +var e = undefined; +x = e; +var e2; +x = e2; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +x = 0 /* A */; +var f = 0 /* A */; +x = f; +var g; +x = g; +var C = (function () { + function C() { + } + return C; +})(); +var h; +x = h; +var i; +x = i; +x = { f: function f() { + return 1; +} }; +x = { f: function f(x) { + return x; +} }; +function j(a) { + x = a; +} diff --git a/tests/baselines/reference/assignFromBooleanInterface.errors.txt b/tests/baselines/reference/assignFromBooleanInterface.errors.txt new file mode 100644 index 0000000000000..679399d45333a --- /dev/null +++ b/tests/baselines/reference/assignFromBooleanInterface.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts (1 errors) ==== + var x = true; + var a: Boolean; + x = a; + ~ +!!! Type 'Boolean' is not assignable to type 'boolean'. + a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface.js b/tests/baselines/reference/assignFromBooleanInterface.js new file mode 100644 index 0000000000000..82b4413f585fe --- /dev/null +++ b/tests/baselines/reference/assignFromBooleanInterface.js @@ -0,0 +1,11 @@ +//// [assignFromBooleanInterface.ts] +var x = true; +var a: Boolean; +x = a; +a = x; + +//// [assignFromBooleanInterface.js] +var x = true; +var a; +x = a; +a = x; diff --git a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt new file mode 100644 index 0000000000000..fc1350681f45c --- /dev/null +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts (2 errors) ==== + interface Boolean { + doStuff(): string; + } + + interface NotBoolean { + doStuff(): string; + } + + var x = true; + var a: Boolean; + var b: NotBoolean; + + a = x; + a = b; + + b = a; + b = x; + + x = a; // expected error + ~ +!!! Type 'Boolean' is not assignable to type 'boolean'. + x = b; // expected error + ~ +!!! Type 'NotBoolean' is not assignable to type 'boolean'. + + \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface2.js b/tests/baselines/reference/assignFromBooleanInterface2.js new file mode 100644 index 0000000000000..cb74309cbc7fc --- /dev/null +++ b/tests/baselines/reference/assignFromBooleanInterface2.js @@ -0,0 +1,34 @@ +//// [assignFromBooleanInterface2.ts] +interface Boolean { + doStuff(): string; +} + +interface NotBoolean { + doStuff(): string; +} + +var x = true; +var a: Boolean; +var b: NotBoolean; + +a = x; +a = b; + +b = a; +b = x; + +x = a; // expected error +x = b; // expected error + + + +//// [assignFromBooleanInterface2.js] +var x = true; +var a; +var b; +a = x; +a = b; +b = a; +b = x; +x = a; +x = b; diff --git a/tests/baselines/reference/assignFromNumberInterface.errors.txt b/tests/baselines/reference/assignFromNumberInterface.errors.txt new file mode 100644 index 0000000000000..845b8cb5b7f55 --- /dev/null +++ b/tests/baselines/reference/assignFromNumberInterface.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts (1 errors) ==== + var x = 1; + var a: Number; + x = a; + ~ +!!! Type 'Number' is not assignable to type 'number'. + a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface.js b/tests/baselines/reference/assignFromNumberInterface.js new file mode 100644 index 0000000000000..aeebc9928f71a --- /dev/null +++ b/tests/baselines/reference/assignFromNumberInterface.js @@ -0,0 +1,11 @@ +//// [assignFromNumberInterface.ts] +var x = 1; +var a: Number; +x = a; +a = x; + +//// [assignFromNumberInterface.js] +var x = 1; +var a; +x = a; +a = x; diff --git a/tests/baselines/reference/assignFromNumberInterface2.errors.txt b/tests/baselines/reference/assignFromNumberInterface2.errors.txt new file mode 100644 index 0000000000000..331232f6cea09 --- /dev/null +++ b/tests/baselines/reference/assignFromNumberInterface2.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts (2 errors) ==== + interface Number { + doStuff(): string; + } + + interface NotNumber { + toString(radix?: number): string; + toFixed(fractionDigits?: number): string; + toExponential(fractionDigits?: number): string; + toPrecision(precision?: number): string; + doStuff(): string; + } + + var x = 1; + var a: Number; + var b: NotNumber; + + a = x; + a = b; + + b = a; + b = x; + + x = a; // expected error + ~ +!!! Type 'Number' is not assignable to type 'number'. + x = b; // expected error + ~ +!!! Type 'NotNumber' is not assignable to type 'number'. + + \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface2.js b/tests/baselines/reference/assignFromNumberInterface2.js new file mode 100644 index 0000000000000..017ef95a626f1 --- /dev/null +++ b/tests/baselines/reference/assignFromNumberInterface2.js @@ -0,0 +1,38 @@ +//// [assignFromNumberInterface2.ts] +interface Number { + doStuff(): string; +} + +interface NotNumber { + toString(radix?: number): string; + toFixed(fractionDigits?: number): string; + toExponential(fractionDigits?: number): string; + toPrecision(precision?: number): string; + doStuff(): string; +} + +var x = 1; +var a: Number; +var b: NotNumber; + +a = x; +a = b; + +b = a; +b = x; + +x = a; // expected error +x = b; // expected error + + + +//// [assignFromNumberInterface2.js] +var x = 1; +var a; +var b; +a = x; +a = b; +b = a; +b = x; +x = a; +x = b; diff --git a/tests/baselines/reference/assignFromStringInterface.errors.txt b/tests/baselines/reference/assignFromStringInterface.errors.txt new file mode 100644 index 0000000000000..ba8c5fd583ca1 --- /dev/null +++ b/tests/baselines/reference/assignFromStringInterface.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts (1 errors) ==== + var x = ''; + var a: String; + x = a; + ~ +!!! Type 'String' is not assignable to type 'string'. + a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface.js b/tests/baselines/reference/assignFromStringInterface.js new file mode 100644 index 0000000000000..82de11dfcc7fd --- /dev/null +++ b/tests/baselines/reference/assignFromStringInterface.js @@ -0,0 +1,11 @@ +//// [assignFromStringInterface.ts] +var x = ''; +var a: String; +x = a; +a = x; + +//// [assignFromStringInterface.js] +var x = ''; +var a; +x = a; +a = x; diff --git a/tests/baselines/reference/assignFromStringInterface2.errors.txt b/tests/baselines/reference/assignFromStringInterface2.errors.txt new file mode 100644 index 0000000000000..6a8f5e5f6f04c --- /dev/null +++ b/tests/baselines/reference/assignFromStringInterface2.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts (2 errors) ==== + interface String { + doStuff(): string; + } + + interface NotString { + doStuff(): string; + toString(): string; + charAt(pos: number): string; + charCodeAt(index: number): number; + concat(...strings: string[]): string; + indexOf(searchString: string, position?: number): number; + lastIndexOf(searchString: string, position?: number): number; + localeCompare(that: string): number; + match(regexp: string): string[]; + match(regexp: RegExp): string[]; + replace(searchValue: string, replaceValue: string): string; + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + replace(searchValue: RegExp, replaceValue: string): string; + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + search(regexp: string): number; + search(regexp: RegExp): number; + slice(start?: number, end?: number): string; + split(separator: string, limit?: number): string[]; + split(separator: RegExp, limit?: number): string[]; + substring(start: number, end?: number): string; + toLowerCase(): string; + toLocaleLowerCase(): string; + toUpperCase(): string; + toLocaleUpperCase(): string; + trim(): string; + length: number; + substr(from: number, length?: number): string; + [index: number]: string; + } + + var x = ''; + var a: String; + var b: NotString; + + a = x; + a = b; + + b = a; + b = x; + + x = a; // expected error + ~ +!!! Type 'String' is not assignable to type 'string'. + x = b; // expected error + ~ +!!! Type 'NotString' is not assignable to type 'string'. + + \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface2.js b/tests/baselines/reference/assignFromStringInterface2.js new file mode 100644 index 0000000000000..f13fd55288b4c --- /dev/null +++ b/tests/baselines/reference/assignFromStringInterface2.js @@ -0,0 +1,61 @@ +//// [assignFromStringInterface2.ts] +interface String { + doStuff(): string; +} + +interface NotString { + doStuff(): string; + toString(): string; + charAt(pos: number): string; + charCodeAt(index: number): number; + concat(...strings: string[]): string; + indexOf(searchString: string, position?: number): number; + lastIndexOf(searchString: string, position?: number): number; + localeCompare(that: string): number; + match(regexp: string): string[]; + match(regexp: RegExp): string[]; + replace(searchValue: string, replaceValue: string): string; + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + replace(searchValue: RegExp, replaceValue: string): string; + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + search(regexp: string): number; + search(regexp: RegExp): number; + slice(start?: number, end?: number): string; + split(separator: string, limit?: number): string[]; + split(separator: RegExp, limit?: number): string[]; + substring(start: number, end?: number): string; + toLowerCase(): string; + toLocaleLowerCase(): string; + toUpperCase(): string; + toLocaleUpperCase(): string; + trim(): string; + length: number; + substr(from: number, length?: number): string; + [index: number]: string; +} + +var x = ''; +var a: String; +var b: NotString; + +a = x; +a = b; + +b = a; +b = x; + +x = a; // expected error +x = b; // expected error + + + +//// [assignFromStringInterface2.js] +var x = ''; +var a; +var b; +a = x; +a = b; +b = a; +b = x; +x = a; +x = b; diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt new file mode 100644 index 0000000000000..ffdffd34a14b3 --- /dev/null +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts (2 errors) ==== + interface IResultCallback extends Function { + x: number; + } + + function fn(cb: IResultCallback) { } + + fn((a, b) => true); + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn(function (a, b) { return true; }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js new file mode 100644 index 0000000000000..dbfd4487ac1c9 --- /dev/null +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js @@ -0,0 +1,18 @@ +//// [assignLambdaToNominalSubtypeOfFunction.ts] +interface IResultCallback extends Function { + x: number; +} + +function fn(cb: IResultCallback) { } + +fn((a, b) => true); +fn(function (a, b) { return true; }) + + +//// [assignLambdaToNominalSubtypeOfFunction.js] +function fn(cb) { +} +fn(function (a, b) { return true; }); +fn(function (a, b) { + return true; +}); diff --git a/tests/baselines/reference/assignToEnum.errors.txt b/tests/baselines/reference/assignToEnum.errors.txt new file mode 100644 index 0000000000000..bc37cc5496db9 --- /dev/null +++ b/tests/baselines/reference/assignToEnum.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/assignToEnum.ts (4 errors) ==== + enum A { foo, bar } + A = undefined; // invalid LHS + ~ +!!! Invalid left-hand side of assignment expression. + A = A.bar; // invalid LHS + ~ +!!! Invalid left-hand side of assignment expression. + A.foo = 1; // invalid LHS + ~~~~~ +!!! Invalid left-hand side of assignment expression. + A.foo = A.bar; // invalid LHS + ~~~~~ +!!! Invalid left-hand side of assignment expression. + + \ No newline at end of file diff --git a/tests/baselines/reference/assignToEnum.js b/tests/baselines/reference/assignToEnum.js new file mode 100644 index 0000000000000..37f98fa4146fb --- /dev/null +++ b/tests/baselines/reference/assignToEnum.js @@ -0,0 +1,19 @@ +//// [assignToEnum.ts] +enum A { foo, bar } +A = undefined; // invalid LHS +A = A.bar; // invalid LHS +A.foo = 1; // invalid LHS +A.foo = A.bar; // invalid LHS + + + +//// [assignToEnum.js] +var A; +(function (A) { + A[A["foo"] = 0] = "foo"; + A[A["bar"] = 1] = "bar"; +})(A || (A = {})); +A = undefined; +A = 1 /* bar */; +0 /* foo */ = 1; +0 /* foo */ = 1 /* bar */; diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt new file mode 100644 index 0000000000000..49feb0a76a0a9 --- /dev/null +++ b/tests/baselines/reference/assignToExistingClass.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/assignToExistingClass.ts (1 errors) ==== + module Test { + class Mocked { + myProp: string; + } + + class Tester { + willThrowError() { + Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + return { myProp: "test" }; + }; + } + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/assignToExistingClass.js b/tests/baselines/reference/assignToExistingClass.js new file mode 100644 index 0000000000000..f12979f314273 --- /dev/null +++ b/tests/baselines/reference/assignToExistingClass.js @@ -0,0 +1,36 @@ +//// [assignToExistingClass.ts] +module Test { + class Mocked { + myProp: string; + } + + class Tester { + willThrowError() { + Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. + return { myProp: "test" }; + }; + } + } + +} + + +//// [assignToExistingClass.js] +var Test; +(function (Test) { + var Mocked = (function () { + function Mocked() { + } + return Mocked; + })(); + var Tester = (function () { + function Tester() { + } + Tester.prototype.willThrowError = function () { + Mocked = Mocked || function () { + return { myProp: "test" }; + }; + }; + return Tester; + })(); +})(Test || (Test = {})); diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt new file mode 100644 index 0000000000000..10af5946425f4 --- /dev/null +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignToFn.ts (1 errors) ==== + module M { + interface I { + f(n:number):boolean; + } + + var x:I={ f:function(n) { return true; } }; + + x.f="hello"; + ~~~ +!!! Type 'string' is not assignable to type '(n: number) => boolean'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/assignToFn.js b/tests/baselines/reference/assignToFn.js new file mode 100644 index 0000000000000..620753e494153 --- /dev/null +++ b/tests/baselines/reference/assignToFn.js @@ -0,0 +1,20 @@ +//// [assignToFn.ts] +module M { + interface I { + f(n:number):boolean; + } + + var x:I={ f:function(n) { return true; } }; + + x.f="hello"; +} + + +//// [assignToFn.js] +var M; +(function (M) { + var x = { f: function (n) { + return true; + } }; + x.f = "hello"; +})(M || (M = {})); diff --git a/tests/baselines/reference/assignToInvalidLHS.errors.txt b/tests/baselines/reference/assignToInvalidLHS.errors.txt new file mode 100644 index 0000000000000..dd183cf6391f5 --- /dev/null +++ b/tests/baselines/reference/assignToInvalidLHS.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/assignToInvalidLHS.ts (1 errors) ==== + declare var y:any; + + // Below is actually valid JavaScript (see http://es5.github.com/#x8.7 ), even though will always fail at runtime with 'invalid left-hand side' + var x = new y = 5; + ~~~~~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignToInvalidLHS.js b/tests/baselines/reference/assignToInvalidLHS.js new file mode 100644 index 0000000000000..9307105cf1059 --- /dev/null +++ b/tests/baselines/reference/assignToInvalidLHS.js @@ -0,0 +1,8 @@ +//// [assignToInvalidLHS.ts] +declare var y:any; + +// Below is actually valid JavaScript (see http://es5.github.com/#x8.7 ), even though will always fail at runtime with 'invalid left-hand side' +var x = new y = 5; + +//// [assignToInvalidLHS.js] +var x = new y = 5; diff --git a/tests/baselines/reference/assignToModule.errors.txt b/tests/baselines/reference/assignToModule.errors.txt new file mode 100644 index 0000000000000..ba284a32fa6c1 --- /dev/null +++ b/tests/baselines/reference/assignToModule.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/assignToModule.ts (1 errors) ==== + module A {} + A = undefined; // invalid LHS + ~ +!!! Cannot find name 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/assignToModule.js b/tests/baselines/reference/assignToModule.js new file mode 100644 index 0000000000000..132a8b9ad9c7b --- /dev/null +++ b/tests/baselines/reference/assignToModule.js @@ -0,0 +1,6 @@ +//// [assignToModule.ts] +module A {} +A = undefined; // invalid LHS + +//// [assignToModule.js] +A = undefined; diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js new file mode 100644 index 0000000000000..487591bc81ed5 --- /dev/null +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js @@ -0,0 +1,13 @@ +//// [assignToObjectTypeWithPrototypeProperty.ts] +class XEvent {} +var p: XEvent = XEvent.prototype; +var x: {prototype: XEvent} = XEvent; + +//// [assignToObjectTypeWithPrototypeProperty.js] +var XEvent = (function () { + function XEvent() { + } + return XEvent; +})(); +var p = XEvent.prototype; +var x = XEvent; diff --git a/tests/baselines/reference/assignToPrototype1.js b/tests/baselines/reference/assignToPrototype1.js new file mode 100644 index 0000000000000..b2d2af37e5296 --- /dev/null +++ b/tests/baselines/reference/assignToPrototype1.js @@ -0,0 +1,11 @@ +//// [assignToPrototype1.ts] +declare class Point { + add(dx: number, dy: number): void; +} + +Point.prototype.add = function(dx, dy) { +}; + +//// [assignToPrototype1.js] +Point.prototype.add = function (dx, dy) { +}; diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt new file mode 100644 index 0000000000000..540bb044f6abf --- /dev/null +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ==== + var x = {one: 1}; + var y: {[index:string]: any}; + + x = y; + ~ +!!! Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': +!!! Property 'one' is missing in type '{ [x: string]: any; }'. + y = x; + ~ +!!! Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': +!!! Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.js b/tests/baselines/reference/assignmentCompat1.js new file mode 100644 index 0000000000000..09546b7165ed3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompat1.js @@ -0,0 +1,12 @@ +//// [assignmentCompat1.ts] +var x = {one: 1}; +var y: {[index:string]: any}; + +x = y; +y = x; + +//// [assignmentCompat1.js] +var x = { one: 1 }; +var y; +x = y; +y = x; diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt new file mode 100644 index 0000000000000..d992072d9d66a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ==== + var b2: { b: number;} = { a: 0 }; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ a: number; }' is not assignable to type '{ b: number; }': +!!! Property 'b' is missing in type '{ a: number; }'. + + b2 = { a: 0 }; // error + ~~ +!!! Type '{ a: number; }' is not assignable to type '{ b: number; }': +!!! Property 'b' is missing in type '{ a: number; }'. + + b2 = {b: 0, a: 0 }; + + var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }; + + b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, + m: 0, + }; // ok + + b3 = { + ~~ +!!! Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. + f: (n) => { return 0; }, + g: (s) => { return 0; }, + }; // error + + b3 = { + ~~ +!!! Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. + f: (n) => { return 0; }, + m: 0, + }; // error + + b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, + m: 0, + n: 0, + k: (a) =>{ return null; }, + }; // ok + + b3 = { + ~~ +!!! Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. + f: (n) => { return 0; }, + g: (s) => { return 0; }, + n: 0, + k: (a) =>{ return null; }, + }; // error \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug2.js b/tests/baselines/reference/assignmentCompatBug2.js new file mode 100644 index 0000000000000..10c2a090ca554 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBug2.js @@ -0,0 +1,93 @@ +//// [assignmentCompatBug2.ts] +var b2: { b: number;} = { a: 0 }; // error + +b2 = { a: 0 }; // error + +b2 = {b: 0, a: 0 }; + +var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }; + +b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, + m: 0, +}; // ok + +b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, +}; // error + +b3 = { + f: (n) => { return 0; }, + m: 0, +}; // error + +b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, + m: 0, + n: 0, + k: (a) =>{ return null; }, +}; // ok + +b3 = { + f: (n) => { return 0; }, + g: (s) => { return 0; }, + n: 0, + k: (a) =>{ return null; }, +}; // error + +//// [assignmentCompatBug2.js] +var b2 = { a: 0 }; +b2 = { a: 0 }; +b2 = { b: 0, a: 0 }; +var b3; +b3 = { + f: function (n) { + return 0; + }, + g: function (s) { + return 0; + }, + m: 0 +}; +b3 = { + f: function (n) { + return 0; + }, + g: function (s) { + return 0; + } +}; +b3 = { + f: function (n) { + return 0; + }, + m: 0 +}; +b3 = { + f: function (n) { + return 0; + }, + g: function (s) { + return 0; + }, + m: 0, + n: 0, + k: function (a) { + return null; + } +}; +b3 = { + f: function (n) { + return 0; + }, + g: function (s) { + return 0; + }, + n: 0, + k: function (a) { + return null; + } +}; diff --git a/tests/baselines/reference/assignmentCompatBug3.errors.txt b/tests/baselines/reference/assignmentCompatBug3.errors.txt new file mode 100644 index 0000000000000..f2cb650567e6f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBug3.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/assignmentCompatBug3.ts (3 errors) ==== + function makePoint(x: number, y: number) { + return { + get x() { return x;}, // shouldn't be "void" + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + get y() { return y;}, // shouldn't be "void" + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + //x: "yo", + //y: "boo", + dist: function () { + return Math.sqrt(x*x+y*y); // shouldn't be picking up "x" and "y" from the object lit + } + } + } + + class C { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 0; + } + } + + function foo(test: string) { } + + var x: any; + var y: any; + + foo(x); + foo(x + y); \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug5.errors.txt b/tests/baselines/reference/assignmentCompatBug5.errors.txt new file mode 100644 index 0000000000000..f2871161da18a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBug5.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/assignmentCompatBug5.ts (4 errors) ==== + function foo1(x: { a: number; }) { } + foo1({ b: 5 }); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo2(x: number[]) { } + foo2(["s", "t"]); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo3(x: (n: number) =>number) { }; + foo3((s:string) => { }); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo3((n) => { return; }); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug5.js b/tests/baselines/reference/assignmentCompatBug5.js new file mode 100644 index 0000000000000..f4ec40dafae35 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatBug5.js @@ -0,0 +1,28 @@ +//// [assignmentCompatBug5.ts] +function foo1(x: { a: number; }) { } +foo1({ b: 5 }); + +function foo2(x: number[]) { } +foo2(["s", "t"]); + +function foo3(x: (n: number) =>number) { }; +foo3((s:string) => { }); +foo3((n) => { return; }); + + + +//// [assignmentCompatBug5.js] +function foo1(x) { +} +foo1({ b: 5 }); +function foo2(x) { +} +foo2(["s", "t"]); +function foo3(x) { +} +; +foo3(function (s) { +}); +foo3(function (n) { + return; +}); diff --git a/tests/baselines/reference/assignmentCompatForEnums.js b/tests/baselines/reference/assignmentCompatForEnums.js new file mode 100644 index 0000000000000..4bca6a514d214 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatForEnums.js @@ -0,0 +1,31 @@ +//// [assignmentCompatForEnums.ts] +enum TokenType { One, Two }; + +var list = {}; + + +function returnType(): TokenType { return null; } + +function foo() { + var x = returnType(); + + var x: TokenType = list['one']; +} + + + +//// [assignmentCompatForEnums.js] +var TokenType; +(function (TokenType) { + TokenType[TokenType["One"] = 0] = "One"; + TokenType[TokenType["Two"] = 1] = "Two"; +})(TokenType || (TokenType = {})); +; +var list = {}; +function returnType() { + return null; +} +function foo() { + var x = returnType(); + var x = list['one']; +} diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt new file mode 100644 index 0000000000000..0b769d4ecf69a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== + function foo(x: { id: number; name?: string; }): void; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + foo({ id: 1234 }); // Ok + foo({ id: 1234, name: "hello" }); // Ok + foo({ id: 1234, name: false }); // Error, name of wrong type + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo({ name: "hello" }); // Error, id required but missing + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js new file mode 100644 index 0000000000000..9fa9ec4c52674 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js @@ -0,0 +1,12 @@ +//// [assignmentCompatFunctionsWithOptionalArgs.ts] +function foo(x: { id: number; name?: string; }): void; +foo({ id: 1234 }); // Ok +foo({ id: 1234, name: "hello" }); // Ok +foo({ id: 1234, name: false }); // Error, name of wrong type +foo({ name: "hello" }); // Error, id required but missing + +//// [assignmentCompatFunctionsWithOptionalArgs.js] +foo({ id: 1234 }); +foo({ id: 1234, name: "hello" }); +foo({ id: 1234, name: false }); +foo({ name: "hello" }); diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt new file mode 100644 index 0000000000000..7588d6e08fae4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/assignmentCompatInterfaceWithStringIndexSignature.ts (1 errors) ==== + interface IHandler { + (e): boolean; + } + + interface IHandlerMap { + [type: string]: IHandler; + } + + class Foo { + public Boz(): void { } + } + + function Biz(map: IHandlerMap) { } + + Biz(new Foo()); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js new file mode 100644 index 0000000000000..2eac9cdb476e0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js @@ -0,0 +1,29 @@ +//// [assignmentCompatInterfaceWithStringIndexSignature.ts] +interface IHandler { + (e): boolean; +} + +interface IHandlerMap { + [type: string]: IHandler; +} + +class Foo { + public Boz(): void { } +} + +function Biz(map: IHandlerMap) { } + +Biz(new Foo()); + + +//// [assignmentCompatInterfaceWithStringIndexSignature.js] +var Foo = (function () { + function Foo() { + } + Foo.prototype.Boz = function () { + }; + return Foo; +})(); +function Biz(map) { +} +Biz(new Foo()); diff --git a/tests/baselines/reference/assignmentCompatOnNew.js b/tests/baselines/reference/assignmentCompatOnNew.js new file mode 100644 index 0000000000000..5829fe9eea6d9 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatOnNew.js @@ -0,0 +1,18 @@ +//// [assignmentCompatOnNew.ts] +class Foo{}; + +function bar(x: {new(): Foo;}){} + +bar(Foo); // Error, but should be allowed + + +//// [assignmentCompatOnNew.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +; +function bar(x) { +} +bar(Foo); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt new file mode 100644 index 0000000000000..ab314d0a95feb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -0,0 +1,76 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts (8 errors) ==== + // void returning call signatures can be assigned a non-void returning call signature that otherwise matches + + interface T { + (x: number): void; + } + var t: T; + var a: { (x: number): void }; + + t = a; + a = t; + + interface S { + (x: number): string; + } + var s: S; + var a2: { (x: number): string }; + t = s; + t = a2; + a = s; + a = a2; + + t = (x: T) => 1; + t = () => 1; + t = function (x: number) { return ''; } + a = (x: T) => 1; + a = () => 1; + a = function (x: number) { return ''; } + + interface S2 { + (x: string): void; + } + var s2: S2; + var a3: { (x: string): void }; + // these are errors + t = s2; + ~ +!!! Type 'S2' is not assignable to type 'T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + t = a3; + ~ +!!! Type '(x: string) => void' is not assignable to type 'T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + t = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type 'T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + t = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type 'T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = s2; + ~ +!!! Type 'S2' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = a3; + ~ +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.js b/tests/baselines/reference/assignmentCompatWithCallSignatures.js new file mode 100644 index 0000000000000..bfee6f14941fd --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.js @@ -0,0 +1,80 @@ +//// [assignmentCompatWithCallSignatures.ts] +// void returning call signatures can be assigned a non-void returning call signature that otherwise matches + +interface T { + (x: number): void; +} +var t: T; +var a: { (x: number): void }; + +t = a; +a = t; + +interface S { + (x: number): string; +} +var s: S; +var a2: { (x: number): string }; +t = s; +t = a2; +a = s; +a = a2; + +t = (x: T) => 1; +t = () => 1; +t = function (x: number) { return ''; } +a = (x: T) => 1; +a = () => 1; +a = function (x: number) { return ''; } + +interface S2 { + (x: string): void; +} +var s2: S2; +var a3: { (x: string): void }; +// these are errors +t = s2; +t = a3; +t = (x: string) => 1; +t = function (x: string) { return ''; } +a = s2; +a = a3; +a = (x: string) => 1; +a = function (x: string) { return ''; } + + +//// [assignmentCompatWithCallSignatures.js] +var t; +var a; +t = a; +a = t; +var s; +var a2; +t = s; +t = a2; +a = s; +a = a2; +t = function (x) { return 1; }; +t = function () { return 1; }; +t = function (x) { + return ''; +}; +a = function (x) { return 1; }; +a = function () { return 1; }; +a = function (x) { + return ''; +}; +var s2; +var a3; +t = s2; +t = a3; +t = function (x) { return 1; }; +t = function (x) { + return ''; +}; +a = s2; +a = a3; +a = function (x) { return 1; }; +a = function (x) { + return ''; +}; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt new file mode 100644 index 0000000000000..2fa4e383e9f17 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -0,0 +1,99 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts (12 errors) ==== + // void returning call signatures can be assigned a non-void returning call signature that otherwise matches + + interface T { + f(x: number): void; + } + var t: T; + var a: { f(x: number): void }; + + t = a; + a = t; + + interface S { + f(x: number): string; + } + var s: S; + var a2: { f(x: number): string }; + t = s; + t = a2; + a = s; + a = a2; + + t = { f: () => 1 }; + t = { f: (x:T) => 1 }; + t = { f: function f() { return 1 } }; + t = { f(x: number) { return ''; } } + a = { f: () => 1 } + a = { f: (x: T) => 1 }; + a = { f: function (x: number) { return ''; } } + + // errors + t = () => 1; + ~ +!!! Type '() => number' is not assignable to type 'T': +!!! Property 'f' is missing in type '() => number'. + t = function (x: number) { return ''; } + ~ +!!! Type '(x: number) => string' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: number) => string'. + a = () => 1; + ~ +!!! Type '() => number' is not assignable to type '{ f(x: number): void; }': +!!! Property 'f' is missing in type '() => number'. + a = function (x: number) { return ''; } + ~ +!!! Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': +!!! Property 'f' is missing in type '(x: number) => string'. + + interface S2 { + f(x: string): void; + } + var s2: S2; + var a3: { f(x: string): void }; + // these are errors + t = s2; + ~ +!!! Type 'S2' is not assignable to type 'T': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + t = a3; + ~ +!!! Type '{ f(x: string): void; }' is not assignable to type 'T': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + t = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: string) => number'. + t = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: string) => string'. + a = s2; + ~ +!!! Type 'S2' is not assignable to type '{ f(x: number): void; }': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = a3; + ~ +!!! Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': +!!! Property 'f' is missing in type '(x: string) => number'. + a = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': +!!! Property 'f' is missing in type '(x: string) => string'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.js b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js new file mode 100644 index 0000000000000..9cc2cebe65037 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js @@ -0,0 +1,98 @@ +//// [assignmentCompatWithCallSignatures2.ts] +// void returning call signatures can be assigned a non-void returning call signature that otherwise matches + +interface T { + f(x: number): void; +} +var t: T; +var a: { f(x: number): void }; + +t = a; +a = t; + +interface S { + f(x: number): string; +} +var s: S; +var a2: { f(x: number): string }; +t = s; +t = a2; +a = s; +a = a2; + +t = { f: () => 1 }; +t = { f: (x:T) => 1 }; +t = { f: function f() { return 1 } }; +t = { f(x: number) { return ''; } } +a = { f: () => 1 } +a = { f: (x: T) => 1 }; +a = { f: function (x: number) { return ''; } } + +// errors +t = () => 1; +t = function (x: number) { return ''; } +a = () => 1; +a = function (x: number) { return ''; } + +interface S2 { + f(x: string): void; +} +var s2: S2; +var a3: { f(x: string): void }; +// these are errors +t = s2; +t = a3; +t = (x: string) => 1; +t = function (x: string) { return ''; } +a = s2; +a = a3; +a = (x: string) => 1; +a = function (x: string) { return ''; } + + +//// [assignmentCompatWithCallSignatures2.js] +var t; +var a; +t = a; +a = t; +var s; +var a2; +t = s; +t = a2; +a = s; +a = a2; +t = { f: function () { return 1; } }; +t = { f: function (x) { return 1; } }; +t = { f: function f() { + return 1; +} }; +t = { f: function f(x) { + return ''; +} }; +a = { f: function () { return 1; } }; +a = { f: function (x) { return 1; } }; +a = { f: function (x) { + return ''; +} }; +t = function () { return 1; }; +t = function (x) { + return ''; +}; +a = function () { return 1; }; +a = function (x) { + return ''; +}; +var s2; +var a3; +t = s2; +t = a3; +t = function (x) { return 1; }; +t = function (x) { + return ''; +}; +a = s2; +a = a3; +a = function (x) { return 1; }; +a = function (x) { + return ''; +}; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js new file mode 100644 index 0000000000000..67779d01fb3b4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -0,0 +1,206 @@ +//// [assignmentCompatWithCallSignatures3.ts] +// these are all permitted with the current rules, since we do not do contextual signature instantiation + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +var a: (x: number) => number[]; +var a2: (x: number) => string[]; +var a3: (x: number) => void; +var a4: (x: string, y: number) => string; +var a5: (x: (arg: string) => number) => string; +var a6: (x: (arg: Base) => Derived) => Base; +var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +var a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +var a10: (...x: Derived[]) => Derived; +var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +var a12: (x: Array, y: Array) => Array; +var a13: (x: Array, y: Array) => Array; +var a14: (x: { a: string; b: number }) => Object; +var a15: { + (x: number): number[]; + (x: string): string[]; +} +var a16: { + (x: T): number[]; + (x: U): number[]; +} +var a17: { + (x: (a: number) => number): number[]; + (x: (a: string) => string): string[]; +}; +var a18: { + (x: { + (a: number): number; + (a: string): string; + }): any[]; + (x: { + (a: boolean): boolean; + (a: Date): Date; + }): any[]; +} + +var b: (x: T) => T[]; +a = b; // ok +b = a; // ok +var b2: (x: T) => string[]; +a2 = b2; // ok +b2 = a2; // ok +var b3: (x: T) => T; +a3 = b3; // ok +b3 = a3; // ok +var b4: (x: T, y: U) => T; +a4 = b4; // ok +b4 = a4; // ok +var b5: (x: (arg: T) => U) => T; +a5 = b5; // ok +b5 = a5; // ok +var b6: (x: (arg: T) => U) => T; +a6 = b6; // ok +b6 = a6; // ok +var b7: (x: (arg: T) => U) => (r: T) => U; +a7 = b7; // ok +b7 = a7; // ok +var b8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +a8 = b8; // ok +b8 = a8; // ok +var b9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +a9 = b9; // ok +b9 = a9; // ok +var b10: (...x: T[]) => T; +a10 = b10; // ok +b10 = a10; // ok +var b11: (x: T, y: T) => T; +a11 = b11; // ok +b11 = a11; // ok +var b12: >(x: Array, y: T) => Array; +a12 = b12; // ok +b12 = a12; // ok +var b13: >(x: Array, y: T) => T; +a13 = b13; // ok +b13 = a13; // ok +var b14: (x: { a: T; b: T }) => T; +a14 = b14; // ok +b14 = a14; // ok +var b15: (x: T) => T[]; +a15 = b15; // ok +b15 = a15; // ok +var b16: (x: T) => number[]; +a16 = b16; // ok +b16 = a16; // ok +var b17: (x: (a: T) => T) => T[]; // ok +a17 = b17; // ok +b17 = a17; // ok +var b18: (x: (a: T) => T) => T[]; +a18 = b18; // ok +b18 = a18; // ok + + +//// [assignmentCompatWithCallSignatures3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var a; +var a2; +var a3; +var a4; +var a5; +var a6; +var a7; +var a8; +var a9; +var a10; +var a11; +var a12; +var a13; +var a14; +var a15; +var a16; +var a17; +var a18; +var b; +a = b; +b = a; +var b2; +a2 = b2; +b2 = a2; +var b3; +a3 = b3; +b3 = a3; +var b4; +a4 = b4; +b4 = a4; +var b5; +a5 = b5; +b5 = a5; +var b6; +a6 = b6; +b6 = a6; +var b7; +a7 = b7; +b7 = a7; +var b8; +a8 = b8; +b8 = a8; +var b9; +a9 = b9; +b9 = a9; +var b10; +a10 = b10; +b10 = a10; +var b11; +a11 = b11; +b11 = a11; +var b12; +a12 = b12; +b12 = a12; +var b13; +a13 = b13; +b13 = a13; +var b14; +a14 = b14; +b14 = a14; +var b15; +a15 = b15; +b15 = a15; +var b16; +a16 = b16; +b16 = a16; +var b17; +a17 = b17; +b17 = a17; +var b18; +a18 = b18; +b18 = a18; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt new file mode 100644 index 0000000000000..973dfe92ca23b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -0,0 +1,115 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== + // These are mostly permitted with the current loose rules. All ok unless otherwise noted. + + module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // target type with non-generic call signatures + var a2: (x: number) => string[]; + var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2; + var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + var a10: (...x: Base[]) => Base; + var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + var a12: (x: Array, y: Array) => Array; + var a14: { + (x: number): number[]; + (x: string): string[]; + }; + var a15: (x: { a: string; b: number }) => number; + var a16: { + (x: { + (a: number): number; + (a?: number): number; + }): number[]; + (x: { + (a: boolean): boolean; + (a?: boolean): boolean; + }): boolean[]; + }; + var a17: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; + + var b2: (x: T) => U[]; + a2 = b2; + b2 = a2; + + var b7: (x: (arg: T) => U) => (r: T) => V; + a7 = b7; + b7 = a7; + + var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; + a8 = b8; // error, { foo: number } and Base are incompatible + ~~ +!!! Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type '{ foo: number; }' is not assignable to type 'Base': +!!! Types of property 'foo' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + b8 = a8; // error, { foo: number } and Base are incompatible + ~~ +!!! Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type 'Base' is not assignable to type '{ foo: number; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + + var b10: (...x: T[]) => T; + a10 = b10; + b10 = a10; + + var b11: (x: T, y: T) => T; + a11 = b11; + b11 = a11; + + var b12: >(x: Array, y: Array) => T; + a12 = b12; + b12 = a12; + + var b15: (x: { a: T; b: T }) => T; + a15 = b15; + b15 = a15; + + var b15a: (x: { a: T; b: T }) => number; + a15 = b15a; + b15a = a15; + + var b16: (x: (a: T) => T) => T[]; + a16 = b16; + b16 = a16; + + var b17: (x: (a: T) => T) => any[]; + a17 = b17; + b17 = a17; + } + + module WithGenericSignaturesInBaseType { + // target type has generic call signature + var a2: (x: T) => T[]; + var b2: (x: T) => string[]; + a2 = b2; + b2 = a2; + + // target type has generic call signature + var a3: (x: T) => string[]; + var b3: (x: T) => T[]; + a3 = b3; + b3 = a3; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js new file mode 100644 index 0000000000000..a52e6e13137a6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -0,0 +1,190 @@ +//// [assignmentCompatWithCallSignatures4.ts] +// These are mostly permitted with the current loose rules. All ok unless otherwise noted. + +module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // target type with non-generic call signatures + var a2: (x: number) => string[]; + var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2; + var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + var a10: (...x: Base[]) => Base; + var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + var a12: (x: Array, y: Array) => Array; + var a14: { + (x: number): number[]; + (x: string): string[]; + }; + var a15: (x: { a: string; b: number }) => number; + var a16: { + (x: { + (a: number): number; + (a?: number): number; + }): number[]; + (x: { + (a: boolean): boolean; + (a?: boolean): boolean; + }): boolean[]; + }; + var a17: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; + + var b2: (x: T) => U[]; + a2 = b2; + b2 = a2; + + var b7: (x: (arg: T) => U) => (r: T) => V; + a7 = b7; + b7 = a7; + + var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; + a8 = b8; // error, { foo: number } and Base are incompatible + b8 = a8; // error, { foo: number } and Base are incompatible + + + var b10: (...x: T[]) => T; + a10 = b10; + b10 = a10; + + var b11: (x: T, y: T) => T; + a11 = b11; + b11 = a11; + + var b12: >(x: Array, y: Array) => T; + a12 = b12; + b12 = a12; + + var b15: (x: { a: T; b: T }) => T; + a15 = b15; + b15 = a15; + + var b15a: (x: { a: T; b: T }) => number; + a15 = b15a; + b15a = a15; + + var b16: (x: (a: T) => T) => T[]; + a16 = b16; + b16 = a16; + + var b17: (x: (a: T) => T) => any[]; + a17 = b17; + b17 = a17; + } + + module WithGenericSignaturesInBaseType { + // target type has generic call signature + var a2: (x: T) => T[]; + var b2: (x: T) => string[]; + a2 = b2; + b2 = a2; + + // target type has generic call signature + var a3: (x: T) => string[]; + var b3: (x: T) => T[]; + a3 = b3; + b3 = a3; + } +} + +//// [assignmentCompatWithCallSignatures4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Errors; +(function (Errors) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Derived); + var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; + })(Base); + var WithNonGenericSignaturesInBaseType; + (function (WithNonGenericSignaturesInBaseType) { + var a2; + var a7; + var a8; + var a10; + var a11; + var a12; + var a14; + var a15; + var a16; + var a17; + var b2; + a2 = b2; + b2 = a2; + var b7; + a7 = b7; + b7 = a7; + var b8; + a8 = b8; + b8 = a8; + var b10; + a10 = b10; + b10 = a10; + var b11; + a11 = b11; + b11 = a11; + var b12; + a12 = b12; + b12 = a12; + var b15; + a15 = b15; + b15 = a15; + var b15a; + a15 = b15a; + b15a = a15; + var b16; + a16 = b16; + b16 = a16; + var b17; + a17 = b17; + b17 = a17; + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); + var WithGenericSignaturesInBaseType; + (function (WithGenericSignaturesInBaseType) { + var a2; + var b2; + a2 = b2; + b2 = a2; + var a3; + var b3; + a3 = b3; + b3 = a3; + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js new file mode 100644 index 0000000000000..e86614a4c589e --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -0,0 +1,144 @@ +//// [assignmentCompatWithCallSignatures5.ts] +// checking assignment compat for function types. No errors in this file + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +var a: (x: T) => T[]; +var a2: (x: T) => string[]; +var a3: (x: T) => void; +var a4: (x: T, y: U) => string; +var a5: (x: (arg: T) => U) => T; +var a6: (x: (arg: T) => Derived) => T; +var a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +var a15: (x: { a: T; b: T }) => T[]; +var a16: (x: { a: T; b: T }) => T[]; +var a17: { + (x: (a: T) => T): T[]; + (x: (a: T) => T): T[]; +}; +var a18: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; +}; + +var b: (x: T) => T[]; +a = b; // ok +b = a; // ok +var b2: (x: T) => string[]; +a2 = b2; // ok +b2 = a2; // ok +var b3: (x: T) => T; +a3 = b3; // ok +b3 = a3; // ok +var b4: (x: T, y: U) => string; +a4 = b4; // ok +b4 = a4; // ok +var b5: (x: (arg: T) => U) => T; +a5 = b5; // ok +b5 = a5; // ok +var b6: (x: (arg: T) => U) => T; +a6 = b6; // ok +b6 = a6; // ok +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +a11 = b11; // ok +b11 = a11; // ok +var b15: (x: { a: U; b: V; }) => U[]; +a15 = b15; // ok, T = U, T = V +b15 = a15; // ok +var b16: (x: { a: T; b: T }) => T[]; +a15 = b16; // ok +b15 = a16; // ok +var b17: (x: (a: T) => T) => T[]; +a17 = b17; // ok +b17 = a17; // ok +var b18: (x: (a: T) => T) => any[]; +a18 = b18; // ok +b18 = a18; // ok + + +//// [assignmentCompatWithCallSignatures5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var a; +var a2; +var a3; +var a4; +var a5; +var a6; +var a11; +var a15; +var a16; +var a17; +var a18; +var b; +a = b; +b = a; +var b2; +a2 = b2; +b2 = a2; +var b3; +a3 = b3; +b3 = a3; +var b4; +a4 = b4; +b4 = a4; +var b5; +a5 = b5; +b5 = a5; +var b6; +a6 = b6; +b6 = a6; +var b11; +a11 = b11; +b11 = a11; +var b15; +a15 = b15; +b15 = a15; +var b16; +a15 = b16; +b15 = a16; +var b17; +a17 = b17; +b17 = a17; +var b18; +a18 = b18; +b18 = a18; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js new file mode 100644 index 0000000000000..e2c099f1e7b16 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -0,0 +1,99 @@ +//// [assignmentCompatWithCallSignatures6.ts] +// checking assignment compatibility relations for function types. All valid + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { + a: (x: T) => T[]; + a2: (x: T) => string[]; + a3: (x: T) => void; + a4: (x: T, y: U) => string; + a5: (x: (arg: T) => U) => T; + a6: (x: (arg: T) => Derived) => T; + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: (x: { a: T; b: T }) => T[]; + a16: (x: { a: T; b: T }) => T[]; +} + +var x: A; + +var b: (x: T) => T[]; +x.a = b; +b = x.a; +var b2: (x: T) => string[]; +x.a2 = b2; +b2 = x.a2; +var b3: (x: T) => T; +x.a3 = b3; +b3 = x.a3; +var b4: (x: T, y: U) => string; +x.a4 = b4; +b4 = x.a4; +var b5: (x: (arg: T) => U) => T; +x.a5 = b5; +b5 = x.a5; +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +x.a11 = b11; +b11 = x.a11; +var b16: (x: { a: T; b: T }) => T[]; +x.a16 = b16; +b16 = x.a16; + +//// [assignmentCompatWithCallSignatures6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var x; +var b; +x.a = b; +b = x.a; +var b2; +x.a2 = b2; +b2 = x.a2; +var b3; +x.a3 = b3; +b3 = x.a3; +var b4; +x.a4 = b4; +b4 = x.a4; +var b5; +x.a5 = b5; +b5 = x.a5; +var b11; +x.a11 = b11; +b11 = x.a11; +var b16; +x.a16 = b16; +b16 = x.a16; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt new file mode 100644 index 0000000000000..125def7dc62b5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -0,0 +1,84 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== + // call signatures in derived types must have the same or fewer optional parameters as the base type + + interface Base { + a: () => number; + a2: (x?: number) => number; + a3: (x: number) => number; + a4: (x: number, y?: number) => number; + a5: (x?: number, y?: number) => number; + a6: (x: number, y: number) => number; + } + var b: Base; + + var a: () => number; + a = () => 1 // ok, same number of required params + a = (x?: number) => 1; // ok, same number of required params + a = (x: number) => 1; // error, too many required params + ~ +!!! Type '(x: number) => number' is not assignable to type '() => number'. + a = b.a; // ok + a = b.a2; // ok + a = b.a3; // error + ~ +!!! Type '(x: number) => number' is not assignable to type '() => number'. + a = b.a4; // error + ~ +!!! Type '(x: number, y?: number) => number' is not assignable to type '() => number'. + a = b.a5; // ok + a = b.a6; // error + ~ +!!! Type '(x: number, y: number) => number' is not assignable to type '() => number'. + + var a2: (x?: number) => number; + a2 = () => 1; // ok, same number of required params + a2 = (x?: number) => 1; // ok, same number of required params + a2 = (x: number) => 1; // ok, same number of params + a2 = b.a; // ok + a2 = b.a2; // ok + a2 = b.a3; // ok, same number of params + a2 = b.a4; // ok, excess params are optional in b.a3 + a2 = b.a5; // ok + a2 = b.a6; // error + ~~ +!!! Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. + + var a3: (x: number) => number; + a3 = () => 1; // ok, fewer required params + a3 = (x?: number) => 1; // ok, fewer required params + a3 = (x: number) => 1; // ok, same number of required params + a3 = (x: number, y: number) => 1; // error, too many required params + ~~ +!!! Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + a3 = b.a; // ok + a3 = b.a2; // ok + a3 = b.a3; // ok + a3 = b.a4; // ok + a3 = b.a5; // ok + a3 = b.a6; // error + ~~ +!!! Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. + + var a4: (x: number, y?: number) => number; + a4 = () => 1; // ok, fewer required params + a4 = (x?: number, y?: number) => 1; // ok, fewer required params + a4 = (x: number) => 1; // ok, same number of required params + a4 = (x: number, y: number) => 1; // ok, same number of params + a4 = b.a; // ok + a4 = b.a2; // ok + a4 = b.a3; // ok + a4 = b.a4; // ok + a4 = b.a5; // ok + a4 = b.a6; // ok, same number of params + + var a5: (x?: number, y?: number) => number; + a5 = () => 1; // ok, fewer required params + a5 = (x?: number, y?: number) => 1; // ok, fewer required params + a5 = (x: number) => 1; // ok, fewer params in lambda + a5 = (x: number, y: number) => 1; // ok, same number of params + a5 = b.a; // ok + a5 = b.a2; // ok + a5 = b.a3; // ok, fewer params in b.a3 + a5 = b.a4; // ok, same number of params + a5 = b.a5; // ok + a5 = b.a6; // ok, same number of params \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js new file mode 100644 index 0000000000000..da0bb3bac2268 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js @@ -0,0 +1,126 @@ +//// [assignmentCompatWithCallSignaturesWithOptionalParameters.ts] +// call signatures in derived types must have the same or fewer optional parameters as the base type + +interface Base { + a: () => number; + a2: (x?: number) => number; + a3: (x: number) => number; + a4: (x: number, y?: number) => number; + a5: (x?: number, y?: number) => number; + a6: (x: number, y: number) => number; +} +var b: Base; + +var a: () => number; + a = () => 1 // ok, same number of required params + a = (x?: number) => 1; // ok, same number of required params + a = (x: number) => 1; // error, too many required params + a = b.a; // ok + a = b.a2; // ok + a = b.a3; // error + a = b.a4; // error + a = b.a5; // ok + a = b.a6; // error + +var a2: (x?: number) => number; + a2 = () => 1; // ok, same number of required params + a2 = (x?: number) => 1; // ok, same number of required params + a2 = (x: number) => 1; // ok, same number of params + a2 = b.a; // ok + a2 = b.a2; // ok + a2 = b.a3; // ok, same number of params + a2 = b.a4; // ok, excess params are optional in b.a3 + a2 = b.a5; // ok + a2 = b.a6; // error + +var a3: (x: number) => number; + a3 = () => 1; // ok, fewer required params + a3 = (x?: number) => 1; // ok, fewer required params + a3 = (x: number) => 1; // ok, same number of required params + a3 = (x: number, y: number) => 1; // error, too many required params + a3 = b.a; // ok + a3 = b.a2; // ok + a3 = b.a3; // ok + a3 = b.a4; // ok + a3 = b.a5; // ok + a3 = b.a6; // error + +var a4: (x: number, y?: number) => number; + a4 = () => 1; // ok, fewer required params + a4 = (x?: number, y?: number) => 1; // ok, fewer required params + a4 = (x: number) => 1; // ok, same number of required params + a4 = (x: number, y: number) => 1; // ok, same number of params + a4 = b.a; // ok + a4 = b.a2; // ok + a4 = b.a3; // ok + a4 = b.a4; // ok + a4 = b.a5; // ok + a4 = b.a6; // ok, same number of params + +var a5: (x?: number, y?: number) => number; + a5 = () => 1; // ok, fewer required params + a5 = (x?: number, y?: number) => 1; // ok, fewer required params + a5 = (x: number) => 1; // ok, fewer params in lambda + a5 = (x: number, y: number) => 1; // ok, same number of params + a5 = b.a; // ok + a5 = b.a2; // ok + a5 = b.a3; // ok, fewer params in b.a3 + a5 = b.a4; // ok, same number of params + a5 = b.a5; // ok + a5 = b.a6; // ok, same number of params + +//// [assignmentCompatWithCallSignaturesWithOptionalParameters.js] +var b; +var a; +a = function () { return 1; }; +a = function (x) { return 1; }; +a = function (x) { return 1; }; +a = b.a; +a = b.a2; +a = b.a3; +a = b.a4; +a = b.a5; +a = b.a6; +var a2; +a2 = function () { return 1; }; +a2 = function (x) { return 1; }; +a2 = function (x) { return 1; }; +a2 = b.a; +a2 = b.a2; +a2 = b.a3; +a2 = b.a4; +a2 = b.a5; +a2 = b.a6; +var a3; +a3 = function () { return 1; }; +a3 = function (x) { return 1; }; +a3 = function (x) { return 1; }; +a3 = function (x, y) { return 1; }; +a3 = b.a; +a3 = b.a2; +a3 = b.a3; +a3 = b.a4; +a3 = b.a5; +a3 = b.a6; +var a4; +a4 = function () { return 1; }; +a4 = function (x, y) { return 1; }; +a4 = function (x) { return 1; }; +a4 = function (x, y) { return 1; }; +a4 = b.a; +a4 = b.a2; +a4 = b.a3; +a4 = b.a4; +a4 = b.a5; +a4 = b.a6; +var a5; +a5 = function () { return 1; }; +a5 = function (x, y) { return 1; }; +a5 = function (x) { return 1; }; +a5 = function (x, y) { return 1; }; +a5 = b.a; +a5 = b.a2; +a5 = b.a3; +a5 = b.a4; +a5 = b.a5; +a5 = b.a6; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt new file mode 100644 index 0000000000000..7bee15e16b7d7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -0,0 +1,82 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts (9 errors) ==== + // call signatures in derived types must have the same or fewer optional parameters as the target for assignment + + interface Base { + a: (...args: number[]) => number; + a2: (x: number, ...z: number[]) => number; + a3: (x: number, y?: string, ...z: number[]) => number; + a4: (x?: number, y?: string, ...z: number[]) => number; + } + + var a: (...args: number[]) => number; // ok, same number of required params + a = () => 1; // ok, same number of required params + a = (...args: number[]) => 1; // ok, same number of required params + a = (...args: string[]) => 1; // error, type mismatch + ~ +!!! Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': +!!! Types of parameters 'args' and 'args' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a = (x?: number) => 1; // ok, same number of required params + a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params + a = (x: number) => 1; // ok, rest param corresponds to infinite number of params + a = (x?: string) => 1; // error, incompatible type + ~ +!!! Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': +!!! Types of parameters 'x' and 'args' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + + var a2: (x: number, ...z: number[]) => number; + a2 = () => 1; // ok, fewer required params + a2 = (...args: number[]) => 1; // ok, fewer required params + a2 = (x?: number) => 1; // ok, fewer required params + a2 = (x: number) => 1; // ok, same number of required params + a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params + a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error + ~~ +!!! Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': +!!! Types of parameters 'args' and 'z' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params + a2 = (x: number, y?: number) => 1; // ok, same number of required params + + var a3: (x: number, y?: string, ...z: number[]) => number; + a3 = () => 1; // ok, fewer required params + a3 = (x?: number) => 1; // ok, fewer required params + a3 = (x: number) => 1; // ok, same number of required params + a3 = (x: number, y: string) => 1; // ok, all present params match + a3 = (x: number, y?: number, z?: number) => 1; // error + ~~ +!!! Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a3 = (x: number, ...z: number[]) => 1; // error + ~~ +!!! Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'z' and 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a3 = (x: string, y?: string, z?: string) => 1; // error + ~~ +!!! Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + var a4: (x?: number, y?: string, ...z: number[]) => number; + a4 = () => 1; // ok, fewer required params + a4 = (x?: number, y?: number) => 1; // error, type mismatch + ~~ +!!! Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a4 = (x: number) => 1; // ok, all present params match + a4 = (x: number, y?: number) => 1; // error, second param has type mismatch + ~~ +!!! Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types + a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch + ~~ +!!! Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': +!!! Types of parameters 'args' and 'z' are incompatible: +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js new file mode 100644 index 0000000000000..25bc22acb645d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js @@ -0,0 +1,122 @@ +//// [assignmentCompatWithCallSignaturesWithRestParameters.ts] +// call signatures in derived types must have the same or fewer optional parameters as the target for assignment + +interface Base { + a: (...args: number[]) => number; + a2: (x: number, ...z: number[]) => number; + a3: (x: number, y?: string, ...z: number[]) => number; + a4: (x?: number, y?: string, ...z: number[]) => number; +} + +var a: (...args: number[]) => number; // ok, same number of required params + a = () => 1; // ok, same number of required params + a = (...args: number[]) => 1; // ok, same number of required params + a = (...args: string[]) => 1; // error, type mismatch + a = (x?: number) => 1; // ok, same number of required params + a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params + a = (x: number) => 1; // ok, rest param corresponds to infinite number of params + a = (x?: string) => 1; // error, incompatible type + + +var a2: (x: number, ...z: number[]) => number; + a2 = () => 1; // ok, fewer required params + a2 = (...args: number[]) => 1; // ok, fewer required params + a2 = (x?: number) => 1; // ok, fewer required params + a2 = (x: number) => 1; // ok, same number of required params + a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params + a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error + a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params + a2 = (x: number, y?: number) => 1; // ok, same number of required params + +var a3: (x: number, y?: string, ...z: number[]) => number; + a3 = () => 1; // ok, fewer required params + a3 = (x?: number) => 1; // ok, fewer required params + a3 = (x: number) => 1; // ok, same number of required params + a3 = (x: number, y: string) => 1; // ok, all present params match + a3 = (x: number, y?: number, z?: number) => 1; // error + a3 = (x: number, ...z: number[]) => 1; // error + a3 = (x: string, y?: string, z?: string) => 1; // error + +var a4: (x?: number, y?: string, ...z: number[]) => number; + a4 = () => 1; // ok, fewer required params + a4 = (x?: number, y?: number) => 1; // error, type mismatch + a4 = (x: number) => 1; // ok, all present params match + a4 = (x: number, y?: number) => 1; // error, second param has type mismatch + a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types + a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch + +//// [assignmentCompatWithCallSignaturesWithRestParameters.js] +var a; +a = function () { return 1; }; +a = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return 1; +}; +a = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return 1; +}; +a = function (x) { return 1; }; +a = function (x, y, z) { return 1; }; +a = function (x) { return 1; }; +a = function (x) { return 1; }; +var a2; +a2 = function () { return 1; }; +a2 = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return 1; +}; +a2 = function (x) { return 1; }; +a2 = function (x) { return 1; }; +a2 = function (x) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return 1; +}; +a2 = function (x) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return 1; +}; +a2 = function (x, y) { return 1; }; +a2 = function (x, y) { return 1; }; +var a3; +a3 = function () { return 1; }; +a3 = function (x) { return 1; }; +a3 = function (x) { return 1; }; +a3 = function (x, y) { return 1; }; +a3 = function (x, y, z) { return 1; }; +a3 = function (x) { + var z = []; + for (var _i = 1; _i < arguments.length; _i++) { + z[_i - 1] = arguments[_i]; + } + return 1; +}; +a3 = function (x, y, z) { return 1; }; +var a4; +a4 = function () { return 1; }; +a4 = function (x, y) { return 1; }; +a4 = function (x) { return 1; }; +a4 = function (x, y) { return 1; }; +a4 = function (x, y) { return 1; }; +a4 = function (x) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return 1; +}; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt new file mode 100644 index 0000000000000..46c7804b14496 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ==== + // void returning call signatures can be assigned a non-void returning call signature that otherwise matches + + interface T { + new (x: number): void; + } + var t: T; + var a: { new (x: number): void }; + + t = a; + a = t; + + interface S { + new (x: number): string; + } + var s: S; + var a2: { new (x: number): string }; + t = s; + t = a2; + a = s; + a = a2; + + interface S2 { + (x: string): void; + } + var s2: S2; + var a3: { (x: string): void }; + // these are errors + t = s2; + ~ +!!! Type 'S2' is not assignable to type 'T'. + t = a3; + ~ +!!! Type '(x: string) => void' is not assignable to type 'T'. + t = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type 'T'. + t = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type 'T'. + a = s2; + ~ +!!! Type 'S2' is not assignable to type 'new (x: number) => void'. + a = a3; + ~ +!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + a = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. + a = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js new file mode 100644 index 0000000000000..7c08c37ed9c92 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js @@ -0,0 +1,63 @@ +//// [assignmentCompatWithConstructSignatures.ts] +// void returning call signatures can be assigned a non-void returning call signature that otherwise matches + +interface T { + new (x: number): void; +} +var t: T; +var a: { new (x: number): void }; + +t = a; +a = t; + +interface S { + new (x: number): string; +} +var s: S; +var a2: { new (x: number): string }; +t = s; +t = a2; +a = s; +a = a2; + +interface S2 { + (x: string): void; +} +var s2: S2; +var a3: { (x: string): void }; +// these are errors +t = s2; +t = a3; +t = (x: string) => 1; +t = function (x: string) { return ''; } +a = s2; +a = a3; +a = (x: string) => 1; +a = function (x: string) { return ''; } + + +//// [assignmentCompatWithConstructSignatures.js] +var t; +var a; +t = a; +a = t; +var s; +var a2; +t = s; +t = a2; +a = s; +a = a2; +var s2; +var a3; +t = s2; +t = a3; +t = function (x) { return 1; }; +t = function (x) { + return ''; +}; +a = s2; +a = a3; +a = function (x) { return 1; }; +a = function (x) { + return ''; +}; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt new file mode 100644 index 0000000000000..703bf50d2947e --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts (12 errors) ==== + // void returning call signatures can be assigned a non-void returning call signature that otherwise matches + + interface T { + f: new (x: number) => void; + } + var t: T; + var a: { f: new (x: number) => void }; + + t = a; + a = t; + + interface S { + f: new (x: number) => string; + } + var s: S; + var a2: { f: new (x: number) => string }; + t = s; + t = a2; + a = s; + a = a2; + + // errors + t = () => 1; + ~ +!!! Type '() => number' is not assignable to type 'T': +!!! Property 'f' is missing in type '() => number'. + t = function (x: number) { return ''; } + ~ +!!! Type '(x: number) => string' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: number) => string'. + a = () => 1; + ~ +!!! Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': +!!! Property 'f' is missing in type '() => number'. + a = function (x: number) { return ''; } + ~ +!!! Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': +!!! Property 'f' is missing in type '(x: number) => string'. + + interface S2 { + f(x: string): void; + } + var s2: S2; + var a3: { f(x: string): void }; + // these are errors + t = s2; + ~ +!!! Type 'S2' is not assignable to type 'T': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + t = a3; + ~ +!!! Type '{ f(x: string): void; }' is not assignable to type 'T': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + t = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: string) => number'. + t = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type 'T': +!!! Property 'f' is missing in type '(x: string) => string'. + a = s2; + ~ +!!! Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + a = a3; + ~ +!!! Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': +!!! Types of property 'f' are incompatible: +!!! Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. + a = (x: string) => 1; + ~ +!!! Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': +!!! Property 'f' is missing in type '(x: string) => number'. + a = function (x: string) { return ''; } + ~ +!!! Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': +!!! Property 'f' is missing in type '(x: string) => string'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js new file mode 100644 index 0000000000000..5e525b92299ec --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js @@ -0,0 +1,77 @@ +//// [assignmentCompatWithConstructSignatures2.ts] +// void returning call signatures can be assigned a non-void returning call signature that otherwise matches + +interface T { + f: new (x: number) => void; +} +var t: T; +var a: { f: new (x: number) => void }; + +t = a; +a = t; + +interface S { + f: new (x: number) => string; +} +var s: S; +var a2: { f: new (x: number) => string }; +t = s; +t = a2; +a = s; +a = a2; + +// errors +t = () => 1; +t = function (x: number) { return ''; } +a = () => 1; +a = function (x: number) { return ''; } + +interface S2 { + f(x: string): void; +} +var s2: S2; +var a3: { f(x: string): void }; +// these are errors +t = s2; +t = a3; +t = (x: string) => 1; +t = function (x: string) { return ''; } +a = s2; +a = a3; +a = (x: string) => 1; +a = function (x: string) { return ''; } + + +//// [assignmentCompatWithConstructSignatures2.js] +var t; +var a; +t = a; +a = t; +var s; +var a2; +t = s; +t = a2; +a = s; +a = a2; +t = function () { return 1; }; +t = function (x) { + return ''; +}; +a = function () { return 1; }; +a = function (x) { + return ''; +}; +var s2; +var a3; +t = s2; +t = a3; +t = function (x) { return 1; }; +t = function (x) { + return ''; +}; +a = s2; +a = a3; +a = function (x) { return 1; }; +a = function (x) { + return ''; +}; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js new file mode 100644 index 0000000000000..73f59ee4c86d1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -0,0 +1,206 @@ +//// [assignmentCompatWithConstructSignatures3.ts] +// checking assignment compatibility relations for function types. All of these are valid. + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +var a: new (x: number) => number[]; +var a2: new (x: number) => string[]; +var a3: new (x: number) => void; +var a4: new (x: string, y: number) => string; +var a5: new (x: (arg: string) => number) => string; +var a6: new (x: (arg: Base) => Derived) => Base; +var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +var a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +var a10: new (...x: Derived[]) => Derived; +var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +var a12: new (x: Array, y: Array) => Array; +var a13: new (x: Array, y: Array) => Array; +var a14: new (x: { a: string; b: number }) => Object; +var a15: { + new (x: number): number[]; + new (x: string): string[]; +} +var a16: { + new (x: T): number[]; + new (x: U): number[]; +} +var a17: { + new (x: new (a: number) => number): number[]; + new (x: new (a: string) => string): string[]; +}; +var a18: { + new (x: { + new (a: number): number; + new (a: string): string; + }): any[]; + new (x: { + new (a: boolean): boolean; + new (a: Date): Date; + }): any[]; +} + +var b: new (x: T) => T[]; +a = b; // ok +b = a; // ok +var b2: new (x: T) => string[]; +a2 = b2; // ok +b2 = a2; // ok +var b3: new (x: T) => T; +a3 = b3; // ok +b3 = a3; // ok +var b4: new (x: T, y: U) => T; +a4 = b4; // ok +b4 = a4; // ok +var b5: new (x: (arg: T) => U) => T; +a5 = b5; // ok +b5 = a5; // ok +var b6: new (x: (arg: T) => U) => T; +a6 = b6; // ok +b6 = a6; // ok +var b7: new (x: (arg: T) => U) => (r: T) => U; +a7 = b7; // ok +b7 = a7; // ok +var b8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +a8 = b8; // ok +b8 = a8; // ok +var b9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +a9 = b9; // ok +b9 = a9; // ok +var b10: new (...x: T[]) => T; +a10 = b10; // ok +b10 = a10; // ok +var b11: new (x: T, y: T) => T; +a11 = b11; // ok +b11 = a11; // ok +var b12: new >(x: Array, y: T) => Array; +a12 = b12; // ok +b12 = a12; // ok +var b13: new >(x: Array, y: T) => T; +a13 = b13; // ok +b13 = a13; // ok +var b14: new (x: { a: T; b: T }) => T; +a14 = b14; // ok +b14 = a14; // ok +var b15: new (x: T) => T[]; +a15 = b15; // ok +b15 = a15; // ok +var b16: new (x: T) => number[]; +a16 = b16; // ok +b16 = a16; // ok +var b17: new (x: new (a: T) => T) => T[]; // ok +a17 = b17; // ok +b17 = a17; // ok +var b18: new (x: new (a: T) => T) => T[]; +a18 = b18; // ok +b18 = a18; // ok + + +//// [assignmentCompatWithConstructSignatures3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var a; +var a2; +var a3; +var a4; +var a5; +var a6; +var a7; +var a8; +var a9; +var a10; +var a11; +var a12; +var a13; +var a14; +var a15; +var a16; +var a17; +var a18; +var b; +a = b; +b = a; +var b2; +a2 = b2; +b2 = a2; +var b3; +a3 = b3; +b3 = a3; +var b4; +a4 = b4; +b4 = a4; +var b5; +a5 = b5; +b5 = a5; +var b6; +a6 = b6; +b6 = a6; +var b7; +a7 = b7; +b7 = a7; +var b8; +a8 = b8; +b8 = a8; +var b9; +a9 = b9; +b9 = a9; +var b10; +a10 = b10; +b10 = a10; +var b11; +a11 = b11; +b11 = a11; +var b12; +a12 = b12; +b12 = a12; +var b13; +a13 = b13; +b13 = a13; +var b14; +a14 = b14; +b14 = a14; +var b15; +a15 = b15; +b15 = a15; +var b16; +a16 = b16; +b16 = a16; +var b17; +a17 = b17; +b17 = a17; +var b18; +a18 = b18; +b18 = a18; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt new file mode 100644 index 0000000000000..c5055b16e897c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -0,0 +1,131 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ==== + // checking assignment compatibility relations for function types. + + module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // target type with non-generic call signatures + var a2: new (x: number) => string[]; + var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2; + var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + var a10: new (...x: Base[]) => Base; + var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + var a12: new (x: Array, y: Array) => Array; + var a14: { + new (x: number): number[]; + new (x: string): string[]; + }; + var a15: new (x: { a: string; b: number }) => number; + var a16: { + new (x: { + new (a: number): number; + new (a?: number): number; + }): number[]; + new (x: { + new (a: boolean): boolean; + new (a?: boolean): boolean; + }): boolean[]; + }; + var a17: { + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + }; + + var b2: new (x: T) => U[]; + a2 = b2; // ok + b2 = a2; // ok + + var b7: new (x: (arg: T) => U) => (r: T) => V; + a7 = b7; // ok + b7 = a7; // ok + + var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; + a8 = b8; // error, type mismatch + ~~ +!!! Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type '{ foo: number; }' is not assignable to type 'Base': +!!! Types of property 'foo' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + b8 = a8; // error + ~~ +!!! Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type 'Base' is not assignable to type '{ foo: number; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + + var b10: new (...x: T[]) => T; + a10 = b10; // ok + b10 = a10; // ok + + var b11: new (x: T, y: T) => T; + a11 = b11; // ok + b11 = a11; // ok + + var b12: new >(x: Array, y: Array) => T; + a12 = b12; // ok + b12 = a12; // ok + + var b15: new (x: { a: T; b: T }) => T; + a15 = b15; // ok + b15 = a15; // ok + + var b15a: new (x: { a: T; b: T }) => number; + a15 = b15a; // ok + b15a = a15; // ok + + var b16: new (x: (a: T) => T) => T[]; + a16 = b16; // error + ~~~ +!!! Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. + b16 = a16; // error + ~~~ +!!! Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. + + var b17: new (x: (a: T) => T) => any[]; + a17 = b17; // error + ~~~ +!!! Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. + b17 = a17; // error + ~~~ +!!! Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. + } + + module WithGenericSignaturesInBaseType { + // target type has generic call signature + var a2: new (x: T) => T[]; + var b2: new (x: T) => string[]; + a2 = b2; // ok + b2 = a2; // ok + + // target type has generic call signature + var a3: new (x: T) => string[]; + var b3: new (x: T) => T[]; + a3 = b3; // ok + b3 = a3; // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js new file mode 100644 index 0000000000000..b4f6a4903a526 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -0,0 +1,190 @@ +//// [assignmentCompatWithConstructSignatures4.ts] +// checking assignment compatibility relations for function types. + +module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // target type with non-generic call signatures + var a2: new (x: number) => string[]; + var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2; + var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + var a10: new (...x: Base[]) => Base; + var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + var a12: new (x: Array, y: Array) => Array; + var a14: { + new (x: number): number[]; + new (x: string): string[]; + }; + var a15: new (x: { a: string; b: number }) => number; + var a16: { + new (x: { + new (a: number): number; + new (a?: number): number; + }): number[]; + new (x: { + new (a: boolean): boolean; + new (a?: boolean): boolean; + }): boolean[]; + }; + var a17: { + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + }; + + var b2: new (x: T) => U[]; + a2 = b2; // ok + b2 = a2; // ok + + var b7: new (x: (arg: T) => U) => (r: T) => V; + a7 = b7; // ok + b7 = a7; // ok + + var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; + a8 = b8; // error, type mismatch + b8 = a8; // error + + + var b10: new (...x: T[]) => T; + a10 = b10; // ok + b10 = a10; // ok + + var b11: new (x: T, y: T) => T; + a11 = b11; // ok + b11 = a11; // ok + + var b12: new >(x: Array, y: Array) => T; + a12 = b12; // ok + b12 = a12; // ok + + var b15: new (x: { a: T; b: T }) => T; + a15 = b15; // ok + b15 = a15; // ok + + var b15a: new (x: { a: T; b: T }) => number; + a15 = b15a; // ok + b15a = a15; // ok + + var b16: new (x: (a: T) => T) => T[]; + a16 = b16; // error + b16 = a16; // error + + var b17: new (x: (a: T) => T) => any[]; + a17 = b17; // error + b17 = a17; // error + } + + module WithGenericSignaturesInBaseType { + // target type has generic call signature + var a2: new (x: T) => T[]; + var b2: new (x: T) => string[]; + a2 = b2; // ok + b2 = a2; // ok + + // target type has generic call signature + var a3: new (x: T) => string[]; + var b3: new (x: T) => T[]; + a3 = b3; // ok + b3 = a3; // ok + } +} + +//// [assignmentCompatWithConstructSignatures4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Errors; +(function (Errors) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Derived); + var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; + })(Base); + var WithNonGenericSignaturesInBaseType; + (function (WithNonGenericSignaturesInBaseType) { + var a2; + var a7; + var a8; + var a10; + var a11; + var a12; + var a14; + var a15; + var a16; + var a17; + var b2; + a2 = b2; + b2 = a2; + var b7; + a7 = b7; + b7 = a7; + var b8; + a8 = b8; + b8 = a8; + var b10; + a10 = b10; + b10 = a10; + var b11; + a11 = b11; + b11 = a11; + var b12; + a12 = b12; + b12 = a12; + var b15; + a15 = b15; + b15 = a15; + var b15a; + a15 = b15a; + b15a = a15; + var b16; + a16 = b16; + b16 = a16; + var b17; + a17 = b17; + b17 = a17; + })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); + var WithGenericSignaturesInBaseType; + (function (WithGenericSignaturesInBaseType) { + var a2; + var b2; + a2 = b2; + b2 = a2; + var a3; + var b3; + a3 = b3; + b3 = a3; + })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); +})(Errors || (Errors = {})); diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js new file mode 100644 index 0000000000000..a1d6d859dd9bf --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -0,0 +1,144 @@ +//// [assignmentCompatWithConstructSignatures5.ts] +// checking assignment compat for function types. All valid + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +var a: new (x: T) => T[]; +var a2: new (x: T) => string[]; +var a3: new (x: T) => void; +var a4: new (x: T, y: U) => string; +var a5: new (x: new (arg: T) => U) => T; +var a6: new (x: new (arg: T) => Derived) => T; +var a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +var a15: new (x: { a: T; b: T }) => T[]; +var a16: new (x: { a: T; b: T }) => T[]; +var a17: { + new (x: new (a: T) => T): T[]; + new (x: new (a: T) => T): T[]; +}; +var a18: { + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; +}; + +var b: new (x: T) => T[]; +a = b; // ok +b = a; // ok +var b2: new (x: T) => string[]; +a2 = b2; // ok +b2 = a2; // ok +var b3: new (x: T) => T; +a3 = b3; // ok +b3 = a3; // ok +var b4: new (x: T, y: U) => string; +a4 = b4; // ok +b4 = a4; // ok +var b5: new (x: new (arg: T) => U) => T; +a5 = b5; // ok +b5 = a5; // ok +var b6: new (x: new (arg: T) => U) => T; +a6 = b6; // ok +b6 = a6; // ok +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +a11 = b11; // ok +b11 = a11; // ok +var b15: new (x: { a: U; b: V; }) => U[]; +a15 = b15; // ok +b15 = a15; // ok +var b16: new (x: { a: T; b: T }) => T[]; +a15 = b16; // ok +b15 = a16; // ok +var b17: new (x: new (a: T) => T) => T[]; +a17 = b17; // ok +b17 = a17; // ok +var b18: new (x: new (a: T) => T) => any[]; +a18 = b18; // ok +b18 = a18; // ok + + +//// [assignmentCompatWithConstructSignatures5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var a; +var a2; +var a3; +var a4; +var a5; +var a6; +var a11; +var a15; +var a16; +var a17; +var a18; +var b; +a = b; +b = a; +var b2; +a2 = b2; +b2 = a2; +var b3; +a3 = b3; +b3 = a3; +var b4; +a4 = b4; +b4 = a4; +var b5; +a5 = b5; +b5 = a5; +var b6; +a6 = b6; +b6 = a6; +var b11; +a11 = b11; +b11 = a11; +var b15; +a15 = b15; +b15 = a15; +var b16; +a15 = b16; +b15 = a16; +var b17; +a17 = b17; +b17 = a17; +var b18; +a18 = b18; +b18 = a18; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js new file mode 100644 index 0000000000000..46218420d679b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -0,0 +1,99 @@ +//// [assignmentCompatWithConstructSignatures6.ts] +// checking assignment compatibility relations for function types. All valid. + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { + a: new (x: T) => T[]; + a2: new (x: T) => string[]; + a3: new (x: T) => void; + a4: new (x: T, y: U) => string; + a5: new (x: (arg: T) => U) => T; + a6: new (x: (arg: T) => Derived) => T; + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: new (x: { a: T; b: T }) => T[]; + a16: new (x: { a: T; b: T }) => T[]; +} + +var x: A; + +var b: new (x: T) => T[]; +x.a = b; +b = x.a; +var b2: new (x: T) => string[]; +x.a2 = b2; +b2 = x.a2; +var b3: new (x: T) => T; +x.a3 = b3; +b3 = x.a3; +var b4: new (x: T, y: U) => string; +x.a4 = b4; +b4 = x.a4; +var b5: new (x: (arg: T) => U) => T; +x.a5 = b5; +b5 = x.a5; +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +x.a11 = b11; +b11 = x.a11; +var b16: new (x: { a: T; b: T }) => T[]; +x.a16 = b16; +b16 = x.a16; + +//// [assignmentCompatWithConstructSignatures6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); +var x; +var b; +x.a = b; +b = x.a; +var b2; +x.a2 = b2; +b2 = x.a2; +var b3; +x.a3 = b3; +b3 = x.a3; +var b4; +x.a4 = b4; +b4 = x.a4; +var b5; +x.a5 = b5; +b5 = x.a5; +var b11; +x.a11 = b11; +b11 = x.a11; +var b16; +x.a16 = b16; +b16 = x.a16; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt new file mode 100644 index 0000000000000..69098417e534c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -0,0 +1,63 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== + // call signatures in derived types must have the same or fewer optional parameters as the base type + + interface Base { + a: new () => number; + a2: new (x?: number) => number; + a3: new (x: number) => number; + a4: new (x: number, y?: number) => number; + a5: new (x?: number, y?: number) => number; + a6: new (x: number, y: number) => number; + } + var b: Base; + + var a: new () => number; + a = b.a; // ok + a = b.a2; // ok + a = b.a3; // error + ~ +!!! Type 'new (x: number) => number' is not assignable to type 'new () => number'. + a = b.a4; // error + ~ +!!! Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. + a = b.a5; // ok + a = b.a6; // error + ~ +!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. + + var a2: new (x?: number) => number; + a2 = b.a; // ok + a2 = b.a2; // ok + a2 = b.a3; // ok + a2 = b.a4; // ok + a2 = b.a5; // ok + a2 = b.a6; // error + ~~ +!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. + + var a3: new (x: number) => number; + a3 = b.a; // ok + a3 = b.a2; // ok + a3 = b.a3; // ok + a3 = b.a4; // ok + a3 = b.a5; // ok + a3 = b.a6; // error + ~~ +!!! Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. + + var a4: new (x: number, y?: number) => number; + a4 = b.a; // ok + a4 = b.a2; // ok + a4 = b.a3; // ok + a4 = b.a4; // ok + a4 = b.a5; // ok + a4 = b.a6; // ok + + var a5: new (x?: number, y?: number) => number; + a5 = b.a; // ok + a5 = b.a2; // ok + a5 = b.a3; // ok + a5 = b.a4; // ok + a5 = b.a5; // ok + a5 = b.a6; // ok + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js new file mode 100644 index 0000000000000..81494071a42cd --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js @@ -0,0 +1,91 @@ +//// [assignmentCompatWithConstructSignaturesWithOptionalParameters.ts] +// call signatures in derived types must have the same or fewer optional parameters as the base type + +interface Base { + a: new () => number; + a2: new (x?: number) => number; + a3: new (x: number) => number; + a4: new (x: number, y?: number) => number; + a5: new (x?: number, y?: number) => number; + a6: new (x: number, y: number) => number; +} +var b: Base; + +var a: new () => number; + a = b.a; // ok + a = b.a2; // ok + a = b.a3; // error + a = b.a4; // error + a = b.a5; // ok + a = b.a6; // error + +var a2: new (x?: number) => number; + a2 = b.a; // ok + a2 = b.a2; // ok + a2 = b.a3; // ok + a2 = b.a4; // ok + a2 = b.a5; // ok + a2 = b.a6; // error + +var a3: new (x: number) => number; + a3 = b.a; // ok + a3 = b.a2; // ok + a3 = b.a3; // ok + a3 = b.a4; // ok + a3 = b.a5; // ok + a3 = b.a6; // error + +var a4: new (x: number, y?: number) => number; + a4 = b.a; // ok + a4 = b.a2; // ok + a4 = b.a3; // ok + a4 = b.a4; // ok + a4 = b.a5; // ok + a4 = b.a6; // ok + +var a5: new (x?: number, y?: number) => number; + a5 = b.a; // ok + a5 = b.a2; // ok + a5 = b.a3; // ok + a5 = b.a4; // ok + a5 = b.a5; // ok + a5 = b.a6; // ok + + +//// [assignmentCompatWithConstructSignaturesWithOptionalParameters.js] +var b; +var a; +a = b.a; +a = b.a2; +a = b.a3; +a = b.a4; +a = b.a5; +a = b.a6; +var a2; +a2 = b.a; +a2 = b.a2; +a2 = b.a3; +a2 = b.a4; +a2 = b.a5; +a2 = b.a6; +var a3; +a3 = b.a; +a3 = b.a2; +a3 = b.a3; +a3 = b.a4; +a3 = b.a5; +a3 = b.a6; +var a4; +a4 = b.a; +a4 = b.a2; +a4 = b.a3; +a4 = b.a4; +a4 = b.a5; +a4 = b.a6; +var a5; +a5 = b.a; +a5 = b.a2; +a5 = b.a3; +a5 = b.a4; +a5 = b.a5; +a5 = b.a6; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js new file mode 100644 index 0000000000000..649a6b724777d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js @@ -0,0 +1,14 @@ +//// [assignmentCompatWithGenericCallSignatures.ts] +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +var f: (x: S) => void +var g: (x: T[]) => void + +f = g; // ok +g = f; // ok + +//// [assignmentCompatWithGenericCallSignatures.js] +var f; +var g; +f = g; +g = f; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js new file mode 100644 index 0000000000000..51d5160b1197a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js @@ -0,0 +1,24 @@ +//// [assignmentCompatWithGenericCallSignatures2.ts] +// some complex cases of assignment compat of generic signatures. No contextual signature instantiation + +interface A { + (x: T, ...y: T[][]): void +} + +interface B { + (x: S, ...y: S[]): void +} + +var a: A; +var b: B; + +// Both ok +a = b; +b = a; + + +//// [assignmentCompatWithGenericCallSignatures2.js] +var a; +var b; +a = b; +b = a; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js new file mode 100644 index 0000000000000..f5f076c581620 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js @@ -0,0 +1,16 @@ +//// [assignmentCompatWithGenericCallSignatures3.ts] +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +interface I { + (f: (x: T) => (y: S) => U): U +} + +var g: (x: T) => (y: S) => I +var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } + +g = h // ok + +//// [assignmentCompatWithGenericCallSignatures3.js] +var g; +var h; +g = h; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt new file mode 100644 index 0000000000000..d5fb8f331fbe2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts (2 errors) ==== + // some complex cases of assignment compat of generic signatures. + + interface I2 { + p: T + } + + var x: >(z: T) => void + ~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var y: >>(z: T) => void + ~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + // These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway + x = y + y = x + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js new file mode 100644 index 0000000000000..8d1b6e5d47d0c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js @@ -0,0 +1,20 @@ +//// [assignmentCompatWithGenericCallSignatures4.ts] +// some complex cases of assignment compat of generic signatures. + +interface I2 { + p: T +} + +var x: >(z: T) => void +var y: >>(z: T) => void + +// These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway +x = y +y = x + + +//// [assignmentCompatWithGenericCallSignatures4.js] +var x; +var y; +x = y; +y = x; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt new file mode 100644 index 0000000000000..5807bbb1663ce --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -0,0 +1,143 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== + // call signatures in derived types must have the same or fewer optional parameters as the target for assignment + + module ClassTypeParam { + class Base { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + + init = () => { + this.a = () => null; // ok, same T of required params + this.a = (x?: T) => null; // ok, same T of required params + this.a = (x: T) => null; // error, too many required params + ~~~~~~ +!!! Type '(x: T) => any' is not assignable to type '() => T'. + + this.a2 = () => null; // ok, same T of required params + this.a2 = (x?: T) => null; // ok, same T of required params + this.a2 = (x: T) => null; // ok, same number of params + + this.a3 = () => null; // ok, fewer required params + this.a3 = (x?: T) => null; // ok, fewer required params + this.a3 = (x: T) => null; // ok, same T of required params + this.a3 = (x: T, y: T) => null; // error, too many required params + ~~~~~~~ +!!! Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. + + this.a4 = () => null; // ok, fewer required params + this.a4 = (x?: T, y?: T) => null; // ok, fewer required params + this.a4 = (x: T) => null; // ok, same T of required params + this.a4 = (x: T, y: T) => null; // ok, same number of params + + + this.a5 = () => null; // ok, fewer required params + this.a5 = (x?: T, y?: T) => null; // ok, fewer required params + this.a5 = (x: T) => null; // ok, all present params match + this.a5 = (x: T, y: T) => null; // ok, same number of params + } + } + } + + module GenericSignaturesInvalid { + + class Base2 { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + } + + class Target { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + } + + + function foo() { + var b: Base2; + var t: Target; + + // all errors + b.a = t.a; + b.a = t.a2; + b.a = t.a3; + ~~~ +!!! Type '(x: T) => T' is not assignable to type '() => T'. + b.a = t.a4; + ~~~ +!!! Type '(x: T, y?: T) => T' is not assignable to type '() => T'. + b.a = t.a5; + + b.a2 = t.a; + b.a2 = t.a2; + b.a2 = t.a3; + b.a2 = t.a4; + b.a2 = t.a5; + + b.a3 = t.a; + b.a3 = t.a2; + b.a3 = t.a3; + b.a3 = t.a4; + b.a3 = t.a5; + + b.a4 = t.a; + b.a4 = t.a2; + b.a4 = t.a3; + b.a4 = t.a4; + b.a4 = t.a5; + + b.a5 = t.a; + b.a5 = t.a2; + b.a5 = t.a3; + b.a5 = t.a4; + b.a5 = t.a5; + } + } + + module GenericSignaturesValid { + + class Base2 { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + + init = () => { + this.a = () => null; // ok, same T of required params + this.a = (x?: T) => null; // ok, same T of required params + this.a = (x: T) => null; // error, too many required params + ~~~~~~ +!!! Type '(x: T) => any' is not assignable to type '() => T'. + + this.a2 = () => null; // ok, same T of required params + this.a2 = (x?: T) => null; // ok, same T of required params + this.a2 = (x: T) => null; // ok, same number of params + + this.a3 = () => null; // ok, fewer required params + this.a3 = (x?: T) => null; // ok, fewer required params + this.a3 = (x: T) => null; // ok, same T of required params + this.a3 = (x: T, y: T) => null; // error, too many required params + ~~~~~~~ +!!! Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. + + this.a4 = () => null; // ok, fewer required params + this.a4 = (x?: T, y?: T) => null; // ok, fewer required params + this.a4 = (x: T) => null; // ok, same T of required params + this.a4 = (x: T, y: T) => null; // ok, same number of params + + + this.a5 = () => null; // ok, fewer required params + this.a5 = (x?: T, y?: T) => null; // ok, fewer required params + this.a5 = (x: T) => null; // ok, all present params match + this.a5 = (x: T, y: T) => null; // ok, same number of params + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js new file mode 100644 index 0000000000000..64ceab9018177 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js @@ -0,0 +1,233 @@ +//// [assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts] +// call signatures in derived types must have the same or fewer optional parameters as the target for assignment + +module ClassTypeParam { + class Base { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + + init = () => { + this.a = () => null; // ok, same T of required params + this.a = (x?: T) => null; // ok, same T of required params + this.a = (x: T) => null; // error, too many required params + + this.a2 = () => null; // ok, same T of required params + this.a2 = (x?: T) => null; // ok, same T of required params + this.a2 = (x: T) => null; // ok, same number of params + + this.a3 = () => null; // ok, fewer required params + this.a3 = (x?: T) => null; // ok, fewer required params + this.a3 = (x: T) => null; // ok, same T of required params + this.a3 = (x: T, y: T) => null; // error, too many required params + + this.a4 = () => null; // ok, fewer required params + this.a4 = (x?: T, y?: T) => null; // ok, fewer required params + this.a4 = (x: T) => null; // ok, same T of required params + this.a4 = (x: T, y: T) => null; // ok, same number of params + + + this.a5 = () => null; // ok, fewer required params + this.a5 = (x?: T, y?: T) => null; // ok, fewer required params + this.a5 = (x: T) => null; // ok, all present params match + this.a5 = (x: T, y: T) => null; // ok, same number of params + } + } +} + +module GenericSignaturesInvalid { + + class Base2 { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + } + + class Target { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + } + + + function foo() { + var b: Base2; + var t: Target; + + // all errors + b.a = t.a; + b.a = t.a2; + b.a = t.a3; + b.a = t.a4; + b.a = t.a5; + + b.a2 = t.a; + b.a2 = t.a2; + b.a2 = t.a3; + b.a2 = t.a4; + b.a2 = t.a5; + + b.a3 = t.a; + b.a3 = t.a2; + b.a3 = t.a3; + b.a3 = t.a4; + b.a3 = t.a5; + + b.a4 = t.a; + b.a4 = t.a2; + b.a4 = t.a3; + b.a4 = t.a4; + b.a4 = t.a5; + + b.a5 = t.a; + b.a5 = t.a2; + b.a5 = t.a3; + b.a5 = t.a4; + b.a5 = t.a5; + } +} + +module GenericSignaturesValid { + + class Base2 { + a: () => T; + a2: (x?: T) => T; + a3: (x: T) => T; + a4: (x: T, y?: T) => T; + a5: (x?: T, y?: T) => T; + + init = () => { + this.a = () => null; // ok, same T of required params + this.a = (x?: T) => null; // ok, same T of required params + this.a = (x: T) => null; // error, too many required params + + this.a2 = () => null; // ok, same T of required params + this.a2 = (x?: T) => null; // ok, same T of required params + this.a2 = (x: T) => null; // ok, same number of params + + this.a3 = () => null; // ok, fewer required params + this.a3 = (x?: T) => null; // ok, fewer required params + this.a3 = (x: T) => null; // ok, same T of required params + this.a3 = (x: T, y: T) => null; // error, too many required params + + this.a4 = () => null; // ok, fewer required params + this.a4 = (x?: T, y?: T) => null; // ok, fewer required params + this.a4 = (x: T) => null; // ok, same T of required params + this.a4 = (x: T, y: T) => null; // ok, same number of params + + + this.a5 = () => null; // ok, fewer required params + this.a5 = (x?: T, y?: T) => null; // ok, fewer required params + this.a5 = (x: T) => null; // ok, all present params match + this.a5 = (x: T, y: T) => null; // ok, same number of params + } + } +} + +//// [assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js] +var ClassTypeParam; +(function (ClassTypeParam) { + var Base = (function () { + function Base() { + var _this = this; + this.init = function () { + _this.a = function () { return null; }; + _this.a = function (x) { return null; }; + _this.a = function (x) { return null; }; + _this.a2 = function () { return null; }; + _this.a2 = function (x) { return null; }; + _this.a2 = function (x) { return null; }; + _this.a3 = function () { return null; }; + _this.a3 = function (x) { return null; }; + _this.a3 = function (x) { return null; }; + _this.a3 = function (x, y) { return null; }; + _this.a4 = function () { return null; }; + _this.a4 = function (x, y) { return null; }; + _this.a4 = function (x) { return null; }; + _this.a4 = function (x, y) { return null; }; + _this.a5 = function () { return null; }; + _this.a5 = function (x, y) { return null; }; + _this.a5 = function (x) { return null; }; + _this.a5 = function (x, y) { return null; }; + }; + } + return Base; + })(); +})(ClassTypeParam || (ClassTypeParam = {})); +var GenericSignaturesInvalid; +(function (GenericSignaturesInvalid) { + var Base2 = (function () { + function Base2() { + } + return Base2; + })(); + var Target = (function () { + function Target() { + } + return Target; + })(); + function foo() { + var b; + var t; + b.a = t.a; + b.a = t.a2; + b.a = t.a3; + b.a = t.a4; + b.a = t.a5; + b.a2 = t.a; + b.a2 = t.a2; + b.a2 = t.a3; + b.a2 = t.a4; + b.a2 = t.a5; + b.a3 = t.a; + b.a3 = t.a2; + b.a3 = t.a3; + b.a3 = t.a4; + b.a3 = t.a5; + b.a4 = t.a; + b.a4 = t.a2; + b.a4 = t.a3; + b.a4 = t.a4; + b.a4 = t.a5; + b.a5 = t.a; + b.a5 = t.a2; + b.a5 = t.a3; + b.a5 = t.a4; + b.a5 = t.a5; + } +})(GenericSignaturesInvalid || (GenericSignaturesInvalid = {})); +var GenericSignaturesValid; +(function (GenericSignaturesValid) { + var Base2 = (function () { + function Base2() { + var _this = this; + this.init = function () { + _this.a = function () { return null; }; + _this.a = function (x) { return null; }; + _this.a = function (x) { return null; }; + _this.a2 = function () { return null; }; + _this.a2 = function (x) { return null; }; + _this.a2 = function (x) { return null; }; + _this.a3 = function () { return null; }; + _this.a3 = function (x) { return null; }; + _this.a3 = function (x) { return null; }; + _this.a3 = function (x, y) { return null; }; + _this.a4 = function () { return null; }; + _this.a4 = function (x, y) { return null; }; + _this.a4 = function (x) { return null; }; + _this.a4 = function (x, y) { return null; }; + _this.a5 = function () { return null; }; + _this.a5 = function (x, y) { return null; }; + _this.a5 = function (x) { return null; }; + _this.a5 = function (x, y) { return null; }; + }; + } + return Base2; + })(); +})(GenericSignaturesValid || (GenericSignaturesValid = {})); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt new file mode 100644 index 0000000000000..0974c579daf7f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -0,0 +1,72 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts (6 errors) ==== + // Derived type indexer must be subtype of base type indexer + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + class A { + [x: number]: Base; + } + + var a: A; + var b: { [x: number]: Derived; } + a = b; + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: number]: Derived2; } + a = b2; + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + module Generics { + class A { + [x: number]: T; + } + + class B extends A { + [x: number]: Derived; // ok + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; } + a = b; // error + ~ +!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'T'. + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: number]: Derived2; } + a = b2; // error + ~ +!!! Type '{ [x: number]: Derived2; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived2' is not assignable to type 'T'. + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + var b3: { [x: number]: T; } + a = b3; // ok + b3 = a; // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js new file mode 100644 index 0000000000000..075a9b286a7a9 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -0,0 +1,91 @@ +//// [assignmentCompatWithNumericIndexer.ts] +// Derived type indexer must be subtype of base type indexer + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +class A { + [x: number]: Base; +} + +var a: A; +var b: { [x: number]: Derived; } +a = b; +b = a; // error + +var b2: { [x: number]: Derived2; } +a = b2; +b2 = a; // error + +module Generics { + class A { + [x: number]: T; + } + + class B extends A { + [x: number]: Derived; // ok + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; } + a = b; // error + b = a; // error + + var b2: { [x: number]: Derived2; } + a = b2; // error + b2 = a; // error + + var b3: { [x: number]: T; } + a = b3; // ok + b3 = a; // ok + } +} + +//// [assignmentCompatWithNumericIndexer.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var a; +var b; +a = b; +b = a; +var b2; +a = b2; +b2 = a; +var Generics; +(function (Generics) { + var A = (function () { + function A() { + } + return A; + })(); + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(A); + function foo() { + var a; + var b; + a = b; + b = a; + var b2; + a = b2; + b2 = a; + var b3; + a = b3; + b3 = a; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt new file mode 100644 index 0000000000000..35a0cf283a597 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -0,0 +1,72 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts (6 errors) ==== + // Derived type indexer must be subtype of base type indexer + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + interface A { + [x: number]: Base; + } + + var a: A; + var b: { [x: number]: Derived; } + a = b; + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: number]: Derived2; } + a = b2; + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + module Generics { + interface A { + [x: number]: T; + } + + interface B extends A { + [x: number]: Derived; // ok + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; } + a = b; // error + ~ +!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'T'. + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: number]: Derived2; } + a = b2; // error + ~ +!!! Type '{ [x: number]: Derived2; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived2' is not assignable to type 'T'. + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + var b3: { [x: number]: T; } + a = b3; // ok + b3 = a; // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js new file mode 100644 index 0000000000000..47a28b8ce2ac8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js @@ -0,0 +1,68 @@ +//// [assignmentCompatWithNumericIndexer2.ts] +// Derived type indexer must be subtype of base type indexer + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +interface A { + [x: number]: Base; +} + +var a: A; +var b: { [x: number]: Derived; } +a = b; +b = a; // error + +var b2: { [x: number]: Derived2; } +a = b2; +b2 = a; // error + +module Generics { + interface A { + [x: number]: T; + } + + interface B extends A { + [x: number]: Derived; // ok + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; } + a = b; // error + b = a; // error + + var b2: { [x: number]: Derived2; } + a = b2; // error + b2 = a; // error + + var b3: { [x: number]: T; } + a = b3; // ok + b3 = a; // ok + } +} + +//// [assignmentCompatWithNumericIndexer2.js] +var a; +var b; +a = b; +b = a; +var b2; +a = b2; +b2 = a; +var Generics; +(function (Generics) { + function foo() { + var a; + var b; + a = b; + b = a; + var b2; + a = b2; + b2 = a; + var b3; + a = b3; + b3 = a; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt new file mode 100644 index 0000000000000..dfc4632375717 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts (3 errors) ==== + // Derived type indexer must be subtype of base type indexer + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + class A { + [x: number]: Derived; + } + + var a: A; + var b: { [x: number]: Base; }; + + a = b; // error + ~ +!!! Type '{ [x: number]: Base; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + b = a; // ok + + class B2 extends A { + [x: number]: Derived2; // ok + } + + var b2: { [x: number]: Derived2; }; + a = b2; // ok + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: number]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Derived'. + + module Generics { + class A { + [x: number]: T; + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; }; + a = b; // error + ~ +!!! Type '{ [x: number]: Derived; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'T'. + b = a; // ok + + var b2: { [x: number]: T; }; + a = b2; // ok + b2 = a; // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js new file mode 100644 index 0000000000000..f59a0a99bd765 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -0,0 +1,85 @@ +//// [assignmentCompatWithNumericIndexer3.ts] +// Derived type indexer must be subtype of base type indexer + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +class A { + [x: number]: Derived; +} + +var a: A; +var b: { [x: number]: Base; }; + +a = b; // error +b = a; // ok + +class B2 extends A { + [x: number]: Derived2; // ok +} + +var b2: { [x: number]: Derived2; }; +a = b2; // ok +b2 = a; // error + +module Generics { + class A { + [x: number]: T; + } + + function foo() { + var a: A; + var b: { [x: number]: Derived; }; + a = b; // error + b = a; // ok + + var b2: { [x: number]: T; }; + a = b2; // ok + b2 = a; // ok + } +} + +//// [assignmentCompatWithNumericIndexer3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var a; +var b; +a = b; +b = a; +var B2 = (function (_super) { + __extends(B2, _super); + function B2() { + _super.apply(this, arguments); + } + return B2; +})(A); +var b2; +a = b2; +b2 = a; +var Generics; +(function (Generics) { + var A = (function () { + function A() { + } + return A; + })(); + function foo() { + var a; + var b; + a = b; + b = a; + var b2; + a = b2; + b2 = a; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.js b/tests/baselines/reference/assignmentCompatWithObjectMembers.js new file mode 100644 index 0000000000000..14b49dcd1e752 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.js @@ -0,0 +1,168 @@ +//// [assignmentCompatWithObjectMembers.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// no errors expected + +module SimpleTypes { + class S { foo: string; } + class T { foo: string; } + var s: S; + var t: T; + + interface S2 { foo: string; } + interface T2 { foo: string; } + var s2: S2; + var t2: T2; + + var a: { foo: string; } + var b: { foo: string; } + + var a2 = { foo: '' }; + var b2 = { foo: '' }; + + s = t; + t = s; + s = s2; + s = a2; + + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + + a = b; + b = a; + a = s; + a = s2; + a = a2; + + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +} + +module ObjectTypes { + class S { foo: S; } + class T { foo: T; } + var s: S; + var t: T; + + interface S2 { foo: S2; } + interface T2 { foo: T2; } + var s2: S2; + var t2: T2; + + var a: { foo: typeof a; } + var b: { foo: typeof b; } + + var a2 = { foo: a2 }; + var b2 = { foo: b2 }; + + s = t; + t = s; + s = s2; + s = a2; + + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + + a = b; + b = a; + a = s; + a = s2; + a = a2; + + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; + +} + +//// [assignmentCompatWithObjectMembers.js] +var SimpleTypes; +(function (SimpleTypes) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: '' }; + var b2 = { foo: '' }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(SimpleTypes || (SimpleTypes = {})); +var ObjectTypes; +(function (ObjectTypes) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: a2 }; + var b2 = { foo: b2 }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(ObjectTypes || (ObjectTypes = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js new file mode 100644 index 0000000000000..7a2c4ae0fce5e --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js @@ -0,0 +1,82 @@ +//// [assignmentCompatWithObjectMembers2.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S { foo: string; } +class T { foo: string; } +var s: S; +var t: T; + +interface S2 { foo: string; bar?: string } +interface T2 { foo: string; baz?: string } +var s2: S2; +var t2: T2; + +var a: { foo: string; bar?: string } +var b: { foo: string; baz?: string } + +var a2 = { foo: '' }; +var b2 = { foo: '' }; + +s = t; +t = s; +s = s2; +s = a2; + +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; + +a = b; +b = a; +a = s; +a = s2; +a = a2; + +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; + + +//// [assignmentCompatWithObjectMembers2.js] +var S = (function () { + function S() { + } + return S; +})(); +var T = (function () { + function T() { + } + return T; +})(); +var s; +var t; +var s2; +var t2; +var a; +var b; +var a2 = { foo: '' }; +var b2 = { foo: '' }; +s = t; +t = s; +s = s2; +s = a2; +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; +a = b; +b = a; +a = s; +a = s2; +a = a2; +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js new file mode 100644 index 0000000000000..ce8b9ad806ec1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js @@ -0,0 +1,82 @@ +//// [assignmentCompatWithObjectMembers3.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S implements S2 { foo: string; } +class T implements T2 { foo: string; } +var s: S; +var t: T; + +interface S2 { foo: string; bar?: string } +interface T2 { foo: string; baz?: string } +var s2: S2; +var t2: T2; + +var a: { foo: string; bar?: string } +var b: { foo: string; baz?: string } + +var a2: S2 = { foo: '' }; +var b2: T2 = { foo: '' }; + +s = t; +t = s; +s = s2; +s = a2; + +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; + +a = b; +b = a; +a = s; +a = s2; +a = a2; + +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; + + +//// [assignmentCompatWithObjectMembers3.js] +var S = (function () { + function S() { + } + return S; +})(); +var T = (function () { + function T() { + } + return T; +})(); +var s; +var t; +var s2; +var t2; +var a; +var b; +var a2 = { foo: '' }; +var b2 = { foo: '' }; +s = t; +t = s; +s = s2; +s = a2; +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; +a = b; +b = a; +a = s; +a = s2; +a = a2; +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt new file mode 100644 index 0000000000000..7b0e088f851a3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -0,0 +1,177 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts (17 errors) ==== + // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M + + module OnlyDerived { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + + class S { foo: Derived; } + class T { foo: Derived2; } + var s: S; + var t: T; + + interface S2 { foo: Derived; } + interface T2 { foo: Derived2; } + var s2: S2; + var t2: T2; + + var a: { foo: Derived; } + var b: { foo: Derived2; } + + var a2 = { foo: new Derived() }; + var b2 = { foo: new Derived2() }; + + s = t; // error + ~ +!!! Type 'T' is not assignable to type 'S': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + t = s; // error + ~ +!!! Type 'S' is not assignable to type 'T': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Derived'. + s = s2; // ok + s = a2; // ok + + s2 = t2; // error + ~~ +!!! Type 'T2' is not assignable to type 'S2': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + t2 = s2; // error + ~~ +!!! Type 'S2' is not assignable to type 'T2': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Derived'. + s2 = t; // error + ~~ +!!! Type 'T' is not assignable to type 'S2': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + s2 = b; // error + ~~ +!!! Type '{ foo: Derived2; }' is not assignable to type 'S2': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + s2 = a2; // ok + + a = b; // error + ~ +!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + b = a; // error + ~ +!!! Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Derived'. + a = s; // ok + a = s2; // ok + a = a2; // ok + + a2 = b2; // error + ~~ +!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + b2 = a2; // error + ~~ +!!! Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Derived'. + a2 = b; // error + ~~ +!!! Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + a2 = t2; // error + ~~ +!!! Type 'T2' is not assignable to type '{ foo: Derived; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + a2 = t; // error + ~~ +!!! Type 'T' is not assignable to type '{ foo: Derived; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Derived2' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Derived2'. + } + + module WithBase { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + + class S { foo: Base; } + class T { foo: Derived2; } + var s: S; + var t: T; + + interface S2 { foo: Base; } + interface T2 { foo: Derived2; } + var s2: S2; + var t2: T2; + + var a: { foo: Base; } + var b: { foo: Derived2; } + + var a2 = { foo: new Base() }; + var b2 = { foo: new Derived2() }; + + s = t; // ok + t = s; // error + ~ +!!! Type 'S' is not assignable to type 'T': +!!! Types of property 'foo' are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + s = s2; // ok + s = a2; // ok + + s2 = t2; // ok + t2 = s2; // error + ~~ +!!! Type 'S2' is not assignable to type 'T2': +!!! Types of property 'foo' are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + s2 = t; // ok + s2 = b; // ok + s2 = a2; // ok + + a = b; // ok + b = a; // error + ~ +!!! Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + a = s; // ok + a = s2; // ok + a = a2; // ok + + a2 = b2; // ok + b2 = a2; // error + ~~ +!!! Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': +!!! Types of property 'foo' are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + a2 = b; // ok + a2 = t2; // ok + a2 = t; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js new file mode 100644 index 0000000000000..a412e06f8475c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -0,0 +1,218 @@ +//// [assignmentCompatWithObjectMembers4.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M + +module OnlyDerived { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + + class S { foo: Derived; } + class T { foo: Derived2; } + var s: S; + var t: T; + + interface S2 { foo: Derived; } + interface T2 { foo: Derived2; } + var s2: S2; + var t2: T2; + + var a: { foo: Derived; } + var b: { foo: Derived2; } + + var a2 = { foo: new Derived() }; + var b2 = { foo: new Derived2() }; + + s = t; // error + t = s; // error + s = s2; // ok + s = a2; // ok + + s2 = t2; // error + t2 = s2; // error + s2 = t; // error + s2 = b; // error + s2 = a2; // ok + + a = b; // error + b = a; // error + a = s; // ok + a = s2; // ok + a = a2; // ok + + a2 = b2; // error + b2 = a2; // error + a2 = b; // error + a2 = t2; // error + a2 = t; // error +} + +module WithBase { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + + class S { foo: Base; } + class T { foo: Derived2; } + var s: S; + var t: T; + + interface S2 { foo: Base; } + interface T2 { foo: Derived2; } + var s2: S2; + var t2: T2; + + var a: { foo: Base; } + var b: { foo: Derived2; } + + var a2 = { foo: new Base() }; + var b2 = { foo: new Derived2() }; + + s = t; // ok + t = s; // error + s = s2; // ok + s = a2; // ok + + s2 = t2; // ok + t2 = s2; // error + s2 = t; // ok + s2 = b; // ok + s2 = a2; // ok + + a = b; // ok + b = a; // error + a = s; // ok + a = s2; // ok + a = a2; // ok + + a2 = b2; // ok + b2 = a2; // error + a2 = b; // ok + a2 = t2; // ok + a2 = t; // ok +} + +//// [assignmentCompatWithObjectMembers4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var OnlyDerived; +(function (OnlyDerived) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Base); + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: new Derived() }; + var b2 = { foo: new Derived2() }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(OnlyDerived || (OnlyDerived = {})); +var WithBase; +(function (WithBase) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Base); + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: new Base() }; + var b2 = { foo: new Derived2() }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(WithBase || (WithBase = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt new file mode 100644 index 0000000000000..d3e92899a8441 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts (2 errors) ==== + class C { + foo: string; + } + + var c: C; + + interface I { + fooo: string; + } + + var i: I; + + c = i; // error + ~ +!!! Type 'I' is not assignable to type 'C': +!!! Property 'foo' is missing in type 'I'. + i = c; // error + ~ +!!! Type 'C' is not assignable to type 'I': +!!! Property 'fooo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.js b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js new file mode 100644 index 0000000000000..87ef37370bb2c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js @@ -0,0 +1,26 @@ +//// [assignmentCompatWithObjectMembers5.ts] +class C { + foo: string; +} + +var c: C; + +interface I { + fooo: string; +} + +var i: I; + +c = i; // error +i = c; // error + +//// [assignmentCompatWithObjectMembers5.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var i; +c = i; +i = c; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt new file mode 100644 index 0000000000000..75ba383671c0d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -0,0 +1,182 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ==== + // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M + + module TargetIsPublic { + // targets + class Base { + public foo: string; + } + + interface I { + foo: string; + } + + var a: { foo: string; } + var b: Base; + var i: I; + + // sources + class D { + public foo: string; + } + + class E { + private foo: string; + } + var d: D; + var e: E; + + a = b; + a = i; + a = d; + a = e; // error + ~ +!!! Type 'E' is not assignable to type '{ foo: string; }': +!!! Private property 'foo' cannot be reimplemented. + + b = a; + b = i; + b = d; + b = e; // error + ~ +!!! Type 'E' is not assignable to type 'Base': +!!! Private property 'foo' cannot be reimplemented. + + i = a; + i = b; + i = d; + i = e; // error + ~ +!!! Type 'E' is not assignable to type 'I': +!!! Private property 'foo' cannot be reimplemented. + + d = a; + d = b; + d = i; + d = e; // error + ~ +!!! Type 'E' is not assignable to type 'D': +!!! Private property 'foo' cannot be reimplemented. + + e = a; // errror + ~ +!!! Type '{ foo: string; }' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = b; // errror + ~ +!!! Type 'Base' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = i; // errror + ~ +!!! Type 'I' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = d; // errror + ~ +!!! Type 'D' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = e; + + } + + module TargetIsPublic { + // targets + class Base { + private foo: string; + } + + interface I extends Base { + } + + var a: { foo: string; } + var b: Base; + var i: I; + + // sources + class D { + public foo: string; + } + + class E { + private foo: string; + } + + var d: D; + var e: E; + + a = b; // error + ~ +!!! Type 'Base' is not assignable to type '{ foo: string; }': +!!! Private property 'foo' cannot be reimplemented. + a = i; // error + ~ +!!! Type 'I' is not assignable to type '{ foo: string; }': +!!! Private property 'foo' cannot be reimplemented. + a = d; + a = e; // error + ~ +!!! Type 'E' is not assignable to type '{ foo: string; }': +!!! Private property 'foo' cannot be reimplemented. + + b = a; // error + ~ +!!! Type '{ foo: string; }' is not assignable to type 'Base': +!!! Private property 'foo' cannot be reimplemented. + b = i; + b = d; // error + ~ +!!! Type 'D' is not assignable to type 'Base': +!!! Private property 'foo' cannot be reimplemented. + b = e; // error + ~ +!!! Type 'E' is not assignable to type 'Base': +!!! Private property 'foo' cannot be reimplemented. + b = b; + + i = a; // error + ~ +!!! Type '{ foo: string; }' is not assignable to type 'I': +!!! Private property 'foo' cannot be reimplemented. + i = b; + i = d; // error + ~ +!!! Type 'D' is not assignable to type 'I': +!!! Private property 'foo' cannot be reimplemented. + i = e; // error + ~ +!!! Type 'E' is not assignable to type 'I': +!!! Private property 'foo' cannot be reimplemented. + i = i; + + d = a; + d = b; // error + ~ +!!! Type 'Base' is not assignable to type 'D': +!!! Private property 'foo' cannot be reimplemented. + d = i; // error + ~ +!!! Type 'I' is not assignable to type 'D': +!!! Private property 'foo' cannot be reimplemented. + d = e; // error + ~ +!!! Type 'E' is not assignable to type 'D': +!!! Private property 'foo' cannot be reimplemented. + + e = a; // errror + ~ +!!! Type '{ foo: string; }' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = b; // errror + ~ +!!! Type 'Base' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = i; // errror + ~ +!!! Type 'I' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = d; // errror + ~ +!!! Type 'D' is not assignable to type 'E': +!!! Private property 'foo' cannot be reimplemented. + e = e; + + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js new file mode 100644 index 0000000000000..c6c7da92653a1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js @@ -0,0 +1,202 @@ +//// [assignmentCompatWithObjectMembersAccessibility.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M + +module TargetIsPublic { + // targets + class Base { + public foo: string; + } + + interface I { + foo: string; + } + + var a: { foo: string; } + var b: Base; + var i: I; + + // sources + class D { + public foo: string; + } + + class E { + private foo: string; + } + var d: D; + var e: E; + + a = b; + a = i; + a = d; + a = e; // error + + b = a; + b = i; + b = d; + b = e; // error + + i = a; + i = b; + i = d; + i = e; // error + + d = a; + d = b; + d = i; + d = e; // error + + e = a; // errror + e = b; // errror + e = i; // errror + e = d; // errror + e = e; + +} + +module TargetIsPublic { + // targets + class Base { + private foo: string; + } + + interface I extends Base { + } + + var a: { foo: string; } + var b: Base; + var i: I; + + // sources + class D { + public foo: string; + } + + class E { + private foo: string; + } + + var d: D; + var e: E; + + a = b; // error + a = i; // error + a = d; + a = e; // error + + b = a; // error + b = i; + b = d; // error + b = e; // error + b = b; + + i = a; // error + i = b; + i = d; // error + i = e; // error + i = i; + + d = a; + d = b; // error + d = i; // error + d = e; // error + + e = a; // errror + e = b; // errror + e = i; // errror + e = d; // errror + e = e; + +} + +//// [assignmentCompatWithObjectMembersAccessibility.js] +var TargetIsPublic; +(function (TargetIsPublic) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var a; + var b; + var i; + var D = (function () { + function D() { + } + return D; + })(); + var E = (function () { + function E() { + } + return E; + })(); + var d; + var e; + a = b; + a = i; + a = d; + a = e; + b = a; + b = i; + b = d; + b = e; + i = a; + i = b; + i = d; + i = e; + d = a; + d = b; + d = i; + d = e; + e = a; + e = b; + e = i; + e = d; + e = e; +})(TargetIsPublic || (TargetIsPublic = {})); +var TargetIsPublic; +(function (TargetIsPublic) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var a; + var b; + var i; + var D = (function () { + function D() { + } + return D; + })(); + var E = (function () { + function E() { + } + return E; + })(); + var d; + var e; + a = b; + a = i; + a = d; + a = e; + b = a; + b = i; + b = d; + b = e; + b = b; + i = a; + i = b; + i = d; + i = e; + i = i; + d = a; + d = b; + d = i; + d = e; + e = a; + e = b; + e = i; + e = d; + e = e; +})(TargetIsPublic || (TargetIsPublic = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js new file mode 100644 index 0000000000000..d72a006b176d7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js @@ -0,0 +1,82 @@ +//// [assignmentCompatWithObjectMembersNumericNames.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// numeric named properties work correctly, no errors expected + +class S { 1: string; } +class T { 1.: string; } +var s: S; +var t: T; + +interface S2 { 1: string; bar?: string } +interface T2 { 1.0: string; baz?: string } +var s2: S2; +var t2: T2; + +var a: { 1.: string; bar?: string } +var b: { 1.0: string; baz?: string } + +var a2 = { 1.0: '' }; +var b2 = { 1: '' }; + +s = t; +t = s; +s = s2; +s = a2; + +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; + +a = b; +b = a; +a = s; +a = s2; +a = a2; + +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; + + +//// [assignmentCompatWithObjectMembersNumericNames.js] +var S = (function () { + function S() { + } + return S; +})(); +var T = (function () { + function T() { + } + return T; +})(); +var s; +var t; +var s2; +var t2; +var a; +var b; +var a2 = { 1.0: '' }; +var b2 = { 1: '' }; +s = t; +t = s; +s = s2; +s = a2; +s2 = t2; +t2 = s2; +s2 = t; +s2 = b; +s2 = a2; +a = b; +b = a; +a = s; +a = s2; +a = a2; +a2 = b2; +b2 = a2; +a2 = b; +a2 = t2; +a2 = t; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt new file mode 100644 index 0000000000000..1e2b287f9420a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -0,0 +1,107 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts (6 errors) ==== + // Derived member is not optional but base member is, should be ok + + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + + module TargetHasOptional { + // targets + interface C { + opt?: Base + } + var c: C; + + var a: { opt?: Base; } + var b: typeof a = { opt: new Base() } + + // sources + interface D { + opt: Base; + } + interface E { + opt: Derived; + } + interface F { + opt?: Derived; + } + var d: D; + var e: E; + var f: F; + + // all ok + c = d; + c = e; + c = f; + c = a; + + a = d; + a = e; + a = f; + a = c; + + b = d; + b = e; + b = f; + b = a; + b = c; + } + + module SourceHasOptional { + // targets + interface C { + opt: Base + } + var c: C; + + var a: { opt: Base; } + var b = { opt: new Base() } + + // sources + interface D { + opt?: Base; + } + interface E { + opt?: Derived; + } + interface F { + opt: Derived; + } + var d: D; + var e: E; + var f: F; + + c = d; // error + ~ +!!! Type 'D' is not assignable to type 'C': +!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. + c = e; // error + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. + c = f; // ok + c = a; // ok + + a = d; // error + ~ +!!! Type 'D' is not assignable to type '{ opt: Base; }': +!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. + a = e; // error + ~ +!!! Type 'E' is not assignable to type '{ opt: Base; }': +!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. + a = f; // ok + a = c; // ok + + b = d; // error + ~ +!!! Type 'D' is not assignable to type '{ opt: Base; }': +!!! Required property 'opt' cannot be reimplemented with optional property in 'D'. + b = e; // error + ~ +!!! Type 'E' is not assignable to type '{ opt: Base; }': +!!! Required property 'opt' cannot be reimplemented with optional property in 'E'. + b = f; // ok + b = a; // ok + b = c; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js new file mode 100644 index 0000000000000..1dd81e0d428d4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -0,0 +1,160 @@ +//// [assignmentCompatWithObjectMembersOptionality.ts] +// Derived member is not optional but base member is, should be ok + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } + +module TargetHasOptional { + // targets + interface C { + opt?: Base + } + var c: C; + + var a: { opt?: Base; } + var b: typeof a = { opt: new Base() } + + // sources + interface D { + opt: Base; + } + interface E { + opt: Derived; + } + interface F { + opt?: Derived; + } + var d: D; + var e: E; + var f: F; + + // all ok + c = d; + c = e; + c = f; + c = a; + + a = d; + a = e; + a = f; + a = c; + + b = d; + b = e; + b = f; + b = a; + b = c; +} + +module SourceHasOptional { + // targets + interface C { + opt: Base + } + var c: C; + + var a: { opt: Base; } + var b = { opt: new Base() } + + // sources + interface D { + opt?: Base; + } + interface E { + opt?: Derived; + } + interface F { + opt: Derived; + } + var d: D; + var e: E; + var f: F; + + c = d; // error + c = e; // error + c = f; // ok + c = a; // ok + + a = d; // error + a = e; // error + a = f; // ok + a = c; // ok + + b = d; // error + b = e; // error + b = f; // ok + b = a; // ok + b = c; // ok +} + +//// [assignmentCompatWithObjectMembersOptionality.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var TargetHasOptional; +(function (TargetHasOptional) { + var c; + var a; + var b = { opt: new Base() }; + var d; + var e; + var f; + c = d; + c = e; + c = f; + c = a; + a = d; + a = e; + a = f; + a = c; + b = d; + b = e; + b = f; + b = a; + b = c; +})(TargetHasOptional || (TargetHasOptional = {})); +var SourceHasOptional; +(function (SourceHasOptional) { + var c; + var a; + var b = { opt: new Base() }; + var d; + var e; + var f; + c = d; + c = e; + c = f; + c = a; + a = d; + a = e; + a = f; + a = c; + b = d; + b = e; + b = f; + b = a; + b = c; +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt new file mode 100644 index 0000000000000..4d4344a8af243 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -0,0 +1,117 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts (9 errors) ==== + // M is optional and S contains no property with the same name as M + // N is optional and T contains no property with the same name as N + + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + + module TargetHasOptional { + // targets + interface C { + opt?: Base + } + var c: C; + + var a: { opt?: Base; } + var b: typeof a = { opt: new Base() } + + // sources + interface D { + other: Base; + } + interface E { + other: Derived; + } + interface F { + other?: Derived; + } + var d: D; + var e: E; + var f: F; + + // all ok + c = d; + c = e; + c = f; + c = a; + + a = d; + a = e; + a = f; + a = c; + + b = d; + b = e; + b = f; + b = a; + b = c; + } + + module SourceHasOptional { + // targets + interface C { + opt: Base + } + var c: C; + + var a: { opt: Base; } + var b = { opt: new Base() } + + // sources + interface D { + other?: Base; + } + interface E { + other?: Derived; + } + interface F { + other: Derived; + } + var d: D; + var e: E; + var f: F; + + c = d; // error + ~ +!!! Type 'D' is not assignable to type 'C': +!!! Property 'opt' is missing in type 'D'. + c = e; // error + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Property 'opt' is missing in type 'E'. + c = f; // error + ~ +!!! Type 'F' is not assignable to type 'C': +!!! Property 'opt' is missing in type 'F'. + c = a; // ok + + a = d; // error + ~ +!!! Type 'D' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'D'. + a = e; // error + ~ +!!! Type 'E' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'E'. + a = f; // error + ~ +!!! Type 'F' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'F'. + a = c; // ok + + b = d; // error + ~ +!!! Type 'D' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'D'. + b = e; // error + ~ +!!! Type 'E' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'E'. + b = f; // error + ~ +!!! Type 'F' is not assignable to type '{ opt: Base; }': +!!! Property 'opt' is missing in type 'F'. + b = a; // ok + b = c; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js new file mode 100644 index 0000000000000..85a3bc4f6fad5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -0,0 +1,161 @@ +//// [assignmentCompatWithObjectMembersOptionality2.ts] +// M is optional and S contains no property with the same name as M +// N is optional and T contains no property with the same name as N + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } + +module TargetHasOptional { + // targets + interface C { + opt?: Base + } + var c: C; + + var a: { opt?: Base; } + var b: typeof a = { opt: new Base() } + + // sources + interface D { + other: Base; + } + interface E { + other: Derived; + } + interface F { + other?: Derived; + } + var d: D; + var e: E; + var f: F; + + // all ok + c = d; + c = e; + c = f; + c = a; + + a = d; + a = e; + a = f; + a = c; + + b = d; + b = e; + b = f; + b = a; + b = c; +} + +module SourceHasOptional { + // targets + interface C { + opt: Base + } + var c: C; + + var a: { opt: Base; } + var b = { opt: new Base() } + + // sources + interface D { + other?: Base; + } + interface E { + other?: Derived; + } + interface F { + other: Derived; + } + var d: D; + var e: E; + var f: F; + + c = d; // error + c = e; // error + c = f; // error + c = a; // ok + + a = d; // error + a = e; // error + a = f; // error + a = c; // ok + + b = d; // error + b = e; // error + b = f; // error + b = a; // ok + b = c; // ok +} + +//// [assignmentCompatWithObjectMembersOptionality2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var TargetHasOptional; +(function (TargetHasOptional) { + var c; + var a; + var b = { opt: new Base() }; + var d; + var e; + var f; + c = d; + c = e; + c = f; + c = a; + a = d; + a = e; + a = f; + a = c; + b = d; + b = e; + b = f; + b = a; + b = c; +})(TargetHasOptional || (TargetHasOptional = {})); +var SourceHasOptional; +(function (SourceHasOptional) { + var c; + var a; + var b = { opt: new Base() }; + var d; + var e; + var f; + c = d; + c = e; + c = f; + c = a; + a = d; + a = e; + a = f; + a = c; + b = d; + b = e; + b = f; + b = a; + b = c; +})(SourceHasOptional || (SourceHasOptional = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt new file mode 100644 index 0000000000000..954fbfe88e499 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -0,0 +1,173 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts (29 errors) ==== + // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M + // string named numeric properties work correctly, errors below unless otherwise noted + + module JustStrings { + class S { '1': string; } + class T { '1.': string; } + var s: S; + var t: T; + + interface S2 { '1': string; bar?: string } + interface T2 { '1.0': string; baz?: string } + var s2: S2; + var t2: T2; + + var a: { '1.': string; bar?: string } + var b: { '1.0': string; baz?: string } + + var a2 = { '1.0': '' }; + var b2 = { '1': '' }; + + s = t; + ~ +!!! Type 'T' is not assignable to type 'S': +!!! Property ''1'' is missing in type 'T'. + t = s; + ~ +!!! Type 'S' is not assignable to type 'T': +!!! Property ''1.'' is missing in type 'S'. + s = s2; // ok + s = a2; + ~ +!!! Type '{ '1.0': string; }' is not assignable to type 'S': +!!! Property ''1'' is missing in type '{ '1.0': string; }'. + + s2 = t2; + ~~ +!!! Type 'T2' is not assignable to type 'S2': +!!! Property ''1'' is missing in type 'T2'. + t2 = s2; + ~~ +!!! Type 'S2' is not assignable to type 'T2': +!!! Property ''1.0'' is missing in type 'S2'. + s2 = t; + ~~ +!!! Type 'T' is not assignable to type 'S2': +!!! Property ''1'' is missing in type 'T'. + s2 = b; + ~~ +!!! Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': +!!! Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. + s2 = a2; + ~~ +!!! Type '{ '1.0': string; }' is not assignable to type 'S2': +!!! Property ''1'' is missing in type '{ '1.0': string; }'. + + a = b; + ~ +!!! Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. + b = a; + ~ +!!! Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': +!!! Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. + a = s; + ~ +!!! Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type 'S'. + a = s2; + ~ +!!! Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type 'S2'. + a = a2; + ~ +!!! Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type '{ '1.0': string; }'. + + a2 = b2; + ~~ +!!! Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type '{ '1': string; }'. + b2 = a2; + ~~ +!!! Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': +!!! Property ''1'' is missing in type '{ '1.0': string; }'. + a2 = b; // ok + a2 = t2; // ok + a2 = t; + ~~ +!!! Type 'T' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type 'T'. + } + + module NumbersAndStrings { + class S { '1': string; } + class T { 1: string; } + var s: S; + var t: T; + + interface S2 { '1': string; bar?: string } + interface T2 { 1.0: string; baz?: string } + var s2: S2; + var t2: T2; + + var a: { '1.': string; bar?: string } + var b: { 1.0: string; baz?: string } + + var a2 = { '1.0': '' }; + var b2 = { 1.: '' }; + + s = t; // ok + t = s; // ok + s = s2; // ok + s = a2; // error + ~ +!!! Type '{ '1.0': string; }' is not assignable to type 'S': +!!! Property ''1'' is missing in type '{ '1.0': string; }'. + + s2 = t2; // ok + t2 = s2; // ok + s2 = t; // ok + s2 = b; // ok + s2 = a2; // error + ~~ +!!! Type '{ '1.0': string; }' is not assignable to type 'S2': +!!! Property ''1'' is missing in type '{ '1.0': string; }'. + + a = b; // error + ~ +!!! Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. + b = a; // error + ~ +!!! Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': +!!! Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. + a = s; // error + ~ +!!! Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type 'S'. + a = s2; // error + ~ +!!! Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type 'S2'. + a = a2; // error + ~ +!!! Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type '{ '1.0': string; }'. + a = b2; // error + ~ +!!! Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! Property ''1.'' is missing in type '{ 1.: string; }'. + + a2 = b2; // error + ~~ +!!! Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type '{ 1.: string; }'. + b2 = a2; // error + ~~ +!!! Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': +!!! Property '1.' is missing in type '{ '1.0': string; }'. + a2 = b; // error + ~~ +!!! Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. + a2 = t2; // error + ~~ +!!! Type 'T2' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type 'T2'. + a2 = t; // error + ~~ +!!! Type 'T' is not assignable to type '{ '1.0': string; }': +!!! Property ''1.0'' is missing in type 'T'. + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js new file mode 100644 index 0000000000000..ad3a82cffdb6a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js @@ -0,0 +1,169 @@ +//// [assignmentCompatWithObjectMembersStringNumericNames.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// string named numeric properties work correctly, errors below unless otherwise noted + +module JustStrings { + class S { '1': string; } + class T { '1.': string; } + var s: S; + var t: T; + + interface S2 { '1': string; bar?: string } + interface T2 { '1.0': string; baz?: string } + var s2: S2; + var t2: T2; + + var a: { '1.': string; bar?: string } + var b: { '1.0': string; baz?: string } + + var a2 = { '1.0': '' }; + var b2 = { '1': '' }; + + s = t; + t = s; + s = s2; // ok + s = a2; + + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + + a = b; + b = a; + a = s; + a = s2; + a = a2; + + a2 = b2; + b2 = a2; + a2 = b; // ok + a2 = t2; // ok + a2 = t; +} + +module NumbersAndStrings { + class S { '1': string; } + class T { 1: string; } + var s: S; + var t: T; + + interface S2 { '1': string; bar?: string } + interface T2 { 1.0: string; baz?: string } + var s2: S2; + var t2: T2; + + var a: { '1.': string; bar?: string } + var b: { 1.0: string; baz?: string } + + var a2 = { '1.0': '' }; + var b2 = { 1.: '' }; + + s = t; // ok + t = s; // ok + s = s2; // ok + s = a2; // error + + s2 = t2; // ok + t2 = s2; // ok + s2 = t; // ok + s2 = b; // ok + s2 = a2; // error + + a = b; // error + b = a; // error + a = s; // error + a = s2; // error + a = a2; // error + a = b2; // error + + a2 = b2; // error + b2 = a2; // error + a2 = b; // error + a2 = t2; // error + a2 = t; // error +} + +//// [assignmentCompatWithObjectMembersStringNumericNames.js] +var JustStrings; +(function (JustStrings) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { '1.0': '' }; + var b2 = { '1': '' }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(JustStrings || (JustStrings = {})); +var NumbersAndStrings; +(function (NumbersAndStrings) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { '1.0': '' }; + var b2 = { 1.: '' }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a = b2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(NumbersAndStrings || (NumbersAndStrings = {})); diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt new file mode 100644 index 0000000000000..350ff22c18d4f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/compiler/assignmentCompatWithOverloads.ts (4 errors) ==== + function f1(x: string): number { return null; } + + function f2(x: string): string { return null; } + + function f3(x: number): number { return null; } + + function f4(x: string): string; + + function f4(x: number): number; + + function f4(x: any): any { return undefined; } + + var g: (s1: string) => number; + + g = f1; // OK + + g = f2; // Error + ~ +!!! Type '(x: string) => string' is not assignable to type '(s1: string) => number': +!!! Type 'string' is not assignable to type 'number'. + + g = f3; // Error + ~ +!!! Type '(x: number) => number' is not assignable to type '(s1: string) => number': +!!! Types of parameters 'x' and 's1' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + g = f4; // Error + ~ +!!! Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': +!!! Type 'string' is not assignable to type 'number'. + + class C { + constructor(x: string); + constructor(x: any) {} + } + + var d: new(x: number) => void; + + d = C; // Error + ~ +!!! Type 'typeof C' is not assignable to type 'new (x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.js b/tests/baselines/reference/assignmentCompatWithOverloads.js new file mode 100644 index 0000000000000..0bd69767515ec --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithOverloads.js @@ -0,0 +1,57 @@ +//// [assignmentCompatWithOverloads.ts] +function f1(x: string): number { return null; } + +function f2(x: string): string { return null; } + +function f3(x: number): number { return null; } + +function f4(x: string): string; + +function f4(x: number): number; + +function f4(x: any): any { return undefined; } + +var g: (s1: string) => number; + +g = f1; // OK + +g = f2; // Error + +g = f3; // Error + +g = f4; // Error + +class C { + constructor(x: string); +constructor(x: any) {} +} + +var d: new(x: number) => void; + +d = C; // Error + +//// [assignmentCompatWithOverloads.js] +function f1(x) { + return null; +} +function f2(x) { + return null; +} +function f3(x) { + return null; +} +function f4(x) { + return undefined; +} +var g; +g = f1; +g = f2; +g = f3; +g = f4; +var C = (function () { + function C(x) { + } + return C; +})(); +var d; +d = C; diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt new file mode 100644 index 0000000000000..b9e63626e1104 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -0,0 +1,92 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts (8 errors) ==== + // index signatures must be compatible in assignments + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + class A { + [x: string]: Base; + } + + var a: A; + + var b: { [x: string]: Derived; } + a = b; // ok + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: string]: Derived2; } + a = b2; // ok + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + module Generics { + class A { + [x: string]: T; + } + + class B extends A { + [x: string]: Derived; // ok + } + + var b1: { [x: string]: Derived; }; + var a1: A; + a1 = b1; // ok + b1 = a1; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + class B2 extends A { + [x: string]: Derived2; // ok + } + + var b2: { [x: string]: Derived2; }; + a1 = b2; // ok + b2 = a1; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + function foo() { + var b3: { [x: string]: Derived; }; + var a3: A; + a3 = b3; // error + ~~ +!!! Type '{ [x: string]: Derived; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'T'. + b3 = a3; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b4: { [x: string]: Derived2; }; + a3 = b4; // error + ~~ +!!! Type '{ [x: string]: Derived2; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived2' is not assignable to type 'T'. + b4 = a3; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js new file mode 100644 index 0000000000000..58340fe08cc20 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -0,0 +1,112 @@ +//// [assignmentCompatWithStringIndexer.ts] +// index signatures must be compatible in assignments + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +class A { + [x: string]: Base; +} + +var a: A; + +var b: { [x: string]: Derived; } +a = b; // ok +b = a; // error + +var b2: { [x: string]: Derived2; } +a = b2; // ok +b2 = a; // error + +module Generics { + class A { + [x: string]: T; + } + + class B extends A { + [x: string]: Derived; // ok + } + + var b1: { [x: string]: Derived; }; + var a1: A; + a1 = b1; // ok + b1 = a1; // error + + class B2 extends A { + [x: string]: Derived2; // ok + } + + var b2: { [x: string]: Derived2; }; + a1 = b2; // ok + b2 = a1; // error + + function foo() { + var b3: { [x: string]: Derived; }; + var a3: A; + a3 = b3; // error + b3 = a3; // error + + var b4: { [x: string]: Derived2; }; + a3 = b4; // error + b4 = a3; // error + } +} + +//// [assignmentCompatWithStringIndexer.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var a; +var b; +a = b; +b = a; +var b2; +a = b2; +b2 = a; +var Generics; +(function (Generics) { + var A = (function () { + function A() { + } + return A; + })(); + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(A); + var b1; + var a1; + a1 = b1; + b1 = a1; + var B2 = (function (_super) { + __extends(B2, _super); + function B2() { + _super.apply(this, arguments); + } + return B2; + })(A); + var b2; + a1 = b2; + b2 = a1; + function foo() { + var b3; + var a3; + a3 = b3; + b3 = a3; + var b4; + a3 = b4; + b4 = a3; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt new file mode 100644 index 0000000000000..e2ab94c037ef9 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -0,0 +1,92 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts (8 errors) ==== + // index signatures must be compatible in assignments + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + interface A { + [x: string]: Base; + } + + var a: A; + + var b: { [x: string]: Derived; } + a = b; // ok + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b2: { [x: string]: Derived2; } + a = b2; // ok + b2 = a; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + module Generics { + interface A { + [x: string]: T; + } + + interface B extends A { + [x: string]: Derived; // ok + } + + var b1: { [x: string]: Derived; }; + var a1: A; + a1 = b1; // ok + b1 = a1; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + interface B2 extends A { + [x: string]: Derived2; // ok + } + + var b2: { [x: string]: Derived2; }; + a1 = b2; // ok + b2 = a1; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'Base' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + + function foo() { + var b3: { [x: string]: Derived; }; + var a3: A; + a3 = b3; // error + ~~ +!!! Type '{ [x: string]: Derived; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived' is not assignable to type 'T'. + b3 = a3; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived': +!!! Property 'bar' is missing in type 'Base'. + + var b4: { [x: string]: Derived2; }; + a3 = b4; // error + ~~ +!!! Type '{ [x: string]: Derived2; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'Derived2' is not assignable to type 'T'. + b4 = a3; // error + ~~ +!!! Type 'A' is not assignable to type '{ [x: string]: Derived2; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'Derived2': +!!! Property 'baz' is missing in type 'Base'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.js b/tests/baselines/reference/assignmentCompatWithStringIndexer2.js new file mode 100644 index 0000000000000..ae8af19da8a18 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.js @@ -0,0 +1,82 @@ +//// [assignmentCompatWithStringIndexer2.ts] +// index signatures must be compatible in assignments + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +interface A { + [x: string]: Base; +} + +var a: A; + +var b: { [x: string]: Derived; } +a = b; // ok +b = a; // error + +var b2: { [x: string]: Derived2; } +a = b2; // ok +b2 = a; // error + +module Generics { + interface A { + [x: string]: T; + } + + interface B extends A { + [x: string]: Derived; // ok + } + + var b1: { [x: string]: Derived; }; + var a1: A; + a1 = b1; // ok + b1 = a1; // error + + interface B2 extends A { + [x: string]: Derived2; // ok + } + + var b2: { [x: string]: Derived2; }; + a1 = b2; // ok + b2 = a1; // error + + function foo() { + var b3: { [x: string]: Derived; }; + var a3: A; + a3 = b3; // error + b3 = a3; // error + + var b4: { [x: string]: Derived2; }; + a3 = b4; // error + b4 = a3; // error + } +} + +//// [assignmentCompatWithStringIndexer2.js] +var a; +var b; +a = b; +b = a; +var b2; +a = b2; +b2 = a; +var Generics; +(function (Generics) { + var b1; + var a1; + a1 = b1; + b1 = a1; + var b2; + a1 = b2; + b2 = a1; + function foo() { + var b3; + var a3; + a3 = b3; + b3 = a3; + var b4; + a3 = b4; + b4 = a3; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt new file mode 100644 index 0000000000000..f4f6dd269f8da --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts (3 errors) ==== + // Derived type indexer must be subtype of base type indexer + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + var a: A; + ~ +!!! Cannot find name 'A'. + var b1: { [x: string]: string; } + a = b1; // error + b1 = a; // error + + module Generics { + class A { + [x: string]: T; + } + + function foo() { + var a: A; + var b: { [x: string]: string; } + a = b; // error + ~ +!!! Type '{ [x: string]: string; }' is not assignable to type 'A': +!!! Index signatures are incompatible: +!!! Type 'string' is not assignable to type 'T'. + b = a; // error + ~ +!!! Type 'A' is not assignable to type '{ [x: string]: string; }': +!!! Index signatures are incompatible: +!!! Type 'T' is not assignable to type 'string'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.js b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js new file mode 100644 index 0000000000000..b706859006fff --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js @@ -0,0 +1,44 @@ +//// [assignmentCompatWithStringIndexer3.ts] +// Derived type indexer must be subtype of base type indexer + +interface Base { foo: string; } +interface Derived extends Base { bar: string; } +interface Derived2 extends Derived { baz: string; } + +var a: A; +var b1: { [x: string]: string; } +a = b1; // error +b1 = a; // error + +module Generics { + class A { + [x: string]: T; + } + + function foo() { + var a: A; + var b: { [x: string]: string; } + a = b; // error + b = a; // error + } +} + +//// [assignmentCompatWithStringIndexer3.js] +var a; +var b1; +a = b1; +b1 = a; +var Generics; +(function (Generics) { + var A = (function () { + function A() { + } + return A; + })(); + function foo() { + var a; + var b; + a = b; + b = a; + } +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js new file mode 100644 index 0000000000000..c48c9f1c27514 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js @@ -0,0 +1,4 @@ +//// [assignmentCompatWithWithGenericConstructSignatures.ts] + + +//// [assignmentCompatWithWithGenericConstructSignatures.js] diff --git a/tests/baselines/reference/assignmentCompatability1.js b/tests/baselines/reference/assignmentCompatability1.js new file mode 100644 index 0000000000000..f629d5eba27e7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability1.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability1.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa = {};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability1.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa = {}; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt new file mode 100644 index 0000000000000..25f76e83c07af --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability10.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export class classWithPublicAndOptional { constructor(public one: T, public two?: U) {} } var x4 = new classWithPublicAndOptional(1);; + export var __val__x4 = x4; + } + __test2__.__val__x4 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': +!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability10.js b/tests/baselines/reference/assignmentCompatability10.js new file mode 100644 index 0000000000000..bbcc8e879e3bb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability10.js @@ -0,0 +1,34 @@ +//// [assignmentCompatability10.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithPublicAndOptional { constructor(public one: T, public two?: U) {} } var x4 = new classWithPublicAndOptional(1);; + export var __val__x4 = x4; +} +__test2__.__val__x4 = __test1__.__val__obj4 + +//// [assignmentCompatability10.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithPublicAndOptional = (function () { + function classWithPublicAndOptional(one, two) { + this.one = one; + this.two = two; + } + return classWithPublicAndOptional; + })(); + __test2__.classWithPublicAndOptional = classWithPublicAndOptional; + var x4 = new classWithPublicAndOptional(1); + ; + __test2__.__val__x4 = x4; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x4 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt new file mode 100644 index 0000000000000..d56d0c3adce92 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability11.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: 1}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.js b/tests/baselines/reference/assignmentCompatability11.js new file mode 100644 index 0000000000000..992e38f772634 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability11.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability11.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: 1}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability11.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: 1 }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt new file mode 100644 index 0000000000000..af8b57365b4b6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability12.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: "1"}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability12.js b/tests/baselines/reference/assignmentCompatability12.js new file mode 100644 index 0000000000000..3c802aab6e3d6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability12.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability12.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: "1"}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability12.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: "1" }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt new file mode 100644 index 0000000000000..5cdfab0b13cc8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability13.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: "1"}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.js b/tests/baselines/reference/assignmentCompatability13.js new file mode 100644 index 0000000000000..ef4f24f710029 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability13.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability13.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: "1"}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability13.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: "1" }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt new file mode 100644 index 0000000000000..96b23b20dd520 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability14.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: true}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability14.js b/tests/baselines/reference/assignmentCompatability14.js new file mode 100644 index 0000000000000..bd4445cb515b0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability14.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability14.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: true}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability14.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: true }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt new file mode 100644 index 0000000000000..962b87624ba82 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability15.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: true}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.js b/tests/baselines/reference/assignmentCompatability15.js new file mode 100644 index 0000000000000..37f1be4bc99d4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability15.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability15.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: true}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability15.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: true }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt new file mode 100644 index 0000000000000..72ba13966ecf8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability16.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: [1]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability16.js b/tests/baselines/reference/assignmentCompatability16.js new file mode 100644 index 0000000000000..43c832016b0e3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability16.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability16.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: [1]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability16.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: [1] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt new file mode 100644 index 0000000000000..0f2560609a843 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability17.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: [1]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'any[]': +!!! Property 'join' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.js b/tests/baselines/reference/assignmentCompatability17.js new file mode 100644 index 0000000000000..09ce24b8f5da6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability17.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability17.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: [1]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability17.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: [1] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt new file mode 100644 index 0000000000000..2e63e9c002451 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability18.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: [1]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'number[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.js b/tests/baselines/reference/assignmentCompatability18.js new file mode 100644 index 0000000000000..ad93e96303ff2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability18.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability18.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: [1]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability18.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: [1] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt new file mode 100644 index 0000000000000..ce8beff52c8b8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/assignmentCompatability19.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: [1]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'number[]': +!!! Types of property 'concat' are incompatible: +!!! Type '(...strings: string[]) => string' is not assignable to type '{ (...items: U[]): number[]; (...items: number[]): number[]; }': +!!! Types of parameters 'strings' and 'items' are incompatible: +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.js b/tests/baselines/reference/assignmentCompatability19.js new file mode 100644 index 0000000000000..f330f94e81c6b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability19.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability19.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: [1]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability19.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: [1] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability2.js b/tests/baselines/reference/assignmentCompatability2.js new file mode 100644 index 0000000000000..207942875bf14 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability2.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability2.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability2.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt new file mode 100644 index 0000000000000..6a4cdd046b6c1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability20.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: ["1"]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.js b/tests/baselines/reference/assignmentCompatability20.js new file mode 100644 index 0000000000000..321ec78ee17ce --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability20.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability20.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: ["1"]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability20.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: ["1"] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt new file mode 100644 index 0000000000000..9da82d08a6198 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability21.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: ["1"]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'string[]': +!!! Property 'join' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.js b/tests/baselines/reference/assignmentCompatability21.js new file mode 100644 index 0000000000000..215ab5dc3979b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability21.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability21.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: ["1"]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability21.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: ["1"] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt new file mode 100644 index 0000000000000..1f707044005bf --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability22.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {one: [true]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'boolean[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.js b/tests/baselines/reference/assignmentCompatability22.js new file mode 100644 index 0000000000000..04cc2a2d0abcf --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability22.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability22.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: [true]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability22.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: [true] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt new file mode 100644 index 0000000000000..31f58604289c5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/assignmentCompatability23.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = {two: [true]}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'boolean[]': +!!! Types of property 'concat' are incompatible: +!!! Type '(...strings: string[]) => string' is not assignable to type '{ (...items: U[]): boolean[]; (...items: boolean[]): boolean[]; }': +!!! Types of parameters 'strings' and 'items' are incompatible: +!!! Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.js b/tests/baselines/reference/assignmentCompatability23.js new file mode 100644 index 0000000000000..1d03236436059 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability23.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability23.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {two: [true]}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability23.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { two: [true] }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt new file mode 100644 index 0000000000000..70a6717b9b7be --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj = function f(a: Tstring) { return a; };; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.js b/tests/baselines/reference/assignmentCompatability24.js new file mode 100644 index 0000000000000..7eda1e6126691 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability24.js @@ -0,0 +1,28 @@ +//// [assignmentCompatability24.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = function f(a: Tstring) { return a; };; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability24.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = function f(a) { + return a; + }; + ; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt new file mode 100644 index 0000000000000..bc3de672ea217 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability25.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{two:number;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': +!!! Types of property 'two' are incompatible: +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.js b/tests/baselines/reference/assignmentCompatability25.js new file mode 100644 index 0000000000000..4f365e9049ce0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability25.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability25.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{two:number;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability25.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt new file mode 100644 index 0000000000000..771ae72eb41f5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability26.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:string;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability26.js b/tests/baselines/reference/assignmentCompatability26.js new file mode 100644 index 0000000000000..e2ae6b766dfa3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability26.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability26.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:string;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability26.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt new file mode 100644 index 0000000000000..26948fe97eabe --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability27.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{two:string;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.js b/tests/baselines/reference/assignmentCompatability27.js new file mode 100644 index 0000000000000..be5b06dab7c83 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability27.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability27.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{two:string;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability27.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt new file mode 100644 index 0000000000000..2b50a9b3596cc --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentCompatability28.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:boolean;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability28.js b/tests/baselines/reference/assignmentCompatability28.js new file mode 100644 index 0000000000000..eef6f0a5ef05c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability28.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability28.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:boolean;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability28.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt new file mode 100644 index 0000000000000..24b2287c57a04 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability29.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:any[];};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'any[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.js b/tests/baselines/reference/assignmentCompatability29.js new file mode 100644 index 0000000000000..c3410a943cab5 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability29.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability29.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:any[];};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability29.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability3.js b/tests/baselines/reference/assignmentCompatability3.js new file mode 100644 index 0000000000000..7120e6ce3e24b --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability3.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability3.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj = {one: 1}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability3.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj = { one: 1 }; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt new file mode 100644 index 0000000000000..1f93bccf20364 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability30.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:number[];};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'number[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.js b/tests/baselines/reference/assignmentCompatability30.js new file mode 100644 index 0000000000000..261c86ad584b6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability30.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability30.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:number[];};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability30.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt new file mode 100644 index 0000000000000..274ec67a1429e --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability31.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:string[];};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.js b/tests/baselines/reference/assignmentCompatability31.js new file mode 100644 index 0000000000000..152b588b72cbf --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability31.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability31.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:string[];};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability31.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt new file mode 100644 index 0000000000000..9f979a127c48d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentCompatability32.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{one:boolean[];};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'boolean[]': +!!! Property 'concat' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.js b/tests/baselines/reference/assignmentCompatability32.js new file mode 100644 index 0000000000000..b9ddacff90cc4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability32.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability32.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:boolean[];};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability32.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt new file mode 100644 index 0000000000000..3f9f4716f814a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj: { (a: Tstring): Tstring; }; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.js b/tests/baselines/reference/assignmentCompatability33.js new file mode 100644 index 0000000000000..80dfcfc4f7acd --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability33.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability33.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj: { (a: Tstring): Tstring; }; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability33.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt new file mode 100644 index 0000000000000..1ae98d98d37e6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var obj: { (a:Tnumber):Tnumber;}; + export var __val__obj = obj; + } + __test2__.__val__obj = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.js b/tests/baselines/reference/assignmentCompatability34.js new file mode 100644 index 0000000000000..ab324a103963d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability34.js @@ -0,0 +1,25 @@ +//// [assignmentCompatability34.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var obj: { (a:Tnumber):Tnumber;}; + export var __val__obj = obj; +} +__test2__.__val__obj = __test1__.__val__obj4 + +//// [assignmentCompatability34.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.obj; + __test2__.__val__obj = __test2__.obj; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt new file mode 100644 index 0000000000000..ac6c09a8bec08 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability35.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{[index:number]:number;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': +!!! Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability35.js b/tests/baselines/reference/assignmentCompatability35.js new file mode 100644 index 0000000000000..1b79a83146b2e --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability35.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability35.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{[index:number]:number;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability35.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt new file mode 100644 index 0000000000000..acf5aa5344ea6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability36.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{[index:string]:any;};; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': +!!! Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.js b/tests/baselines/reference/assignmentCompatability36.js new file mode 100644 index 0000000000000..62332f741d4c4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability36.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{[index:string]:any;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability36.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt new file mode 100644 index 0000000000000..f097e9664d3f9 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{ new (param: Tnumber); };; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.js b/tests/baselines/reference/assignmentCompatability37.js new file mode 100644 index 0000000000000..8625cae42e575 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability37.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability37.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{ new (param: Tnumber); };; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability37.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt new file mode 100644 index 0000000000000..9efa19b03385d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export var aa:{ new (param: Tstring); };; + export var __val__aa = aa; + } + __test2__.__val__aa = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.js b/tests/baselines/reference/assignmentCompatability38.js new file mode 100644 index 0000000000000..22096b68f25f8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability38.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability38.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{ new (param: Tstring); };; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability38.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt new file mode 100644 index 0000000000000..f924512d461b7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability39.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export class classWithTwoPublic { constructor(public one: T, public two: U) {} } var x2 = new classWithTwoPublic(1, "a");; + export var __val__x2 = x2; + } + __test2__.__val__x2 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': +!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.js b/tests/baselines/reference/assignmentCompatability39.js new file mode 100644 index 0000000000000..70e8a69229002 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability39.js @@ -0,0 +1,34 @@ +//// [assignmentCompatability39.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithTwoPublic { constructor(public one: T, public two: U) {} } var x2 = new classWithTwoPublic(1, "a");; + export var __val__x2 = x2; +} +__test2__.__val__x2 = __test1__.__val__obj4 + +//// [assignmentCompatability39.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithTwoPublic = (function () { + function classWithTwoPublic(one, two) { + this.one = one; + this.two = two; + } + return classWithTwoPublic; + })(); + __test2__.classWithTwoPublic = classWithTwoPublic; + var x2 = new classWithTwoPublic(1, "a"); + ; + __test2__.__val__x2 = x2; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x2 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability4.js b/tests/baselines/reference/assignmentCompatability4.js new file mode 100644 index 0000000000000..2f7d33b8d5537 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability4.js @@ -0,0 +1,26 @@ +//// [assignmentCompatability4.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export var aa:{one:number;};; + export var __val__aa = aa; +} +__test2__.__val__aa = __test1__.__val__obj4 + +//// [assignmentCompatability4.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + __test2__.aa; + ; + __test2__.__val__aa = __test2__.aa; +})(__test2__ || (__test2__ = {})); +__test2__.__val__aa = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt new file mode 100644 index 0000000000000..db1948d7cb06f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability40.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export class classWithPrivate { constructor(private one: T) {} } var x5 = new classWithPrivate(1);; + export var __val__x5 = x5; + } + __test2__.__val__x5 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': +!!! Private property 'one' cannot be reimplemented. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability40.js b/tests/baselines/reference/assignmentCompatability40.js new file mode 100644 index 0000000000000..801ddfe75964f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability40.js @@ -0,0 +1,33 @@ +//// [assignmentCompatability40.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithPrivate { constructor(private one: T) {} } var x5 = new classWithPrivate(1);; + export var __val__x5 = x5; +} +__test2__.__val__x5 = __test1__.__val__obj4 + +//// [assignmentCompatability40.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithPrivate = (function () { + function classWithPrivate(one) { + this.one = one; + } + return classWithPrivate; + })(); + __test2__.classWithPrivate = classWithPrivate; + var x5 = new classWithPrivate(1); + ; + __test2__.__val__x5 = x5; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x5 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt new file mode 100644 index 0000000000000..e21dc1c8cd329 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability41.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export class classWithTwoPrivate { constructor(private one: T, private two: U) {} } var x6 = new classWithTwoPrivate(1, "a");; + export var __val__x6 = x6; + } + __test2__.__val__x6 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': +!!! Private property 'one' cannot be reimplemented. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability41.js b/tests/baselines/reference/assignmentCompatability41.js new file mode 100644 index 0000000000000..2ebd35a6caab2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability41.js @@ -0,0 +1,34 @@ +//// [assignmentCompatability41.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithTwoPrivate { constructor(private one: T, private two: U) {} } var x6 = new classWithTwoPrivate(1, "a");; + export var __val__x6 = x6; +} +__test2__.__val__x6 = __test1__.__val__obj4 + +//// [assignmentCompatability41.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithTwoPrivate = (function () { + function classWithTwoPrivate(one, two) { + this.one = one; + this.two = two; + } + return classWithTwoPrivate; + })(); + __test2__.classWithTwoPrivate = classWithTwoPrivate; + var x6 = new classWithTwoPrivate(1, "a"); + ; + __test2__.__val__x6 = x6; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x6 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt new file mode 100644 index 0000000000000..2258a85139edb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability42.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export class classWithPublicPrivate { constructor(public one: T, private two: U) {} } var x7 = new classWithPublicPrivate(1, "a");; + export var __val__x7 = x7; + } + __test2__.__val__x7 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': +!!! Private property 'two' cannot be reimplemented. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability42.js b/tests/baselines/reference/assignmentCompatability42.js new file mode 100644 index 0000000000000..39dab170d35c9 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability42.js @@ -0,0 +1,34 @@ +//// [assignmentCompatability42.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithPublicPrivate { constructor(public one: T, private two: U) {} } var x7 = new classWithPublicPrivate(1, "a");; + export var __val__x7 = x7; +} +__test2__.__val__x7 = __test1__.__val__obj4 + +//// [assignmentCompatability42.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithPublicPrivate = (function () { + function classWithPublicPrivate(one, two) { + this.one = one; + this.two = two; + } + return classWithPublicPrivate; + })(); + __test2__.classWithPublicPrivate = classWithPublicPrivate; + var x7 = new classWithPublicPrivate(1, "a"); + ; + __test2__.__val__x7 = x7; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x7 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt new file mode 100644 index 0000000000000..1ab4e3dcef8e2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/assignmentCompatability43.ts (1 errors) ==== + module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + export interface interfaceTwo { one: T; two: U; }; var obj2: interfaceTwo = { one: 1, two: "a" };; + export var __val__obj2 = obj2; + } + __test2__.__val__obj2 = __test1__.__val__obj4 + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': +!!! Required property 'two' cannot be reimplemented with optional property in 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.js b/tests/baselines/reference/assignmentCompatability43.js new file mode 100644 index 0000000000000..0ff9bdb481991 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability43.js @@ -0,0 +1,27 @@ +//// [assignmentCompatability43.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export interface interfaceTwo { one: T; two: U; }; var obj2: interfaceTwo = { one: 1, two: "a" };; + export var __val__obj2 = obj2; +} +__test2__.__val__obj2 = __test1__.__val__obj4 + +//// [assignmentCompatability43.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + ; + var obj2 = { one: 1, two: "a" }; + ; + __test2__.__val__obj2 = obj2; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj2 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability5.js b/tests/baselines/reference/assignmentCompatability5.js new file mode 100644 index 0000000000000..ef38b738ad304 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability5.js @@ -0,0 +1,27 @@ +//// [assignmentCompatability5.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export interface interfaceOne { one: T; }; var obj1: interfaceOne = { one: 1 };; + export var __val__obj1 = obj1; +} +__test2__.__val__obj1 = __test1__.__val__obj4 + +//// [assignmentCompatability5.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + ; + var obj1 = { one: 1 }; + ; + __test2__.__val__obj1 = obj1; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj1 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability6.js b/tests/baselines/reference/assignmentCompatability6.js new file mode 100644 index 0000000000000..7b1e2bb65d65f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability6.js @@ -0,0 +1,27 @@ +//// [assignmentCompatability6.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; + export var __val__obj3 = obj3; +} +__test2__.__val__obj3 = __test1__.__val__obj4 + +//// [assignmentCompatability6.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + ; + var obj3 = {}; + ; + __test2__.__val__obj3 = obj3; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj3 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability7.js b/tests/baselines/reference/assignmentCompatability7.js new file mode 100644 index 0000000000000..c6bf8e53bc168 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability7.js @@ -0,0 +1,27 @@ +//// [assignmentCompatability7.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +__test2__.__val__obj4 = __test1__.__val__obj4 + +//// [assignmentCompatability7.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + ; + var obj4 = { one: 1 }; + ; + __test2__.__val__obj4 = obj4; +})(__test2__ || (__test2__ = {})); +__test2__.__val__obj4 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability8.js b/tests/baselines/reference/assignmentCompatability8.js new file mode 100644 index 0000000000000..65e4240aac553 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability8.js @@ -0,0 +1,33 @@ +//// [assignmentCompatability8.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithPublic { constructor(public one: T) {} } var x1 = new classWithPublic(1);; + export var __val__x1 = x1; +} +__test2__.__val__x1 = __test1__.__val__obj4 + +//// [assignmentCompatability8.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithPublic = (function () { + function classWithPublic(one) { + this.one = one; + } + return classWithPublic; + })(); + __test2__.classWithPublic = classWithPublic; + var x1 = new classWithPublic(1); + ; + __test2__.__val__x1 = x1; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x1 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability9.js b/tests/baselines/reference/assignmentCompatability9.js new file mode 100644 index 0000000000000..98932380b3ecb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability9.js @@ -0,0 +1,33 @@ +//// [assignmentCompatability9.ts] +module __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; +} +module __test2__ { + export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; + export var __val__x3 = x3; +} +__test2__.__val__x3 = __test1__.__val__obj4 + +//// [assignmentCompatability9.js] +var __test1__; +(function (__test1__) { + ; + var obj4 = { one: 1 }; + ; + __test1__.__val__obj4 = obj4; +})(__test1__ || (__test1__ = {})); +var __test2__; +(function (__test2__) { + var classWithOptional = (function () { + function classWithOptional(one) { + this.one = one; + } + return classWithOptional; + })(); + __test2__.classWithOptional = classWithOptional; + var x3 = new classWithOptional(); + ; + __test2__.__val__x3 = x3; +})(__test2__ || (__test2__ = {})); +__test2__.__val__x3 = __test1__.__val__obj4; diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt new file mode 100644 index 0000000000000..b6e8cd608c7d4 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts (8 errors) ==== + // 3.8.4 Assignment Compatibility + + interface Applicable { + apply(blah: any); // also works for 'apply' + } + + var x: Applicable; + + // Should fail + x = ''; + ~ +!!! Type 'string' is not assignable to type 'Applicable': +!!! Property 'apply' is missing in type 'String'. + x = ['']; + ~ +!!! Type 'string[]' is not assignable to type 'Applicable': +!!! Property 'apply' is missing in type 'string[]'. + x = 4; + ~ +!!! Type 'number' is not assignable to type 'Applicable': +!!! Property 'apply' is missing in type 'Number'. + x = {}; + ~ +!!! Type '{}' is not assignable to type 'Applicable': +!!! Property 'apply' is missing in type '{}'. + + // Should work + function f() { }; + x = f; + + function fn(c: Applicable) { } + + // Should Fail + fn(''); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn(['']); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn(4); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn({}); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + + // Should work + fn(a => { }); + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js new file mode 100644 index 0000000000000..cf00d40094d03 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js @@ -0,0 +1,50 @@ +//// [assignmentCompatability_checking-apply-member-off-of-function-interface.ts] +// 3.8.4 Assignment Compatibility + +interface Applicable { + apply(blah: any); // also works for 'apply' +} + +var x: Applicable; + +// Should fail +x = ''; +x = ['']; +x = 4; +x = {}; + +// Should work +function f() { }; +x = f; + +function fn(c: Applicable) { } + +// Should Fail +fn(''); +fn(['']); +fn(4); +fn({}); + + +// Should work +fn(a => { }); + + +//// [assignmentCompatability_checking-apply-member-off-of-function-interface.js] +var x; +x = ''; +x = ['']; +x = 4; +x = {}; +function f() { +} +; +x = f; +function fn(c) { +} +fn(''); +fn(['']); +fn(4); +fn({}); +fn(function (a) { +}); diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt new file mode 100644 index 0000000000000..50bada3904a5a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts (8 errors) ==== + // 3.8.4 Assignment Compatibility + + interface Callable { + call(blah: any); // also works for 'apply' + } + + var x: Callable; + + // Should fail + x = ''; + ~ +!!! Type 'string' is not assignable to type 'Callable': +!!! Property 'call' is missing in type 'String'. + x = ['']; + ~ +!!! Type 'string[]' is not assignable to type 'Callable': +!!! Property 'call' is missing in type 'string[]'. + x = 4; + ~ +!!! Type 'number' is not assignable to type 'Callable': +!!! Property 'call' is missing in type 'Number'. + x = {}; + ~ +!!! Type '{}' is not assignable to type 'Callable': +!!! Property 'call' is missing in type '{}'. + + // Should work + function f() { }; + x = f; + + function fn(c: Callable) { } + + // Should Fail + fn(''); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn(['']); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn(4); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn({}); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + + // Should work + fn(a => { }); + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js new file mode 100644 index 0000000000000..1fde370e36b98 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js @@ -0,0 +1,50 @@ +//// [assignmentCompatability_checking-call-member-off-of-function-interface.ts] +// 3.8.4 Assignment Compatibility + +interface Callable { + call(blah: any); // also works for 'apply' +} + +var x: Callable; + +// Should fail +x = ''; +x = ['']; +x = 4; +x = {}; + +// Should work +function f() { }; +x = f; + +function fn(c: Callable) { } + +// Should Fail +fn(''); +fn(['']); +fn(4); +fn({}); + + +// Should work +fn(a => { }); + + +//// [assignmentCompatability_checking-call-member-off-of-function-interface.js] +var x; +x = ''; +x = ['']; +x = 4; +x = {}; +function f() { +} +; +x = f; +function fn(c) { +} +fn(''); +fn(['']); +fn(4); +fn({}); +fn(function (a) { +}); diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js new file mode 100644 index 0000000000000..69d2b9c16eef7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js @@ -0,0 +1,17 @@ +//// [assignmentCompatibilityForConstrainedTypeParameters.ts] +function foo() { + function bar() { + var x: S; + var y: T; + y = x; + } +} + +//// [assignmentCompatibilityForConstrainedTypeParameters.js] +function foo() { + function bar() { + var x; + var y; + y = x; + } +} diff --git a/tests/baselines/reference/assignmentLHSIsReference.js b/tests/baselines/reference/assignmentLHSIsReference.js new file mode 100644 index 0000000000000..65950ded27519 --- /dev/null +++ b/tests/baselines/reference/assignmentLHSIsReference.js @@ -0,0 +1,42 @@ +//// [assignmentLHSIsReference.ts] +var value; + +// identifiers: variable and parameter +var x1: number; +x1 = value; + +function fn1(x2: number) { + x2 = value; +} + +// property accesses +var x3: { a: string }; +x3.a = value; +x3['a'] = value; + +// parentheses, the contained expression is reference +(x1) = value; + +function fn2(x4: number) { + (x4) = value; +} + +(x3.a) = value; +(x3['a']) = value; + +//// [assignmentLHSIsReference.js] +var value; +var x1; +x1 = value; +function fn1(x2) { + x2 = value; +} +var x3; +x3.a = value; +x3['a'] = value; +(x1) = value; +function fn2(x4) { + (x4) = value; +} +(x3.a) = value; +(x3['a']) = value; diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt new file mode 100644 index 0000000000000..b5ebd69f67ae5 --- /dev/null +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -0,0 +1,151 @@ +==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (40 errors) ==== + // expected error for all the LHS of assignments + var value; + + // this + class C { + constructor() { this = value; } + ~~~~ +!!! Invalid left-hand side of assignment expression. + foo() { this = value; } + ~~~~ +!!! Invalid left-hand side of assignment expression. + static sfoo() { this = value; } + ~~~~ +!!! Invalid left-hand side of assignment expression. + } + + function foo() { this = value; } + ~~~~ +!!! Invalid left-hand side of assignment expression. + + this = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + + // identifiers: module, class, enum, function + module M { export var a; } + M = value; + ~ +!!! Invalid left-hand side of assignment expression. + + C = value; + ~ +!!! Invalid left-hand side of assignment expression. + + enum E { } + E = value; + ~ +!!! Invalid left-hand side of assignment expression. + + foo = value; + ~~~ +!!! Invalid left-hand side of assignment expression. + + // literals + null = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + true = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + false = value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + 0 = value; + ~ +!!! Invalid left-hand side of assignment expression. + '' = value; + ~~ +!!! Invalid left-hand side of assignment expression. + /d+/ = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + + // object literals + { a: 0} = value; + ~ +!!! Declaration or statement expected. + + // array literals + ['', ''] = value; + ~~~~~~~~ +!!! Invalid left-hand side of assignment expression. + + // super + class Derived extends C { + constructor() { super(); super = value; } + ~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + + foo() { super = value } + ~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + + static sfoo() { super = value; } + ~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + } + + // function expression + function bar() { } = value; + ~ +!!! Declaration or statement expected. + () => { } = value; + ~ +!!! ';' expected. + + // function calls + foo() = value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + + // parentheses, the containted expression is value + (this) = value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (M) = value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (C) = value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (E) = value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (foo) = value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + (null) = value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (true) = value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (0) = value; + ~~~ +!!! Invalid left-hand side of assignment expression. + ('') = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + (/d+/) = value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + ({}) = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + ([]) = value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + (function baz() { }) = value; + ~~~~~~~~~~~~~~~~~~~~ +!!! Invalid left-hand side of assignment expression. + (foo()) = value; + ~~~~~~~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentStricterConstraints.errors.txt b/tests/baselines/reference/assignmentStricterConstraints.errors.txt new file mode 100644 index 0000000000000..37b4de1bfa52b --- /dev/null +++ b/tests/baselines/reference/assignmentStricterConstraints.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ==== + var f = function (x: T, y: S): void { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + x = y + ~ +!!! Type 'S' is not assignable to type 'T'. + } + + var g = function (x: T, y: S): void { } + + g = f + g(1, "") + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentStricterConstraints.js b/tests/baselines/reference/assignmentStricterConstraints.js new file mode 100644 index 0000000000000..f8f4ce6d1b6ad --- /dev/null +++ b/tests/baselines/reference/assignmentStricterConstraints.js @@ -0,0 +1,19 @@ +//// [assignmentStricterConstraints.ts] +var f = function (x: T, y: S): void { + x = y +} + +var g = function (x: T, y: S): void { } + +g = f +g(1, "") + + +//// [assignmentStricterConstraints.js] +var f = function (x, y) { + x = y; +}; +var g = function (x, y) { +}; +g = f; +g(1, ""); diff --git a/tests/baselines/reference/assignmentToFunction.errors.txt b/tests/baselines/reference/assignmentToFunction.errors.txt new file mode 100644 index 0000000000000..0e5d9351f29e6 --- /dev/null +++ b/tests/baselines/reference/assignmentToFunction.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/assignmentToFunction.ts (2 errors) ==== + function fn() { } + fn = () => 3; + ~~ +!!! Invalid left-hand side of assignment expression. + + module foo { + function xyz() { + function bar() { + } + bar = null; + ~~~ +!!! Invalid left-hand side of assignment expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToFunction.js b/tests/baselines/reference/assignmentToFunction.js new file mode 100644 index 0000000000000..a4e2d540a8d43 --- /dev/null +++ b/tests/baselines/reference/assignmentToFunction.js @@ -0,0 +1,24 @@ +//// [assignmentToFunction.ts] +function fn() { } +fn = () => 3; + +module foo { + function xyz() { + function bar() { + } + bar = null; + } +} + +//// [assignmentToFunction.js] +function fn() { +} +fn = function () { return 3; }; +var foo; +(function (foo) { + function xyz() { + function bar() { + } + bar = null; + } +})(foo || (foo = {})); diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt new file mode 100644 index 0000000000000..4fe688b7118f4 --- /dev/null +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/assignmentToObject.ts (1 errors) ==== + var a = { toString: 5 }; + var b: {} = a; // ok + var c: Object = a; // should be error + ~~~~~~~~~~~~~ +!!! Type '{ toString: number; }' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type 'number' is not assignable to type '() => string'. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObject.js b/tests/baselines/reference/assignmentToObject.js new file mode 100644 index 0000000000000..6c11d67dd6823 --- /dev/null +++ b/tests/baselines/reference/assignmentToObject.js @@ -0,0 +1,10 @@ +//// [assignmentToObject.ts] +var a = { toString: 5 }; +var b: {} = a; // ok +var c: Object = a; // should be error + + +//// [assignmentToObject.js] +var a = { toString: 5 }; +var b = a; +var c = a; diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt new file mode 100644 index 0000000000000..57f2c0c233b51 --- /dev/null +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== + var errObj: Object = { toString: 0 }; // Error, incompatible toString + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ toString: number; }' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type 'number' is not assignable to type '() => string'. + var goodObj: Object = { + toString(x?) { + return ""; + } + }; // Ok, because toString is a subtype of Object's toString + + var errFun: Function = {}; // Error for no call signature + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'Function': +!!! Property 'apply' is missing in type '{}'. + + function foo() { } + module foo { + export var boom = 0; + } + + var goodFundule: Function = foo; // ok + + function bar() { } + module bar { + export function apply(thisArg: string, argArray?: string) { } + } + + var goodFundule2: Function = bar; // ok + + function bad() { } + module bad { + export var apply = 0; + } + + var badFundule: Function = bad; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'typeof bad' is not assignable to type 'Function': +!!! Types of property 'apply' are incompatible: +!!! Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.js b/tests/baselines/reference/assignmentToObjectAndFunction.js new file mode 100644 index 0000000000000..07afb88493110 --- /dev/null +++ b/tests/baselines/reference/assignmentToObjectAndFunction.js @@ -0,0 +1,62 @@ +//// [assignmentToObjectAndFunction.ts] +var errObj: Object = { toString: 0 }; // Error, incompatible toString +var goodObj: Object = { + toString(x?) { + return ""; + } +}; // Ok, because toString is a subtype of Object's toString + +var errFun: Function = {}; // Error for no call signature + +function foo() { } +module foo { + export var boom = 0; +} + +var goodFundule: Function = foo; // ok + +function bar() { } +module bar { + export function apply(thisArg: string, argArray?: string) { } +} + +var goodFundule2: Function = bar; // ok + +function bad() { } +module bad { + export var apply = 0; +} + +var badFundule: Function = bad; // error + +//// [assignmentToObjectAndFunction.js] +var errObj = { toString: 0 }; +var goodObj = { + toString: function toString(x) { + return ""; + } +}; +var errFun = {}; +function foo() { +} +var foo; +(function (foo) { + foo.boom = 0; +})(foo || (foo = {})); +var goodFundule = foo; +function bar() { +} +var bar; +(function (bar) { + function apply(thisArg, argArray) { + } + bar.apply = apply; +})(bar || (bar = {})); +var goodFundule2 = bar; +function bad() { +} +var bad; +(function (bad) { + bad.apply = 0; +})(bad || (bad = {})); +var badFundule = bad; diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt new file mode 100644 index 0000000000000..3d56ed9d18ba9 --- /dev/null +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (1 errors) ==== + var x; + (1, x)=0; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.js b/tests/baselines/reference/assignmentToParenthesizedExpression1.js new file mode 100644 index 0000000000000..8d8589b5f50aa --- /dev/null +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.js @@ -0,0 +1,7 @@ +//// [assignmentToParenthesizedExpression1.ts] +var x; +(1, x)=0; + +//// [assignmentToParenthesizedExpression1.js] +var x; +(1, x) = 0; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt new file mode 100644 index 0000000000000..95e9d44ee4dc8 --- /dev/null +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -0,0 +1,126 @@ +==== tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts (24 errors) ==== + var x: number; + x = 3; // OK + (x) = 3; // OK + x = ''; // Error + ~ +!!! Type 'string' is not assignable to type 'number'. + (x) = ''; // Error + ~~~ +!!! Type 'string' is not assignable to type 'number'. + + module M { + export var y: number; + } + M.y = 3; // OK + (M).y = 3; // OK + (M.y) = 3; // OK + M.y = ''; // Error + ~~~ +!!! Type 'string' is not assignable to type 'number'. + (M).y = ''; // Error + ~~~~~ +!!! Type 'string' is not assignable to type 'number'. + (M.y) = ''; // Error + ~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + M = { y: 3 }; // Error + ~ +!!! Invalid left-hand side of assignment expression. + (M) = { y: 3 }; // Error + ~~~ +!!! Invalid left-hand side of assignment expression. + + module M2 { + export module M3 { + export var x: number; + } + + M3 = { x: 3 }; // Error + ~~ +!!! Invalid left-hand side of assignment expression. + } + M2.M3 = { x: 3 }; // OK + (M2).M3 = { x: 3 }; // OK + (M2.M3) = { x: 3 }; // OK + + M2.M3 = { x: '' }; // Error + ~~~~~ +!!! Type '{ x: string; }' is not assignable to type 'typeof M3': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + (M2).M3 = { x: '' }; // Error + ~~~~~~~ +!!! Type '{ x: string; }' is not assignable to type 'typeof M3': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + (M2.M3) = { x: '' }; // Error + ~~~~~~~ +!!! Type '{ x: string; }' is not assignable to type 'typeof M3': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + + function fn() { } + fn = () => 3; // Bug 823548: Should be error (fn is not a reference) + ~~ +!!! Invalid left-hand side of assignment expression. + (fn) = () => 3; // Should be error + ~~~~ +!!! Invalid left-hand side of assignment expression. + + function fn2(x: number, y: { t: number }) { + x = 3; + (x) = 3; // OK + x = ''; // Error + ~ +!!! Type 'string' is not assignable to type 'number'. + (x) = ''; // Error + ~~~ +!!! Type 'string' is not assignable to type 'number'. + + (y).t = 3; // OK + (y.t) = 3; // OK + (y).t = ''; // Error + ~~~~~ +!!! Type 'string' is not assignable to type 'number'. + (y.t) = ''; // Error + ~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + y['t'] = 3; // OK + (y)['t'] = 3; // OK + (y['t']) = 3; // OK + y['t'] = ''; // Error + ~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + (y)['t'] = ''; // Error + ~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + (y['t']) = ''; // Error + ~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + } + + enum E { + A + } + E = undefined; // Error + ~ +!!! Invalid left-hand side of assignment expression. + (E) = undefined; // Error + ~~~ +!!! Invalid left-hand side of assignment expression. + + class C { + + } + + C = undefined; // Error + ~ +!!! Invalid left-hand side of assignment expression. + (C) = undefined; // Error + ~~~ +!!! Invalid left-hand side of assignment expression. + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js new file mode 100644 index 0000000000000..9e00625168273 --- /dev/null +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js @@ -0,0 +1,138 @@ +//// [assignmentToParenthesizedIdentifiers.ts] +var x: number; +x = 3; // OK +(x) = 3; // OK +x = ''; // Error +(x) = ''; // Error + +module M { + export var y: number; +} +M.y = 3; // OK +(M).y = 3; // OK +(M.y) = 3; // OK +M.y = ''; // Error +(M).y = ''; // Error +(M.y) = ''; // Error + +M = { y: 3 }; // Error +(M) = { y: 3 }; // Error + +module M2 { + export module M3 { + export var x: number; + } + + M3 = { x: 3 }; // Error +} +M2.M3 = { x: 3 }; // OK +(M2).M3 = { x: 3 }; // OK +(M2.M3) = { x: 3 }; // OK + +M2.M3 = { x: '' }; // Error +(M2).M3 = { x: '' }; // Error +(M2.M3) = { x: '' }; // Error + + +function fn() { } +fn = () => 3; // Bug 823548: Should be error (fn is not a reference) +(fn) = () => 3; // Should be error + +function fn2(x: number, y: { t: number }) { + x = 3; + (x) = 3; // OK + x = ''; // Error + (x) = ''; // Error + + (y).t = 3; // OK + (y.t) = 3; // OK + (y).t = ''; // Error + (y.t) = ''; // Error + + y['t'] = 3; // OK + (y)['t'] = 3; // OK + (y['t']) = 3; // OK + y['t'] = ''; // Error + (y)['t'] = ''; // Error + (y['t']) = ''; // Error +} + +enum E { + A +} +E = undefined; // Error +(E) = undefined; // Error + +class C { + +} + +C = undefined; // Error +(C) = undefined; // Error + + +//// [assignmentToParenthesizedIdentifiers.js] +var x; +x = 3; +(x) = 3; +x = ''; +(x) = ''; +var M; +(function (M) { + M.y; +})(M || (M = {})); +M.y = 3; +(M).y = 3; +(M.y) = 3; +M.y = ''; +(M).y = ''; +(M.y) = ''; +M = { y: 3 }; +(M) = { y: 3 }; +var M2; +(function (M2) { + (function (M3) { + M3.x; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; + M3 = { x: 3 }; +})(M2 || (M2 = {})); +M2.M3 = { x: 3 }; +(M2).M3 = { x: 3 }; +(M2.M3) = { x: 3 }; +M2.M3 = { x: '' }; +(M2).M3 = { x: '' }; +(M2.M3) = { x: '' }; +function fn() { +} +fn = function () { return 3; }; +(fn) = function () { return 3; }; +function fn2(x, y) { + x = 3; + (x) = 3; + x = ''; + (x) = ''; + (y).t = 3; + (y.t) = 3; + (y).t = ''; + (y.t) = ''; + y['t'] = 3; + (y)['t'] = 3; + (y['t']) = 3; + y['t'] = ''; + (y)['t'] = ''; + (y['t']) = ''; +} +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +E = undefined; +(E) = undefined; +var C = (function () { + function C() { + } + return C; +})(); +C = undefined; +(C) = undefined; diff --git a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt new file mode 100644 index 0000000000000..b67b5b075e46c --- /dev/null +++ b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/assignmentToReferenceTypes.ts (4 errors) ==== + // Should all be allowed + + module M { + } + M = null; + ~ +!!! Cannot find name 'M'. + + class C { + } + C = null; + ~ +!!! Invalid left-hand side of assignment expression. + + enum E { + } + E = null; + ~ +!!! Invalid left-hand side of assignment expression. + + function f() { } + f = null; + ~ +!!! Invalid left-hand side of assignment expression. + + var x = 1; + x = null; + + function g(x) { + x = null; + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToReferenceTypes.js b/tests/baselines/reference/assignmentToReferenceTypes.js new file mode 100644 index 0000000000000..58f6119d12557 --- /dev/null +++ b/tests/baselines/reference/assignmentToReferenceTypes.js @@ -0,0 +1,45 @@ +//// [assignmentToReferenceTypes.ts] +// Should all be allowed + +module M { +} +M = null; + +class C { +} +C = null; + +enum E { +} +E = null; + +function f() { } +f = null; + +var x = 1; +x = null; + +function g(x) { + x = null; +} + +//// [assignmentToReferenceTypes.js] +M = null; +var C = (function () { + function C() { + } + return C; +})(); +C = null; +var E; +(function (E) { +})(E || (E = {})); +E = null; +function f() { +} +f = null; +var x = 1; +x = null; +function g(x) { + x = null; +} diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt new file mode 100644 index 0000000000000..5671c58d5b248 --- /dev/null +++ b/tests/baselines/reference/assignments.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/conformance/expressions/valuesAndReferences/assignments.ts (6 errors) ==== + // In this file: + // Assign to a module + // Assign to a class + // Assign to an enum + // Assign to a function + // Assign to a variable + // Assign to a parameter + // Assign to an interface + + module M { } + M = null; // Error + ~ +!!! Cannot find name 'M'. + + class C { } + C = null; // Error + ~ +!!! Invalid left-hand side of assignment expression. + + enum E { A } + E = null; // Error + ~ +!!! Invalid left-hand side of assignment expression. + E.A = null; // OK per spec, Error per implementation (509581) + ~~~ +!!! Invalid left-hand side of assignment expression. + + function fn() { } + fn = null; // Should be error + ~~ +!!! Invalid left-hand side of assignment expression. + + var v; + v = null; // OK + + function fn2(p) { + p = null; // OK + } + + interface I { } + I = null; // Error + ~ +!!! Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/assignments.js b/tests/baselines/reference/assignments.js new file mode 100644 index 0000000000000..3a7479a0734d4 --- /dev/null +++ b/tests/baselines/reference/assignments.js @@ -0,0 +1,56 @@ +//// [assignments.ts] +// In this file: +// Assign to a module +// Assign to a class +// Assign to an enum +// Assign to a function +// Assign to a variable +// Assign to a parameter +// Assign to an interface + +module M { } +M = null; // Error + +class C { } +C = null; // Error + +enum E { A } +E = null; // Error +E.A = null; // OK per spec, Error per implementation (509581) + +function fn() { } +fn = null; // Should be error + +var v; +v = null; // OK + +function fn2(p) { + p = null; // OK +} + +interface I { } +I = null; // Error + +//// [assignments.js] +M = null; +var C = (function () { + function C() { + } + return C; +})(); +C = null; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +E = null; +0 /* A */ = null; +function fn() { +} +fn = null; +var v; +v = null; +function fn2(p) { + p = null; +} +I = null; diff --git a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt new file mode 100644 index 0000000000000..96306db9e3d2b --- /dev/null +++ b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/augmentedClassWithPrototypePropertyOnModule.ts (1 errors) ==== + declare module m { + var f; + var prototype; // This should be error since prototype would be static property on class m + ~~~~~~~~~ +!!! Duplicate identifier 'prototype'. + } + declare class m { + } \ No newline at end of file diff --git a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js new file mode 100644 index 0000000000000..ff3afb2da82e3 --- /dev/null +++ b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js @@ -0,0 +1,9 @@ +//// [augmentedClassWithPrototypePropertyOnModule.ts] +declare module m { + var f; + var prototype; // This should be error since prototype would be static property on class m +} +declare class m { +} + +//// [augmentedClassWithPrototypePropertyOnModule.js] diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt new file mode 100644 index 0000000000000..8c00e5eeeea2c --- /dev/null +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/augmentedTypeAssignmentCompatIndexSignature.ts (2 errors) ==== + interface Foo { a } + interface Bar { b } + + interface Object { + [n: number]: Foo; + } + + interface Function { + [n: number]: Bar; + } + + var o = {}; + var f = () => { }; + + var v1: { + ~~~~~ + [n: number]: Foo + ~~~~~~~~~~~~~~~~~~~~ + } = o; // Should be allowed + ~~~~~ +!!! Type '{}' is not assignable to type '{ [x: number]: Foo; }': +!!! Index signature is missing in type '{}'. + + var v2: { + ~~~~~ + [n: number]: Bar + ~~~~~~~~~~~~~~~~~~~~ + } = f; // Should be allowed + ~~~~~ +!!! Type '() => void' is not assignable to type '{ [x: number]: Bar; }': +!!! Index signature is missing in type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js new file mode 100644 index 0000000000000..f05f0adbe8c59 --- /dev/null +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js @@ -0,0 +1,29 @@ +//// [augmentedTypeAssignmentCompatIndexSignature.ts] +interface Foo { a } +interface Bar { b } + +interface Object { + [n: number]: Foo; +} + +interface Function { + [n: number]: Bar; +} + +var o = {}; +var f = () => { }; + +var v1: { + [n: number]: Foo +} = o; // Should be allowed + +var v2: { + [n: number]: Bar +} = f; // Should be allowed + +//// [augmentedTypeAssignmentCompatIndexSignature.js] +var o = {}; +var f = function () { +}; +var v1 = o; +var v2 = f; diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js new file mode 100644 index 0000000000000..87d6b23e973ee --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js @@ -0,0 +1,19 @@ +//// [augmentedTypeBracketAccessIndexSignature.ts] +interface Foo { a } +interface Bar { b } + +interface Object { + [n: number]: Foo; +} + +interface Function { + [n: number]: Bar; +} + +var a = {}[0]; // Should be Foo +var b = (() => { })[0]; // Should be Bar + +//// [augmentedTypeBracketAccessIndexSignature.js] +var a = {}[0]; +var b = (function () { +})[0]; diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js new file mode 100644 index 0000000000000..b1d5fb713086d --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js @@ -0,0 +1,23 @@ +//// [augmentedTypeBracketNamedPropertyAccess.ts] +interface Object { + data: number; +} +interface Function { + functionData: string; +} +var o = {}; +var f = function () { }; + +var r1 = o['data']; // Should be number +var r2 = o['functionData']; // Should be any (no property found) +var r3 = f['functionData']; // Should be string +var r4 = f['data']; // Should be number + +//// [augmentedTypeBracketNamedPropertyAccess.js] +var o = {}; +var f = function () { +}; +var r1 = o['data']; +var r2 = o['functionData']; +var r3 = f['functionData']; +var r4 = f['data']; diff --git a/tests/baselines/reference/augmentedTypesClass.errors.txt b/tests/baselines/reference/augmentedTypesClass.errors.txt new file mode 100644 index 0000000000000..ee05d1137679c --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/augmentedTypesClass.ts (2 errors) ==== + //// class then var + class c1 { public foo() { } } + var c1 = 1; // error + ~~ +!!! Duplicate identifier 'c1'. + + //// class then enum + class c4 { public foo() { } } + enum c4 { One } // error + ~~ +!!! Duplicate identifier 'c4'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js new file mode 100644 index 0000000000000..bf80f773fbda0 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -0,0 +1,29 @@ +//// [augmentedTypesClass.ts] +//// class then var +class c1 { public foo() { } } +var c1 = 1; // error + +//// class then enum +class c4 { public foo() { } } +enum c4 { One } // error + +//// [augmentedTypesClass.js] +var c1 = (function () { + function c1() { + } + c1.prototype.foo = function () { + }; + return c1; +})(); +var c1 = 1; +var c4 = (function () { + function c4() { + } + c4.prototype.foo = function () { + }; + return c4; +})(); +var c4; +(function (c4) { + c4[c4["One"] = 0] = "One"; +})(c4 || (c4 = {})); diff --git a/tests/baselines/reference/augmentedTypesClass2.errors.txt b/tests/baselines/reference/augmentedTypesClass2.errors.txt new file mode 100644 index 0000000000000..7216ac604c7da --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass2.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/augmentedTypesClass2.ts (2 errors) ==== + // Checking class with other things in type space not value space + + // class then interface + class c11 { + foo() { + return 1; + } + } + + interface c11 { // error + ~~~ +!!! Duplicate identifier 'c11'. + bar(): void; + } + + // class then class - covered + // class then enum + class c33 { + foo() { + return 1; + } + } + enum c33 { One }; + ~~~ +!!! Duplicate identifier 'c33'. + + // class then import + class c44 { + foo() { + return 1; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass2.js b/tests/baselines/reference/augmentedTypesClass2.js new file mode 100644 index 0000000000000..1255fd9401067 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass2.js @@ -0,0 +1,62 @@ +//// [augmentedTypesClass2.ts] +// Checking class with other things in type space not value space + +// class then interface +class c11 { + foo() { + return 1; + } +} + +interface c11 { // error + bar(): void; +} + +// class then class - covered +// class then enum +class c33 { + foo() { + return 1; + } +} +enum c33 { One }; + +// class then import +class c44 { + foo() { + return 1; + } +} + + + +//// [augmentedTypesClass2.js] +var c11 = (function () { + function c11() { + } + c11.prototype.foo = function () { + return 1; + }; + return c11; +})(); +var c33 = (function () { + function c33() { + } + c33.prototype.foo = function () { + return 1; + }; + return c33; +})(); +var c33; +(function (c33) { + c33[c33["One"] = 0] = "One"; +})(c33 || (c33 = {})); +; +var c44 = (function () { + function c44() { + } + c44.prototype.foo = function () { + return 1; + }; + return c44; +})(); diff --git a/tests/baselines/reference/augmentedTypesClass2a.errors.txt b/tests/baselines/reference/augmentedTypesClass2a.errors.txt new file mode 100644 index 0000000000000..16edf2fb577fb --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass2a.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/augmentedTypesClass2a.ts (2 errors) ==== + //// class then function + class c2 { public foo() { } } + function c2() { } // error + ~~ +!!! Duplicate identifier 'c2'. + var c2 = () => { } + ~~ +!!! Duplicate identifier 'c2'. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js new file mode 100644 index 0000000000000..3a77cbc2cad2c --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -0,0 +1,18 @@ +//// [augmentedTypesClass2a.ts] +//// class then function +class c2 { public foo() { } } +function c2() { } // error +var c2 = () => { } + +//// [augmentedTypesClass2a.js] +var c2 = (function () { + function c2() { + } + c2.prototype.foo = function () { + }; + return c2; +})(); +function c2() { +} +var c2 = function () { +}; diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js new file mode 100644 index 0000000000000..9c0dbc3eb3751 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -0,0 +1,52 @@ +//// [augmentedTypesClass3.ts] +// class then module +class c5 { public foo() { } } +module c5 { } // should be ok + +class c5a { public foo() { } } +module c5a { var y = 2; } // should be ok + +class c5b { public foo() { } } +module c5b { export var y = 2; } // should be ok + +//// class then import +class c5c { public foo() { } } +//import c5c = require(''); + +//// [augmentedTypesClass3.js] +var c5 = (function () { + function c5() { + } + c5.prototype.foo = function () { + }; + return c5; +})(); +var c5a = (function () { + function c5a() { + } + c5a.prototype.foo = function () { + }; + return c5a; +})(); +var c5a; +(function (c5a) { + var y = 2; +})(c5a || (c5a = {})); +var c5b = (function () { + function c5b() { + } + c5b.prototype.foo = function () { + }; + return c5b; +})(); +var c5b; +(function (c5b) { + c5b.y = 2; +})(c5b || (c5b = {})); +var c5c = (function () { + function c5c() { + } + c5c.prototype.foo = function () { + }; + return c5c; +})(); diff --git a/tests/baselines/reference/augmentedTypesClass4.errors.txt b/tests/baselines/reference/augmentedTypesClass4.errors.txt new file mode 100644 index 0000000000000..f909cd9c266f5 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass4.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/augmentedTypesClass4.ts (1 errors) ==== + //// class then class + class c3 { public foo() { } } + class c3 { public bar() { } } // error + ~~ +!!! Duplicate identifier 'c3'. + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js new file mode 100644 index 0000000000000..08206852d5a29 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -0,0 +1,21 @@ +//// [augmentedTypesClass4.ts] +//// class then class +class c3 { public foo() { } } +class c3 { public bar() { } } // error + + +//// [augmentedTypesClass4.js] +var c3 = (function () { + function c3() { + } + c3.prototype.foo = function () { + }; + return c3; +})(); +var c3 = (function () { + function c3() { + } + c3.prototype.bar = function () { + }; + return c3; +})(); diff --git a/tests/baselines/reference/augmentedTypesEnum.errors.txt b/tests/baselines/reference/augmentedTypesEnum.errors.txt new file mode 100644 index 0000000000000..557c266f830f2 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesEnum.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/compiler/augmentedTypesEnum.ts (5 errors) ==== + // enum then var + enum e1111 { One } + var e1111 = 1; // error + ~~~~~ +!!! Duplicate identifier 'e1111'. + + // enum then function + enum e2 { One } + function e2() { } // error + ~~ +!!! Duplicate identifier 'e2'. + + enum e3 { One } + var e3 = () => { } // error + ~~ +!!! Duplicate identifier 'e3'. + + // enum then class + enum e4 { One } + class e4 { public foo() { } } // error + ~~ +!!! Duplicate identifier 'e4'. + + // enum then enum + enum e5 { One } + enum e5 { Two } + + enum e5a { One } + enum e5a { One } // error + ~~~ +!!! Duplicate identifier 'One'. + + // enum then internal module + enum e6 { One } + module e6 { } // ok + + enum e6a { One } + module e6a { var y = 2; } // should be error + + enum e6b { One } + module e6b { export var y = 2; } // should be error + + // enum then import, messes with error reporting + //enum e7 { One } + //import e7 = require(''); // should be error \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js new file mode 100644 index 0000000000000..55ba96b210a2b --- /dev/null +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -0,0 +1,102 @@ +//// [augmentedTypesEnum.ts] +// enum then var +enum e1111 { One } +var e1111 = 1; // error + +// enum then function +enum e2 { One } +function e2() { } // error + +enum e3 { One } +var e3 = () => { } // error + +// enum then class +enum e4 { One } +class e4 { public foo() { } } // error + +// enum then enum +enum e5 { One } +enum e5 { Two } + +enum e5a { One } +enum e5a { One } // error + +// enum then internal module +enum e6 { One } +module e6 { } // ok + +enum e6a { One } +module e6a { var y = 2; } // should be error + +enum e6b { One } +module e6b { export var y = 2; } // should be error + +// enum then import, messes with error reporting +//enum e7 { One } +//import e7 = require(''); // should be error + +//// [augmentedTypesEnum.js] +var e1111; +(function (e1111) { + e1111[e1111["One"] = 0] = "One"; +})(e1111 || (e1111 = {})); +var e1111 = 1; +var e2; +(function (e2) { + e2[e2["One"] = 0] = "One"; +})(e2 || (e2 = {})); +function e2() { +} +var e3; +(function (e3) { + e3[e3["One"] = 0] = "One"; +})(e3 || (e3 = {})); +var e3 = function () { +}; +var e4; +(function (e4) { + e4[e4["One"] = 0] = "One"; +})(e4 || (e4 = {})); +var e4 = (function () { + function e4() { + } + e4.prototype.foo = function () { + }; + return e4; +})(); +var e5; +(function (e5) { + e5[e5["One"] = 0] = "One"; +})(e5 || (e5 = {})); +var e5; +(function (e5) { + e5[e5["Two"] = 0] = "Two"; +})(e5 || (e5 = {})); +var e5a; +(function (e5a) { + e5a[e5a["One"] = 0] = "One"; +})(e5a || (e5a = {})); +var e5a; +(function (e5a) { + e5a[e5a["One"] = 0] = "One"; +})(e5a || (e5a = {})); +var e6; +(function (e6) { + e6[e6["One"] = 0] = "One"; +})(e6 || (e6 = {})); +var e6a; +(function (e6a) { + e6a[e6a["One"] = 0] = "One"; +})(e6a || (e6a = {})); +var e6a; +(function (e6a) { + var y = 2; +})(e6a || (e6a = {})); +var e6b; +(function (e6b) { + e6b[e6b["One"] = 0] = "One"; +})(e6b || (e6b = {})); +var e6b; +(function (e6b) { + e6b.y = 2; +})(e6b || (e6b = {})); diff --git a/tests/baselines/reference/augmentedTypesEnum2.errors.txt b/tests/baselines/reference/augmentedTypesEnum2.errors.txt new file mode 100644 index 0000000000000..06581cf182cb3 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesEnum2.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/augmentedTypesEnum2.ts (2 errors) ==== + // enum then interface + enum e1 { One } + + interface e1 { + ~~ +!!! Duplicate identifier 'e1'. + foo(): void; + } + + // interface then enum works + + // enum then class + enum e2 { One }; + class e2 { // error + ~~ +!!! Duplicate identifier 'e2'. + foo() { + return 1; + } + } + + //enum then enum - covered + //enum then import - covered \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesEnum2.js b/tests/baselines/reference/augmentedTypesEnum2.js new file mode 100644 index 0000000000000..a89f6c8df51b9 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesEnum2.js @@ -0,0 +1,39 @@ +//// [augmentedTypesEnum2.ts] +// enum then interface +enum e1 { One } + +interface e1 { + foo(): void; +} + +// interface then enum works + +// enum then class +enum e2 { One }; +class e2 { // error + foo() { + return 1; + } +} + +//enum then enum - covered +//enum then import - covered + +//// [augmentedTypesEnum2.js] +var e1; +(function (e1) { + e1[e1["One"] = 0] = "One"; +})(e1 || (e1 = {})); +var e2; +(function (e2) { + e2[e2["One"] = 0] = "One"; +})(e2 || (e2 = {})); +; +var e2 = (function () { + function e2() { + } + e2.prototype.foo = function () { + return 1; + }; + return e2; +})(); diff --git a/tests/baselines/reference/augmentedTypesEnum3.js b/tests/baselines/reference/augmentedTypesEnum3.js new file mode 100644 index 0000000000000..e0d8b51cf72e5 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesEnum3.js @@ -0,0 +1,53 @@ +//// [augmentedTypesEnum3.ts] +module E { + var t; +} +enum E { } + +enum F { } +module F { var t; } + +module A { + var o; +} +enum A { + b +} +enum A { + c +} +module A { + var p; +} + +//// [augmentedTypesEnum3.js] +var E; +(function (E) { + var t; +})(E || (E = {})); +var E; +(function (E) { +})(E || (E = {})); +var F; +(function (F) { +})(F || (F = {})); +var F; +(function (F) { + var t; +})(F || (F = {})); +var A; +(function (A) { + var o; +})(A || (A = {})); +var A; +(function (A) { + A[A["b"] = 0] = "b"; +})(A || (A = {})); +var A; +(function (A) { + A[A["c"] = 0] = "c"; +})(A || (A = {})); +var A; +(function (A) { + var p; +})(A || (A = {})); diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.js b/tests/baselines/reference/augmentedTypesExternalModule1.js new file mode 100644 index 0000000000000..69cc810668c03 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesExternalModule1.js @@ -0,0 +1,16 @@ +//// [augmentedTypesExternalModule1.ts] +export var a = 1; +class c5 { public foo() { } } +module c5 { } // should be ok everywhere + +//// [augmentedTypesExternalModule1.js] +define(["require", "exports"], function (require, exports) { + exports.a = 1; + var c5 = (function () { + function c5() { + } + c5.prototype.foo = function () { + }; + return c5; + })(); +}); diff --git a/tests/baselines/reference/augmentedTypesFunction.errors.txt b/tests/baselines/reference/augmentedTypesFunction.errors.txt new file mode 100644 index 0000000000000..ab42d79d8f7e8 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesFunction.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/compiler/augmentedTypesFunction.ts (6 errors) ==== + // function then var + function y1() { } + var y1 = 1; // error + ~~ +!!! Duplicate identifier 'y1'. + + // function then function + function y2() { } + function y2() { } // error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate function implementation. + + function y2a() { } + var y2a = () => { } // error + ~~~ +!!! Duplicate identifier 'y2a'. + + // function then class + function y3() { } + class y3 { } // error + ~~ +!!! Duplicate identifier 'y3'. + + function y3a() { } + class y3a { public foo() { } } // error + ~~~ +!!! Duplicate identifier 'y3a'. + + // function then enum + function y4() { } + enum y4 { One } // error + ~~ +!!! Duplicate identifier 'y4'. + + // function then internal module + function y5() { } + module y5 { } // ok since module is not instantiated + + function y5a() { } + module y5a { var y = 2; } // should be an error + + function y5b() { } + module y5b { export var y = 3; } // should be an error + + function y5c() { } + module y5c { export interface I { foo(): void } } // should be an error + + // function then import, messes with other errors + //function y6() { } + //import y6 = require(''); \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js new file mode 100644 index 0000000000000..42f91d8cabdd3 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -0,0 +1,90 @@ +//// [augmentedTypesFunction.ts] +// function then var +function y1() { } +var y1 = 1; // error + +// function then function +function y2() { } +function y2() { } // error + +function y2a() { } +var y2a = () => { } // error + +// function then class +function y3() { } +class y3 { } // error + +function y3a() { } +class y3a { public foo() { } } // error + +// function then enum +function y4() { } +enum y4 { One } // error + +// function then internal module +function y5() { } +module y5 { } // ok since module is not instantiated + +function y5a() { } +module y5a { var y = 2; } // should be an error + +function y5b() { } +module y5b { export var y = 3; } // should be an error + +function y5c() { } +module y5c { export interface I { foo(): void } } // should be an error + +// function then import, messes with other errors +//function y6() { } +//import y6 = require(''); + +//// [augmentedTypesFunction.js] +function y1() { +} +var y1 = 1; +function y2() { +} +function y2() { +} +function y2a() { +} +var y2a = function () { +}; +function y3() { +} +var y3 = (function () { + function y3() { + } + return y3; +})(); +function y3a() { +} +var y3a = (function () { + function y3a() { + } + y3a.prototype.foo = function () { + }; + return y3a; +})(); +function y4() { +} +var y4; +(function (y4) { + y4[y4["One"] = 0] = "One"; +})(y4 || (y4 = {})); +function y5() { +} +function y5a() { +} +var y5a; +(function (y5a) { + var y = 2; +})(y5a || (y5a = {})); +function y5b() { +} +var y5b; +(function (y5b) { + y5b.y = 3; +})(y5b || (y5b = {})); +function y5c() { +} diff --git a/tests/baselines/reference/augmentedTypesInterface.errors.txt b/tests/baselines/reference/augmentedTypesInterface.errors.txt new file mode 100644 index 0000000000000..e26c2648c32b2 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesInterface.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/augmentedTypesInterface.ts (2 errors) ==== + // interface then interface + + interface i { + foo(): void; + } + + interface i { + bar(): number; + } + + // interface then class + interface i2 { + foo(): void; + } + + class i2 { // error + ~~ +!!! Duplicate identifier 'i2'. + bar() { + return 1; + } + } + + // interface then enum + interface i3 { + foo(): void; + } + enum i3 { One }; // error + ~~ +!!! Duplicate identifier 'i3'. + + // interface then import + interface i4 { + foo(): void; + } + + //import i4 = require(''); // error \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesInterface.js b/tests/baselines/reference/augmentedTypesInterface.js new file mode 100644 index 0000000000000..85fffd795a3e0 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesInterface.js @@ -0,0 +1,49 @@ +//// [augmentedTypesInterface.ts] +// interface then interface + +interface i { + foo(): void; +} + +interface i { + bar(): number; +} + +// interface then class +interface i2 { + foo(): void; +} + +class i2 { // error + bar() { + return 1; + } +} + +// interface then enum +interface i3 { + foo(): void; +} +enum i3 { One }; // error + +// interface then import +interface i4 { + foo(): void; +} + +//import i4 = require(''); // error + +//// [augmentedTypesInterface.js] +var i2 = (function () { + function i2() { + } + i2.prototype.bar = function () { + return 1; + }; + return i2; +})(); +var i3; +(function (i3) { + i3[i3["One"] = 0] = "One"; +})(i3 || (i3 = {})); +; diff --git a/tests/baselines/reference/augmentedTypesModules.errors.txt b/tests/baselines/reference/augmentedTypesModules.errors.txt new file mode 100644 index 0000000000000..b33ee75570d32 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules.errors.txt @@ -0,0 +1,104 @@ +==== tests/cases/compiler/augmentedTypesModules.ts (3 errors) ==== + // module then var + module m1 { } + var m1 = 1; // Should be allowed + + module m1a { var y = 2; } + var m1a = 1; + ~~~ +!!! Duplicate identifier 'm1a'. + + module m1b { export var y = 2; } + var m1b = 1; + ~~~ +!!! Duplicate identifier 'm1b'. + + module m1c { + export interface I { foo(): void; } + } + var m1c = 1; // Should be allowed + + module m1d { + export class I { foo() { } } + } + var m1d = 1; // error + ~~~ +!!! Duplicate identifier 'm1d'. + + // module then function + module m2 { } + function m2() { }; // ok since the module is not instantiated + + module m2a { var y = 2; } + function m2a() { }; // error since the module is instantiated + + module m2b { export var y = 2; } + function m2b() { }; // error since the module is instantiated + + // should be errors to have function first + function m2c() { }; + module m2c { export var y = 2; } + + module m2d { } + declare function m2d(): void; + + declare function m2e(): void; + module m2e { } + + function m2f() { }; + module m2f { export interface I { foo(): void } } + + function m2g() { }; + module m2g { export class C { foo() { } } } + + // module then class + module m3 { } + class m3 { } // ok since the module is not instantiated + + module m3a { var y = 2; } + class m3a { foo() { } } // error, class isn't ambient or declared before the module + + class m3b { foo() { } } + module m3b { var y = 2; } + + class m3c { foo() { } } + module m3c { export var y = 2; } + + declare class m3d { foo(): void } + module m3d { export var y = 2; } + + module m3e { export var y = 2; } + declare class m3e { foo(): void } + + declare class m3f { foo(): void } + module m3f { export interface I { foo(): void } } + + declare class m3g { foo(): void } + module m3g { export class C { foo() { } } } + + // module then enum + // should be errors + module m4 { } + enum m4 { } + + module m4a { var y = 2; } + enum m4a { One } + + module m4b { export var y = 2; } + enum m4b { One } + + module m4c { interface I { foo(): void } } + enum m4c { One } + + module m4d { class C { foo() { } } } + enum m4d { One } + + //// module then module + + module m5 { export var y = 2; } + module m5 { export interface I { foo(): void } } // should already be reasonably well covered + + // module then import + module m6 { export var y = 2; } + //import m6 = require(''); + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js new file mode 100644 index 0000000000000..481db22b83ea6 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -0,0 +1,267 @@ +//// [augmentedTypesModules.ts] +// module then var +module m1 { } +var m1 = 1; // Should be allowed + +module m1a { var y = 2; } +var m1a = 1; + +module m1b { export var y = 2; } +var m1b = 1; + +module m1c { + export interface I { foo(): void; } +} +var m1c = 1; // Should be allowed + +module m1d { + export class I { foo() { } } +} +var m1d = 1; // error + +// module then function +module m2 { } +function m2() { }; // ok since the module is not instantiated + +module m2a { var y = 2; } +function m2a() { }; // error since the module is instantiated + +module m2b { export var y = 2; } +function m2b() { }; // error since the module is instantiated + +// should be errors to have function first +function m2c() { }; +module m2c { export var y = 2; } + +module m2d { } +declare function m2d(): void; + +declare function m2e(): void; +module m2e { } + +function m2f() { }; +module m2f { export interface I { foo(): void } } + +function m2g() { }; +module m2g { export class C { foo() { } } } + +// module then class +module m3 { } +class m3 { } // ok since the module is not instantiated + +module m3a { var y = 2; } +class m3a { foo() { } } // error, class isn't ambient or declared before the module + +class m3b { foo() { } } +module m3b { var y = 2; } + +class m3c { foo() { } } +module m3c { export var y = 2; } + +declare class m3d { foo(): void } +module m3d { export var y = 2; } + +module m3e { export var y = 2; } +declare class m3e { foo(): void } + +declare class m3f { foo(): void } +module m3f { export interface I { foo(): void } } + +declare class m3g { foo(): void } +module m3g { export class C { foo() { } } } + +// module then enum +// should be errors +module m4 { } +enum m4 { } + +module m4a { var y = 2; } +enum m4a { One } + +module m4b { export var y = 2; } +enum m4b { One } + +module m4c { interface I { foo(): void } } +enum m4c { One } + +module m4d { class C { foo() { } } } +enum m4d { One } + +//// module then module + +module m5 { export var y = 2; } +module m5 { export interface I { foo(): void } } // should already be reasonably well covered + +// module then import +module m6 { export var y = 2; } +//import m6 = require(''); + + +//// [augmentedTypesModules.js] +var m1 = 1; +var m1a; +(function (m1a) { + var y = 2; +})(m1a || (m1a = {})); +var m1a = 1; +var m1b; +(function (m1b) { + m1b.y = 2; +})(m1b || (m1b = {})); +var m1b = 1; +var m1c = 1; +var m1d; +(function (m1d) { + var I = (function () { + function I() { + } + I.prototype.foo = function () { + }; + return I; + })(); + m1d.I = I; +})(m1d || (m1d = {})); +var m1d = 1; +function m2() { +} +; +var m2a; +(function (m2a) { + var y = 2; +})(m2a || (m2a = {})); +function m2a() { +} +; +var m2b; +(function (m2b) { + m2b.y = 2; +})(m2b || (m2b = {})); +function m2b() { +} +; +function m2c() { +} +; +var m2c; +(function (m2c) { + m2c.y = 2; +})(m2c || (m2c = {})); +function m2f() { +} +; +function m2g() { +} +; +var m2g; +(function (m2g) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + m2g.C = C; +})(m2g || (m2g = {})); +var m3 = (function () { + function m3() { + } + return m3; +})(); +var m3a; +(function (m3a) { + var y = 2; +})(m3a || (m3a = {})); +var m3a = (function () { + function m3a() { + } + m3a.prototype.foo = function () { + }; + return m3a; +})(); +var m3b = (function () { + function m3b() { + } + m3b.prototype.foo = function () { + }; + return m3b; +})(); +var m3b; +(function (m3b) { + var y = 2; +})(m3b || (m3b = {})); +var m3c = (function () { + function m3c() { + } + m3c.prototype.foo = function () { + }; + return m3c; +})(); +var m3c; +(function (m3c) { + m3c.y = 2; +})(m3c || (m3c = {})); +var m3d; +(function (m3d) { + m3d.y = 2; +})(m3d || (m3d = {})); +var m3e; +(function (m3e) { + m3e.y = 2; +})(m3e || (m3e = {})); +var m3g; +(function (m3g) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + m3g.C = C; +})(m3g || (m3g = {})); +var m4; +(function (m4) { +})(m4 || (m4 = {})); +var m4a; +(function (m4a) { + var y = 2; +})(m4a || (m4a = {})); +var m4a; +(function (m4a) { + m4a[m4a["One"] = 0] = "One"; +})(m4a || (m4a = {})); +var m4b; +(function (m4b) { + m4b.y = 2; +})(m4b || (m4b = {})); +var m4b; +(function (m4b) { + m4b[m4b["One"] = 0] = "One"; +})(m4b || (m4b = {})); +var m4c; +(function (m4c) { + m4c[m4c["One"] = 0] = "One"; +})(m4c || (m4c = {})); +var m4d; +(function (m4d) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); +})(m4d || (m4d = {})); +var m4d; +(function (m4d) { + m4d[m4d["One"] = 0] = "One"; +})(m4d || (m4d = {})); +var m5; +(function (m5) { + m5.y = 2; +})(m5 || (m5 = {})); +var m6; +(function (m6) { + m6.y = 2; +})(m6 || (m6 = {})); diff --git a/tests/baselines/reference/augmentedTypesModules2.js b/tests/baselines/reference/augmentedTypesModules2.js new file mode 100644 index 0000000000000..d1551b6244e9c --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules2.js @@ -0,0 +1,79 @@ +//// [augmentedTypesModules2.ts] +// module then function +module m2 { } +function m2() { }; // ok since the module is not instantiated + +module m2a { var y = 2; } +function m2a() { }; // error since the module is instantiated + +module m2b { export var y = 2; } +function m2b() { }; // error since the module is instantiated + +function m2c() { }; +module m2c { export var y = 2; } + +module m2cc { export var y = 2; } +function m2cc() { }; // error to have module first + +module m2d { } +declare function m2d(): void; + +declare function m2e(): void; +module m2e { } + +function m2f() { }; +module m2f { export interface I { foo(): void } } + +function m2g() { }; +module m2g { export class C { foo() { } } } + + +//// [augmentedTypesModules2.js] +function m2() { +} +; +var m2a; +(function (m2a) { + var y = 2; +})(m2a || (m2a = {})); +function m2a() { +} +; +var m2b; +(function (m2b) { + m2b.y = 2; +})(m2b || (m2b = {})); +function m2b() { +} +; +function m2c() { +} +; +var m2c; +(function (m2c) { + m2c.y = 2; +})(m2c || (m2c = {})); +var m2cc; +(function (m2cc) { + m2cc.y = 2; +})(m2cc || (m2cc = {})); +function m2cc() { +} +; +function m2f() { +} +; +function m2g() { +} +; +var m2g; +(function (m2g) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + m2g.C = C; +})(m2g || (m2g = {})); diff --git a/tests/baselines/reference/augmentedTypesModules3.js b/tests/baselines/reference/augmentedTypesModules3.js new file mode 100644 index 0000000000000..b02116035ce46 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules3.js @@ -0,0 +1,25 @@ +//// [augmentedTypesModules3.ts] +//// module then class +module m3 { } +class m3 { } // ok since the module is not instantiated + +module m3a { var y = 2; } +class m3a { foo() { } } // error, class isn't ambient or declared before the module + +//// [augmentedTypesModules3.js] +var m3 = (function () { + function m3() { + } + return m3; +})(); +var m3a; +(function (m3a) { + var y = 2; +})(m3a || (m3a = {})); +var m3a = (function () { + function m3a() { + } + m3a.prototype.foo = function () { + }; + return m3a; +})(); diff --git a/tests/baselines/reference/augmentedTypesModules3b.js b/tests/baselines/reference/augmentedTypesModules3b.js new file mode 100644 index 0000000000000..2d250ab2822a1 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules3b.js @@ -0,0 +1,62 @@ +//// [augmentedTypesModules3b.ts] +class m3b { foo() { } } +module m3b { var y = 2; } + +class m3c { foo() { } } +module m3c { export var y = 2; } + +declare class m3d { foo(): void } +module m3d { export var y = 2; } + +module m3e { export var y = 2; } +declare class m3e { foo(): void } + +declare class m3f { foo(): void } +module m3f { export interface I { foo(): void } } + +declare class m3g { foo(): void } +module m3g { export class C { foo() { } } } + + +//// [augmentedTypesModules3b.js] +var m3b = (function () { + function m3b() { + } + m3b.prototype.foo = function () { + }; + return m3b; +})(); +var m3b; +(function (m3b) { + var y = 2; +})(m3b || (m3b = {})); +var m3c = (function () { + function m3c() { + } + m3c.prototype.foo = function () { + }; + return m3c; +})(); +var m3c; +(function (m3c) { + m3c.y = 2; +})(m3c || (m3c = {})); +var m3d; +(function (m3d) { + m3d.y = 2; +})(m3d || (m3d = {})); +var m3e; +(function (m3e) { + m3e.y = 2; +})(m3e || (m3e = {})); +var m3g; +(function (m3g) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + m3g.C = C; +})(m3g || (m3g = {})); diff --git a/tests/baselines/reference/augmentedTypesModules4.js b/tests/baselines/reference/augmentedTypesModules4.js new file mode 100644 index 0000000000000..8396d0b7b92c2 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules4.js @@ -0,0 +1,66 @@ +//// [augmentedTypesModules4.ts] +// module then enum +// should be errors +module m4 { } +enum m4 { } + +module m4a { var y = 2; } +enum m4a { One } + +module m4b { export var y = 2; } +enum m4b { One } + +module m4c { interface I { foo(): void } } +enum m4c { One } + +module m4d { class C { foo() { } } } +enum m4d { One } + +//// module then module + +module m5 { export var y = 2; } +module m5 { export interface I { foo(): void } } // should already be reasonably well covered + + +//// [augmentedTypesModules4.js] +var m4; +(function (m4) { +})(m4 || (m4 = {})); +var m4a; +(function (m4a) { + var y = 2; +})(m4a || (m4a = {})); +var m4a; +(function (m4a) { + m4a[m4a["One"] = 0] = "One"; +})(m4a || (m4a = {})); +var m4b; +(function (m4b) { + m4b.y = 2; +})(m4b || (m4b = {})); +var m4b; +(function (m4b) { + m4b[m4b["One"] = 0] = "One"; +})(m4b || (m4b = {})); +var m4c; +(function (m4c) { + m4c[m4c["One"] = 0] = "One"; +})(m4c || (m4c = {})); +var m4d; +(function (m4d) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); +})(m4d || (m4d = {})); +var m4d; +(function (m4d) { + m4d[m4d["One"] = 0] = "One"; +})(m4d || (m4d = {})); +var m5; +(function (m5) { + m5.y = 2; +})(m5 || (m5 = {})); diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt new file mode 100644 index 0000000000000..6edbb52ec5044 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/compiler/augmentedTypesVar.ts (7 errors) ==== + // var then var + var x1 = 1; + var x1 = 2; + + // var then function + var x2 = 1; + function x2() { } // should be an error + ~~ +!!! Duplicate identifier 'x2'. + + var x3 = 1; + var x3 = () => { } // should be an error + ~~ +!!! Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'. + + // var then class + var x4 = 1; + class x4 { } // error + ~~ +!!! Duplicate identifier 'x4'. + + var x4a = 1; + class x4a { public foo() { } } // error + ~~~ +!!! Duplicate identifier 'x4a'. + + // var then enum + var x5 = 1; + enum x5 { One } // error + ~~ +!!! Duplicate identifier 'x5'. + + // var then module + var x6 = 1; + module x6 { } // ok since non-instantiated + + var x6a = 1; + module x6a { var y = 2; } // error since instantiated + ~~~ +!!! Duplicate identifier 'x6a'. + + var x6b = 1; + module x6b { export var y = 2; } // error + ~~~ +!!! Duplicate identifier 'x6b'. + + // var then import, messes with other error reporting + //var x7 = 1; + //import x7 = require(''); + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js new file mode 100644 index 0000000000000..65219d2d2e5a6 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -0,0 +1,77 @@ +//// [augmentedTypesVar.ts] +// var then var +var x1 = 1; +var x1 = 2; + +// var then function +var x2 = 1; +function x2() { } // should be an error + +var x3 = 1; +var x3 = () => { } // should be an error + +// var then class +var x4 = 1; +class x4 { } // error + +var x4a = 1; +class x4a { public foo() { } } // error + +// var then enum +var x5 = 1; +enum x5 { One } // error + +// var then module +var x6 = 1; +module x6 { } // ok since non-instantiated + +var x6a = 1; +module x6a { var y = 2; } // error since instantiated + +var x6b = 1; +module x6b { export var y = 2; } // error + +// var then import, messes with other error reporting +//var x7 = 1; +//import x7 = require(''); + + +//// [augmentedTypesVar.js] +var x1 = 1; +var x1 = 2; +var x2 = 1; +function x2() { +} +var x3 = 1; +var x3 = function () { +}; +var x4 = 1; +var x4 = (function () { + function x4() { + } + return x4; +})(); +var x4a = 1; +var x4a = (function () { + function x4a() { + } + x4a.prototype.foo = function () { + }; + return x4a; +})(); +var x5 = 1; +var x5; +(function (x5) { + x5[x5["One"] = 0] = "One"; +})(x5 || (x5 = {})); +var x6 = 1; +var x6a = 1; +var x6a; +(function (x6a) { + var y = 2; +})(x6a || (x6a = {})); +var x6b = 1; +var x6b; +(function (x6b) { + x6b.y = 2; +})(x6b || (x6b = {})); diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js new file mode 100644 index 0000000000000..27b56e4ff88d4 --- /dev/null +++ b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js @@ -0,0 +1,12 @@ +//// [autoAsiForStaticsInClassDeclaration.ts] +class C { + static x + static y +} + +//// [autoAsiForStaticsInClassDeclaration.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/autoLift2.errors.txt b/tests/baselines/reference/autoLift2.errors.txt new file mode 100644 index 0000000000000..6f62c8e9e4b80 --- /dev/null +++ b/tests/baselines/reference/autoLift2.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/autoLift2.ts (10 errors) ==== + class A + + { + constructor() { + this.foo: any; + ~ +!!! ';' expected. + ~~~ +!!! Property 'foo' does not exist on type 'A'. + ~~~ +!!! Cannot find name 'any'. + this.bar: any; + ~ +!!! ';' expected. + ~~~ +!!! Property 'bar' does not exist on type 'A'. + ~~~ +!!! Cannot find name 'any'. + } + + + baz() { + + this.foo = "foo"; + ~~~ +!!! Property 'foo' does not exist on type 'A'. + + this.bar = "bar"; + ~~~ +!!! Property 'bar' does not exist on type 'A'. + + [1, 2].forEach((p) => this.foo); + ~~~ +!!! Property 'foo' does not exist on type 'A'. + + [1, 2].forEach((p) => this.bar); + ~~~ +!!! Property 'bar' does not exist on type 'A'. + + } + + } + + + + var a = new A(); + + a.baz(); + + + \ No newline at end of file diff --git a/tests/baselines/reference/autolift3.errors.txt b/tests/baselines/reference/autolift3.errors.txt new file mode 100644 index 0000000000000..a73368620f562 --- /dev/null +++ b/tests/baselines/reference/autolift3.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/autolift3.ts (1 errors) ==== + class B { + + constructor() { + function foo() { } + + foo(); + + var a = 0; + var inner: any = (function() { + var CScriptIO = (function() { + var fso = 0 + + return { + readFile: function(path: string): string { + return fso.toString(); + } + } + })(); + return inner; + })(); + } + } + + var b = new B(); + + b.foo(); + ~~~ +!!! Property 'foo' does not exist on type 'B'. + + + + \ No newline at end of file diff --git a/tests/baselines/reference/autolift3.js b/tests/baselines/reference/autolift3.js new file mode 100644 index 0000000000000..cc3bcaaae9745 --- /dev/null +++ b/tests/baselines/reference/autolift3.js @@ -0,0 +1,55 @@ +//// [autolift3.ts] +class B { + + constructor() { + function foo() { } + + foo(); + + var a = 0; + var inner: any = (function() { + var CScriptIO = (function() { + var fso = 0 + + return { + readFile: function(path: string): string { + return fso.toString(); + } + } + })(); + return inner; + })(); + } +} + +var b = new B(); + +b.foo(); + + + + + +//// [autolift3.js] +var B = (function () { + function B() { + function foo() { + } + foo(); + var a = 0; + var inner = (function () { + var CScriptIO = (function () { + var fso = 0; + return { + readFile: function (path) { + return fso.toString(); + } + }; + })(); + return inner; + })(); + } + return B; +})(); +var b = new B(); +b.foo(); diff --git a/tests/baselines/reference/autolift4.errors.txt b/tests/baselines/reference/autolift4.errors.txt new file mode 100644 index 0000000000000..9469d976c5912 --- /dev/null +++ b/tests/baselines/reference/autolift4.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/autolift4.ts (1 errors) ==== + class Point { + + constructor(public x: number, public y: number) { + + } + getDist() { + return Math.sqrt(this.x*this.x + this.y*this.y); + } + static origin = new Point(0,0); + } + + class Point3D extends Point { + + constructor(x: number, y: number, public z: number, m:number) { + super(x, y); + } + + getDist() { + return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.m); + ~ +!!! Property 'm' does not exist on type 'Point3D'. + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js new file mode 100644 index 0000000000000..6a903b890d8da --- /dev/null +++ b/tests/baselines/reference/autolift4.js @@ -0,0 +1,54 @@ +//// [autolift4.ts] +class Point { + + constructor(public x: number, public y: number) { + + } + getDist() { + return Math.sqrt(this.x*this.x + this.y*this.y); + } + static origin = new Point(0,0); +} + +class Point3D extends Point { + + constructor(x: number, y: number, public z: number, m:number) { + super(x, y); + } + + getDist() { + return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.m); + } +} + + + +//// [autolift4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt(this.x * this.x + this.y * this.y); + }; + Point.origin = new Point(0, 0); + return Point; +})(); +var Point3D = (function (_super) { + __extends(Point3D, _super); + function Point3D(x, y, z, m) { + _super.call(this, x, y); + this.z = z; + } + Point3D.prototype.getDist = function () { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.m); + }; + return Point3D; +})(Point); diff --git a/tests/baselines/reference/autonumberingInEnums.js b/tests/baselines/reference/autonumberingInEnums.js new file mode 100644 index 0000000000000..2d0bdc0282df6 --- /dev/null +++ b/tests/baselines/reference/autonumberingInEnums.js @@ -0,0 +1,18 @@ +//// [autonumberingInEnums.ts] +enum Foo { + a = 1 +} + +enum Foo { + b // should work fine +} + +//// [autonumberingInEnums.js] +var Foo; +(function (Foo) { + Foo[Foo["a"] = 1] = "a"; +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + Foo[Foo["b"] = 0] = "b"; +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/avoid.js b/tests/baselines/reference/avoid.js new file mode 100644 index 0000000000000..45f4d52a7bc12 --- /dev/null +++ b/tests/baselines/reference/avoid.js @@ -0,0 +1,38 @@ +//// [avoid.ts] +function f() { + var x=1; +} + +var y=f(); // error void fn +var why:any=f(); // error void fn +var w:any; +w=f(); // error void fn + +class C { + g() { + + } +} + +var z=new C().g(); // error void fn +var N=new f(); // ok with void fn + + + +//// [avoid.js] +function f() { + var x = 1; +} +var y = f(); +var why = f(); +var w; +w = f(); +var C = (function () { + function C() { + } + C.prototype.g = function () { + }; + return C; +})(); +var z = new C().g(); +var N = new f(); diff --git a/tests/baselines/reference/badArrayIndex.errors.txt b/tests/baselines/reference/badArrayIndex.errors.txt new file mode 100644 index 0000000000000..71228c95e2179 --- /dev/null +++ b/tests/baselines/reference/badArrayIndex.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/badArrayIndex.ts (2 errors) ==== + var results = number[]; + ~ +!!! Expression expected. + ~~~~~~ +!!! Cannot find name 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt new file mode 100644 index 0000000000000..9c1edf93231eb --- /dev/null +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== + class Z { + public x = ""; + } + + var a1: Z[] = []; + var a2 = new Z[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var a3 = new Z[](); + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var a4: Z[] = new Z[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var a5: Z[] = new Z[](); + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var a6: Z[][] = new Z [ ] [ ]; + ~~~~~~~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + \ No newline at end of file diff --git a/tests/baselines/reference/badExternalModuleReference.errors.txt b/tests/baselines/reference/badExternalModuleReference.errors.txt new file mode 100644 index 0000000000000..392336db3794d --- /dev/null +++ b/tests/baselines/reference/badExternalModuleReference.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/badExternalModuleReference.ts (1 errors) ==== + import a1 = require("garbage"); + ~~~~~~~~~ +!!! Cannot find external module 'garbage'. + export declare var a: { + test1: a1.connectModule; + (): a1.connectExport; + }; + \ No newline at end of file diff --git a/tests/baselines/reference/badExternalModuleReference.js b/tests/baselines/reference/badExternalModuleReference.js new file mode 100644 index 0000000000000..3e748aee23974 --- /dev/null +++ b/tests/baselines/reference/badExternalModuleReference.js @@ -0,0 +1,11 @@ +//// [badExternalModuleReference.ts] +import a1 = require("garbage"); +export declare var a: { + test1: a1.connectModule; + (): a1.connectExport; +}; + + +//// [badExternalModuleReference.js] +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/badOverloadError.js b/tests/baselines/reference/badOverloadError.js new file mode 100644 index 0000000000000..fe59c4bb6b947 --- /dev/null +++ b/tests/baselines/reference/badOverloadError.js @@ -0,0 +1,10 @@ +//// [badOverloadError.ts] +function method() { + var dictionary = <{ [index: string]: string; }>{}; +} + + +//// [badOverloadError.js] +function method() { + var dictionary = {}; +} diff --git a/tests/baselines/reference/badThisBinding.js b/tests/baselines/reference/badThisBinding.js new file mode 100644 index 0000000000000..115759411bf4e --- /dev/null +++ b/tests/baselines/reference/badThisBinding.js @@ -0,0 +1,27 @@ +//// [badThisBinding.ts] +declare function foo(a:any): any; +declare function bar(a:any): any; + +class Greeter { + constructor() { + foo(() => { + bar(() => { + var x = this; + }); + }); + } + +} + +//// [badThisBinding.js] +var Greeter = (function () { + function Greeter() { + var _this = this; + foo(function () { + bar(function () { + var x = _this; + }); + }); + } + return Greeter; +})(); diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt new file mode 100644 index 0000000000000..e1bd24e234994 --- /dev/null +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/compiler/baseCheck.ts (9 errors) ==== + class C { constructor(x: number, y: number) { } } + class ELoc extends C { + constructor(x: number) { + super(0, x); + } + } + class ELocVar extends C { + constructor(x: number) { + super(0, loc); + ~~~ +!!! Cannot find name 'loc'. + } + + m() { + var loc=10; + } + } + + class D extends C { constructor(public z: number) { super(this.z) } } // too few params + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! 'this' cannot be referenced in current location. + class E extends C { constructor(public z: number) { super(0, this.z) } } + ~~~~ +!!! 'this' cannot be referenced in current location. + class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! 'this' cannot be referenced in current location. + + function f() { + if (x<10) { + ~ +!!! Cannot find name 'x'. + x=11; + ~ +!!! Cannot find name 'x'. + } + else { + x=12; + ~ +!!! Cannot find name 'x'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js new file mode 100644 index 0000000000000..39eb8a312c943 --- /dev/null +++ b/tests/baselines/reference/baseCheck.js @@ -0,0 +1,92 @@ +//// [baseCheck.ts] +class C { constructor(x: number, y: number) { } } +class ELoc extends C { + constructor(x: number) { + super(0, x); + } +} +class ELocVar extends C { + constructor(x: number) { + super(0, loc); + } + + m() { + var loc=10; + } +} + +class D extends C { constructor(public z: number) { super(this.z) } } // too few params +class E extends C { constructor(public z: number) { super(0, this.z) } } +class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type + +function f() { + if (x<10) { + x=11; + } + else { + x=12; + } +} + + +//// [baseCheck.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C(x, y) { + } + return C; +})(); +var ELoc = (function (_super) { + __extends(ELoc, _super); + function ELoc(x) { + _super.call(this, 0, x); + } + return ELoc; +})(C); +var ELocVar = (function (_super) { + __extends(ELocVar, _super); + function ELocVar(x) { + _super.call(this, 0, loc); + } + ELocVar.prototype.m = function () { + var loc = 10; + }; + return ELocVar; +})(C); +var D = (function (_super) { + __extends(D, _super); + function D(z) { + _super.call(this, this.z); + this.z = z; + } + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E(z) { + _super.call(this, 0, this.z); + this.z = z; + } + return E; +})(C); +var F = (function (_super) { + __extends(F, _super); + function F(z) { + _super.call(this, "hello", this.z); + this.z = z; + } + return F; +})(C); +function f() { + if (x < 10) { + x = 11; + } + else { + x = 12; + } +} diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js new file mode 100644 index 0000000000000..0c1e6c610f39e --- /dev/null +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -0,0 +1,47 @@ +//// [baseIndexSignatureResolution.ts] +class Base { private a: string; } +class Derived extends Base { private b: string; } + +// Note - commmenting "extends Foo" prevents the error +interface Foo { + [i: number]: Base; +} +interface FooOf extends Foo { + [i: number]: TBase; +} +var x: FooOf = null; +var y: Derived = x[0]; + +/* +// Note - the equivalent for normal interface methods works fine: +interface A { + foo(): Base; +} +interface B extends A { + foo(): TBase; +} +var b: B = null; +var z: Derived = b.foo(); +*/ + +//// [baseIndexSignatureResolution.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var x = null; +var y = x[0]; diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.js b/tests/baselines/reference/baseTypeAfterDerivedType.js new file mode 100644 index 0000000000000..c64239ac0c86f --- /dev/null +++ b/tests/baselines/reference/baseTypeAfterDerivedType.js @@ -0,0 +1,30 @@ +//// [baseTypeAfterDerivedType.ts] +interface Derived extends Base { + method(...args: any[]): void; +} + +interface Base { + method(...args: any[]): void; +} + +class Derived2 implements Base2 { + method(...args: any[]): void { } +} + +interface Base2 { + method(...args: any[]): void; +} + + +//// [baseTypeAfterDerivedType.js] +var Derived2 = (function () { + function Derived2() { + } + Derived2.prototype.method = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + }; + return Derived2; +})(); diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js new file mode 100644 index 0000000000000..b206ef2b91189 --- /dev/null +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -0,0 +1,70 @@ +//// [baseTypeOrderChecking.ts] +var someVariable: Class4; + + + +class Class1 + +{ + +} + + + +class Class2 extends Class1 + +{ + +} + + + +class Class3 + +{ + + public memberVariable: Class2; + +} + + + +class Class4 extends Class3 + +{ + +} + + +//// [baseTypeOrderChecking.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var someVariable; +var Class1 = (function () { + function Class1() { + } + return Class1; +})(); +var Class2 = (function (_super) { + __extends(Class2, _super); + function Class2() { + _super.apply(this, arguments); + } + return Class2; +})(Class1); +var Class3 = (function () { + function Class3() { + } + return Class3; +})(); +var Class4 = (function (_super) { + __extends(Class4, _super); + function Class4() { + _super.apply(this, arguments); + } + return Class4; +})(Class3); diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt new file mode 100644 index 0000000000000..eb083f30f3ce3 --- /dev/null +++ b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/baseTypePrivateMemberClash.ts (1 errors) ==== + class X { + private m: number; + } + class Y { + private m: string; + } + + interface Z extends X, Y { } + ~ +!!! Interface 'Z' cannot simultaneously extend types 'X' and 'Y': +!!! Named properties 'm' of types 'X' and 'Y' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.js b/tests/baselines/reference/baseTypePrivateMemberClash.js new file mode 100644 index 0000000000000..79a44ee44d4eb --- /dev/null +++ b/tests/baselines/reference/baseTypePrivateMemberClash.js @@ -0,0 +1,21 @@ +//// [baseTypePrivateMemberClash.ts] +class X { + private m: number; +} +class Y { + private m: string; +} + +interface Z extends X, Y { } + +//// [baseTypePrivateMemberClash.js] +var X = (function () { + function X() { + } + return X; +})(); +var Y = (function () { + function Y() { + } + return Y; +})(); diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt new file mode 100644 index 0000000000000..f4dc4ab5c8f5f --- /dev/null +++ b/tests/baselines/reference/bases.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/compiler/bases.ts (10 errors) ==== + interface I { + x; + } + + class B { + constructor() { + this.y: any; + ~ +!!! ';' expected. + ~ +!!! Property 'y' does not exist on type 'B'. + ~~~ +!!! Cannot find name 'any'. + } + } + + class C extends B implements I { + ~ +!!! Class 'C' incorrectly implements interface 'I': +!!! Property 'x' is missing in type 'C'. + constructor() { + ~~~~~~~~~~~~~~~ + this.x: any; + ~ +!!! ';' expected. + ~~~~~~~~~~~~~~~~~~~~ + ~ +!!! Property 'x' does not exist on type 'C'. + ~~~ +!!! Cannot find name 'any'. + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + new C().x; + ~ +!!! Property 'x' does not exist on type 'C'. + new C().y; + ~ +!!! Property 'y' does not exist on type 'C'. + + \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js new file mode 100644 index 0000000000000..01af9d529ac20 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -0,0 +1,77 @@ +//// [bestCommonTypeOfConditionalExpressions.ts] +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// no errors expected here + +var a: { x: number; y?: number }; +var b: { x: number; z?: number }; + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Base { baz: string; } +var base: Base; +var derived: Derived; +var derived2: Derived2; + +var r = true ? 1 : 2; +var r3 = true ? 1 : {}; +var r4 = true ? a : b; // typeof a +var r5 = true ? b : a; // typeof b +var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void +var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; +var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void +var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT +var r11 = true ? base : derived2; + +function foo5(t: T, u: U): Object { + return true ? t : u; // BCT is Object +} + +//// [bestCommonTypeOfConditionalExpressions.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a; +var b; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +var base; +var derived; +var derived2; +var r = true ? 1 : 2; +var r3 = true ? 1 : {}; +var r4 = true ? a : b; +var r5 = true ? b : a; +var r6 = true ? function (x) { +} : function (x) { +}; +var r7 = true ? function (x) { +} : function (x) { +}; +var r8 = true ? function (x) { +} : function (x) { +}; +var r10 = true ? derived : derived2; +var r11 = true ? base : derived2; +function foo5(t, u) { + return true ? t : u; +} diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt new file mode 100644 index 0000000000000..9d86da98f3f27 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts (8 errors) ==== + // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) + // these are errors + + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + var base: Base; + var derived: Derived; + var derived2: Derived2; + + var r2 = true ? 1 : ''; + ~~~~~~~~~~~~~ +!!! No best common type exists between 'number' and 'string'. + var r9 = true ? derived : derived2; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! No best common type exists between 'Derived' and 'Derived2'. + + function foo(t: T, u: U) { + return true ? t : u; + ~~~~~~~~~~~~ +!!! No best common type exists between 'T' and 'U'. + } + + function foo2(t: T, u: U) { // Error for referencing own type parameter + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return true ? t : u; // Ok because BCT(T, U) = U + ~~~~~~~~~~~~ +!!! No best common type exists between 'T' and 'U'. + } + + function foo3(t: T, u: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return true ? t : u; + ~~~~~~~~~~~~ +!!! No best common type exists between 'T' and 'U'. + } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js new file mode 100644 index 0000000000000..c205b8a1c1de3 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -0,0 +1,66 @@ +//// [bestCommonTypeOfConditionalExpressions2.ts] +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// these are errors + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Base { baz: string; } +var base: Base; +var derived: Derived; +var derived2: Derived2; + +var r2 = true ? 1 : ''; +var r9 = true ? derived : derived2; + +function foo(t: T, u: U) { + return true ? t : u; +} + +function foo2(t: T, u: U) { // Error for referencing own type parameter + return true ? t : u; // Ok because BCT(T, U) = U +} + +function foo3(t: T, u: U) { + return true ? t : u; +} + +//// [bestCommonTypeOfConditionalExpressions2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +var base; +var derived; +var derived2; +var r2 = true ? 1 : ''; +var r9 = true ? derived : derived2; +function foo(t, u) { + return true ? t : u; +} +function foo2(t, u) { + return true ? t : u; +} +function foo3(t, u) { + return true ? t : u; +} diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.js b/tests/baselines/reference/bestCommonTypeReturnStatement.js new file mode 100644 index 0000000000000..232ffc07c54f8 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.js @@ -0,0 +1,26 @@ +//// [bestCommonTypeReturnStatement.ts] +interface IPromise { + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; +} + +function f() { + if (true) return b(); + return d(); +} + + +function b(): IPromise { return null; } +function d(): IPromise { return null; } + +//// [bestCommonTypeReturnStatement.js] +function f() { + if (true) + return b(); + return d(); +} +function b() { + return null; +} +function d() { + return null; +} diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js new file mode 100644 index 0000000000000..00814d6552621 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js @@ -0,0 +1,28 @@ +//// [bestCommonTypeWithContextualTyping.ts] +interface Contextual { + dummy; + p?: number; +} + +interface Ellement { + dummy; + p: any; +} + +var e: Ellement; + +// All of these should pass. Neither type is a supertype of the other, but the RHS should +// always use Ellement in these examples (not Contextual). Because Ellement is assignable +// to Contextual, no errors. +var arr: Contextual[] = [e]; // Ellement[] +var obj: { [s: string]: Contextual } = { s: e }; // { s: Ellement; [s: string]: Ellement } + +var conditional: Contextual = null ? e : e; // Ellement +var contextualOr: Contextual = e || e; // Ellement + +//// [bestCommonTypeWithContextualTyping.js] +var e; +var arr = [e]; +var obj = { s: e }; +var conditional = null ? e : e; +var contextualOr = e || e; diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js new file mode 100644 index 0000000000000..ed994ebf7894a --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js @@ -0,0 +1,27 @@ +//// [bestCommonTypeWithOptionalProperties.ts] +interface X { foo: string } +interface Y extends X { bar?: number } +interface Z extends X { bar: string } + +var x: X; +var y: Y; +var z: Z; + +// All these arrays should be X[] +var b1 = [x, y, z]; +var b2 = [x, z, y]; +var b3 = [y, x, z]; +var b4 = [y, z, x]; +var b5 = [z, x, y]; +var b6 = [z, y, x]; + +//// [bestCommonTypeWithOptionalProperties.js] +var x; +var y; +var z; +var b1 = [x, y, z]; +var b2 = [x, z, y]; +var b3 = [y, x, z]; +var b4 = [y, z, x]; +var b5 = [z, x, y]; +var b6 = [z, y, x]; diff --git a/tests/baselines/reference/binaryArithmatic1.js b/tests/baselines/reference/binaryArithmatic1.js new file mode 100644 index 0000000000000..fc347d719a59b --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic1.js @@ -0,0 +1,5 @@ +//// [binaryArithmatic1.ts] +var v = 4 | null; + +//// [binaryArithmatic1.js] +var v = 4 | null; diff --git a/tests/baselines/reference/binaryArithmatic2.js b/tests/baselines/reference/binaryArithmatic2.js new file mode 100644 index 0000000000000..58e247ed2e72a --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic2.js @@ -0,0 +1,5 @@ +//// [binaryArithmatic2.ts] +var v = 4 | undefined; + +//// [binaryArithmatic2.js] +var v = 4 | undefined; diff --git a/tests/baselines/reference/binaryArithmatic3.errors.txt b/tests/baselines/reference/binaryArithmatic3.errors.txt new file mode 100644 index 0000000000000..74f3662aad736 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic3.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/binaryArithmatic3.ts (2 errors) ==== + var v = undefined | undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/binaryArithmatic3.js b/tests/baselines/reference/binaryArithmatic3.js new file mode 100644 index 0000000000000..09a34671ed188 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic3.js @@ -0,0 +1,5 @@ +//// [binaryArithmatic3.ts] +var v = undefined | undefined; + +//// [binaryArithmatic3.js] +var v = undefined | undefined; diff --git a/tests/baselines/reference/binaryArithmatic4.errors.txt b/tests/baselines/reference/binaryArithmatic4.errors.txt new file mode 100644 index 0000000000000..87200bec116d1 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/binaryArithmatic4.ts (2 errors) ==== + var v = null | null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/binaryArithmatic4.js b/tests/baselines/reference/binaryArithmatic4.js new file mode 100644 index 0000000000000..1b00d6c9a3c21 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic4.js @@ -0,0 +1,5 @@ +//// [binaryArithmatic4.ts] +var v = null | null; + +//// [binaryArithmatic4.js] +var v = null | null; diff --git a/tests/baselines/reference/bind1.errors.txt b/tests/baselines/reference/bind1.errors.txt new file mode 100644 index 0000000000000..0f883d94f5287 --- /dev/null +++ b/tests/baselines/reference/bind1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/bind1.ts (1 errors) ==== + module M { + export class C implements I {} // this should be an unresolved symbol I error + ~ +!!! Cannot find name 'I'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/bind1.js b/tests/baselines/reference/bind1.js new file mode 100644 index 0000000000000..2aa31265797e8 --- /dev/null +++ b/tests/baselines/reference/bind1.js @@ -0,0 +1,17 @@ +//// [bind1.ts] +module M { + export class C implements I {} // this should be an unresolved symbol I error +} + + + +//// [bind1.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; +})(M || (M = {})); diff --git a/tests/baselines/reference/bind2.js b/tests/baselines/reference/bind2.js new file mode 100644 index 0000000000000..51d8178319fd2 --- /dev/null +++ b/tests/baselines/reference/bind2.js @@ -0,0 +1,4 @@ +//// [bind2.ts] + + +//// [bind2.js] diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.js b/tests/baselines/reference/binopAssignmentShouldHaveType.js new file mode 100644 index 0000000000000..e47b6dea875ca --- /dev/null +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.js @@ -0,0 +1,41 @@ +//// [binopAssignmentShouldHaveType.ts] +declare var console; +"use strict"; +module Test { + export class Bug { + getName():string { + return "name"; + } + bug() { + var name:string= null; + if ((name= this.getName()).length > 0) { + console.log(name); + } + } + } +} + + + + + +//// [binopAssignmentShouldHaveType.js] +"use strict"; +var Test; +(function (Test) { + var Bug = (function () { + function Bug() { + } + Bug.prototype.getName = function () { + return "name"; + }; + Bug.prototype.bug = function () { + var name = null; + if ((name = this.getName()).length > 0) { + console.log(name); + } + }; + return Bug; + })(); + Test.Bug = Bug; +})(Test || (Test = {})); diff --git a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt new file mode 100644 index 0000000000000..8ec2f4e04076e --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorInvalidOperations.ts (4 errors) ==== + // Unary operator ~ + var q; + + // operand before ~ + var a = q~; //expect error + ~ +!!! ',' expected. + ~ +!!! Expression expected. + + // multiple operands after ~ + var mul = ~[1, 2, "abc"], ""; //expect error + ~~ +!!! Variable declaration expected. + + // miss an operand + var b =~; + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..3513093d9f424 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,69 @@ +==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (3 errors) ==== + // ~ operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {} + var obj1 = { x:"", y: () => { }}; + + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any other type var + var ResultIsNumber = ~ANY1; + var ResultIsNumber1 = ~ANY2; + var ResultIsNumber2 = ~A; + var ResultIsNumber3 = ~M; + var ResultIsNumber4 = ~obj; + var ResultIsNumber5 = ~obj1; + + // any type literal + var ResultIsNumber6 = ~undefined; + var ResultIsNumber7 = ~null; + + // any type expressions + var ResultIsNumber8 = ~ANY2[0] + var ResultIsNumber9 = ~obj1.x; + var ResultIsNumber10 = ~obj1.y; + var ResultIsNumber11 = ~objA.a; + var ResultIsNumber12 = ~M.n; + var ResultIsNumber13 = ~foo(); + var ResultIsNumber14 = ~A.foo(); + var ResultIsNumber15 = ~(ANY + ANY1); + var ResultIsNumber16 = ~(null + undefined); + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber17 = ~(null + null); + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber18 = ~(undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + // multiple ~ operators + var ResultIsNumber19 = ~~ANY; + var ResultIsNumber20 = ~~~(ANY + ANY1); + + //miss assignment operators + ~ANY; + ~ANY1; + ~ANY2[0]; + ~ANY, ANY1; + ~obj1.y; + ~objA.a; + ~M.n; + ~~obj1.x; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..b4995f230506f --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -0,0 +1,118 @@ +//// [bitwiseNotOperatorWithAnyOtherType.ts] +// ~ operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj: () => {} +var obj1 = { x:"", y: () => { }}; + +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any other type var +var ResultIsNumber = ~ANY1; +var ResultIsNumber1 = ~ANY2; +var ResultIsNumber2 = ~A; +var ResultIsNumber3 = ~M; +var ResultIsNumber4 = ~obj; +var ResultIsNumber5 = ~obj1; + +// any type literal +var ResultIsNumber6 = ~undefined; +var ResultIsNumber7 = ~null; + +// any type expressions +var ResultIsNumber8 = ~ANY2[0] +var ResultIsNumber9 = ~obj1.x; +var ResultIsNumber10 = ~obj1.y; +var ResultIsNumber11 = ~objA.a; +var ResultIsNumber12 = ~M.n; +var ResultIsNumber13 = ~foo(); +var ResultIsNumber14 = ~A.foo(); +var ResultIsNumber15 = ~(ANY + ANY1); +var ResultIsNumber16 = ~(null + undefined); +var ResultIsNumber17 = ~(null + null); +var ResultIsNumber18 = ~(undefined + undefined); + +// multiple ~ operators +var ResultIsNumber19 = ~~ANY; +var ResultIsNumber20 = ~~~(ANY + ANY1); + +//miss assignment operators +~ANY; +~ANY1; +~ANY2[0]; +~ANY, ANY1; +~obj1.y; +~objA.a; +~M.n; +~~obj1.x; + +//// [bitwiseNotOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber = ~ANY1; +var ResultIsNumber1 = ~ANY2; +var ResultIsNumber2 = ~A; +var ResultIsNumber3 = ~M; +var ResultIsNumber4 = ~obj; +var ResultIsNumber5 = ~obj1; +var ResultIsNumber6 = ~undefined; +var ResultIsNumber7 = ~null; +var ResultIsNumber8 = ~ANY2[0]; +var ResultIsNumber9 = ~obj1.x; +var ResultIsNumber10 = ~obj1.y; +var ResultIsNumber11 = ~objA.a; +var ResultIsNumber12 = ~M.n; +var ResultIsNumber13 = ~foo(); +var ResultIsNumber14 = ~A.foo(); +var ResultIsNumber15 = ~(ANY + ANY1); +var ResultIsNumber16 = ~(null + undefined); +var ResultIsNumber17 = ~(null + null); +var ResultIsNumber18 = ~(undefined + undefined); +var ResultIsNumber19 = ~~ANY; +var ResultIsNumber20 = ~~~(ANY + ANY1); +~ANY; +~ANY1; +~ANY2[0]; +~ANY, ANY1; +~obj1.y; +~objA.a; +~M.n; +~~obj1.x; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js new file mode 100644 index 0000000000000..303be601a8b52 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -0,0 +1,72 @@ +//// [bitwiseNotOperatorWithBooleanType.ts] +// ~ operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return false; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsNumber1 = ~BOOLEAN; + +// boolean type literal +var ResultIsNumber2 = ~true; +var ResultIsNumber3 = ~{ x: true, y: false }; + +// boolean type expressions +var ResultIsNumber4 = ~objA.a; +var ResultIsNumber5 = ~M.n; +var ResultIsNumber6 = ~foo(); +var ResultIsNumber7 = ~A.foo(); + +// multiple ~ operators +var ResultIsNumber8 = ~~BOOLEAN; + +// miss assignment operators +~true; +~BOOLEAN; +~foo(); +~true, false; +~objA.a; +~M.n; + +//// [bitwiseNotOperatorWithBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return false; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ~BOOLEAN; +var ResultIsNumber2 = ~true; +var ResultIsNumber3 = ~{ x: true, y: false }; +var ResultIsNumber4 = ~objA.a; +var ResultIsNumber5 = ~M.n; +var ResultIsNumber6 = ~foo(); +var ResultIsNumber7 = ~A.foo(); +var ResultIsNumber8 = ~~BOOLEAN; +~true; +~BOOLEAN; +~foo(); +~true, false; +~objA.a; +~M.n; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js new file mode 100644 index 0000000000000..71568eefcecb3 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -0,0 +1,35 @@ +//// [bitwiseNotOperatorWithEnumType.ts] +// ~ operator on enum type + +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsNumber1 = ~ENUM1; + +// enum type expressions +var ResultIsNumber2 = ~ENUM1[1]; +var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]); + +// multiple ~ operators +var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); + +// miss assignment operators +~ENUM1; +~ENUM1[1]; +~ENUM1[1], ~ENUM1[2]; + +//// [bitwiseNotOperatorWithEnumType.js] +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = ~ENUM1; +var ResultIsNumber2 = ~ENUM1[1]; +var ResultIsNumber3 = ~(ENUM1[1] + ENUM1[2]); +var ResultIsNumber4 = ~~~(ENUM1[1] + ENUM1[2]); +~ENUM1; +~ENUM1[1]; +~ENUM1[1], ~ENUM1[2]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js new file mode 100644 index 0000000000000..d1684a65eaf12 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -0,0 +1,86 @@ +//// [bitwiseNotOperatorWithNumberType.ts] +// ~ operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsNumber1 = ~NUMBER; +var ResultIsNumber2 = ~NUMBER1; + +// number type literal +var ResultIsNumber3 = ~1; +var ResultIsNumber4 = ~{ x: 1, y: 2}; +var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; + +// number type expressions +var ResultIsNumber6 = ~objA.a; +var ResultIsNumber7 = ~M.n; +var ResultIsNumber8 = ~NUMBER1[0]; +var ResultIsNumber9 = ~foo(); +var ResultIsNumber10 = ~A.foo(); +var ResultIsNumber11 = ~(NUMBER + NUMBER); + +// multiple ~ operators +var ResultIsNumber12 = ~~NUMBER; +var ResultIsNumber13 = ~~~(NUMBER + NUMBER); + +// miss assignment operators +~NUMBER; +~NUMBER1; +~foo(); +~objA.a; +~M.n; +~objA.a, M.n; + +//// [bitwiseNotOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ~NUMBER; +var ResultIsNumber2 = ~NUMBER1; +var ResultIsNumber3 = ~1; +var ResultIsNumber4 = ~{ x: 1, y: 2 }; +var ResultIsNumber5 = ~{ x: 1, y: function (n) { + return n; +} }; +var ResultIsNumber6 = ~objA.a; +var ResultIsNumber7 = ~M.n; +var ResultIsNumber8 = ~NUMBER1[0]; +var ResultIsNumber9 = ~foo(); +var ResultIsNumber10 = ~A.foo(); +var ResultIsNumber11 = ~(NUMBER + NUMBER); +var ResultIsNumber12 = ~~NUMBER; +var ResultIsNumber13 = ~~~(NUMBER + NUMBER); +~NUMBER; +~NUMBER1; +~foo(); +~objA.a; +~M.n; +~objA.a, M.n; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js new file mode 100644 index 0000000000000..4b18f4dbea5c2 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -0,0 +1,84 @@ +//// [bitwiseNotOperatorWithStringType.ts] +// ~ operator on string type +var STRING: string; +var STRING1: string[] = ["", "abc"]; + +function foo(): string { return "abc"; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsNumber1 = ~STRING; +var ResultIsNumber2 = ~STRING1; + +// string type literal +var ResultIsNumber3 = ~""; +var ResultIsNumber4 = ~{ x: "", y: "" }; +var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; + +// string type expressions +var ResultIsNumber6 = ~objA.a; +var ResultIsNumber7 = ~M.n; +var ResultIsNumber8 = ~STRING1[0]; +var ResultIsNumber9 = ~foo(); +var ResultIsNumber10 = ~A.foo(); +var ResultIsNumber11 = ~(STRING + STRING); +var ResultIsNumber12 = ~STRING.charAt(0); + +// multiple ~ operators +var ResultIsNumber13 = ~~STRING; +var ResultIsNumber14 = ~~~(STRING + STRING); + +//miss assignment operators +~STRING; +~STRING1; +~foo(); +~objA.a,M.n; + +//// [bitwiseNotOperatorWithStringType.js] +var STRING; +var STRING1 = ["", "abc"]; +function foo() { + return "abc"; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ~STRING; +var ResultIsNumber2 = ~STRING1; +var ResultIsNumber3 = ~""; +var ResultIsNumber4 = ~{ x: "", y: "" }; +var ResultIsNumber5 = ~{ x: "", y: function (s) { + return s; +} }; +var ResultIsNumber6 = ~objA.a; +var ResultIsNumber7 = ~M.n; +var ResultIsNumber8 = ~STRING1[0]; +var ResultIsNumber9 = ~foo(); +var ResultIsNumber10 = ~A.foo(); +var ResultIsNumber11 = ~(STRING + STRING); +var ResultIsNumber12 = ~STRING.charAt(0); +var ResultIsNumber13 = ~~STRING; +var ResultIsNumber14 = ~~~(STRING + STRING); +~STRING; +~STRING1; +~foo(); +~objA.a, M.n; diff --git a/tests/baselines/reference/bom-utf16be.js b/tests/baselines/reference/bom-utf16be.js new file mode 100644 index 0000000000000..e2bab0613e300 --- /dev/null +++ b/tests/baselines/reference/bom-utf16be.js @@ -0,0 +1,6 @@ +//// [bom-utf16be.ts] +var x=10; + + +//// [bom-utf16be.js] +var x = 10; diff --git a/tests/baselines/reference/bom-utf16le.js b/tests/baselines/reference/bom-utf16le.js new file mode 100644 index 0000000000000..215b9f0207261 --- /dev/null +++ b/tests/baselines/reference/bom-utf16le.js @@ -0,0 +1,6 @@ +//// [bom-utf16le.ts] +var x=10; + + +//// [bom-utf16le.js] +var x = 10; diff --git a/tests/baselines/reference/bom-utf8.js b/tests/baselines/reference/bom-utf8.js new file mode 100644 index 0000000000000..5ca8c824b6a65 --- /dev/null +++ b/tests/baselines/reference/bom-utf8.js @@ -0,0 +1,6 @@ +//// [bom-utf8.ts] +var x=10; + + +//// [bom-utf8.js] +var x = 10; diff --git a/tests/baselines/reference/boolInsteadOfBoolean.errors.txt b/tests/baselines/reference/boolInsteadOfBoolean.errors.txt new file mode 100644 index 0000000000000..611d98995d862 --- /dev/null +++ b/tests/baselines/reference/boolInsteadOfBoolean.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts (1 errors) ==== + var x: bool; + ~~~~ +!!! Cannot find name 'bool'. + var a: boolean = x; + x = a; \ No newline at end of file diff --git a/tests/baselines/reference/boolInsteadOfBoolean.js b/tests/baselines/reference/boolInsteadOfBoolean.js new file mode 100644 index 0000000000000..6cf0c4492fdd1 --- /dev/null +++ b/tests/baselines/reference/boolInsteadOfBoolean.js @@ -0,0 +1,9 @@ +//// [boolInsteadOfBoolean.ts] +var x: bool; +var a: boolean = x; +x = a; + +//// [boolInsteadOfBoolean.js] +var x; +var a = x; +x = a; diff --git a/tests/baselines/reference/booleanPropertyAccess.js b/tests/baselines/reference/booleanPropertyAccess.js new file mode 100644 index 0000000000000..5d816253c37eb --- /dev/null +++ b/tests/baselines/reference/booleanPropertyAccess.js @@ -0,0 +1,10 @@ +//// [booleanPropertyAccess.ts] +var x = true; + +var a = x.toString(); +var b = x['toString'](); + +//// [booleanPropertyAccess.js] +var x = true; +var a = x.toString(); +var b = x['toString'](); diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.js b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js new file mode 100644 index 0000000000000..0a3de64c675ff --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement1.ts] +while (true) { + break; +} + +//// [breakInIterationOrSwitchStatement1.js] +while (true) { + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.js b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js new file mode 100644 index 0000000000000..903bed733db13 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js @@ -0,0 +1,10 @@ +//// [breakInIterationOrSwitchStatement2.ts] +do { + break; +} +while (true); + +//// [breakInIterationOrSwitchStatement2.js] +do { + break; +} while (true); diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.js b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js new file mode 100644 index 0000000000000..dfadaf031823e --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement3.ts] +for (;;) { + break; +} + +//// [breakInIterationOrSwitchStatement3.js] +for (;;) { + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt new file mode 100644 index 0000000000000..667108c902d89 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/breakInIterationOrSwitchStatement4.ts (1 errors) ==== + for (var i in something) { + ~~~~~~~~~ +!!! Cannot find name 'something'. + break; + } \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.js b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js new file mode 100644 index 0000000000000..ef1978666e28a --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement4.ts] +for (var i in something) { + break; +} + +//// [breakInIterationOrSwitchStatement4.js] +for (var i in something) { + break; +} diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js new file mode 100644 index 0000000000000..21ca5d4cce45f --- /dev/null +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js @@ -0,0 +1,5 @@ +//// [breakNotInIterationOrSwitchStatement1.ts] +break; + +//// [breakNotInIterationOrSwitchStatement1.js] +break; diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js new file mode 100644 index 0000000000000..531e5b5e5b6bf --- /dev/null +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js @@ -0,0 +1,13 @@ +//// [breakNotInIterationOrSwitchStatement2.ts] +while (true) { + function f() { + break; + } +} + +//// [breakNotInIterationOrSwitchStatement2.js] +while (true) { + function f() { + break; + } +} diff --git a/tests/baselines/reference/breakTarget1.js b/tests/baselines/reference/breakTarget1.js new file mode 100644 index 0000000000000..5283dfe191189 --- /dev/null +++ b/tests/baselines/reference/breakTarget1.js @@ -0,0 +1,6 @@ +//// [breakTarget1.ts] +target: + break target; + +//// [breakTarget1.js] +target: break target; diff --git a/tests/baselines/reference/breakTarget2.js b/tests/baselines/reference/breakTarget2.js new file mode 100644 index 0000000000000..9ca050c18e515 --- /dev/null +++ b/tests/baselines/reference/breakTarget2.js @@ -0,0 +1,10 @@ +//// [breakTarget2.ts] +target: +while (true) { + break target; +} + +//// [breakTarget2.js] +target: while (true) { + break target; +} diff --git a/tests/baselines/reference/breakTarget3.js b/tests/baselines/reference/breakTarget3.js new file mode 100644 index 0000000000000..0fa6cd2d2988a --- /dev/null +++ b/tests/baselines/reference/breakTarget3.js @@ -0,0 +1,11 @@ +//// [breakTarget3.ts] +target1: +target2: +while (true) { + break target1; +} + +//// [breakTarget3.js] +target1: target2: while (true) { + break target1; +} diff --git a/tests/baselines/reference/breakTarget4.js b/tests/baselines/reference/breakTarget4.js new file mode 100644 index 0000000000000..4586301d71b7c --- /dev/null +++ b/tests/baselines/reference/breakTarget4.js @@ -0,0 +1,11 @@ +//// [breakTarget4.ts] +target1: +target2: +while (true) { + break target2; +} + +//// [breakTarget4.js] +target1: target2: while (true) { + break target2; +} diff --git a/tests/baselines/reference/breakTarget5.js b/tests/baselines/reference/breakTarget5.js new file mode 100644 index 0000000000000..197e4e147bd7e --- /dev/null +++ b/tests/baselines/reference/breakTarget5.js @@ -0,0 +1,18 @@ +//// [breakTarget5.ts] +target: +while (true) { + function f() { + while (true) { + break target; + } + } +} + +//// [breakTarget5.js] +target: while (true) { + function f() { + while (true) { + break target; + } + } +} diff --git a/tests/baselines/reference/breakTarget6.js b/tests/baselines/reference/breakTarget6.js new file mode 100644 index 0000000000000..9c5bcc3ded192 --- /dev/null +++ b/tests/baselines/reference/breakTarget6.js @@ -0,0 +1,9 @@ +//// [breakTarget6.ts] +while (true) { + break target; +} + +//// [breakTarget6.js] +while (true) { + break target; +} diff --git a/tests/baselines/reference/callConstructAssignment.errors.txt b/tests/baselines/reference/callConstructAssignment.errors.txt new file mode 100644 index 0000000000000..e80dbcbfc3834 --- /dev/null +++ b/tests/baselines/reference/callConstructAssignment.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ==== + + + var foo:{ ( ):void; } + + var bar:{ new ( ):any; } + + foo = bar; // error + ~~~ +!!! Type 'new () => any' is not assignable to type '() => void'. + bar = foo; // error + ~~~ +!!! Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/callConstructAssignment.js b/tests/baselines/reference/callConstructAssignment.js new file mode 100644 index 0000000000000..936269a996e7c --- /dev/null +++ b/tests/baselines/reference/callConstructAssignment.js @@ -0,0 +1,15 @@ +//// [callConstructAssignment.ts] + + +var foo:{ ( ):void; } + +var bar:{ new ( ):any; } + +foo = bar; // error +bar = foo; // error + +//// [callConstructAssignment.js] +var foo; +var bar; +foo = bar; +bar = foo; diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js new file mode 100644 index 0000000000000..9acb2fd1fb40b --- /dev/null +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js @@ -0,0 +1,10 @@ +//// [callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts] +interface I { + (u: U): U; +} +var i: I; +var y = i(""); // y should be string + +//// [callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js] +var i; +var y = i(""); diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt new file mode 100644 index 0000000000000..dfe311ab86c21 --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt @@ -0,0 +1,73 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ==== + // type parameter lists must exactly match type argument lists + // all of these invocations are errors + + function f(x: T, y: U): T { return null; } + var r1 = f(1, ''); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r1b = f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var f2 = (x: T, y: U): T => { return null; } + var r2 = f2(1, ''); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2b = f2(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var f3: { (x: T, y: U): T; } + var r3 = f3(1, ''); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r3b = f3(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class C { + f(x: T, y: U): T { + return null; + } + } + var r4 = (new C()).f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r4b = (new C()).f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface I { + f(x: T, y: U): T; + } + var i: I; + var r5 = i.f(1, ''); + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5b = i.f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class C2 { + f(x: T, y: U): T { + return null; + } + } + var r6 = (new C2()).f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6b = (new C2()).f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface I2 { + f(x: T, y: U): T; + } + var i2: I2; + var r7 = i2.f(1, ''); + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = i2.f(1, ''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js new file mode 100644 index 0000000000000..f02070124b8a1 --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js @@ -0,0 +1,86 @@ +//// [callGenericFunctionWithIncorrectNumberOfTypeArguments.ts] +// type parameter lists must exactly match type argument lists +// all of these invocations are errors + +function f(x: T, y: U): T { return null; } +var r1 = f(1, ''); +var r1b = f(1, ''); + +var f2 = (x: T, y: U): T => { return null; } +var r2 = f2(1, ''); +var r2b = f2(1, ''); + +var f3: { (x: T, y: U): T; } +var r3 = f3(1, ''); +var r3b = f3(1, ''); + +class C { + f(x: T, y: U): T { + return null; + } +} +var r4 = (new C()).f(1, ''); +var r4b = (new C()).f(1, ''); + +interface I { + f(x: T, y: U): T; +} +var i: I; +var r5 = i.f(1, ''); +var r5b = i.f(1, ''); + +class C2 { + f(x: T, y: U): T { + return null; + } +} +var r6 = (new C2()).f(1, ''); +var r6b = (new C2()).f(1, ''); + +interface I2 { + f(x: T, y: U): T; +} +var i2: I2; +var r7 = i2.f(1, ''); +var r7b = i2.f(1, ''); + +//// [callGenericFunctionWithIncorrectNumberOfTypeArguments.js] +function f(x, y) { + return null; +} +var r1 = f(1, ''); +var r1b = f(1, ''); +var f2 = function (x, y) { + return null; +}; +var r2 = f2(1, ''); +var r2b = f2(1, ''); +var f3; +var r3 = f3(1, ''); +var r3b = f3(1, ''); +var C = (function () { + function C() { + } + C.prototype.f = function (x, y) { + return null; + }; + return C; +})(); +var r4 = (new C()).f(1, ''); +var r4b = (new C()).f(1, ''); +var i; +var r5 = i.f(1, ''); +var r5b = i.f(1, ''); +var C2 = (function () { + function C2() { + } + C2.prototype.f = function (x, y) { + return null; + }; + return C2; +})(); +var r6 = (new C2()).f(1, ''); +var r6b = (new C2()).f(1, ''); +var i2; +var r7 = i2.f(1, ''); +var r7b = i2.f(1, ''); diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js new file mode 100644 index 0000000000000..44a8e8ee11371 --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js @@ -0,0 +1,71 @@ +//// [callGenericFunctionWithZeroTypeArguments.ts] +// valid invocations of generic functions with no explicit type arguments provided + +function f(x: T): T { return null; } +var r = f(1); + +var f2 = (x: T): T => { return null; } +var r2 = f2(1); + +var f3: { (x: T): T; } +var r3 = f3(1); + +class C { + f(x: T): T { + return null; + } +} +var r4 = (new C()).f(1); + +interface I { + f(x: T): T; +} +var i: I; +var r5 = i.f(1); + +class C2 { + f(x: T): T { + return null; + } +} +var r6 = (new C2()).f(1); + +interface I2 { + f(x: T): T; +} +var i2: I2; +var r7 = i2.f(1); + +//// [callGenericFunctionWithZeroTypeArguments.js] +function f(x) { + return null; +} +var r = f(1); +var f2 = function (x) { + return null; +}; +var r2 = f2(1); +var f3; +var r3 = f3(1); +var C = (function () { + function C() { + } + C.prototype.f = function (x) { + return null; + }; + return C; +})(); +var r4 = (new C()).f(1); +var i; +var r5 = i.f(1); +var C2 = (function () { + function C2() { + } + C2.prototype.f = function (x) { + return null; + }; + return C2; +})(); +var r6 = (new C2()).f(1); +var i2; +var r7 = i2.f(1); diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt new file mode 100644 index 0000000000000..69284efdf8262 --- /dev/null +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.errors.txt @@ -0,0 +1,62 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/callNonGenericFunctionWithTypeArguments.ts (9 errors) ==== + // it is always illegal to provide type arguments to a non-generic function + // all invocations here are illegal + + function f(x: number) { return null; } + var r = f(1); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var f2 = (x: number) => { return null; } + var r2 = f2(1); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var f3: { (x: number): any; } + var r3 = f3(1); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class C { + f(x: number) { + return null; + } + } + var r4 = (new C()).f(1); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface I { + f(x: number): any; + } + var i: I; + var r5 = i.f(1); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class C2 { + f(x: number) { + return null; + } + } + var r6 = (new C2()).f(1); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface I2 { + f(x: number); + } + var i2: I2; + var r7 = i2.f(1); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var a; + var r8 = a(); + ~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + + var a2: any; + var r8 = a2(); + ~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js new file mode 100644 index 0000000000000..6d93ed9deb404 --- /dev/null +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js @@ -0,0 +1,82 @@ +//// [callNonGenericFunctionWithTypeArguments.ts] +// it is always illegal to provide type arguments to a non-generic function +// all invocations here are illegal + +function f(x: number) { return null; } +var r = f(1); + +var f2 = (x: number) => { return null; } +var r2 = f2(1); + +var f3: { (x: number): any; } +var r3 = f3(1); + +class C { + f(x: number) { + return null; + } +} +var r4 = (new C()).f(1); + +interface I { + f(x: number): any; +} +var i: I; +var r5 = i.f(1); + +class C2 { + f(x: number) { + return null; + } +} +var r6 = (new C2()).f(1); + +interface I2 { + f(x: number); +} +var i2: I2; +var r7 = i2.f(1); + +var a; +var r8 = a(); + +var a2: any; +var r8 = a2(); + +//// [callNonGenericFunctionWithTypeArguments.js] +function f(x) { + return null; +} +var r = f(1); +var f2 = function (x) { + return null; +}; +var r2 = f2(1); +var f3; +var r3 = f3(1); +var C = (function () { + function C() { + } + C.prototype.f = function (x) { + return null; + }; + return C; +})(); +var r4 = (new C()).f(1); +var i; +var r5 = i.f(1); +var C2 = (function () { + function C2() { + } + C2.prototype.f = function (x) { + return null; + }; + return C2; +})(); +var r6 = (new C2()).f(1); +var i2; +var r7 = i2.f(1); +var a; +var r8 = a(); +var a2; +var r8 = a2(); diff --git a/tests/baselines/reference/callOnClass.errors.txt b/tests/baselines/reference/callOnClass.errors.txt new file mode 100644 index 0000000000000..9232fefe7034b --- /dev/null +++ b/tests/baselines/reference/callOnClass.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/callOnClass.ts (1 errors) ==== + class C { } + var c = C(); + ~~~ +!!! Value of type 'typeof C' is not callable. Did you mean to include 'new'? + + \ No newline at end of file diff --git a/tests/baselines/reference/callOnClass.js b/tests/baselines/reference/callOnClass.js new file mode 100644 index 0000000000000..18127dca56c60 --- /dev/null +++ b/tests/baselines/reference/callOnClass.js @@ -0,0 +1,13 @@ +//// [callOnClass.ts] +class C { } +var c = C(); + + + +//// [callOnClass.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = C(); diff --git a/tests/baselines/reference/callOnInstance.errors.txt b/tests/baselines/reference/callOnInstance.errors.txt new file mode 100644 index 0000000000000..da866a56e04da --- /dev/null +++ b/tests/baselines/reference/callOnInstance.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/callOnInstance.ts (4 errors) ==== + declare function D(): string; + + declare class D { constructor (value: number); } // Duplicate identifier + ~ +!!! Duplicate identifier 'D'. + + var s1: string = D(); // OK + + var s2: string = (new D(1))(); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + declare class C { constructor(value: number); } + (new C(1))(); // Error for calling an instance + ~~~~~~~~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file diff --git a/tests/baselines/reference/callOnInstance.js b/tests/baselines/reference/callOnInstance.js new file mode 100644 index 0000000000000..fae3108b080c0 --- /dev/null +++ b/tests/baselines/reference/callOnInstance.js @@ -0,0 +1,16 @@ +//// [callOnInstance.ts] +declare function D(): string; + +declare class D { constructor (value: number); } // Duplicate identifier + +var s1: string = D(); // OK + +var s2: string = (new D(1))(); + +declare class C { constructor(value: number); } +(new C(1))(); // Error for calling an instance + +//// [callOnInstance.js] +var s1 = D(); +var s2 = (new D(1))(); +(new C(1))(); diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt new file mode 100644 index 0000000000000..89e5312a09c2f --- /dev/null +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/callOverloadViaElementAccessExpression.ts (2 errors) ==== + class C { + foo(x: number): number; + foo(x: string): string; + foo(x: any): any { + return null; + } + } + + var c = new C(); + var r: string = c['foo'](1); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + var r2: number = c['foo'](''); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.js b/tests/baselines/reference/callOverloadViaElementAccessExpression.js new file mode 100644 index 0000000000000..2e35c72e780b4 --- /dev/null +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.js @@ -0,0 +1,25 @@ +//// [callOverloadViaElementAccessExpression.ts] +class C { + foo(x: number): number; + foo(x: string): string; + foo(x: any): any { + return null; + } +} + +var c = new C(); +var r: string = c['foo'](1); +var r2: number = c['foo'](''); + +//// [callOverloadViaElementAccessExpression.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var c = new C(); +var r = c['foo'](1); +var r2 = c['foo'](''); diff --git a/tests/baselines/reference/callOverloads1.errors.txt b/tests/baselines/reference/callOverloads1.errors.txt new file mode 100644 index 0000000000000..47a6b6c8e06dd --- /dev/null +++ b/tests/baselines/reference/callOverloads1.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/callOverloads1.ts (3 errors) ==== + class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } + } + + function Foo(); // error + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Duplicate identifier 'Foo'. + function F1(s:string); + function F1(a:any) { return a;} + + var f1 = new Foo("hey"); + + + f1.bar1(); + Foo(); + ~~~~~ +!!! Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads1.js b/tests/baselines/reference/callOverloads1.js new file mode 100644 index 0000000000000..4d595108ab250 --- /dev/null +++ b/tests/baselines/reference/callOverloads1.js @@ -0,0 +1,33 @@ +//// [callOverloads1.ts] +class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } +} + +function Foo(); // error +function F1(s:string); +function F1(a:any) { return a;} + +var f1 = new Foo("hey"); + + +f1.bar1(); +Foo(); + +//// [callOverloads1.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(); +function F1(a) { + return a; +} +var f1 = new Foo("hey"); +f1.bar1(); +Foo(); diff --git a/tests/baselines/reference/callOverloads2.errors.txt b/tests/baselines/reference/callOverloads2.errors.txt new file mode 100644 index 0000000000000..8d99dba63d68a --- /dev/null +++ b/tests/baselines/reference/callOverloads2.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/callOverloads2.ts (5 errors) ==== + + + class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } + } + + function Foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Duplicate identifier 'Foo'. + + function F1(s:string) {return s;} + function F1(a:any) { return a;} // error - duplicate identifier + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate function implementation. + + function Goo(s:string); // error - no implementation + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + + declare function Gar(s:String); // expect no error + + var f1 = new Foo("hey"); + + + f1.bar1(); + Foo(); + ~~~~~ +!!! Value of type 'typeof Foo' is not callable. Did you mean to include 'new'? + \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js new file mode 100644 index 0000000000000..2bffd50a2ab89 --- /dev/null +++ b/tests/baselines/reference/callOverloads2.js @@ -0,0 +1,44 @@ +//// [callOverloads2.ts] + + +class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } +} + +function Foo(); + +function F1(s:string) {return s;} +function F1(a:any) { return a;} // error - duplicate identifier + +function Goo(s:string); // error - no implementation + +declare function Gar(s:String); // expect no error + +var f1 = new Foo("hey"); + + +f1.bar1(); +Foo(); + + +//// [callOverloads2.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(); +function F1(s) { + return s; +} +function F1(a) { + return a; +} +var f1 = new Foo("hey"); +f1.bar1(); +Foo(); diff --git a/tests/baselines/reference/callOverloads3.errors.txt b/tests/baselines/reference/callOverloads3.errors.txt new file mode 100644 index 0000000000000..a2e4050579f43 --- /dev/null +++ b/tests/baselines/reference/callOverloads3.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/callOverloads3.ts (5 errors) ==== + + function Foo():Foo; + ~~~ +!!! Cannot find name 'Foo'. + function Foo(s:string):Foo; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Cannot find name 'Foo'. + class Foo { + ~~~ +!!! Duplicate identifier 'Foo'. + bar1() { /*WScript.Echo("bar1");*/ } + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } + } + //class Foo(s: String); + + var f1 = new Foo("hey"); + ~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + + f1.bar1(); + Foo(); + Foo("s"); + \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads3.js b/tests/baselines/reference/callOverloads3.js new file mode 100644 index 0000000000000..8e630e437a576 --- /dev/null +++ b/tests/baselines/reference/callOverloads3.js @@ -0,0 +1,32 @@ +//// [callOverloads3.ts] + +function Foo():Foo; +function Foo(s:string):Foo; +class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } +} +//class Foo(s: String); + +var f1 = new Foo("hey"); + + +f1.bar1(); +Foo(); +Foo("s"); + + +//// [callOverloads3.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(); +var f1 = new Foo("hey"); +f1.bar1(); +Foo(); +Foo("s"); diff --git a/tests/baselines/reference/callOverloads4.errors.txt b/tests/baselines/reference/callOverloads4.errors.txt new file mode 100644 index 0000000000000..36c0b97955e8a --- /dev/null +++ b/tests/baselines/reference/callOverloads4.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/callOverloads4.ts (5 errors) ==== + + function Foo():Foo; + ~~~ +!!! Cannot find name 'Foo'. + function Foo(s:string):Foo; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Cannot find name 'Foo'. + class Foo { + ~~~ +!!! Duplicate identifier 'Foo'. + bar1() { /*WScript.Echo("bar1");*/ } + constructor(s: string); + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } + } + + var f1 = new Foo("hey"); + ~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + + f1.bar1(); + Foo(); + Foo("s"); + \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads4.js b/tests/baselines/reference/callOverloads4.js new file mode 100644 index 0000000000000..19bed1db43767 --- /dev/null +++ b/tests/baselines/reference/callOverloads4.js @@ -0,0 +1,32 @@ +//// [callOverloads4.ts] + +function Foo():Foo; +function Foo(s:string):Foo; +class Foo { + bar1() { /*WScript.Echo("bar1");*/ } + constructor(s: string); + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } +} + +var f1 = new Foo("hey"); + + +f1.bar1(); +Foo(); +Foo("s"); + + +//// [callOverloads4.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(); +var f1 = new Foo("hey"); +f1.bar1(); +Foo(); +Foo("s"); diff --git a/tests/baselines/reference/callOverloads5.errors.txt b/tests/baselines/reference/callOverloads5.errors.txt new file mode 100644 index 0000000000000..ba667881530c0 --- /dev/null +++ b/tests/baselines/reference/callOverloads5.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/callOverloads5.ts (5 errors) ==== + function Foo():Foo; + ~~~ +!!! Cannot find name 'Foo'. + function Foo(s:string):Foo; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Cannot find name 'Foo'. + class Foo { + ~~~ +!!! Duplicate identifier 'Foo'. + bar1(s:string); + bar1(n:number); + bar1(a:any) { /*WScript.Echo(a);*/ } + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } + } + //class Foo(s: String); + + var f1 = new Foo("hey"); + ~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + + f1.bar1("a"); + Foo(); + Foo("s"); + \ No newline at end of file diff --git a/tests/baselines/reference/callOverloads5.js b/tests/baselines/reference/callOverloads5.js new file mode 100644 index 0000000000000..b1dba82ae3c59 --- /dev/null +++ b/tests/baselines/reference/callOverloads5.js @@ -0,0 +1,33 @@ +//// [callOverloads5.ts] +function Foo():Foo; +function Foo(s:string):Foo; +class Foo { + bar1(s:string); + bar1(n:number); + bar1(a:any) { /*WScript.Echo(a);*/ } + constructor(x: any) { + // WScript.Echo("Constructor function has executed"); + } +} +//class Foo(s: String); + +var f1 = new Foo("hey"); + + +f1.bar1("a"); +Foo(); +Foo("s"); + + +//// [callOverloads5.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function (a) { + }; + return Foo; +})(); +var f1 = new Foo("hey"); +f1.bar1("a"); +Foo(); +Foo("s"); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt new file mode 100644 index 0000000000000..1708786502092 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -0,0 +1,73 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts (1 errors) ==== + module CallSignature { + interface Base { // T + // M's + (x: number): void; + (x: number, y: number): void; + } + + // S's + interface I extends Base { + // N's + (x: number): number; // ok because base returns void + (x: number, y: number): boolean; // ok because base returns void + (x: T): string; // ok because base returns void + } + + interface Base2 { // T + // M's + (x: number): number; + } + + // S's + interface I2 extends Base2 { + // N's + (x: number): string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + (x: T): string; // ok, adds a new call signature + } + } + + module MemberWithCallSignature { + interface Base { // T + // M's + a: (x: number) => void; + a2: (x: number, y: number) => void; + a3: (x: T) => void; + } + + // S's + interface I extends Base { + // N's + a: (x: number) => number; // ok because base returns void + a2: (x: number, y: number) => boolean; // ok because base returns void + a3: (x: T) => string; // ok because base returns void + } + + interface Base2 { // T + // M's + a: (x: number) => number; + a2: (x: T) => T; + } + + // S's + interface I2 extends Base2 { + ~~ +!!! Interface 'I2' incorrectly extends interface 'Base2': +!!! Types of property 'a' are incompatible: +!!! Type '(x: number) => string' is not assignable to type '(x: number) => number': +!!! Type 'string' is not assignable to type 'number'. + // N's + a: (x: number) => string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + a2: (x: T) => string; // error because base returns non-void; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance.js new file mode 100644 index 0000000000000..3b540397d556a --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.js @@ -0,0 +1,70 @@ +//// [callSignatureAssignabilityInInheritance.ts] +module CallSignature { + interface Base { // T + // M's + (x: number): void; + (x: number, y: number): void; + } + + // S's + interface I extends Base { + // N's + (x: number): number; // ok because base returns void + (x: number, y: number): boolean; // ok because base returns void + (x: T): string; // ok because base returns void + } + + interface Base2 { // T + // M's + (x: number): number; + } + + // S's + interface I2 extends Base2 { + // N's + (x: number): string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + (x: T): string; // ok, adds a new call signature + } +} + +module MemberWithCallSignature { + interface Base { // T + // M's + a: (x: number) => void; + a2: (x: number, y: number) => void; + a3: (x: T) => void; + } + + // S's + interface I extends Base { + // N's + a: (x: number) => number; // ok because base returns void + a2: (x: number, y: number) => boolean; // ok because base returns void + a3: (x: T) => string; // ok because base returns void + } + + interface Base2 { // T + // M's + a: (x: number) => number; + a2: (x: T) => T; + } + + // S's + interface I2 extends Base2 { + // N's + a: (x: number) => string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + a2: (x: T) => string; // error because base returns non-void; + } +} + +//// [callSignatureAssignabilityInInheritance.js] diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js new file mode 100644 index 0000000000000..b0de8c047c750 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -0,0 +1,104 @@ +//// [callSignatureAssignabilityInInheritance2.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: (x: number) => number[]; + a2: (x: number) => string[]; + a3: (x: number) => void; + a4: (x: string, y: number) => string; + a5: (x: (arg: string) => number) => string; + a6: (x: (arg: Base) => Derived) => Base; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Derived[]) => Derived; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a13: (x: Array, y: Array) => Array; + a14: (x: { a: string; b: number }) => Object; + a15: { + (x: number): number[]; + (x: string): string[]; + }; + a16: { + (x: T): number[]; + (x: U): number[]; + }; + a17: { + (x: (a: number) => number): number[]; + (x: (a: string) => string): string[]; + }; + a18: { + (x: { + (a: number): number; + (a: string): string; + }): any[]; + (x: { + (a: boolean): boolean; + (a: Date): Date; + }): any[]; + }; +} + +// S's +interface I extends A { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: (x: (arg: T) => U) => (r: T) => U; // ok + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: (...x: T[]) => T; // ok + a11: (x: T, y: T) => T; // ok + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature + a15: (x: T) => T[]; // ok + a16: (x: T) => number[]; // ok + a17: (x: (a: T) => T) => T[]; // ok + a18: (x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +} + +//// [callSignatureAssignabilityInInheritance2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt new file mode 100644 index 0000000000000..81cd8b924f00a --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -0,0 +1,130 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + // error cases + + module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // base type with non-generic call signatures + interface A { + a2: (x: number) => string[]; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Base[]) => Base; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a14: { + (x: number): number[]; + (x: string): string[]; + }; + a15: (x: { a: string; b: number }) => number; + a16: { + // type of parameter is overload set which means we can't do inference based on this type + (x: { + (a: number): number; + (a?: number): number; + }): number[]; + (x: { + (a: boolean): boolean; + (a?: boolean): boolean; + }): boolean[]; + }; + a17: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; + } + + interface I extends A { + a2: (x: T) => U[]; // error, contextual signature instantiation doesn't relate return types so U is {}, not a subtype of string[] + } + + interface I2 extends A { + ~~ +!!! Interface 'I2' incorrectly extends interface 'A': +!!! Types of property 'a2' are incompatible: +!!! Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'T' is not assignable to type 'number'. + a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic + } + + interface I3 extends A { + // valid, no inferences for V so it defaults to Derived2 + a7: (x: (arg: T) => U) => (r: T) => V; + } + + interface I4 extends A { + ~~ +!!! Interface 'I4' incorrectly extends interface 'A': +!!! Types of property 'a8' are incompatible: +!!! Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type '{ foo: number; }' is not assignable to type 'Base': +!!! Types of property 'foo' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch + } + + interface I4B extends A { + a10: (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation + } + + interface I4C extends A { + a11: (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation + } + + interface I4E extends A { + a12: >(x: Array, y: Array) => T; // valid, no inferences for T, defaults to Array + } + + interface I6 extends A { + a15: (x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type + } + + interface I7 extends A { + a15: (x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string + } + + interface I8 extends A { + // ok, we relate each signature of a16 to b16, and within that, we make inferences from two different signatures in the respective A.a16 signature + a16: (x: (a: T) => T) => T[]; + } + + interface I9 extends A { + a17: (x: (a: T) => T) => any[]; // valid, target is more constrained than source, so it is safe in the traditional constraint-contravariant fashion + } + } + + module WithGenericSignaturesInBaseType { + // base type has generic call signature + interface B { + a2: (x: T) => T[]; + } + + interface I6 extends B { + a2: (x: T) => string[]; // error + } + + // base type has generic call signature + interface C { + a2: (x: T) => string[]; + } + + interface I7 extends C { + a2: (x: T) => T[]; // error + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js new file mode 100644 index 0000000000000..0f7a1c93b587a --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -0,0 +1,151 @@ +//// [callSignatureAssignabilityInInheritance3.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// error cases + +module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // base type with non-generic call signatures + interface A { + a2: (x: number) => string[]; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Base[]) => Base; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a14: { + (x: number): number[]; + (x: string): string[]; + }; + a15: (x: { a: string; b: number }) => number; + a16: { + // type of parameter is overload set which means we can't do inference based on this type + (x: { + (a: number): number; + (a?: number): number; + }): number[]; + (x: { + (a: boolean): boolean; + (a?: boolean): boolean; + }): boolean[]; + }; + a17: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; + } + + interface I extends A { + a2: (x: T) => U[]; // error, contextual signature instantiation doesn't relate return types so U is {}, not a subtype of string[] + } + + interface I2 extends A { + a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic + } + + interface I3 extends A { + // valid, no inferences for V so it defaults to Derived2 + a7: (x: (arg: T) => U) => (r: T) => V; + } + + interface I4 extends A { + a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch + } + + interface I4B extends A { + a10: (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation + } + + interface I4C extends A { + a11: (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation + } + + interface I4E extends A { + a12: >(x: Array, y: Array) => T; // valid, no inferences for T, defaults to Array + } + + interface I6 extends A { + a15: (x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type + } + + interface I7 extends A { + a15: (x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string + } + + interface I8 extends A { + // ok, we relate each signature of a16 to b16, and within that, we make inferences from two different signatures in the respective A.a16 signature + a16: (x: (a: T) => T) => T[]; + } + + interface I9 extends A { + a17: (x: (a: T) => T) => any[]; // valid, target is more constrained than source, so it is safe in the traditional constraint-contravariant fashion + } + } + + module WithGenericSignaturesInBaseType { + // base type has generic call signature + interface B { + a2: (x: T) => T[]; + } + + interface I6 extends B { + a2: (x: T) => string[]; // error + } + + // base type has generic call signature + interface C { + a2: (x: T) => string[]; + } + + interface I7 extends C { + a2: (x: T) => T[]; // error + } + } +} + +//// [callSignatureAssignabilityInInheritance3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Errors; +(function (Errors) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Derived); + var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; + })(Base); +})(Errors || (Errors = {})); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js new file mode 100644 index 0000000000000..b48921b69d712 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -0,0 +1,84 @@ +//// [callSignatureAssignabilityInInheritance4.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: (x: T) => T[]; + a2: (x: T) => string[]; + a3: (x: T) => void; + a4: (x: T, y: U) => string; + a5: (x: (arg: T) => U) => T; + a6: (x: (arg: T) => Derived) => T; + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: (x: { a: T; b: T }) => T[]; + a16: (x: { a: T; b: T }) => T[]; + a17: { + (x: (a: T) => T): T[]; + (x: (a: T) => T): T[]; + }; + a18: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; +} + +// S's +interface I extends A { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok + a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V + a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type + a17: (x: (a: T) => T) => T[]; // ok + a18: (x: (a: T) => T) => any[]; // ok +} + +//// [callSignatureAssignabilityInInheritance4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js new file mode 100644 index 0000000000000..00298f1907978 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -0,0 +1,83 @@ +//// [callSignatureAssignabilityInInheritance5.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: (x: number) => number[]; + a2: (x: number) => string[]; + a3: (x: number) => void; + a4: (x: string, y: number) => string; + a5: (x: (arg: string) => number) => string; + a6: (x: (arg: Base) => Derived) => Base; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Derived[]) => Derived; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a13: (x: Array, y: Array) => Array; + a14: (x: { a: string; b: number }) => Object; +} + +interface B extends A { + a: (x: T) => T[]; +} + +// S's +interface I extends B { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: (x: (arg: T) => U) => (r: T) => U; // ok + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: (...x: T[]) => T; // ok + a11: (x: T, y: T) => T; // ok + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +} + +//// [callSignatureAssignabilityInInheritance5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js new file mode 100644 index 0000000000000..329e57bcab110 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -0,0 +1,85 @@ +//// [callSignatureAssignabilityInInheritance6.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: (x: T) => T[]; + a2: (x: T) => string[]; + a3: (x: T) => void; + a4: (x: T, y: U) => string; + a5: (x: (arg: T) => U) => T; + a6: (x: (arg: T) => Derived) => T; + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: (x: { a: T; b: T }) => T[]; + a16: (x: { a: T; b: T }) => T[]; +} + +// S's +interface I extends A { + a: (x: T) => T[]; +} + +interface I2 extends A { + a2: (x: T) => string[]; +} + +interface I3 extends A { + a3: (x: T) => T; +} + +interface I4 extends A { + a4: (x: T, y: U) => string; +} + +interface I5 extends A { + a5: (x: (arg: T) => U) => T; +} + +interface I7 extends A { + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +} + +interface I9 extends A { + a16: (x: { a: T; b: T }) => T[]; +} + +//// [callSignatureAssignabilityInInheritance6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/callSignatureFunctionOverload.js b/tests/baselines/reference/callSignatureFunctionOverload.js new file mode 100644 index 0000000000000..6da28693bced3 --- /dev/null +++ b/tests/baselines/reference/callSignatureFunctionOverload.js @@ -0,0 +1,19 @@ +//// [callSignatureFunctionOverload.ts] +var foo: { + (name: string): string; + (name: 'order'): string; + (name: 'content'): string; + (name: 'done'): string; +} + +var foo2: { + (name: string): string; + (name: 'order'): string; + (name: 'order'): string; + (name: 'done'): string; +} + + +//// [callSignatureFunctionOverload.js] +var foo; +var foo2; diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt new file mode 100644 index 0000000000000..7cd13f2fafb71 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -0,0 +1,88 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts (16 errors) ==== + // Optional parameters cannot also have initializer expressions, these are all errors + + function foo(x?: number = 1) { } + ~ +!!! Parameter cannot have question mark and initializer. + var f = function foo(x?: number = 1) { } + ~ +!!! Parameter cannot have question mark and initializer. + var f2 = (x: number, y? = 1) => { } + ~ +!!! Parameter cannot have question mark and initializer. + + foo(1); + foo(); + f(1); + f(); + f2(1); + f2(1, 2); + + class C { + foo(x?: number = 1) { } + ~ +!!! Parameter cannot have question mark and initializer. + } + + var c: C; + c.foo(); + c.foo(1); + + interface I { + (x? = 1); + ~ +!!! Parameter cannot have question mark and initializer. + ~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + foo(x: number, y?: number = 1); + ~ +!!! Parameter cannot have question mark and initializer. + ~~~~~~~~~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + var i: I; + i(); + i(1); + i.foo(1); + i.foo(1, 2); + + var a: { + (x?: number = 1); + ~ +!!! Parameter cannot have question mark and initializer. + ~~~~~~~~~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + foo(x? = 1); + ~ +!!! Parameter cannot have question mark and initializer. + ~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + a(); + a(1); + a.foo(); + a.foo(1); + + var b = { + foo(x?: number = 1) { }, + ~ +!!! Parameter cannot have question mark and initializer. + a: function foo(x: number, y?: number = '') { }, + ~ +!!! Parameter cannot have question mark and initializer. + ~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + b: (x?: any = '') => { } + ~ +!!! Parameter cannot have question mark and initializer. + } + + b.foo(); + b.foo(1); + b.a(1); + b.a(1, 2); + b.b(); + b.b(1); + \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js new file mode 100644 index 0000000000000..8530026d05068 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js @@ -0,0 +1,31 @@ +//// [callSignatureWithoutAnnotationsOrBody.ts] +// Call signatures without a return type annotation and function body return 'any' + +function foo(x) { } +var r = foo(1); // void since there's a body + +interface I { + (); + f(); +} +var i: I; +var r2 = i(); +var r3 = i.f(); + +var a: { + (); + f(); +}; +var r4 = a(); +var r5 = a.f(); + +//// [callSignatureWithoutAnnotationsOrBody.js] +function foo(x) { +} +var r = foo(1); +var i; +var r2 = i(); +var r3 = i.f(); +var a; +var r4 = a(); +var r5 = a.f(); diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js new file mode 100644 index 0000000000000..4c7e0312b86cb --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -0,0 +1,237 @@ +//// [callSignatureWithoutReturnTypeAnnotationInference.ts] +// Call signatures without a return type should infer one from the function body (if present) + +// Simple types +function foo(x) { + return 1; +} +var r = foo(1); + +function foo2(x) { + return foo(x); +} +var r2 = foo2(1); + +function foo3() { + return foo3(); +} +var r3 = foo3(); + +function foo4(x: T) { + return x; +} +var r4 = foo4(1); + +function foo5(x) { + if (true) { + return 1; + } else { + return 2; + } +} +var r5 = foo5(1); + +function foo6(x) { + try { + } + catch (e) { + return []; + } + finally { + return []; + } +} +var r6 = foo6(1); + +function foo7(x) { + return typeof x; +} +var r7 = foo7(1); + +// object types +function foo8(x: number) { + return { x: x }; +} +var r8 = foo8(1); + +interface I { + foo: string; +} +function foo9(x: number) { + var i: I; + return i; +} +var r9 = foo9(1); + +class C { + foo: string; +} +function foo10(x: number) { + var c: C; + return c; +} +var r10 = foo10(1); + +module M { + export var x = 1; + export class C { foo: string } +} +function foo11() { + return M; +} +var r11 = foo11(); + +// merged declarations +interface I2 { + x: number; +} +interface I2 { + y: number; +} +function foo12() { + var i2: I2; + return i2; +} +var r12 = foo12(); + +function m1() { return 1; } +module m1 { export var y = 2; } +function foo13() { + return m1; +} +var r13 = foo13(); + +class c1 { + foo: string; + constructor(x) { } +} +module c1 { + export var x = 1; +} +function foo14() { + return c1; +} +var r14 = foo14(); + +enum e1 { A } +module e1 { export var y = 1; } +function foo15() { + return e1; +} +var r15 = foo15(); + +//// [callSignatureWithoutReturnTypeAnnotationInference.js] +function foo(x) { + return 1; +} +var r = foo(1); +function foo2(x) { + return foo(x); +} +var r2 = foo2(1); +function foo3() { + return foo3(); +} +var r3 = foo3(); +function foo4(x) { + return x; +} +var r4 = foo4(1); +function foo5(x) { + if (true) { + return 1; + } + else { + return 2; + } +} +var r5 = foo5(1); +function foo6(x) { + try { + } + catch (e) { + return []; + } + finally { + return []; + } +} +var r6 = foo6(1); +function foo7(x) { + return typeof x; +} +var r7 = foo7(1); +function foo8(x) { + return { x: x }; +} +var r8 = foo8(1); +function foo9(x) { + var i; + return i; +} +var r9 = foo9(1); +var C = (function () { + function C() { + } + return C; +})(); +function foo10(x) { + var c; + return c; +} +var r10 = foo10(1); +var M; +(function (M) { + M.x = 1; + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; +})(M || (M = {})); +function foo11() { + return M; +} +var r11 = foo11(); +function foo12() { + var i2; + return i2; +} +var r12 = foo12(); +function m1() { + return 1; +} +var m1; +(function (m1) { + m1.y = 2; +})(m1 || (m1 = {})); +function foo13() { + return m1; +} +var r13 = foo13(); +var c1 = (function () { + function c1(x) { + } + return c1; +})(); +var c1; +(function (c1) { + c1.x = 1; +})(c1 || (c1 = {})); +function foo14() { + return c1; +} +var r14 = foo14(); +var e1; +(function (e1) { + e1[e1["A"] = 0] = "A"; +})(e1 || (e1 = {})); +var e1; +(function (e1) { + e1.y = 1; +})(e1 || (e1 = {})); +function foo15() { + return e1; +} +var r15 = foo15(); diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt new file mode 100644 index 0000000000000..1f23e15f18188 --- /dev/null +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts (1 errors) ==== + interface I1 { + (value: T): void; + field1: I1; + } + + function foo() { + var test: I1; + test("expects boolean instead of string"); // should not error - "test" should not expect a boolean + test(true); // should error - string expected + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js new file mode 100644 index 0000000000000..62ffe63ecf073 --- /dev/null +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js @@ -0,0 +1,18 @@ +//// [callSignaturesShouldBeResolvedBeforeSpecialization.ts] +interface I1 { + (value: T): void; + field1: I1; +} + +function foo() { + var test: I1; + test("expects boolean instead of string"); // should not error - "test" should not expect a boolean + test(true); // should error - string expected +} + +//// [callSignaturesShouldBeResolvedBeforeSpecialization.js] +function foo() { + var test; + test("expects boolean instead of string"); + test(true); +} diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js new file mode 100644 index 0000000000000..8d5b59f84d125 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js @@ -0,0 +1,33 @@ +//// [callSignaturesThatDifferOnlyByReturnType.ts] +// Each pair of signatures in these types has a signature that should cause an error. +// Overloads, generic or not, that differ only by return type are an error. +interface I { + (x): number; + (x): void; // error + (x: T): number; + (x: T): string; // error +} + +interface I2 { + (x: T): number; + (x: T): string; // error +} + +interface I3 { + (x: T): number; + (x: T): string; // error +} + +var a: { + (x, y): Object; + (x, y): any; // error +} + +var a2: { + (x: T): number; + (x: T): string; // error +} + +//// [callSignaturesThatDifferOnlyByReturnType.js] +var a; +var a2; diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt new file mode 100644 index 0000000000000..7dd3e28006762 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts (2 errors) ==== + // Normally it is an error to have multiple overloads which differ only by return type in a single type declaration. + // Here the multiple overloads come from multiple bases. + + interface I { + foo(x: number): T; + } + + interface A extends I, I { } + ~ +!!! Interface 'A' cannot simultaneously extend types 'I' and 'I': +!!! Named properties 'foo' of types 'I' and 'I' are not identical. + + var x: A; + // BUG 822524 + var r = x.foo(1); // no error + var r2 = x.foo(''); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js new file mode 100644 index 0000000000000..e3ee6e2ed0116 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js @@ -0,0 +1,20 @@ +//// [callSignaturesThatDifferOnlyByReturnType2.ts] +// Normally it is an error to have multiple overloads which differ only by return type in a single type declaration. +// Here the multiple overloads come from multiple bases. + +interface I { + foo(x: number): T; +} + +interface A extends I, I { } + +var x: A; +// BUG 822524 +var r = x.foo(1); // no error +var r2 = x.foo(''); // error + + +//// [callSignaturesThatDifferOnlyByReturnType2.js] +var x; +var r = x.foo(1); +var r2 = x.foo(''); diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js new file mode 100644 index 0000000000000..83af745779593 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js @@ -0,0 +1,21 @@ +//// [callSignaturesThatDifferOnlyByReturnType3.ts] +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations. + +interface I { + (x: string): string; +} + +interface I { + (x: string): number; +} + +interface I2 { + (x: string): string; +} + +interface I2 { + (x: string): number; +} + +//// [callSignaturesThatDifferOnlyByReturnType3.js] diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt new file mode 100644 index 0000000000000..f7d58ea096e8a --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.errors.txt @@ -0,0 +1,119 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithAccessibilityModifiersOnParameters.ts (40 errors) ==== + // Call signature parameters do not allow accessibility modifiers + + function foo(public x, private y) { } + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f = function foo(public x, private y) { } + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f2 = function (public x, private y) { } + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f3 = (x, private y) => { } + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f4 = (public x: T, y: T) => { } + ~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + + function foo2(private x: string, public y: number) { } + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f5 = function foo(private x: string, public y: number) { } + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f6 = function (private x: string, public y: number) { } + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f7 = (private x: string, public y: number) => { } + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + var f8 = (private x: T, public y: T) => { } + ~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + + class C { + foo(public x, private y) { } + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo2(public x: number, private y: string) { } + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo3(public x: T, private y: T) { } + ~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + interface I { + (private x, public y); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + (private x: string, public y: number); + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo(private x, public y); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo(public x: number, y: string); + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo3(x: T, private y: T); + ~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + var a: { + foo(public x, private y); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + foo2(private x: number, public y: string); + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + }; + + var b = { + foo(public x, y) { }, + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + a: function foo(x: number, private y: string) { }, + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + b: (public x: T, private y: T) => { } + ~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js new file mode 100644 index 0000000000000..1915a7df3f324 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js @@ -0,0 +1,81 @@ +//// [callSignaturesWithAccessibilityModifiersOnParameters.ts] +// Call signature parameters do not allow accessibility modifiers + +function foo(public x, private y) { } +var f = function foo(public x, private y) { } +var f2 = function (public x, private y) { } +var f3 = (x, private y) => { } +var f4 = (public x: T, y: T) => { } + +function foo2(private x: string, public y: number) { } +var f5 = function foo(private x: string, public y: number) { } +var f6 = function (private x: string, public y: number) { } +var f7 = (private x: string, public y: number) => { } +var f8 = (private x: T, public y: T) => { } + +class C { + foo(public x, private y) { } + foo2(public x: number, private y: string) { } + foo3(public x: T, private y: T) { } +} + +interface I { + (private x, public y); + (private x: string, public y: number); + foo(private x, public y); + foo(public x: number, y: string); + foo3(x: T, private y: T); +} + +var a: { + foo(public x, private y); + foo2(private x: number, public y: string); +}; + +var b = { + foo(public x, y) { }, + a: function foo(x: number, private y: string) { }, + b: (public x: T, private y: T) => { } +} + +//// [callSignaturesWithAccessibilityModifiersOnParameters.js] +function foo(x, y) { +} +var f = function foo(x, y) { +}; +var f2 = function (x, y) { +}; +var f3 = function (x, y) { +}; +var f4 = function (x, y) { +}; +function foo2(x, y) { +} +var f5 = function foo(x, y) { +}; +var f6 = function (x, y) { +}; +var f7 = function (x, y) { +}; +var f8 = function (x, y) { +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + C.prototype.foo2 = function (x, y) { + }; + C.prototype.foo3 = function (x, y) { + }; + return C; +})(); +var a; +var b = { + foo: function foo(x, y) { + }, + a: function foo(x, y) { + }, + b: function (x, y) { + } +}; diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt b/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt new file mode 100644 index 0000000000000..facb92dd46139 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts (22 errors) ==== + // Duplicate parameter names are always an error + + function foo(x, x) { } + ~ +!!! Duplicate identifier 'x'. + var f = function foo(x, x) { } + ~ +!!! Duplicate identifier 'x'. + var f2 = function (x, x) { } + ~ +!!! Duplicate identifier 'x'. + var f3 = (x, x) => { } + ~ +!!! Duplicate identifier 'x'. + var f4 = (x: T, x: T) => { } + ~ +!!! Duplicate identifier 'x'. + + function foo2(x: string, x: number) { } + ~ +!!! Duplicate identifier 'x'. + var f5 = function foo(x: string, x: number) { } + ~ +!!! Duplicate identifier 'x'. + var f6 = function (x: string, x: number) { } + ~ +!!! Duplicate identifier 'x'. + var f7 = (x: string, x: number) => { } + ~ +!!! Duplicate identifier 'x'. + var f8 = (x: T, y: T) => { } + + class C { + foo(x, x) { } + ~ +!!! Duplicate identifier 'x'. + foo2(x: number, x: string) { } + ~ +!!! Duplicate identifier 'x'. + foo3(x: T, x: T) { } + ~ +!!! Duplicate identifier 'x'. + } + + interface I { + (x, x); + ~ +!!! Duplicate identifier 'x'. + (x: string, x: number); + ~ +!!! Duplicate identifier 'x'. + foo(x, x); + ~ +!!! Duplicate identifier 'x'. + foo(x: number, x: string); + ~ +!!! Duplicate identifier 'x'. + foo3(x: T, x: T); + ~ +!!! Duplicate identifier 'x'. + } + + var a: { + foo(x, x); + ~ +!!! Duplicate identifier 'x'. + foo2(x: number, x: string); + ~ +!!! Duplicate identifier 'x'. + }; + + var b = { + foo(x, x) { }, + ~ +!!! Duplicate identifier 'x'. + a: function foo(x: number, x: string) { }, + ~ +!!! Duplicate identifier 'x'. + b: (x: T, x: T) => { } + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js new file mode 100644 index 0000000000000..0fe2ea5dac750 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js @@ -0,0 +1,81 @@ +//// [callSignaturesWithDuplicateParameters.ts] +// Duplicate parameter names are always an error + +function foo(x, x) { } +var f = function foo(x, x) { } +var f2 = function (x, x) { } +var f3 = (x, x) => { } +var f4 = (x: T, x: T) => { } + +function foo2(x: string, x: number) { } +var f5 = function foo(x: string, x: number) { } +var f6 = function (x: string, x: number) { } +var f7 = (x: string, x: number) => { } +var f8 = (x: T, y: T) => { } + +class C { + foo(x, x) { } + foo2(x: number, x: string) { } + foo3(x: T, x: T) { } +} + +interface I { + (x, x); + (x: string, x: number); + foo(x, x); + foo(x: number, x: string); + foo3(x: T, x: T); +} + +var a: { + foo(x, x); + foo2(x: number, x: string); +}; + +var b = { + foo(x, x) { }, + a: function foo(x: number, x: string) { }, + b: (x: T, x: T) => { } +} + +//// [callSignaturesWithDuplicateParameters.js] +function foo(x, x) { +} +var f = function foo(x, x) { +}; +var f2 = function (x, x) { +}; +var f3 = function (x, x) { +}; +var f4 = function (x, x) { +}; +function foo2(x, x) { +} +var f5 = function foo(x, x) { +}; +var f6 = function (x, x) { +}; +var f7 = function (x, x) { +}; +var f8 = function (x, y) { +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x, x) { + }; + C.prototype.foo2 = function (x, x) { + }; + C.prototype.foo3 = function (x, x) { + }; + return C; +})(); +var a; +var b = { + foo: function foo(x, x) { + }, + a: function foo(x, x) { + }, + b: function (x, x) { + } +}; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.js b/tests/baselines/reference/callSignaturesWithOptionalParameters.js new file mode 100644 index 0000000000000..4627a9abfe29f --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.js @@ -0,0 +1,104 @@ +//// [callSignaturesWithOptionalParameters.ts] +// Optional parameters should be valid in all the below casts + +function foo(x?: number) { } +var f = function foo(x?: number) { } +var f2 = (x: number, y?: number) => { } + +foo(1); +foo(); +f(1); +f(); +f2(1); +f2(1, 2); + +class C { + foo(x?: number) { } +} + +var c: C; +c.foo(); +c.foo(1); + +interface I { + (x?: number); + foo(x: number, y?: number); +} + +var i: I; +i(); +i(1); +i.foo(1); +i.foo(1, 2); + +var a: { + (x?: number); + foo(x?: number); +} + +a(); +a(1); +a.foo(); +a.foo(1); + +var b = { + foo(x?: number) { }, + a: function foo(x: number, y?: number) { }, + b: (x?: number) => { } +} + +b.foo(); +b.foo(1); +b.a(1); +b.a(1, 2); +b.b(); +b.b(1); + + +//// [callSignaturesWithOptionalParameters.js] +function foo(x) { +} +var f = function foo(x) { +}; +var f2 = function (x, y) { +}; +foo(1); +foo(); +f(1); +f(); +f2(1); +f2(1, 2); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var c; +c.foo(); +c.foo(1); +var i; +i(); +i(1); +i.foo(1); +i.foo(1, 2); +var a; +a(); +a(1); +a.foo(); +a.foo(1); +var b = { + foo: function foo(x) { + }, + a: function foo(x, y) { + }, + b: function (x) { + } +}; +b.foo(); +b.foo(1); +b.a(1); +b.a(1, 2); +b.b(); +b.b(1); diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js new file mode 100644 index 0000000000000..9b46124c1ac15 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js @@ -0,0 +1,98 @@ +//// [callSignaturesWithOptionalParameters2.ts] +// Optional parameters should be valid in all the below casts + +function foo(x?: number); +function foo(x?: number) { } + +foo(1); +foo(); + +function foo2(x: number); +function foo2(x: number, y?: number); +function foo2(x: number, y?: number) { } + +foo2(1); +foo2(1, 2); + +class C { + foo(x?: number); + foo(x?: number) { } + + foo2(x: number); + foo2(x: number, y?: number); + foo2(x: number, y?: number) { } +} + +var c: C; +c.foo(); +c.foo(1); + +c.foo2(1); +c.foo2(1, 2); + +interface I { + (x?: number); + (x?: number, y?: number); + foo(x: number, y?: number); + foo(x: number, y?: number, z?: number); +} + +var i: I; +i(); +i(1); +i(1, 2); +i.foo(1); +i.foo(1, 2); +i.foo(1, 2, 3); + +var a: { + (x?: number); + (x?: number, y?: number); + foo(x: number, y?: number); + foo(x: number, y?: number, z?: number); +} + +a(); +a(1); +a(1, 2); +a.foo(1); +a.foo(1, 2); +a.foo(1, 2, 3); + +//// [callSignaturesWithOptionalParameters2.js] +function foo(x) { +} +foo(1); +foo(); +function foo2(x, y) { +} +foo2(1); +foo2(1, 2); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + C.prototype.foo2 = function (x, y) { + }; + return C; +})(); +var c; +c.foo(); +c.foo(1); +c.foo2(1); +c.foo2(1, 2); +var i; +i(); +i(1); +i(1, 2); +i.foo(1); +i.foo(1, 2); +i.foo(1, 2, 3); +var a; +a(); +a(1); +a(1, 2); +a.foo(1); +a.foo(1, 2); +a.foo(1, 2, 3); diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt b/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt new file mode 100644 index 0000000000000..033fa6d51c01d --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.errors.txt @@ -0,0 +1,66 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts (4 errors) ==== + // Optional parameters allow initializers only in implementation signatures + + function foo(x = 1) { } + var f = function foo(x = 1) { } + var f2 = (x: number, y = 1) => { } + + foo(1); + foo(); + f(1); + f(); + f2(1); + f2(1, 2); + + class C { + foo(x = 1) { } + } + + var c: C; + c.foo(); + c.foo(1); + + // these are errors + interface I { + (x = 1); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + foo(x: number, y = 1); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + var i: I; + i(); + i(1); + i.foo(1); + i.foo(1, 2); + + // these are errors + var a: { + (x = 1); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + foo(x = 1); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + a(); + a(1); + a.foo(); + a.foo(1); + + var b = { + foo(x = 1) { }, + a: function foo(x: number, y = 1) { }, + b: (x = 1) => { } + } + + b.foo(); + b.foo(1); + b.a(1); + b.a(1, 2); + b.b(); + b.b(1); + \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.js b/tests/baselines/reference/callSignaturesWithParameterInitializers.js new file mode 100644 index 0000000000000..e41cc96ed4882 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.js @@ -0,0 +1,113 @@ +//// [callSignaturesWithParameterInitializers.ts] +// Optional parameters allow initializers only in implementation signatures + +function foo(x = 1) { } +var f = function foo(x = 1) { } +var f2 = (x: number, y = 1) => { } + +foo(1); +foo(); +f(1); +f(); +f2(1); +f2(1, 2); + +class C { + foo(x = 1) { } +} + +var c: C; +c.foo(); +c.foo(1); + +// these are errors +interface I { + (x = 1); + foo(x: number, y = 1); +} + +var i: I; +i(); +i(1); +i.foo(1); +i.foo(1, 2); + +// these are errors +var a: { + (x = 1); + foo(x = 1); +} + +a(); +a(1); +a.foo(); +a.foo(1); + +var b = { + foo(x = 1) { }, + a: function foo(x: number, y = 1) { }, + b: (x = 1) => { } +} + +b.foo(); +b.foo(1); +b.a(1); +b.a(1, 2); +b.b(); +b.b(1); + + +//// [callSignaturesWithParameterInitializers.js] +function foo(x) { + if (x === void 0) { x = 1; } +} +var f = function foo(x) { + if (x === void 0) { x = 1; } +}; +var f2 = function (x, y) { + if (y === void 0) { y = 1; } +}; +foo(1); +foo(); +f(1); +f(); +f2(1); +f2(1, 2); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + if (x === void 0) { x = 1; } + }; + return C; +})(); +var c; +c.foo(); +c.foo(1); +var i; +i(); +i(1); +i.foo(1); +i.foo(1, 2); +var a; +a(); +a(1); +a.foo(); +a.foo(1); +var b = { + foo: function foo(x) { + if (x === void 0) { x = 1; } + }, + a: function foo(x, y) { + if (y === void 0) { y = 1; } + }, + b: function (x) { + if (x === void 0) { x = 1; } + } +}; +b.foo(); +b.foo(1); +b.a(1); +b.a(1, 2); +b.b(); +b.b(1); diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt new file mode 100644 index 0000000000000..ad4a81aa7f1ef --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (4 errors) ==== + // Optional parameters allow initializers only in implementation signatures + // All the below declarations are errors + + function foo(x = 2); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + function foo(x = 1) { } + + foo(1); + foo(); + + class C { + foo(x = 2); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + foo(x = 1) { } + } + + var c: C; + c.foo(); + c.foo(1); + + var b = { + foo(x = 1), + ~ +!!! '{' expected. + foo(x = 1) { }, + ~~~ +!!! Duplicate identifier 'foo'. + } + + b.foo(); + b.foo(1); \ No newline at end of file diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt new file mode 100644 index 0000000000000..027efabf4a4a4 --- /dev/null +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts (2 errors) ==== + function f() { } + + f(); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f(); + f(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js new file mode 100644 index 0000000000000..f7bc46a77240e --- /dev/null +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js @@ -0,0 +1,13 @@ +//// [callWithWrongNumberOfTypeArguments.ts] +function f() { } + +f(); +f(); +f(); + +//// [callWithWrongNumberOfTypeArguments.js] +function f() { +} +f(); +f(); +f(); diff --git a/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt b/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt new file mode 100644 index 0000000000000..aaa831dc2ac26 --- /dev/null +++ b/tests/baselines/reference/callbackArgsDifferByOptionality.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/callbackArgsDifferByOptionality.ts (2 errors) ==== + function x3(callback: (x?: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function x3(callback: (x: string) => number); + function x3(callback: (x: any) => number) { + cb(); + ~~ +!!! Cannot find name 'cb'. + } \ No newline at end of file diff --git a/tests/baselines/reference/callbackArgsDifferByOptionality.js b/tests/baselines/reference/callbackArgsDifferByOptionality.js new file mode 100644 index 0000000000000..da827c0ea2e88 --- /dev/null +++ b/tests/baselines/reference/callbackArgsDifferByOptionality.js @@ -0,0 +1,11 @@ +//// [callbackArgsDifferByOptionality.ts] +function x3(callback: (x?: 'hi') => number); +function x3(callback: (x: string) => number); +function x3(callback: (x: any) => number) { + cb(); +} + +//// [callbackArgsDifferByOptionality.js] +function x3(callback) { + cb(); +} diff --git a/tests/baselines/reference/callbacksDontShareTypes.js b/tests/baselines/reference/callbacksDontShareTypes.js new file mode 100644 index 0000000000000..f1e9865eee952 --- /dev/null +++ b/tests/baselines/reference/callbacksDontShareTypes.js @@ -0,0 +1,34 @@ +//// [callbacksDontShareTypes.ts] +interface Collection { + length: number; + add(x: T): void; + remove(x: T): boolean; +} +interface Combinators { + map(c: Collection, f: (x: T) => U): Collection; + map(c: Collection, f: (x: T) => any): Collection; +} + +var _: Combinators; +var c2: Collection; + +var rf1 = (x: number) => { return x.toFixed() }; +var r1a = _.map(c2, (x) => { return x.toFixed() }); +var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors +var r5a = _.map(c2, (x) => { return x.toFixed() }); +var r5b = _.map(c2, rf1); + +//// [callbacksDontShareTypes.js] +var _; +var c2; +var rf1 = function (x) { + return x.toFixed(); +}; +var r1a = _.map(c2, function (x) { + return x.toFixed(); +}); +var r1b = _.map(c2, rf1); +var r5a = _.map(c2, function (x) { + return x.toFixed(); +}); +var r5b = _.map(c2, rf1); diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt new file mode 100644 index 0000000000000..504e08eadf00c --- /dev/null +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts (2 errors) ==== + module M + { + class ClassA {} + } + var t = new M.ClassA[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~ +!!! Property 'ClassA' does not exist on type 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt new file mode 100644 index 0000000000000..015bd2d43c3ed --- /dev/null +++ b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/cannotInvokeNewOnIndexExpression.ts (1 errors) ==== + var test: any[] = new any[1]; + ~~~ +!!! Cannot find name 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js new file mode 100644 index 0000000000000..86442dbf443f2 --- /dev/null +++ b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js @@ -0,0 +1,5 @@ +//// [cannotInvokeNewOnIndexExpression.ts] +var test: any[] = new any[1]; + +//// [cannotInvokeNewOnIndexExpression.js] +var test = new any[1]; diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js new file mode 100644 index 0000000000000..4728cb88e7f7b --- /dev/null +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -0,0 +1,68 @@ +//// [castExpressionParentheses.ts] +declare var a; + +// parentheses should be omitted +// literals +({a:0}); +([1,3,]); +("string"); +(23.0); +(/regexp/g); +(false); +(true); +(null); +// names and dotted names +(this); +(this.x); +((a).x); +(a); +(a[0]); +(a.b["0"]); +(a()).x; + +declare var A; + +// should keep the parentheses in emit +(new A).foo; +(typeof A).x; +(-A).x; +new (A()); +(()=> {})(); +(function foo() { })(); +(-A).x; + +// nested cast, should keep one pair of parenthese +((-A)).x; + +// nested parenthesized expression, should keep one pair of parenthese +((A)) + + + +//// [castExpressionParentheses.js] +{ a: 0 }; +[1, 3]; +"string"; +23.0; +/regexp/g; +false; +true; +null; +this; +this.x; +a.x; +a; +a[0]; +a.b["0"]; +a().x; +(new A).foo; +(typeof A).x; +(-A).x; +new (A()); +(function () { +})(); +(function foo() { +})(); +(-A).x; +(-A).x; +(A); diff --git a/tests/baselines/reference/castNewObjectBug.js b/tests/baselines/reference/castNewObjectBug.js new file mode 100644 index 0000000000000..ccf7c117e1a2d --- /dev/null +++ b/tests/baselines/reference/castNewObjectBug.js @@ -0,0 +1,6 @@ +//// [castNewObjectBug.ts] +interface Foo { } +var xx = new Object(); + +//// [castNewObjectBug.js] +var xx = new Object(); diff --git a/tests/baselines/reference/castParentheses.js b/tests/baselines/reference/castParentheses.js new file mode 100644 index 0000000000000..8ee31be63f9c5 --- /dev/null +++ b/tests/baselines/reference/castParentheses.js @@ -0,0 +1,26 @@ +//// [castParentheses.ts] +class a { + static b: any; +} + +var b = (a); +var b = (a).b; +var b = (a.b).c; +var b = (a.b()).c; +var b = (new a); +var b = (new a.b); +var b = (new a).b + +//// [castParentheses.js] +var a = (function () { + function a() { + } + return a; +})(); +var b = a; +var b = a.b; +var b = a.b.c; +var b = a.b().c; +var b = (new a); +var b = (new a.b); +var b = (new a).b; diff --git a/tests/baselines/reference/castTest.js b/tests/baselines/reference/castTest.js new file mode 100644 index 0000000000000..5afa67026b9f5 --- /dev/null +++ b/tests/baselines/reference/castTest.js @@ -0,0 +1,53 @@ +//// [castTest.ts] + +var x : any = 0; +var z = x; +var y = x + z; + +var a = 0; +var b = true; +var s = ""; + +var ar = null; + +var f = <(res : number) => void>null; + +declare class Point +{ + x: number; + y: number; + add(dx: number, dy: number): Point; + mult(p: Point): Point; + constructor(x: number, y: number); +} + +var p_cast = ({ + x: 0, + y: 0, + add: function(dx, dy) { + return new Point(this.x + dx, this.y + dy); + }, + mult: function(p) { return p; } +}) + + + +//// [castTest.js] +var x = 0; +var z = x; +var y = x + z; +var a = 0; +var b = true; +var s = ""; +var ar = null; +var f = null; +var p_cast = ({ + x: 0, + y: 0, + add: function (dx, dy) { + return new Point(this.x + dx, this.y + dy); + }, + mult: function (p) { + return p; + } +}); diff --git a/tests/baselines/reference/catch.js b/tests/baselines/reference/catch.js new file mode 100644 index 0000000000000..c6b13cf4d6896 --- /dev/null +++ b/tests/baselines/reference/catch.js @@ -0,0 +1,18 @@ +//// [catch.ts] +function f() { + try {} catch(e) { } + try {} catch(e) { } +} + + +//// [catch.js] +function f() { + try { + } + catch (e) { + } + try { + } + catch (e) { + } +} diff --git a/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..3052a7fb28a4d --- /dev/null +++ b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/catchClauseWithTypeAnnotation.ts (1 errors) ==== + try { + } catch (e: any) { + ~ +!!! Catch clause parameter cannot have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/cf.js b/tests/baselines/reference/cf.js new file mode 100644 index 0000000000000..bc7e43a371ae2 --- /dev/null +++ b/tests/baselines/reference/cf.js @@ -0,0 +1,115 @@ +//// [cf.ts] +function f() { + var z; + var x=10; + var y=3; + + L1: for (var i=0;i<19;i++) { + if (y==7) { + continue L1; + x=11; + } + if (y==3) { + y++; + } + else { + y--; + } + do { + y+=2; + if (y==20) { + break; + x=12; + } + } while (y<41); + y++; + } + while (y>2) { + y=y>>1; + } + L2: try { + L3: if (x 2) { + y = y >> 1; + } + L2: try { + L3: if (x < y) { + break L2; + x = 13; + } + else { + break L3; + x = 14; + } + } + catch (e) { + x++; + } + finally { + x += 3; + } + y++; + for (var k = 0; k < 10; k++) { + z; + break; + } + for (k = 0; k < 10; k++) { + if (k == 6) { + continue; + } + break; + } +} diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt new file mode 100644 index 0000000000000..9bab75fe15c6e --- /dev/null +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/chainedAssignment1.ts (3 errors) ==== + class X { + constructor(public z) { } + a: number; + } + + class Y { + constructor(public z) { + } + a: number; + b: string; + } + + class Z { + z: any; + c: string; + } + + var c1 = new X(3); + var c2 = new Y(5); + var c3 = new Z(); + c1 = c2 = c3; // a bug made this not report the same error as below + ~~ +!!! Type 'Z' is not assignable to type 'X': +!!! Property 'a' is missing in type 'Z'. + ~~ +!!! Type 'Z' is not assignable to type 'Y': +!!! Property 'a' is missing in type 'Z'. + c2 = c3; // Error TS111: Cannot convert Z to Y + ~~ +!!! Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment1.js b/tests/baselines/reference/chainedAssignment1.js new file mode 100644 index 0000000000000..1f1c5cb762159 --- /dev/null +++ b/tests/baselines/reference/chainedAssignment1.js @@ -0,0 +1,47 @@ +//// [chainedAssignment1.ts] +class X { + constructor(public z) { } + a: number; +} + +class Y { + constructor(public z) { + } + a: number; + b: string; +} + +class Z { + z: any; + c: string; +} + +var c1 = new X(3); +var c2 = new Y(5); +var c3 = new Z(); +c1 = c2 = c3; // a bug made this not report the same error as below +c2 = c3; // Error TS111: Cannot convert Z to Y + +//// [chainedAssignment1.js] +var X = (function () { + function X(z) { + this.z = z; + } + return X; +})(); +var Y = (function () { + function Y(z) { + this.z = z; + } + return Y; +})(); +var Z = (function () { + function Z() { + } + return Z; +})(); +var c1 = new X(3); +var c2 = new Y(5); +var c3 = new Z(); +c1 = c2 = c3; +c2 = c3; diff --git a/tests/baselines/reference/chainedAssignment2.js b/tests/baselines/reference/chainedAssignment2.js new file mode 100644 index 0000000000000..482d97da80947 --- /dev/null +++ b/tests/baselines/reference/chainedAssignment2.js @@ -0,0 +1,18 @@ +//// [chainedAssignment2.ts] +var a: string; +var b: number; +var c: boolean; +var d: Date; +var e: RegExp; + +a = b = c = d = e = null; + + + +//// [chainedAssignment2.js] +var a; +var b; +var c; +var d; +var e; +a = b = c = d = e = null; diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt new file mode 100644 index 0000000000000..61d34172032ba --- /dev/null +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/chainedAssignment3.ts (2 errors) ==== + class A { + id: number; + } + + class B extends A { + value: string; + } + + var a: A; + var b: B; + a = b = null; + a = b = new B(); + b = a = new B(); + + a.id = b.value = null; + + // error cases + b = a = new A(); + ~ +!!! Type 'A' is not assignable to type 'B': +!!! Property 'value' is missing in type 'A'. + a = b = new A(); + ~ +!!! Type 'A' is not assignable to type 'B'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js new file mode 100644 index 0000000000000..f2c1554be8a6f --- /dev/null +++ b/tests/baselines/reference/chainedAssignment3.js @@ -0,0 +1,51 @@ +//// [chainedAssignment3.ts] +class A { + id: number; +} + +class B extends A { + value: string; +} + +var a: A; +var b: B; +a = b = null; +a = b = new B(); +b = a = new B(); + +a.id = b.value = null; + +// error cases +b = a = new A(); +a = b = new A(); + + + + +//// [chainedAssignment3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var a; +var b; +a = b = null; +a = b = new B(); +b = a = new B(); +a.id = b.value = null; +b = a = new A(); +a = b = new A(); diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt new file mode 100644 index 0000000000000..f5580d38c037b --- /dev/null +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/chainedAssignmentChecking.ts (2 errors) ==== + class X { + constructor(public z) { } + a: number; + } + + class Y { + constructor(public z) { } + a: number; + b: string; + } + + class Z { + z: any; + c: string; + } + + var c1 = new X(3); + var c2 = new Y(5); + var c3 = new Z(); + + c1 = c2 = c3; // Should be error + ~~ +!!! Type 'Z' is not assignable to type 'X': +!!! Property 'a' is missing in type 'Z'. + ~~ +!!! Type 'Z' is not assignable to type 'Y': +!!! Property 'a' is missing in type 'Z'. + \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignmentChecking.js b/tests/baselines/reference/chainedAssignmentChecking.js new file mode 100644 index 0000000000000..403b48685695e --- /dev/null +++ b/tests/baselines/reference/chainedAssignmentChecking.js @@ -0,0 +1,46 @@ +//// [chainedAssignmentChecking.ts] +class X { + constructor(public z) { } + a: number; +} + +class Y { + constructor(public z) { } + a: number; + b: string; +} + +class Z { + z: any; + c: string; +} + +var c1 = new X(3); +var c2 = new Y(5); +var c3 = new Z(); + +c1 = c2 = c3; // Should be error + + +//// [chainedAssignmentChecking.js] +var X = (function () { + function X(z) { + this.z = z; + } + return X; +})(); +var Y = (function () { + function Y(z) { + this.z = z; + } + return Y; +})(); +var Z = (function () { + function Z() { + } + return Z; +})(); +var c1 = new X(3); +var c2 = new Y(5); +var c3 = new Z(); +c1 = c2 = c3; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt new file mode 100644 index 0000000000000..01eff3e2a6054 --- /dev/null +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== + class Chain { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain { + return null; + } + } + + class A { + x; + } + class B extends A { + y; + } + class C extends B { + z; + } + + // Ok to go down the chain, but error to try to climb back up + (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js new file mode 100644 index 0000000000000..92243b90d140e --- /dev/null +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -0,0 +1,57 @@ +//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts] +class Chain { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain { + return null; + } +} + +class A { + x; +} +class B extends A { + y; +} +class C extends B { + z; +} + +// Ok to go down the chain, but error to try to climb back up +(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); + +//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Chain = (function () { + function Chain(value) { + this.value = value; + } + Chain.prototype.then = function (cb) { + return null; + }; + return Chain; +})(); +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(B); +(new Chain(new A)).then(function (a) { return new B; }).then(function (b) { return new C; }).then(function (c) { return new B; }).then(function (b) { return new A; }); diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt new file mode 100644 index 0000000000000..71361a10847a4 --- /dev/null +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts (5 errors) ==== + class Chain { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain { + var t: T; + var s: S; + // Ok to go down the chain, but error to climb up the chain + (new Chain(t)).then(tt => s).then(ss => t); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // But error to try to climb up the chain + (new Chain(s)).then(ss => t); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Staying at T or S should be fine + (new Chain(t)).then(tt => t).then(tt => t).then(tt => t); + (new Chain(s)).then(ss => s).then(ss => s).then(ss => s); + + return null; + } + } + + // Similar to above, but T is now constrained. Verify that the constraint is maintained across invocations + interface I { + x: number; + } + class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var i: I; + var t: T; + var s: S; + // Ok to go down the chain, check the constraint at the end. + // Should get an error that we are assigning a string to a number + (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + // Staying at T or S should keep the constraint. + // Get an error when we assign a string to a number in both cases + (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js new file mode 100644 index 0000000000000..608e6f72c37ff --- /dev/null +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js @@ -0,0 +1,74 @@ +//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts] +class Chain { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain { + var t: T; + var s: S; + // Ok to go down the chain, but error to climb up the chain + (new Chain(t)).then(tt => s).then(ss => t); + + // But error to try to climb up the chain + (new Chain(s)).then(ss => t); + + // Staying at T or S should be fine + (new Chain(t)).then(tt => t).then(tt => t).then(tt => t); + (new Chain(s)).then(ss => s).then(ss => s).then(ss => s); + + return null; + } +} + +// Similar to above, but T is now constrained. Verify that the constraint is maintained across invocations +interface I { + x: number; +} +class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var i: I; + var t: T; + var s: S; + // Ok to go down the chain, check the constraint at the end. + // Should get an error that we are assigning a string to a number + (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; + + // Staying at T or S should keep the constraint. + // Get an error when we assign a string to a number in both cases + (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; + (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; + + return null; + } +} + +//// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js] +var Chain = (function () { + function Chain(value) { + this.value = value; + } + Chain.prototype.then = function (cb) { + var t; + var s; + (new Chain(t)).then(function (tt) { return s; }).then(function (ss) { return t; }); + (new Chain(s)).then(function (ss) { return t; }); + (new Chain(t)).then(function (tt) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }); + (new Chain(s)).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }); + return null; + }; + return Chain; +})(); +var Chain2 = (function () { + function Chain2(value) { + this.value = value; + } + Chain2.prototype.then = function (cb) { + var i; + var t; + var s; + (new Chain2(i)).then(function (ii) { return t; }).then(function (tt) { return s; }).value.x = ""; + (new Chain2(i)).then(function (ii) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }).then(function (tt) { return t; }).value.x = ""; + (new Chain2(i)).then(function (ii) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).then(function (ss) { return s; }).value.x = ""; + return null; + }; + return Chain2; +})(); diff --git a/tests/baselines/reference/chainedImportAlias.js b/tests/baselines/reference/chainedImportAlias.js new file mode 100644 index 0000000000000..cbc1e82b45a7c --- /dev/null +++ b/tests/baselines/reference/chainedImportAlias.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/chainedImportAlias.ts] //// + +//// [chainedImportAlias_file0.ts] +export module m { + export function foo() { } +} + +//// [chainedImportAlias_file1.ts] +import x = require('chainedImportAlias_file1'); +import y = x; +declare var console: { + log(message?: any); +}; +console.log(y); + + +//// [chainedImportAlias_file1.js] +var x = require('chainedImportAlias_file1'); +var y = x; +console.log(y); diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js new file mode 100644 index 0000000000000..c4c2328178dc1 --- /dev/null +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js @@ -0,0 +1,19 @@ +//// [chainedSpecializationToObjectTypeLiteral.ts] +interface Sequence { + each(iterator: (value: T) => void): void; + map(iterator: (value: T) => U): Sequence; + filter(iterator: (value: T) => boolean): Sequence; + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>; +} + +var s: Sequence; +var s2 = s.groupBy(s => s.length); +var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); + + +//// [chainedSpecializationToObjectTypeLiteral.js] +var s; +var s2 = s.groupBy(function (s) { return s.length; }); +var s3 = s2.each(function (x) { + x.key; +}); diff --git a/tests/baselines/reference/checkForObjectTooStrict.errors.txt b/tests/baselines/reference/checkForObjectTooStrict.errors.txt new file mode 100644 index 0000000000000..cc2cfc4cf7dc5 --- /dev/null +++ b/tests/baselines/reference/checkForObjectTooStrict.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/checkForObjectTooStrict.ts (2 errors) ==== + module Foo { + + export class Object { + + } + + } + + + + class Bar extends Foo.Object { // should work + + constructor () { + + super(); + + } + + } + + + class Baz extends Object { + ~~~~~~ +!!! A class may only extend another class. + + constructor () { // ERROR, as expected + + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js new file mode 100644 index 0000000000000..b134ff2a40ac3 --- /dev/null +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -0,0 +1,63 @@ +//// [checkForObjectTooStrict.ts] +module Foo { + + export class Object { + + } + +} + + + +class Bar extends Foo.Object { // should work + + constructor () { + + super(); + + } + +} + + +class Baz extends Object { + + constructor () { // ERROR, as expected + + super(); + + } + +} + + +//// [checkForObjectTooStrict.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo; +(function (Foo) { + var Object = (function () { + function Object() { + } + return Object; + })(); + Foo.Object = Object; +})(Foo || (Foo = {})); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.call(this); + } + return Bar; +})(Foo.Object); +var Baz = (function (_super) { + __extends(Baz, _super); + function Baz() { + _super.call(this); + } + return Baz; +})(Object); diff --git a/tests/baselines/reference/checkInterfaceBases.js b/tests/baselines/reference/checkInterfaceBases.js new file mode 100644 index 0000000000000..54718986340db --- /dev/null +++ b/tests/baselines/reference/checkInterfaceBases.js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/checkInterfaceBases.ts] //// + +//// [jquery.d.ts] +interface JQueryEventObjectTest { + data: any; + which: number; + metaKey: any; +} + +//// [app.ts] +/// +interface SecondEvent { + data: any; +} +interface Third extends JQueryEventObjectTest, SecondEvent {} + + +//// [app.js] diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js new file mode 100644 index 0000000000000..27c6af65aed67 --- /dev/null +++ b/tests/baselines/reference/circularImportAlias.js @@ -0,0 +1,52 @@ +//// [circularImportAlias.ts] +// expected no error + +module B { + export import a = A; + export class D extends a.C { + id: number; + } +} + +module A { + export class C { name: string } + export import b = B; +} + +var c: { name: string }; +var c = new B.a.C(); + + + + +//// [circularImportAlias.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B; +(function (B) { + B.a = A; + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(B.a.C); + B.D = D; +})(B || (B = {})); +var A; +(function (A) { + var C = (function () { + function C() { + } + return C; + })(); + A.C = C; + A.b = B; +})(A || (A = {})); +var c; +var c = new B.a.C(); diff --git a/tests/baselines/reference/circularModuleImports.errors.txt b/tests/baselines/reference/circularModuleImports.errors.txt new file mode 100644 index 0000000000000..8ce4566a68369 --- /dev/null +++ b/tests/baselines/reference/circularModuleImports.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/circularModuleImports.ts (1 errors) ==== + module M + + { + + import A = B; + ~~~~~~~~~~~~~ +!!! Circular definition of import alias 'A'. + + import B = A; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/circularModuleImports.js b/tests/baselines/reference/circularModuleImports.js new file mode 100644 index 0000000000000..1f9aba36c06a3 --- /dev/null +++ b/tests/baselines/reference/circularModuleImports.js @@ -0,0 +1,13 @@ +//// [circularModuleImports.ts] +module M + +{ + + import A = B; + + import B = A; + +} + + +//// [circularModuleImports.js] diff --git a/tests/baselines/reference/circularReference.errors.txt b/tests/baselines/reference/circularReference.errors.txt new file mode 100644 index 0000000000000..2a825b9fc870f --- /dev/null +++ b/tests/baselines/reference/circularReference.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== + import foo1 = require('./foo1'); + export module M1 { + export class C1 { + m1: foo1.M1.C1; + y: number + constructor(){ + this.m1 = new foo1.M1.C1(); + this.m1.y = 10; // Error + ~ +!!! Property 'y' does not exist on type 'C1'. + this.m1.x = 20; // OK + + var tmp = new M1.C1(); + tmp.y = 10; // OK + tmp.x = 20; // Error + ~ +!!! Property 'x' does not exist on type 'C1'. + } + } + } + +==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== + import foo2 = require('./foo2'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export module M1 { + export class C1 { + m1: foo2.M1.C1; + x: number; + constructor(){ + this.m1 = new foo2.M1.C1(); + this.m1.y = 10; // OK + this.m1.x = 20; // Error + ~ +!!! Property 'x' does not exist on type 'C1'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/circularReference.js b/tests/baselines/reference/circularReference.js new file mode 100644 index 0000000000000..b9935b41a84b4 --- /dev/null +++ b/tests/baselines/reference/circularReference.js @@ -0,0 +1,66 @@ +//// [tests/cases/conformance/externalModules/circularReference.ts] //// + +//// [foo1.ts] +import foo2 = require('./foo2'); +export module M1 { + export class C1 { + m1: foo2.M1.C1; + x: number; + constructor(){ + this.m1 = new foo2.M1.C1(); + this.m1.y = 10; // OK + this.m1.x = 20; // Error + } + } +} + +//// [foo2.ts] +import foo1 = require('./foo1'); +export module M1 { + export class C1 { + m1: foo1.M1.C1; + y: number + constructor(){ + this.m1 = new foo1.M1.C1(); + this.m1.y = 10; // Error + this.m1.x = 20; // OK + + var tmp = new M1.C1(); + tmp.y = 10; // OK + tmp.x = 20; // Error + } + } +} + + +//// [foo1.js] +var foo2 = require('./foo2'); +(function (M1) { + var C1 = (function () { + function C1() { + this.m1 = new foo2.M1.C1(); + this.m1.y = 10; + this.m1.x = 20; + } + return C1; + })(); + M1.C1 = C1; +})(exports.M1 || (exports.M1 = {})); +var M1 = exports.M1; +//// [foo2.js] +var foo1 = require('./foo1'); +(function (M1) { + var C1 = (function () { + function C1() { + this.m1 = new foo1.M1.C1(); + this.m1.y = 10; + this.m1.x = 20; + var tmp = new M1.C1(); + tmp.y = 10; + tmp.x = 20; + } + return C1; + })(); + M1.C1 = C1; +})(exports.M1 || (exports.M1 = {})); +var M1 = exports.M1; diff --git a/tests/baselines/reference/class1.errors.txt b/tests/baselines/reference/class1.errors.txt new file mode 100644 index 0000000000000..9acb45f4c2ad2 --- /dev/null +++ b/tests/baselines/reference/class1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/class1.ts (1 errors) ==== + interface foo{ } + class foo{ } + ~~~ +!!! Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/class1.js b/tests/baselines/reference/class1.js new file mode 100644 index 0000000000000..96b279e58c6a1 --- /dev/null +++ b/tests/baselines/reference/class1.js @@ -0,0 +1,10 @@ +//// [class1.ts] +interface foo{ } +class foo{ } + +//// [class1.js] +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/class2.errors.txt b/tests/baselines/reference/class2.errors.txt new file mode 100644 index 0000000000000..5e362d9941a3c --- /dev/null +++ b/tests/baselines/reference/class2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/class2.ts (2 errors) ==== + class foo { constructor() { static f = 3; } } + ~~~~~~ +!!! Statement expected. + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterface1.errors.txt b/tests/baselines/reference/classAndInterface1.errors.txt new file mode 100644 index 0000000000000..6d6bb495c3d24 --- /dev/null +++ b/tests/baselines/reference/classAndInterface1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/classAndInterface1.ts (1 errors) ==== + class cli { } + interface cli { } // error + ~~~ +!!! Duplicate identifier 'cli'. \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterface1.js b/tests/baselines/reference/classAndInterface1.js new file mode 100644 index 0000000000000..74eec3e942edd --- /dev/null +++ b/tests/baselines/reference/classAndInterface1.js @@ -0,0 +1,10 @@ +//// [classAndInterface1.ts] +class cli { } +interface cli { } // error + +//// [classAndInterface1.js] +var cli = (function () { + function cli() { + } + return cli; +})(); diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt new file mode 100644 index 0000000000000..95c1893ff1dee --- /dev/null +++ b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (2 errors) ==== + class C { foo: string; } + interface C { foo: string; } // error + ~ +!!! Duplicate identifier 'C'. + + module M { + class D { + bar: string; + } + + interface D { // error + ~ +!!! Duplicate identifier 'D'. + bar: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.js b/tests/baselines/reference/classAndInterfaceWithSameName.js new file mode 100644 index 0000000000000..09886e34bc8b7 --- /dev/null +++ b/tests/baselines/reference/classAndInterfaceWithSameName.js @@ -0,0 +1,28 @@ +//// [classAndInterfaceWithSameName.ts] +class C { foo: string; } +interface C { foo: string; } // error + +module M { + class D { + bar: string; + } + + interface D { // error + bar: string; + } +} + +//// [classAndInterfaceWithSameName.js] +var C = (function () { + function C() { + } + return C; +})(); +var M; +(function (M) { + var D = (function () { + function D() { + } + return D; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/classAndVariableWithSameName.errors.txt b/tests/baselines/reference/classAndVariableWithSameName.errors.txt new file mode 100644 index 0000000000000..fa9d852a976f2 --- /dev/null +++ b/tests/baselines/reference/classAndVariableWithSameName.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts (2 errors) ==== + class C { foo: string; } + var C = ''; // error + ~ +!!! Duplicate identifier 'C'. + + module M { + class D { + bar: string; + } + + var D = 1; // error + ~ +!!! Duplicate identifier 'D'. + } \ No newline at end of file diff --git a/tests/baselines/reference/classAndVariableWithSameName.js b/tests/baselines/reference/classAndVariableWithSameName.js new file mode 100644 index 0000000000000..818123cf8f9c5 --- /dev/null +++ b/tests/baselines/reference/classAndVariableWithSameName.js @@ -0,0 +1,28 @@ +//// [classAndVariableWithSameName.ts] +class C { foo: string; } +var C = ''; // error + +module M { + class D { + bar: string; + } + + var D = 1; // error +} + +//// [classAndVariableWithSameName.js] +var C = (function () { + function C() { + } + return C; +})(); +var C = ''; +var M; +(function (M) { + var D = (function () { + function D() { + } + return D; + })(); + var D = 1; +})(M || (M = {})); diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.js b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js new file mode 100644 index 0000000000000..e33b2b79fa8d2 --- /dev/null +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js @@ -0,0 +1,21 @@ +//// [classAppearsToHaveMembersOfObject.ts] +class C { foo: string; } + +var c: C; +var r = c.toString(); +var r2 = c.hasOwnProperty(''); +var o: Object = c; +var o2: {} = c; + + +//// [classAppearsToHaveMembersOfObject.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r = c.toString(); +var r2 = c.hasOwnProperty(''); +var o = c; +var o2 = c; diff --git a/tests/baselines/reference/classBodyWithStatements.errors.txt b/tests/baselines/reference/classBodyWithStatements.errors.txt new file mode 100644 index 0000000000000..840402821fa73 --- /dev/null +++ b/tests/baselines/reference/classBodyWithStatements.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/classes/classDeclarations/classBody/classBodyWithStatements.ts (4 errors) ==== + class C { + var x = 1; + ~~~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + } + ~ +!!! Declaration or statement expected. + + class C2 { + function foo() {} + ~~~~~~~~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + } + ~ +!!! Declaration or statement expected. + + var x = 1; + var y = 2; + class C3 { + x: number = y + 1; // ok, need a var in the statement production + } \ No newline at end of file diff --git a/tests/baselines/reference/classCannotExtendVar.errors.txt b/tests/baselines/reference/classCannotExtendVar.errors.txt new file mode 100644 index 0000000000000..94d116248fa27 --- /dev/null +++ b/tests/baselines/reference/classCannotExtendVar.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/classCannotExtendVar.ts (1 errors) ==== + var Markup; + + class Markup { + ~~~~~~ +!!! Duplicate identifier 'Markup'. + constructor() { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/classCannotExtendVar.js b/tests/baselines/reference/classCannotExtendVar.js new file mode 100644 index 0000000000000..46e89c1941846 --- /dev/null +++ b/tests/baselines/reference/classCannotExtendVar.js @@ -0,0 +1,16 @@ +//// [classCannotExtendVar.ts] +var Markup; + +class Markup { + constructor() { + } +} + + +//// [classCannotExtendVar.js] +var Markup; +var Markup = (function () { + function Markup() { + } + return Markup; +})(); diff --git a/tests/baselines/reference/classConstructorAccessibility.errors.txt b/tests/baselines/reference/classConstructorAccessibility.errors.txt new file mode 100644 index 0000000000000..fe2f1e22458b9 --- /dev/null +++ b/tests/baselines/reference/classConstructorAccessibility.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/classes/constructorDeclarations/classConstructorAccessibility.ts (2 errors) ==== + class C { + public constructor(public x: number) { } + } + + class D { + private constructor(public x: number) { } // error + ~~~~~~~ +!!! 'private' modifier cannot appear on a constructor declaration. + } + + var c = new C(1); + var d = new D(1); + + module Generic { + class C { + public constructor(public x: T) { } + } + + class D { + private constructor(public x: T) { } // error + ~~~~~~~ +!!! 'private' modifier cannot appear on a constructor declaration. + } + + var c = new C(1); + var d = new D(1); + } + \ No newline at end of file diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js new file mode 100644 index 0000000000000..bdc4e3c17eb17 --- /dev/null +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -0,0 +1,44 @@ +//// [classDeclarationMergedInModuleWithContinuation.ts] +module M { + export class N { } + export module N { + export var v = 0; + } +} + +module M { + export class O extends M.N { + } +} + +//// [classDeclarationMergedInModuleWithContinuation.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var N = (function () { + function N() { + } + return N; + })(); + M.N = N; + (function (N) { + N.v = 0; + })(M.N || (M.N = {})); + var N = M.N; +})(M || (M = {})); +var M; +(function (M) { + var O = (function (_super) { + __extends(O, _super); + function O() { + _super.apply(this, arguments); + } + return O; + })(M.N); + M.O = O; +})(M || (M = {})); diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt new file mode 100644 index 0000000000000..220bd9581e8e0 --- /dev/null +++ b/tests/baselines/reference/classExpression.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/classExpression.ts (7 errors) ==== + var x = class C { + ~~~~~ +!!! Expression expected. + } + + var y = { + foo: class C2 { + ~~~~~ +!!! Expression expected. + ~~ +!!! ':' expected. + ~ +!!! ',' expected. + ~~ +!!! Cannot find name 'C2'. + } + } + ~ +!!! Declaration or statement expected. + + module M { + var z = class C4 { + ~~~~~ +!!! Expression expected. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js new file mode 100644 index 0000000000000..6c7d9fe679b0b --- /dev/null +++ b/tests/baselines/reference/classExtendingClass.js @@ -0,0 +1,82 @@ +//// [classExtendingClass.ts] +class C { + foo: string; + thing() { } + static other() { } +} + +class D extends C { + bar: string; +} + +var d: D; +var r = d.foo; +var r2 = d.bar; +var r3 = d.thing(); +var r4 = D.other(); + +class C2 { + foo: T; + thing(x: T) { } + static other(x: T) { } +} + +class D2 extends C2 { + bar: string; +} + +var d2: D2; +var r5 = d2.foo; +var r6 = d2.bar; +var r7 = d2.thing(''); +var r8 = D2.other(1); + +//// [classExtendingClass.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.thing = function () { + }; + C.other = function () { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var d; +var r = d.foo; +var r2 = d.bar; +var r3 = d.thing(); +var r4 = D.other(); +var C2 = (function () { + function C2() { + } + C2.prototype.thing = function (x) { + }; + C2.other = function (x) { + }; + return C2; +})(); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; +})(C2); +var d2; +var r5 = d2.foo; +var r6 = d2.bar; +var r7 = d2.thing(''); +var r8 = D2.other(1); diff --git a/tests/baselines/reference/classExtendingPrimitive.errors.txt b/tests/baselines/reference/classExtendingPrimitive.errors.txt new file mode 100644 index 0000000000000..5b3ddb4fe7a1c --- /dev/null +++ b/tests/baselines/reference/classExtendingPrimitive.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts (11 errors) ==== + // classes cannot extend primitives + + class C extends number { } + ~~~~~~ +!!! Cannot find name 'number'. + class C2 extends string { } + ~~~~~~ +!!! Cannot find name 'string'. + class C3 extends boolean { } + ~~~~~~~ +!!! Cannot find name 'boolean'. + class C4 extends Void { } + ~~~~ +!!! Cannot find name 'Void'. + class C4a extends void {} + ~~~~ +!!! Identifier expected. + class C5 extends Null { } + ~~~~ +!!! Cannot find name 'Null'. + class C5a extends null { } + ~~~~ +!!! Identifier expected. + ~ +!!! ';' expected. + class C6 extends undefined { } + ~~~~~~~~~ +!!! Cannot find name 'undefined'. + class C7 extends Undefined { } + ~~~~~~~~~ +!!! Cannot find name 'Undefined'. + + enum E { A } + class C8 extends E { } + ~ +!!! A class may only extend another class. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingQualifiedName.errors.txt b/tests/baselines/reference/classExtendingQualifiedName.errors.txt new file mode 100644 index 0000000000000..626c9d551c8aa --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/classExtendingQualifiedName.ts (1 errors) ==== + module M { + class C { + } + + class D extends M.C { + ~~~ +!!! Module 'M' has no exported member 'C'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js new file mode 100644 index 0000000000000..c6721909db724 --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -0,0 +1,31 @@ +//// [classExtendingQualifiedName.ts] +module M { + class C { + } + + class D extends M.C { + } +} + +//// [classExtendingQualifiedName.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(M.C); +})(M || (M = {})); diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js new file mode 100644 index 0000000000000..9fc31a231eaa7 --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -0,0 +1,32 @@ +//// [classExtendingQualifiedName2.ts] +module M { + export class C { + } + + class D extends M.C { + } +} + +//// [classExtendingQualifiedName2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(M.C); +})(M || (M = {})); diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt new file mode 100644 index 0000000000000..01a09095a99f4 --- /dev/null +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ==== + class A { + a: number; + } + module A { + export var v: string; + } + + module Foo { + var A = 1; + class B extends A { + ~ +!!! Type name 'A' in extends clause does not reference constructor function for 'A'. + b: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js new file mode 100644 index 0000000000000..6d4a9a09b6751 --- /dev/null +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -0,0 +1,42 @@ +//// [classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts] +class A { + a: number; +} +module A { + export var v: string; +} + +module Foo { + var A = 1; + class B extends A { + b: string; + } +} + +//// [classExtendsClauseClassMergedWithModuleNotReferingConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var A; +(function (A) { + A.v; +})(A || (A = {})); +var Foo; +(function (Foo) { + var A = 1; + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(A); +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt new file mode 100644 index 0000000000000..a3329ee139117 --- /dev/null +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/classExtendsClauseClassNotReferringConstructor.ts (1 errors) ==== + class A { a: number; } + module Foo { + var A = 1; + class B extends A { b: string; } + ~ +!!! Type name 'A' in extends clause does not reference constructor function for 'A'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js new file mode 100644 index 0000000000000..03fcfa19a3714 --- /dev/null +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -0,0 +1,31 @@ +//// [classExtendsClauseClassNotReferringConstructor.ts] +class A { a: number; } +module Foo { + var A = 1; + class B extends A { b: string; } +} + + +//// [classExtendsClauseClassNotReferringConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var Foo; +(function (Foo) { + var A = 1; + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(A); +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt new file mode 100644 index 0000000000000..1c6dacfd6d7d3 --- /dev/null +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ==== + interface I { + foo: string; + } + class C extends I { } // error + ~ +!!! A class may only extend another class. + + class C2 extends { foo: string; } { } // error + ~ +!!! Identifier expected. + var x: { foo: string; } + class C3 extends x { } // error + ~ +!!! Cannot find name 'x'. + + module M { export var x = 1; } + class C4 extends M { } // error + ~ +!!! Cannot find name 'M'. + + function foo() { } + class C5 extends foo { } // error + ~~~ +!!! Cannot find name 'foo'. + + class C6 extends []{ } // error + ~ +!!! Identifier expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterface.errors.txt b/tests/baselines/reference/classExtendsInterface.errors.txt new file mode 100644 index 0000000000000..4274e5e70895e --- /dev/null +++ b/tests/baselines/reference/classExtendsInterface.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/classExtendsInterface.ts (2 errors) ==== + interface Comparable {} + class A extends Comparable {} + ~~~~~~~~~~ +!!! A class may only extend another class. + class B implements Comparable {} + + interface Comparable2 {} + class A2 extends Comparable2 {} + ~~~~~~~~~~~~~~ +!!! A class may only extend another class. + class B2 implements Comparable2 {} + \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js new file mode 100644 index 0000000000000..e40c9154e3120 --- /dev/null +++ b/tests/baselines/reference/classExtendsInterface.js @@ -0,0 +1,41 @@ +//// [classExtendsInterface.ts] +interface Comparable {} +class A extends Comparable {} +class B implements Comparable {} + +interface Comparable2 {} +class A2 extends Comparable2 {} +class B2 implements Comparable2 {} + + +//// [classExtendsInterface.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(Comparable); +var B = (function () { + function B() { + } + return B; +})(); +var A2 = (function (_super) { + __extends(A2, _super); + function A2() { + _super.apply(this, arguments); + } + return A2; +})(Comparable2); +var B2 = (function () { + function B2() { + } + return B2; +})(); diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt new file mode 100644 index 0000000000000..a74abc33755be --- /dev/null +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts (1 errors) ==== + class C { + public foo(x: any) { return x; } + private x = 1; + } + + interface I extends C { + other(x: any): any; + } + + class D2 implements I { + ~~ +!!! Class 'D2' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + public foo(x: any) { return x } + private x = 3; + other(x: any) { return x } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js new file mode 100644 index 0000000000000..ed6e3138b075b --- /dev/null +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js @@ -0,0 +1,38 @@ +//// [classExtendsInterfaceThatExtendsClassWithPrivates1.ts] +class C { + public foo(x: any) { return x; } + private x = 1; +} + +interface I extends C { + other(x: any): any; +} + +class D2 implements I { + public foo(x: any) { return x } + private x = 3; + other(x: any) { return x } +} + +//// [classExtendsInterfaceThatExtendsClassWithPrivates1.js] +var C = (function () { + function C() { + this.x = 1; + } + C.prototype.foo = function (x) { + return x; + }; + return C; +})(); +var D2 = (function () { + function D2() { + this.x = 3; + } + D2.prototype.foo = function (x) { + return x; + }; + D2.prototype.other = function (x) { + return x; + }; + return D2; +})(); diff --git a/tests/baselines/reference/classExtendsItself.errors.txt b/tests/baselines/reference/classExtendsItself.errors.txt new file mode 100644 index 0000000000000..7bc086e2323e5 --- /dev/null +++ b/tests/baselines/reference/classExtendsItself.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts (3 errors) ==== + class C extends C { } // error + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' recursively references itself as a base type. + + class D extends D { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'D' recursively references itself as a base type. + + class E extends E { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'E' recursively references itself as a base type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js new file mode 100644 index 0000000000000..126d88acd9a17 --- /dev/null +++ b/tests/baselines/reference/classExtendsItself.js @@ -0,0 +1,35 @@ +//// [classExtendsItself.ts] +class C extends C { } // error + +class D extends D { } // error + +class E extends E { } // error + +//// [classExtendsItself.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(C); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(D); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(E); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt new file mode 100644 index 0000000000000..0995a3477db97 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts (2 errors) ==== + class C extends E { foo: string; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' recursively references itself as a base type. + + class D extends C { bar: string; } + + class E extends D { baz: number; } + + class C2 extends E2 { foo: T; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C2' recursively references itself as a base type. + + class D2 extends C2 { bar: T; } + + class E2 extends D2 { baz: T; } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js new file mode 100644 index 0000000000000..584acb8bac631 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -0,0 +1,62 @@ +//// [classExtendsItselfIndirectly.ts] +class C extends E { foo: string; } // error + +class D extends C { bar: string; } + +class E extends D { baz: number; } + +class C2 extends E2 { foo: T; } // error + +class D2 extends C2 { bar: T; } + +class E2 extends D2 { baz: T; } + +//// [classExtendsItselfIndirectly.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(E); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(D); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(E2); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; +})(C2); +var E2 = (function (_super) { + __extends(E2, _super); + function E2() { + _super.apply(this, arguments); + } + return E2; +})(D2); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt new file mode 100644 index 0000000000000..8a998f0b4c5f2 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts (2 errors) ==== + class C extends N.E { foo: string; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' recursively references itself as a base type. + + module M { + export class D extends C { bar: string; } + + } + + module N { + export class E extends M.D { baz: number; } + } + + module O { + class C2 extends Q.E2 { foo: T; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C2' recursively references itself as a base type. + + module P { + export class D2 extends C2 { bar: T; } + } + + module Q { + export class E2 extends P.D2 { baz: T; } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js new file mode 100644 index 0000000000000..d893227025343 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -0,0 +1,92 @@ +//// [classExtendsItselfIndirectly2.ts] +class C extends N.E { foo: string; } // error + +module M { + export class D extends C { bar: string; } + +} + +module N { + export class E extends M.D { baz: number; } +} + +module O { + class C2 extends Q.E2 { foo: T; } // error + + module P { + export class D2 extends C2 { bar: T; } + } + + module Q { + export class E2 extends P.D2 { baz: T; } + } +} + +//// [classExtendsItselfIndirectly2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(N.E); +var M; +(function (M) { + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C); + M.D = D; +})(M || (M = {})); +var N; +(function (N) { + var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; + })(M.D); + N.E = E; +})(N || (N = {})); +var O; +(function (O) { + var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; + })(Q.E2); + var P; + (function (P) { + var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; + })(C2); + P.D2 = D2; + })(P || (P = {})); + var Q; + (function (Q) { + var E2 = (function (_super) { + __extends(E2, _super); + function E2() { + _super.apply(this, arguments); + } + return E2; + })(P.D2); + Q.E2 = E2; + })(Q || (Q = {})); +})(O || (O = {})); diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt new file mode 100644 index 0000000000000..c64fba71dd6b0 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file1.ts (1 errors) ==== + class C extends E { foo: string; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' recursively references itself as a base type. + +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file2.ts (0 errors) ==== + class D extends C { bar: string; } + +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file3.ts (0 errors) ==== + class E extends D { baz: number; } + +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file4.ts (1 errors) ==== + class C2 extends E2 { foo: T; } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C2' recursively references itself as a base type. + +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file5.ts (0 errors) ==== + class D2 extends C2 { bar: T; } + +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly_file6.ts (0 errors) ==== + class E2 extends D2 { baz: T; } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js new file mode 100644 index 0000000000000..26c3a85ef5135 --- /dev/null +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -0,0 +1,104 @@ +//// [tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly3.ts] //// + +//// [classExtendsItselfIndirectly_file1.ts] +class C extends E { foo: string; } // error + +//// [classExtendsItselfIndirectly_file2.ts] +class D extends C { bar: string; } + +//// [classExtendsItselfIndirectly_file3.ts] +class E extends D { baz: number; } + +//// [classExtendsItselfIndirectly_file4.ts] +class C2 extends E2 { foo: T; } // error + +//// [classExtendsItselfIndirectly_file5.ts] +class D2 extends C2 { bar: T; } + +//// [classExtendsItselfIndirectly_file6.ts] +class E2 extends D2 { baz: T; } + +//// [classExtendsItselfIndirectly_file1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(E); +//// [classExtendsItselfIndirectly_file2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +//// [classExtendsItselfIndirectly_file3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(D); +//// [classExtendsItselfIndirectly_file4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(E2); +//// [classExtendsItselfIndirectly_file5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; +})(C2); +//// [classExtendsItselfIndirectly_file6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var E2 = (function (_super) { + __extends(E2, _super); + function E2() { + _super.apply(this, arguments); + } + return E2; +})(D2); diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt b/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt new file mode 100644 index 0000000000000..545c2b21961bb --- /dev/null +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/classExtendsMultipleBaseClasses.ts (2 errors) ==== + class A { } + class B { } + class C extends A,B { } + ~ +!!! '{' expected. + ~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt new file mode 100644 index 0000000000000..516154005ce2c --- /dev/null +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsShadowedConstructorFunction.ts (1 errors) ==== + class C { foo: string; } + + module M { + var C = 1; + class D extends C { // error, C must evaluate to constructor function + ~ +!!! Type name 'C' in extends clause does not reference constructor function for 'C'. + bar: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js new file mode 100644 index 0000000000000..b7245b8095c50 --- /dev/null +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -0,0 +1,33 @@ +//// [classExtendsShadowedConstructorFunction.ts] +class C { foo: string; } + +module M { + var C = 1; + class D extends C { // error, C must evaluate to constructor function + bar: string; + } +} + +//// [classExtendsShadowedConstructorFunction.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var M; +(function (M) { + var C = 1; + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C); +})(M || (M = {})); diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt new file mode 100644 index 0000000000000..eb7571a243631 --- /dev/null +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsValidConstructorFunction.ts (1 errors) ==== + function foo() { } + + var x = new foo(); // can be used as a constructor function + + class C extends foo { } // error, cannot extend it though + ~~~ +!!! Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js new file mode 100644 index 0000000000000..7de208a26149e --- /dev/null +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -0,0 +1,24 @@ +//// [classExtendsValidConstructorFunction.ts] +function foo() { } + +var x = new foo(); // can be used as a constructor function + +class C extends foo { } // error, cannot extend it though + +//// [classExtendsValidConstructorFunction.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function foo() { +} +var x = new foo(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(foo); diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt new file mode 100644 index 0000000000000..216f434d161cf --- /dev/null +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/classHeritageWithTrailingSeparator.ts (1 errors) ==== + class C { foo: number } + class D extends C, { + ~ +!!! '{' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/classImplementingInterfaceIndexer.js b/tests/baselines/reference/classImplementingInterfaceIndexer.js new file mode 100644 index 0000000000000..dffd9063e8794 --- /dev/null +++ b/tests/baselines/reference/classImplementingInterfaceIndexer.js @@ -0,0 +1,14 @@ +//// [classImplementingInterfaceIndexer.ts] +interface I { + [index: string]: { prop } +} +class A implements I { + [index: string]: { prop } +} + +//// [classImplementingInterfaceIndexer.js] +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/classImplementsClass1.js b/tests/baselines/reference/classImplementsClass1.js new file mode 100644 index 0000000000000..8a0be66cda65f --- /dev/null +++ b/tests/baselines/reference/classImplementsClass1.js @@ -0,0 +1,15 @@ +//// [classImplementsClass1.ts] +class A { } +class C implements A { } + +//// [classImplementsClass1.js] +var A = (function () { + function A() { + } + return A; +})(); +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/classImplementsClass2.errors.txt b/tests/baselines/reference/classImplementsClass2.errors.txt new file mode 100644 index 0000000000000..a48b000b8954d --- /dev/null +++ b/tests/baselines/reference/classImplementsClass2.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/classImplementsClass2.ts (2 errors) ==== + class A { foo(): number { return 1; } } + class C implements A {} // error + ~ +!!! Class 'C' incorrectly implements interface 'A': +!!! Property 'foo' is missing in type 'C'. + + class C2 extends A { + foo() { + return 1; + } + } + + var c: C; + var c2: C2; + c = c2; + c2 = c; + ~~ +!!! Type 'C' is not assignable to type 'C2': +!!! Property 'foo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js new file mode 100644 index 0000000000000..0b4bb10240351 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass2.js @@ -0,0 +1,49 @@ +//// [classImplementsClass2.ts] +class A { foo(): number { return 1; } } +class C implements A {} // error + +class C2 extends A { + foo() { + return 1; + } +} + +var c: C; +var c2: C2; +c = c2; +c2 = c; + +//// [classImplementsClass2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + C2.prototype.foo = function () { + return 1; + }; + return C2; +})(A); +var c; +var c2; +c = c2; +c2 = c; diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js new file mode 100644 index 0000000000000..682b90ecc5a83 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass3.js @@ -0,0 +1,50 @@ +//// [classImplementsClass3.ts] +class A { foo(): number { return 1; } } +class C implements A { + foo() { + return 1; + } +} + +class C2 extends A {} + +// no errors +var c: C; +var c2: C2; +c = c2; +c2 = c; + +//// [classImplementsClass3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function () { + return 1; + }; + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(A); +var c; +var c2; +c = c2; +c2 = c; diff --git a/tests/baselines/reference/classImplementsClass4.errors.txt b/tests/baselines/reference/classImplementsClass4.errors.txt new file mode 100644 index 0000000000000..eb9848c63a9b8 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass4.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/classImplementsClass4.ts (2 errors) ==== + class A { + private x = 1; + foo(): number { return 1; } + } + class C implements A { + ~ +!!! Class 'C' incorrectly implements interface 'A': +!!! Property 'x' is missing in type 'C'. + foo() { + return 1; + } + } + + class C2 extends A {} + + var c: C; + var c2: C2; + c = c2; + c2 = c; + ~~ +!!! Type 'C' is not assignable to type 'C2': +!!! Property 'x' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js new file mode 100644 index 0000000000000..0e08e508fb57d --- /dev/null +++ b/tests/baselines/reference/classImplementsClass4.js @@ -0,0 +1,53 @@ +//// [classImplementsClass4.ts] +class A { + private x = 1; + foo(): number { return 1; } +} +class C implements A { + foo() { + return 1; + } +} + +class C2 extends A {} + +var c: C; +var c2: C2; +c = c2; +c2 = c; + +//// [classImplementsClass4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + this.x = 1; + } + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function () { + return 1; + }; + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(A); +var c; +var c2; +c = c2; +c2 = c; diff --git a/tests/baselines/reference/classImplementsClass5.errors.txt b/tests/baselines/reference/classImplementsClass5.errors.txt new file mode 100644 index 0000000000000..97f83fc83f886 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass5.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/classImplementsClass5.ts (3 errors) ==== + class A { + private x = 1; + foo(): number { return 1; } + } + class C implements A { + ~ +!!! Class 'C' incorrectly implements interface 'A': +!!! Private property 'x' cannot be reimplemented. + private x = 1; + foo() { + return 1; + } + } + + class C2 extends A {} + + var c: C; + var c2: C2; + c = c2; + ~ +!!! Type 'C2' is not assignable to type 'C': +!!! Private property 'x' cannot be reimplemented. + c2 = c; + ~~ +!!! Type 'C' is not assignable to type 'C2': +!!! Private property 'x' cannot be reimplemented. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js new file mode 100644 index 0000000000000..46e826683e7c3 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass5.js @@ -0,0 +1,55 @@ +//// [classImplementsClass5.ts] +class A { + private x = 1; + foo(): number { return 1; } +} +class C implements A { + private x = 1; + foo() { + return 1; + } +} + +class C2 extends A {} + +var c: C; +var c2: C2; +c = c2; +c2 = c; + +//// [classImplementsClass5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + this.x = 1; + } + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C = (function () { + function C() { + this.x = 1; + } + C.prototype.foo = function () { + return 1; + }; + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(A); +var c; +var c2; +c = c2; +c2 = c; diff --git a/tests/baselines/reference/classImplementsClass6.errors.txt b/tests/baselines/reference/classImplementsClass6.errors.txt new file mode 100644 index 0000000000000..789c579fe94ca --- /dev/null +++ b/tests/baselines/reference/classImplementsClass6.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/classImplementsClass6.ts (2 errors) ==== + class A { + static bar(): string { + return ""; + } + foo(): number { return 1; } + } + class C implements A { + + foo() { + return 1; + } + } + + class C2 extends A {} + + var c: C; + var c2: C2; + c = c2; + c2 = c; + c.bar(); // error + ~~~ +!!! Property 'bar' does not exist on type 'C'. + c2.bar(); // should error + ~~~ +!!! Property 'bar' does not exist on type 'C2'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js new file mode 100644 index 0000000000000..2ed6ddc396ed4 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass6.js @@ -0,0 +1,62 @@ +//// [classImplementsClass6.ts] +class A { + static bar(): string { + return ""; + } + foo(): number { return 1; } +} +class C implements A { + + foo() { + return 1; + } +} + +class C2 extends A {} + +var c: C; +var c2: C2; +c = c2; +c2 = c; +c.bar(); // error +c2.bar(); // should error + +//// [classImplementsClass6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.bar = function () { + return ""; + }; + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function () { + return 1; + }; + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(A); +var c; +var c2; +c = c2; +c2 = c; +c.bar(); +c2.bar(); diff --git a/tests/baselines/reference/classImplementsImportedInterface.js b/tests/baselines/reference/classImplementsImportedInterface.js new file mode 100644 index 0000000000000..c76a026b58a2e --- /dev/null +++ b/tests/baselines/reference/classImplementsImportedInterface.js @@ -0,0 +1,25 @@ +//// [classImplementsImportedInterface.ts] +module M1 { + export interface I { + foo(); + } +} + +module M2 { + import T = M1.I; + class C implements T { + foo() {} + } +} + +//// [classImplementsImportedInterface.js] +var M2; +(function (M2) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/classIndexer.js b/tests/baselines/reference/classIndexer.js new file mode 100644 index 0000000000000..bed13e3f43147 --- /dev/null +++ b/tests/baselines/reference/classIndexer.js @@ -0,0 +1,13 @@ +//// [classIndexer.ts] +class C123 { + [s: string]: number; + constructor() { + } +} + +//// [classIndexer.js] +var C123 = (function () { + function C123() { + } + return C123; +})(); diff --git a/tests/baselines/reference/classIndexer2.errors.txt b/tests/baselines/reference/classIndexer2.errors.txt new file mode 100644 index 0000000000000..4278564d8ff84 --- /dev/null +++ b/tests/baselines/reference/classIndexer2.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/classIndexer2.ts (1 errors) ==== + class C123 { + [s: string]: number; + x: number; + y: string; + ~~~~~~~~~~ +!!! Property 'y' of type 'string' is not assignable to string index type 'number'. + constructor() { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer2.js b/tests/baselines/reference/classIndexer2.js new file mode 100644 index 0000000000000..6ed7098e7553b --- /dev/null +++ b/tests/baselines/reference/classIndexer2.js @@ -0,0 +1,15 @@ +//// [classIndexer2.ts] +class C123 { + [s: string]: number; + x: number; + y: string; + constructor() { + } +} + +//// [classIndexer2.js] +var C123 = (function () { + function C123() { + } + return C123; +})(); diff --git a/tests/baselines/reference/classIndexer3.errors.txt b/tests/baselines/reference/classIndexer3.errors.txt new file mode 100644 index 0000000000000..f923a3364a193 --- /dev/null +++ b/tests/baselines/reference/classIndexer3.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/classIndexer3.ts (1 errors) ==== + class C123 { + [s: string]: number; + constructor() { + } + } + + class D123 extends C123 { + x: number; + y: string; + ~~~~~~~~~~ +!!! Property 'y' of type 'string' is not assignable to string index type 'number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js new file mode 100644 index 0000000000000..ca5c5913d75ba --- /dev/null +++ b/tests/baselines/reference/classIndexer3.js @@ -0,0 +1,31 @@ +//// [classIndexer3.ts] +class C123 { + [s: string]: number; + constructor() { + } +} + +class D123 extends C123 { + x: number; + y: string; +} + +//// [classIndexer3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C123 = (function () { + function C123() { + } + return C123; +})(); +var D123 = (function (_super) { + __extends(D123, _super); + function D123() { + _super.apply(this, arguments); + } + return D123; +})(C123); diff --git a/tests/baselines/reference/classIndexer4.errors.txt b/tests/baselines/reference/classIndexer4.errors.txt new file mode 100644 index 0000000000000..06559adf90930 --- /dev/null +++ b/tests/baselines/reference/classIndexer4.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/classIndexer4.ts (1 errors) ==== + class C123 { + [s: string]: number; + constructor() { + } + } + + interface D123 extends C123 { + x: number; + y: string; + ~~~~~~~~~~ +!!! Property 'y' of type 'string' is not assignable to string index type 'number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer4.js b/tests/baselines/reference/classIndexer4.js new file mode 100644 index 0000000000000..419f785f26e38 --- /dev/null +++ b/tests/baselines/reference/classIndexer4.js @@ -0,0 +1,18 @@ +//// [classIndexer4.ts] +class C123 { + [s: string]: number; + constructor() { + } +} + +interface D123 extends C123 { + x: number; + y: string; +} + +//// [classIndexer4.js] +var C123 = (function () { + function C123() { + } + return C123; +})(); diff --git a/tests/baselines/reference/classInheritence.errors.txt b/tests/baselines/reference/classInheritence.errors.txt new file mode 100644 index 0000000000000..6a8ad5a948821 --- /dev/null +++ b/tests/baselines/reference/classInheritence.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/classInheritence.ts (1 errors) ==== + class B extends A { } + class A extends A { } + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A' recursively references itself as a base type. \ No newline at end of file diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js new file mode 100644 index 0000000000000..3378aea91c049 --- /dev/null +++ b/tests/baselines/reference/classInheritence.js @@ -0,0 +1,25 @@ +//// [classInheritence.ts] +class B extends A { } +class A extends A { } + +//// [classInheritence.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(A); diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt new file mode 100644 index 0000000000000..fa5dcab097351 --- /dev/null +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts (1 errors) ==== + class Base { + foo: T; + } + + class Derived extends Base<{ bar: string; }> { + foo: { + bar: string; baz: number; // ok + } + } + + class Derived2 extends Base<{ bar: string; }> { + ~~~~~~~~ +!!! Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': +!!! Types of property 'foo' are incompatible: +!!! Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': +!!! Required property 'bar' cannot be reimplemented with optional property in '{ bar?: string; }'. + foo: { + bar?: string; // error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js new file mode 100644 index 0000000000000..db9ae2adc28f7 --- /dev/null +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -0,0 +1,43 @@ +//// [classIsSubtypeOfBaseType.ts] +class Base { + foo: T; +} + +class Derived extends Base<{ bar: string; }> { + foo: { + bar: string; baz: number; // ok + } +} + +class Derived2 extends Base<{ bar: string; }> { + foo: { + bar?: string; // error + } +} + +//// [classIsSubtypeOfBaseType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt new file mode 100644 index 0000000000000..c34cdca7c905a --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/classMemberInitializerScoping.ts (2 errors) ==== + var aaa = 1; + class CCC { + y: number = aaa; + ~~~ +!!! Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. + static staticY: number = aaa; // This shouldnt be error + constructor(aaa) { + this.y = ''; // was: error, cannot assign string to number + ~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + } + } + + // above is equivalent to this: + var aaaa = 1; + class CCCC { + y: any; + constructor(aaaa) { + this.y = aaaa; + this.y = ''; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerScoping.js b/tests/baselines/reference/classMemberInitializerScoping.js new file mode 100644 index 0000000000000..20ce9c8026308 --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerScoping.js @@ -0,0 +1,40 @@ +//// [classMemberInitializerScoping.ts] +var aaa = 1; +class CCC { + y: number = aaa; + static staticY: number = aaa; // This shouldnt be error + constructor(aaa) { + this.y = ''; // was: error, cannot assign string to number + } +} + +// above is equivalent to this: +var aaaa = 1; +class CCCC { + y: any; + constructor(aaaa) { + this.y = aaaa; + this.y = ''; + } +} + + + +//// [classMemberInitializerScoping.js] +var aaa = 1; +var CCC = (function () { + function CCC(aaa) { + this.y = aaa; + this.y = ''; + } + CCC.staticY = aaa; + return CCC; +})(); +var aaaa = 1; +var CCCC = (function () { + function CCCC(aaaa) { + this.y = aaaa; + this.y = ''; + } + return CCCC; +})(); diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt new file mode 100644 index 0000000000000..6f05862d7657e --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts (1 errors) ==== + declare var console: { + log(msg?: any): void; + }; + class Test { + constructor(private field: string) { + } + messageHandler = () => { + var field = this.field; + console.log(field); // Using field here shouldnt be error + }; + static field: number; + static staticMessageHandler = () => { + var field = Test.field; + console.log(field); // Using field here shouldnt be error + }; + } + + var field1: string; + class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // But this should be error as the field1 will resolve to var field1 + ~~~~~~ +!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + // but since this code would be generated inside constructor, in generated js + // it would resolve to private field1 and thats not what user intended here. + }; + static staticMessageHandler = () => { + console.log(field1); // This shouldnt be error as its a static property + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js new file mode 100644 index 0000000000000..f246ea387090b --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js @@ -0,0 +1,61 @@ +//// [classMemberInitializerWithLamdaScoping.ts] +declare var console: { + log(msg?: any): void; +}; +class Test { + constructor(private field: string) { + } + messageHandler = () => { + var field = this.field; + console.log(field); // Using field here shouldnt be error + }; + static field: number; + static staticMessageHandler = () => { + var field = Test.field; + console.log(field); // Using field here shouldnt be error + }; +} + +var field1: string; +class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // But this should be error as the field1 will resolve to var field1 + // but since this code would be generated inside constructor, in generated js + // it would resolve to private field1 and thats not what user intended here. + }; + static staticMessageHandler = () => { + console.log(field1); // This shouldnt be error as its a static property + }; +} + +//// [classMemberInitializerWithLamdaScoping.js] +var Test = (function () { + function Test(field) { + this.field = field; + var _this = this; + this.messageHandler = function () { + var field = _this.field; + console.log(field); + }; + } + Test.staticMessageHandler = function () { + var field = Test.field; + console.log(field); + }; + return Test; +})(); +var field1; +var Test1 = (function () { + function Test1(field1) { + this.field1 = field1; + this.messageHandler = function () { + console.log(field1); + }; + } + Test1.staticMessageHandler = function () { + console.log(field1); + }; + return Test1; +})(); diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt new file mode 100644 index 0000000000000..d5864dac8520d --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping2_0.ts (0 errors) ==== + var field1: string; + +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping2_1.ts (1 errors) ==== + declare var console: { + log(msg?: any): void; + }; + class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // But this should be error as the field1 will resolve to var field1 + ~~~~~~ +!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + // but since this code would be generated inside constructor, in generated js + // it would resolve to private field1 and thats not what user intended here. + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js new file mode 100644 index 0000000000000..fb299aea4c6ff --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping2.ts] //// + +//// [classMemberInitializerWithLamdaScoping2_0.ts] +var field1: string; + +//// [classMemberInitializerWithLamdaScoping2_1.ts] +declare var console: { + log(msg?: any): void; +}; +class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // But this should be error as the field1 will resolve to var field1 + // but since this code would be generated inside constructor, in generated js + // it would resolve to private field1 and thats not what user intended here. + }; +} + +//// [classMemberInitializerWithLamdaScoping2_0.js] +var field1; +//// [classMemberInitializerWithLamdaScoping2_1.js] +var Test1 = (function () { + function Test1(field1) { + this.field1 = field1; + this.messageHandler = function () { + console.log(field1); + }; + } + return Test1; +})(); diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt new file mode 100644 index 0000000000000..032934a6af3dc --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ==== + var field1: string; + +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (2 errors) ==== + declare var console: { + log(msg?: any): void; + }; + export class Test1 { + ~~~~~~~~~~~~~~~~~~~~ + constructor(private field1: string) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + messageHandler = () => { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + console.log(field1); // But this should be error as the field1 will resolve to var field1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor. + // but since this code would be generated inside constructor, in generated js + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // it would resolve to private field1 and thats not what user intended here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js new file mode 100644 index 0000000000000..4f14159894e62 --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping3.ts] //// + +//// [classMemberInitializerWithLamdaScoping3_0.ts] +var field1: string; + +//// [classMemberInitializerWithLamdaScoping3_1.ts] +declare var console: { + log(msg?: any): void; +}; +export class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // But this should be error as the field1 will resolve to var field1 + // but since this code would be generated inside constructor, in generated js + // it would resolve to private field1 and thats not what user intended here. + }; +} + +//// [classMemberInitializerWithLamdaScoping3_0.js] +var field1; +//// [classMemberInitializerWithLamdaScoping3_1.js] +var Test1 = (function () { + function Test1(field1) { + this.field1 = field1; + this.messageHandler = function () { + console.log(field1); + }; + } + return Test1; +})(); +exports.Test1 = Test1; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt new file mode 100644 index 0000000000000..4926a2c64100b --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (1 errors) ==== + export var field1: string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ==== + declare var console: { + log(msg?: any): void; + }; + export class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // Should be error that couldnt find symbol field1 + ~~~~~~ +!!! Cannot find name 'field1'. + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js new file mode 100644 index 0000000000000..6451984dedaa8 --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping4.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping4.ts] //// + +//// [classMemberInitializerWithLamdaScoping3_0.ts] +export var field1: string; + +//// [classMemberInitializerWithLamdaScoping3_1.ts] +declare var console: { + log(msg?: any): void; +}; +export class Test1 { + constructor(private field1: string) { + } + messageHandler = () => { + console.log(field1); // Should be error that couldnt find symbol field1 + }; +} + +//// [classMemberInitializerWithLamdaScoping3_0.js] +exports.field1; +//// [classMemberInitializerWithLamdaScoping3_1.js] +var Test1 = (function () { + function Test1(field1) { + this.field1 = field1; + this.messageHandler = function () { + console.log(field1); + }; + } + return Test1; +})(); +exports.Test1 = Test1; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js new file mode 100644 index 0000000000000..0dec98fb9b3ab --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js @@ -0,0 +1,22 @@ +//// [classMemberInitializerWithLamdaScoping5.ts] +declare var console: { + log(message?: any, ...optionalParams: any[]): void; +}; +class Greeter { + constructor(message: string) { + } + + messageHandler = (message: string) => { + console.log(message); // This shouldnt be error + } +} + +//// [classMemberInitializerWithLamdaScoping5.js] +var Greeter = (function () { + function Greeter(message) { + this.messageHandler = function (message) { + console.log(message); + }; + } + return Greeter; +})(); diff --git a/tests/baselines/reference/classMethodWithKeywordName1.js b/tests/baselines/reference/classMethodWithKeywordName1.js new file mode 100644 index 0000000000000..9b6b7595f04b8 --- /dev/null +++ b/tests/baselines/reference/classMethodWithKeywordName1.js @@ -0,0 +1,13 @@ +//// [classMethodWithKeywordName1.ts] +class C { + static try() {} +} + +//// [classMethodWithKeywordName1.js] +var C = (function () { + function C() { + } + C.try = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/classOrder1.js b/tests/baselines/reference/classOrder1.js new file mode 100644 index 0000000000000..6748a45444dae --- /dev/null +++ b/tests/baselines/reference/classOrder1.js @@ -0,0 +1,23 @@ +//// [classOrder1.ts] +class A { + public foo() { + /*WScript.Echo("Here!");*/ + } +} + +var a = new A(); +a.foo(); + + + + +//// [classOrder1.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var a = new A(); +a.foo(); diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js new file mode 100644 index 0000000000000..179be456028dd --- /dev/null +++ b/tests/baselines/reference/classOrder2.js @@ -0,0 +1,47 @@ +//// [classOrder2.ts] + +class A extends B { + + foo() { this.bar(); } + +} + +class B { + + bar() { } + +} + + +var a = new A(); + +a.foo(); + + + +//// [classOrder2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + A.prototype.foo = function () { + this.bar(); + }; + return A; +})(B); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +var a = new A(); +a.foo(); diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js new file mode 100644 index 0000000000000..ddf3383187343 --- /dev/null +++ b/tests/baselines/reference/classOrderBug.js @@ -0,0 +1,42 @@ +//// [classOrderBug.ts] +class bar { + public baz: foo; + constructor() { + + this.baz = new foo(); + + } + +} + +class baz {} +class foo extends baz {} + + + + +//// [classOrderBug.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var bar = (function () { + function bar() { + this.baz = new foo(); + } + return bar; +})(); +var baz = (function () { + function baz() { + } + return baz; +})(); +var foo = (function (_super) { + __extends(foo, _super); + function foo() { + _super.apply(this, arguments); + } + return foo; +})(baz); diff --git a/tests/baselines/reference/classOverloadForFunction.errors.txt b/tests/baselines/reference/classOverloadForFunction.errors.txt new file mode 100644 index 0000000000000..eb3fe5bc33b4e --- /dev/null +++ b/tests/baselines/reference/classOverloadForFunction.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/classOverloadForFunction.ts (1 errors) ==== + class foo { }; + function foo() {} + ~~~ +!!! Duplicate identifier 'foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/classOverloadForFunction.js b/tests/baselines/reference/classOverloadForFunction.js new file mode 100644 index 0000000000000..47c787986da29 --- /dev/null +++ b/tests/baselines/reference/classOverloadForFunction.js @@ -0,0 +1,14 @@ +//// [classOverloadForFunction.ts] +class foo { }; +function foo() {} + + +//// [classOverloadForFunction.js] +var foo = (function () { + function foo() { + } + return foo; +})(); +; +function foo() { +} diff --git a/tests/baselines/reference/classOverloadForFunction2.errors.txt b/tests/baselines/reference/classOverloadForFunction2.errors.txt new file mode 100644 index 0000000000000..d1e2135b94e81 --- /dev/null +++ b/tests/baselines/reference/classOverloadForFunction2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/classOverloadForFunction2.ts (2 errors) ==== + function bar(): string; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + class bar {} + ~~~ +!!! Duplicate identifier 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/classOverloadForFunction2.js b/tests/baselines/reference/classOverloadForFunction2.js new file mode 100644 index 0000000000000..13eb0f6c5333c --- /dev/null +++ b/tests/baselines/reference/classOverloadForFunction2.js @@ -0,0 +1,10 @@ +//// [classOverloadForFunction2.ts] +function bar(): string; +class bar {} + +//// [classOverloadForFunction2.js] +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/classPropertyAsPrivate.errors.txt b/tests/baselines/reference/classPropertyAsPrivate.errors.txt new file mode 100644 index 0000000000000..c5d922c0ad5e3 --- /dev/null +++ b/tests/baselines/reference/classPropertyAsPrivate.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/classes/members/accessibility/classPropertyAsPrivate.ts (12 errors) ==== + class C { + private x: string; + private get y() { return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private set y(x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private foo() { } + + private static a: string; + private static get b() { return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static set b(x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static foo() { } + } + + var c: C; + // all errors + c.x; + ~~~ +!!! Property 'C.x' is inaccessible. + c.y; + ~~~ +!!! Property 'C.y' is inaccessible. + c.y = 1; + ~~~ +!!! Property 'C.y' is inaccessible. + c.foo(); + ~~~~~ +!!! Property 'C.foo' is inaccessible. + + C.a; + ~~~ +!!! Property 'C.a' is inaccessible. + C.b(); + ~~~ +!!! Property 'C.b' is inaccessible. + C.b = 1; + ~~~ +!!! Property 'C.b' is inaccessible. + C.foo(); + ~~~~~ +!!! Property 'C.foo' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt b/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt new file mode 100644 index 0000000000000..c8c7f86dde0c4 --- /dev/null +++ b/tests/baselines/reference/classPropertyIsPublicByDefault.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/classes/members/accessibility/classPropertyIsPublicByDefault.ts (4 errors) ==== + class C { + x: string; + get y() { return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set y(x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + foo() { } + + static a: string; + static get b() { return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set b(x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static foo() { } + } + + var c: C; + c.x; + c.y; + c.y = 1; + c.foo(); + + C.a; + C.b(); + C.b = 1; + C.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/classSideInheritance1.errors.txt b/tests/baselines/reference/classSideInheritance1.errors.txt new file mode 100644 index 0000000000000..fa1035551ed3a --- /dev/null +++ b/tests/baselines/reference/classSideInheritance1.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/classSideInheritance1.ts (2 errors) ==== + class A { + static bar(): string { + return ""; + } + foo(): number { return 1; } + } + + class C2 extends A {} + + var a: A; + var c: C2; + a.bar(); // static off an instance - should be an error + ~~~ +!!! Property 'bar' does not exist on type 'A'. + c.bar(); // static off an instance - should be an error + ~~~ +!!! Property 'bar' does not exist on type 'C2'. + A.bar(); // valid + C2.bar(); // valid \ No newline at end of file diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js new file mode 100644 index 0000000000000..7cb37e7d1548e --- /dev/null +++ b/tests/baselines/reference/classSideInheritance1.js @@ -0,0 +1,48 @@ +//// [classSideInheritance1.ts] +class A { + static bar(): string { + return ""; + } + foo(): number { return 1; } +} + +class C2 extends A {} + +var a: A; +var c: C2; +a.bar(); // static off an instance - should be an error +c.bar(); // static off an instance - should be an error +A.bar(); // valid +C2.bar(); // valid + +//// [classSideInheritance1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.bar = function () { + return ""; + }; + A.prototype.foo = function () { + return 1; + }; + return A; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(A); +var a; +var c; +a.bar(); +c.bar(); +A.bar(); +C2.bar(); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js new file mode 100644 index 0000000000000..f848226bb0e86 --- /dev/null +++ b/tests/baselines/reference/classSideInheritance2.js @@ -0,0 +1,44 @@ +//// [classSideInheritance2.ts] +interface IText { + foo: number; +} + +interface TextSpan {} + +class SubText extends TextBase { + + constructor(text: IText, span: TextSpan) { + super(); + } +} + +class TextBase implements IText { + public foo: number; + public subText(span: TextSpan): IText { + + return new SubText(this, span); + } +} + +//// [classSideInheritance2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SubText = (function (_super) { + __extends(SubText, _super); + function SubText(text, span) { + _super.call(this); + } + return SubText; +})(TextBase); +var TextBase = (function () { + function TextBase() { + } + TextBase.prototype.subText = function (span) { + return new SubText(this, span); + }; + return TextBase; +})(); diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt new file mode 100644 index 0000000000000..718ac5f37cb01 --- /dev/null +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== + class A { + constructor(public x: string) { + } + } + class B extends A { + constructor(x: string, public data: string) { + super(x); + } + } + class C extends A { + constructor(x: string) { + super(x); + } + } + + var r1: typeof A = B; // error + ~~~~~~~~~~~~~~~~ +!!! Type 'typeof B' is not assignable to type 'typeof A'. + var r2: new (x: string) => A = B; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'typeof B' is not assignable to type 'new (x: string) => A'. + var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js new file mode 100644 index 0000000000000..0e226d9f41730 --- /dev/null +++ b/tests/baselines/reference/classSideInheritance3.js @@ -0,0 +1,51 @@ +//// [classSideInheritance3.ts] +class A { + constructor(public x: string) { + } +} +class B extends A { + constructor(x: string, public data: string) { + super(x); + } +} +class C extends A { + constructor(x: string) { + super(x); + } +} + +var r1: typeof A = B; // error +var r2: new (x: string) => A = B; // error +var r3: typeof A = C; // ok + +//// [classSideInheritance3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A(x) { + this.x = x; + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B(x, data) { + _super.call(this, x); + this.data = data; + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C(x) { + _super.call(this, x); + } + return C; +})(A); +var r1 = B; +var r2 = B; +var r3 = C; diff --git a/tests/baselines/reference/classTypeParametersInStatics.errors.txt b/tests/baselines/reference/classTypeParametersInStatics.errors.txt new file mode 100644 index 0000000000000..8fc40c979f786 --- /dev/null +++ b/tests/baselines/reference/classTypeParametersInStatics.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/classTypeParametersInStatics.ts (3 errors) ==== + module Editor { + + + export class List { + public next: List; + public prev: List; + + constructor(public isHead: boolean, public data: T) { + + } + + public static MakeHead(): List { // should error + ~ +!!! Static members cannot reference class type parameters. + var entry: List = new List(true, null); + ~ +!!! Static members cannot reference class type parameters. + ~ +!!! Static members cannot reference class type parameters. + entry.prev = entry; + entry.next = entry; + return entry; + } + + public static MakeHead2(): List { // should not error + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public static MakeHead3(): List { // should not error + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classTypeParametersInStatics.js b/tests/baselines/reference/classTypeParametersInStatics.js new file mode 100644 index 0000000000000..8790ad9bceb01 --- /dev/null +++ b/tests/baselines/reference/classTypeParametersInStatics.js @@ -0,0 +1,65 @@ +//// [classTypeParametersInStatics.ts] +module Editor { + + + export class List { + public next: List; + public prev: List; + + constructor(public isHead: boolean, public data: T) { + + } + + public static MakeHead(): List { // should error + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public static MakeHead2(): List { // should not error + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public static MakeHead3(): List { // should not error + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + } +} + +//// [classTypeParametersInStatics.js] +var Editor; +(function (Editor) { + var List = (function () { + function List(isHead, data) { + this.isHead = isHead; + this.data = data; + } + List.MakeHead = function () { + var entry = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + }; + List.MakeHead2 = function () { + var entry = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + }; + List.MakeHead3 = function () { + var entry = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + }; + return List; + })(); + Editor.List = List; +})(Editor || (Editor = {})); diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt new file mode 100644 index 0000000000000..f7f4036254b6b --- /dev/null +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -0,0 +1,154 @@ +==== tests/cases/compiler/classUpdateTests.ts (16 errors) ==== + // + // test codegen for instance properties + // + class A { + public p1 = 0; + private p2 = 0; + p3; + } + + class B { + public p1 = 0; + private p2 = 0; + p3; + + constructor() {} + } + + class C { + constructor(public p1=0, private p2=0, p3=0) {} + } + + // + // test requirements for super calls + // + class D { // NO ERROR + + } + + class E extends D { // NO ERROR + public p1 = 0; + } + + class F extends E { + constructor() {} // ERROR - super call required + ~~~~~~~~~~~~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class G extends D { + public p1 = 0; + constructor() { super(); } // NO ERROR + } + + class H { + constructor() { super(); } // ERROR - no super call allowed + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + class I extends Object { + ~~~~~~ +!!! A class may only extend another class. + constructor() { super(); } // ERROR - no super call allowed + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + class J extends G { + constructor(public p1:number) { + super(); // NO ERROR + } + } + + class K extends G { + constructor(public p1:number) { // ERROR + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var i = 0; + ~~~~~~~~~~~~ + super(); + ~~~~~~~~~~ + } + ~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class L extends G { + ~ +!!! Class 'L' incorrectly extends base class 'G': +!!! Private property 'p1' cannot be reimplemented. + constructor(private p1:number) { + super(); // NO ERROR + } + } + + class M extends G { + ~ +!!! Class 'M' incorrectly extends base class 'G': +!!! Private property 'p1' cannot be reimplemented. + constructor(private p1:number) { // ERROR + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var i = 0; + ~~~~~~~~~~~~ + super(); + ~~~~~~~~~~ + } + ~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + // + // test this reference in field initializers + // + class N { + public p1 = 0; + public p2 = this.p1; + + constructor() { + this.p2 = 0; + } + } + + // + // test error on property declarations within class constructors + // + class O { + constructor() { + public p1 = 0; // ERROR + ~~~~~~ +!!! Statement expected. + } + } + ~ +!!! Declaration or statement expected. + + class P { + constructor() { + private p1 = 0; // ERROR + ~~~~~~~ +!!! Statement expected. + } + } + ~ +!!! Declaration or statement expected. + + class Q { + constructor() { + public this.p1 = 0; // ERROR + ~~~~~~ +!!! Statement expected. + ~~ +!!! Property 'p1' does not exist on type 'Q'. + } + } + + class R { + constructor() { + private this.p1 = 0; // ERROR + ~~~~~~~ +!!! Statement expected. + ~~ +!!! Property 'p1' does not exist on type 'R'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt new file mode 100644 index 0000000000000..28938907d7a18 --- /dev/null +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithBaseClassButNoConstructor.ts (4 errors) ==== + class Base { + constructor(x: number) { } + } + + class C extends Base { + foo: string; + } + + var r = C; + var c = new C(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var c2 = new C(1); // ok + + class Base2 { + constructor(x: T) { } + } + + class D extends Base2 { + foo: U; + } + + var r2 = D; + var d = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D(1); // ok + + // specialized base class + class D2 extends Base2 { + foo: U; + } + + var r3 = D2; + var d3 = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d4 = new D(1); // ok + + class D3 extends Base2 { + foo: string; + } + + var r4 = D3; + var d5 = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d6 = new D(1); // ok \ No newline at end of file diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js new file mode 100644 index 0000000000000..1f7009c5b030d --- /dev/null +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -0,0 +1,99 @@ +//// [classWithBaseClassButNoConstructor.ts] +class Base { + constructor(x: number) { } +} + +class C extends Base { + foo: string; +} + +var r = C; +var c = new C(); // error +var c2 = new C(1); // ok + +class Base2 { + constructor(x: T) { } +} + +class D extends Base2 { + foo: U; +} + +var r2 = D; +var d = new D(); // error +var d2 = new D(1); // ok + +// specialized base class +class D2 extends Base2 { + foo: U; +} + +var r3 = D2; +var d3 = new D(); // error +var d4 = new D(1); // ok + +class D3 extends Base2 { + foo: string; +} + +var r4 = D3; +var d5 = new D(); // error +var d6 = new D(1); // ok + +//// [classWithBaseClassButNoConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(x) { + } + return Base; +})(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(Base); +var r = C; +var c = new C(); +var c2 = new C(1); +var Base2 = (function () { + function Base2(x) { + } + return Base2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(Base2); +var r2 = D; +var d = new D(); +var d2 = new D(1); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; +})(Base2); +var r3 = D2; +var d3 = new D(); +var d4 = new D(1); +var D3 = (function (_super) { + __extends(D3, _super); + function D3() { + _super.apply(this, arguments); + } + return D3; +})(Base2); +var r4 = D3; +var d5 = new D(); +var d6 = new D(1); diff --git a/tests/baselines/reference/classWithConstructors.errors.txt b/tests/baselines/reference/classWithConstructors.errors.txt new file mode 100644 index 0000000000000..f6612ca87f730 --- /dev/null +++ b/tests/baselines/reference/classWithConstructors.errors.txt @@ -0,0 +1,62 @@ +==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithConstructors.ts (6 errors) ==== + module NonGeneric { + class C { + constructor(x: string) { } + } + + var c = new C(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var c2 = new C(''); // ok + + class C2 { + constructor(x: number); + constructor(x: string); + constructor(x: any) { } + } + + var c3 = new C2(); // error + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var c4 = new C2(''); // ok + var c5 = new C2(1); // ok + + class D extends C2 { } + + var d = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D(1); // ok + var d3 = new D(''); // ok + } + + module Generics { + class C { + constructor(x: T) { } + } + + var c = new C(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var c2 = new C(''); // ok + + class C2 { + constructor(x: T); + constructor(x: T, y: U); + constructor(x: any) { } + } + + var c3 = new C2(); // error + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var c4 = new C2(''); // ok + var c5 = new C2(1, 2); // ok + + class D extends C2 { } + + var d = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D(1); // ok + var d3 = new D(''); // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js new file mode 100644 index 0000000000000..baa4cd7d26a03 --- /dev/null +++ b/tests/baselines/reference/classWithConstructors.js @@ -0,0 +1,114 @@ +//// [classWithConstructors.ts] +module NonGeneric { + class C { + constructor(x: string) { } + } + + var c = new C(); // error + var c2 = new C(''); // ok + + class C2 { + constructor(x: number); + constructor(x: string); + constructor(x: any) { } + } + + var c3 = new C2(); // error + var c4 = new C2(''); // ok + var c5 = new C2(1); // ok + + class D extends C2 { } + + var d = new D(); // error + var d2 = new D(1); // ok + var d3 = new D(''); // ok +} + +module Generics { + class C { + constructor(x: T) { } + } + + var c = new C(); // error + var c2 = new C(''); // ok + + class C2 { + constructor(x: T); + constructor(x: T, y: U); + constructor(x: any) { } + } + + var c3 = new C2(); // error + var c4 = new C2(''); // ok + var c5 = new C2(1, 2); // ok + + class D extends C2 { } + + var d = new D(); // error + var d2 = new D(1); // ok + var d3 = new D(''); // ok +} + +//// [classWithConstructors.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var NonGeneric; +(function (NonGeneric) { + var C = (function () { + function C(x) { + } + return C; + })(); + var c = new C(); + var c2 = new C(''); + var C2 = (function () { + function C2(x) { + } + return C2; + })(); + var c3 = new C2(); + var c4 = new C2(''); + var c5 = new C2(1); + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C2); + var d = new D(); + var d2 = new D(1); + var d3 = new D(''); +})(NonGeneric || (NonGeneric = {})); +var Generics; +(function (Generics) { + var C = (function () { + function C(x) { + } + return C; + })(); + var c = new C(); + var c2 = new C(''); + var C2 = (function () { + function C2(x) { + } + return C2; + })(); + var c3 = new C2(); + var c4 = new C2(''); + var c5 = new C2(1, 2); + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C2); + var d = new D(); + var d2 = new D(1); + var d3 = new D(''); +})(Generics || (Generics = {})); diff --git a/tests/baselines/reference/classWithEmptyBody.js b/tests/baselines/reference/classWithEmptyBody.js new file mode 100644 index 0000000000000..b4129162a0bd9 --- /dev/null +++ b/tests/baselines/reference/classWithEmptyBody.js @@ -0,0 +1,46 @@ +//// [classWithEmptyBody.ts] +class C { +} + +var c: C; +var o: {} = c; +c = 1; +c = { foo: '' } +c = () => { } + +class D { + constructor() { + return 1; + } +} + +var d: D; +var o: {} = d; +d = 1; +d = { foo: '' } +d = () => { } + +//// [classWithEmptyBody.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var o = c; +c = 1; +c = { foo: '' }; +c = function () { +}; +var D = (function () { + function D() { + return 1; + } + return D; +})(); +var d; +var o = d; +d = 1; +d = { foo: '' }; +d = function () { +}; diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt new file mode 100644 index 0000000000000..56f34575468f3 --- /dev/null +++ b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/classWithMultipleBaseClasses.ts (1 errors) ==== + class A { + foo() { } + } + + class B { + bar() { } + } + + interface I { + baz(); + } + + interface J { + bat(); + } + + + class D implements I, J { + ~ +!!! Class 'D' incorrectly implements interface 'I': +!!! Property 'foo' is missing in type 'D'. + baz() { } + bat() { } + } + + interface I extends A, B { + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.js b/tests/baselines/reference/classWithMultipleBaseClasses.js new file mode 100644 index 0000000000000..c6900f526cbd6 --- /dev/null +++ b/tests/baselines/reference/classWithMultipleBaseClasses.js @@ -0,0 +1,50 @@ +//// [classWithMultipleBaseClasses.ts] +class A { + foo() { } +} + +class B { + bar() { } +} + +interface I { + baz(); +} + +interface J { + bat(); +} + + +class D implements I, J { + baz() { } + bat() { } +} + +interface I extends A, B { +} + +//// [classWithMultipleBaseClasses.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +var D = (function () { + function D() { + } + D.prototype.baz = function () { + }; + D.prototype.bat = function () { + }; + return D; +})(); diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.js b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js new file mode 100644 index 0000000000000..7898b3217fdb9 --- /dev/null +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js @@ -0,0 +1,34 @@ +//// [classWithNoConstructorOrBaseClass.ts] +class C { + x: string; +} + +var c = new C(); +var r = C; + +class D { + x: T; + y: U; +} + +var d = new D(); +var d2 = new D(); +var r2 = D; + + +//// [classWithNoConstructorOrBaseClass.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = new C(); +var r = C; +var D = (function () { + function D() { + } + return D; +})(); +var d = new D(); +var d2 = new D(); +var r2 = D; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js new file mode 100644 index 0000000000000..9c7474fbfb520 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.js @@ -0,0 +1,49 @@ +//// [classWithOnlyPublicMembersEquivalentToInterface.ts] +// no errors expected + +class C { + public x: string; + public y(a: number): number { return null; } + public get z() { return 1; } + public set z(v) { } + [x: string]: Object; + [x: number]: Object; + 0: number; +} + +interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; +} + +var c: C; +var i: I; +c = i; +i = c; + +//// [classWithOnlyPublicMembersEquivalentToInterface.js] +var C = (function () { + function C() { + } + C.prototype.y = function (a) { + return null; + }; + Object.defineProperty(C.prototype, "z", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return C; +})(); +var c; +var i; +c = i; +i = c; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js new file mode 100644 index 0000000000000..f41f084d5fbc0 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.js @@ -0,0 +1,51 @@ +//// [classWithOnlyPublicMembersEquivalentToInterface2.ts] +// no errors expected + +class C { + public x: string; + public y(a: number): number { return null; } + public get z() { return 1; } + public set z(v) { } + [x: string]: Object; + [x: number]: Object; + 0: number; + + public static foo: string; // doesn't effect equivalence +} + +interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; +} + +var c: C; +var i: I; +c = i; +i = c; + +//// [classWithOnlyPublicMembersEquivalentToInterface2.js] +var C = (function () { + function C() { + } + C.prototype.y = function (a) { + return null; + }; + Object.defineProperty(C.prototype, "z", { + get: function () { + return 1; + }, + set: function (v) { + }, + enumerable: true, + configurable: true + }); + return C; +})(); +var c; +var i; +c = i; +i = c; diff --git a/tests/baselines/reference/classWithOptionalParameter.errors.txt b/tests/baselines/reference/classWithOptionalParameter.errors.txt new file mode 100644 index 0000000000000..028e1f62dff9c --- /dev/null +++ b/tests/baselines/reference/classWithOptionalParameter.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/types/namedTypes/classWithOptionalParameter.ts (4 errors) ==== + // classes do not permit optional parameters, these are errors + + class C { + x?: string; + ~ +!!! A class member cannot be declared optional. + f?() {} + ~ +!!! A class member cannot be declared optional. + } + + class C2 { + x?: T; + ~ +!!! A class member cannot be declared optional. + f?(x: T) {} + ~ +!!! A class member cannot be declared optional. + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt new file mode 100644 index 0000000000000..e939db8e41896 --- /dev/null +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/classWithOverloadImplementationOfWrongName.ts (1 errors) ==== + class C { + foo(): string; + foo(x): number; + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + bar(x): any { } + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js new file mode 100644 index 0000000000000..f8cb9bf4c5ba3 --- /dev/null +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js @@ -0,0 +1,15 @@ +//// [classWithOverloadImplementationOfWrongName.ts] +class C { + foo(): string; + foo(x): number; + bar(x): any { } +} + +//// [classWithOverloadImplementationOfWrongName.js] +var C = (function () { + function C() { + } + C.prototype.bar = function (x) { + }; + return C; +})(); diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt new file mode 100644 index 0000000000000..5c233b6c43c69 --- /dev/null +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts (1 errors) ==== + class C { + foo(): string; + bar(x): any { } + foo(x): number; + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js new file mode 100644 index 0000000000000..5caba8f3fd543 --- /dev/null +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js @@ -0,0 +1,15 @@ +//// [classWithOverloadImplementationOfWrongName2.ts] +class C { + foo(): string; + bar(x): any { } + foo(x): number; +} + +//// [classWithOverloadImplementationOfWrongName2.js] +var C = (function () { + function C() { + } + C.prototype.bar = function (x) { + }; + return C; +})(); diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt b/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt new file mode 100644 index 0000000000000..47ff1f52e6627 --- /dev/null +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames.ts (4 errors) ==== + // classes cannot use predefined types as names + + class any { } + ~~~ +!!! Class name cannot be 'any' + class number { } + ~~~~~~ +!!! Class name cannot be 'number' + class boolean { } + ~~~~~~~ +!!! Class name cannot be 'boolean' + class string { } + ~~~~~~ +!!! Class name cannot be 'string' \ No newline at end of file diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames.js b/tests/baselines/reference/classWithPredefinedTypesAsNames.js new file mode 100644 index 0000000000000..8de0af7c13487 --- /dev/null +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames.js @@ -0,0 +1,29 @@ +//// [classWithPredefinedTypesAsNames.ts] +// classes cannot use predefined types as names + +class any { } +class number { } +class boolean { } +class string { } + +//// [classWithPredefinedTypesAsNames.js] +var any = (function () { + function any() { + } + return any; +})(); +var number = (function () { + function number() { + } + return number; +})(); +var boolean = (function () { + function boolean() { + } + return boolean; +})(); +var string = (function () { + function string() { + } + return string; +})(); diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt new file mode 100644 index 0000000000000..0d6065e7a7196 --- /dev/null +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/classes/classDeclarations/classWithPredefinedTypesAsNames2.ts (1 errors) ==== + // classes cannot use predefined types as names + + class void {} + ~~~~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/classWithPrivateProperty.errors.txt b/tests/baselines/reference/classWithPrivateProperty.errors.txt new file mode 100644 index 0000000000000..aa1664bbb3787 --- /dev/null +++ b/tests/baselines/reference/classWithPrivateProperty.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/conformance/types/members/classWithPrivateProperty.ts (8 errors) ==== + // accessing any private outside the class is an error + + class C { + private x; + private a = ''; + private b: string = ''; + private c() { return '' } + private d = () => ''; + private static e; + private static f() { return '' } + private static g = () => ''; + } + + var c = new C(); + var r1: string = c.x; + ~~~ +!!! Property 'C.x' is inaccessible. + var r2: string = c.a; + ~~~ +!!! Property 'C.a' is inaccessible. + var r3: string = c.b; + ~~~ +!!! Property 'C.b' is inaccessible. + var r4: string = c.c(); + ~~~ +!!! Property 'C.c' is inaccessible. + var r5: string = c.d(); + ~~~ +!!! Property 'C.d' is inaccessible. + var r6: string = C.e; + ~~~ +!!! Property 'C.e' is inaccessible. + var r7: string = C.f(); + ~~~ +!!! Property 'C.f' is inaccessible. + var r8: string = C.g(); + ~~~ +!!! Property 'C.g' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/classWithPrivateProperty.js b/tests/baselines/reference/classWithPrivateProperty.js new file mode 100644 index 0000000000000..534f4082b6dba --- /dev/null +++ b/tests/baselines/reference/classWithPrivateProperty.js @@ -0,0 +1,49 @@ +//// [classWithPrivateProperty.ts] +// accessing any private outside the class is an error + +class C { + private x; + private a = ''; + private b: string = ''; + private c() { return '' } + private d = () => ''; + private static e; + private static f() { return '' } + private static g = () => ''; +} + +var c = new C(); +var r1: string = c.x; +var r2: string = c.a; +var r3: string = c.b; +var r4: string = c.c(); +var r5: string = c.d(); +var r6: string = C.e; +var r7: string = C.f(); +var r8: string = C.g(); + +//// [classWithPrivateProperty.js] +var C = (function () { + function C() { + this.a = ''; + this.b = ''; + this.d = function () { return ''; }; + } + C.prototype.c = function () { + return ''; + }; + C.f = function () { + return ''; + }; + C.g = function () { return ''; }; + return C; +})(); +var c = new C(); +var r1 = c.x; +var r2 = c.a; +var r3 = c.b; +var r4 = c.c(); +var r5 = c.d(); +var r6 = C.e; +var r7 = C.f(); +var r8 = C.g(); diff --git a/tests/baselines/reference/classWithPublicProperty.js b/tests/baselines/reference/classWithPublicProperty.js new file mode 100644 index 0000000000000..277314db65223 --- /dev/null +++ b/tests/baselines/reference/classWithPublicProperty.js @@ -0,0 +1,48 @@ +//// [classWithPublicProperty.ts] +class C { + public x; + public a = ''; + public b: string = ''; + public c() { return '' } + public d = () => ''; + public static e; + public static f() { return '' } + public static g = () => ''; +} + +// all of these are valid +var c = new C(); +var r1: string = c.x; +var r2: string = c.a; +var r3: string = c.b; +var r4: string = c.c(); +var r5: string = c.d(); +var r6: string = C.e; +var r7: string = C.f(); +var r8: string = C.g(); + +//// [classWithPublicProperty.js] +var C = (function () { + function C() { + this.a = ''; + this.b = ''; + this.d = function () { return ''; }; + } + C.prototype.c = function () { + return ''; + }; + C.f = function () { + return ''; + }; + C.g = function () { return ''; }; + return C; +})(); +var c = new C(); +var r1 = c.x; +var r2 = c.a; +var r3 = c.b; +var r4 = c.c(); +var r5 = c.d(); +var r6 = C.e; +var r7 = C.f(); +var r8 = C.g(); diff --git a/tests/baselines/reference/classWithStaticMembers.errors.txt b/tests/baselines/reference/classWithStaticMembers.errors.txt new file mode 100644 index 0000000000000..63f6d4b76e0eb --- /dev/null +++ b/tests/baselines/reference/classWithStaticMembers.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithStaticMembers.ts (2 errors) ==== + class C { + static fn() { return this; } + static get x() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set x(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + constructor(public a: number, private b: number) { } + static foo: string; + } + + var r = C.fn(); + var r2 = r.x; + var r3 = r.foo; + + class D extends C { + bar: string; + } + + var r = D.fn(); + var r2 = r.x; + var r3 = r.foo; \ No newline at end of file diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt b/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt new file mode 100644 index 0000000000000..6ed2fe3f84d92 --- /dev/null +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts (2 errors) ==== + class C { + constructor() { } + constructor(x) { } // error + ~~~~~~~~~~~~~~~~~~ +!!! Multiple constructor implementations are not allowed. + } + + class D { + constructor(x: T) { } + constructor(x: T, y: T) { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Multiple constructor implementations are not allowed. + } \ No newline at end of file diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.js b/tests/baselines/reference/classWithTwoConstructorDefinitions.js new file mode 100644 index 0000000000000..77c98697f1fd3 --- /dev/null +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.js @@ -0,0 +1,22 @@ +//// [classWithTwoConstructorDefinitions.ts] +class C { + constructor() { } + constructor(x) { } // error +} + +class D { + constructor(x: T) { } + constructor(x: T, y: T) { } // error +} + +//// [classWithTwoConstructorDefinitions.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D(x) { + } + return D; +})(); diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt new file mode 100644 index 0000000000000..8f21178ed7238 --- /dev/null +++ b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/classWithoutExplicitConstructor.ts (2 errors) ==== + class C { + x = 1 + y = 'hello'; + } + + var c = new C(); + var c2 = new C(null); // error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class D { + x = 2 + y: T = null; + } + + var d = new D(); + var d2 = new D(null); // error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.js b/tests/baselines/reference/classWithoutExplicitConstructor.js new file mode 100644 index 0000000000000..b2574663fc281 --- /dev/null +++ b/tests/baselines/reference/classWithoutExplicitConstructor.js @@ -0,0 +1,36 @@ +//// [classWithoutExplicitConstructor.ts] +class C { + x = 1 + y = 'hello'; +} + +var c = new C(); +var c2 = new C(null); // error + +class D { + x = 2 + y: T = null; +} + +var d = new D(); +var d2 = new D(null); // error + +//// [classWithoutExplicitConstructor.js] +var C = (function () { + function C() { + this.x = 1; + this.y = 'hello'; + } + return C; +})(); +var c = new C(); +var c2 = new C(null); +var D = (function () { + function D() { + this.x = 2; + this.y = null; + } + return D; +})(); +var d = new D(); +var d2 = new D(null); diff --git a/tests/baselines/reference/classdecl.errors.txt b/tests/baselines/reference/classdecl.errors.txt new file mode 100644 index 0000000000000..fcb0ad8b25a39 --- /dev/null +++ b/tests/baselines/reference/classdecl.errors.txt @@ -0,0 +1,102 @@ +==== tests/cases/compiler/classdecl.ts (4 errors) ==== + class a { + //constructor (); + constructor (n: number); + constructor (s: string); + constructor (ns: any) { + + } + + public pgF() { } + + public pv; + public get d() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 30; + } + public set d() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public static get p2() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return { x: 30, y: 40 }; + } + + private static d2() { + } + private static get p3() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "string"; + } + private pv3; + + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } + } + + class b extends a { + } + + module m1 { + export class b { + } + class d { + } + + + export interface ib { + } + } + + module m2 { + + export module m3 { + export class c extends b { + } + export class ib2 implements m1.ib { + } + } + } + + class c extends m1.b { + } + + class ib2 implements m1.ib { + } + + declare class aAmbient { + constructor (n: number); + constructor (s: string); + public pgF(): void; + public pv; + public d : number; + static p2 : { x: number; y: number; }; + static d2(); + static p3; + private pv3; + private foo(s); + } + + class d { + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } + } + + class e { + private foo(s: string): string; + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/clinterfaces.errors.txt b/tests/baselines/reference/clinterfaces.errors.txt new file mode 100644 index 0000000000000..e187459e4f4cf --- /dev/null +++ b/tests/baselines/reference/clinterfaces.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/clinterfaces.ts (4 errors) ==== + module M { + class C { } + interface C { } + ~ +!!! Duplicate identifier 'C'. + interface D { } + class D { } + ~ +!!! Duplicate identifier 'D'. + } + + interface Foo { + a: string; + } + + class Foo{ + ~~~ +!!! Duplicate identifier 'Foo'. + b: number; + } + + class Bar{ + b: number; + } + + interface Bar { + ~~~ +!!! Duplicate identifier 'Bar'. + a: string; + } + + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/clinterfaces.js b/tests/baselines/reference/clinterfaces.js new file mode 100644 index 0000000000000..02ae73498697a --- /dev/null +++ b/tests/baselines/reference/clinterfaces.js @@ -0,0 +1,51 @@ +//// [clinterfaces.ts] +module M { + class C { } + interface C { } + interface D { } + class D { } +} + +interface Foo { + a: string; +} + +class Foo{ + b: number; +} + +class Bar{ + b: number; +} + +interface Bar { + a: string; +} + +export = Foo; + + +//// [clinterfaces.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var D = (function () { + function D() { + } + return D; + })(); +})(M || (M = {})); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js new file mode 100644 index 0000000000000..280e30c8c7d0f --- /dev/null +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -0,0 +1,39 @@ +//// [cloduleAcrossModuleDefinitions.ts] +module A { + export class B { + foo() { } + static bar() { } + } +} + +module A { + export module B { + export var x = 1; + } +} + +var b: A.B; // ok + + +//// [cloduleAcrossModuleDefinitions.js] +var A; +(function (A) { + var B = (function () { + function B() { + } + B.prototype.foo = function () { + }; + B.bar = function () { + }; + return B; + })(); + A.B = B; +})(A || (A = {})); +var A; +(function (A) { + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var b; diff --git a/tests/baselines/reference/cloduleAndTypeParameters.js b/tests/baselines/reference/cloduleAndTypeParameters.js new file mode 100644 index 0000000000000..28d89b59cf2b2 --- /dev/null +++ b/tests/baselines/reference/cloduleAndTypeParameters.js @@ -0,0 +1,30 @@ +//// [cloduleAndTypeParameters.ts] +class Foo { + constructor() { + } +} + +module Foo { + export interface Bar { + bar(): void; + } + + export class Baz { + } +} + +//// [cloduleAndTypeParameters.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Foo; +(function (Foo) { + var Baz = (function () { + function Baz() { + } + return Baz; + })(); + Foo.Baz = Baz; +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.js b/tests/baselines/reference/cloduleSplitAcrossFiles.js new file mode 100644 index 0000000000000..6bc8cfddb6f58 --- /dev/null +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/cloduleSplitAcrossFiles.ts] //// + +//// [cloduleSplitAcrossFiles_class.ts] +class D { } + +//// [cloduleSplitAcrossFiles_module.ts] +module D { + export var y = "hi"; +} +D.y; + +//// [cloduleSplitAcrossFiles_class.js] +var D = (function () { + function D() { + } + return D; +})(); +//// [cloduleSplitAcrossFiles_module.js] +var D; +(function (D) { + D.y = "hi"; +})(D || (D = {})); +D.y; diff --git a/tests/baselines/reference/cloduleStaticMembers.errors.txt b/tests/baselines/reference/cloduleStaticMembers.errors.txt new file mode 100644 index 0000000000000..ad1a3572c93c9 --- /dev/null +++ b/tests/baselines/reference/cloduleStaticMembers.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/cloduleStaticMembers.ts (3 errors) ==== + class Clod { + private static x = 10; + public static y = 10; + } + module Clod { + var p = Clod.x; + ~~~~~~ +!!! Property 'Clod.x' is inaccessible. + var q = x; + ~ +!!! Cannot find name 'x'. + + var s = Clod.y; + var t = y; + ~ +!!! Cannot find name 'y'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/cloduleStaticMembers.js b/tests/baselines/reference/cloduleStaticMembers.js new file mode 100644 index 0000000000000..518ef43fe4045 --- /dev/null +++ b/tests/baselines/reference/cloduleStaticMembers.js @@ -0,0 +1,29 @@ +//// [cloduleStaticMembers.ts] +class Clod { + private static x = 10; + public static y = 10; +} +module Clod { + var p = Clod.x; + var q = x; + + var s = Clod.y; + var t = y; +} + + +//// [cloduleStaticMembers.js] +var Clod = (function () { + function Clod() { + } + Clod.x = 10; + Clod.y = 10; + return Clod; +})(); +var Clod; +(function (Clod) { + var p = Clod.x; + var q = x; + var s = Clod.y; + var t = y; +})(Clod || (Clod = {})); diff --git a/tests/baselines/reference/cloduleTest1.js b/tests/baselines/reference/cloduleTest1.js new file mode 100644 index 0000000000000..f79f1e5c46fdc --- /dev/null +++ b/tests/baselines/reference/cloduleTest1.js @@ -0,0 +1,21 @@ +//// [cloduleTest1.ts] + declare function $(selector: string): $; + interface $ { + addClass(className: string): $; + } + module $ { + export interface AjaxSettings { + } + export function ajax(options: AjaxSettings) { } + } + var it: $ = $('.foo').addClass('bar'); + + +//// [cloduleTest1.js] +var $; +(function ($) { + function ajax(options) { + } + $.ajax = ajax; +})($ || ($ = {})); +var it = $('.foo').addClass('bar'); diff --git a/tests/baselines/reference/cloduleTest2.errors.txt b/tests/baselines/reference/cloduleTest2.errors.txt new file mode 100644 index 0000000000000..a1355c0c9f159 --- /dev/null +++ b/tests/baselines/reference/cloduleTest2.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/cloduleTest2.ts (8 errors) ==== + module T1 { + module m3d { export var y = 2; } + declare class m3d { constructor(foo); foo(): void ; static bar(); } + var r = new m3d(); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + module T2 { + declare class m3d { constructor(foo); foo(): void; static bar(); } + module m3d { export var y = 2; } + var r = new m3d(); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + module T3 { + module m3d { export var y = 2; } + declare class m3d { foo(): void; static bar(); } + var r = new m3d(); + r.foo(); + r.bar(); // error + ~~~ +!!! Property 'bar' does not exist on type 'm3d'. + r.y; // error + ~ +!!! Property 'y' does not exist on type 'm3d'. + } + + module T4 { + declare class m3d { foo(): void; static bar(); } + module m3d { export var y = 2; } + var r = new m3d(); + r.foo(); + r.bar(); // error + ~~~ +!!! Property 'bar' does not exist on type 'm3d'. + r.y; // error + ~ +!!! Property 'y' does not exist on type 'm3d'. + } + + module m3d { export var y = 2; } + declare class m3d { constructor(foo); foo(): void; static bar(); } + var r = new m3d(); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + declare class m4d extends m3d { } + var r2 = new m4d(); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/cloduleTest2.js b/tests/baselines/reference/cloduleTest2.js new file mode 100644 index 0000000000000..f2097ca9338bd --- /dev/null +++ b/tests/baselines/reference/cloduleTest2.js @@ -0,0 +1,83 @@ +//// [cloduleTest2.ts] +module T1 { + module m3d { export var y = 2; } + declare class m3d { constructor(foo); foo(): void ; static bar(); } + var r = new m3d(); // error +} + +module T2 { + declare class m3d { constructor(foo); foo(): void; static bar(); } + module m3d { export var y = 2; } + var r = new m3d(); // error +} + +module T3 { + module m3d { export var y = 2; } + declare class m3d { foo(): void; static bar(); } + var r = new m3d(); + r.foo(); + r.bar(); // error + r.y; // error +} + +module T4 { + declare class m3d { foo(): void; static bar(); } + module m3d { export var y = 2; } + var r = new m3d(); + r.foo(); + r.bar(); // error + r.y; // error +} + +module m3d { export var y = 2; } +declare class m3d { constructor(foo); foo(): void; static bar(); } +var r = new m3d(); // error + +declare class m4d extends m3d { } +var r2 = new m4d(); // error + +//// [cloduleTest2.js] +var T1; +(function (T1) { + var m3d; + (function (m3d) { + m3d.y = 2; + })(m3d || (m3d = {})); + var r = new m3d(); +})(T1 || (T1 = {})); +var T2; +(function (T2) { + var m3d; + (function (m3d) { + m3d.y = 2; + })(m3d || (m3d = {})); + var r = new m3d(); +})(T2 || (T2 = {})); +var T3; +(function (T3) { + var m3d; + (function (m3d) { + m3d.y = 2; + })(m3d || (m3d = {})); + var r = new m3d(); + r.foo(); + r.bar(); + r.y; +})(T3 || (T3 = {})); +var T4; +(function (T4) { + var m3d; + (function (m3d) { + m3d.y = 2; + })(m3d || (m3d = {})); + var r = new m3d(); + r.foo(); + r.bar(); + r.y; +})(T4 || (T4 = {})); +var m3d; +(function (m3d) { + m3d.y = 2; +})(m3d || (m3d = {})); +var r = new m3d(); +var r2 = new m4d(); diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt new file mode 100644 index 0000000000000..d4c17e19bd198 --- /dev/null +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/cloduleWithDuplicateMember1.ts (5 errors) ==== + class C { + get x() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return ''; + } + static foo() { } + } + + module C { + export var x = 1; + ~ +!!! Duplicate identifier 'x'. + } + module C { + export function foo() { } + ~~~ +!!! Duplicate identifier 'foo'. + export function x() { } + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt new file mode 100644 index 0000000000000..1eca71ea42843 --- /dev/null +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (3 errors) ==== + class C { + set x(y) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set y(z) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + module C { + export var x = 1; + } + module C { + export function x() { } + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.js b/tests/baselines/reference/cloduleWithRecursiveReference.js new file mode 100644 index 0000000000000..783433ee2b8f8 --- /dev/null +++ b/tests/baselines/reference/cloduleWithRecursiveReference.js @@ -0,0 +1,23 @@ +//// [cloduleWithRecursiveReference.ts] +module M +{ + export class C { } + export module C { + export var C = M.C + } +} + +//// [cloduleWithRecursiveReference.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; + (function (C) { + C.C = M.C; + })(M.C || (M.C = {})); + var C = M.C; +})(M || (M = {})); diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt new file mode 100644 index 0000000000000..8ee9d5817a047 --- /dev/null +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/clodulesDerivedClasses.ts (1 errors) ==== + class Shape { + id: number; + } + + module Shape.Utils { + export function convert(): Shape { return null;} + } + + class Path extends Shape { + ~~~~ +!!! Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': +!!! Types of property 'Utils' are incompatible: +!!! Type 'typeof Utils' is not assignable to type 'typeof Utils': +!!! Property 'convert' is missing in type 'typeof Utils'. + name: string; + + } + + module Path.Utils { + export function convert2(): Path { + return null; + } + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js new file mode 100644 index 0000000000000..ada2d7475cd4d --- /dev/null +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -0,0 +1,63 @@ +//// [clodulesDerivedClasses.ts] +class Shape { + id: number; +} + +module Shape.Utils { + export function convert(): Shape { return null;} +} + +class Path extends Shape { + name: string; + +} + +module Path.Utils { + export function convert2(): Path { + return null; + } +} + + + + + +//// [clodulesDerivedClasses.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Shape = (function () { + function Shape() { + } + return Shape; +})(); +var Shape; +(function (Shape) { + (function (Utils) { + function convert() { + return null; + } + Utils.convert = convert; + })(Shape.Utils || (Shape.Utils = {})); + var Utils = Shape.Utils; +})(Shape || (Shape = {})); +var Path = (function (_super) { + __extends(Path, _super); + function Path() { + _super.apply(this, arguments); + } + return Path; +})(Shape); +var Path; +(function (Path) { + (function (Utils) { + function convert2() { + return null; + } + Utils.convert2 = convert2; + })(Path.Utils || (Path.Utils = {})); + var Utils = Path.Utils; +})(Path || (Path = {})); diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt b/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt new file mode 100644 index 0000000000000..958ff48235ca8 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/collisionArgumentsArrowFunctions.ts (2 errors) ==== + var f1 = (i: number, ...arguments) => { //arguments is error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + var f12 = (arguments: number, ...rest) => { //arguments is error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + var f1NoError = (arguments: number) => { // no error + var arguments = 10; // no error + } + + var f2 = (...restParameters) => { + var arguments = 10; // No Error + } + var f2NoError = () => { + var arguments = 10; // no error + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions.js b/tests/baselines/reference/collisionArgumentsArrowFunctions.js new file mode 100644 index 0000000000000..ba2777f47e2b4 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions.js @@ -0,0 +1,46 @@ +//// [collisionArgumentsArrowFunctions.ts] +var f1 = (i: number, ...arguments) => { //arguments is error + var arguments: any[]; // no error +} +var f12 = (arguments: number, ...rest) => { //arguments is error + var arguments = 10; // no error +} +var f1NoError = (arguments: number) => { // no error + var arguments = 10; // no error +} + +var f2 = (...restParameters) => { + var arguments = 10; // No Error +} +var f2NoError = () => { + var arguments = 10; // no error +} + +//// [collisionArgumentsArrowFunctions.js] +var f1 = function (i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; +}; +var f12 = function (arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments = 10; +}; +var f1NoError = function (arguments) { + var arguments = 10; +}; +var f2 = function () { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var arguments = 10; +}; +var f2NoError = function () { + var arguments = 10; +}; diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt new file mode 100644 index 0000000000000..bff94980b7213 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.errors.txt @@ -0,0 +1,97 @@ +==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (5 errors) ==== + // Constructors + class c1 { + constructor(i: number, ...arguments) { // error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + } + class c12 { + constructor(arguments: number, ...rest) { // error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + } + class c1NoError { + constructor(arguments: number) { // no error + var arguments = 10; // no error + } + } + + class c2 { + constructor(...restParameters) { + var arguments = 10; // no error + } + } + class c2NoError { + constructor() { + var arguments = 10; // no error + } + } + + class c3 { + constructor(public arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + } + class c3NoError { + constructor(public arguments: number) { // no error + var arguments = 10; // no error + } + } + + declare class c4 { + constructor(i: number, ...arguments); // No error - no code gen + } + declare class c42 { + constructor(arguments: number, ...rest); // No error - no code gen + } + declare class c4NoError { + constructor(arguments: number); // no error + } + + class c5 { + constructor(i: number, ...arguments); // no codegen no error + constructor(i: string, ...arguments); // no codegen no error + constructor(i: any, ...arguments) { // error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + } + + class c52 { + constructor(arguments: number, ...rest); // no codegen no error + constructor(arguments: string, ...rest); // no codegen no error + constructor(arguments: any, ...rest) { // error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any; // no error + } + } + + class c5NoError { + constructor(arguments: number); // no error + constructor(arguments: string); // no error + constructor(arguments: any) { // no error + var arguments: any; // no error + } + } + + declare class c6 { + constructor(i: number, ...arguments); // no codegen no error + constructor(i: string, ...arguments); // no codegen no error + } + declare class c62 { + constructor(arguments: number, ...rest); // no codegen no error + constructor(arguments: string, ...rest); // no codegen no error + } + + declare class c6NoError { + constructor(arguments: number); // no error + constructor(arguments: string); // no error + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.js b/tests/baselines/reference/collisionArgumentsClassConstructor.js new file mode 100644 index 0000000000000..51c3f42a53d4b --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.js @@ -0,0 +1,175 @@ +//// [collisionArgumentsClassConstructor.ts] +// Constructors +class c1 { + constructor(i: number, ...arguments) { // error + var arguments: any[]; // no error + } +} +class c12 { + constructor(arguments: number, ...rest) { // error + var arguments = 10; // no error + } +} +class c1NoError { + constructor(arguments: number) { // no error + var arguments = 10; // no error + } +} + +class c2 { + constructor(...restParameters) { + var arguments = 10; // no error + } +} +class c2NoError { + constructor() { + var arguments = 10; // no error + } +} + +class c3 { + constructor(public arguments: number, ...restParameters) { //arguments is error + var arguments = 10; // no error + } +} +class c3NoError { + constructor(public arguments: number) { // no error + var arguments = 10; // no error + } +} + +declare class c4 { + constructor(i: number, ...arguments); // No error - no code gen +} +declare class c42 { + constructor(arguments: number, ...rest); // No error - no code gen +} +declare class c4NoError { + constructor(arguments: number); // no error +} + +class c5 { + constructor(i: number, ...arguments); // no codegen no error + constructor(i: string, ...arguments); // no codegen no error + constructor(i: any, ...arguments) { // error + var arguments: any[]; // no error + } +} + +class c52 { + constructor(arguments: number, ...rest); // no codegen no error + constructor(arguments: string, ...rest); // no codegen no error + constructor(arguments: any, ...rest) { // error + var arguments: any; // no error + } +} + +class c5NoError { + constructor(arguments: number); // no error + constructor(arguments: string); // no error + constructor(arguments: any) { // no error + var arguments: any; // no error + } +} + +declare class c6 { + constructor(i: number, ...arguments); // no codegen no error + constructor(i: string, ...arguments); // no codegen no error +} +declare class c62 { + constructor(arguments: number, ...rest); // no codegen no error + constructor(arguments: string, ...rest); // no codegen no error +} + +declare class c6NoError { + constructor(arguments: number); // no error + constructor(arguments: string); // no error +} + +//// [collisionArgumentsClassConstructor.js] +var c1 = (function () { + function c1(i, arguments) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + } + return c1; +})(); +var c12 = (function () { + function c12(arguments, rest) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments = 10; + } + return c12; +})(); +var c1NoError = (function () { + function c1NoError(arguments) { + var arguments = 10; + } + return c1NoError; +})(); +var c2 = (function () { + function c2(restParameters) { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var arguments = 10; + } + return c2; +})(); +var c2NoError = (function () { + function c2NoError() { + var arguments = 10; + } + return c2NoError; +})(); +var c3 = (function () { + function c3(arguments, restParameters) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + this.arguments = arguments; + var arguments = 10; + } + return c3; +})(); +var c3NoError = (function () { + function c3NoError(arguments) { + this.arguments = arguments; + var arguments = 10; + } + return c3NoError; +})(); +var c5 = (function () { + function c5(i, arguments) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + } + return c5; +})(); +var c52 = (function () { + function c52(arguments, rest) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments; + } + return c52; +})(); +var c5NoError = (function () { + function c5NoError(arguments) { + var arguments; + } + return c5NoError; +})(); diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt new file mode 100644 index 0000000000000..57342c1006d69 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsClassMethod.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/collisionArgumentsClassMethod.ts (4 errors) ==== + class c1 { + public foo(i: number, ...arguments) { //arguments is error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + public foo1(arguments: number, ...rest) { //arguments is error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + public fooNoError(arguments: number) { // no error + var arguments = 10; // no error + } + public f4(i: number, ...arguments); // no codegen no error + public f4(i: string, ...arguments); // no codegen no error + public f4(i: any, ...arguments) { // error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + public f41(arguments: number, ...rest); // no codegen no error + public f41(arguments: string, ...rest); // no codegen no error + public f41(arguments: any, ...rest) { // error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any; // no error + } + public f4NoError(arguments: number); // no error + public f4NoError(arguments: string); // no error + public f4NoError(arguments: any) { // no error + var arguments: any; // no error + } + } + + declare class c2 { + public foo(i: number, ...arguments); // No error - no code gen + public foo1(arguments: number, ...rest); // No error - no code gen + public fooNoError(arguments: number); // No error - no code gen + + public f4(i: number, ...arguments); // no codegen no error + public f4(i: string, ...arguments); // no codegen no error + public f41(arguments: number, ...rest); // no codegen no error + public f41(arguments: string, ...rest); // no codegen no error + public f4NoError(arguments: number); // no error + public f4NoError(arguments: string); // no error + } + + class c3 { + public foo(...restParameters) { + var arguments = 10; // no error + } + public fooNoError() { + var arguments = 10; // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.js b/tests/baselines/reference/collisionArgumentsClassMethod.js new file mode 100644 index 0000000000000..0ca983b658799 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsClassMethod.js @@ -0,0 +1,105 @@ +//// [collisionArgumentsClassMethod.ts] +class c1 { + public foo(i: number, ...arguments) { //arguments is error + var arguments: any[]; // no error + } + public foo1(arguments: number, ...rest) { //arguments is error + var arguments = 10; // no error + } + public fooNoError(arguments: number) { // no error + var arguments = 10; // no error + } + public f4(i: number, ...arguments); // no codegen no error + public f4(i: string, ...arguments); // no codegen no error + public f4(i: any, ...arguments) { // error + var arguments: any[]; // no error + } + public f41(arguments: number, ...rest); // no codegen no error + public f41(arguments: string, ...rest); // no codegen no error + public f41(arguments: any, ...rest) { // error + var arguments: any; // no error + } + public f4NoError(arguments: number); // no error + public f4NoError(arguments: string); // no error + public f4NoError(arguments: any) { // no error + var arguments: any; // no error + } +} + +declare class c2 { + public foo(i: number, ...arguments); // No error - no code gen + public foo1(arguments: number, ...rest); // No error - no code gen + public fooNoError(arguments: number); // No error - no code gen + + public f4(i: number, ...arguments); // no codegen no error + public f4(i: string, ...arguments); // no codegen no error + public f41(arguments: number, ...rest); // no codegen no error + public f41(arguments: string, ...rest); // no codegen no error + public f4NoError(arguments: number); // no error + public f4NoError(arguments: string); // no error +} + +class c3 { + public foo(...restParameters) { + var arguments = 10; // no error + } + public fooNoError() { + var arguments = 10; // no error + } +} + +//// [collisionArgumentsClassMethod.js] +var c1 = (function () { + function c1() { + } + c1.prototype.foo = function (i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + }; + c1.prototype.foo1 = function (arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments = 10; + }; + c1.prototype.fooNoError = function (arguments) { + var arguments = 10; + }; + c1.prototype.f4 = function (i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + }; + c1.prototype.f41 = function (arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments; + }; + c1.prototype.f4NoError = function (arguments) { + var arguments; + }; + return c1; +})(); +var c3 = (function () { + function c3() { + } + c3.prototype.foo = function () { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var arguments = 10; + }; + c3.prototype.fooNoError = function () { + var arguments = 10; + }; + return c3; +})(); diff --git a/tests/baselines/reference/collisionArgumentsFunction.errors.txt b/tests/baselines/reference/collisionArgumentsFunction.errors.txt new file mode 100644 index 0000000000000..9d76598113a25 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunction.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/collisionArgumentsFunction.ts (4 errors) ==== + // Functions + function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + function f12(i: number, ...arguments) { //arguments is error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + function f1NoError(arguments: number) { // no error + var arguments = 10; // no error + } + + declare function f2(i: number, ...arguments); // no error - no code gen + declare function f21(arguments: number, ...rest); // no error - no code gen + declare function f2NoError(arguments: number); // no error + + function f3(...restParameters) { + var arguments = 10; // no error + } + function f3NoError() { + var arguments = 10; // no error + } + + function f4(arguments: number, ...rest); // no codegen no error + function f4(arguments: string, ...rest); // no codegen no error + function f4(arguments: any, ...rest) { // error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any; // No error + } + function f42(i: number, ...arguments); // no codegen no error + function f42(i: string, ...arguments); // no codegen no error + function f42(i: any, ...arguments) { // error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // No error + } + function f4NoError(arguments: number); // no error + function f4NoError(arguments: string); // no error + function f4NoError(arguments: any) { // no error + var arguments: any; // No error + } + + declare function f5(arguments: number, ...rest); // no codegen no error + declare function f5(arguments: string, ...rest); // no codegen no error + declare function f52(i: number, ...arguments); // no codegen no error + declare function f52(i: string, ...arguments); // no codegen no error + declare function f6(arguments: number); // no codegen no error + declare function f6(arguments: string); // no codegen no error \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsFunction.js b/tests/baselines/reference/collisionArgumentsFunction.js new file mode 100644 index 0000000000000..400a375014128 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunction.js @@ -0,0 +1,91 @@ +//// [collisionArgumentsFunction.ts] +// Functions +function f1(arguments: number, ...restParameters) { //arguments is error + var arguments = 10; // no error +} +function f12(i: number, ...arguments) { //arguments is error + var arguments: any[]; // no error +} +function f1NoError(arguments: number) { // no error + var arguments = 10; // no error +} + +declare function f2(i: number, ...arguments); // no error - no code gen +declare function f21(arguments: number, ...rest); // no error - no code gen +declare function f2NoError(arguments: number); // no error + +function f3(...restParameters) { + var arguments = 10; // no error +} +function f3NoError() { + var arguments = 10; // no error +} + +function f4(arguments: number, ...rest); // no codegen no error +function f4(arguments: string, ...rest); // no codegen no error +function f4(arguments: any, ...rest) { // error + var arguments: any; // No error +} +function f42(i: number, ...arguments); // no codegen no error +function f42(i: string, ...arguments); // no codegen no error +function f42(i: any, ...arguments) { // error + var arguments: any[]; // No error +} +function f4NoError(arguments: number); // no error +function f4NoError(arguments: string); // no error +function f4NoError(arguments: any) { // no error + var arguments: any; // No error +} + +declare function f5(arguments: number, ...rest); // no codegen no error +declare function f5(arguments: string, ...rest); // no codegen no error +declare function f52(i: number, ...arguments); // no codegen no error +declare function f52(i: string, ...arguments); // no codegen no error +declare function f6(arguments: number); // no codegen no error +declare function f6(arguments: string); // no codegen no error + +//// [collisionArgumentsFunction.js] +function f1(arguments) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var arguments = 10; +} +function f12(i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; +} +function f1NoError(arguments) { + var arguments = 10; +} +function f3() { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var arguments = 10; +} +function f3NoError() { + var arguments = 10; +} +function f4(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments; +} +function f42(i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; +} +function f4NoError(arguments) { + var arguments; +} diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt b/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt new file mode 100644 index 0000000000000..d4b8bbd9e94a5 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/compiler/collisionArgumentsFunctionExpressions.ts (4 errors) ==== + function foo() { + function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments = 10; // no error + } + function f12(i: number, ...arguments) { //arguments is error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // no error + } + function f1NoError(arguments: number) { // no error + var arguments = 10; // no error + } + + function f3(...restParameters) { + var arguments = 10; // no error + } + function f3NoError() { + var arguments = 10; // no error + } + + function f4(arguments: number, ...rest); // no codegen no error + function f4(arguments: string, ...rest); // no codegen no error + function f4(arguments: any, ...rest) { // error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any; // No error + } + function f42(i: number, ...arguments); // no codegen no error + function f42(i: string, ...arguments); // no codegen no error + function f42(i: any, ...arguments) { // error + ~~~~~~~~~~~~ +!!! Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + var arguments: any[]; // No error + } + function f4NoError(arguments: number); // no error + function f4NoError(arguments: string); // no error + function f4NoError(arguments: any) { // no error + var arguments: any; // No error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions.js b/tests/baselines/reference/collisionArgumentsFunctionExpressions.js new file mode 100644 index 0000000000000..a57be35eab770 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions.js @@ -0,0 +1,83 @@ +//// [collisionArgumentsFunctionExpressions.ts] +function foo() { + function f1(arguments: number, ...restParameters) { //arguments is error + var arguments = 10; // no error + } + function f12(i: number, ...arguments) { //arguments is error + var arguments: any[]; // no error + } + function f1NoError(arguments: number) { // no error + var arguments = 10; // no error + } + + function f3(...restParameters) { + var arguments = 10; // no error + } + function f3NoError() { + var arguments = 10; // no error + } + + function f4(arguments: number, ...rest); // no codegen no error + function f4(arguments: string, ...rest); // no codegen no error + function f4(arguments: any, ...rest) { // error + var arguments: any; // No error + } + function f42(i: number, ...arguments); // no codegen no error + function f42(i: string, ...arguments); // no codegen no error + function f42(i: any, ...arguments) { // error + var arguments: any[]; // No error + } + function f4NoError(arguments: number); // no error + function f4NoError(arguments: string); // no error + function f4NoError(arguments: any) { // no error + var arguments: any; // No error + } +} + +//// [collisionArgumentsFunctionExpressions.js] +function foo() { + function f1(arguments) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var arguments = 10; + } + function f12(i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + } + function f1NoError(arguments) { + var arguments = 10; + } + function f3() { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var arguments = 10; + } + function f3NoError() { + var arguments = 10; + } + function f4(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var arguments; + } + function f42(i) { + var arguments = []; + for (var _i = 1; _i < arguments.length; _i++) { + arguments[_i - 1] = arguments[_i]; + } + var arguments; + } + function f4NoError(arguments) { + var arguments; + } +} diff --git a/tests/baselines/reference/collisionArgumentsInType.js b/tests/baselines/reference/collisionArgumentsInType.js new file mode 100644 index 0000000000000..3047fd05fd6e2 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInType.js @@ -0,0 +1,21 @@ +//// [collisionArgumentsInType.ts] +var v1: (i: number, ...arguments) => void; // no error - no code gen +var v12: (arguments: number, ...restParameters) => void; // no error - no code gen +var v2: { + (arguments: number, ...restParameters); // no error - no code gen + new (arguments: number, ...restParameters); // no error - no code gen + foo(arguments: number, ...restParameters); // no error - no code gen + prop: (arguments: number, ...restParameters) => void; // no error - no code gen +} +var v21: { + (i: number, ...arguments); // no error - no code gen + new (i: number, ...arguments); // no error - no code gen + foo(i: number, ...arguments); // no error - no code gen + prop: (i: number, ...arguments) => void; // no error - no code gen +} + +//// [collisionArgumentsInType.js] +var v1; +var v12; +var v2; +var v21; diff --git a/tests/baselines/reference/collisionArgumentsInterfaceMembers.js b/tests/baselines/reference/collisionArgumentsInterfaceMembers.js new file mode 100644 index 0000000000000..a55e112b60380 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInterfaceMembers.js @@ -0,0 +1,31 @@ +//// [collisionArgumentsInterfaceMembers.ts] +// call +interface i1 { + (i: number, ...arguments); // no error - no code gen +} +interface i12 { + (arguments: number, ...rest); // no error - no code gen +} +interface i1NoError { + (arguments: number); // no error +} + +// new +interface i2 { + new (i: number, ...arguments); // no error - no code gen +} +interface i21 { + new (arguments: number, ...rest); // no error - no code gen +} +interface i2NoError { + new (arguments: number); // no error +} + +// method +interface i3 { + foo(i: number, ...arguments); // no error - no code gen + foo1(arguments: number, ...rest); // no error - no code gen + fooNoError(arguments: number); // no error +} + +//// [collisionArgumentsInterfaceMembers.js] diff --git a/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js new file mode 100644 index 0000000000000..454fddf6fa87c --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js @@ -0,0 +1,12 @@ +//// [collisionCodeGenEnumWithEnumMemberConflict.ts] +enum Color { + Color, + Thing = Color +} + +//// [collisionCodeGenEnumWithEnumMemberConflict.js] +var Color; +(function (Color) { + Color[Color["Color"] = 0] = "Color"; + Color[Color["Thing"] = Color.Color] = "Thing"; +})(Color || (Color = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt new file mode 100644 index 0000000000000..23c7fe49f7343 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt @@ -0,0 +1,56 @@ +==== tests/cases/compiler/collisionCodeGenModuleWithAccessorChildren.ts (5 errors) ==== + module M { + export var x = 3; + class c { + private y; + set Z(M) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + this.y = x; + } + } + } + + module M { + class d { + private y; + set Z(p) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var M = 10; + this.y = x; + } + } + } + + module M { // Shouldnt be _M + class e { + private y; + set M(p) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + this.y = x; + } + } + } + + module M { + class f { + get Z() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var M = 10; + return x; + } + } + } + + module M { // Shouldnt be _M + class e { + get M() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return x; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js new file mode 100644 index 0000000000000..2a83baa479c35 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js @@ -0,0 +1,56 @@ +//// [collisionCodeGenModuleWithConstructorChildren.ts] +module M { + export var x = 3; + class c { + constructor(M, p = x) { + } + } +} + +module M { + class d { + constructor(private M, p = x) { + } + } +} + +module M { + class d2 { + constructor() { + var M = 10; + var p = x; + } + } +} + +//// [collisionCodeGenModuleWithConstructorChildren.js] +var M; +(function (M) { + M.x = 3; + var c = (function () { + function c(M, p) { + if (p === void 0) { p = M.x; } + } + return c; + })(); +})(M || (M = {})); +var M; +(function (M) { + var d = (function () { + function d(M, p) { + if (p === void 0) { p = M.x; } + this.M = M; + } + return d; + })(); +})(M || (M = {})); +var M; +(function (M) { + var d2 = (function () { + function d2() { + var M = 10; + var p = M.x; + } + return d2; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js new file mode 100644 index 0000000000000..0dc8e508d45ca --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js @@ -0,0 +1,17 @@ +//// [collisionCodeGenModuleWithEnumMemberConflict.ts] +module m1 { + enum e { + m1, + m2 = m1 + } +} + +//// [collisionCodeGenModuleWithEnumMemberConflict.js] +var m1; +(function (m1) { + var e; + (function (e) { + e[e["m1"] = 0] = "m1"; + e[e["m2"] = e.m1] = "m2"; + })(e || (e = {})); +})(m1 || (m1 = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js new file mode 100644 index 0000000000000..4eaead87cad48 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js @@ -0,0 +1,44 @@ +//// [collisionCodeGenModuleWithFunctionChildren.ts] +module M { + export var x = 3; + function fn(M, p = x) { } +} + +module M { + function fn2() { + var M; + var p = x; + } +} + +module M { + function fn3() { + function M() { + var p = x; + } + } +} + +//// [collisionCodeGenModuleWithFunctionChildren.js] +var M; +(function (M) { + M.x = 3; + function fn(M, p) { + if (p === void 0) { p = M.x; } + } +})(M || (M = {})); +var M; +(function (M) { + function fn2() { + var M; + var p = M.x; + } +})(M || (M = {})); +var M; +(function (M) { + function fn3() { + function M() { + var p = M.x; + } + } +})(M || (M = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js new file mode 100644 index 0000000000000..79c2b74745e1e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js @@ -0,0 +1,45 @@ +//// [collisionCodeGenModuleWithMemberClassConflict.ts] +module m1 { + export class m1 { + } +} +var foo = new m1.m1(); + +module m2 { + export class m2 { + } + + export class _m2 { + } +} +var foo = new m2.m2(); +var foo = new m2._m2(); + +//// [collisionCodeGenModuleWithMemberClassConflict.js] +var m1; +(function (m1) { + var m1 = (function () { + function m1() { + } + return m1; + })(); + m1.m1 = m1; +})(m1 || (m1 = {})); +var foo = new m1.m1(); +var m2; +(function (m2) { + var m2 = (function () { + function m2() { + } + return m2; + })(); + m2.m2 = m2; + var _m2 = (function () { + function _m2() { + } + return _m2; + })(); + m2._m2 = _m2; +})(m2 || (m2 = {})); +var foo = new m2.m2(); +var foo = new m2._m2(); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js new file mode 100644 index 0000000000000..d511a86d1fe6b --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js @@ -0,0 +1,20 @@ +//// [collisionCodeGenModuleWithMemberInterfaceConflict.ts] +module m1 { + export interface m1 { + } + export class m2 implements m1 { + } +} +var foo = new m1.m2(); + +//// [collisionCodeGenModuleWithMemberInterfaceConflict.js] +var m1; +(function (m1) { + var m2 = (function () { + function m2() { + } + return m2; + })(); + m1.m2 = m2; +})(m1 || (m1 = {})); +var foo = new m1.m2(); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js new file mode 100644 index 0000000000000..b7edd01b85861 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js @@ -0,0 +1,14 @@ +//// [collisionCodeGenModuleWithMemberVariable.ts] +module m1 { + export var m1 = 10; + var b = m1; +} +var foo = m1.m1; + +//// [collisionCodeGenModuleWithMemberVariable.js] +var m1; +(function (m1) { + m1.m1 = 10; + var b = m1.m1; +})(m1 || (m1 = {})); +var foo = m1.m1; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js new file mode 100644 index 0000000000000..14e07ac403988 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js @@ -0,0 +1,82 @@ +//// [collisionCodeGenModuleWithMethodChildren.ts] +module M { + export var x = 3; + class c { + fn(M, p = x) { } + } +} + +module M { + class d { + fn2() { + var M; + var p = x; + } + } +} + +module M { + class e { + fn3() { + function M() { + var p = x; + } + } + } +} + +module M { // Shouldnt bn _M + class f { + M() { + } + } +} + +//// [collisionCodeGenModuleWithMethodChildren.js] +var M; +(function (M) { + M.x = 3; + var c = (function () { + function c() { + } + c.prototype.fn = function (M, p) { + if (p === void 0) { p = M.x; } + }; + return c; + })(); +})(M || (M = {})); +var M; +(function (M) { + var d = (function () { + function d() { + } + d.prototype.fn2 = function () { + var M; + var p = M.x; + }; + return d; + })(); +})(M || (M = {})); +var M; +(function (M) { + var e = (function () { + function e() { + } + e.prototype.fn3 = function () { + function M() { + var p = M.x; + } + }; + return e; + })(); +})(M || (M = {})); +var M; +(function (M) { + var f = (function () { + function f() { + } + f.prototype.M = function () { + }; + return f; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js new file mode 100644 index 0000000000000..6fbefcdc40ef8 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js @@ -0,0 +1,95 @@ +//// [collisionCodeGenModuleWithModuleChildren.ts] +module M { + export var x = 3; + module m1 { + var M = 10; + var p = x; + } +} + +module M { + module m2 { + class M { + } + var p = x; + var p2 = new M(); + } +} + +module M { + module m3 { + function M() { + } + var p = x; + var p2 = M(); + } +} + +module M { // shouldnt be _M + module m3 { + interface M { + } + var p = x; + var p2: M; + } +} + +module M { + module m4 { + module M { + var p = x; + } + } +} + +//// [collisionCodeGenModuleWithModuleChildren.js] +var M; +(function (M) { + M.x = 3; + var m1; + (function (m1) { + var M = 10; + var p = M.x; + })(m1 || (m1 = {})); +})(M || (M = {})); +var M; +(function (M) { + var m2; + (function (m2) { + var M = (function () { + function M() { + } + return M; + })(); + var p = M.x; + var p2 = new M(); + })(m2 || (m2 = {})); +})(M || (M = {})); +var M; +(function (M) { + var m3; + (function (m3) { + function M() { + } + var p = M.x; + var p2 = M(); + })(m3 || (m3 = {})); +})(M || (M = {})); +var M; +(function (M) { + var m3; + (function (m3) { + var p = M.x; + var p2; + })(m3 || (m3 = {})); +})(M || (M = {})); +var M; +(function (M) { + var m4; + (function (m4) { + var M; + (function (M) { + var p = M.x; + })(M || (M = {})); + })(m4 || (m4 = {})); +})(M || (M = {})); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js new file mode 100644 index 0000000000000..e34cbf988c054 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js @@ -0,0 +1,80 @@ +//// [collisionCodeGenModuleWithModuleReopening.ts] +module m1 { + export class m1 { + } +} +var foo = new m1.m1(); +module m1 { + export class c1 { + } + var b = new c1(); + var c = new m1(); +} +var foo2 = new m1.c1(); + +module m2 { + export class c1 { + } + export var b10 = 10; + var x = new c1(); +} +var foo3 = new m2.c1(); +module m2 { + export class m2 { + } + var b = new m2(); + var d = b10; + var c = new c1(); +} +var foo3 = new m2.c1(); +var foo2 = new m2.m2(); + +//// [collisionCodeGenModuleWithModuleReopening.js] +var m1; +(function (m1) { + var m1 = (function () { + function m1() { + } + return m1; + })(); + m1.m1 = m1; +})(m1 || (m1 = {})); +var foo = new m1.m1(); +var m1; +(function (m1) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m1.c1 = c1; + var b = new c1(); + var c = new m1.m1(); +})(m1 || (m1 = {})); +var foo2 = new m1.c1(); +var m2; +(function (m2) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m2.c1 = c1; + m2.b10 = 10; + var x = new c1(); +})(m2 || (m2 = {})); +var foo3 = new m2.c1(); +var m2; +(function (m2) { + var m2 = (function () { + function m2() { + } + return m2; + })(); + m2.m2 = m2; + var b = new m2(); + var d = m2.b10; + var c = new m2.c1(); +})(m2 || (m2 = {})); +var foo3 = new m2.c1(); +var foo2 = new m2.m2(); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js new file mode 100644 index 0000000000000..27d665149643c --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js @@ -0,0 +1,27 @@ +//// [collisionCodeGenModuleWithPrivateMember.ts] +module m1 { + class m1 { + } + var x = new m1(); + export class c1 { + } +} +var foo = new m1.c1(); + +//// [collisionCodeGenModuleWithPrivateMember.js] +var m1; +(function (m1) { + var m1 = (function () { + function m1() { + } + return m1; + })(); + var x = new m1(); + var c1 = (function () { + function c1() { + } + return c1; + })(); + m1.c1 = c1; +})(m1 || (m1 = {})); +var foo = new m1.c1(); diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js new file mode 100644 index 0000000000000..68a70f6bc35b4 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js @@ -0,0 +1,22 @@ +//// [collisionCodeGenModuleWithUnicodeNames.ts] +module 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { + export class 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { + } +} + +var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123(); + + + + +//// [collisionCodeGenModuleWithUnicodeNames.js] +var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; +(function (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123) { + var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = (function () { + function 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123() { + } + return 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; + })(); + 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; +})(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 || (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = {})); +var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123(); diff --git a/tests/baselines/reference/collisionExportsRequireAndAlias.js b/tests/baselines/reference/collisionExportsRequireAndAlias.js new file mode 100644 index 0000000000000..938bf77428d3f --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAlias.js @@ -0,0 +1,22 @@ +//// [collisionExportsRequireAndAlias.ts] +// TODO: re-enable, fails when run in the browser with full compiler suite, but not when run alone + +////@module: amd +//// @Filename: collisionExportsRequireAndAlias_file1.ts +//export function bar() { +//} + +//// @Filename: collisionExportsRequireAndAlias_file3333.ts +//export function bar2() { +//} +//// @Filename: collisionExportsRequireAndAlias_file2.ts +//import require = require('collisionExportsRequireAndAlias_file1'); // Error +//import exports = require('collisionExportsRequireAndAlias_file3333'); // Error +//export function foo() { +// require.bar(); +//} +//export function foo2() { +// exports.bar2(); +//} + +//// [collisionExportsRequireAndAlias.js] diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.js b/tests/baselines/reference/collisionExportsRequireAndClass.js new file mode 100644 index 0000000000000..7ec2975f918a3 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndClass.js @@ -0,0 +1,22 @@ +//// [collisionExportsRequireAndClass.ts] +export class require { +} +export class exports { +} + + +//// [collisionExportsRequireAndClass.js] +define(["require", "exports"], function (require, exports) { + var require = (function () { + function require() { + } + return require; + })(); + exports.require = require; + var exports = (function () { + function exports() { + } + return exports; + })(); + exports.exports = exports; +}); diff --git a/tests/baselines/reference/collisionExportsRequireAndEnum.js b/tests/baselines/reference/collisionExportsRequireAndEnum.js new file mode 100644 index 0000000000000..f495b534805c8 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndEnum.js @@ -0,0 +1,23 @@ +//// [collisionExportsRequireAndEnum.ts] +export enum require { // Error + _thisVal1, + _thisVal2, +} +export enum exports { // Error + _thisVal1, + _thisVal2, +} + +//// [collisionExportsRequireAndEnum.js] +define(["require", "exports"], function (require, exports) { + (function (require) { + require[require["_thisVal1"] = 0] = "_thisVal1"; + require[require["_thisVal2"] = 1] = "_thisVal2"; + })(exports.require || (exports.require = {})); + var require = exports.require; + (function (exports) { + exports[exports["_thisVal1"] = 0] = "_thisVal1"; + exports[exports["_thisVal2"] = 1] = "_thisVal2"; + })(exports.exports || (exports.exports = {})); + var exports = exports.exports; +}); diff --git a/tests/baselines/reference/collisionExportsRequireAndFunction.js b/tests/baselines/reference/collisionExportsRequireAndFunction.js new file mode 100644 index 0000000000000..a7d4ca2492e4f --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndFunction.js @@ -0,0 +1,20 @@ +//// [collisionExportsRequireAndFunction.ts] +export function exports() { + return 1; +} +export function require() { + return "require"; +} + + +//// [collisionExportsRequireAndFunction.js] +define(["require", "exports"], function (require, exports) { + function exports() { + return 1; + } + exports.exports = exports; + function require() { + return "require"; + } + exports.require = require; +}); diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.js b/tests/baselines/reference/collisionExportsRequireAndModule.js new file mode 100644 index 0000000000000..88e53a922b017 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndModule.js @@ -0,0 +1,49 @@ +//// [collisionExportsRequireAndModule.ts] +export module require { + export interface I { + } + export class C { + } +} +export function foo(): require.I { + return null; +} +export module exports { + export interface I { + } + export class C { + } +} +export function foo2(): exports.I { + return null; +} + +//// [collisionExportsRequireAndModule.js] +define(["require", "exports"], function (require, exports) { + (function (require) { + var C = (function () { + function C() { + } + return C; + })(); + require.C = C; + })(exports.require || (exports.require = {})); + var require = exports.require; + function foo() { + return null; + } + exports.foo = foo; + (function (exports) { + var C = (function () { + function C() { + } + return C; + })(); + exports.C = C; + })(exports.exports || (exports.exports = {})); + var exports = exports.exports; + function foo2() { + return null; + } + exports.foo2 = foo2; +}); diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.js b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.js new file mode 100644 index 0000000000000..7961015b30b54 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.js @@ -0,0 +1,27 @@ +//// [collisionExportsRequireAndUninstantiatedModule.ts] +export module require { // no error + export interface I { + } +} +export function foo(): require.I { + return null; +} +export module exports { // no error + export interface I { + } +} +export function foo2(): exports.I { + return null; +} + +//// [collisionExportsRequireAndUninstantiatedModule.js] +define(["require", "exports"], function (require, exports) { + function foo() { + return null; + } + exports.foo = foo; + function foo2() { + return null; + } + exports.foo2 = foo2; +}); diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.js b/tests/baselines/reference/collisionExportsRequireAndVar.js new file mode 100644 index 0000000000000..a760403856317 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndVar.js @@ -0,0 +1,15 @@ +//// [collisionExportsRequireAndVar.ts] +export function foo() { +} +var exports = 1; +var require = "require"; + + +//// [collisionExportsRequireAndVar.js] +define(["require", "exports"], function (require, exports) { + function foo() { + } + exports.foo = foo; + var exports = 1; + var require = "require"; +}); diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt b/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt new file mode 100644 index 0000000000000..223565f664b4c --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/collisionRestParameterArrowFunctions.ts (1 errors) ==== + var f1 = (_i: number, ...restParameters) => { //_i is error + ~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + var f1NoError = (_i: number) => { // no error + var _i = 10; // no error + } + + var f2 = (...restParameters) => { + var _i = 10; // No Error + } + var f2NoError = () => { + var _i = 10; // no error + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.js b/tests/baselines/reference/collisionRestParameterArrowFunctions.js new file mode 100644 index 0000000000000..d23ef5c1418be --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.js @@ -0,0 +1,36 @@ +//// [collisionRestParameterArrowFunctions.ts] +var f1 = (_i: number, ...restParameters) => { //_i is error + var _i = 10; // no error +} +var f1NoError = (_i: number) => { // no error + var _i = 10; // no error +} + +var f2 = (...restParameters) => { + var _i = 10; // No Error +} +var f2NoError = () => { + var _i = 10; // no error +} + +//// [collisionRestParameterArrowFunctions.js] +var f1 = function (_i) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var _i = 10; +}; +var f1NoError = function (_i) { + var _i = 10; +}; +var f2 = function () { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var _i = 10; +}; +var f2NoError = function () { + var _i = 10; +}; diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt b/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt new file mode 100644 index 0000000000000..d64474d412b9b --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.errors.txt @@ -0,0 +1,73 @@ +==== tests/cases/compiler/collisionRestParameterClassConstructor.ts (3 errors) ==== + // Constructors + class c1 { + constructor(_i: number, ...restParameters) { //_i is error + ~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + } + class c1NoError { + constructor(_i: number) { // no error + var _i = 10; // no error + } + } + + class c2 { + constructor(...restParameters) { + var _i = 10; // no error + } + } + class c2NoError { + constructor() { + var _i = 10; // no error + } + } + + class c3 { + constructor(public _i: number, ...restParameters) { //_i is error + ~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + } + class c3NoError { + constructor(public _i: number) { // no error + var _i = 10; // no error + } + } + + declare class c4 { + constructor(_i: number, ...restParameters); // No error - no code gen + } + declare class c4NoError { + constructor(_i: number); // no error + } + + class c5 { + constructor(_i: number, ...rest); // no codegen no error + constructor(_i: string, ...rest); // no codegen no error + constructor(_i: any, ...rest) { // error + ~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i: any; // no error + } + } + + class c5NoError { + constructor(_i: number); // no error + constructor(_i: string); // no error + constructor(_i: any) { // no error + var _i: any; // no error + } + } + + declare class c6 { + constructor(_i: number, ...rest); // no codegen no error + constructor(_i: string, ...rest); // no codegen no error + } + + declare class c6NoError { + constructor(_i: number); // no error + constructor(_i: string); // no error + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.js b/tests/baselines/reference/collisionRestParameterClassConstructor.js new file mode 100644 index 0000000000000..5b62d311c7c5a --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.js @@ -0,0 +1,135 @@ +//// [collisionRestParameterClassConstructor.ts] +// Constructors +class c1 { + constructor(_i: number, ...restParameters) { //_i is error + var _i = 10; // no error + } +} +class c1NoError { + constructor(_i: number) { // no error + var _i = 10; // no error + } +} + +class c2 { + constructor(...restParameters) { + var _i = 10; // no error + } +} +class c2NoError { + constructor() { + var _i = 10; // no error + } +} + +class c3 { + constructor(public _i: number, ...restParameters) { //_i is error + var _i = 10; // no error + } +} +class c3NoError { + constructor(public _i: number) { // no error + var _i = 10; // no error + } +} + +declare class c4 { + constructor(_i: number, ...restParameters); // No error - no code gen +} +declare class c4NoError { + constructor(_i: number); // no error +} + +class c5 { + constructor(_i: number, ...rest); // no codegen no error + constructor(_i: string, ...rest); // no codegen no error + constructor(_i: any, ...rest) { // error + var _i: any; // no error + } +} + +class c5NoError { + constructor(_i: number); // no error + constructor(_i: string); // no error + constructor(_i: any) { // no error + var _i: any; // no error + } +} + +declare class c6 { + constructor(_i: number, ...rest); // no codegen no error + constructor(_i: string, ...rest); // no codegen no error +} + +declare class c6NoError { + constructor(_i: number); // no error + constructor(_i: string); // no error +} + +//// [collisionRestParameterClassConstructor.js] +var c1 = (function () { + function c1(_i, restParameters) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var _i = 10; + } + return c1; +})(); +var c1NoError = (function () { + function c1NoError(_i) { + var _i = 10; + } + return c1NoError; +})(); +var c2 = (function () { + function c2(restParameters) { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var _i = 10; + } + return c2; +})(); +var c2NoError = (function () { + function c2NoError() { + var _i = 10; + } + return c2NoError; +})(); +var c3 = (function () { + function c3(_i, restParameters) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + this._i = _i; + var _i = 10; + } + return c3; +})(); +var c3NoError = (function () { + function c3NoError(_i) { + this._i = _i; + var _i = 10; + } + return c3NoError; +})(); +var c5 = (function () { + function c5(_i, rest) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var _i; + } + return c5; +})(); +var c5NoError = (function () { + function c5NoError(_i) { + var _i; + } + return c5NoError; +})(); diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt b/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt new file mode 100644 index 0000000000000..789901bc54eca --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassMethod.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/compiler/collisionRestParameterClassMethod.ts (2 errors) ==== + class c1 { + public foo(_i: number, ...restParameters) { //_i is error + ~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + public fooNoError(_i: number) { // no error + var _i = 10; // no error + } + public f4(_i: number, ...rest); // no codegen no error + public f4(_i: string, ...rest); // no codegen no error + public f4(_i: any, ...rest) { // error + ~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i: any; // no error + } + + public f4NoError(_i: number); // no error + public f4NoError(_i: string); // no error + public f4NoError(_i: any) { // no error + var _i: any; // no error + } + } + + declare class c2 { + public foo(_i: number, ...restParameters); // No error - no code gen + public fooNoError(_i: number); // no error + + public f4(_i: number, ...rest); // no codegen no error + public f4(_i: string, ...rest); // no codegen no error + public f4NoError(_i: number); // no error + public f4NoError(_i: string); // no error + } + + class c3 { + public foo(...restParameters) { + var _i = 10; // no error + } + public fooNoError() { + var _i = 10; // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.js b/tests/baselines/reference/collisionRestParameterClassMethod.js new file mode 100644 index 0000000000000..f5f4978472e45 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassMethod.js @@ -0,0 +1,81 @@ +//// [collisionRestParameterClassMethod.ts] +class c1 { + public foo(_i: number, ...restParameters) { //_i is error + var _i = 10; // no error + } + public fooNoError(_i: number) { // no error + var _i = 10; // no error + } + public f4(_i: number, ...rest); // no codegen no error + public f4(_i: string, ...rest); // no codegen no error + public f4(_i: any, ...rest) { // error + var _i: any; // no error + } + + public f4NoError(_i: number); // no error + public f4NoError(_i: string); // no error + public f4NoError(_i: any) { // no error + var _i: any; // no error + } +} + +declare class c2 { + public foo(_i: number, ...restParameters); // No error - no code gen + public fooNoError(_i: number); // no error + + public f4(_i: number, ...rest); // no codegen no error + public f4(_i: string, ...rest); // no codegen no error + public f4NoError(_i: number); // no error + public f4NoError(_i: string); // no error +} + +class c3 { + public foo(...restParameters) { + var _i = 10; // no error + } + public fooNoError() { + var _i = 10; // no error + } +} + +//// [collisionRestParameterClassMethod.js] +var c1 = (function () { + function c1() { + } + c1.prototype.foo = function (_i) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var _i = 10; + }; + c1.prototype.fooNoError = function (_i) { + var _i = 10; + }; + c1.prototype.f4 = function (_i) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var _i; + }; + c1.prototype.f4NoError = function (_i) { + var _i; + }; + return c1; +})(); +var c3 = (function () { + function c3() { + } + c3.prototype.foo = function () { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var _i = 10; + }; + c3.prototype.fooNoError = function () { + var _i = 10; + }; + return c3; +})(); diff --git a/tests/baselines/reference/collisionRestParameterFunction.errors.txt b/tests/baselines/reference/collisionRestParameterFunction.errors.txt new file mode 100644 index 0000000000000..3b3cb2a66ae8a --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunction.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/collisionRestParameterFunction.ts (2 errors) ==== + // Functions + function f1(_i: number, ...restParameters) { //_i is error + ~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + function f1NoError(_i: number) { // no error + var _i = 10; // no error + } + + declare function f2(_i: number, ...restParameters); // no error - no code gen + declare function f2NoError(_i: number); // no error + + function f3(...restParameters) { + var _i = 10; // no error + } + function f3NoError() { + var _i = 10; // no error + } + + function f4(_i: number, ...rest); // no codegen no error + function f4(_i: string, ...rest); // no codegen no error + function f4(_i: any, ...rest) { // error + ~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + } + + function f4NoError(_i: number); // no error + function f4NoError(_i: string); // no error + function f4NoError(_i: any) { // no error + } + + declare function f5(_i: number, ...rest); // no codegen no error + declare function f5(_i: string, ...rest); // no codegen no error + + declare function f6(_i: number); // no codegen no error + declare function f6(_i: string); // no codegen no error \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterFunction.js b/tests/baselines/reference/collisionRestParameterFunction.js new file mode 100644 index 0000000000000..7e575778f0378 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunction.js @@ -0,0 +1,64 @@ +//// [collisionRestParameterFunction.ts] +// Functions +function f1(_i: number, ...restParameters) { //_i is error + var _i = 10; // no error +} +function f1NoError(_i: number) { // no error + var _i = 10; // no error +} + +declare function f2(_i: number, ...restParameters); // no error - no code gen +declare function f2NoError(_i: number); // no error + +function f3(...restParameters) { + var _i = 10; // no error +} +function f3NoError() { + var _i = 10; // no error +} + +function f4(_i: number, ...rest); // no codegen no error +function f4(_i: string, ...rest); // no codegen no error +function f4(_i: any, ...rest) { // error +} + +function f4NoError(_i: number); // no error +function f4NoError(_i: string); // no error +function f4NoError(_i: any) { // no error +} + +declare function f5(_i: number, ...rest); // no codegen no error +declare function f5(_i: string, ...rest); // no codegen no error + +declare function f6(_i: number); // no codegen no error +declare function f6(_i: string); // no codegen no error + +//// [collisionRestParameterFunction.js] +function f1(_i) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var _i = 10; +} +function f1NoError(_i) { + var _i = 10; +} +function f3() { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var _i = 10; +} +function f3NoError() { + var _i = 10; +} +function f4(_i) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} +function f4NoError(_i) { +} diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt b/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt new file mode 100644 index 0000000000000..102693b2fcc79 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/collisionRestParameterFunctionExpressions.ts (2 errors) ==== + function foo() { + function f1(_i: number, ...restParameters) { //_i is error + ~~~~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + var _i = 10; // no error + } + function f1NoError(_i: number) { // no error + var _i = 10; // no error + } + function f3(...restParameters) { + var _i = 10; // no error + } + function f3NoError() { + var _i = 10; // no error + } + + function f4(_i: number, ...rest); // no codegen no error + function f4(_i: string, ...rest); // no codegen no error + function f4(_i: any, ...rest) { // error + ~~~~~~~ +!!! Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter. + } + + function f4NoError(_i: number); // no error + function f4NoError(_i: string); // no error + function f4NoError(_i: any) { // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.js b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js new file mode 100644 index 0000000000000..fa50850ceef45 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js @@ -0,0 +1,57 @@ +//// [collisionRestParameterFunctionExpressions.ts] +function foo() { + function f1(_i: number, ...restParameters) { //_i is error + var _i = 10; // no error + } + function f1NoError(_i: number) { // no error + var _i = 10; // no error + } + function f3(...restParameters) { + var _i = 10; // no error + } + function f3NoError() { + var _i = 10; // no error + } + + function f4(_i: number, ...rest); // no codegen no error + function f4(_i: string, ...rest); // no codegen no error + function f4(_i: any, ...rest) { // error + } + + function f4NoError(_i: number); // no error + function f4NoError(_i: string); // no error + function f4NoError(_i: any) { // no error + } +} + +//// [collisionRestParameterFunctionExpressions.js] +function foo() { + function f1(_i) { + var restParameters = []; + for (var _i = 1; _i < arguments.length; _i++) { + restParameters[_i - 1] = arguments[_i]; + } + var _i = 10; + } + function f1NoError(_i) { + var _i = 10; + } + function f3() { + var restParameters = []; + for (var _i = 0; _i < arguments.length; _i++) { + restParameters[_i - 0] = arguments[_i]; + } + var _i = 10; + } + function f3NoError() { + var _i = 10; + } + function f4(_i) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + } + function f4NoError(_i) { + } +} diff --git a/tests/baselines/reference/collisionRestParameterInType.js b/tests/baselines/reference/collisionRestParameterInType.js new file mode 100644 index 0000000000000..3910cbc490d7a --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInType.js @@ -0,0 +1,12 @@ +//// [collisionRestParameterInType.ts] +var v1: (_i: number, ...restParameters) => void; // no error - no code gen +var v2: { + (_i: number, ...restParameters); // no error - no code gen + new (_i: number, ...restParameters); // no error - no code gen + foo(_i: number, ...restParameters); // no error - no code gen + prop: (_i: number, ...restParameters) => void; // no error - no code gen +} + +//// [collisionRestParameterInType.js] +var v1; +var v2; diff --git a/tests/baselines/reference/collisionRestParameterInterfaceMembers.js b/tests/baselines/reference/collisionRestParameterInterfaceMembers.js new file mode 100644 index 0000000000000..044ef871bf384 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInterfaceMembers.js @@ -0,0 +1,24 @@ +//// [collisionRestParameterInterfaceMembers.ts] +// call +interface i1 { + (_i: number, ...restParameters); // no error - no code gen +} +interface i1NoError { + (_i: number); // no error +} + +// new +interface i2 { + new (_i: number, ...restParameters); // no error - no code gen +} +interface i2NoError { + new (_i: number); // no error +} + +// method +interface i3 { + foo (_i: number, ...restParameters); // no error - no code gen + fooNoError (_i: number); // no error +} + +//// [collisionRestParameterInterfaceMembers.js] diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt new file mode 100644 index 0000000000000..cf43c5433e7f3 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts (1 errors) ==== + declare var console: { log(msg?: string): void; }; + var _i = "This is what I'd expect to see"; + class Foo { + constructor(...args: any[]) { + console.log(_i); // This should result in error + ~~ +!!! Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter. + } + } + new Foo(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js new file mode 100644 index 0000000000000..39d3d993d20f9 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js @@ -0,0 +1,23 @@ +//// [collisionRestParameterUnderscoreIUsage.ts] +declare var console: { log(msg?: string): void; }; +var _i = "This is what I'd expect to see"; +class Foo { + constructor(...args: any[]) { + console.log(_i); // This should result in error + } +} +new Foo(); + +//// [collisionRestParameterUnderscoreIUsage.js] +var _i = "This is what I'd expect to see"; +var Foo = (function () { + function Foo(args) { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + console.log(_i); + } + return Foo; +})(); +new Foo(); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt new file mode 100644 index 0000000000000..05b000677db7c --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/compiler/collisionSuperAndLocalFunctionInAccessors.ts (10 errors) ==== + function _super() { // No error + } + class Foo { + get prop1(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + function _super() { // No error + } + return 10; + } + set prop1(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + function _super() { // No error + } + } + } + class b extends Foo { + get prop2(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + return 10; + } + set prop2(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + class c extends Foo { + get prop2(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = () => { + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + return 10; + } + set prop2(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = () => { + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt new file mode 100644 index 0000000000000..e6b0a98a4a794 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/collisionSuperAndLocalFunctionInConstructor.ts (2 errors) ==== + function _super() { // No error + } + class Foo { + constructor() { + function _super() { // No error + } + } + } + class b extends Foo { + constructor() { + super(); + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + class c extends Foo { + constructor() { + super(); + var x = () => { + function _super() { // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js new file mode 100644 index 0000000000000..0d6f15cc3749a --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -0,0 +1,62 @@ +//// [collisionSuperAndLocalFunctionInConstructor.ts] +function _super() { // No error +} +class Foo { + constructor() { + function _super() { // No error + } + } +} +class b extends Foo { + constructor() { + super(); + function _super() { // Should be error + } + } +} +class c extends Foo { + constructor() { + super(); + var x = () => { + function _super() { // Should be error + } + } + } +} + +//// [collisionSuperAndLocalFunctionInConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function _super() { +} +var Foo = (function () { + function Foo() { + function _super() { + } + } + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.call(this); + function _super() { + } + } + return b; +})(Foo); +var c = (function (_super) { + __extends(c, _super); + function c() { + _super.call(this); + var x = function () { + function _super() { + } + }; + } + return c; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt new file mode 100644 index 0000000000000..c4ba64b811ccb --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/collisionSuperAndLocalFunctionInMethod.ts (2 errors) ==== + function _super() { // No error + } + class Foo { + x() { + function _super() { // No error + } + } + _super() { // No error + } + } + class b extends Foo { + public foo() { + function _super() { // should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + _super() { // No Error + } + } + class c extends Foo { + public foo() { + var x = () => { + function _super() { // should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + _super() { // No error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js new file mode 100644 index 0000000000000..4e116deb80213 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -0,0 +1,78 @@ +//// [collisionSuperAndLocalFunctionInMethod.ts] +function _super() { // No error +} +class Foo { + x() { + function _super() { // No error + } + } + _super() { // No error + } +} +class b extends Foo { + public foo() { + function _super() { // should be error + } + } + _super() { // No Error + } +} +class c extends Foo { + public foo() { + var x = () => { + function _super() { // should be error + } + } + } + _super() { // No error + } +} + +//// [collisionSuperAndLocalFunctionInMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function _super() { +} +var Foo = (function () { + function Foo() { + } + Foo.prototype.x = function () { + function _super() { + } + }; + Foo.prototype._super = function () { + }; + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.prototype.foo = function () { + function _super() { + } + }; + b.prototype._super = function () { + }; + return b; +})(Foo); +var c = (function (_super) { + __extends(c, _super); + function c() { + _super.apply(this, arguments); + } + c.prototype.foo = function () { + var x = function () { + function _super() { + } + }; + }; + c.prototype._super = function () { + }; + return c; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt new file mode 100644 index 0000000000000..17ffba8834198 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/collisionSuperAndLocalFunctionInProperty.ts (1 errors) ==== + function _super() { // No error + } + class Foo { + public prop1 = { + doStuff: () => { + function _super() { // No error + } + } + } + } + class b extends Foo { + public prop2 = { + doStuff: () => { + function _super() { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js new file mode 100644 index 0000000000000..45a4c704b525c --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -0,0 +1,53 @@ +//// [collisionSuperAndLocalFunctionInProperty.ts] +function _super() { // No error +} +class Foo { + public prop1 = { + doStuff: () => { + function _super() { // No error + } + } + } +} +class b extends Foo { + public prop2 = { + doStuff: () => { + function _super() { // error + } + } + } +} + +//// [collisionSuperAndLocalFunctionInProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function _super() { +} +var Foo = (function () { + function Foo() { + this.prop1 = { + doStuff: function () { + function _super() { + } + } + }; + } + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + this.prop2 = { + doStuff: function () { + function _super() { + } + } + }; + } + return b; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt new file mode 100644 index 0000000000000..927eb55cf59d2 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/collisionSuperAndLocalVarInAccessors.ts (10 errors) ==== + var _super = 10; // No Error + class Foo { + get prop1(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _super = 10; // No error + return 10; + } + set prop1(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _super = 10; // No error + } + } + class b extends Foo { + get prop2(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + return 10; + } + set prop2(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + class c extends Foo { + get prop2(): number { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = () => { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + return 10; + } + set prop2(val: number) { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = () => { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt new file mode 100644 index 0000000000000..0dac3188dd06a --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/collisionSuperAndLocalVarInConstructor.ts (2 errors) ==== + var _super = 10; // No Error + class Foo { + constructor() { + var _super = 10; // No error + } + } + class b extends Foo { + constructor() { + super(); + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + class c extends Foo { + constructor() { + super(); + var x = () => { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js new file mode 100644 index 0000000000000..926b310a83d05 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -0,0 +1,54 @@ +//// [collisionSuperAndLocalVarInConstructor.ts] +var _super = 10; // No Error +class Foo { + constructor() { + var _super = 10; // No error + } +} +class b extends Foo { + constructor() { + super(); + var _super = 10; // Should be error + } +} +class c extends Foo { + constructor() { + super(); + var x = () => { + var _super = 10; // Should be error + } + } +} + +//// [collisionSuperAndLocalVarInConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var _super = 10; +var Foo = (function () { + function Foo() { + var _super = 10; + } + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.call(this); + var _super = 10; + } + return b; +})(Foo); +var c = (function (_super) { + __extends(c, _super); + function c() { + _super.call(this); + var x = function () { + var _super = 10; + }; + } + return c; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt new file mode 100644 index 0000000000000..36435dff1e062 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/collisionSuperAndLocalVarInMethod.ts (2 errors) ==== + var _super = 10; // No Error + class Foo { + x() { + var _super = 10; // No error + } + } + class b extends Foo { + public foo() { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + class c extends Foo { + public foo() { + var x = () => { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js new file mode 100644 index 0000000000000..e99c9235cc6e7 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -0,0 +1,58 @@ +//// [collisionSuperAndLocalVarInMethod.ts] +var _super = 10; // No Error +class Foo { + x() { + var _super = 10; // No error + } +} +class b extends Foo { + public foo() { + var _super = 10; // Should be error + } +} +class c extends Foo { + public foo() { + var x = () => { + var _super = 10; // Should be error + } + } +} + +//// [collisionSuperAndLocalVarInMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var _super = 10; +var Foo = (function () { + function Foo() { + } + Foo.prototype.x = function () { + var _super = 10; + }; + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.prototype.foo = function () { + var _super = 10; + }; + return b; +})(Foo); +var c = (function (_super) { + __extends(c, _super); + function c() { + _super.apply(this, arguments); + } + c.prototype.foo = function () { + var x = function () { + var _super = 10; + }; + }; + return c; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt new file mode 100644 index 0000000000000..7e21cb4401f44 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/collisionSuperAndLocalVarInProperty.ts (1 errors) ==== + var _super = 10; // No Error + class Foo { + public prop1 = { + doStuff: () => { + var _super = 10; // No error + } + } + public _super = 10; // No error + } + class b extends Foo { + public prop2 = { + doStuff: () => { + var _super = 10; // Should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + public _super = 10; // No error + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js new file mode 100644 index 0000000000000..7e3b8a5c5c3ee --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -0,0 +1,51 @@ +//// [collisionSuperAndLocalVarInProperty.ts] +var _super = 10; // No Error +class Foo { + public prop1 = { + doStuff: () => { + var _super = 10; // No error + } + } + public _super = 10; // No error +} +class b extends Foo { + public prop2 = { + doStuff: () => { + var _super = 10; // Should be error + } + } + public _super = 10; // No error +} + +//// [collisionSuperAndLocalVarInProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var _super = 10; +var Foo = (function () { + function Foo() { + this.prop1 = { + doStuff: function () { + var _super = 10; + } + }; + this._super = 10; + } + return Foo; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + this.prop2 = { + doStuff: function () { + var _super = 10; + } + }; + this._super = 10; + } + return b; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt b/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt new file mode 100644 index 0000000000000..74fdc3ea68edf --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndNameResolution.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/collisionSuperAndNameResolution.ts (1 errors) ==== + var console: { + log(message: any); + } + var _super = 10; // No error + class base { + } + class Foo extends base { + x() { + console.log(_super); // Error as this doesnt not resolve to user defined _super + ~~~~~~ +!!! Expression resolves to '_super' that compiler uses to capture base class reference. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js new file mode 100644 index 0000000000000..26633a6006e24 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -0,0 +1,37 @@ +//// [collisionSuperAndNameResolution.ts] +var console: { + log(message: any); +} +var _super = 10; // No error +class base { +} +class Foo extends base { + x() { + console.log(_super); // Error as this doesnt not resolve to user defined _super + } +} + +//// [collisionSuperAndNameResolution.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var console; +var _super = 10; +var base = (function () { + function base() { + } + return base; +})(); +var Foo = (function (_super) { + __extends(Foo, _super); + function Foo() { + _super.apply(this, arguments); + } + Foo.prototype.x = function () { + console.log(_super); + }; + return Foo; +})(base); diff --git a/tests/baselines/reference/collisionSuperAndParameter.errors.txt b/tests/baselines/reference/collisionSuperAndParameter.errors.txt new file mode 100644 index 0000000000000..4c6c0079fcc7d --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndParameter.errors.txt @@ -0,0 +1,81 @@ +==== tests/cases/compiler/collisionSuperAndParameter.ts (9 errors) ==== + class Foo { + a() { + var lamda = (_super: number) => { // No Error + return x => this; // New scope. So should inject new _this capture + } + } + b(_super: number) { // No Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + set c(_super: number) { // No error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + class Foo2 extends Foo { + x() { + var lamda = (_super: number) => { // Error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + return x => this; // New scope. So should inject new _this capture + } + } + y(_super: number) { // Error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + set z(_super: number) { // Error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + public prop3: { + doStuff: (_super: number) => void; // no error - no code gen + } + public prop4 = { + doStuff: (_super: number) => { // should be error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + constructor(_super: number) { // should be error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + } + declare class Foo3 extends Foo { + x(); + y(_super: number); // No error - no code gen + constructor(_super: number); // No error - no code gen + public prop2: { + doStuff: (_super: number) => void; // no error - no code gen + }; + public _super: number; // No error + } + + class Foo4 extends Foo { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(_super: any) { // should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + y(_super: number); // no code gen - no error + y(_super: string); // no code gen - no error + y(_super: any) { // Error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndParameter1.errors.txt b/tests/baselines/reference/collisionSuperAndParameter1.errors.txt new file mode 100644 index 0000000000000..ea3c3d9b42066 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndParameter1.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/collisionSuperAndParameter1.ts (1 errors) ==== + class Foo { + } + + class Foo2 extends Foo { + x() { + var lambda = (_super: number) => { // Error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js new file mode 100644 index 0000000000000..11a4206624a7e --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -0,0 +1,34 @@ +//// [collisionSuperAndParameter1.ts] +class Foo { +} + +class Foo2 extends Foo { + x() { + var lambda = (_super: number) => { // Error + } + } +} + +//// [collisionSuperAndParameter1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Foo2 = (function (_super) { + __extends(Foo2, _super); + function Foo2() { + _super.apply(this, arguments); + } + Foo2.prototype.x = function () { + var lambda = function (_super) { + }; + }; + return Foo2; +})(Foo); diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt new file mode 100644 index 0000000000000..5eed3b86bbcb4 --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts (4 errors) ==== + class a { + } + + class b1 extends a { + constructor(_super: number) { // should be error + ~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + } + + class b2 extends a { + constructor(private _super: number) { // should be error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + } + + class b3 extends a { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(_super: any) { // should be error + ~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + } + + class b4 extends a { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(private _super: any) { // should be error + ~~~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference. + super(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js new file mode 100644 index 0000000000000..fd523d010fb1f --- /dev/null +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -0,0 +1,74 @@ +//// [collisionSuperAndPropertyNameAsConstuctorParameter.ts] +class a { +} + +class b1 extends a { + constructor(_super: number) { // should be error + super(); + } +} + +class b2 extends a { + constructor(private _super: number) { // should be error + super(); + } +} + +class b3 extends a { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(_super: any) { // should be error + super(); + } +} + +class b4 extends a { + constructor(_super: number); // no code gen - no error + constructor(_super: string);// no code gen - no error + constructor(private _super: any) { // should be error + super(); + } +} + +//// [collisionSuperAndPropertyNameAsConstuctorParameter.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b1 = (function (_super) { + __extends(b1, _super); + function b1(_super) { + _super.call(this); + } + return b1; +})(a); +var b2 = (function (_super) { + __extends(b2, _super); + function b2(_super) { + _super.call(this); + this._super = _super; + } + return b2; +})(a); +var b3 = (function (_super) { + __extends(b3, _super); + function b3(_super) { + _super.call(this); + } + return b3; +})(a); +var b4 = (function (_super) { + __extends(b4, _super); + function b4(_super) { + _super.call(this); + this._super = _super; + } + return b4; +})(a); diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js new file mode 100644 index 0000000000000..9ce9dd131a956 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js @@ -0,0 +1,15 @@ +//// [collisionThisExpressionAndAliasInGlobal.ts] +module a { + export var b = 10; +} +var f = () => this; +import _this = a; // Error + +//// [collisionThisExpressionAndAliasInGlobal.js] +var _this = this; +var a; +(function (a) { + a.b = 10; +})(a || (a = {})); +var f = function () { return _this; }; +var _this = a; diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js new file mode 100644 index 0000000000000..10238a55f47f4 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js @@ -0,0 +1,10 @@ +//// [collisionThisExpressionAndAmbientClassInGlobal.ts] +declare class _this { // no error - as no code generation +} +var f = () => this; +var a = new _this(); // Error + +//// [collisionThisExpressionAndAmbientClassInGlobal.js] +var _this = this; +var f = function () { return _this; }; +var a = new _this(); diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js new file mode 100644 index 0000000000000..1aff51e65e244 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js @@ -0,0 +1,9 @@ +//// [collisionThisExpressionAndAmbientVarInGlobal.ts] +declare var _this: number; // no error as no code gen +var f = () => this; +_this = 10; // Error + +//// [collisionThisExpressionAndAmbientVarInGlobal.js] +var _this = this; +var f = function () { return _this; }; +_this = 10; diff --git a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js new file mode 100644 index 0000000000000..ccaa335d80ee3 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js @@ -0,0 +1,13 @@ +//// [collisionThisExpressionAndClassInGlobal.ts] +class _this { +} +var f = () => this; + +//// [collisionThisExpressionAndClassInGlobal.js] +var _this = this; +var _this = (function () { + function _this() { + } + return _this; +})(); +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js new file mode 100644 index 0000000000000..4ab929a387724 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js @@ -0,0 +1,15 @@ +//// [collisionThisExpressionAndEnumInGlobal.ts] +enum _this { // Error + _thisVal1, + _thisVal2, +} +var f = () => this; + +//// [collisionThisExpressionAndEnumInGlobal.js] +var _this = this; +var _this; +(function (_this) { + _this[_this["_thisVal1"] = 0] = "_thisVal1"; + _this[_this["_thisVal2"] = 1] = "_thisVal2"; +})(_this || (_this = {})); +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js new file mode 100644 index 0000000000000..3c6232ba0baa0 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js @@ -0,0 +1,12 @@ +//// [collisionThisExpressionAndFunctionInGlobal.ts] +function _this() { //Error + return 10; +} +var f = () => this; + +//// [collisionThisExpressionAndFunctionInGlobal.js] +var _this = this; +function _this() { + return 10; +} +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt new file mode 100644 index 0000000000000..ae3399f80660b --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts (4 errors) ==== + class class1 { + get a(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } + } + + return 10; + } + set a(val: number) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } + } + + } + } + + class class2 { + get a(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } + + return 10; + } + set a(val: number) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js new file mode 100644 index 0000000000000..d0ed79da53088 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js @@ -0,0 +1,48 @@ +//// [collisionThisExpressionAndLocalVarInConstructor.ts] +class class1 { + constructor() { + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } + } + } +} + +class class2 { + constructor() { + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } + } +} + +//// [collisionThisExpressionAndLocalVarInConstructor.js] +var class1 = (function () { + function class1() { + var _this = this; + var x2 = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + } + return class1; +})(); +var class2 = (function () { + function class2() { + var _this = this; + var _this = 2; + var x2 = { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + } + return class2; +})(); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js new file mode 100644 index 0000000000000..967d01819ec54 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js @@ -0,0 +1,18 @@ +//// [collisionThisExpressionAndLocalVarInFunction.ts] +var console: { + log(val: any); +} +function x() { + var _this = 5; + x => { console.log(this.x); }; +} + +//// [collisionThisExpressionAndLocalVarInFunction.js] +var console; +function x() { + var _this = this; + var _this = 5; + (function (x) { + console.log(_this.x); + }); +} diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js new file mode 100644 index 0000000000000..e8b7a0db7f3cd --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js @@ -0,0 +1,20 @@ +//// [collisionThisExpressionAndLocalVarInLambda.ts] +declare function alert(message?: any): void; + +var x = { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } +} +alert(x.doStuff(x => alert(x))); + +//// [collisionThisExpressionAndLocalVarInLambda.js] +var _this = this; +var x = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } +}; +alert(x.doStuff(function (x) { return alert(x); })); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js new file mode 100644 index 0000000000000..63b536bd8b60b --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js @@ -0,0 +1,44 @@ +//// [collisionThisExpressionAndLocalVarInMethod.ts] +class a { + method1() { + return { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } + } + } + method2() { + var _this = 2; + return { + doStuff: (callback) => () => { + return callback(this); + } + } + } +} + +//// [collisionThisExpressionAndLocalVarInMethod.js] +var a = (function () { + function a() { + } + a.prototype.method1 = function () { + var _this = this; + return { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + }; + a.prototype.method2 = function () { + var _this = this; + var _this = 2; + return { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + }; + return a; +})(); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js new file mode 100644 index 0000000000000..65d181921d5f3 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js @@ -0,0 +1,46 @@ +//// [collisionThisExpressionAndLocalVarInProperty.ts] +class class1 { + public prop1 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(this); + } + } +} + +class class2 { + constructor() { + var _this = 2; + } + public prop1 = { + doStuff: (callback) => () => { + return callback(this); + } + } +} + +//// [collisionThisExpressionAndLocalVarInProperty.js] +var class1 = (function () { + function class1() { + var _this = this; + this.prop1 = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + } + return class1; +})(); +var class2 = (function () { + function class2() { + var _this = this; + this.prop1 = { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + var _this = 2; + } + return class2; +})(); diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js new file mode 100644 index 0000000000000..d502fc5c03a0f --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -0,0 +1,60 @@ +//// [collisionThisExpressionAndLocalVarWithSuperExperssion.ts] +class a { + public foo() { + } +} +class b extends a { + public foo() { + var _this = 10; + var f = () => super.foo(); + } +} +class b2 extends a { + public foo() { + var f = () => { + var _this = 10; + return super.foo() + } + } +} + +//// [collisionThisExpressionAndLocalVarWithSuperExperssion.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + a.prototype.foo = function () { + }; + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.prototype.foo = function () { + var _this = this; + var _this = 10; + var f = function () { return _super.prototype.foo.call(_this); }; + }; + return b; +})(a); +var b2 = (function (_super) { + __extends(b2, _super); + function b2() { + _super.apply(this, arguments); + } + b2.prototype.foo = function () { + var _this = this; + var f = function () { + var _this = 10; + return _super.prototype.foo.call(_this); + }; + }; + return b2; +})(a); diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js new file mode 100644 index 0000000000000..777f141451b40 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js @@ -0,0 +1,18 @@ +//// [collisionThisExpressionAndModuleInGlobal.ts] +module _this { //Error + class c { + } +} +var f = () => this; + +//// [collisionThisExpressionAndModuleInGlobal.js] +var _this = this; +var _this; +(function (_this) { + var c = (function () { + function c() { + } + return c; + })(); +})(_this || (_this = {})); +var f = function () { return _this; }; diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js new file mode 100644 index 0000000000000..969f3eff090bb --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js @@ -0,0 +1,29 @@ +//// [collisionThisExpressionAndNameResolution.ts] +var console : { + log(message: any); +} +class Foo { + x() { + var _this = 10; // Local var. No this capture in x(), so no conflict. + function inner() { + console.log(_this); // Error as this doesnt not resolve to user defined _this + return x => this; // New scope. So should inject new _this capture into function inner + } + } +} + +//// [collisionThisExpressionAndNameResolution.js] +var console; +var Foo = (function () { + function Foo() { + } + Foo.prototype.x = function () { + var _this = 10; + function inner() { + var _this = this; + console.log(_this); + return function (x) { return _this; }; + } + }; + return Foo; +})(); diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.js b/tests/baselines/reference/collisionThisExpressionAndParameter.js new file mode 100644 index 0000000000000..7df383afcdf2b --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.js @@ -0,0 +1,173 @@ +//// [collisionThisExpressionAndParameter.ts] +class Foo { + x() { + var _this = 10; // Local var. No this capture in x(), so no conflict. + function inner(_this: number) { // Error + return x => this; // New scope. So should inject new _this capture into function inner + } + } + y() { + var lamda = (_this: number) => { // Error + return x => this; // New scope. So should inject new _this capture + } + } + z(_this: number) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } + + x1() { + var _this = 10; // Local var. No this capture in x(), so no conflict. + function inner(_this: number) { // No Error + } + } + y1() { + var lamda = (_this: number) => { // No Error + } + } + z1(_this: number) { // No Error + var lambda = () => { + } + } +} +class Foo1 { + constructor(_this: number) { // Error + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } + } +} +declare var console: { + log(msg: any); +} + +function f1(_this: number) { + x => { console.log(this.x); }; +} + +declare class Foo2 { + constructor(_this: number); // no error - no code gen + z(_this: number); // no error - no code gen +} +declare function f2(_this: number); // no error + +class Foo3 { + constructor(_this: string); // no code gen - no error + constructor(_this: number); // no code gen - no error + constructor(_this: any) { // Error + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } + } + + z(_this: string); // no code gen - no error + z(_this: number); // no code gen - no error + z(_this: any) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } +} +declare var console: { + log(msg: any); +} + +function f3(_this: number); // no code gen - no error +function f3(_this: string); // no code gen - no error +function f3(_this: any) { + x => { console.log(this.x); }; +} + +declare class Foo4 { + constructor(_this: string); // no code gen - no error + constructor(_this: number); // no code gen - no error + z(_this: string); // no code gen - no error + z(_this: number); // no code gen - no error +} + +declare function f4(_this: number); // no code gen - no error +declare function f4(_this: string); // no code gen - no error + +//// [collisionThisExpressionAndParameter.js] +var Foo = (function () { + function Foo() { + } + Foo.prototype.x = function () { + var _this = 10; + function inner(_this) { + var _this = this; + return function (x) { return _this; }; + } + }; + Foo.prototype.y = function () { + var _this = this; + var lamda = function (_this) { + return function (x) { return _this; }; + }; + }; + Foo.prototype.z = function (_this) { + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + }; + Foo.prototype.x1 = function () { + var _this = 10; + function inner(_this) { + } + }; + Foo.prototype.y1 = function () { + var lamda = function (_this) { + }; + }; + Foo.prototype.z1 = function (_this) { + var lambda = function () { + }; + }; + return Foo; +})(); +var Foo1 = (function () { + function Foo1(_this) { + var _this = this; + var x2 = { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + } + return Foo1; +})(); +function f1(_this) { + var _this = this; + (function (x) { + console.log(_this.x); + }); +} +var Foo3 = (function () { + function Foo3(_this) { + var _this = this; + var x2 = { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + } + Foo3.prototype.z = function (_this) { + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + }; + return Foo3; +})(); +function f3(_this) { + var _this = this; + (function (x) { + console.log(_this.x); + }); +} diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js new file mode 100644 index 0000000000000..813295bb8894e --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js @@ -0,0 +1,76 @@ +//// [collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts] +class Foo2 { + constructor(_this: number) { //Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } +} + +class Foo3 { + constructor(private _this: number) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } +} + +class Foo4 { + constructor(_this: number); // No code gen - no error + constructor(_this: string); // No code gen - no error + constructor(_this: any) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } +} + +class Foo5 { + constructor(_this: number); // No code gen - no error + constructor(_this: string); // No code gen - no error + constructor(private _this: any) { // Error + var lambda = () => { + return x => this; // New scope. So should inject new _this capture + } + } +} + +//// [collisionThisExpressionAndPropertyNameAsConstuctorParameter.js] +var Foo2 = (function () { + function Foo2(_this) { + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + } + return Foo2; +})(); +var Foo3 = (function () { + function Foo3(_this) { + this._this = _this; + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + } + return Foo3; +})(); +var Foo4 = (function () { + function Foo4(_this) { + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + } + return Foo4; +})(); +var Foo5 = (function () { + function Foo5(_this) { + this._this = _this; + var _this = this; + var lambda = function () { + return function (x) { return _this; }; + }; + } + return Foo5; +})(); diff --git a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js new file mode 100644 index 0000000000000..7057ad7ac55d6 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js @@ -0,0 +1,8 @@ +//// [collisionThisExpressionAndVarInGlobal.ts] +var _this = 1; +var f = () => this; + +//// [collisionThisExpressionAndVarInGlobal.js] +var _this = this; +var _this = 1; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/commaOperator1.js b/tests/baselines/reference/commaOperator1.js new file mode 100644 index 0000000000000..503ce541bb4e3 --- /dev/null +++ b/tests/baselines/reference/commaOperator1.js @@ -0,0 +1,14 @@ +//// [commaOperator1.ts] +var v1 = ((1, 2, 3), 4, 5, (6, 7)); +function f1() { + var a = 1; + return a, v1, a; +} + + +//// [commaOperator1.js] +var v1 = ((1, 2, 3), 4, 5, (6, 7)); +function f1() { + var a = 1; + return a, v1, a; +} diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt new file mode 100644 index 0000000000000..d426c3f5eb073 --- /dev/null +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ==== + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + + var resultIsBoolean: boolean + var resultIsNumber: number + var resultIsString: string + + //Expect errors when the results type is different form the second operand + resultIsBoolean = (BOOLEAN, STRING); + ~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'boolean'. + resultIsBoolean = (BOOLEAN, NUMBER); + ~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'boolean'. + + resultIsNumber = (NUMBER, BOOLEAN); + ~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'number'. + resultIsNumber = (NUMBER, STRING); + ~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + resultIsString = (STRING, BOOLEAN); + ~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'string'. + resultIsString = (STRING, NUMBER); + ~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js new file mode 100644 index 0000000000000..37a72e824ece9 --- /dev/null +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js @@ -0,0 +1,33 @@ +//// [commaOperatorInvalidAssignmentType.ts] +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; + +var resultIsBoolean: boolean +var resultIsNumber: number +var resultIsString: string + +//Expect errors when the results type is different form the second operand +resultIsBoolean = (BOOLEAN, STRING); +resultIsBoolean = (BOOLEAN, NUMBER); + +resultIsNumber = (NUMBER, BOOLEAN); +resultIsNumber = (NUMBER, STRING); + +resultIsString = (STRING, BOOLEAN); +resultIsString = (STRING, NUMBER); + + +//// [commaOperatorInvalidAssignmentType.js] +var BOOLEAN; +var NUMBER; +var STRING; +var resultIsBoolean; +var resultIsNumber; +var resultIsString; +resultIsBoolean = (BOOLEAN, STRING); +resultIsBoolean = (BOOLEAN, NUMBER); +resultIsNumber = (NUMBER, BOOLEAN); +resultIsNumber = (NUMBER, STRING); +resultIsString = (STRING, BOOLEAN); +resultIsString = (STRING, NUMBER); diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt new file mode 100644 index 0000000000000..fad2c5a147737 --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ==== + //Expect to have compiler errors + //Comma operator in fuction arguments and return + function foo(x: number, y: string) { + return x, y; + } + var resultIsString: number = foo(1, "123"); //error here + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + //TypeParameters + function foo1() { + var x: T1; + var y: T2; + var result: T1 = (x, y); //error here + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'T2' is not assignable to type 'T1'. + } \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js new file mode 100644 index 0000000000000..061a18af2737d --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js @@ -0,0 +1,25 @@ +//// [commaOperatorOtherInvalidOperation.ts] +//Expect to have compiler errors +//Comma operator in fuction arguments and return +function foo(x: number, y: string) { + return x, y; +} +var resultIsString: number = foo(1, "123"); //error here + +//TypeParameters +function foo1() { + var x: T1; + var y: T2; + var result: T1 = (x, y); //error here +} + +//// [commaOperatorOtherInvalidOperation.js] +function foo(x, y) { + return x, y; +} +var resultIsString = foo(1, "123"); +function foo1() { + var x; + var y; + var result = (x, y); +} diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.js b/tests/baselines/reference/commaOperatorOtherValidOperation.js new file mode 100644 index 0000000000000..f99eb586be3a5 --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.js @@ -0,0 +1,36 @@ +//// [commaOperatorOtherValidOperation.ts] +//Comma operator in for loop +for (var i = 0, j = 10; i < j; i++, j--) +{ +} + +//Comma operator in fuction arguments and return +function foo(x: number, y: string) +{ + return x, y; +} +var resultIsString = foo(1, "123"); + +//TypeParameters +function foo1() +{ + var x: T1; + var y: T2; + x, y; + var resultIsT1 = (y, x); +} + + +//// [commaOperatorOtherValidOperation.js] +for (var i = 0, j = 10; i < j; i++, j--) { +} +function foo(x, y) { + return x, y; +} +var resultIsString = foo(1, "123"); +function foo1() { + var x; + var y; + x, y; + var resultIsT1 = (y, x); +} diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js new file mode 100644 index 0000000000000..29c9b61e6b0c4 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js @@ -0,0 +1,68 @@ +//// [commaOperatorWithSecondOperandAnyType.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +//The second operand type is any +ANY, ANY; +BOOLEAN, ANY; +NUMBER, ANY; +STRING, ANY; +OBJECT, ANY; + +//Return type is any +var resultIsAny1 = (ANY, ANY); +var resultIsAny2 = (BOOLEAN, ANY); +var resultIsAny3 = (NUMBER, ANY); +var resultIsAny4 = (STRING, ANY); +var resultIsAny5 = (OBJECT, ANY); + +//Literal and expression +var x: any; + +1, ANY; +++NUMBER, ANY; +"string", [null, 1]; +"string".charAt(0), [null, 1]; +true, x("any"); +!BOOLEAN, x.doSomeThing(); + +var resultIsAny6 = (1, ANY); +var resultIsAny7 = (++NUMBER, ANY); +var resultIsAny8 = ("string", null); +var resultIsAny9 = ("string".charAt(0), undefined); +var resultIsAny10 = (true, x("any")); +var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); + + +//// [commaOperatorWithSecondOperandAnyType.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +ANY, ANY; +BOOLEAN, ANY; +NUMBER, ANY; +STRING, ANY; +OBJECT, ANY; +var resultIsAny1 = (ANY, ANY); +var resultIsAny2 = (BOOLEAN, ANY); +var resultIsAny3 = (NUMBER, ANY); +var resultIsAny4 = (STRING, ANY); +var resultIsAny5 = (OBJECT, ANY); +var x; +1, ANY; +++NUMBER, ANY; +"string", [null, 1]; +"string".charAt(0), [null, 1]; +true, x("any"); +!BOOLEAN, x.doSomeThing(); +var resultIsAny6 = (1, ANY); +var resultIsAny7 = (++NUMBER, ANY); +var resultIsAny8 = ("string", null); +var resultIsAny9 = ("string".charAt(0), undefined); +var resultIsAny10 = (true, x("any")); +var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js new file mode 100644 index 0000000000000..a772c42b4b9c2 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js @@ -0,0 +1,65 @@ +//// [commaOperatorWithSecondOperandBooleanType.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +//The second operand type is boolean +ANY, BOOLEAN; +BOOLEAN, BOOLEAN; +NUMBER, BOOLEAN; +STRING, BOOLEAN; +OBJECT, BOOLEAN; + +//Return type is boolean +var resultIsBoolean1 = (ANY, BOOLEAN); +var resultIsBoolean2 = (BOOLEAN, BOOLEAN); +var resultIsBoolean3 = (NUMBER, BOOLEAN); +var resultIsBoolean4 = (STRING, BOOLEAN); +var resultIsBoolean5 = (OBJECT, BOOLEAN); + +//Literal and expression +null, BOOLEAN; +ANY = undefined, BOOLEAN; +1, true; +++NUMBER, true; +[1, 2, 3], !BOOLEAN; +OBJECT = [1, 2, 3], BOOLEAN = false; + +var resultIsBoolean6 = (null, BOOLEAN); +var resultIsBoolean7 = (ANY = undefined, BOOLEAN); +var resultIsBoolean8 = (1, true); +var resultIsBoolean9 = (++NUMBER, true); +var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); +var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); + + +//// [commaOperatorWithSecondOperandBooleanType.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +ANY, BOOLEAN; +BOOLEAN, BOOLEAN; +NUMBER, BOOLEAN; +STRING, BOOLEAN; +OBJECT, BOOLEAN; +var resultIsBoolean1 = (ANY, BOOLEAN); +var resultIsBoolean2 = (BOOLEAN, BOOLEAN); +var resultIsBoolean3 = (NUMBER, BOOLEAN); +var resultIsBoolean4 = (STRING, BOOLEAN); +var resultIsBoolean5 = (OBJECT, BOOLEAN); +null, BOOLEAN; +ANY = undefined, BOOLEAN; +1, true; +++NUMBER, true; +[1, 2, 3], !BOOLEAN; +OBJECT = [1, 2, 3], BOOLEAN = false; +var resultIsBoolean6 = (null, BOOLEAN); +var resultIsBoolean7 = (ANY = undefined, BOOLEAN); +var resultIsBoolean8 = (1, true); +var resultIsBoolean9 = (++NUMBER, true); +var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); +var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js new file mode 100644 index 0000000000000..b9d93041ff327 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js @@ -0,0 +1,65 @@ +//// [commaOperatorWithSecondOperandNumberType.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +//The second operand type is number +ANY, NUMBER; +BOOLEAN, NUMBER; +NUMBER, NUMBER; +STRING, NUMBER; +OBJECT, NUMBER; + +//Return type is number +var resultIsNumber1 = (ANY, NUMBER); +var resultIsNumber2 = (BOOLEAN, NUMBER); +var resultIsNumber3 = (NUMBER, NUMBER); +var resultIsNumber4 = (STRING, NUMBER); +var resultIsNumber5 = (OBJECT, NUMBER); + +//Literal and expression +null, NUMBER; +ANY = undefined, NUMBER; +true, 1; +BOOLEAN = false, 1; +"", NUMBER = 1; +STRING.trim(), NUMBER = 1; + +var resultIsNumber6 = (null, NUMBER); +var resultIsNumber7 = (ANY = undefined, NUMBER); +var resultIsNumber8 = (true, 1); +var resultIsNumber9 = (BOOLEAN = false, 1); +var resultIsNumber10 = ("", NUMBER = 1); +var resultIsNumber11 = (STRING.trim(), NUMBER = 1); + + +//// [commaOperatorWithSecondOperandNumberType.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +ANY, NUMBER; +BOOLEAN, NUMBER; +NUMBER, NUMBER; +STRING, NUMBER; +OBJECT, NUMBER; +var resultIsNumber1 = (ANY, NUMBER); +var resultIsNumber2 = (BOOLEAN, NUMBER); +var resultIsNumber3 = (NUMBER, NUMBER); +var resultIsNumber4 = (STRING, NUMBER); +var resultIsNumber5 = (OBJECT, NUMBER); +null, NUMBER; +ANY = undefined, NUMBER; +true, 1; +BOOLEAN = false, 1; +"", NUMBER = 1; +STRING.trim(), NUMBER = 1; +var resultIsNumber6 = (null, NUMBER); +var resultIsNumber7 = (ANY = undefined, NUMBER); +var resultIsNumber8 = (true, 1); +var resultIsNumber9 = (BOOLEAN = false, 1); +var resultIsNumber10 = ("", NUMBER = 1); +var resultIsNumber11 = (STRING.trim(), NUMBER = 1); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js new file mode 100644 index 0000000000000..e822744b58452 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -0,0 +1,74 @@ +//// [commaOperatorWithSecondOperandObjectType.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +class CLASS { + num: number; +} + +//The second operand type is Object +ANY, OBJECT; +BOOLEAN, OBJECT; +NUMBER, OBJECT; +STRING, OBJECT; +OBJECT, OBJECT; + +//Return type is Object +var resultIsObject1 = (ANY, OBJECT); +var resultIsObject2 = (BOOLEAN, OBJECT); +var resultIsObject3 = (NUMBER, OBJECT); +var resultIsObject4 = (STRING, OBJECT); +var resultIsObject5 = (OBJECT, OBJECT); + +//Literal and expression +null, OBJECT +ANY = null, OBJECT +true, {} +!BOOLEAN, [] +"string", new Date() +STRING.toLowerCase(), new CLASS() + +var resultIsObject6 = (null, OBJECT); +var resultIsObject7 = (ANY = null, OBJECT); +var resultIsObject8 = (true, {}); +var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); +var resultIsObject10 = ("string", new Date()); +var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); + + +//// [commaOperatorWithSecondOperandObjectType.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +var CLASS = (function () { + function CLASS() { + } + return CLASS; +})(); +ANY, OBJECT; +BOOLEAN, OBJECT; +NUMBER, OBJECT; +STRING, OBJECT; +OBJECT, OBJECT; +var resultIsObject1 = (ANY, OBJECT); +var resultIsObject2 = (BOOLEAN, OBJECT); +var resultIsObject3 = (NUMBER, OBJECT); +var resultIsObject4 = (STRING, OBJECT); +var resultIsObject5 = (OBJECT, OBJECT); +null, OBJECT; +ANY = null, OBJECT; +true, {}; +!BOOLEAN, []; +"string", new Date(); +STRING.toLowerCase(), new CLASS(); +var resultIsObject6 = (null, OBJECT); +var resultIsObject7 = (ANY = null, OBJECT); +var resultIsObject8 = (true, {}); +var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); +var resultIsObject10 = ("string", new Date()); +var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js new file mode 100644 index 0000000000000..78d2f882418b2 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js @@ -0,0 +1,68 @@ +//// [commaOperatorWithSecondOperandStringType.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +var resultIsString: string; + +//The second operand is string +ANY, STRING; +BOOLEAN, STRING; +NUMBER, STRING; +STRING, STRING; +OBJECT, STRING; + +//Return type is string +var resultIsString1 = (ANY, STRING); +var resultIsString2 = (BOOLEAN, STRING); +var resultIsString3 = (NUMBER, STRING); +var resultIsString4 = (STRING, STRING); +var resultIsString5 = (OBJECT, STRING); + +//Literal and expression +null, STRING; +ANY = new Date(), STRING; +true, ""; +BOOLEAN == undefined, ""; +["a", "b"], NUMBER.toString(); +OBJECT = new Object, STRING + "string"; + +var resultIsString6 = (null, STRING); +var resultIsString7 = (ANY = new Date(), STRING); +var resultIsString8 = (true, ""); +var resultIsString9 = (BOOLEAN == undefined, ""); +var resultIsString10 = (["a", "b"], NUMBER.toString()); +var resultIsString11 = (new Object, STRING + "string"); + + +//// [commaOperatorWithSecondOperandStringType.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +var resultIsString; +ANY, STRING; +BOOLEAN, STRING; +NUMBER, STRING; +STRING, STRING; +OBJECT, STRING; +var resultIsString1 = (ANY, STRING); +var resultIsString2 = (BOOLEAN, STRING); +var resultIsString3 = (NUMBER, STRING); +var resultIsString4 = (STRING, STRING); +var resultIsString5 = (OBJECT, STRING); +null, STRING; +ANY = new Date(), STRING; +true, ""; +BOOLEAN == undefined, ""; +["a", "b"], NUMBER.toString(); +OBJECT = new Object, STRING + "string"; +var resultIsString6 = (null, STRING); +var resultIsString7 = (ANY = new Date(), STRING); +var resultIsString8 = (true, ""); +var resultIsString9 = (BOOLEAN == undefined, ""); +var resultIsString10 = (["a", "b"], NUMBER.toString()); +var resultIsString11 = (new Object, STRING + "string"); diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt new file mode 100644 index 0000000000000..a213d41649275 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts (12 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + // Expect to have compiler errors + // Missing the second operand + (ANY, ); + ~ +!!! Expression expected. + (BOOLEAN, ); + ~ +!!! Expression expected. + (NUMBER, ); + ~ +!!! Expression expected. + (STRING, ); + ~ +!!! Expression expected. + (OBJECT, ); + ~ +!!! Expression expected. + + // Missing the first operand + (, ANY); + ~ +!!! Expression expected. + (, BOOLEAN); + ~ +!!! Expression expected. + (, NUMBER); + ~ +!!! Expression expected. + (, STRING); + ~ +!!! Expression expected. + (, OBJECT); + ~ +!!! Expression expected. + + // Missing all operands + ( , ); + ~ +!!! Expression expected. + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.js b/tests/baselines/reference/commaOperatorsMultipleOperators.js new file mode 100644 index 0000000000000..1f37bafbd49a9 --- /dev/null +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.js @@ -0,0 +1,48 @@ +//// [commaOperatorsMultipleOperators.ts] +var ANY: any; +var BOOLEAN: boolean; +var NUMBER: number; +var STRING: string; +var OBJECT: Object; + +//Expected: work well +ANY, BOOLEAN, NUMBER; +BOOLEAN, NUMBER, STRING; +NUMBER, STRING, OBJECT; +STRING, OBJECT, ANY; +OBJECT, ANY, BOOLEAN; + +//Results should have the same type as the third operand +var resultIsAny1 = (STRING, OBJECT, ANY); +var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); +var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); +var resultIsString1 = (BOOLEAN, NUMBER, STRING); +var resultIsObject1 = (NUMBER, STRING, OBJECT); + +//Literal and expression +null, true, 1; +++NUMBER, STRING.charAt(0), new Object(); + +var resultIsNumber2 = (null, true, 1); +var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); + +//// [commaOperatorsMultipleOperators.js] +var ANY; +var BOOLEAN; +var NUMBER; +var STRING; +var OBJECT; +ANY, BOOLEAN, NUMBER; +BOOLEAN, NUMBER, STRING; +NUMBER, STRING, OBJECT; +STRING, OBJECT, ANY; +OBJECT, ANY, BOOLEAN; +var resultIsAny1 = (STRING, OBJECT, ANY); +var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); +var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); +var resultIsString1 = (BOOLEAN, NUMBER, STRING); +var resultIsObject1 = (NUMBER, STRING, OBJECT); +null, true, 1; +++NUMBER, STRING.charAt(0), new Object(); +var resultIsNumber2 = (null, true, 1); +var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.js b/tests/baselines/reference/commentBeforeStaticMethod1.js new file mode 100644 index 0000000000000..4d9bfb0b09455 --- /dev/null +++ b/tests/baselines/reference/commentBeforeStaticMethod1.js @@ -0,0 +1,19 @@ +//// [commentBeforeStaticMethod1.ts] +class C { + /** + * Returns bar + */ + public static foo(): string { + return "bar"; + } +} + +//// [commentBeforeStaticMethod1.js] +var C = (function () { + function C() { + } + C.foo = function () { + return "bar"; + }; + return C; +})(); diff --git a/tests/baselines/reference/commentInEmptyParameterList1.js b/tests/baselines/reference/commentInEmptyParameterList1.js new file mode 100644 index 0000000000000..8f4e13d82d69d --- /dev/null +++ b/tests/baselines/reference/commentInEmptyParameterList1.js @@ -0,0 +1,7 @@ +//// [commentInEmptyParameterList1.ts] +function foo(/** nothing */) { +} + +//// [commentInEmptyParameterList1.js] +function foo() { +} diff --git a/tests/baselines/reference/commentInMethodCall.js b/tests/baselines/reference/commentInMethodCall.js new file mode 100644 index 0000000000000..501139a2a72d1 --- /dev/null +++ b/tests/baselines/reference/commentInMethodCall.js @@ -0,0 +1,11 @@ +//// [commentInMethodCall.ts] +//commment here +var s: string[]; +s.map(// do something + function () { }); + + +//// [commentInMethodCall.js] +var s; +s.map(function () { +}); diff --git a/tests/baselines/reference/commentOnAmbientClass1.js b/tests/baselines/reference/commentOnAmbientClass1.js new file mode 100644 index 0000000000000..38ce0d345bead --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientClass1.js @@ -0,0 +1,10 @@ +//// [commentOnAmbientClass1.ts] +/*! Keep this pinned comment */ +declare class C { +} + +// Don't keep this comment. +declare class D { +} + +//// [commentOnAmbientClass1.js] diff --git a/tests/baselines/reference/commentOnAmbientVariable1.js b/tests/baselines/reference/commentOnAmbientVariable1.js new file mode 100644 index 0000000000000..44e68ad338df0 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable1.js @@ -0,0 +1,8 @@ +//// [commentOnAmbientVariable1.ts] +/*! Keep this pinned comment */ +declare var v: number; + +// Don't keep this comment. +declare var y: number; + +//// [commentOnAmbientVariable1.js] diff --git a/tests/baselines/reference/commentOnAmbientVariable2.js b/tests/baselines/reference/commentOnAmbientVariable2.js new file mode 100644 index 0000000000000..091add41ae430 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable2.js @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/commentOnAmbientVariable2.ts] //// + +//// [commentOnAmbientVariable2_1.ts] +var y = 1; + +//// [commentOnAmbientVariable2_2.ts] +/// +declare var x: number; +x = 2; + +//// [commentOnAmbientVariable2_1.js] +var y = 1; +//// [commentOnAmbientVariable2_2.js] +x = 2; diff --git a/tests/baselines/reference/commentOnClassAccessor1.errors.txt b/tests/baselines/reference/commentOnClassAccessor1.errors.txt new file mode 100644 index 0000000000000..b434f9fc57de3 --- /dev/null +++ b/tests/baselines/reference/commentOnClassAccessor1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/commentOnClassAccessor1.ts (1 errors) ==== + class C { + /** + * @type {number} + */ + get bar(): number { return 1;} + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/commentOnClassAccessor2.errors.txt b/tests/baselines/reference/commentOnClassAccessor2.errors.txt new file mode 100644 index 0000000000000..137490042a725 --- /dev/null +++ b/tests/baselines/reference/commentOnClassAccessor2.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/commentOnClassAccessor2.ts (2 errors) ==== + class C { + /** + * Getter. + */ + get bar(): number { return 1;} + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + /** + * Setter. + */ + set bar(v) { } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/commentOnClassMethod1.js b/tests/baselines/reference/commentOnClassMethod1.js new file mode 100644 index 0000000000000..214d4f7f120b4 --- /dev/null +++ b/tests/baselines/reference/commentOnClassMethod1.js @@ -0,0 +1,17 @@ +//// [commentOnClassMethod1.ts] +class WebControls { + /** + * Render a control + */ + createControl(): any { + } +} + +//// [commentOnClassMethod1.js] +var WebControls = (function () { + function WebControls() { + } + WebControls.prototype.createControl = function () { + }; + return WebControls; +})(); diff --git a/tests/baselines/reference/commentOnElidedModule1.js b/tests/baselines/reference/commentOnElidedModule1.js new file mode 100644 index 0000000000000..c8458b7aaf634 --- /dev/null +++ b/tests/baselines/reference/commentOnElidedModule1.js @@ -0,0 +1,10 @@ +//// [commentOnElidedModule1.ts] +/*! Keep this pinned comment */ +module ElidedModule { +} + +// Don't keep this comment. +module ElidedModule2 { +} + +//// [commentOnElidedModule1.js] diff --git a/tests/baselines/reference/commentOnExpressionStatement1.js b/tests/baselines/reference/commentOnExpressionStatement1.js new file mode 100644 index 0000000000000..6daee86cc1b88 --- /dev/null +++ b/tests/baselines/reference/commentOnExpressionStatement1.js @@ -0,0 +1,6 @@ +//// [commentOnExpressionStatement1.ts] + +1 + 1; // Comment. + +//// [commentOnExpressionStatement1.js] +1 + 1; diff --git a/tests/baselines/reference/commentOnIfStatement1.js b/tests/baselines/reference/commentOnIfStatement1.js new file mode 100644 index 0000000000000..4ac6b22d01fa2 --- /dev/null +++ b/tests/baselines/reference/commentOnIfStatement1.js @@ -0,0 +1,9 @@ +//// [commentOnIfStatement1.ts] + +// Test +if (true) { +} + +//// [commentOnIfStatement1.js] +if (true) { +} diff --git a/tests/baselines/reference/commentOnImportStatement1.errors.txt b/tests/baselines/reference/commentOnImportStatement1.errors.txt new file mode 100644 index 0000000000000..580b96bd61e83 --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/commentOnImportStatement1.ts (1 errors) ==== + /* Copyright */ + + import foo = require('./foo'); + ~~~~~~~ +!!! Cannot find external module './foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement1.js b/tests/baselines/reference/commentOnImportStatement1.js new file mode 100644 index 0000000000000..955369cd65e9e --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement1.js @@ -0,0 +1,9 @@ +//// [commentOnImportStatement1.ts] +/* Copyright */ + +import foo = require('./foo'); + + +//// [commentOnImportStatement1.js] +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/commentOnImportStatement2.errors.txt b/tests/baselines/reference/commentOnImportStatement2.errors.txt new file mode 100644 index 0000000000000..5b600cf4bcf65 --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement2.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/commentOnImportStatement2.ts (1 errors) ==== + /* not copyright */ + import foo = require('./foo'); + ~~~~~~~ +!!! Cannot find external module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement2.js b/tests/baselines/reference/commentOnImportStatement2.js new file mode 100644 index 0000000000000..63cedfcab1850 --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement2.js @@ -0,0 +1,5 @@ +//// [commentOnImportStatement2.ts] +/* not copyright */ +import foo = require('./foo'); + +//// [commentOnImportStatement2.js] diff --git a/tests/baselines/reference/commentOnImportStatement3.errors.txt b/tests/baselines/reference/commentOnImportStatement3.errors.txt new file mode 100644 index 0000000000000..dede9f0f713bd --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement3.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/commentOnImportStatement3.ts (1 errors) ==== + /* copyright */ + + /* not copyright */ + import foo = require('./foo'); + ~~~~~~~ +!!! Cannot find external module './foo'. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnImportStatement3.js b/tests/baselines/reference/commentOnImportStatement3.js new file mode 100644 index 0000000000000..f5ec592d6b4c4 --- /dev/null +++ b/tests/baselines/reference/commentOnImportStatement3.js @@ -0,0 +1,7 @@ +//// [commentOnImportStatement3.ts] +/* copyright */ + +/* not copyright */ +import foo = require('./foo'); + +//// [commentOnImportStatement3.js] diff --git a/tests/baselines/reference/commentOnInterface1.js b/tests/baselines/reference/commentOnInterface1.js new file mode 100644 index 0000000000000..2785341ed1ab2 --- /dev/null +++ b/tests/baselines/reference/commentOnInterface1.js @@ -0,0 +1,10 @@ +//// [commentOnInterface1.ts] +/*! Keep this pinned comment */ +interface I { +} + +// Don't keep this comment. +interface I2 { +} + +//// [commentOnInterface1.js] diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js new file mode 100644 index 0000000000000..d014043dfe0a3 --- /dev/null +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js @@ -0,0 +1,10 @@ +//// [commentOnParenthesizedExpressionOpenParen1.ts] +var j; +var f: () => any; +( /* Preserve */ j = f()); + + +//// [commentOnParenthesizedExpressionOpenParen1.js] +var j; +var f; +(j = f()); diff --git a/tests/baselines/reference/commentOnSignature1.js b/tests/baselines/reference/commentOnSignature1.js new file mode 100644 index 0000000000000..fac146e4e6c24 --- /dev/null +++ b/tests/baselines/reference/commentOnSignature1.js @@ -0,0 +1,11 @@ +//// [commentOnSignature1.ts] +/*! Keep this pinned comment */ +function foo(n: number): void; +// Don't keep this comment. +function foo(s: string): void; +function foo(a: any): void { +} + +//// [commentOnSignature1.js] +function foo(a) { +} diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js new file mode 100644 index 0000000000000..dc9bac84fa538 --- /dev/null +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js @@ -0,0 +1,14 @@ +//// [commentOnSimpleArrowFunctionBody1.ts] +function Foo(x: any) +{ +} + +Foo(() => + // do something + 127); + + +//// [commentOnSimpleArrowFunctionBody1.js] +function Foo(x) { +} +Foo(function () { return 127; }); diff --git a/tests/baselines/reference/commentOnStaticMember1.js b/tests/baselines/reference/commentOnStaticMember1.js new file mode 100644 index 0000000000000..78e7ec905f23c --- /dev/null +++ b/tests/baselines/reference/commentOnStaticMember1.js @@ -0,0 +1,15 @@ +//// [commentOnStaticMember1.ts] +class Greeter { + //Hello World + static foo(){ + } +} + +//// [commentOnStaticMember1.js] +var Greeter = (function () { + function Greeter() { + } + Greeter.foo = function () { + }; + return Greeter; +})(); diff --git a/tests/baselines/reference/commentsAtEndOfFile1.js b/tests/baselines/reference/commentsAtEndOfFile1.js new file mode 100644 index 0000000000000..a0b0fe3731e1d --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.js @@ -0,0 +1,8 @@ +//// [commentsAtEndOfFile1.ts] +Input: +; +//Testing two + + +//// [commentsAtEndOfFile1.js] +Input: ; diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.js b/tests/baselines/reference/commentsBeforeFunctionExpression1.js new file mode 100644 index 0000000000000..0e23722faf393 --- /dev/null +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.js @@ -0,0 +1,10 @@ +//// [commentsBeforeFunctionExpression1.ts] +var v = { + f: /**own f*/ (a) => 0 +} + + +//// [commentsBeforeFunctionExpression1.js] +var v = { + f: function (a) { return 0; } +}; diff --git a/tests/baselines/reference/commentsBeforeVariableStatement1.js b/tests/baselines/reference/commentsBeforeVariableStatement1.js new file mode 100644 index 0000000000000..598894dc93652 --- /dev/null +++ b/tests/baselines/reference/commentsBeforeVariableStatement1.js @@ -0,0 +1,9 @@ +//// [commentsBeforeVariableStatement1.ts] +/** b's comment*/ +export var b: number; + + +//// [commentsBeforeVariableStatement1.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/commentsClass.js b/tests/baselines/reference/commentsClass.js new file mode 100644 index 0000000000000..8d9ca135b4a38 --- /dev/null +++ b/tests/baselines/reference/commentsClass.js @@ -0,0 +1,120 @@ +//// [commentsClass.ts] + +/** This is class c2 without constuctor*/ +class c2 { +} +var i2 = new c2(); +var i2_c = c2; +class c3 { + /** Constructor comment*/ + constructor() { + } +} +var i3 = new c3(); +var i3_c = c3; +/** Class comment*/ +class c4 { + /** Constructor comment*/ + constructor() { + } +} +var i4 = new c4(); +var i4_c = c4; +/** Class with statics*/ +class c5 { + static s1: number; +} +var i5 = new c5(); +var i5_c = c5; + +/// class with statics and constructor +class c6 { /// class with statics and constructor2 + /// s1 comment + static s1: number; /// s1 comment2 + /// constructor comment + constructor() { /// constructor comment2 + } +} +var i6 = new c6(); +var i6_c = c6; + +// class with statics and constructor +class c7 { + // s1 comment + static s1: number; + // constructor comment + constructor() { + } +} +var i7 = new c7(); +var i7_c = c7; + +/** class with statics and constructor + */ +class c8 { + /** s1 comment */ + static s1: number; /** s1 comment2 */ + /** constructor comment + */ + constructor() { + /** constructor comment2 + */ + } +} +var i8 = new c8(); +var i8_c = c8; + + +//// [commentsClass.js] +var c2 = (function () { + function c2() { + } + return c2; +})(); +var i2 = new c2(); +var i2_c = c2; +var c3 = (function () { + function c3() { + } + return c3; +})(); +var i3 = new c3(); +var i3_c = c3; +var c4 = (function () { + function c4() { + } + return c4; +})(); +var i4 = new c4(); +var i4_c = c4; +var c5 = (function () { + function c5() { + } + return c5; +})(); +var i5 = new c5(); +var i5_c = c5; +var c6 = (function () { + function c6() { + } + return c6; +})(); +var i6 = new c6(); +var i6_c = c6; +var c7 = (function () { + function c7() { + } + return c7; +})(); +var i7 = new c7(); +var i7_c = c7; +var c8 = (function () { + function c8() { + } + return c8; +})(); +var i8 = new c8(); +var i8_c = c8; + + +//// [commentsClass.d.ts] diff --git a/tests/baselines/reference/commentsClassMembers.js b/tests/baselines/reference/commentsClassMembers.js new file mode 100644 index 0000000000000..002e2d4108138 --- /dev/null +++ b/tests/baselines/reference/commentsClassMembers.js @@ -0,0 +1,440 @@ +//// [commentsClassMembers.ts] + +/** This is comment for c1*/ +class c1 { + /** p1 is property of c1*/ + public p1: number; + /** sum with property*/ + public p2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property*/ + public get p3() { + return this.p2(this.p1); + } + /** setter property*/ + public set p3(/** this is value*/value: number) { + this.p1 = this.p2(value); + } + /** pp1 is property of c1*/ + private pp1: number; + /** sum with property*/ + private pp2(/** number to add*/b: number) { + return this.p1 + b; + } + /** getter property*/ + private get pp3() { + return this.pp2(this.pp1); + } + /** setter property*/ + private set pp3( /** this is value*/value: number) { + this.pp1 = this.pp2(value); + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; + /** static sum with property*/ + static s2(/** number to add*/b: number) { + return c1.s1 + b; + } + /** static getter property*/ + static get s3() { + return c1.s2(c1.s1); + } + /** setter property*/ + static set s3( /** this is value*/value: number) { + c1.s1 = c1.s2(value); + } + public nc_p1: number; + public nc_p2(b: number) { + return this.nc_p1 + b; + } + public get nc_p3() { + return this.nc_p2(this.nc_p1); + } + public set nc_p3(value: number) { + this.nc_p1 = this.nc_p2(value); + } + private nc_pp1: number; + private nc_pp2(b: number) { + return this.nc_pp1 + b; + } + private get nc_pp3() { + return this.nc_pp2(this.nc_pp1); + } + private set nc_pp3(value: number) { + this.nc_pp1 = this.nc_pp2(value); + } + static nc_s1: number; + static nc_s2(b: number) { + return c1.nc_s1 + b; + } + static get nc_s3() { + return c1.nc_s2(c1.nc_s1); + } + static set nc_s3(value: number) { + c1.nc_s1 = c1.nc_s2(value); + } + + // p1 is property of c1 + public a_p1: number; + // sum with property + public a_p2(b: number) { + return this.a_p1 + b; + } + // getter property + public get a_p3() { + return this.a_p2(this.a_p1); + } + // setter property + public set a_p3(value: number) { + this.a_p1 = this.a_p2(value); + } + // pp1 is property of c1 + private a_pp1: number; + // sum with property + private a_pp2(b: number) { + return this.a_p1 + b; + } + // getter property + private get a_pp3() { + return this.a_pp2(this.a_pp1); + } + // setter property + private set a_pp3(value: number) { + this.a_pp1 = this.a_pp2(value); + } + + // s1 is static property of c1 + static a_s1: number; + // static sum with property + static a_s2(b: number) { + return c1.a_s1 + b; + } + // static getter property + static get a_s3() { + return c1.s2(c1.s1); + } + + // setter property + static set a_s3(value: number) { + c1.a_s1 = c1.a_s2(value); + } + + /** p1 is property of c1 */ + public b_p1: number; + /** sum with property */ + public b_p2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + public get b_p3() { + return this.b_p2(this.b_p1); + } + /** setter property */ + public set b_p3(value: number) { + this.b_p1 = this.b_p2(value); + } + /** pp1 is property of c1 */ + private b_pp1: number; + /** sum with property */ + private b_pp2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + private get b_pp3() { + return this.b_pp2(this.b_pp1); + } + /** setter property */ + private set b_pp3(value: number) { + this.b_pp1 = this.b_pp2(value); + } + + /** s1 is static property of c1 */ + static b_s1: number; + /** static sum with property */ + static b_s2(b: number) { + return c1.b_s1 + b; + } + /** static getter property + */ + static get b_s3() { + return c1.s2(c1.s1); + } + + /** setter property + */ + static set b_s3(value: number) { + /** setter */ + c1.b_s1 = c1.b_s2(value); + } +} +var i1 = new c1(); +var i1_p = i1.p1; +var i1_f = i1.p2; +var i1_r = i1.p2(20); +var i1_prop = i1.p3; +i1.p3 = i1_prop; +var i1_nc_p = i1.nc_p1; +var i1_ncf = i1.nc_p2; +var i1_ncr = i1.nc_p2(20); +var i1_ncprop = i1.nc_p3; +i1.nc_p3 = i1_ncprop; +var i1_s_p = c1.s1; +var i1_s_f = c1.s2; +var i1_s_r = c1.s2(20); +var i1_s_prop = c1.s3; +c1.s3 = i1_s_prop; +var i1_s_nc_p = c1.nc_s1; +var i1_s_ncf = c1.nc_s2; +var i1_s_ncr = c1.nc_s2(20); +var i1_s_ncprop = c1.nc_s3; +c1.nc_s3 = i1_s_ncprop; +var i1_c = c1; +class cProperties { + private val: number; + /** getter only property*/ + public get p1() { + return this.val; + } + public get nc_p1() { + return this.val; + } + /**setter only property*/ + public set p2(value: number) { + this.val = value; + } + public set nc_p2(value: number) { + this.val = value; + } +} +var cProperties_i = new cProperties(); +cProperties_i.p2 = cProperties_i.p1; +cProperties_i.nc_p2 = cProperties_i.nc_p1; + + +//// [commentsClassMembers.js] +var c1 = (function () { + function c1() { + } + c1.prototype.p2 = function (b) { + return this.p1 + b; + }; + Object.defineProperty(c1.prototype, "p3", { + get: function () { + return this.p2(this.p1); + }, + set: function (value) { + this.p1 = this.p2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.pp2 = function (b) { + return this.p1 + b; + }; + Object.defineProperty(c1.prototype, "pp3", { + get: function () { + return this.pp2(this.pp1); + }, + set: function (value) { + this.pp1 = this.pp2(value); + }, + enumerable: true, + configurable: true + }); + c1.s2 = function (b) { + return c1.s1 + b; + }; + Object.defineProperty(c1, "s3", { + get: function () { + return c1.s2(c1.s1); + }, + set: function (value) { + c1.s1 = c1.s2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.nc_p2 = function (b) { + return this.nc_p1 + b; + }; + Object.defineProperty(c1.prototype, "nc_p3", { + get: function () { + return this.nc_p2(this.nc_p1); + }, + set: function (value) { + this.nc_p1 = this.nc_p2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.nc_pp2 = function (b) { + return this.nc_pp1 + b; + }; + Object.defineProperty(c1.prototype, "nc_pp3", { + get: function () { + return this.nc_pp2(this.nc_pp1); + }, + set: function (value) { + this.nc_pp1 = this.nc_pp2(value); + }, + enumerable: true, + configurable: true + }); + c1.nc_s2 = function (b) { + return c1.nc_s1 + b; + }; + Object.defineProperty(c1, "nc_s3", { + get: function () { + return c1.nc_s2(c1.nc_s1); + }, + set: function (value) { + c1.nc_s1 = c1.nc_s2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.a_p2 = function (b) { + return this.a_p1 + b; + }; + Object.defineProperty(c1.prototype, "a_p3", { + get: function () { + return this.a_p2(this.a_p1); + }, + set: function (value) { + this.a_p1 = this.a_p2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.a_pp2 = function (b) { + return this.a_p1 + b; + }; + Object.defineProperty(c1.prototype, "a_pp3", { + get: function () { + return this.a_pp2(this.a_pp1); + }, + set: function (value) { + this.a_pp1 = this.a_pp2(value); + }, + enumerable: true, + configurable: true + }); + c1.a_s2 = function (b) { + return c1.a_s1 + b; + }; + Object.defineProperty(c1, "a_s3", { + get: function () { + return c1.s2(c1.s1); + }, + set: function (value) { + c1.a_s1 = c1.a_s2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.b_p2 = function (b) { + return this.b_p1 + b; + }; + Object.defineProperty(c1.prototype, "b_p3", { + get: function () { + return this.b_p2(this.b_p1); + }, + set: function (value) { + this.b_p1 = this.b_p2(value); + }, + enumerable: true, + configurable: true + }); + c1.prototype.b_pp2 = function (b) { + return this.b_p1 + b; + }; + Object.defineProperty(c1.prototype, "b_pp3", { + get: function () { + return this.b_pp2(this.b_pp1); + }, + set: function (value) { + this.b_pp1 = this.b_pp2(value); + }, + enumerable: true, + configurable: true + }); + c1.b_s2 = function (b) { + return c1.b_s1 + b; + }; + Object.defineProperty(c1, "b_s3", { + get: function () { + return c1.s2(c1.s1); + }, + set: function (value) { + c1.b_s1 = c1.b_s2(value); + }, + enumerable: true, + configurable: true + }); + return c1; +})(); +var i1 = new c1(); +var i1_p = i1.p1; +var i1_f = i1.p2; +var i1_r = i1.p2(20); +var i1_prop = i1.p3; +i1.p3 = i1_prop; +var i1_nc_p = i1.nc_p1; +var i1_ncf = i1.nc_p2; +var i1_ncr = i1.nc_p2(20); +var i1_ncprop = i1.nc_p3; +i1.nc_p3 = i1_ncprop; +var i1_s_p = c1.s1; +var i1_s_f = c1.s2; +var i1_s_r = c1.s2(20); +var i1_s_prop = c1.s3; +c1.s3 = i1_s_prop; +var i1_s_nc_p = c1.nc_s1; +var i1_s_ncf = c1.nc_s2; +var i1_s_ncr = c1.nc_s2(20); +var i1_s_ncprop = c1.nc_s3; +c1.nc_s3 = i1_s_ncprop; +var i1_c = c1; +var cProperties = (function () { + function cProperties() { + } + Object.defineProperty(cProperties.prototype, "p1", { + get: function () { + return this.val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(cProperties.prototype, "nc_p1", { + get: function () { + return this.val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(cProperties.prototype, "p2", { + set: function (value) { + this.val = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(cProperties.prototype, "nc_p2", { + set: function (value) { + this.val = value; + }, + enumerable: true, + configurable: true + }); + return cProperties; +})(); +var cProperties_i = new cProperties(); +cProperties_i.p2 = cProperties_i.p1; +cProperties_i.nc_p2 = cProperties_i.nc_p1; + + +//// [commentsClassMembers.d.ts] diff --git a/tests/baselines/reference/commentsCommentParsing.js b/tests/baselines/reference/commentsCommentParsing.js new file mode 100644 index 0000000000000..2ec854fe789bd --- /dev/null +++ b/tests/baselines/reference/commentsCommentParsing.js @@ -0,0 +1,226 @@ +//// [commentsCommentParsing.ts] + +/// This is simple /// comments +function simple() { +} + +simple(); + +/// multiLine /// Comments +/// This is example of multiline /// comments +/// Another multiLine +function multiLine() { +} +multiLine(); + +/** this is eg of single line jsdoc style comment */ +function jsDocSingleLine() { +} +jsDocSingleLine(); + + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +function jsDocMultiLine() { +} +jsDocMultiLine(); + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +/** Shoul mege this line as well +* and this too*/ /** Another this one too*/ +function jsDocMultiLineMerge() { +} +jsDocMultiLineMerge(); + + +/// Triple slash comment +/** jsdoc comment */ +function jsDocMixedComments1() { +} +jsDocMixedComments1(); + +/// Triple slash comment +/** jsdoc comment */ /*** another jsDocComment*/ +function jsDocMixedComments2() { +} +jsDocMixedComments2(); + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +function jsDocMixedComments3() { +} +jsDocMixedComments3(); + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments4() { +} +jsDocMixedComments4(); + +/// Triple slash comment 1 +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments5() { +} +jsDocMixedComments5(); + +/*** another jsDocComment*/ +/// Triple slash comment 1 +/// Triple slash comment +/// Triple slash comment 2 +/** jsdoc comment */ +function jsDocMixedComments6() { +} +jsDocMixedComments6(); + +// This shoulnot be help comment +function noHelpComment1() { +} +noHelpComment1(); + +/* This shoulnot be help comment */ +function noHelpComment2() { +} +noHelpComment2(); + +function noHelpComment3() { +} +noHelpComment3(); +/** Adds two integers and returns the result + * @param {number} a first number + * @param b second number + */ +function sum(a: number, b: number) { + return a + b; +} +sum(10, 20); +/** This is multiplication function*/ +/** @param */ +/** @param a first number*/ +/** @param b */ +/** @param c { + @param d @anotherTag*/ +/** @param e LastParam @anotherTag*/ +function multiply(a: number, b: number, c?: number, d?, e?) { +} +/** fn f1 with number +* @param { string} b about b +*/ +function f1(a: number); +function f1(b: string); +/**@param opt optional parameter*/ +function f1(aOrb, opt?) { + return aOrb; +} +/** This is subtract function +@param { a +*@param { number | } b this is about b +@param { { () => string; } } c this is optional param c +@param { { () => string; } d this is optional param d +@param { { () => string; } } e this is optional param e +@param { { { () => string; } } f this is optional param f +*/ +function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +} +/** this is square function +@paramTag { number } a this is input number of paramTag +@param { number } a this is input number +@returnType { number } it is return type +*/ +function square(a: number) { + return a * a; +} +/** this is divide function +@param { number} a this is a +@paramTag { number } g this is optional param g +@param { number} b this is b +*/ +function divide(a: number, b: number) { +} +/** this is jsdoc style function with param tag as well as inline parameter help +*@param a it is first parameter +*@param c it is third parameter +*/ +function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { + return a + b + c + d; +} + +/**/ +class NoQuickInfoClass { +} + +//// [commentsCommentParsing.js] +function simple() { +} +simple(); +function multiLine() { +} +multiLine(); +function jsDocSingleLine() { +} +jsDocSingleLine(); +function jsDocMultiLine() { +} +jsDocMultiLine(); +function jsDocMultiLineMerge() { +} +jsDocMultiLineMerge(); +function jsDocMixedComments1() { +} +jsDocMixedComments1(); +function jsDocMixedComments2() { +} +jsDocMixedComments2(); +function jsDocMixedComments3() { +} +jsDocMixedComments3(); +function jsDocMixedComments4() { +} +jsDocMixedComments4(); +function jsDocMixedComments5() { +} +jsDocMixedComments5(); +function jsDocMixedComments6() { +} +jsDocMixedComments6(); +function noHelpComment1() { +} +noHelpComment1(); +function noHelpComment2() { +} +noHelpComment2(); +function noHelpComment3() { +} +noHelpComment3(); +function sum(a, b) { + return a + b; +} +sum(10, 20); +function multiply(a, b, c, d, e) { +} +function f1(aOrb, opt) { + return aOrb; +} +function subtract(a, b, c, d, e, f) { +} +function square(a) { + return a * a; +} +function divide(a, b) { +} +function jsDocParamTest(a, b, c, d) { + return a + b + c + d; +} +var NoQuickInfoClass = (function () { + function NoQuickInfoClass() { + } + return NoQuickInfoClass; +})(); + + +//// [commentsCommentParsing.d.ts] diff --git a/tests/baselines/reference/commentsDottedModuleName.js b/tests/baselines/reference/commentsDottedModuleName.js new file mode 100644 index 0000000000000..13946b3fe26c2 --- /dev/null +++ b/tests/baselines/reference/commentsDottedModuleName.js @@ -0,0 +1,31 @@ +//// [commentsDottedModuleName.ts] + +/** this is multi declare module*/ +export module outerModule.InnerModule { + /// class b comment + export class b { + } +} + +//// [commentsDottedModuleName.js] +define(["require", "exports"], function (require, exports) { + (function (outerModule) { + (function (InnerModule) { + var b = (function () { + function b() { + } + return b; + })(); + InnerModule.b = b; + })(outerModule.InnerModule || (outerModule.InnerModule = {})); + var InnerModule = outerModule.InnerModule; + })(exports.outerModule || (exports.outerModule = {})); + var outerModule = exports.outerModule; +}); + + +//// [commentsDottedModuleName.d.ts] +export declare module outerModule.InnerModule { + class b { + } +} diff --git a/tests/baselines/reference/commentsEnums.js b/tests/baselines/reference/commentsEnums.js new file mode 100644 index 0000000000000..c6f12e13d052a --- /dev/null +++ b/tests/baselines/reference/commentsEnums.js @@ -0,0 +1,25 @@ +//// [commentsEnums.ts] + +/** Enum of colors*/ +enum Colors { + /** Fancy name for 'blue'*/ + Cornflower /* blue */, + /** Fancy name for 'pink'*/ + FancyPink +} +var x = Colors.Cornflower; +x = Colors.FancyPink; + + + +//// [commentsEnums.js] +var Colors; +(function (Colors) { + Colors[Colors["Cornflower"] = 0] = "Cornflower"; + Colors[Colors["FancyPink"] = 1] = "FancyPink"; +})(Colors || (Colors = {})); +var x = 0 /* Cornflower */; +x = 1 /* FancyPink */; + + +//// [commentsEnums.d.ts] diff --git a/tests/baselines/reference/commentsExternalModules.js b/tests/baselines/reference/commentsExternalModules.js new file mode 100644 index 0000000000000..4988eac8a83d0 --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules.js @@ -0,0 +1,145 @@ +//// [tests/cases/compiler/commentsExternalModules.ts] //// + +//// [commentsExternalModules_0.ts] + +/** Module comment*/ +export module m1 { + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } +} +m1.fooExport(); +var myvar = new m1.m2.c(); + +/** Module comment */ +export module m4 { + /** b's comment */ + export var b: number; + /** foo's comment + */ + function foo() { + return b; + } + /** m2 comments + */ + export module m2 { + /** class comment; */ + export class c { + }; + /** i */ + export var i = new c(); + } + /** exported function */ + export function fooExport() { + return foo(); + } +} +m4.fooExport(); +var myvar2 = new m4.m2.c(); + +//// [commentsExternalModules_1.ts] +/**This is on import declaration*/ +import extMod = require("commentsExternalModules_0"); +extMod.m1.fooExport(); +var newVar = new extMod.m1.m2.c(); +extMod.m4.fooExport(); +var newVar2 = new extMod.m4.m2.c(); + + +//// [commentsExternalModules_0.js] +define(["require", "exports"], function (require, exports) { + (function (m1) { + m1.b; + function foo() { + return m1.b; + } + (function (m2) { + var c = (function () { + function c() { + } + return c; + })(); + m2.c = c; + ; + m2.i = new c(); + })(m1.m2 || (m1.m2 = {})); + var m2 = m1.m2; + function fooExport() { + return foo(); + } + m1.fooExport = fooExport; + })(exports.m1 || (exports.m1 = {})); + var m1 = exports.m1; + m1.fooExport(); + var myvar = new m1.m2.c(); + (function (m4) { + m4.b; + function foo() { + return m4.b; + } + (function (m2) { + var c = (function () { + function c() { + } + return c; + })(); + m2.c = c; + ; + m2.i = new c(); + })(m4.m2 || (m4.m2 = {})); + var m2 = m4.m2; + function fooExport() { + return foo(); + } + m4.fooExport = fooExport; + })(exports.m4 || (exports.m4 = {})); + var m4 = exports.m4; + m4.fooExport(); + var myvar2 = new m4.m2.c(); +}); +//// [commentsExternalModules_1.js] +define(["require", "exports", "commentsExternalModules_0"], function (require, exports, extMod) { + extMod.m1.fooExport(); + var newVar = new extMod.m1.m2.c(); + extMod.m4.fooExport(); + var newVar2 = new extMod.m4.m2.c(); +}); + + +//// [commentsExternalModules_0.d.ts] +export declare module m1 { + var b; + function foo(); + module m2 { + class c { + } + var i; + } + function fooExport(); +} +export declare module m4 { + var b; + function foo(); + module m2 { + class c { + } + var i; + } + function fooExport(); +} +//// [commentsExternalModules_1.d.ts] diff --git a/tests/baselines/reference/commentsFunction.js b/tests/baselines/reference/commentsFunction.js new file mode 100644 index 0000000000000..9a1c0702ce7e1 --- /dev/null +++ b/tests/baselines/reference/commentsFunction.js @@ -0,0 +1,44 @@ +//// [commentsFunction.ts] + +/** This comment should appear for foo*/ +function foo() { +} +foo(); +/** This is comment for function signature*/ +function fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; +} +fooWithParameters("a", 10); +/** fooFunc + * comment + */ +var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) { + return b; +} + +/// lamdaFoo var comment +var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +lambdaFoo(10, 20); +lambddaNoVarComment(10, 20); + +//// [commentsFunction.js] +function foo() { +} +foo(); +function fooWithParameters(a, b) { + var d = a; +} +fooWithParameters("a", 10); +var fooFunc = function FooFunctionValue(b) { + return b; +}; +var lambdaFoo = function (a, b) { return a + b; }; +var lambddaNoVarComment = function (a, b) { return a * b; }; +lambdaFoo(10, 20); +lambddaNoVarComment(10, 20); + + +//// [commentsFunction.d.ts] diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js new file mode 100644 index 0000000000000..1e1ee51e385fe --- /dev/null +++ b/tests/baselines/reference/commentsInheritance.js @@ -0,0 +1,260 @@ +//// [commentsInheritance.ts] + +/** i1 is interface with properties*/ +interface i1 { + /** i1_p1*/ + i1_p1: number; + /** i1_f1*/ + i1_f1(): void; + /** i1_l1*/ + i1_l1: () => void; + // il_nc_p1 + i1_nc_p1: number; + i1_nc_f1(): void; + i1_nc_l1: () => void; + p1: number; + f1(): void; + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; +} +class c1 implements i1 { + public i1_p1: number; + // i1_f1 + public i1_f1() { + } + public i1_l1: () => void; + public i1_nc_p1: number; + public i1_nc_f1() { + } + public i1_nc_l1: () => void; + /** c1_p1*/ + public p1: number; + /** c1_f1*/ + public f1() { + } + /** c1_l1*/ + public l1: () => void; + /** c1_nc_p1*/ + public nc_p1: number; + /** c1_nc_f1*/ + public nc_f1() { + } + /** c1_nc_l1*/ + public nc_l1: () => void; +} +var i1_i: i1; +var c1_i = new c1(); +// assign to interface +i1_i = c1_i; +class c2 { + /** c2 c2_p1*/ + public c2_p1: number; + /** c2 c2_f1*/ + public c2_f1() { + } + /** c2 c2_prop*/ + public get c2_prop() { + return 10; + } + public c2_nc_p1: number; + public c2_nc_f1() { + } + public get c2_nc_prop() { + return 10; + } + /** c2 p1*/ + public p1: number; + /** c2 f1*/ + public f1() { + } + /** c2 prop*/ + public get prop() { + return 10; + } + public nc_p1: number; + public nc_f1() { + } + public get nc_prop() { + return 10; + } + /** c2 constructor*/ + constructor(a: number) { + this.c2_p1 = a; + } +} +class c3 extends c2 { + constructor() { + super(10); + } + /** c3 p1*/ + public p1: number; + /** c3 f1*/ + public f1() { + } + /** c3 prop*/ + public get prop() { + return 10; + } + public nc_p1: number; + public nc_f1() { + } + public get nc_prop() { + return 10; + } +} +var c2_i = new c2(10); +var c3_i = new c3(); +// assign +c2_i = c3_i; +class c4 extends c2 { +} +var c4_i = new c4(10); +interface i2 { + /** i2_p1*/ + i2_p1: number; + /** i2_f1*/ + i2_f1(): void; + /** i2_l1*/ + i2_l1: () => void; + // i2_nc_p1 + i2_nc_p1: number; + i2_nc_f1(): void; + i2_nc_l1: () => void; + /** i2 p1*/ + p1: number; + /** i2 f1*/ + f1(): void; + /** i2 l1*/ + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; +} +interface i3 extends i2 { + /** i3 p1 */ + p1: number; + /** + * i3 f1 + */ + f1(): void; + /** i3 l1*/ + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; +} +var i2_i: i2; +var i3_i: i3; +// assign to interface +i2_i = i3_i; + + +//// [commentsInheritance.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var c1 = (function () { + function c1() { + } + c1.prototype.i1_f1 = function () { + }; + c1.prototype.i1_nc_f1 = function () { + }; + c1.prototype.f1 = function () { + }; + c1.prototype.nc_f1 = function () { + }; + return c1; +})(); +var i1_i; +var c1_i = new c1(); +i1_i = c1_i; +var c2 = (function () { + function c2(a) { + this.c2_p1 = a; + } + c2.prototype.c2_f1 = function () { + }; + Object.defineProperty(c2.prototype, "c2_prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + c2.prototype.c2_nc_f1 = function () { + }; + Object.defineProperty(c2.prototype, "c2_nc_prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + c2.prototype.f1 = function () { + }; + Object.defineProperty(c2.prototype, "prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + c2.prototype.nc_f1 = function () { + }; + Object.defineProperty(c2.prototype, "nc_prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + return c2; +})(); +var c3 = (function (_super) { + __extends(c3, _super); + function c3() { + _super.call(this, 10); + } + c3.prototype.f1 = function () { + }; + Object.defineProperty(c3.prototype, "prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + c3.prototype.nc_f1 = function () { + }; + Object.defineProperty(c3.prototype, "nc_prop", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + return c3; +})(c2); +var c2_i = new c2(10); +var c3_i = new c3(); +c2_i = c3_i; +var c4 = (function (_super) { + __extends(c4, _super); + function c4() { + _super.apply(this, arguments); + } + return c4; +})(c2); +var c4_i = new c4(10); +var i2_i; +var i3_i; +i2_i = i3_i; + + +//// [commentsInheritance.d.ts] diff --git a/tests/baselines/reference/commentsInterface.js b/tests/baselines/reference/commentsInterface.js new file mode 100644 index 0000000000000..0bca2ac73e198 --- /dev/null +++ b/tests/baselines/reference/commentsInterface.js @@ -0,0 +1,105 @@ +//// [commentsInterface.ts] +/** this is interface 1*/ +interface i1 { +} +var i1_i: i1; +interface nc_i1 { +} +var nc_i1_i: nc_i1; +/** this is interface 2 with memebers*/ +interface i2 { + /** this is x*/ + x: number; + /** this is foo*/ + foo: (/**param help*/b: number) => string; + /** this is indexer*/ + [/**string param*/i: string]: any; + /**new method*/ + new (/** param*/i: i1); + nc_x: number; + nc_foo: (b: number) => string; + [i: number]: number; + /** this is call signature*/ + (/**paramhelp a*/a: number,/**paramhelp b*/ b: number) : number; + /** this is fnfoo*/ + fnfoo(/**param help*/b: number): string; + nc_fnfoo(b: number): string; + // nc_y + nc_y: number; +} +var i2_i: i2; +var i2_i_x = i2_i.x; +var i2_i_foo = i2_i.foo; +var i2_i_foo_r = i2_i.foo(30); +var i2_i_i2_si = i2_i["hello"]; +var i2_i_i2_ii = i2_i[30]; +var i2_i_n = new i2_i(i1_i); +var i2_i_nc_x = i2_i.nc_x; +var i2_i_nc_foo = i2_i.nc_foo; +var i2_i_nc_foo_r = i2_i.nc_foo(30); +var i2_i_r = i2_i(10, 20); +var i2_i_fnfoo = i2_i.fnfoo; +var i2_i_fnfoo_r = i2_i.fnfoo(10); +var i2_i_nc_fnfoo = i2_i.nc_fnfoo; +var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); +interface i3 { + /** Comment i3 x*/ + x: number; + /** Function i3 f*/ + f(/**number parameter*/a: number): string; + /** i3 l*/ + l: (/**comment i3 l b*/b: number) => string; + nc_x: number; + nc_f(a: number): string; + nc_l: (b: number) => string; +} +var i3_i: i3; +i3_i = { + f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, + l: this.f, + /** own x*/ + x: this.f(10), + nc_x: this.l(this.x), + nc_f: this.f, + nc_l: this.l +}; +i3_i.f(10); +i3_i.l(10); +i3_i.nc_f(10); +i3_i.nc_l(10); + + +//// [commentsInterface.js] +var i1_i; +var nc_i1_i; +var i2_i; +var i2_i_x = i2_i.x; +var i2_i_foo = i2_i.foo; +var i2_i_foo_r = i2_i.foo(30); +var i2_i_i2_si = i2_i["hello"]; +var i2_i_i2_ii = i2_i[30]; +var i2_i_n = new i2_i(i1_i); +var i2_i_nc_x = i2_i.nc_x; +var i2_i_nc_foo = i2_i.nc_foo; +var i2_i_nc_foo_r = i2_i.nc_foo(30); +var i2_i_r = i2_i(10, 20); +var i2_i_fnfoo = i2_i.fnfoo; +var i2_i_fnfoo_r = i2_i.fnfoo(10); +var i2_i_nc_fnfoo = i2_i.nc_fnfoo; +var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); +var i3_i; +i3_i = { + f: function (a) { return "Hello" + a; }, + l: this.f, + x: this.f(10), + nc_x: this.l(this.x), + nc_f: this.f, + nc_l: this.l +}; +i3_i.f(10); +i3_i.l(10); +i3_i.nc_f(10); +i3_i.nc_l(10); + + +//// [commentsInterface.d.ts] diff --git a/tests/baselines/reference/commentsModules.js b/tests/baselines/reference/commentsModules.js new file mode 100644 index 0000000000000..c5cc74d40ef0e --- /dev/null +++ b/tests/baselines/reference/commentsModules.js @@ -0,0 +1,245 @@ +//// [commentsModules.ts] +/** Module comment*/ +module m1 { + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + + // shouldn't appear + export function foo2Export(/**hm*/ a: string) { + } + + /** foo3Export + * comment + */ + export function foo3Export() { + } + + /** foo4Export + * comment + */ + function foo4Export() { + } +} +m1.fooExport(); +var myvar = new m1.m2.c(); +/** module comment of m2.m3*/ +module m2.m3 { + /** Exported class comment*/ + export class c { + } +} +new m2.m3.c(); +/** module comment of m3.m4.m5*/ +module m3.m4.m5 { + /** Exported class comment*/ + export class c { + } +} +new m3.m4.m5.c(); +/** module comment of m4.m5.m6*/ +module m4.m5.m6 { + export module m7 { + /** Exported class comment*/ + export class c { + } + } +} +new m4.m5.m6.m7.c(); +/** module comment of m5.m6.m7*/ +module m5.m6.m7 { + /** module m8 comment*/ + export module m8 { + /** Exported class comment*/ + export class c { + } + } +} +new m5.m6.m7.m8.c(); +module m6.m7 { + export module m8 { + /** Exported class comment*/ + export class c { + } + } +} +new m6.m7.m8.c(); +module m7.m8 { + /** module m9 comment*/ + export module m9 { + /** Exported class comment*/ + export class c { + } + + /** class d */ + class d { + } + + // class e + export class e { + } + } +} +new m7.m8.m9.c(); + +//// [commentsModules.js] +var m1; +(function (m1) { + m1.b; + function foo() { + return m1.b; + } + (function (m2) { + var c = (function () { + function c() { + } + return c; + })(); + m2.c = c; + ; + m2.i = new c(); + })(m1.m2 || (m1.m2 = {})); + var m2 = m1.m2; + function fooExport() { + return foo(); + } + m1.fooExport = fooExport; + function foo2Export(a) { + } + m1.foo2Export = foo2Export; + function foo3Export() { + } + m1.foo3Export = foo3Export; + function foo4Export() { + } +})(m1 || (m1 = {})); +m1.fooExport(); +var myvar = new m1.m2.c(); +var m2; +(function (m2) { + (function (m3) { + var c = (function () { + function c() { + } + return c; + })(); + m3.c = c; + })(m2.m3 || (m2.m3 = {})); + var m3 = m2.m3; +})(m2 || (m2 = {})); +new m2.m3.c(); +var m3; +(function (m3) { + (function (m4) { + (function (m5) { + var c = (function () { + function c() { + } + return c; + })(); + m5.c = c; + })(m4.m5 || (m4.m5 = {})); + var m5 = m4.m5; + })(m3.m4 || (m3.m4 = {})); + var m4 = m3.m4; +})(m3 || (m3 = {})); +new m3.m4.m5.c(); +var m4; +(function (m4) { + (function (m5) { + (function (m6) { + (function (m7) { + var c = (function () { + function c() { + } + return c; + })(); + m7.c = c; + })(m6.m7 || (m6.m7 = {})); + var m7 = m6.m7; + })(m5.m6 || (m5.m6 = {})); + var m6 = m5.m6; + })(m4.m5 || (m4.m5 = {})); + var m5 = m4.m5; +})(m4 || (m4 = {})); +new m4.m5.m6.m7.c(); +var m5; +(function (m5) { + (function (m6) { + (function (m7) { + (function (m8) { + var c = (function () { + function c() { + } + return c; + })(); + m8.c = c; + })(m7.m8 || (m7.m8 = {})); + var m8 = m7.m8; + })(m6.m7 || (m6.m7 = {})); + var m7 = m6.m7; + })(m5.m6 || (m5.m6 = {})); + var m6 = m5.m6; +})(m5 || (m5 = {})); +new m5.m6.m7.m8.c(); +var m6; +(function (m6) { + (function (m7) { + (function (m8) { + var c = (function () { + function c() { + } + return c; + })(); + m8.c = c; + })(m7.m8 || (m7.m8 = {})); + var m8 = m7.m8; + })(m6.m7 || (m6.m7 = {})); + var m7 = m6.m7; +})(m6 || (m6 = {})); +new m6.m7.m8.c(); +var m7; +(function (m7) { + (function (m8) { + (function (m9) { + var c = (function () { + function c() { + } + return c; + })(); + m9.c = c; + var d = (function () { + function d() { + } + return d; + })(); + var e = (function () { + function e() { + } + return e; + })(); + m9.e = e; + })(m8.m9 || (m8.m9 = {})); + var m9 = m8.m9; + })(m7.m8 || (m7.m8 = {})); + var m8 = m7.m8; +})(m7 || (m7 = {})); +new m7.m8.m9.c(); + + +//// [commentsModules.d.ts] diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.js b/tests/baselines/reference/commentsMultiModuleMultiFile.js new file mode 100644 index 0000000000000..008c7d3d53fe2 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.js @@ -0,0 +1,106 @@ +//// [tests/cases/compiler/commentsMultiModuleMultiFile.ts] //// + +//// [commentsMultiModuleMultiFile_0.ts] + +/** this is multi declare module*/ +export module multiM { + /// class b comment + export class b { + } +} +/** thi is multi module 2*/ +export module multiM { + /** class c comment*/ + export class c { + } + + // class e comment + export class e { + } +} + +new multiM.b(); +new multiM.c(); + +//// [commentsMultiModuleMultiFile_1.ts] +import m = require('commentsMultiModuleMultiFile_0'); +/** this is multi module 3 comment*/ +export module multiM { + /** class d comment*/ + export class d { + } + + /// class f comment + export class f { + } +} +new multiM.d(); + +//// [commentsMultiModuleMultiFile_0.js] +define(["require", "exports"], function (require, exports) { + (function (multiM) { + var b = (function () { + function b() { + } + return b; + })(); + multiM.b = b; + })(exports.multiM || (exports.multiM = {})); + var multiM = exports.multiM; + (function (multiM) { + var c = (function () { + function c() { + } + return c; + })(); + multiM.c = c; + var e = (function () { + function e() { + } + return e; + })(); + multiM.e = e; + })(exports.multiM || (exports.multiM = {})); + var multiM = exports.multiM; + new multiM.b(); + new multiM.c(); +}); +//// [commentsMultiModuleMultiFile_1.js] +define(["require", "exports"], function (require, exports) { + (function (multiM) { + var d = (function () { + function d() { + } + return d; + })(); + multiM.d = d; + var f = (function () { + function f() { + } + return f; + })(); + multiM.f = f; + })(exports.multiM || (exports.multiM = {})); + var multiM = exports.multiM; + new multiM.d(); +}); + + +//// [commentsMultiModuleMultiFile_0.d.ts] +export declare module multiM { + class b { + } +} +export declare module multiM { + class c { + } + class e { + } +} +//// [commentsMultiModuleMultiFile_1.d.ts] +export declare module multiM { + class d { + } + class f { + } +} diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.js b/tests/baselines/reference/commentsMultiModuleSingleFile.js new file mode 100644 index 0000000000000..093e9b78bd224 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.js @@ -0,0 +1,62 @@ +//// [commentsMultiModuleSingleFile.ts] + +/** this is multi declare module*/ +module multiM { + /** class b*/ + export class b { + } + + // class d + export class d { + } +} + +/// this is multi module 2 +module multiM { + /** class c comment*/ + export class c { + } + + /// class e + export class e { + } +} +new multiM.b(); +new multiM.c(); + +//// [commentsMultiModuleSingleFile.js] +var multiM; +(function (multiM) { + var b = (function () { + function b() { + } + return b; + })(); + multiM.b = b; + var d = (function () { + function d() { + } + return d; + })(); + multiM.d = d; +})(multiM || (multiM = {})); +var multiM; +(function (multiM) { + var c = (function () { + function c() { + } + return c; + })(); + multiM.c = c; + var e = (function () { + function e() { + } + return e; + })(); + multiM.e = e; +})(multiM || (multiM = {})); +new multiM.b(); +new multiM.c(); + + +//// [commentsMultiModuleSingleFile.d.ts] diff --git a/tests/baselines/reference/commentsOnObjectLiteral1.js b/tests/baselines/reference/commentsOnObjectLiteral1.js new file mode 100644 index 0000000000000..1c47ed68d8d4c --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral1.js @@ -0,0 +1,11 @@ +//// [commentsOnObjectLiteral1.ts] +var Person = makeClass( + /** + @scope Person + */ + { + } +); + +//// [commentsOnObjectLiteral1.js] +var Person = makeClass({}); diff --git a/tests/baselines/reference/commentsOnObjectLiteral2.js b/tests/baselines/reference/commentsOnObjectLiteral2.js new file mode 100644 index 0000000000000..cc64db96c016c --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral2.js @@ -0,0 +1,20 @@ +//// [commentsOnObjectLiteral2.ts] +var Person = makeClass( + { + /** + This is just another way to define a constructor. + @constructs + @param {string} name The name of the person. + */ + initialize: function(name) { + this.name = name; + }, + } +); + +//// [commentsOnObjectLiteral2.js] +var Person = makeClass({ + initialize: function (name) { + this.name = name; + } +}); diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.errors.txt b/tests/baselines/reference/commentsOnObjectLiteral3.errors.txt new file mode 100644 index 0000000000000..d9a276615f496 --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral3.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/commentsOnObjectLiteral3.ts (2 errors) ==== + + var v = { + //property + prop: 1, + //property + func: function () { + }, + //PropertyName + CallSignature + func1() { }, + //getter + get a() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.prop; + }, + //setter + set a(value) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + this.prop = value; + } + }; + \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.errors.txt b/tests/baselines/reference/commentsOnObjectLiteral4.errors.txt new file mode 100644 index 0000000000000..91cf41d82a34c --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral4.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/commentsOnObjectLiteral4.ts (1 errors) ==== + + var v = { + /** + * @type {number} + */ + get bar(): number { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this._bar; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnReturnStatement1.js b/tests/baselines/reference/commentsOnReturnStatement1.js new file mode 100644 index 0000000000000..a29cab364c438 --- /dev/null +++ b/tests/baselines/reference/commentsOnReturnStatement1.js @@ -0,0 +1,21 @@ +//// [commentsOnReturnStatement1.ts] +class DebugClass { + public static debugFunc() { + // Start Debugger Test Code + var i = 0; + + // End Debugger Test Code + return true; + } +} + +//// [commentsOnReturnStatement1.js] +var DebugClass = (function () { + function DebugClass() { + } + DebugClass.debugFunc = function () { + var i = 0; + return true; + }; + return DebugClass; +})(); diff --git a/tests/baselines/reference/commentsOnStaticMembers.js b/tests/baselines/reference/commentsOnStaticMembers.js new file mode 100644 index 0000000000000..c7cd12d8522d2 --- /dev/null +++ b/tests/baselines/reference/commentsOnStaticMembers.js @@ -0,0 +1,30 @@ +//// [commentsOnStaticMembers.ts] + +class test { + /** + * p1 comment appears in output + */ + public static p1: string = ""; + /** + * p2 comment does not appear in output + */ + public static p2: string; + + /** + * p3 comment appears in output + */ + private static p3: string = ""; + /** + * p4 comment does not appear in output + */ + private static p4: string; +} + +//// [commentsOnStaticMembers.js] +var test = (function () { + function test() { + } + test.p1 = ""; + test.p3 = ""; + return test; +})(); diff --git a/tests/baselines/reference/commentsOverloads.js b/tests/baselines/reference/commentsOverloads.js new file mode 100644 index 0000000000000..c359c949f3bf8 --- /dev/null +++ b/tests/baselines/reference/commentsOverloads.js @@ -0,0 +1,259 @@ +//// [commentsOverloads.ts] +/** this is signature 1*/ +function f1(/**param a*/a: number): number; +function f1(b: string): number; +function f1(aOrb: any) { + return 10; +} +f1("hello"); +f1(10); +function f2(a: number): number; +/** this is signature 2*/ +function f2(b: string): number; +/** this is f2 var comment*/ +function f2(aOrb: any) { + return 10; +} +f2("hello"); +f2(10); +function f3(a: number): number; +function f3(b: string): number; +function f3(aOrb: any) { + return 10; +} +f3("hello"); +f3(10); +/** this is signature 4 - with number parameter*/ +function f4(/**param a*/a: number): number; +/** this is signature 4 - with string parameter*/ +function f4(b: string): number; +function f4(aOrb: any) { + return 10; +} +f4("hello"); +f4(10); +interface i1 { + /**this signature 1*/ + (/**param a*/ a: number): number; + /**this is signature 2*/ + (b: string): number; + /** foo 1*/ + foo(a: number): number; + /** foo 2*/ + foo(b: string): number; + // foo 3 + foo(arr: number[]): number; + /** foo 4 */ + foo(arr: string[]): number; + + foo2(a: number): number; + /** foo2 2*/ + foo2(b: string): number; + foo3(a: number): number; + foo3(b: string): number; + /** foo4 1*/ + foo4(a: number): number; + foo4(b: string): number; + /** foo4 any */ + foo4(c: any): any; + /// new 1 + new (a: string); + /** new 1*/ + new (b: number); +} +var i1_i: i1; +interface i2 { + new (a: string); + /** new 2*/ + new (b: number); + (a: number): number; + /**this is signature 2*/ + (b: string): number; +} +var i2_i: i2; +interface i3 { + /** new 1*/ + new (a: string); + /** new 2*/ + new (b: number); + /**this is signature 1*/ + (a: number): number; + (b: string): number; +} +var i3_i: i3; +interface i4 { + new (a: string); + new (b: number); + (a: number): number; + (b: string): number; +} +class c { + public prop1(a: number): number; + public prop1(b: string): number; + public prop1(aorb: any) { + return 10; + } + /** prop2 1*/ + public prop2(a: number): number; + public prop2(b: string): number; + public prop2(aorb: any) { + return 10; + } + public prop3(a: number): number; + /** prop3 2*/ + public prop3(b: string): number; + public prop3(aorb: any) { + return 10; + } + /** prop4 1*/ + public prop4(a: number): number; + /** prop4 2*/ + public prop4(b: string): number; + public prop4(aorb: any) { + return 10; + } + /** prop5 1*/ + public prop5(a: number): number; + /** prop5 2*/ + public prop5(b: string): number; + /** Prop5 implementaion*/ + public prop5(aorb: any) { + return 10; + } +} +class c1 { + constructor(a: number); + constructor(b: string); + constructor(aorb: any) { + } +} +class c2 { + /** c2 1*/ + constructor(a: number); + // c2 2 + constructor(b: string); + constructor(aorb: any) { + } +} +class c3 { + constructor(a: number); + /** c3 2*/ + constructor(b: string); + constructor(aorb: any) { + } +} +class c4 { + /** c4 1*/ + constructor(a: number); + /** c4 2*/ + constructor(b: string); + /** c4 3 */ + constructor(aorb: any) { + } +} +class c5 { + /** c5 1*/ + constructor(a: number); + /** c5 2*/ + constructor(b: string); + /** c5 implementation*/ + constructor(aorb: any) { + } +} +var c_i = new c(); + +var c1_i_1 = new c1(10); +var c1_i_2 = new c1("hello"); +var c2_i_1 = new c2(10); +var c2_i_2 = new c2("hello"); +var c3_i_1 = new c3(10); +var c3_i_2 = new c3("hello"); +var c4_i_1 = new c4(10); +var c4_i_2 = new c4("hello"); +var c5_i_1 = new c5(10); +var c5_i_2 = new c5("hello"); + + +//// [commentsOverloads.js] +function f1(aOrb) { + return 10; +} +f1("hello"); +f1(10); +function f2(aOrb) { + return 10; +} +f2("hello"); +f2(10); +function f3(aOrb) { + return 10; +} +f3("hello"); +f3(10); +function f4(aOrb) { + return 10; +} +f4("hello"); +f4(10); +var i1_i; +var i2_i; +var i3_i; +var c = (function () { + function c() { + } + c.prototype.prop1 = function (aorb) { + return 10; + }; + c.prototype.prop2 = function (aorb) { + return 10; + }; + c.prototype.prop3 = function (aorb) { + return 10; + }; + c.prototype.prop4 = function (aorb) { + return 10; + }; + c.prototype.prop5 = function (aorb) { + return 10; + }; + return c; +})(); +var c1 = (function () { + function c1(aorb) { + } + return c1; +})(); +var c2 = (function () { + function c2(aorb) { + } + return c2; +})(); +var c3 = (function () { + function c3(aorb) { + } + return c3; +})(); +var c4 = (function () { + function c4(aorb) { + } + return c4; +})(); +var c5 = (function () { + function c5(aorb) { + } + return c5; +})(); +var c_i = new c(); +var c1_i_1 = new c1(10); +var c1_i_2 = new c1("hello"); +var c2_i_1 = new c2(10); +var c2_i_2 = new c2("hello"); +var c3_i_1 = new c3(10); +var c3_i_2 = new c3("hello"); +var c4_i_1 = new c4(10); +var c4_i_2 = new c4("hello"); +var c5_i_1 = new c5(10); +var c5_i_2 = new c5("hello"); + + +//// [commentsOverloads.d.ts] diff --git a/tests/baselines/reference/commentsPropertySignature1.js b/tests/baselines/reference/commentsPropertySignature1.js new file mode 100644 index 0000000000000..f216ac9ba9490 --- /dev/null +++ b/tests/baselines/reference/commentsPropertySignature1.js @@ -0,0 +1,11 @@ +//// [commentsPropertySignature1.ts] +var a = { + /** own x*/ + x: 0 +}; + + +//// [commentsPropertySignature1.js] +var a = { + x: 0 +}; diff --git a/tests/baselines/reference/commentsVarDecl.js b/tests/baselines/reference/commentsVarDecl.js new file mode 100644 index 0000000000000..2d115b44fa64b --- /dev/null +++ b/tests/baselines/reference/commentsVarDecl.js @@ -0,0 +1,63 @@ +//// [commentsVarDecl.ts] + +/** Variable comments*/ +var myVariable = 10; + +/** This is another variable comment*/ +var anotherVariable = 30; + +// shouldn't appear +var aVar = ""; + +/** this is multiline comment + * All these variables are of number type */ +var anotherAnotherVariable = 70; + +/** Triple slash multiline comment*/ +/** another line in the comment*/ +/** comment line 2*/ +var x = 70; + +/** Triple slash comment on the assignement shouldnt be in .d.ts file*/ +x = myVariable; + +/** triple slash comment1*/ +/** jsdocstyle comment - only this comment should be in .d.ts file*/ +var n = 30; + +/** var deckaration with comment on type as well*/ +var y = /** value comment */ 20; + +/// var deckaration with comment on type as well +var yy = + /// value comment + 20; + +/** comment2 */ +var z = /** lambda comment */ (x: number, y: number) => x + y; + +var z2: /** type comment*/ (x: number) => string; + +var x2 = z2; + +var n4: (x: number) => string; +n4 = z2; + +//// [commentsVarDecl.js] +var myVariable = 10; +var anotherVariable = 30; +var aVar = ""; +var anotherAnotherVariable = 70; +var x = 70; +x = myVariable; +var n = 30; +var y = 20; +var yy = 20; +var z = function (x, y) { return x + y; }; +var z2; +var x2 = z2; +var n4; +n4 = z2; + + +//// [commentsVarDecl.d.ts] diff --git a/tests/baselines/reference/commentsVariableStatement1.js b/tests/baselines/reference/commentsVariableStatement1.js new file mode 100644 index 0000000000000..dcdf0420abeca --- /dev/null +++ b/tests/baselines/reference/commentsVariableStatement1.js @@ -0,0 +1,10 @@ +//// [commentsVariableStatement1.ts] + +/** Comment */ +var v = 1; + +//// [commentsVariableStatement1.js] +var v = 1; + + +//// [commentsVariableStatement1.d.ts] diff --git a/tests/baselines/reference/commentsdoNotEmitComments.js b/tests/baselines/reference/commentsdoNotEmitComments.js new file mode 100644 index 0000000000000..252e37fdebcd1 --- /dev/null +++ b/tests/baselines/reference/commentsdoNotEmitComments.js @@ -0,0 +1,134 @@ +//// [commentsdoNotEmitComments.ts] + +/** Variable comments*/ +var myVariable = 10; + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +} + +/** variable with function type comment*/ +var fooVar: () => void; +foo(50); +fooVar(); + +/**class comment*/ +class c { + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; + + /** function comment */ + public myFoo() { + return this.b; + } + + /** getter comment*/ + public get prop1() { + return this.b; + } + + /** setter comment*/ + public set prop1(val: number) { + this.b = val; + } + + /** overload signature1*/ + public foo1(a: number): string; + /** Overload signature 2*/ + public foo1(b: string): string; + /** overload implementation signature*/ + public foo1(aOrb) { + return aOrb.toString(); + } +} + +/**instance comment*/ +var i = new c(); + +/** interface comments*/ +interface i1 { + /** caller comments*/ + (a: number): number; + + /** new comments*/ + new (b: string); + + /**indexer property*/ + [a: number]: string; + + /** function property;*/ + myFoo(/*param prop*/a: number): string; + + /** prop*/ + prop: string; +} + +/**interface instance comments*/ +var i1_i: i1; + +/** this is module comment*/ +module m1 { + /** class b */ + export class b { + constructor(public x: number) { + + } + } + + /// module m2 + export module m2 { + } +} + +/// this is x +declare var x; + + +//// [commentsdoNotEmitComments.js] +var myVariable = 10; +function foo(p) { +} +var fooVar; +foo(50); +fooVar(); +var c = (function () { + function c() { + this.b = 10; + } + c.prototype.myFoo = function () { + return this.b; + }; + Object.defineProperty(c.prototype, "prop1", { + get: function () { + return this.b; + }, + set: function (val) { + this.b = val; + }, + enumerable: true, + configurable: true + }); + c.prototype.foo1 = function (aOrb) { + return aOrb.toString(); + }; + return c; +})(); +var i = new c(); +var i1_i; +var m1; +(function (m1) { + var b = (function () { + function b(x) { + this.x = x; + } + return b; + })(); + m1.b = b; +})(m1 || (m1 = {})); + + +//// [commentsdoNotEmitComments.d.ts] diff --git a/tests/baselines/reference/commentsemitComments.js b/tests/baselines/reference/commentsemitComments.js new file mode 100644 index 0000000000000..e9c55e4d6015e --- /dev/null +++ b/tests/baselines/reference/commentsemitComments.js @@ -0,0 +1,134 @@ +//// [commentsemitComments.ts] + +/** Variable comments*/ +var myVariable = 10; + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +} + +/** variable with function type comment*/ +var fooVar: () => void; +foo(50); +fooVar(); + +/**class comment*/ +class c { + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; + + /** function comment */ + public myFoo() { + return this.b; + } + + /** getter comment*/ + public get prop1() { + return this.b; + } + + /** setter comment*/ + public set prop1(val: number) { + this.b = val; + } + + /** overload signature1*/ + public foo1(a: number): string; + /** Overload signature 2*/ + public foo1(b: string): string; + /** overload implementation signature*/ + public foo1(aOrb) { + return aOrb.toString(); + } +} + +/**instance comment*/ +var i = new c(); + +/** interface comments*/ +interface i1 { + /** caller comments*/ + (a: number): number; + + /** new comments*/ + new (b: string); + + /**indexer property*/ + [a: number]: string; + + /** function property;*/ + myFoo(/*param prop*/a: number): string; + + /** prop*/ + prop: string; +} + +/**interface instance comments*/ +var i1_i: i1; + +/** this is module comment*/ +module m1 { + /** class b */ + export class b { + constructor(public x: number) { + + } + } + + /// module m2 + export module m2 { + } +} + +/// this is x +declare var x; + + +//// [commentsemitComments.js] +var myVariable = 10; +function foo(p) { +} +var fooVar; +foo(50); +fooVar(); +var c = (function () { + function c() { + this.b = 10; + } + c.prototype.myFoo = function () { + return this.b; + }; + Object.defineProperty(c.prototype, "prop1", { + get: function () { + return this.b; + }, + set: function (val) { + this.b = val; + }, + enumerable: true, + configurable: true + }); + c.prototype.foo1 = function (aOrb) { + return aOrb.toString(); + }; + return c; +})(); +var i = new c(); +var i1_i; +var m1; +(function (m1) { + var b = (function () { + function b(x) { + this.x = x; + } + return b; + })(); + m1.b = b; +})(m1 || (m1 = {})); + + +//// [commentsemitComments.d.ts] diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.js b/tests/baselines/reference/commonJSImportAsPrimaryExpression.js new file mode 100644 index 0000000000000..9ae5a21c86295 --- /dev/null +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/externalModules/commonJSImportAsPrimaryExpression.ts] //// + +//// [foo_0.ts] +export class C1 { + m1 = 42; + static s1 = true; +} + +//// [foo_1.ts] +import foo = require("./foo_0"); +if(foo.C1.s1){ + // Should cause runtime import +} + + +//// [foo_0.js] +var C1 = (function () { + function C1() { + this.m1 = 42; + } + C1.s1 = true; + return C1; +})(); +exports.C1 = C1; +//// [foo_1.js] +var foo = require("./foo_0"); +if (foo.C1.s1) { +} diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js new file mode 100644 index 0000000000000..266ffe4698afe --- /dev/null +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.js @@ -0,0 +1,54 @@ +//// [tests/cases/conformance/externalModules/commonJSImportNotAsPrimaryExpression.ts] //// + +//// [foo_0.ts] +export class C1 { + m1 = 42; + static s1 = true; +} + +export interface I1 { + name: string; + age: number; +} + +export module M1 { + export interface I2 { + foo: string; + } +} + +export enum E1 { + A,B,C +} + +//// [foo_1.ts] +import foo = require("./foo_0"); +// None of the below should cause a runtime dependency on foo_0 +import f = foo.M1; +var i: f.I2; +var x: foo.C1 = <{m1: number}>{}; +var y: typeof foo.C1.s1 = false; +var z: foo.M1.I2; +var e: number = 0; + +//// [foo_0.js] +var C1 = (function () { + function C1() { + this.m1 = 42; + } + C1.s1 = true; + return C1; +})(); +exports.C1 = C1; +(function (E1) { + E1[E1["A"] = 0] = "A"; + E1[E1["B"] = 1] = "B"; + E1[E1["C"] = 2] = "C"; +})(exports.E1 || (exports.E1 = {})); +var E1 = exports.E1; +//// [foo_1.js] +var i; +var x = {}; +var y = false; +var z; +var e = 0; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js new file mode 100644 index 0000000000000..a0009c5546379 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -0,0 +1,367 @@ +//// [comparisonOperatorWithIdenticalObjects.ts] +class A1 { + public a: string; + public b: number; + public c: boolean; + public d: any; + public e: Object; + public fn(a: string): string { + return null; + } +} +class B1 { + public a: string; + public b: number; + public c: boolean; + public d: any; + public e: Object; + public fn(b: string): string { + return null; + } +} + +class Base { + private a: string; + private fn(b: string): string { + return null; + } +} +class A2 extends Base { } +class B2 extends Base { } + +interface A3 { f(a: number): string; } +interface B3 { f(a: number): string; } + +interface A4 { new (a: string): A1; } +interface B4 { new (a: string): B1; } + +interface A5 { [x: number]: number; } +interface B5 { [x: number]: number; } + +interface A6 { [x: string]: string; } +interface B6 { [x: string]: string; } + +var a1: A1; +var a2: A2; +var a3: A3; +var a4: A4; +var a5: A5; +var a6: A6; + +var b1: B1; +var b2: B2; +var b3: B3; +var b4: B4; +var b5: B5; +var b6: B6; + +var base1: Base; +var base2: Base; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = base1 < base2; +var r1a3 = a2 < b2; +var r1a4 = a3 < b3; +var r1a5 = a4 < b4; +var r1a6 = a5 < b5; +var r1a7 = a6 < b6; + +var r1b1 = b1 < a1; +var r1b2 = base2 < base1; +var r1b3 = b2 < a2; +var r1b4 = b3 < a3; +var r1b5 = b4 < a4; +var r1b6 = b5 < a5; +var r1b7 = b6 < a6; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = base1 > base2; +var r2a3 = a2 > b2; +var r2a4 = a3 > b3; +var r2a5 = a4 > b4; +var r2a6 = a5 > b5; +var r2a7 = a6 > b6; + +var r2b1 = b1 > a1; +var r2b2 = base2 > base1; +var r2b3 = b2 > a2; +var r2b4 = b3 > a3; +var r2b5 = b4 > a4; +var r2b6 = b5 > a5; +var r2b7 = b6 > a6; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = base1 <= base2; +var r3a3 = a2 <= b2; +var r3a4 = a3 <= b3; +var r3a5 = a4 <= b4; +var r3a6 = a5 <= b5; +var r3a7 = a6 <= b6; + +var r3b1 = b1 <= a1; +var r3b2 = base2 <= base1; +var r3b3 = b2 <= a2; +var r3b4 = b3 <= a3; +var r3b5 = b4 <= a4; +var r3b6 = b5 <= a5; +var r3b7 = b6 <= a6; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = base1 >= base2; +var r4a3 = a2 >= b2; +var r4a4 = a3 >= b3; +var r4a5 = a4 >= b4; +var r4a6 = a5 >= b5; +var r4a7 = a6 >= b6; + +var r4b1 = b1 >= a1; +var r4b2 = base2 >= base1; +var r4b3 = b2 >= a2; +var r4b4 = b3 >= a3; +var r4b5 = b4 >= a4; +var r4b6 = b5 >= a5; +var r4b7 = b6 >= a6; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = base1 == base2; +var r5a3 = a2 == b2; +var r5a4 = a3 == b3; +var r5a5 = a4 == b4; +var r5a6 = a5 == b5; +var r5a7 = a6 == b6; + +var r5b1 = b1 == a1; +var r5b2 = base2 == base1; +var r5b3 = b2 == a2; +var r5b4 = b3 == a3; +var r5b5 = b4 == a4; +var r5b6 = b5 == a5; +var r5b7 = b6 == a6; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = base1 != base2; +var r6a3 = a2 != b2; +var r6a4 = a3 != b3; +var r6a5 = a4 != b4; +var r6a6 = a5 != b5; +var r6a7 = a6 != b6; + +var r6b1 = b1 != a1; +var r6b2 = base2 != base1; +var r6b3 = b2 != a2; +var r6b4 = b3 != a3; +var r6b5 = b4 != a4; +var r6b6 = b5 != a5; +var r6b7 = b6 != a6; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = base1 === base2; +var r7a3 = a2 === b2; +var r7a4 = a3 === b3; +var r7a5 = a4 === b4; +var r7a6 = a5 === b5; +var r7a7 = a6 === b6; + +var r7b1 = b1 === a1; +var r7b2 = base2 === base1; +var r7b3 = b2 === a2; +var r7b4 = b3 === a3; +var r7b5 = b4 === a4; +var r7b6 = b5 === a5; +var r7b7 = b6 === a6; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = base1 !== base2; +var r8a3 = a2 !== b2; +var r8a4 = a3 !== b3; +var r8a5 = a4 !== b4; +var r8a6 = a5 !== b5; +var r8a7 = a6 !== b6; + +var r8b1 = b1 !== a1; +var r8b2 = base2 !== base1; +var r8b3 = b2 !== a2; +var r8b4 = b3 !== a3; +var r8b5 = b4 !== a4; +var r8b6 = b5 !== a5; +var r8b7 = b6 !== a6; + +//// [comparisonOperatorWithIdenticalObjects.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A1 = (function () { + function A1() { + } + A1.prototype.fn = function (a) { + return null; + }; + return A1; +})(); +var B1 = (function () { + function B1() { + } + B1.prototype.fn = function (b) { + return null; + }; + return B1; +})(); +var Base = (function () { + function Base() { + } + Base.prototype.fn = function (b) { + return null; + }; + return Base; +})(); +var A2 = (function (_super) { + __extends(A2, _super); + function A2() { + _super.apply(this, arguments); + } + return A2; +})(Base); +var B2 = (function (_super) { + __extends(B2, _super); + function B2() { + _super.apply(this, arguments); + } + return B2; +})(Base); +var a1; +var a2; +var a3; +var a4; +var a5; +var a6; +var b1; +var b2; +var b3; +var b4; +var b5; +var b6; +var base1; +var base2; +var r1a1 = a1 < b1; +var r1a2 = base1 < base2; +var r1a3 = a2 < b2; +var r1a4 = a3 < b3; +var r1a5 = a4 < b4; +var r1a6 = a5 < b5; +var r1a7 = a6 < b6; +var r1b1 = b1 < a1; +var r1b2 = base2 < base1; +var r1b3 = b2 < a2; +var r1b4 = b3 < a3; +var r1b5 = b4 < a4; +var r1b6 = b5 < a5; +var r1b7 = b6 < a6; +var r2a1 = a1 > b1; +var r2a2 = base1 > base2; +var r2a3 = a2 > b2; +var r2a4 = a3 > b3; +var r2a5 = a4 > b4; +var r2a6 = a5 > b5; +var r2a7 = a6 > b6; +var r2b1 = b1 > a1; +var r2b2 = base2 > base1; +var r2b3 = b2 > a2; +var r2b4 = b3 > a3; +var r2b5 = b4 > a4; +var r2b6 = b5 > a5; +var r2b7 = b6 > a6; +var r3a1 = a1 <= b1; +var r3a2 = base1 <= base2; +var r3a3 = a2 <= b2; +var r3a4 = a3 <= b3; +var r3a5 = a4 <= b4; +var r3a6 = a5 <= b5; +var r3a7 = a6 <= b6; +var r3b1 = b1 <= a1; +var r3b2 = base2 <= base1; +var r3b3 = b2 <= a2; +var r3b4 = b3 <= a3; +var r3b5 = b4 <= a4; +var r3b6 = b5 <= a5; +var r3b7 = b6 <= a6; +var r4a1 = a1 >= b1; +var r4a2 = base1 >= base2; +var r4a3 = a2 >= b2; +var r4a4 = a3 >= b3; +var r4a5 = a4 >= b4; +var r4a6 = a5 >= b5; +var r4a7 = a6 >= b6; +var r4b1 = b1 >= a1; +var r4b2 = base2 >= base1; +var r4b3 = b2 >= a2; +var r4b4 = b3 >= a3; +var r4b5 = b4 >= a4; +var r4b6 = b5 >= a5; +var r4b7 = b6 >= a6; +var r5a1 = a1 == b1; +var r5a2 = base1 == base2; +var r5a3 = a2 == b2; +var r5a4 = a3 == b3; +var r5a5 = a4 == b4; +var r5a6 = a5 == b5; +var r5a7 = a6 == b6; +var r5b1 = b1 == a1; +var r5b2 = base2 == base1; +var r5b3 = b2 == a2; +var r5b4 = b3 == a3; +var r5b5 = b4 == a4; +var r5b6 = b5 == a5; +var r5b7 = b6 == a6; +var r6a1 = a1 != b1; +var r6a2 = base1 != base2; +var r6a3 = a2 != b2; +var r6a4 = a3 != b3; +var r6a5 = a4 != b4; +var r6a6 = a5 != b5; +var r6a7 = a6 != b6; +var r6b1 = b1 != a1; +var r6b2 = base2 != base1; +var r6b3 = b2 != a2; +var r6b4 = b3 != a3; +var r6b5 = b4 != a4; +var r6b6 = b5 != a5; +var r6b7 = b6 != a6; +var r7a1 = a1 === b1; +var r7a2 = base1 === base2; +var r7a3 = a2 === b2; +var r7a4 = a3 === b3; +var r7a5 = a4 === b4; +var r7a6 = a5 === b5; +var r7a7 = a6 === b6; +var r7b1 = b1 === a1; +var r7b2 = base2 === base1; +var r7b3 = b2 === a2; +var r7b4 = b3 === a3; +var r7b5 = b4 === a4; +var r7b6 = b5 === a5; +var r7b7 = b6 === a6; +var r8a1 = a1 !== b1; +var r8a2 = base1 !== base2; +var r8a3 = a2 !== b2; +var r8a4 = a3 !== b3; +var r8a5 = a4 !== b4; +var r8a6 = a5 !== b5; +var r8a7 = a6 !== b6; +var r8b1 = b1 !== a1; +var r8b2 = base2 !== base1; +var r8b3 = b2 !== a2; +var r8b4 = b3 !== a3; +var r8b5 = b4 !== a4; +var r8b6 = b5 !== a5; +var r8b7 = b6 !== a6; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js new file mode 100644 index 0000000000000..c5d64ff5f5511 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js @@ -0,0 +1,149 @@ +//// [comparisonOperatorWithIdenticalPrimitiveType.ts] +enum E { a, b, c } + +var a: number; +var b: boolean; +var c: string; +var d: void; +var e: E; + +// operator < +var ra1 = a < a; +var ra2 = b < b; +var ra3 = c < c; +var ra4 = d < d; +var ra5 = e < e; +var ra6 = null < null; +var ra7 = undefined < undefined; + +// operator > +var rb1 = a > a; +var rb2 = b > b; +var rb3 = c > c; +var rb4 = d > d; +var rb5 = e > e; +var rb6 = null > null; +var rb7 = undefined > undefined; + +// operator <= +var rc1 = a <= a; +var rc2 = b <= b; +var rc3 = c <= c; +var rc4 = d <= d; +var rc5 = e <= e; +var rc6 = null <= null; +var rc7 = undefined <= undefined; + +// operator >= +var rd1 = a >= a; +var rd2 = b >= b; +var rd3 = c >= c; +var rd4 = d >= d; +var rd5 = e >= e; +var rd6 = null >= null; +var rd7 = undefined >= undefined; + +// operator == +var re1 = a == a; +var re2 = b == b; +var re3 = c == c; +var re4 = d == d; +var re5 = e == e; +var re6 = null == null; +var re7 = undefined == undefined; + +// operator != +var rf1 = a != a; +var rf2 = b != b; +var rf3 = c != c; +var rf4 = d != d; +var rf5 = e != e; +var rf6 = null != null; +var rf7 = undefined != undefined; + +// operator === +var rg1 = a === a; +var rg2 = b === b; +var rg3 = c === c; +var rg4 = d === d; +var rg5 = e === e; +var rg6 = null === null; +var rg7 = undefined === undefined; + +// operator !== +var rh1 = a !== a; +var rh2 = b !== b; +var rh3 = c !== c; +var rh4 = d !== d; +var rh5 = e !== e; +var rh6 = null !== null; +var rh7 = undefined !== undefined; + +//// [comparisonOperatorWithIdenticalPrimitiveType.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var ra1 = a < a; +var ra2 = b < b; +var ra3 = c < c; +var ra4 = d < d; +var ra5 = e < e; +var ra6 = null < null; +var ra7 = undefined < undefined; +var rb1 = a > a; +var rb2 = b > b; +var rb3 = c > c; +var rb4 = d > d; +var rb5 = e > e; +var rb6 = null > null; +var rb7 = undefined > undefined; +var rc1 = a <= a; +var rc2 = b <= b; +var rc3 = c <= c; +var rc4 = d <= d; +var rc5 = e <= e; +var rc6 = null <= null; +var rc7 = undefined <= undefined; +var rd1 = a >= a; +var rd2 = b >= b; +var rd3 = c >= c; +var rd4 = d >= d; +var rd5 = e >= e; +var rd6 = null >= null; +var rd7 = undefined >= undefined; +var re1 = a == a; +var re2 = b == b; +var re3 = c == c; +var re4 = d == d; +var re5 = e == e; +var re6 = null == null; +var re7 = undefined == undefined; +var rf1 = a != a; +var rf2 = b != b; +var rf3 = c != c; +var rf4 = d != d; +var rf5 = e != e; +var rf6 = null != null; +var rf7 = undefined != undefined; +var rg1 = a === a; +var rg2 = b === b; +var rg3 = c === c; +var rg4 = d === d; +var rg5 = e === e; +var rg6 = null === null; +var rg7 = undefined === undefined; +var rh1 = a !== a; +var rh2 = b !== b; +var rh3 = c !== c; +var rh4 = d !== d; +var rh5 = e !== e; +var rh6 = null !== null; +var rh7 = undefined !== undefined; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js new file mode 100644 index 0000000000000..2894f730b324f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js @@ -0,0 +1,23 @@ +//// [comparisonOperatorWithIdenticalTypeParameter.ts] +function foo(t: T) { + var r1 = t < t; + var r2 = t > t; + var r3 = t <= t; + var r4 = t >= t; + var r5 = t == t; + var r6 = t != t; + var r7 = t === t; + var r8 = t !== t; +} + +//// [comparisonOperatorWithIdenticalTypeParameter.js] +function foo(t) { + var r1 = t < t; + var r2 = t > t; + var r3 = t <= t; + var r4 = t >= t; + var r5 = t == t; + var r6 = t != t; + var r7 = t === t; + var r8 = t !== t; +} diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt new file mode 100644 index 0000000000000..c866a79e23cc8 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt @@ -0,0 +1,361 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts (96 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + class C { + public c: string; + } + + var a1: { fn(): Base }; + var b1: { new (): Base }; + + var a2: { fn(a: number, b: string): void }; + var b2: { fn(a: string): void }; + + var a3: { fn(a: Base, b: string): void }; + var b3: { fn(a: Derived, b: Base): void }; + + var a4: { fn(): Base }; + var b4: { fn(): C }; + + var a5: { fn(a?: Base): void }; + var b5: { fn(a?: C): void }; + + var a6: { fn(...a: Base[]): void }; + var b6: { fn(...a: C[]): void }; + + var a7: { fn(t: T): T }; + var b7: { fn(t: T[]): T }; + + // operator < + var r1a1 = a1 < b1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r1a3 = a3 < b3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r1a4 = a4 < b4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r1a5 = a5 < b5; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r1a6 = a6 < b6; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r1b3 = b3 < a3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r1b4 = b4 < a4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r1b5 = b5 < a5; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r1b6 = b6 < a6; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r2a3 = a3 > b3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r2a4 = a4 > b4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r2a5 = a5 > b5; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r2a6 = a6 > b6; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r2b3 = b3 > a3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r2b4 = b4 > a4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r2b5 = b5 > a5; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r2b6 = b6 > a6; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r3a3 = a3 <= b3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r3a4 = a4 <= b4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r3a5 = a5 <= b5; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r3a6 = a6 <= b6; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r3b3 = b3 <= a3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r3b4 = b4 <= a4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r3b5 = b5 <= a5; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r3b6 = b6 <= a6; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r4a3 = a3 >= b3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r4a4 = a4 >= b4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r4a5 = a5 >= b5; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r4a6 = a6 >= b6; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r4b3 = b3 >= a3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r4b4 = b4 >= a4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r4b5 = b5 >= a5; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r4b6 = b6 >= a6; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r5a3 = a3 == b3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r5a4 = a4 == b4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r5a5 = a5 == b5; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r5a6 = a6 == b6; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r5b3 = b3 == a3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r5b4 = b4 == a4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r5b5 = b5 == a5; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r5b6 = b6 == a6; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r6a3 = a3 != b3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r6a4 = a4 != b4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r6a5 = a5 != b5; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r6a6 = a6 != b6; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r6b3 = b3 != a3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r6b4 = b4 != a4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r6b5 = b5 != a5; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r6b6 = b6 != a6; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r7a3 = a3 === b3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r7a4 = a4 === b4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r7a5 = a5 === b5; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r7a6 = a6 === b6; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r7b3 = b3 === a3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r7b4 = b4 === a4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r7b5 = b5 === a5; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r7b6 = b6 === a6; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. + var r8a3 = a3 !== b3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. + var r8a4 = a4 !== b4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. + var r8a5 = a5 !== b5; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. + var r8a6 = a6 !== b6; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. + var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. + var r8b3 = b3 !== a3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. + var r8b4 = b4 !== a4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. + var r8b5 = b5 !== a5; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. + var r8b6 = b6 !== a6; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. + var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js new file mode 100644 index 0000000000000..3258d2a25c8b5 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -0,0 +1,320 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class C { + public c: string; +} + +var a1: { fn(): Base }; +var b1: { new (): Base }; + +var a2: { fn(a: number, b: string): void }; +var b2: { fn(a: string): void }; + +var a3: { fn(a: Base, b: string): void }; +var b3: { fn(a: Derived, b: Base): void }; + +var a4: { fn(): Base }; +var b4: { fn(): C }; + +var a5: { fn(a?: Base): void }; +var b5: { fn(a?: C): void }; + +var a6: { fn(...a: Base[]): void }; +var b6: { fn(...a: C[]): void }; + +var a7: { fn(t: T): T }; +var b7: { fn(t: T[]): T }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; + +//// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var C = (function () { + function C() { + } + return C; +})(); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var a7; +var b7; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt new file mode 100644 index 0000000000000..d0cfd9493b8ac --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt @@ -0,0 +1,361 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts (96 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + class C { + public c: string; + } + + var a1: { fn(): Base }; + var b1: { new (): Base }; + + var a2: { new (a: number, b: string): Base }; + var b2: { new (a: string): Base }; + + var a3: { new (a: Base, b: string): Base }; + var b3: { new (a: Derived, b: Base): Base }; + + var a4: { new (): Base }; + var b4: { new (): C }; + + var a5: { new (a?: Base): Base }; + var b5: { new (a?: C): Base }; + + var a6: { new (...a: Base[]): Base }; + var b6: { new (...a: C[]): Base }; + + var a7: { new (t: T): T }; + var b7: { new (t: T[]): T }; + + // operator < + var r1a1 = a1 < b1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r1a3 = a3 < b3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r1a4 = a4 < b4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. + var r1a5 = a5 < b5; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r1a6 = a6 < b6; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r1b3 = b3 < a3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r1b4 = b4 < a4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. + var r1b5 = b5 < a5; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r1b6 = b6 < a6; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r2a3 = a3 > b3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r2a4 = a4 > b4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. + var r2a5 = a5 > b5; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r2a6 = a6 > b6; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r2b3 = b3 > a3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r2b4 = b4 > a4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. + var r2b5 = b5 > a5; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r2b6 = b6 > a6; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r3a3 = a3 <= b3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r3a4 = a4 <= b4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. + var r3a5 = a5 <= b5; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r3a6 = a6 <= b6; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r3b3 = b3 <= a3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r3b4 = b4 <= a4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. + var r3b5 = b5 <= a5; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r3b6 = b6 <= a6; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r4a3 = a3 >= b3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r4a4 = a4 >= b4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. + var r4a5 = a5 >= b5; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r4a6 = a6 >= b6; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r4b3 = b3 >= a3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r4b4 = b4 >= a4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. + var r4b5 = b5 >= a5; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r4b6 = b6 >= a6; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r5a3 = a3 == b3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r5a4 = a4 == b4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new () => Base' and 'new () => C'. + var r5a5 = a5 == b5; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r5a6 = a6 == b6; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r5b3 = b3 == a3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r5b4 = b4 == a4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new () => C' and 'new () => Base'. + var r5b5 = b5 == a5; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r5b6 = b6 == a6; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r6a3 = a3 != b3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r6a4 = a4 != b4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new () => Base' and 'new () => C'. + var r6a5 = a5 != b5; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r6a6 = a6 != b6; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r6b3 = b3 != a3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r6b4 = b4 != a4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new () => C' and 'new () => Base'. + var r6b5 = b5 != a5; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r6b6 = b6 != a6; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r7a3 = a3 === b3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r7a4 = a4 === b4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new () => Base' and 'new () => C'. + var r7a5 = a5 === b5; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r7a6 = a6 === b6; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r7b3 = b3 === a3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r7b4 = b4 === a4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new () => C' and 'new () => Base'. + var r7b5 = b5 === a5; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r7b6 = b6 === a6; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. + var r8a3 = a3 !== b3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. + var r8a4 = a4 !== b4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new () => Base' and 'new () => C'. + var r8a5 = a5 !== b5; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. + var r8a6 = a6 !== b6; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. + var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. + var r8b3 = b3 !== a3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. + var r8b4 = b4 !== a4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new () => C' and 'new () => Base'. + var r8b5 = b5 !== a5; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. + var r8b6 = b6 !== a6; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. + var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js new file mode 100644 index 0000000000000..fc5ea7b40b92e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -0,0 +1,320 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class C { + public c: string; +} + +var a1: { fn(): Base }; +var b1: { new (): Base }; + +var a2: { new (a: number, b: string): Base }; +var b2: { new (a: string): Base }; + +var a3: { new (a: Base, b: string): Base }; +var b3: { new (a: Derived, b: Base): Base }; + +var a4: { new (): Base }; +var b4: { new (): C }; + +var a5: { new (a?: Base): Base }; +var b5: { new (a?: C): Base }; + +var a6: { new (...a: Base[]): Base }; +var b6: { new (...a: C[]): Base }; + +var a7: { new (t: T): T }; +var b7: { new (t: T[]): T }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; + +//// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var C = (function () { + function C() { + } + return C; +})(); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var a7; +var b7; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt new file mode 100644 index 0000000000000..dda19ceaa1826 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt @@ -0,0 +1,240 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (64 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + class C { + public c: string; + } + + var a1: { [a: string]: string }; + var b1: { [b: string]: number }; + + var a2: { [index: string]: Base }; + var b2: { [index: string]: C }; + + var a3: { [index: number]: Base }; + var b3: { [index: number]: C }; + + var a4: { [index: number]: Derived }; + var b4: { [index: string]: Base }; + + // operator < + var r1a1 = a1 < b1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r1a3 = a3 < b3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r1a4 = a4 < b4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r1b1 = b1 < a1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r1b3 = b3 < a3; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r1b4 = b4 < a4; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator > + var r2a1 = a1 > b1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r2a3 = a3 > b3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r2a4 = a4 > b4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r2b1 = b1 > a1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r2b3 = b3 > a3; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r2b4 = b4 > a4; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator <= + var r3a1 = a1 <= b1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r3a3 = a3 <= b3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r3a4 = a4 <= b4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r3b1 = b1 <= a1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r3b3 = b3 <= a3; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r3b4 = b4 <= a4; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator >= + var r4a1 = a1 >= b1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r4a3 = a3 >= b3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r4a4 = a4 >= b4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r4b1 = b1 >= a1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r4b3 = b3 >= a3; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r4b4 = b4 >= a4; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator == + var r5a1 = a1 == b1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r5a3 = a3 == b3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r5a4 = a4 == b4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r5b1 = b1 == a1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r5b3 = b3 == a3; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r5b4 = b4 == a4; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator != + var r6a1 = a1 != b1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r6a3 = a3 != b3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r6a4 = a4 != b4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r6b1 = b1 != a1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r6b3 = b3 != a3; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r6b4 = b4 != a4; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator === + var r7a1 = a1 === b1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r7a3 = a3 === b3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r7a4 = a4 === b4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r7b1 = b1 === a1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r7b3 = b3 === a3; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r7b4 = b4 === a4; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. + + // operator !== + var r8a1 = a1 !== b1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: string]: string; }' and '{ [x: string]: number; }'. + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: string]: C; }'. + var r8a3 = a3 !== b3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: number]: Base; }' and '{ [x: number]: C; }'. + var r8a4 = a4 !== b4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: number]: Derived; }' and '{ [x: string]: Base; }'. + + var r8b1 = b1 !== a1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: string]: number; }' and '{ [x: string]: string; }'. + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: string]: C; }' and '{ [x: string]: Base; }'. + var r8b3 = b3 !== a3; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: number]: C; }' and '{ [x: number]: Base; }'. + var r8b4 = b4 !== a4; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ [x: string]: Base; }' and '{ [x: number]: Derived; }'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js new file mode 100644 index 0000000000000..d5ace469bd227 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -0,0 +1,209 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class C { + public c: string; +} + +var a1: { [a: string]: string }; +var b1: { [b: string]: number }; + +var a2: { [index: string]: Base }; +var b2: { [index: string]: C }; + +var a3: { [index: number]: Base }; +var b3: { [index: number]: C }; + +var a4: { [index: number]: Derived }; +var b4: { [index: string]: Base }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; + +//// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var C = (function () { + function C() { + } + return C; +})(); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt new file mode 100644 index 0000000000000..79da7a1389bd6 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt @@ -0,0 +1,152 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts (1 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + class C { + public c: string; + } + + var a1: { fn(x: T): T }; + var b1: { fn(): string }; + + var a2: { fn(x: T): T }; + var b2: { fn(x: string): number }; + + var a3: { fn(x?: T): T }; + var b3: { fn(x?: string): number }; + + var a4: { fn(...x: T[]): T }; + var b4: { fn(...x: string[]): number }; + + var a5: { fn(x: T, y: T): T }; + var b5: { fn(x: string, y: number): string }; + + var a6: { fn(x: T, y: U): T }; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b6: { fn(x: Base, y: C): Base }; + + // operator < + var r1a1 = a1 < b1; + var r1a2 = a2 < b2; + var r1a3 = a3 < b3; + var r1a4 = a4 < b4; + var r1a5 = a5 < b5; + var r1a6 = a6 < b6; + + var r1b1 = b1 < a1; + var r1b2 = b2 < a2; + var r1b3 = b3 < a3; + var r1b4 = b4 < a4; + var r1b5 = b5 < a5; + var r1b6 = b6 < a6; + + // operator > + var r2a1 = a1 > b1; + var r2a2 = a2 > b2; + var r2a3 = a3 > b3; + var r2a4 = a4 > b4; + var r2a5 = a5 > b5; + var r2a6 = a6 > b6; + + var r2b1 = b1 > a1; + var r2b2 = b2 > a2; + var r2b3 = b3 > a3; + var r2b4 = b4 > a4; + var r2b5 = b5 > a5; + var r2b6 = b6 > a6; + + // operator <= + var r3a1 = a1 <= b1; + var r3a2 = a2 <= b2; + var r3a3 = a3 <= b3; + var r3a4 = a4 <= b4; + var r3a5 = a5 <= b5; + var r3a6 = a6 <= b6; + + var r3b1 = b1 <= a1; + var r3b2 = b2 <= a2; + var r3b3 = b3 <= a3; + var r3b4 = b4 <= a4; + var r3b5 = b5 <= a5; + var r3b6 = b6 <= a6; + + // operator >= + var r4a1 = a1 >= b1; + var r4a2 = a2 >= b2; + var r4a3 = a3 >= b3; + var r4a4 = a4 >= b4; + var r4a5 = a5 >= b5; + var r4a6 = a6 >= b6; + + var r4b1 = b1 >= a1; + var r4b2 = b2 >= a2; + var r4b3 = b3 >= a3; + var r4b4 = b4 >= a4; + var r4b5 = b5 >= a5; + var r4b6 = b6 >= a6; + + // operator == + var r5a1 = a1 == b1; + var r5a2 = a2 == b2; + var r5a3 = a3 == b3; + var r5a4 = a4 == b4; + var r5a5 = a5 == b5; + var r5a6 = a6 == b6; + + var r5b1 = b1 == a1; + var r5b2 = b2 == a2; + var r5b3 = b3 == a3; + var r5b4 = b4 == a4; + var r5b5 = b5 == a5; + var r5b6 = b6 == a6; + + // operator != + var r6a1 = a1 != b1; + var r6a2 = a2 != b2; + var r6a3 = a3 != b3; + var r6a4 = a4 != b4; + var r6a5 = a5 != b5; + var r6a6 = a6 != b6; + + var r6b1 = b1 != a1; + var r6b2 = b2 != a2; + var r6b3 = b3 != a3; + var r6b4 = b4 != a4; + var r6b5 = b5 != a5; + var r6b6 = b6 != a6; + + // operator === + var r7a1 = a1 === b1; + var r7a2 = a2 === b2; + var r7a3 = a3 === b3; + var r7a4 = a4 === b4; + var r7a5 = a5 === b5; + var r7a6 = a6 === b6; + + var r7b1 = b1 === a1; + var r7b2 = b2 === a2; + var r7b3 = b3 === a3; + var r7b4 = b4 === a4; + var r7b5 = b5 === a5; + var r7b6 = b6 === a6; + + // operator !== + var r8a1 = a1 !== b1; + var r8a2 = a2 !== b2; + var r8a3 = a3 !== b3; + var r8a4 = a4 !== b4; + var r8a5 = a5 !== b5; + var r8a6 = a6 !== b6; + + var r8b1 = b1 !== a1; + var r8b2 = b2 !== a2; + var r8b3 = b3 !== a3; + var r8b4 = b4 !== a4; + var r8b5 = b5 !== a5; + var r8b6 = b6 !== a6; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js new file mode 100644 index 0000000000000..8ba98b249d0c9 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -0,0 +1,283 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class C { + public c: string; +} + +var a1: { fn(x: T): T }; +var b1: { fn(): string }; + +var a2: { fn(x: T): T }; +var b2: { fn(x: string): number }; + +var a3: { fn(x?: T): T }; +var b3: { fn(x?: string): number }; + +var a4: { fn(...x: T[]): T }; +var b4: { fn(...x: string[]): number }; + +var a5: { fn(x: T, y: T): T }; +var b5: { fn(x: string, y: number): string }; + +var a6: { fn(x: T, y: U): T }; +var b6: { fn(x: Base, y: C): Base }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; + +//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var C = (function () { + function C() { + } + return C; +})(); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt new file mode 100644 index 0000000000000..870a40fa0a39e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt @@ -0,0 +1,152 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts (1 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + class C { + public c: string; + } + + var a1: { new (x: T): T }; + var b1: { new (): string }; + + var a2: { new (x: T): T }; + var b2: { new (x: string): number }; + + var a3: { new (x?: T): T }; + var b3: { new (x?: string): number }; + + var a4: { new (...x: T[]): T }; + var b4: { new (...x: string[]): number }; + + var a5: { new (x: T, y: T): T }; + var b5: { new (x: string, y: number): string }; + + var a6: { new (x: T, y: U): T }; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b6: { new (x: Base, y: C): Base }; + + // operator < + var r1a1 = a1 < b1; + var r1a2 = a2 < b2; + var r1a3 = a3 < b3; + var r1a4 = a4 < b4; + var r1a5 = a5 < b5; + var r1a6 = a6 < b6; + + var r1b1 = b1 < a1; + var r1b2 = b2 < a2; + var r1b3 = b3 < a3; + var r1b4 = b4 < a4; + var r1b5 = b5 < a5; + var r1b6 = b6 < a6; + + // operator > + var r2a1 = a1 > b1; + var r2a2 = a2 > b2; + var r2a3 = a3 > b3; + var r2a4 = a4 > b4; + var r2a5 = a5 > b5; + var r2a6 = a6 > b6; + + var r2b1 = b1 > a1; + var r2b2 = b2 > a2; + var r2b3 = b3 > a3; + var r2b4 = b4 > a4; + var r2b5 = b5 > a5; + var r2b6 = b6 > a6; + + // operator <= + var r3a1 = a1 <= b1; + var r3a2 = a2 <= b2; + var r3a3 = a3 <= b3; + var r3a4 = a4 <= b4; + var r3a5 = a5 <= b5; + var r3a6 = a6 <= b6; + + var r3b1 = b1 <= a1; + var r3b2 = b2 <= a2; + var r3b3 = b3 <= a3; + var r3b4 = b4 <= a4; + var r3b5 = b5 <= a5; + var r3b6 = b6 <= a6; + + // operator >= + var r4a1 = a1 >= b1; + var r4a2 = a2 >= b2; + var r4a3 = a3 >= b3; + var r4a4 = a4 >= b4; + var r4a5 = a5 >= b5; + var r4a6 = a6 >= b6; + + var r4b1 = b1 >= a1; + var r4b2 = b2 >= a2; + var r4b3 = b3 >= a3; + var r4b4 = b4 >= a4; + var r4b5 = b5 >= a5; + var r4b6 = b6 >= a6; + + // operator == + var r5a1 = a1 == b1; + var r5a2 = a2 == b2; + var r5a3 = a3 == b3; + var r5a4 = a4 == b4; + var r5a5 = a5 == b5; + var r5a6 = a6 == b6; + + var r5b1 = b1 == a1; + var r5b2 = b2 == a2; + var r5b3 = b3 == a3; + var r5b4 = b4 == a4; + var r5b5 = b5 == a5; + var r5b6 = b6 == a6; + + // operator != + var r6a1 = a1 != b1; + var r6a2 = a2 != b2; + var r6a3 = a3 != b3; + var r6a4 = a4 != b4; + var r6a5 = a5 != b5; + var r6a6 = a6 != b6; + + var r6b1 = b1 != a1; + var r6b2 = b2 != a2; + var r6b3 = b3 != a3; + var r6b4 = b4 != a4; + var r6b5 = b5 != a5; + var r6b6 = b6 != a6; + + // operator === + var r7a1 = a1 === b1; + var r7a2 = a2 === b2; + var r7a3 = a3 === b3; + var r7a4 = a4 === b4; + var r7a5 = a5 === b5; + var r7a6 = a6 === b6; + + var r7b1 = b1 === a1; + var r7b2 = b2 === a2; + var r7b3 = b3 === a3; + var r7b4 = b4 === a4; + var r7b5 = b5 === a5; + var r7b6 = b6 === a6; + + // operator !== + var r8a1 = a1 !== b1; + var r8a2 = a2 !== b2; + var r8a3 = a3 !== b3; + var r8a4 = a4 !== b4; + var r8a5 = a5 !== b5; + var r8a6 = a6 !== b6; + + var r8b1 = b1 !== a1; + var r8b2 = b2 !== a2; + var r8b3 = b3 !== a3; + var r8b4 = b4 !== a4; + var r8b5 = b5 !== a5; + var r8b6 = b6 !== a6; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js new file mode 100644 index 0000000000000..6abddb3532361 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -0,0 +1,283 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class C { + public c: string; +} + +var a1: { new (x: T): T }; +var b1: { new (): string }; + +var a2: { new (x: T): T }; +var b2: { new (x: string): number }; + +var a3: { new (x?: T): T }; +var b3: { new (x?: string): number }; + +var a4: { new (...x: T[]): T }; +var b4: { new (...x: string[]): number }; + +var a5: { new (x: T, y: T): T }; +var b5: { new (x: string, y: number): string }; + +var a6: { new (x: T, y: U): T }; +var b6: { new (x: Base, y: C): Base }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; + +//// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var C = (function () { + function C() { + } + return C; +})(); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt new file mode 100644 index 0000000000000..fd3be68dee079 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt @@ -0,0 +1,75 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts (16 errors) ==== + interface A1 { + b?: number; + } + + interface B1 { + b?: string; + } + + var a: A1; + var b: B1; + + // operator < + var ra1 = a < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'A1' and 'B1'. + var ra2 = b < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'B1' and 'A1'. + + // operator > + var rb1 = a > b; + ~~~~~ +!!! Operator '>' cannot be applied to types 'A1' and 'B1'. + var rb2 = b > a; + ~~~~~ +!!! Operator '>' cannot be applied to types 'B1' and 'A1'. + + // operator <= + var rc1 = a <= b; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'A1' and 'B1'. + var rc2 = b <= a; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'B1' and 'A1'. + + // operator >= + var rd1 = a >= b; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'A1' and 'B1'. + var rd2 = b >= a; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'B1' and 'A1'. + + // operator == + var re1 = a == b; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'A1' and 'B1'. + var re2 = b == a; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'B1' and 'A1'. + + // operator != + var rf1 = a != b; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'A1' and 'B1'. + var rf2 = b != a; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'B1' and 'A1'. + + // operator === + var rg1 = a === b; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'A1' and 'B1'. + var rg2 = b === a; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'B1' and 'A1'. + + // operator !== + var rh1 = a !== b; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'A1' and 'B1'. + var rh2 = b !== a; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'B1' and 'A1'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js new file mode 100644 index 0000000000000..2c48a4fe73350 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js @@ -0,0 +1,63 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts] +interface A1 { + b?: number; +} + +interface B1 { + b?: string; +} + +var a: A1; +var b: B1; + +// operator < +var ra1 = a < b; +var ra2 = b < a; + +// operator > +var rb1 = a > b; +var rb2 = b > a; + +// operator <= +var rc1 = a <= b; +var rc2 = b <= a; + +// operator >= +var rd1 = a >= b; +var rd2 = b >= a; + +// operator == +var re1 = a == b; +var re2 = b == a; + +// operator != +var rf1 = a != b; +var rf2 = b != a; + +// operator === +var rg1 = a === b; +var rg2 = b === a; + +// operator !== +var rh1 = a !== b; +var rh2 = b !== a; + +//// [comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js] +var a; +var b; +var ra1 = a < b; +var ra2 = b < a; +var rb1 = a > b; +var rb2 = b > a; +var rc1 = a <= b; +var rc2 = b <= a; +var rd1 = a >= b; +var rd2 = b >= a; +var re1 = a == b; +var re2 = b == a; +var rf1 = a != b; +var rf2 = b != a; +var rg1 = a === b; +var rg2 = b === a; +var rh1 = a !== b; +var rh2 = b !== a; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt new file mode 100644 index 0000000000000..c8d6dd24fa34e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt @@ -0,0 +1,141 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnProperty.ts (32 errors) ==== + class A1 { + public a: number; + } + + class B1 { + public a: string; + } + + class A2 { + private a: string; + } + + class B2 { + private a: string; + } + + var a1: A1; + var b1: B1; + var a2: A2; + var b2: B2; + + // operator < + var r1a1 = a1 < b1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'A1' and 'B1'. + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'A2' and 'B2'. + + var r1b1 = b1 < a1; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'B1' and 'A1'. + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'B2' and 'A2'. + + // operator > + var r2a1 = a1 > b1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'A1' and 'B1'. + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'A2' and 'B2'. + + var r2b1 = b1 > a1; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'B1' and 'A1'. + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'B2' and 'A2'. + + // operator <= + var r3a1 = a1 <= b1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'A1' and 'B1'. + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'A2' and 'B2'. + + var r3b1 = b1 <= a1; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'B1' and 'A1'. + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'B2' and 'A2'. + + // operator >= + var r4a1 = a1 >= b1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'A1' and 'B1'. + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'A2' and 'B2'. + + var r4b1 = b1 >= a1; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'B1' and 'A1'. + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'B2' and 'A2'. + + // operator == + var r5a1 = a1 == b1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'A1' and 'B1'. + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'A2' and 'B2'. + + var r5b1 = b1 == a1; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'B1' and 'A1'. + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'B2' and 'A2'. + + // operator != + var r6a1 = a1 != b1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'A1' and 'B1'. + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'A2' and 'B2'. + + var r6b1 = b1 != a1; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'B1' and 'A1'. + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'B2' and 'A2'. + + // operator === + var r7a1 = a1 === b1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'A1' and 'B1'. + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'A2' and 'B2'. + + var r7b1 = b1 === a1; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'B1' and 'A1'. + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'B2' and 'A2'. + + // operator !== + var r8a1 = a1 !== b1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'A1' and 'B1'. + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'A2' and 'B2'. + + var r8b1 = b1 !== a1; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'B1' and 'A1'. + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'B2' and 'A2'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js new file mode 100644 index 0000000000000..1eb7ac188d18d --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js @@ -0,0 +1,135 @@ +//// [comparisonOperatorWithNoRelationshipObjectsOnProperty.ts] +class A1 { + public a: number; +} + +class B1 { + public a: string; +} + +class A2 { + private a: string; +} + +class B2 { + private a: string; +} + +var a1: A1; +var b1: B1; +var a2: A2; +var b2: B2; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; + +//// [comparisonOperatorWithNoRelationshipObjectsOnProperty.js] +var A1 = (function () { + function A1() { + } + return A1; +})(); +var B1 = (function () { + function B1() { + } + return B1; +})(); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var B2 = (function () { + function B2() { + } + return B2; +})(); +var a1; +var b1; +var a2; +var b2; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt new file mode 100644 index 0000000000000..d614662c0a1f3 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.errors.txt @@ -0,0 +1,504 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipPrimitiveType.ts (144 errors) ==== + enum E { a, b, c } + + var a: number; + var b: boolean; + var c: string; + var d: void; + var e: E; + + // operator < + var r1a1 = a < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'boolean'. + var r1a1 = a < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'string'. + var r1a1 = a < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'void'. + var r1a1 = a < e; // no error, expected + + var r1b1 = b < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'number'. + var r1b1 = b < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'string'. + var r1b1 = b < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'void'. + var r1b1 = b < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'E'. + + var r1c1 = c < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'number'. + var r1c1 = c < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'boolean'. + var r1c1 = c < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'void'. + var r1c1 = c < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'E'. + + var r1d1 = d < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'number'. + var r1d1 = d < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'boolean'. + var r1d1 = d < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'string'. + var r1d1 = d < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'E'. + + var r1e1 = e < a; // no error, expected + var r1e1 = e < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'boolean'. + var r1e1 = e < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'string'. + var r1e1 = e < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'void'. + + // operator > + var r2a1 = a > b; + ~~~~~ +!!! Operator '>' cannot be applied to types 'number' and 'boolean'. + var r2a1 = a > c; + ~~~~~ +!!! Operator '>' cannot be applied to types 'number' and 'string'. + var r2a1 = a > d; + ~~~~~ +!!! Operator '>' cannot be applied to types 'number' and 'void'. + var r2a1 = a > e; // no error, expected + + var r2b1 = b > a; + ~~~~~ +!!! Operator '>' cannot be applied to types 'boolean' and 'number'. + var r2b1 = b > c; + ~~~~~ +!!! Operator '>' cannot be applied to types 'boolean' and 'string'. + var r2b1 = b > d; + ~~~~~ +!!! Operator '>' cannot be applied to types 'boolean' and 'void'. + var r2b1 = b > e; + ~~~~~ +!!! Operator '>' cannot be applied to types 'boolean' and 'E'. + + var r2c1 = c > a; + ~~~~~ +!!! Operator '>' cannot be applied to types 'string' and 'number'. + var r2c1 = c > b; + ~~~~~ +!!! Operator '>' cannot be applied to types 'string' and 'boolean'. + var r2c1 = c > d; + ~~~~~ +!!! Operator '>' cannot be applied to types 'string' and 'void'. + var r2c1 = c > e; + ~~~~~ +!!! Operator '>' cannot be applied to types 'string' and 'E'. + + var r2d1 = d > a; + ~~~~~ +!!! Operator '>' cannot be applied to types 'void' and 'number'. + var r2d1 = d > b; + ~~~~~ +!!! Operator '>' cannot be applied to types 'void' and 'boolean'. + var r2d1 = d > c; + ~~~~~ +!!! Operator '>' cannot be applied to types 'void' and 'string'. + var r2d1 = d > e; + ~~~~~ +!!! Operator '>' cannot be applied to types 'void' and 'E'. + + var r2e1 = e > a; // no error, expected + var r2e1 = e > b; + ~~~~~ +!!! Operator '>' cannot be applied to types 'E' and 'boolean'. + var r2e1 = e > c; + ~~~~~ +!!! Operator '>' cannot be applied to types 'E' and 'string'. + var r2e1 = e > d; + ~~~~~ +!!! Operator '>' cannot be applied to types 'E' and 'void'. + + // operator <= + var r3a1 = a <= b; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'number' and 'boolean'. + var r3a1 = a <= c; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'number' and 'string'. + var r3a1 = a <= d; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'number' and 'void'. + var r3a1 = a <= e; // no error, expected + + var r3b1 = b <= a; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'boolean' and 'number'. + var r3b1 = b <= c; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'boolean' and 'string'. + var r3b1 = b <= d; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'boolean' and 'void'. + var r3b1 = b <= e; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'boolean' and 'E'. + + var r3c1 = c <= a; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'string' and 'number'. + var r3c1 = c <= b; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'string' and 'boolean'. + var r3c1 = c <= d; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'string' and 'void'. + var r3c1 = c <= e; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'string' and 'E'. + + var r3d1 = d <= a; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'void' and 'number'. + var r3d1 = d <= b; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'void' and 'boolean'. + var r3d1 = d <= c; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'void' and 'string'. + var r3d1 = d <= e; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'void' and 'E'. + + var r3e1 = e <= a; // no error, expected + var r3e1 = e <= b; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'E' and 'boolean'. + var r3e1 = e <= c; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'E' and 'string'. + var r3e1 = e <= d; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'E' and 'void'. + + // operator >= + var r4a1 = a >= b; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'number' and 'boolean'. + var r4a1 = a >= c; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'number' and 'string'. + var r4a1 = a >= d; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'number' and 'void'. + var r4a1 = a >= e; // no error, expected + + var r4b1 = b >= a; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'boolean' and 'number'. + var r4b1 = b >= c; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'boolean' and 'string'. + var r4b1 = b >= d; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'boolean' and 'void'. + var r4b1 = b >= e; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'boolean' and 'E'. + + var r4c1 = c >= a; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'string' and 'number'. + var r4c1 = c >= b; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'string' and 'boolean'. + var r4c1 = c >= d; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'string' and 'void'. + var r4c1 = c >= e; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'string' and 'E'. + + var r4d1 = d >= a; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'void' and 'number'. + var r4d1 = d >= b; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'void' and 'boolean'. + var r4d1 = d >= c; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'void' and 'string'. + var r4d1 = d >= e; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'void' and 'E'. + + var r4e1 = e >= a; // no error, expected + var r4e1 = e >= b; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'E' and 'boolean'. + var r4e1 = e >= c; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'E' and 'string'. + var r4e1 = e >= d; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'E' and 'void'. + + // operator == + var r5a1 = a == b; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'number' and 'boolean'. + var r5a1 = a == c; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'number' and 'string'. + var r5a1 = a == d; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'number' and 'void'. + var r5a1 = a == e; // no error, expected + + var r5b1 = b == a; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'boolean' and 'number'. + var r5b1 = b == c; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'boolean' and 'string'. + var r5b1 = b == d; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'boolean' and 'void'. + var r5b1 = b == e; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'boolean' and 'E'. + + var r5c1 = c == a; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'number'. + var r5c1 = c == b; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'boolean'. + var r5c1 = c == d; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'void'. + var r5c1 = c == e; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'E'. + + var r5d1 = d == a; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'void' and 'number'. + var r5d1 = d == b; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'void' and 'boolean'. + var r5d1 = d == c; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'void' and 'string'. + var r5d1 = d == e; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'void' and 'E'. + + var r5e1 = e == a; // no error, expected + var r5e1 = e == b; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'E' and 'boolean'. + var r5e1 = e == c; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'E' and 'string'. + var r5e1 = e == d; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'E' and 'void'. + + // operator != + var r6a1 = a != b; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'number' and 'boolean'. + var r6a1 = a != c; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'number' and 'string'. + var r6a1 = a != d; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'number' and 'void'. + var r6a1 = a != e; // no error, expected + + var r6b1 = b != a; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'boolean' and 'number'. + var r6b1 = b != c; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'boolean' and 'string'. + var r6b1 = b != d; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'boolean' and 'void'. + var r6b1 = b != e; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'boolean' and 'E'. + + var r6c1 = c != a; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'string' and 'number'. + var r6c1 = c != b; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'string' and 'boolean'. + var r6c1 = c != d; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'string' and 'void'. + var r6c1 = c != e; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'string' and 'E'. + + var r6d1 = d != a; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'void' and 'number'. + var r6d1 = d != b; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'void' and 'boolean'. + var r6d1 = d != c; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'void' and 'string'. + var r6d1 = d != e; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'void' and 'E'. + + var r6e1 = e != a; // no error, expected + var r6e1 = e != b; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'E' and 'boolean'. + var r6e1 = e != c; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'E' and 'string'. + var r6e1 = e != d; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'E' and 'void'. + + // operator === + var r7a1 = a === b; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'number' and 'boolean'. + var r7a1 = a === c; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'number' and 'string'. + var r7a1 = a === d; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'number' and 'void'. + var r7a1 = a === e; // no error, expected + + var r7b1 = b === a; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'boolean' and 'number'. + var r7b1 = b === c; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'boolean' and 'string'. + var r7b1 = b === d; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'boolean' and 'void'. + var r7b1 = b === e; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'boolean' and 'E'. + + var r7c1 = c === a; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'string' and 'number'. + var r7c1 = c === b; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'string' and 'boolean'. + var r7c1 = c === d; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'string' and 'void'. + var r7c1 = c === e; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'string' and 'E'. + + var r7d1 = d === a; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'void' and 'number'. + var r7d1 = d === b; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'void' and 'boolean'. + var r7d1 = d === c; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'void' and 'string'. + var r7d1 = d === e; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'void' and 'E'. + + var r7e1 = e === a; // no error, expected + var r7e1 = e === b; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'E' and 'boolean'. + var r7e1 = e === c; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'E' and 'string'. + var r7e1 = e === d; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'E' and 'void'. + + // operator !== + var r8a1 = a !== b; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'number' and 'boolean'. + var r8a1 = a !== c; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'number' and 'string'. + var r8a1 = a !== d; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'number' and 'void'. + var r8a1 = a !== e; // no error, expected + + var r8b1 = b !== a; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'boolean' and 'number'. + var r8b1 = b !== c; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'boolean' and 'string'. + var r8b1 = b !== d; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'boolean' and 'void'. + var r8b1 = b !== e; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'boolean' and 'E'. + + var r8c1 = c !== a; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'string' and 'number'. + var r8c1 = c !== b; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'string' and 'boolean'. + var r8c1 = c !== d; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'string' and 'void'. + var r8c1 = c !== e; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'string' and 'E'. + + var r8d1 = d !== a; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'void' and 'number'. + var r8d1 = d !== b; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'void' and 'boolean'. + var r8d1 = d !== c; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'void' and 'string'. + var r8d1 = d !== e; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'void' and 'E'. + + var r8e1 = e !== a; // no error, expected + var r8e1 = e !== b; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'E' and 'boolean'. + var r8e1 = e !== c; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'E' and 'string'. + var r8e1 = e !== d; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'E' and 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js new file mode 100644 index 0000000000000..2220793ed2c77 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js @@ -0,0 +1,389 @@ +//// [comparisonOperatorWithNoRelationshipPrimitiveType.ts] +enum E { a, b, c } + +var a: number; +var b: boolean; +var c: string; +var d: void; +var e: E; + +// operator < +var r1a1 = a < b; +var r1a1 = a < c; +var r1a1 = a < d; +var r1a1 = a < e; // no error, expected + +var r1b1 = b < a; +var r1b1 = b < c; +var r1b1 = b < d; +var r1b1 = b < e; + +var r1c1 = c < a; +var r1c1 = c < b; +var r1c1 = c < d; +var r1c1 = c < e; + +var r1d1 = d < a; +var r1d1 = d < b; +var r1d1 = d < c; +var r1d1 = d < e; + +var r1e1 = e < a; // no error, expected +var r1e1 = e < b; +var r1e1 = e < c; +var r1e1 = e < d; + +// operator > +var r2a1 = a > b; +var r2a1 = a > c; +var r2a1 = a > d; +var r2a1 = a > e; // no error, expected + +var r2b1 = b > a; +var r2b1 = b > c; +var r2b1 = b > d; +var r2b1 = b > e; + +var r2c1 = c > a; +var r2c1 = c > b; +var r2c1 = c > d; +var r2c1 = c > e; + +var r2d1 = d > a; +var r2d1 = d > b; +var r2d1 = d > c; +var r2d1 = d > e; + +var r2e1 = e > a; // no error, expected +var r2e1 = e > b; +var r2e1 = e > c; +var r2e1 = e > d; + +// operator <= +var r3a1 = a <= b; +var r3a1 = a <= c; +var r3a1 = a <= d; +var r3a1 = a <= e; // no error, expected + +var r3b1 = b <= a; +var r3b1 = b <= c; +var r3b1 = b <= d; +var r3b1 = b <= e; + +var r3c1 = c <= a; +var r3c1 = c <= b; +var r3c1 = c <= d; +var r3c1 = c <= e; + +var r3d1 = d <= a; +var r3d1 = d <= b; +var r3d1 = d <= c; +var r3d1 = d <= e; + +var r3e1 = e <= a; // no error, expected +var r3e1 = e <= b; +var r3e1 = e <= c; +var r3e1 = e <= d; + +// operator >= +var r4a1 = a >= b; +var r4a1 = a >= c; +var r4a1 = a >= d; +var r4a1 = a >= e; // no error, expected + +var r4b1 = b >= a; +var r4b1 = b >= c; +var r4b1 = b >= d; +var r4b1 = b >= e; + +var r4c1 = c >= a; +var r4c1 = c >= b; +var r4c1 = c >= d; +var r4c1 = c >= e; + +var r4d1 = d >= a; +var r4d1 = d >= b; +var r4d1 = d >= c; +var r4d1 = d >= e; + +var r4e1 = e >= a; // no error, expected +var r4e1 = e >= b; +var r4e1 = e >= c; +var r4e1 = e >= d; + +// operator == +var r5a1 = a == b; +var r5a1 = a == c; +var r5a1 = a == d; +var r5a1 = a == e; // no error, expected + +var r5b1 = b == a; +var r5b1 = b == c; +var r5b1 = b == d; +var r5b1 = b == e; + +var r5c1 = c == a; +var r5c1 = c == b; +var r5c1 = c == d; +var r5c1 = c == e; + +var r5d1 = d == a; +var r5d1 = d == b; +var r5d1 = d == c; +var r5d1 = d == e; + +var r5e1 = e == a; // no error, expected +var r5e1 = e == b; +var r5e1 = e == c; +var r5e1 = e == d; + +// operator != +var r6a1 = a != b; +var r6a1 = a != c; +var r6a1 = a != d; +var r6a1 = a != e; // no error, expected + +var r6b1 = b != a; +var r6b1 = b != c; +var r6b1 = b != d; +var r6b1 = b != e; + +var r6c1 = c != a; +var r6c1 = c != b; +var r6c1 = c != d; +var r6c1 = c != e; + +var r6d1 = d != a; +var r6d1 = d != b; +var r6d1 = d != c; +var r6d1 = d != e; + +var r6e1 = e != a; // no error, expected +var r6e1 = e != b; +var r6e1 = e != c; +var r6e1 = e != d; + +// operator === +var r7a1 = a === b; +var r7a1 = a === c; +var r7a1 = a === d; +var r7a1 = a === e; // no error, expected + +var r7b1 = b === a; +var r7b1 = b === c; +var r7b1 = b === d; +var r7b1 = b === e; + +var r7c1 = c === a; +var r7c1 = c === b; +var r7c1 = c === d; +var r7c1 = c === e; + +var r7d1 = d === a; +var r7d1 = d === b; +var r7d1 = d === c; +var r7d1 = d === e; + +var r7e1 = e === a; // no error, expected +var r7e1 = e === b; +var r7e1 = e === c; +var r7e1 = e === d; + +// operator !== +var r8a1 = a !== b; +var r8a1 = a !== c; +var r8a1 = a !== d; +var r8a1 = a !== e; // no error, expected + +var r8b1 = b !== a; +var r8b1 = b !== c; +var r8b1 = b !== d; +var r8b1 = b !== e; + +var r8c1 = c !== a; +var r8c1 = c !== b; +var r8c1 = c !== d; +var r8c1 = c !== e; + +var r8d1 = d !== a; +var r8d1 = d !== b; +var r8d1 = d !== c; +var r8d1 = d !== e; + +var r8e1 = e !== a; // no error, expected +var r8e1 = e !== b; +var r8e1 = e !== c; +var r8e1 = e !== d; + +//// [comparisonOperatorWithNoRelationshipPrimitiveType.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var r1a1 = a < b; +var r1a1 = a < c; +var r1a1 = a < d; +var r1a1 = a < e; +var r1b1 = b < a; +var r1b1 = b < c; +var r1b1 = b < d; +var r1b1 = b < e; +var r1c1 = c < a; +var r1c1 = c < b; +var r1c1 = c < d; +var r1c1 = c < e; +var r1d1 = d < a; +var r1d1 = d < b; +var r1d1 = d < c; +var r1d1 = d < e; +var r1e1 = e < a; +var r1e1 = e < b; +var r1e1 = e < c; +var r1e1 = e < d; +var r2a1 = a > b; +var r2a1 = a > c; +var r2a1 = a > d; +var r2a1 = a > e; +var r2b1 = b > a; +var r2b1 = b > c; +var r2b1 = b > d; +var r2b1 = b > e; +var r2c1 = c > a; +var r2c1 = c > b; +var r2c1 = c > d; +var r2c1 = c > e; +var r2d1 = d > a; +var r2d1 = d > b; +var r2d1 = d > c; +var r2d1 = d > e; +var r2e1 = e > a; +var r2e1 = e > b; +var r2e1 = e > c; +var r2e1 = e > d; +var r3a1 = a <= b; +var r3a1 = a <= c; +var r3a1 = a <= d; +var r3a1 = a <= e; +var r3b1 = b <= a; +var r3b1 = b <= c; +var r3b1 = b <= d; +var r3b1 = b <= e; +var r3c1 = c <= a; +var r3c1 = c <= b; +var r3c1 = c <= d; +var r3c1 = c <= e; +var r3d1 = d <= a; +var r3d1 = d <= b; +var r3d1 = d <= c; +var r3d1 = d <= e; +var r3e1 = e <= a; +var r3e1 = e <= b; +var r3e1 = e <= c; +var r3e1 = e <= d; +var r4a1 = a >= b; +var r4a1 = a >= c; +var r4a1 = a >= d; +var r4a1 = a >= e; +var r4b1 = b >= a; +var r4b1 = b >= c; +var r4b1 = b >= d; +var r4b1 = b >= e; +var r4c1 = c >= a; +var r4c1 = c >= b; +var r4c1 = c >= d; +var r4c1 = c >= e; +var r4d1 = d >= a; +var r4d1 = d >= b; +var r4d1 = d >= c; +var r4d1 = d >= e; +var r4e1 = e >= a; +var r4e1 = e >= b; +var r4e1 = e >= c; +var r4e1 = e >= d; +var r5a1 = a == b; +var r5a1 = a == c; +var r5a1 = a == d; +var r5a1 = a == e; +var r5b1 = b == a; +var r5b1 = b == c; +var r5b1 = b == d; +var r5b1 = b == e; +var r5c1 = c == a; +var r5c1 = c == b; +var r5c1 = c == d; +var r5c1 = c == e; +var r5d1 = d == a; +var r5d1 = d == b; +var r5d1 = d == c; +var r5d1 = d == e; +var r5e1 = e == a; +var r5e1 = e == b; +var r5e1 = e == c; +var r5e1 = e == d; +var r6a1 = a != b; +var r6a1 = a != c; +var r6a1 = a != d; +var r6a1 = a != e; +var r6b1 = b != a; +var r6b1 = b != c; +var r6b1 = b != d; +var r6b1 = b != e; +var r6c1 = c != a; +var r6c1 = c != b; +var r6c1 = c != d; +var r6c1 = c != e; +var r6d1 = d != a; +var r6d1 = d != b; +var r6d1 = d != c; +var r6d1 = d != e; +var r6e1 = e != a; +var r6e1 = e != b; +var r6e1 = e != c; +var r6e1 = e != d; +var r7a1 = a === b; +var r7a1 = a === c; +var r7a1 = a === d; +var r7a1 = a === e; +var r7b1 = b === a; +var r7b1 = b === c; +var r7b1 = b === d; +var r7b1 = b === e; +var r7c1 = c === a; +var r7c1 = c === b; +var r7c1 = c === d; +var r7c1 = c === e; +var r7d1 = d === a; +var r7d1 = d === b; +var r7d1 = d === c; +var r7d1 = d === e; +var r7e1 = e === a; +var r7e1 = e === b; +var r7e1 = e === c; +var r7e1 = e === d; +var r8a1 = a !== b; +var r8a1 = a !== c; +var r8a1 = a !== d; +var r8a1 = a !== e; +var r8b1 = b !== a; +var r8b1 = b !== c; +var r8b1 = b !== d; +var r8b1 = b !== e; +var r8c1 = c !== a; +var r8c1 = c !== b; +var r8c1 = c !== d; +var r8c1 = c !== e; +var r8d1 = d !== a; +var r8d1 = d !== b; +var r8d1 = d !== c; +var r8d1 = d !== e; +var r8e1 = e !== a; +var r8e1 = e !== b; +var r8e1 = e !== c; +var r8e1 = e !== d; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt new file mode 100644 index 0000000000000..6114521d63c67 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt @@ -0,0 +1,397 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (120 errors) ==== + enum E { a, b, c } + + var a: boolean; + var b: number; + var c: string; + var d: void; + var e: E; + var f: { a: string }; + var g: any[]; + + function foo(t: T, u: U) { + var r1 = t < u; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'U'. + var r2 = t > u; + ~~~~~ +!!! Operator '>' cannot be applied to types 'T' and 'U'. + var r3 = t <= u; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'T' and 'U'. + var r4 = t >= u; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'T' and 'U'. + var r5 = t == u; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'T' and 'U'. + var r6 = t != u; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'T' and 'U'. + var r7 = t === u; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'T' and 'U'. + var r8 = t !== u; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'T' and 'U'. + + // operator < + var r1a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r1a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r1a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r1a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r1a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r1a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r1a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r1b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r1b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r1b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r1b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r1b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r1b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r1b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator > + var r2a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r2a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r2a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r2a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r2a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r2a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r2a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r2b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r2b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r2b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r2b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r2b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r2b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r2b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator <= + var r3a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r3a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r3a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r3a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r3a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r3a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r3a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r3b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r3b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r3b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r3b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r3b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r3b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r3b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator >= + var r4a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r4a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r4a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r4a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r4a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r4a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r4a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r4b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r4b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r4b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r4b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r4b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r4b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r4b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator == + var r5a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r5a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r5a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r5a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r5a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r5a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r5a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r5b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r5b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r5b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r5b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r5b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r5b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r5b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator != + var r6a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r6a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r6a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r6a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r6a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r6a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r6a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r6b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r6b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r6b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r6b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r6b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r6b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r6b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator === + var r7a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r7a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r7a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r7a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r7a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r7a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r7a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r7b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r7b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r7b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r7b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r7b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r7b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r7b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + + // operator !== + var r8a1 = t < a; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'boolean'. + var r8a2 = t < b; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'number'. + var r8a3 = t < c; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'string'. + var r8a4 = t < d; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'void'. + var r8a5 = t < e; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'E'. + var r8a6 = t < f; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and '{ a: string; }'. + var r8a7 = t < g; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'any[]'. + + var r8b1 = a < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'boolean' and 'T'. + var r8b2 = b < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'number' and 'T'. + var r8b3 = c < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'string' and 'T'. + var r8b4 = d < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'void' and 'T'. + var r8b5 = e < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'E' and 'T'. + var r8b6 = f < t; + ~~~~~ +!!! Operator '<' cannot be applied to types '{ a: string; }' and 'T'. + var r8b7 = g < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'any[]' and 'T'. + } \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js new file mode 100644 index 0000000000000..316bb0e49715d --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js @@ -0,0 +1,294 @@ +//// [comparisonOperatorWithNoRelationshipTypeParameter.ts] +enum E { a, b, c } + +var a: boolean; +var b: number; +var c: string; +var d: void; +var e: E; +var f: { a: string }; +var g: any[]; + +function foo(t: T, u: U) { + var r1 = t < u; + var r2 = t > u; + var r3 = t <= u; + var r4 = t >= u; + var r5 = t == u; + var r6 = t != u; + var r7 = t === u; + var r8 = t !== u; + + // operator < + var r1a1 = t < a; + var r1a2 = t < b; + var r1a3 = t < c; + var r1a4 = t < d; + var r1a5 = t < e; + var r1a6 = t < f; + var r1a7 = t < g; + + var r1b1 = a < t; + var r1b2 = b < t; + var r1b3 = c < t; + var r1b4 = d < t; + var r1b5 = e < t; + var r1b6 = f < t; + var r1b7 = g < t; + + // operator > + var r2a1 = t < a; + var r2a2 = t < b; + var r2a3 = t < c; + var r2a4 = t < d; + var r2a5 = t < e; + var r2a6 = t < f; + var r2a7 = t < g; + + var r2b1 = a < t; + var r2b2 = b < t; + var r2b3 = c < t; + var r2b4 = d < t; + var r2b5 = e < t; + var r2b6 = f < t; + var r2b7 = g < t; + + // operator <= + var r3a1 = t < a; + var r3a2 = t < b; + var r3a3 = t < c; + var r3a4 = t < d; + var r3a5 = t < e; + var r3a6 = t < f; + var r3a7 = t < g; + + var r3b1 = a < t; + var r3b2 = b < t; + var r3b3 = c < t; + var r3b4 = d < t; + var r3b5 = e < t; + var r3b6 = f < t; + var r3b7 = g < t; + + // operator >= + var r4a1 = t < a; + var r4a2 = t < b; + var r4a3 = t < c; + var r4a4 = t < d; + var r4a5 = t < e; + var r4a6 = t < f; + var r4a7 = t < g; + + var r4b1 = a < t; + var r4b2 = b < t; + var r4b3 = c < t; + var r4b4 = d < t; + var r4b5 = e < t; + var r4b6 = f < t; + var r4b7 = g < t; + + // operator == + var r5a1 = t < a; + var r5a2 = t < b; + var r5a3 = t < c; + var r5a4 = t < d; + var r5a5 = t < e; + var r5a6 = t < f; + var r5a7 = t < g; + + var r5b1 = a < t; + var r5b2 = b < t; + var r5b3 = c < t; + var r5b4 = d < t; + var r5b5 = e < t; + var r5b6 = f < t; + var r5b7 = g < t; + + // operator != + var r6a1 = t < a; + var r6a2 = t < b; + var r6a3 = t < c; + var r6a4 = t < d; + var r6a5 = t < e; + var r6a6 = t < f; + var r6a7 = t < g; + + var r6b1 = a < t; + var r6b2 = b < t; + var r6b3 = c < t; + var r6b4 = d < t; + var r6b5 = e < t; + var r6b6 = f < t; + var r6b7 = g < t; + + // operator === + var r7a1 = t < a; + var r7a2 = t < b; + var r7a3 = t < c; + var r7a4 = t < d; + var r7a5 = t < e; + var r7a6 = t < f; + var r7a7 = t < g; + + var r7b1 = a < t; + var r7b2 = b < t; + var r7b3 = c < t; + var r7b4 = d < t; + var r7b5 = e < t; + var r7b6 = f < t; + var r7b7 = g < t; + + // operator !== + var r8a1 = t < a; + var r8a2 = t < b; + var r8a3 = t < c; + var r8a4 = t < d; + var r8a5 = t < e; + var r8a6 = t < f; + var r8a7 = t < g; + + var r8b1 = a < t; + var r8b2 = b < t; + var r8b3 = c < t; + var r8b4 = d < t; + var r8b5 = e < t; + var r8b6 = f < t; + var r8b7 = g < t; +} + +//// [comparisonOperatorWithNoRelationshipTypeParameter.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var d; +var e; +var f; +var g; +function foo(t, u) { + var r1 = t < u; + var r2 = t > u; + var r3 = t <= u; + var r4 = t >= u; + var r5 = t == u; + var r6 = t != u; + var r7 = t === u; + var r8 = t !== u; + var r1a1 = t < a; + var r1a2 = t < b; + var r1a3 = t < c; + var r1a4 = t < d; + var r1a5 = t < e; + var r1a6 = t < f; + var r1a7 = t < g; + var r1b1 = a < t; + var r1b2 = b < t; + var r1b3 = c < t; + var r1b4 = d < t; + var r1b5 = e < t; + var r1b6 = f < t; + var r1b7 = g < t; + var r2a1 = t < a; + var r2a2 = t < b; + var r2a3 = t < c; + var r2a4 = t < d; + var r2a5 = t < e; + var r2a6 = t < f; + var r2a7 = t < g; + var r2b1 = a < t; + var r2b2 = b < t; + var r2b3 = c < t; + var r2b4 = d < t; + var r2b5 = e < t; + var r2b6 = f < t; + var r2b7 = g < t; + var r3a1 = t < a; + var r3a2 = t < b; + var r3a3 = t < c; + var r3a4 = t < d; + var r3a5 = t < e; + var r3a6 = t < f; + var r3a7 = t < g; + var r3b1 = a < t; + var r3b2 = b < t; + var r3b3 = c < t; + var r3b4 = d < t; + var r3b5 = e < t; + var r3b6 = f < t; + var r3b7 = g < t; + var r4a1 = t < a; + var r4a2 = t < b; + var r4a3 = t < c; + var r4a4 = t < d; + var r4a5 = t < e; + var r4a6 = t < f; + var r4a7 = t < g; + var r4b1 = a < t; + var r4b2 = b < t; + var r4b3 = c < t; + var r4b4 = d < t; + var r4b5 = e < t; + var r4b6 = f < t; + var r4b7 = g < t; + var r5a1 = t < a; + var r5a2 = t < b; + var r5a3 = t < c; + var r5a4 = t < d; + var r5a5 = t < e; + var r5a6 = t < f; + var r5a7 = t < g; + var r5b1 = a < t; + var r5b2 = b < t; + var r5b3 = c < t; + var r5b4 = d < t; + var r5b5 = e < t; + var r5b6 = f < t; + var r5b7 = g < t; + var r6a1 = t < a; + var r6a2 = t < b; + var r6a3 = t < c; + var r6a4 = t < d; + var r6a5 = t < e; + var r6a6 = t < f; + var r6a7 = t < g; + var r6b1 = a < t; + var r6b2 = b < t; + var r6b3 = c < t; + var r6b4 = d < t; + var r6b5 = e < t; + var r6b6 = f < t; + var r6b7 = g < t; + var r7a1 = t < a; + var r7a2 = t < b; + var r7a3 = t < c; + var r7a4 = t < d; + var r7a5 = t < e; + var r7a6 = t < f; + var r7a7 = t < g; + var r7b1 = a < t; + var r7b2 = b < t; + var r7b3 = c < t; + var r7b4 = d < t; + var r7b5 = e < t; + var r7b6 = f < t; + var r7b7 = g < t; + var r8a1 = t < a; + var r8a2 = t < b; + var r8a3 = t < c; + var r8a4 = t < d; + var r8a5 = t < e; + var r8a6 = t < f; + var r8a7 = t < g; + var r8b1 = a < t; + var r8b2 = b < t; + var r8b3 = c < t; + var r8b4 = d < t; + var r8b5 = e < t; + var r8b6 = f < t; + var r8b7 = g < t; +} diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js new file mode 100644 index 0000000000000..24fc1b16b8abf --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js @@ -0,0 +1,314 @@ +//// [comparisonOperatorWithOneOperandIsAny.ts] +var x: any; + +enum E { a, b, c } + +function foo(t: T) { + var foo_r1 = t < x; + var foo_r2 = t > x; + var foo_r3 = t <= x; + var foo_r4 = t >= x; + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + + var foo_r1 = x < t; + var foo_r2 = x > t; + var foo_r3 = x <= t; + var foo_r4 = x >= t; + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; +} + +var a: boolean; +var b: number; +var c: string; +var d: void; +var e: E; +var f: {}; +var g: string[]; + +// operator < +var r1a1 = x < a; +var r1a2 = x < b; +var r1a3 = x < c; +var r1a4 = x < d; +var r1a5 = x < e; +var r1a6 = x < f; +var r1a7 = x < g; + +var r1b1 = a < x; +var r1b2 = b < x; +var r1b3 = c < x; +var r1b4 = d < x; +var r1b5 = e < x; +var r1b6 = f < x; +var r1b7 = g < x; + +// operator > +var r2a1 = x > a; +var r2a2 = x > b; +var r2a3 = x > c; +var r2a4 = x > d; +var r2a5 = x > e; +var r2a6 = x > f; +var r2a7 = x > g; + +var r2b1 = a > x; +var r2b2 = b > x; +var r2b3 = c > x; +var r2b4 = d > x; +var r2b5 = e > x; +var r2b6 = f > x; +var r2b7 = g > x; + +// operator <= +var r3a1 = x <= a; +var r3a2 = x <= b; +var r3a3 = x <= c; +var r3a4 = x <= d; +var r3a5 = x <= e; +var r3a6 = x <= f; +var r3a7 = x <= g; + +var r3b1 = a <= x; +var r3b2 = b <= x; +var r3b3 = c <= x; +var r3b4 = d <= x; +var r3b5 = e <= x; +var r3b6 = f <= x; +var r3b7 = g <= x; + +// operator >= +var r4a1 = x >= a; +var r4a2 = x >= b; +var r4a3 = x >= c; +var r4a4 = x >= d; +var r4a5 = x >= e; +var r4a6 = x >= f; +var r4a7 = x >= g; + +var r4b1 = a >= x; +var r4b2 = b >= x; +var r4b3 = c >= x; +var r4b4 = d >= x; +var r4b5 = e >= x; +var r4b6 = f >= x; +var r4b7 = g >= x; + +// operator == +var r5a1 = x == a; +var r5a2 = x == b; +var r5a3 = x == c; +var r5a4 = x == d; +var r5a5 = x == e; +var r5a6 = x == f; +var r5a7 = x == g; + +var r5b1 = a == x; +var r5b2 = b == x; +var r5b3 = c == x; +var r5b4 = d == x; +var r5b5 = e == x; +var r5b6 = f == x; +var r5b7 = g == x; + +// operator != +var r6a1 = x != a; +var r6a2 = x != b; +var r6a3 = x != c; +var r6a4 = x != d; +var r6a5 = x != e; +var r6a6 = x != f; +var r6a7 = x != g; + +var r6b1 = a != x; +var r6b2 = b != x; +var r6b3 = c != x; +var r6b4 = d != x; +var r6b5 = e != x; +var r6b6 = f != x; +var r6b7 = g != x; + +// operator === +var r7a1 = x === a; +var r7a2 = x === b; +var r7a3 = x === c; +var r7a4 = x === d; +var r7a5 = x === e; +var r7a6 = x === f; +var r7a7 = x === g; + +var r7b1 = a === x; +var r7b2 = b === x; +var r7b3 = c === x; +var r7b4 = d === x; +var r7b5 = e === x; +var r7b6 = f === x; +var r7b7 = g === x; + +// operator !== +var r8a1 = x !== a; +var r8a2 = x !== b; +var r8a3 = x !== c; +var r8a4 = x !== d; +var r8a5 = x !== e; +var r8a6 = x !== f; +var r8a7 = x !== g; + +var r8b1 = a !== x; +var r8b2 = b !== x; +var r8b3 = c !== x; +var r8b4 = d !== x; +var r8b5 = e !== x; +var r8b6 = f !== x; +var r8b7 = g !== x; + +//// [comparisonOperatorWithOneOperandIsAny.js] +var x; +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +function foo(t) { + var foo_r1 = t < x; + var foo_r2 = t > x; + var foo_r3 = t <= x; + var foo_r4 = t >= x; + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + var foo_r1 = x < t; + var foo_r2 = x > t; + var foo_r3 = x <= t; + var foo_r4 = x >= t; + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; +} +var a; +var b; +var c; +var d; +var e; +var f; +var g; +var r1a1 = x < a; +var r1a2 = x < b; +var r1a3 = x < c; +var r1a4 = x < d; +var r1a5 = x < e; +var r1a6 = x < f; +var r1a7 = x < g; +var r1b1 = a < x; +var r1b2 = b < x; +var r1b3 = c < x; +var r1b4 = d < x; +var r1b5 = e < x; +var r1b6 = f < x; +var r1b7 = g < x; +var r2a1 = x > a; +var r2a2 = x > b; +var r2a3 = x > c; +var r2a4 = x > d; +var r2a5 = x > e; +var r2a6 = x > f; +var r2a7 = x > g; +var r2b1 = a > x; +var r2b2 = b > x; +var r2b3 = c > x; +var r2b4 = d > x; +var r2b5 = e > x; +var r2b6 = f > x; +var r2b7 = g > x; +var r3a1 = x <= a; +var r3a2 = x <= b; +var r3a3 = x <= c; +var r3a4 = x <= d; +var r3a5 = x <= e; +var r3a6 = x <= f; +var r3a7 = x <= g; +var r3b1 = a <= x; +var r3b2 = b <= x; +var r3b3 = c <= x; +var r3b4 = d <= x; +var r3b5 = e <= x; +var r3b6 = f <= x; +var r3b7 = g <= x; +var r4a1 = x >= a; +var r4a2 = x >= b; +var r4a3 = x >= c; +var r4a4 = x >= d; +var r4a5 = x >= e; +var r4a6 = x >= f; +var r4a7 = x >= g; +var r4b1 = a >= x; +var r4b2 = b >= x; +var r4b3 = c >= x; +var r4b4 = d >= x; +var r4b5 = e >= x; +var r4b6 = f >= x; +var r4b7 = g >= x; +var r5a1 = x == a; +var r5a2 = x == b; +var r5a3 = x == c; +var r5a4 = x == d; +var r5a5 = x == e; +var r5a6 = x == f; +var r5a7 = x == g; +var r5b1 = a == x; +var r5b2 = b == x; +var r5b3 = c == x; +var r5b4 = d == x; +var r5b5 = e == x; +var r5b6 = f == x; +var r5b7 = g == x; +var r6a1 = x != a; +var r6a2 = x != b; +var r6a3 = x != c; +var r6a4 = x != d; +var r6a5 = x != e; +var r6a6 = x != f; +var r6a7 = x != g; +var r6b1 = a != x; +var r6b2 = b != x; +var r6b3 = c != x; +var r6b4 = d != x; +var r6b5 = e != x; +var r6b6 = f != x; +var r6b7 = g != x; +var r7a1 = x === a; +var r7a2 = x === b; +var r7a3 = x === c; +var r7a4 = x === d; +var r7a5 = x === e; +var r7a6 = x === f; +var r7a7 = x === g; +var r7b1 = a === x; +var r7b2 = b === x; +var r7b3 = c === x; +var r7b4 = d === x; +var r7b5 = e === x; +var r7b6 = f === x; +var r7b7 = g === x; +var r8a1 = x !== a; +var r8a2 = x !== b; +var r8a3 = x !== c; +var r8a4 = x !== d; +var r8a5 = x !== e; +var r8a6 = x !== f; +var r8a7 = x !== g; +var r8b1 = a !== x; +var r8b2 = b !== x; +var r8b3 = c !== x; +var r8b4 = d !== x; +var r8b5 = e !== x; +var r8b6 = f !== x; +var r8b7 = g !== x; diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js new file mode 100644 index 0000000000000..88d2ef48b1db9 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js @@ -0,0 +1,311 @@ +//// [comparisonOperatorWithOneOperandIsNull.ts] +enum E { a, b, c } + +function foo(t: T) { + var foo_r1 = t < null; + var foo_r2 = t > null; + var foo_r3 = t <= null; + var foo_r4 = t >= null; + var foo_r5 = t == null; + var foo_r6 = t != null; + var foo_r7 = t === null; + var foo_r8 = t !== null; + + var foo_r1 = null < t; + var foo_r2 = null > t; + var foo_r3 = null <= t; + var foo_r4 = null >= t; + var foo_r5 = null == t; + var foo_r6 = null != t; + var foo_r7 = null === t; + var foo_r8 = null !== t; +} + +var a: boolean; +var b: number; +var c: string; +var d: void; +var e: E; +var f: {}; +var g: string[]; + +// operator < +var r1a1 = null < a; +var r1a2 = null < b; +var r1a3 = null < c; +var r1a4 = null < d; +var r1a5 = null < e; +var r1a6 = null < f; +var r1a7 = null < g; + +var r1b1 = a < null; +var r1b2 = b < null; +var r1b3 = c < null; +var r1b4 = d < null; +var r1b5 = e < null; +var r1b6 = f < null; +var r1b7 = g < null; + +// operator > +var r2a1 = null > a; +var r2a2 = null > b; +var r2a3 = null > c; +var r2a4 = null > d; +var r2a5 = null > e; +var r2a6 = null > f; +var r2a7 = null > g; + +var r2b1 = a > null; +var r2b2 = b > null; +var r2b3 = c > null; +var r2b4 = d > null; +var r2b5 = e > null; +var r2b6 = f > null; +var r2b7 = g > null; + +// operator <= +var r3a1 = null <= a; +var r3a2 = null <= b; +var r3a3 = null <= c; +var r3a4 = null <= d; +var r3a5 = null <= e; +var r3a6 = null <= f; +var r3a7 = null <= g; + +var r3b1 = a <= null; +var r3b2 = b <= null; +var r3b3 = c <= null; +var r3b4 = d <= null; +var r3b5 = e <= null; +var r3b6 = f <= null; +var r3b7 = g <= null; + +// operator >= +var r4a1 = null >= a; +var r4a2 = null >= b; +var r4a3 = null >= c; +var r4a4 = null >= d; +var r4a5 = null >= e; +var r4a6 = null >= f; +var r4a7 = null >= g; + +var r4b1 = a >= null; +var r4b2 = b >= null; +var r4b3 = c >= null; +var r4b4 = d >= null; +var r4b5 = e >= null; +var r4b6 = f >= null; +var r4b7 = g >= null; + +// operator == +var r5a1 = null == a; +var r5a2 = null == b; +var r5a3 = null == c; +var r5a4 = null == d; +var r5a5 = null == e; +var r5a6 = null == f; +var r5a7 = null == g; + +var r5b1 = a == null; +var r5b2 = b == null; +var r5b3 = c == null; +var r5b4 = d == null; +var r5b5 = e == null; +var r5b6 = f == null; +var r5b7 = g == null; + +// operator != +var r6a1 = null != a; +var r6a2 = null != b; +var r6a3 = null != c; +var r6a4 = null != d; +var r6a5 = null != e; +var r6a6 = null != f; +var r6a7 = null != g; + +var r6b1 = a != null; +var r6b2 = b != null; +var r6b3 = c != null; +var r6b4 = d != null; +var r6b5 = e != null; +var r6b6 = f != null; +var r6b7 = g != null; + +// operator === +var r7a1 = null === a; +var r7a2 = null === b; +var r7a3 = null === c; +var r7a4 = null === d; +var r7a5 = null === e; +var r7a6 = null === f; +var r7a7 = null === g; + +var r7b1 = a === null; +var r7b2 = b === null; +var r7b3 = c === null; +var r7b4 = d === null; +var r7b5 = e === null; +var r7b6 = f === null; +var r7b7 = g === null; + +// operator !== +var r8a1 = null !== a; +var r8a2 = null !== b; +var r8a3 = null !== c; +var r8a4 = null !== d; +var r8a5 = null !== e; +var r8a6 = null !== f; +var r8a7 = null !== g; + +var r8b1 = a !== null; +var r8b2 = b !== null; +var r8b3 = c !== null; +var r8b4 = d !== null; +var r8b5 = e !== null; +var r8b6 = f !== null; +var r8b7 = g !== null; + +//// [comparisonOperatorWithOneOperandIsNull.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +function foo(t) { + var foo_r1 = t < null; + var foo_r2 = t > null; + var foo_r3 = t <= null; + var foo_r4 = t >= null; + var foo_r5 = t == null; + var foo_r6 = t != null; + var foo_r7 = t === null; + var foo_r8 = t !== null; + var foo_r1 = null < t; + var foo_r2 = null > t; + var foo_r3 = null <= t; + var foo_r4 = null >= t; + var foo_r5 = null == t; + var foo_r6 = null != t; + var foo_r7 = null === t; + var foo_r8 = null !== t; +} +var a; +var b; +var c; +var d; +var e; +var f; +var g; +var r1a1 = null < a; +var r1a2 = null < b; +var r1a3 = null < c; +var r1a4 = null < d; +var r1a5 = null < e; +var r1a6 = null < f; +var r1a7 = null < g; +var r1b1 = a < null; +var r1b2 = b < null; +var r1b3 = c < null; +var r1b4 = d < null; +var r1b5 = e < null; +var r1b6 = f < null; +var r1b7 = g < null; +var r2a1 = null > a; +var r2a2 = null > b; +var r2a3 = null > c; +var r2a4 = null > d; +var r2a5 = null > e; +var r2a6 = null > f; +var r2a7 = null > g; +var r2b1 = a > null; +var r2b2 = b > null; +var r2b3 = c > null; +var r2b4 = d > null; +var r2b5 = e > null; +var r2b6 = f > null; +var r2b7 = g > null; +var r3a1 = null <= a; +var r3a2 = null <= b; +var r3a3 = null <= c; +var r3a4 = null <= d; +var r3a5 = null <= e; +var r3a6 = null <= f; +var r3a7 = null <= g; +var r3b1 = a <= null; +var r3b2 = b <= null; +var r3b3 = c <= null; +var r3b4 = d <= null; +var r3b5 = e <= null; +var r3b6 = f <= null; +var r3b7 = g <= null; +var r4a1 = null >= a; +var r4a2 = null >= b; +var r4a3 = null >= c; +var r4a4 = null >= d; +var r4a5 = null >= e; +var r4a6 = null >= f; +var r4a7 = null >= g; +var r4b1 = a >= null; +var r4b2 = b >= null; +var r4b3 = c >= null; +var r4b4 = d >= null; +var r4b5 = e >= null; +var r4b6 = f >= null; +var r4b7 = g >= null; +var r5a1 = null == a; +var r5a2 = null == b; +var r5a3 = null == c; +var r5a4 = null == d; +var r5a5 = null == e; +var r5a6 = null == f; +var r5a7 = null == g; +var r5b1 = a == null; +var r5b2 = b == null; +var r5b3 = c == null; +var r5b4 = d == null; +var r5b5 = e == null; +var r5b6 = f == null; +var r5b7 = g == null; +var r6a1 = null != a; +var r6a2 = null != b; +var r6a3 = null != c; +var r6a4 = null != d; +var r6a5 = null != e; +var r6a6 = null != f; +var r6a7 = null != g; +var r6b1 = a != null; +var r6b2 = b != null; +var r6b3 = c != null; +var r6b4 = d != null; +var r6b5 = e != null; +var r6b6 = f != null; +var r6b7 = g != null; +var r7a1 = null === a; +var r7a2 = null === b; +var r7a3 = null === c; +var r7a4 = null === d; +var r7a5 = null === e; +var r7a6 = null === f; +var r7a7 = null === g; +var r7b1 = a === null; +var r7b2 = b === null; +var r7b3 = c === null; +var r7b4 = d === null; +var r7b5 = e === null; +var r7b6 = f === null; +var r7b7 = g === null; +var r8a1 = null !== a; +var r8a2 = null !== b; +var r8a3 = null !== c; +var r8a4 = null !== d; +var r8a5 = null !== e; +var r8a6 = null !== f; +var r8a7 = null !== g; +var r8b1 = a !== null; +var r8b2 = b !== null; +var r8b3 = c !== null; +var r8b4 = d !== null; +var r8b5 = e !== null; +var r8b6 = f !== null; +var r8b7 = g !== null; diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js new file mode 100644 index 0000000000000..1faffebbc60f4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js @@ -0,0 +1,314 @@ +//// [comparisonOperatorWithOneOperandIsUndefined.ts] +var x: typeof undefined; + +enum E { a, b, c } + +function foo(t: T) { + var foo_r1 = t < x; + var foo_r2 = t > x; + var foo_r3 = t <= x; + var foo_r4 = t >= x; + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + + var foo_r1 = x < t; + var foo_r2 = x > t; + var foo_r3 = x <= t; + var foo_r4 = x >= t; + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; +} + +var a: boolean; +var b: number; +var c: string; +var d: void; +var e: E; +var f: {}; +var g: string[]; + +// operator < +var r1a1 = x < a; +var r1a2 = x < b; +var r1a3 = x < c; +var r1a4 = x < d; +var r1a5 = x < e; +var r1a6 = x < f; +var r1a7 = x < g; + +var r1b1 = a < x; +var r1b2 = b < x; +var r1b3 = c < x; +var r1b4 = d < x; +var r1b5 = e < x; +var r1b6 = f < x; +var r1b7 = g < x; + +// operator > +var r2a1 = x > a; +var r2a2 = x > b; +var r2a3 = x > c; +var r2a4 = x > d; +var r2a5 = x > e; +var r2a6 = x > f; +var r2a7 = x > g; + +var r2b1 = a > x; +var r2b2 = b > x; +var r2b3 = c > x; +var r2b4 = d > x; +var r2b5 = e > x; +var r2b6 = f > x; +var r2b7 = g > x; + +// operator <= +var r3a1 = x <= a; +var r3a2 = x <= b; +var r3a3 = x <= c; +var r3a4 = x <= d; +var r3a5 = x <= e; +var r3a6 = x <= f; +var r3a7 = x <= g; + +var r3b1 = a <= x; +var r3b2 = b <= x; +var r3b3 = c <= x; +var r3b4 = d <= x; +var r3b5 = e <= x; +var r3b6 = f <= x; +var r3b7 = g <= x; + +// operator >= +var r4a1 = x >= a; +var r4a2 = x >= b; +var r4a3 = x >= c; +var r4a4 = x >= d; +var r4a5 = x >= e; +var r4a6 = x >= f; +var r4a7 = x >= g; + +var r4b1 = a >= x; +var r4b2 = b >= x; +var r4b3 = c >= x; +var r4b4 = d >= x; +var r4b5 = e >= x; +var r4b6 = f >= x; +var r4b7 = g >= x; + +// operator == +var r5a1 = x == a; +var r5a2 = x == b; +var r5a3 = x == c; +var r5a4 = x == d; +var r5a5 = x == e; +var r5a6 = x == f; +var r5a7 = x == g; + +var r5b1 = a == x; +var r5b2 = b == x; +var r5b3 = c == x; +var r5b4 = d == x; +var r5b5 = e == x; +var r5b6 = f == x; +var r5b7 = g == x; + +// operator != +var r6a1 = x != a; +var r6a2 = x != b; +var r6a3 = x != c; +var r6a4 = x != d; +var r6a5 = x != e; +var r6a6 = x != f; +var r6a7 = x != g; + +var r6b1 = a != x; +var r6b2 = b != x; +var r6b3 = c != x; +var r6b4 = d != x; +var r6b5 = e != x; +var r6b6 = f != x; +var r6b7 = g != x; + +// operator === +var r7a1 = x === a; +var r7a2 = x === b; +var r7a3 = x === c; +var r7a4 = x === d; +var r7a5 = x === e; +var r7a6 = x === f; +var r7a7 = x === g; + +var r7b1 = a === x; +var r7b2 = b === x; +var r7b3 = c === x; +var r7b4 = d === x; +var r7b5 = e === x; +var r7b6 = f === x; +var r7b7 = g === x; + +// operator !== +var r8a1 = x !== a; +var r8a2 = x !== b; +var r8a3 = x !== c; +var r8a4 = x !== d; +var r8a5 = x !== e; +var r8a6 = x !== f; +var r8a7 = x !== g; + +var r8b1 = a !== x; +var r8b2 = b !== x; +var r8b3 = c !== x; +var r8b4 = d !== x; +var r8b5 = e !== x; +var r8b6 = f !== x; +var r8b7 = g !== x; + +//// [comparisonOperatorWithOneOperandIsUndefined.js] +var x; +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +function foo(t) { + var foo_r1 = t < x; + var foo_r2 = t > x; + var foo_r3 = t <= x; + var foo_r4 = t >= x; + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + var foo_r1 = x < t; + var foo_r2 = x > t; + var foo_r3 = x <= t; + var foo_r4 = x >= t; + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; +} +var a; +var b; +var c; +var d; +var e; +var f; +var g; +var r1a1 = x < a; +var r1a2 = x < b; +var r1a3 = x < c; +var r1a4 = x < d; +var r1a5 = x < e; +var r1a6 = x < f; +var r1a7 = x < g; +var r1b1 = a < x; +var r1b2 = b < x; +var r1b3 = c < x; +var r1b4 = d < x; +var r1b5 = e < x; +var r1b6 = f < x; +var r1b7 = g < x; +var r2a1 = x > a; +var r2a2 = x > b; +var r2a3 = x > c; +var r2a4 = x > d; +var r2a5 = x > e; +var r2a6 = x > f; +var r2a7 = x > g; +var r2b1 = a > x; +var r2b2 = b > x; +var r2b3 = c > x; +var r2b4 = d > x; +var r2b5 = e > x; +var r2b6 = f > x; +var r2b7 = g > x; +var r3a1 = x <= a; +var r3a2 = x <= b; +var r3a3 = x <= c; +var r3a4 = x <= d; +var r3a5 = x <= e; +var r3a6 = x <= f; +var r3a7 = x <= g; +var r3b1 = a <= x; +var r3b2 = b <= x; +var r3b3 = c <= x; +var r3b4 = d <= x; +var r3b5 = e <= x; +var r3b6 = f <= x; +var r3b7 = g <= x; +var r4a1 = x >= a; +var r4a2 = x >= b; +var r4a3 = x >= c; +var r4a4 = x >= d; +var r4a5 = x >= e; +var r4a6 = x >= f; +var r4a7 = x >= g; +var r4b1 = a >= x; +var r4b2 = b >= x; +var r4b3 = c >= x; +var r4b4 = d >= x; +var r4b5 = e >= x; +var r4b6 = f >= x; +var r4b7 = g >= x; +var r5a1 = x == a; +var r5a2 = x == b; +var r5a3 = x == c; +var r5a4 = x == d; +var r5a5 = x == e; +var r5a6 = x == f; +var r5a7 = x == g; +var r5b1 = a == x; +var r5b2 = b == x; +var r5b3 = c == x; +var r5b4 = d == x; +var r5b5 = e == x; +var r5b6 = f == x; +var r5b7 = g == x; +var r6a1 = x != a; +var r6a2 = x != b; +var r6a3 = x != c; +var r6a4 = x != d; +var r6a5 = x != e; +var r6a6 = x != f; +var r6a7 = x != g; +var r6b1 = a != x; +var r6b2 = b != x; +var r6b3 = c != x; +var r6b4 = d != x; +var r6b5 = e != x; +var r6b6 = f != x; +var r6b7 = g != x; +var r7a1 = x === a; +var r7a2 = x === b; +var r7a3 = x === c; +var r7a4 = x === d; +var r7a5 = x === e; +var r7a6 = x === f; +var r7a7 = x === g; +var r7b1 = a === x; +var r7b2 = b === x; +var r7b3 = c === x; +var r7b4 = d === x; +var r7b5 = e === x; +var r7b6 = f === x; +var r7b7 = g === x; +var r8a1 = x !== a; +var r8a2 = x !== b; +var r8a3 = x !== c; +var r8a4 = x !== d; +var r8a5 = x !== e; +var r8a6 = x !== f; +var r8a7 = x !== g; +var r8b1 = a !== x; +var r8b2 = b !== x; +var r8b3 = c !== x; +var r8b4 = d !== x; +var r8b5 = e !== x; +var r8b6 = f !== x; +var r8b7 = g !== x; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js new file mode 100644 index 0000000000000..a2866a7d44fbb --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js @@ -0,0 +1,127 @@ +//// [comparisonOperatorWithSubtypeEnumAndNumber.ts] +enum E { a, b, c } + +var a: E; +var b: number; + +// operator < +var ra1 = a < b; +var ra2 = b < a; +var ra3 = E.a < b; +var ra4 = b < E.a; +var ra5 = E.a < 0; +var ra6 = 0 < E.a; + +// operator > +var rb1 = a > b; +var rb2 = b > a; +var rb3 = E.a > b; +var rb4 = b > E.a; +var rb5 = E.a > 0; +var rb6 = 0 > E.a; + +// operator <= +var rc1 = a <= b; +var rc2 = b <= a; +var rc3 = E.a <= b; +var rc4 = b <= E.a; +var rc5 = E.a <= 0; +var rc6 = 0 <= E.a; + +// operator >= +var rd1 = a >= b; +var rd2 = b >= a; +var rd3 = E.a >= b; +var rd4 = b >= E.a; +var rd5 = E.a >= 0; +var rd6 = 0 >= E.a; + +// operator == +var re1 = a == b; +var re2 = b == a; +var re3 = E.a == b; +var re4 = b == E.a; +var re5 = E.a == 0; +var re6 = 0 == E.a; + +// operator != +var rf1 = a != b; +var rf2 = b != a; +var rf3 = E.a != b; +var rf4 = b != E.a; +var rf5 = E.a != 0; +var rf6 = 0 != E.a; + +// operator === +var rg1 = a === b; +var rg2 = b === a; +var rg3 = E.a === b; +var rg4 = b === E.a; +var rg5 = E.a === 0; +var rg6 = 0 === E.a; + +// operator !== +var rh1 = a !== b; +var rh2 = b !== a; +var rh3 = E.a !== b; +var rh4 = b !== E.a; +var rh5 = E.a !== 0; +var rh6 = 0 !== E.a; + +//// [comparisonOperatorWithSubtypeEnumAndNumber.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var ra1 = a < b; +var ra2 = b < a; +var ra3 = 0 /* a */ < b; +var ra4 = b < 0 /* a */; +var ra5 = 0 /* a */ < 0; +var ra6 = 0 < 0 /* a */; +var rb1 = a > b; +var rb2 = b > a; +var rb3 = 0 /* a */ > b; +var rb4 = b > 0 /* a */; +var rb5 = 0 /* a */ > 0; +var rb6 = 0 > 0 /* a */; +var rc1 = a <= b; +var rc2 = b <= a; +var rc3 = 0 /* a */ <= b; +var rc4 = b <= 0 /* a */; +var rc5 = 0 /* a */ <= 0; +var rc6 = 0 <= 0 /* a */; +var rd1 = a >= b; +var rd2 = b >= a; +var rd3 = 0 /* a */ >= b; +var rd4 = b >= 0 /* a */; +var rd5 = 0 /* a */ >= 0; +var rd6 = 0 >= 0 /* a */; +var re1 = a == b; +var re2 = b == a; +var re3 = 0 /* a */ == b; +var re4 = b == 0 /* a */; +var re5 = 0 /* a */ == 0; +var re6 = 0 == 0 /* a */; +var rf1 = a != b; +var rf2 = b != a; +var rf3 = 0 /* a */ != b; +var rf4 = b != 0 /* a */; +var rf5 = 0 /* a */ != 0; +var rf6 = 0 != 0 /* a */; +var rg1 = a === b; +var rg2 = b === a; +var rg3 = 0 /* a */ === b; +var rg4 = b === 0 /* a */; +var rg5 = 0 /* a */ === 0; +var rg6 = 0 === 0 /* a */; +var rh1 = a !== b; +var rh2 = b !== a; +var rh3 = 0 /* a */ !== b; +var rh4 = b !== 0 /* a */; +var rh5 = 0 /* a */ !== 0; +var rh6 = 0 !== 0 /* a */; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js new file mode 100644 index 0000000000000..1f6706c3a10c4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -0,0 +1,478 @@ +//// [comparisonOperatorWithSubtypeObjectOnCallSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +var a1: { fn(): void }; +var b1: { fn(): void }; + +var a2: { fn(a: number, b: string): void }; +var b2: { fn(a: number, b: string): void }; + +var a3: { fn(a: number, b: string): void }; +var b3: { fn(a: number): void }; + +var a4: { fn(a: number, b: string): void }; +var b4: { fn(): void }; + +var a5: { fn(a: Base): void }; +var b5: { fn(a: Derived): void }; + +var a6: { fn(a: Derived, b: Base): void }; +var b6: { fn(a: Base, b: Derived): void }; + +var a7: { fn(): void }; +var b7: { fn(): Base }; + +var a8: { fn(): Base }; +var b8: { fn(): Base }; + +var a9: { fn(): Base }; +var b9: { fn(): Derived }; + +var a10: { fn(a?: Base): void }; +var b10: { fn(a?: Derived): void }; + +var a11: { fn(...a: Base[]): void }; +var b11: { fn(...a: Derived[]): void }; + +//var a12: { fn(t: T, u: U): T[] }; +//var b12: { fn(a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1a8 = a8 < b8; +var r1a9 = a9 < b9; +var r1a10 = a10 < b10; +var r1a11 = a11 < b11; +//var r1a12 = a12 < b12; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r1b8 = b8 < a8; +var r1b9 = b9 < a9; +var r1b10 = b10 < a10; +var r1b11 = b11 < a11; +//var r1b12 = b12 < a12; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2a8 = a8 > b8; +var r2a9 = a9 > b9; +var r2a10 = a10 > b10; +var r2a11 = a11 > b11; +//var r2a12 = a12 > b12; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r2b8 = b8 > a8; +var r2b9 = b9 > a9; +var r2b10 = b10 > a10; +var r2b11 = b11 > a11; +//var r2b12 = b12 > a12; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3a8 = a8 <= b8; +var r3a9 = a9 <= b9; +var r3a10 = a10 <= b10; +var r3a11 = a11 <= b11; +//var r3a12 = a12 <= b12; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r3b8 = b8 <= a8; +var r3b9 = b9 <= a9; +var r3b10 = b10 <= a10; +var r3b11 = b11 <= a11; +//var r3b12 = b12 <= a12; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4a8 = a8 >= b8; +var r4a9 = a9 >= b9; +var r4a10 = a10 >= b10; +var r4a11 = a11 >= b11; +//var r4a12 = a12 >= b12; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r4b8 = b8 >= a8; +var r4b9 = b9 >= a9; +var r4b10 = b10 >= a10; +var r4b11 = b11 >= a11; +//var r4b12 = b12 >= a12; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5a8 = a8 == b8; +var r5a9 = a9 == b9; +var r5a10 = a10 == b10; +var r5a11 = a11 == b11; +//var r5a12 = a12 == b12; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r5b8 = b8 == a8; +var r5b9 = b9 == a9; +var r5b10 = b10 == a10; +var r5b11 = b11 == a11; +//var r5b12 = b12 == a12; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6a8 = a8 != b8; +var r6a9 = a9 != b9; +var r6a10 = a10 != b10; +var r6a11 = a11 != b11; +//var r6a12 = a12 != b12; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r6b8 = b8 != a8; +var r6b9 = b9 != a9; +var r6b10 = b10 != a10; +var r6b11 = b11 != a11; +//var r6b12 = b12 != a12; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7a8 = a8 === b8; +var r7a9 = a9 === b9; +var r7a10 = a10 === b10; +var r7a11 = a11 === b11; +//var r7a12 = a12 === b12; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r7b8 = b8 === a8; +var r7b9 = b9 === a9; +var r7b10 = b10 === a10; +var r7b11 = b11 === a11; +//var r7b12 = b12 === a12; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8a8 = a8 !== b8; +var r8a9 = a9 !== b9; +var r8a10 = a10 !== b10; +var r8a11 = a11 !== b11; +//var r8a12 = a12 !== b12; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; +var r8b8 = b8 !== a8; +var r8b9 = b9 !== a9; +var r8b10 = b10 !== a10; +var r8b11 = b11 !== a11; +//var r8b12 = b12 !== a12; + +//// [comparisonOperatorWithSubtypeObjectOnCallSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var a7; +var b7; +var a8; +var b8; +var a9; +var b9; +var a10; +var b10; +var a11; +var b11; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1a8 = a8 < b8; +var r1a9 = a9 < b9; +var r1a10 = a10 < b10; +var r1a11 = a11 < b11; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r1b8 = b8 < a8; +var r1b9 = b9 < a9; +var r1b10 = b10 < a10; +var r1b11 = b11 < a11; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2a8 = a8 > b8; +var r2a9 = a9 > b9; +var r2a10 = a10 > b10; +var r2a11 = a11 > b11; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r2b8 = b8 > a8; +var r2b9 = b9 > a9; +var r2b10 = b10 > a10; +var r2b11 = b11 > a11; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3a8 = a8 <= b8; +var r3a9 = a9 <= b9; +var r3a10 = a10 <= b10; +var r3a11 = a11 <= b11; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r3b8 = b8 <= a8; +var r3b9 = b9 <= a9; +var r3b10 = b10 <= a10; +var r3b11 = b11 <= a11; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4a8 = a8 >= b8; +var r4a9 = a9 >= b9; +var r4a10 = a10 >= b10; +var r4a11 = a11 >= b11; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r4b8 = b8 >= a8; +var r4b9 = b9 >= a9; +var r4b10 = b10 >= a10; +var r4b11 = b11 >= a11; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5a8 = a8 == b8; +var r5a9 = a9 == b9; +var r5a10 = a10 == b10; +var r5a11 = a11 == b11; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r5b8 = b8 == a8; +var r5b9 = b9 == a9; +var r5b10 = b10 == a10; +var r5b11 = b11 == a11; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6a8 = a8 != b8; +var r6a9 = a9 != b9; +var r6a10 = a10 != b10; +var r6a11 = a11 != b11; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r6b8 = b8 != a8; +var r6b9 = b9 != a9; +var r6b10 = b10 != a10; +var r6b11 = b11 != a11; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7a8 = a8 === b8; +var r7a9 = a9 === b9; +var r7a10 = a10 === b10; +var r7a11 = a11 === b11; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r7b8 = b8 === a8; +var r7b9 = b9 === a9; +var r7b10 = b10 === a10; +var r7b11 = b11 === a11; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8a8 = a8 !== b8; +var r8a9 = a9 !== b9; +var r8a10 = a10 !== b10; +var r8a11 = a11 !== b11; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; +var r8b8 = b8 !== a8; +var r8b9 = b9 !== a9; +var r8b10 = b10 !== a10; +var r8b11 = b11 !== a11; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js new file mode 100644 index 0000000000000..df82986e45d5a --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -0,0 +1,404 @@ +//// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +var a1: { new (): Base }; +var b1: { new (): Base }; + +var a2: { new (a: number, b: string): Base }; +var b2: { new (a: number, b: string): Base }; + +var a3: { new (a: number, b: string): Base }; +var b3: { new (a: number): Base }; + +var a4: { new (a: number, b: string): Base }; +var b4: { new (): Base }; + +var a5: { new (a: Base): Base }; +var b5: { new (a: Derived): Base }; + +var a6: { new (a: Derived, b: Base): Base }; +var b6: { new (a: Base, b: Derived): Base }; + +var a7: { new (): Base }; +var b7: { new (): Derived }; + +var a8: { new (a?: Base): Base }; +var b8: { new (a?: Derived): Base }; + +var a9: { new (...a: Base[]): Base }; +var b9: { new (...a: Derived[]): Base }; + +//var a10: { (t: T, u: U): T[] }; +//var b10: { (a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1a8 = a8 < b8; +var r1a9 = a9 < b9; +//var r1a10 = a10 < b10; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r1b8 = b8 < a8; +var r1b9 = b9 < a9; +//var r1b10 = b10 < a10; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2a8 = a8 > b8; +var r2a9 = a9 > b9; +//var r2a10 = a10 > b10; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r2b8 = b8 > a8; +var r2b9 = b9 > a9; +//var r2b10 = b10 > a10; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3a8 = a8 <= b8; +var r3a9 = a9 <= b9; +//var r3a10 = a10 <= b10; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r3b8 = b8 <= a8; +var r3b9 = b9 <= a9; +//var r3b10 = b10 <= a10; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4a8 = a8 >= b8; +var r4a9 = a9 >= b9; +//var r4a10 = a10 >= b10; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r4b8 = b8 >= a8; +var r4b9 = b9 >= a9; +//var r4b10 = b10 >= a10; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5a8 = a8 == b8; +var r5a9 = a9 == b9; +//var r5a10 = a10 == b10; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r5b8 = b8 == a8; +var r5b9 = b9 == a9; +//var r5b10 = b10 == a10; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6a8 = a8 != b8; +var r6a9 = a9 != b9; +//var r6a10 = a10 != b10; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r6b8 = b8 != a8; +var r6b9 = b9 != a9; +//var r6b10 = b10 != a10; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7a8 = a8 === b8; +var r7a9 = a9 === b9; +//var r7a10 = a10 === b10; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r7b8 = b8 === a8; +var r7b9 = b9 === a9; +//var r7b10 = b10 === a10; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8a8 = a8 !== b8; +var r8a9 = a9 !== b9; +//var r8a10 = a10 !== b10; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; +var r8b8 = b8 !== a8; +var r8b9 = b9 !== a9; +//var r8b10 = b10 !== a10; + +//// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var a7; +var b7; +var a8; +var b8; +var a9; +var b9; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1a7 = a7 < b7; +var r1a8 = a8 < b8; +var r1a9 = a9 < b9; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r1b7 = b7 < a7; +var r1b8 = b8 < a8; +var r1b9 = b9 < a9; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2a7 = a7 > b7; +var r2a8 = a8 > b8; +var r2a9 = a9 > b9; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r2b7 = b7 > a7; +var r2b8 = b8 > a8; +var r2b9 = b9 > a9; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3a7 = a7 <= b7; +var r3a8 = a8 <= b8; +var r3a9 = a9 <= b9; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r3b7 = b7 <= a7; +var r3b8 = b8 <= a8; +var r3b9 = b9 <= a9; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4a7 = a7 >= b7; +var r4a8 = a8 >= b8; +var r4a9 = a9 >= b9; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r4b7 = b7 >= a7; +var r4b8 = b8 >= a8; +var r4b9 = b9 >= a9; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5a7 = a7 == b7; +var r5a8 = a8 == b8; +var r5a9 = a9 == b9; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r5b7 = b7 == a7; +var r5b8 = b8 == a8; +var r5b9 = b9 == a9; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6a7 = a7 != b7; +var r6a8 = a8 != b8; +var r6a9 = a9 != b9; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r6b7 = b7 != a7; +var r6b8 = b8 != a8; +var r6b9 = b9 != a9; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7a7 = a7 === b7; +var r7a8 = a8 === b8; +var r7a9 = a9 === b9; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r7b7 = b7 === a7; +var r7b8 = b8 === a8; +var r7b9 = b9 === a9; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8a7 = a7 !== b7; +var r8a8 = a8 !== b8; +var r8a9 = a9 !== b9; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +var r8b7 = b7 !== a7; +var r8b8 = b8 !== a8; +var r8b9 = b9 !== a9; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js new file mode 100644 index 0000000000000..c6c785266a0f5 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -0,0 +1,200 @@ +//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +var a1: { [a: string]: string }; +var b1: { [b: string]: string }; + +var a2: { [index: string]: Base }; +var b2: { [index: string]: Derived }; + +var a3: { [index: number]: string }; +var b3: { [index: number]: string }; + +var a4: { [index: number]: Base }; +var b4: { [index: string]: Derived }; + +// operator < +var r1a1 = a1 < b1; +var r1a1 = a2 < b2; +var r1a1 = a3 < b3; +var r1a1 = a4 < b4; + +var r1b1 = b1 < a1; +var r1b1 = b2 < a2; +var r1b1 = b3 < a3; +var r1b1 = b4 < a4; + +// operator > +var r2a1 = a1 > b1; +var r2a1 = a2 > b2; +var r2a1 = a3 > b3; +var r2a1 = a4 > b4; + +var r2b1 = b1 > a1; +var r2b1 = b2 > a2; +var r2b1 = b3 > a3; +var r2b1 = b4 > a4; + +// operator <= +var r3a1 = a1 <= b1; +var r3a1 = a2 <= b2; +var r3a1 = a3 <= b3; +var r3a1 = a4 <= b4; + +var r3b1 = b1 <= a1; +var r3b1 = b2 <= a2; +var r3b1 = b3 <= a3; +var r3b1 = b4 <= a4; + +// operator >= +var r4a1 = a1 >= b1; +var r4a1 = a2 >= b2; +var r4a1 = a3 >= b3; +var r4a1 = a4 >= b4; + +var r4b1 = b1 >= a1; +var r4b1 = b2 >= a2; +var r4b1 = b3 >= a3; +var r4b1 = b4 >= a4; + +// operator == +var r5a1 = a1 == b1; +var r5a1 = a2 == b2; +var r5a1 = a3 == b3; +var r5a1 = a4 == b4; + +var r5b1 = b1 == a1; +var r5b1 = b2 == a2; +var r5b1 = b3 == a3; +var r5b1 = b4 == a4; + +// operator != +var r6a1 = a1 != b1; +var r6a1 = a2 != b2; +var r6a1 = a3 != b3; +var r6a1 = a4 != b4; + +var r6b1 = b1 != a1; +var r6b1 = b2 != a2; +var r6b1 = b3 != a3; +var r6b1 = b4 != a4; + +// operator === +var r7a1 = a1 === b1; +var r7a1 = a2 === b2; +var r7a1 = a3 === b3; +var r7a1 = a4 === b4; + +var r7b1 = b1 === a1; +var r7b1 = b2 === a2; +var r7b1 = b3 === a3; +var r7b1 = b4 === a4; + +// operator !== +var r8a1 = a1 !== b1; +var r8a1 = a2 !== b2; +var r8a1 = a3 !== b3; +var r8a1 = a4 !== b4; + +var r8b1 = b1 !== a1; +var r8b1 = b2 !== a2; +var r8b1 = b3 !== a3; +var r8b1 = b4 !== a4; + +//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var r1a1 = a1 < b1; +var r1a1 = a2 < b2; +var r1a1 = a3 < b3; +var r1a1 = a4 < b4; +var r1b1 = b1 < a1; +var r1b1 = b2 < a2; +var r1b1 = b3 < a3; +var r1b1 = b4 < a4; +var r2a1 = a1 > b1; +var r2a1 = a2 > b2; +var r2a1 = a3 > b3; +var r2a1 = a4 > b4; +var r2b1 = b1 > a1; +var r2b1 = b2 > a2; +var r2b1 = b3 > a3; +var r2b1 = b4 > a4; +var r3a1 = a1 <= b1; +var r3a1 = a2 <= b2; +var r3a1 = a3 <= b3; +var r3a1 = a4 <= b4; +var r3b1 = b1 <= a1; +var r3b1 = b2 <= a2; +var r3b1 = b3 <= a3; +var r3b1 = b4 <= a4; +var r4a1 = a1 >= b1; +var r4a1 = a2 >= b2; +var r4a1 = a3 >= b3; +var r4a1 = a4 >= b4; +var r4b1 = b1 >= a1; +var r4b1 = b2 >= a2; +var r4b1 = b3 >= a3; +var r4b1 = b4 >= a4; +var r5a1 = a1 == b1; +var r5a1 = a2 == b2; +var r5a1 = a3 == b3; +var r5a1 = a4 == b4; +var r5b1 = b1 == a1; +var r5b1 = b2 == a2; +var r5b1 = b3 == a3; +var r5b1 = b4 == a4; +var r6a1 = a1 != b1; +var r6a1 = a2 != b2; +var r6a1 = a3 != b3; +var r6a1 = a4 != b4; +var r6b1 = b1 != a1; +var r6b1 = b2 != a2; +var r6b1 = b3 != a3; +var r6b1 = b4 != a4; +var r7a1 = a1 === b1; +var r7a1 = a2 === b2; +var r7a1 = a3 === b3; +var r7a1 = a4 === b4; +var r7b1 = b1 === a1; +var r7b1 = b2 === a2; +var r7b1 = b3 === a3; +var r7b1 = b4 === a4; +var r8a1 = a1 !== b1; +var r8a1 = a2 !== b2; +var r8a1 = a3 !== b3; +var r8a1 = a4 !== b4; +var r8b1 = b1 !== a1; +var r8b1 = b2 !== a2; +var r8b1 = b3 !== a3; +var r8b1 = b4 !== a4; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt new file mode 100644 index 0000000000000..33fcc439e0aa4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt @@ -0,0 +1,197 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts (16 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + var a1: { fn(x: T): T }; + var b1: { fn(x: string): string }; + + var a2: { fn(x: T): T }; + var b2: { fn(x: string, y: number): string }; + + var a3: { fn(x: T, y: U): T }; + var b3: { fn(x: string, y: number): string }; + + var a4: { fn(x?: T): T }; + var b4: { fn(x?: string): string }; + + var a5: { fn(...x: T[]): T }; + var b5: { fn(...x: string[]): string }; + + var a6: { fn(x: T, y: T): T }; + var b6: { fn(x: string, y: number): {} }; + + //var a7: { fn(x: T, y: U): T }; + var b7: { fn(x: Base, y: Derived): Base }; + + // operator < + var r1a1 = a1 < b1; + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r1a3 = a3 < b3; + var r1a4 = a4 < b4; + var r1a5 = a5 < b5; + var r1a6 = a6 < b6; + //var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r1b3 = b3 < a3; + var r1b4 = b4 < a4; + var r1b5 = b5 < a5; + var r1b6 = b6 < a6; + //var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r2a3 = a3 > b3; + var r2a4 = a4 > b4; + var r2a5 = a5 > b5; + var r2a6 = a6 > b6; + //var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r2b3 = b3 > a3; + var r2b4 = b4 > a4; + var r2b5 = b5 > a5; + var r2b6 = b6 > a6; + //var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r3a3 = a3 <= b3; + var r3a4 = a4 <= b4; + var r3a5 = a5 <= b5; + var r3a6 = a6 <= b6; + //var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r3b3 = b3 <= a3; + var r3b4 = b4 <= a4; + var r3b5 = b5 <= a5; + var r3b6 = b6 <= a6; + //var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r4a3 = a3 >= b3; + var r4a4 = a4 >= b4; + var r4a5 = a5 >= b5; + var r4a6 = a6 >= b6; + //var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r4b3 = b3 >= a3; + var r4b4 = b4 >= a4; + var r4b5 = b5 >= a5; + var r4b6 = b6 >= a6; + //var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r5a3 = a3 == b3; + var r5a4 = a4 == b4; + var r5a5 = a5 == b5; + var r5a6 = a6 == b6; + //var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r5b3 = b3 == a3; + var r5b4 = b4 == a4; + var r5b5 = b5 == a5; + var r5b6 = b6 == a6; + //var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r6a3 = a3 != b3; + var r6a4 = a4 != b4; + var r6a5 = a5 != b5; + var r6a6 = a6 != b6; + //var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r6b3 = b3 != a3; + var r6b4 = b4 != a4; + var r6b5 = b5 != a5; + var r6b6 = b6 != a6; + //var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r7a3 = a3 === b3; + var r7a4 = a4 === b4; + var r7a5 = a5 === b5; + var r7a6 = a6 === b6; + //var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r7b3 = b3 === a3; + var r7b4 = b4 === a4; + var r7b5 = b5 === a5; + var r7b6 = b6 === a6; + //var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(x: T): T; }' and '{ fn(x: string, y: number): string; }'. + var r8a3 = a3 !== b3; + var r8a4 = a4 !== b4; + var r8a5 = a5 !== b5; + var r8a6 = a6 !== b6; + //var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types '{ fn(x: string, y: number): string; }' and '{ fn(x: T): T; }'. + var r8b3 = b3 !== a3; + var r8b4 = b4 !== a4; + var r8b5 = b5 !== a5; + var r8b6 = b6 !== a6; + //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js new file mode 100644 index 0000000000000..67a33f10a15ee --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -0,0 +1,294 @@ +//// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +var a1: { fn(x: T): T }; +var b1: { fn(x: string): string }; + +var a2: { fn(x: T): T }; +var b2: { fn(x: string, y: number): string }; + +var a3: { fn(x: T, y: U): T }; +var b3: { fn(x: string, y: number): string }; + +var a4: { fn(x?: T): T }; +var b4: { fn(x?: string): string }; + +var a5: { fn(...x: T[]): T }; +var b5: { fn(...x: string[]): string }; + +var a6: { fn(x: T, y: T): T }; +var b6: { fn(x: string, y: number): {} }; + +//var a7: { fn(x: T, y: U): T }; +var b7: { fn(x: Base, y: Derived): Base }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +//var r8b7 = b7 !== a7; + +//// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var b7; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt new file mode 100644 index 0000000000000..573322f8d6602 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt @@ -0,0 +1,197 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts (16 errors) ==== + class Base { + public a: string; + } + + class Derived extends Base { + public b: string; + } + + var a1: { new (x: T): T }; + var b1: { new (x: string): string }; + + var a2: { new (x: T): T }; + var b2: { new (x: string, y: number): string }; + + var a3: { new (x: T, y: U): T }; + var b3: { new (x: string, y: number): string }; + + var a4: { new (x?: T): T }; + var b4: { new (x?: string): string }; + + var a5: { new (...x: T[]): T }; + var b5: { new (...x: string[]): string }; + + var a6: { new (x: T, y: T): T }; + var b6: { new (x: string, y: number): {} }; + + //var a7: { new (x: T, y: U): T }; + var b7: { new (x: Base, y: Derived): Base }; + + // operator < + var r1a1 = a1 < b1; + var r1a2 = a2 < b2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r1a3 = a3 < b3; + var r1a4 = a4 < b4; + var r1a5 = a5 < b5; + var r1a6 = a6 < b6; + //var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + var r1b2 = b2 < a2; + ~~~~~~~ +!!! Operator '<' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r1b3 = b3 < a3; + var r1b4 = b4 < a4; + var r1b5 = b5 < a5; + var r1b6 = b6 < a6; + //var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + var r2a2 = a2 > b2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r2a3 = a3 > b3; + var r2a4 = a4 > b4; + var r2a5 = a5 > b5; + var r2a6 = a6 > b6; + //var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + var r2b2 = b2 > a2; + ~~~~~~~ +!!! Operator '>' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r2b3 = b3 > a3; + var r2b4 = b4 > a4; + var r2b5 = b5 > a5; + var r2b6 = b6 > a6; + //var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + var r3a2 = a2 <= b2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r3a3 = a3 <= b3; + var r3a4 = a4 <= b4; + var r3a5 = a5 <= b5; + var r3a6 = a6 <= b6; + //var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + var r3b2 = b2 <= a2; + ~~~~~~~~ +!!! Operator '<=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r3b3 = b3 <= a3; + var r3b4 = b4 <= a4; + var r3b5 = b5 <= a5; + var r3b6 = b6 <= a6; + //var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + var r4a2 = a2 >= b2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r4a3 = a3 >= b3; + var r4a4 = a4 >= b4; + var r4a5 = a5 >= b5; + var r4a6 = a6 >= b6; + //var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + var r4b2 = b2 >= a2; + ~~~~~~~~ +!!! Operator '>=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r4b3 = b3 >= a3; + var r4b4 = b4 >= a4; + var r4b5 = b5 >= a5; + var r4b6 = b6 >= a6; + //var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + var r5a2 = a2 == b2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r5a3 = a3 == b3; + var r5a4 = a4 == b4; + var r5a5 = a5 == b5; + var r5a6 = a6 == b6; + //var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + var r5b2 = b2 == a2; + ~~~~~~~~ +!!! Operator '==' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r5b3 = b3 == a3; + var r5b4 = b4 == a4; + var r5b5 = b5 == a5; + var r5b6 = b6 == a6; + //var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + var r6a2 = a2 != b2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r6a3 = a3 != b3; + var r6a4 = a4 != b4; + var r6a5 = a5 != b5; + var r6a6 = a6 != b6; + //var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + var r6b2 = b2 != a2; + ~~~~~~~~ +!!! Operator '!=' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r6b3 = b3 != a3; + var r6b4 = b4 != a4; + var r6b5 = b5 != a5; + var r6b6 = b6 != a6; + //var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + var r7a2 = a2 === b2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r7a3 = a3 === b3; + var r7a4 = a4 === b4; + var r7a5 = a5 === b5; + var r7a6 = a6 === b6; + //var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + var r7b2 = b2 === a2; + ~~~~~~~~~ +!!! Operator '===' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r7b3 = b3 === a3; + var r7b4 = b4 === a4; + var r7b5 = b5 === a5; + var r7b6 = b6 === a6; + //var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + var r8a2 = a2 !== b2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (x: T) => T' and 'new (x: string, y: number) => string'. + var r8a3 = a3 !== b3; + var r8a4 = a4 !== b4; + var r8a5 = a5 !== b5; + var r8a6 = a6 !== b6; + //var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + var r8b2 = b2 !== a2; + ~~~~~~~~~ +!!! Operator '!==' cannot be applied to types 'new (x: string, y: number) => string' and 'new (x: T) => T'. + var r8b3 = b3 !== a3; + var r8b4 = b4 !== a4; + var r8b5 = b5 !== a5; + var r8b6 = b6 !== a6; + //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js new file mode 100644 index 0000000000000..c47ec3bc05f93 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -0,0 +1,294 @@ +//// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +var a1: { new (x: T): T }; +var b1: { new (x: string): string }; + +var a2: { new (x: T): T }; +var b2: { new (x: string, y: number): string }; + +var a3: { new (x: T, y: U): T }; +var b3: { new (x: string, y: number): string }; + +var a4: { new (x?: T): T }; +var b4: { new (x?: string): string }; + +var a5: { new (...x: T[]): T }; +var b5: { new (...x: string[]): string }; + +var a6: { new (x: T, y: T): T }; +var b6: { new (x: string, y: number): {} }; + +//var a7: { new (x: T, y: U): T }; +var b7: { new (x: Base, y: Derived): Base }; + +// operator < +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; +//var r8b7 = b7 !== a7; + +//// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var a1; +var b1; +var a2; +var b2; +var a3; +var b3; +var a4; +var b4; +var a5; +var b5; +var a6; +var b6; +var b7; +var r1a1 = a1 < b1; +var r1a2 = a2 < b2; +var r1a3 = a3 < b3; +var r1a4 = a4 < b4; +var r1a5 = a5 < b5; +var r1a6 = a6 < b6; +var r1b1 = b1 < a1; +var r1b2 = b2 < a2; +var r1b3 = b3 < a3; +var r1b4 = b4 < a4; +var r1b5 = b5 < a5; +var r1b6 = b6 < a6; +var r2a1 = a1 > b1; +var r2a2 = a2 > b2; +var r2a3 = a3 > b3; +var r2a4 = a4 > b4; +var r2a5 = a5 > b5; +var r2a6 = a6 > b6; +var r2b1 = b1 > a1; +var r2b2 = b2 > a2; +var r2b3 = b3 > a3; +var r2b4 = b4 > a4; +var r2b5 = b5 > a5; +var r2b6 = b6 > a6; +var r3a1 = a1 <= b1; +var r3a2 = a2 <= b2; +var r3a3 = a3 <= b3; +var r3a4 = a4 <= b4; +var r3a5 = a5 <= b5; +var r3a6 = a6 <= b6; +var r3b1 = b1 <= a1; +var r3b2 = b2 <= a2; +var r3b3 = b3 <= a3; +var r3b4 = b4 <= a4; +var r3b5 = b5 <= a5; +var r3b6 = b6 <= a6; +var r4a1 = a1 >= b1; +var r4a2 = a2 >= b2; +var r4a3 = a3 >= b3; +var r4a4 = a4 >= b4; +var r4a5 = a5 >= b5; +var r4a6 = a6 >= b6; +var r4b1 = b1 >= a1; +var r4b2 = b2 >= a2; +var r4b3 = b3 >= a3; +var r4b4 = b4 >= a4; +var r4b5 = b5 >= a5; +var r4b6 = b6 >= a6; +var r5a1 = a1 == b1; +var r5a2 = a2 == b2; +var r5a3 = a3 == b3; +var r5a4 = a4 == b4; +var r5a5 = a5 == b5; +var r5a6 = a6 == b6; +var r5b1 = b1 == a1; +var r5b2 = b2 == a2; +var r5b3 = b3 == a3; +var r5b4 = b4 == a4; +var r5b5 = b5 == a5; +var r5b6 = b6 == a6; +var r6a1 = a1 != b1; +var r6a2 = a2 != b2; +var r6a3 = a3 != b3; +var r6a4 = a4 != b4; +var r6a5 = a5 != b5; +var r6a6 = a6 != b6; +var r6b1 = b1 != a1; +var r6b2 = b2 != a2; +var r6b3 = b3 != a3; +var r6b4 = b4 != a4; +var r6b5 = b5 != a5; +var r6b6 = b6 != a6; +var r7a1 = a1 === b1; +var r7a2 = a2 === b2; +var r7a3 = a3 === b3; +var r7a4 = a4 === b4; +var r7a5 = a5 === b5; +var r7a6 = a6 === b6; +var r7b1 = b1 === a1; +var r7b2 = b2 === a2; +var r7b3 = b3 === a3; +var r7b4 = b4 === a4; +var r7b5 = b5 === a5; +var r7b6 = b6 === a6; +var r8a1 = a1 !== b1; +var r8a2 = a2 !== b2; +var r8a3 = a3 !== b3; +var r8a4 = a4 !== b4; +var r8a5 = a5 !== b5; +var r8a6 = a6 !== b6; +var r8b1 = b1 !== a1; +var r8b2 = b2 !== a2; +var r8b3 = b3 !== a3; +var r8b4 = b4 !== a4; +var r8b5 = b5 !== a5; +var r8b6 = b6 !== a6; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js new file mode 100644 index 0000000000000..570c6faf123e2 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js @@ -0,0 +1,64 @@ +//// [comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts] +interface I { + a: string; + b?: number; +} + +interface J { + a: string; +} + +var a: I; +var b: J; + +// operator < +var ra1 = a < b; +var ra2 = b < a; + +// operator > +var rb1 = a > b; +var rb2 = b > a; + +// operator <= +var rc1 = a <= b; +var rc2 = b <= a; + +// operator >= +var rd1 = a >= b; +var rd2 = b >= a; + +// operator == +var re1 = a == b; +var re2 = b == a; + +// operator != +var rf1 = a != b; +var rf2 = b != a; + +// operator === +var rg1 = a === b; +var rg2 = b === a; + +// operator !== +var rh1 = a !== b; +var rh2 = b !== a; + +//// [comparisonOperatorWithSubtypeObjectOnOptionalProperty.js] +var a; +var b; +var ra1 = a < b; +var ra2 = b < a; +var rb1 = a > b; +var rb2 = b > a; +var rc1 = a <= b; +var rc2 = b <= a; +var rd1 = a >= b; +var rd2 = b >= a; +var re1 = a == b; +var re2 = b == a; +var rf1 = a != b; +var rf2 = b != a; +var rg1 = a === b; +var rg2 = b === a; +var rh1 = a !== b; +var rh2 = b !== a; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js new file mode 100644 index 0000000000000..0dfe4cf330a35 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -0,0 +1,157 @@ +//// [comparisonOperatorWithSubtypeObjectOnProperty.ts] +class Base { + public a: string; +} + +class Derived extends Base { + public b: string; +} + +class A1 { + public a: Base; + public b: Base; +} + +class B1 { + public a: Base; + public b: Derived; +} + +class A2 { + private a; +} + +class B2 extends A2 { + private b; +} + +var a1: A1; +var a2: A2; +var b1: B1; +var b2: B2; + +// operator < +var ra1 = a1 < b1; +var ra2 = a2 < b2; +var ra3 = b1 < a1; +var ra4 = b2 < a2; + +// operator > +var rb1 = a1 > b1; +var rb2 = a2 > b2; +var rb3 = b1 > a1; +var rb4 = b2 > a2; + +// operator <= +var rc1 = a1 <= b1; +var rc2 = a2 <= b2; +var rc3 = b1 <= a1; +var rc4 = b2 <= a2; + +// operator >= +var rd1 = a1 >= b1; +var rd2 = a2 >= b2; +var rd3 = b1 >= a1; +var rd4 = b2 >= a2; + +// operator == +var re1 = a1 == b1; +var re2 = a2 == b2; +var re3 = b1 == a1; +var re4 = b2 == a2; + +// operator != +var rf1 = a1 != b1; +var rf2 = a2 != b2; +var rf3 = b1 != a1; +var rf4 = b2 != a2; + +// operator === +var rg1 = a1 === b1; +var rg2 = a2 === b2; +var rg3 = b1 === a1; +var rg4 = b2 === a2; + +// operator !== +var rh1 = a1 !== b1; +var rh2 = a2 !== b2; +var rh3 = b1 !== a1; +var rh4 = b2 !== a2; + +//// [comparisonOperatorWithSubtypeObjectOnProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var A1 = (function () { + function A1() { + } + return A1; +})(); +var B1 = (function () { + function B1() { + } + return B1; +})(); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var B2 = (function (_super) { + __extends(B2, _super); + function B2() { + _super.apply(this, arguments); + } + return B2; +})(A2); +var a1; +var a2; +var b1; +var b2; +var ra1 = a1 < b1; +var ra2 = a2 < b2; +var ra3 = b1 < a1; +var ra4 = b2 < a2; +var rb1 = a1 > b1; +var rb2 = a2 > b2; +var rb3 = b1 > a1; +var rb4 = b2 > a2; +var rc1 = a1 <= b1; +var rc2 = a2 <= b2; +var rc3 = b1 <= a1; +var rc4 = b2 <= a2; +var rd1 = a1 >= b1; +var rd2 = a2 >= b2; +var rd3 = b1 >= a1; +var rd4 = b2 >= a2; +var re1 = a1 == b1; +var re2 = a2 == b2; +var re3 = b1 == a1; +var re4 = b2 == a2; +var rf1 = a1 != b1; +var rf2 = a2 != b2; +var rf3 = b1 != a1; +var rf4 = b2 != a2; +var rg1 = a1 === b1; +var rg2 = a2 === b2; +var rg3 = b1 === a1; +var rg4 = b2 === a2; +var rh1 = a1 !== b1; +var rh2 = a2 !== b2; +var rh3 = b1 !== a1; +var rh4 = b2 !== a2; diff --git a/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js new file mode 100644 index 0000000000000..6f0aa6b3537e9 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js @@ -0,0 +1,22 @@ +//// [comparisonOperatorWithTwoOperandsAreAny.ts] +var a: any; + +var r1 = a < a; +var r2 = a > a; +var r3 = a <= a; +var r4 = a >= a; +var r5 = a == a; +var r6 = a != a; +var r7 = a === a; +var r8 = a !== a; + +//// [comparisonOperatorWithTwoOperandsAreAny.js] +var a; +var r1 = a < a; +var r2 = a > a; +var r3 = a <= a; +var r4 = a >= a; +var r5 = a == a; +var r6 = a != a; +var r7 = a === a; +var r8 = a !== a; diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt new file mode 100644 index 0000000000000..139efbbfc9921 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt @@ -0,0 +1,143 @@ +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts (32 errors) ==== + var a: {}; + var b: Object; + + function foo(t: T, u: U, v: V) { + // errors + var ra1 = t < u; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'U'. + var ra2 = t > u; + ~~~~~ +!!! Operator '>' cannot be applied to types 'T' and 'U'. + var ra3 = t <= u; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'T' and 'U'. + var ra4 = t >= u; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'T' and 'U'. + var ra5 = t == u; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'T' and 'U'. + var ra6 = t != u; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'T' and 'U'. + var ra7 = t === u; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'T' and 'U'. + var ra8 = t !== u; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'T' and 'U'. + + var rb1 = u < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'U' and 'T'. + var rb2 = u > t; + ~~~~~ +!!! Operator '>' cannot be applied to types 'U' and 'T'. + var rb3 = u <= t; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'U' and 'T'. + var rb4 = u >= t; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'U' and 'T'. + var rb5 = u == t; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'U' and 'T'. + var rb6 = u != t; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'U' and 'T'. + var rb7 = u === t; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'U' and 'T'. + var rb8 = u !== t; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'U' and 'T'. + + var rc1 = t < v; + ~~~~~ +!!! Operator '<' cannot be applied to types 'T' and 'V'. + var rc2 = t > v; + ~~~~~ +!!! Operator '>' cannot be applied to types 'T' and 'V'. + var rc3 = t <= v; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'T' and 'V'. + var rc4 = t >= v; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'T' and 'V'. + var rc5 = t == v; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'T' and 'V'. + var rc6 = t != v; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'T' and 'V'. + var rc7 = t === v; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'T' and 'V'. + var rc8 = t !== v; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'T' and 'V'. + + var rd1 = v < t; + ~~~~~ +!!! Operator '<' cannot be applied to types 'V' and 'T'. + var rd2 = v > t; + ~~~~~ +!!! Operator '>' cannot be applied to types 'V' and 'T'. + var rd3 = v <= t; + ~~~~~~ +!!! Operator '<=' cannot be applied to types 'V' and 'T'. + var rd4 = v >= t; + ~~~~~~ +!!! Operator '>=' cannot be applied to types 'V' and 'T'. + var rd5 = v == t; + ~~~~~~ +!!! Operator '==' cannot be applied to types 'V' and 'T'. + var rd6 = v != t; + ~~~~~~ +!!! Operator '!=' cannot be applied to types 'V' and 'T'. + var rd7 = v === t; + ~~~~~~~ +!!! Operator '===' cannot be applied to types 'V' and 'T'. + var rd8 = v !== t; + ~~~~~~~ +!!! Operator '!==' cannot be applied to types 'V' and 'T'. + + // ok + var re1 = t < a; + var re2 = t > a; + var re3 = t <= a; + var re4 = t >= a; + var re5 = t == a; + var re6 = t != a; + var re7 = t === a; + var re8 = t !== a; + + var rf1 = a < t; + var rf2 = a > t; + var rf3 = a <= t; + var rf4 = a >= t; + var rf5 = a == t; + var rf6 = a != t; + var rf7 = a === t; + var rf8 = a !== t; + + var rg1 = t < b; + var rg2 = t > b; + var rg3 = t <= b; + var rg4 = t >= b; + var rg5 = t == b; + var rg6 = t != b; + var rg7 = t === b; + var rg8 = t !== b; + + var rh1 = b < t; + var rh2 = b > t; + var rh3 = b <= t; + var rh4 = b >= t; + var rh5 = b == t; + var rh6 = b != t; + var rh7 = b === t; + var rh8 = b !== t; + } \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js new file mode 100644 index 0000000000000..814fb5c6aa7dd --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js @@ -0,0 +1,149 @@ +//// [comparisonOperatorWithTypeParameter.ts] +var a: {}; +var b: Object; + +function foo(t: T, u: U, v: V) { + // errors + var ra1 = t < u; + var ra2 = t > u; + var ra3 = t <= u; + var ra4 = t >= u; + var ra5 = t == u; + var ra6 = t != u; + var ra7 = t === u; + var ra8 = t !== u; + + var rb1 = u < t; + var rb2 = u > t; + var rb3 = u <= t; + var rb4 = u >= t; + var rb5 = u == t; + var rb6 = u != t; + var rb7 = u === t; + var rb8 = u !== t; + + var rc1 = t < v; + var rc2 = t > v; + var rc3 = t <= v; + var rc4 = t >= v; + var rc5 = t == v; + var rc6 = t != v; + var rc7 = t === v; + var rc8 = t !== v; + + var rd1 = v < t; + var rd2 = v > t; + var rd3 = v <= t; + var rd4 = v >= t; + var rd5 = v == t; + var rd6 = v != t; + var rd7 = v === t; + var rd8 = v !== t; + + // ok + var re1 = t < a; + var re2 = t > a; + var re3 = t <= a; + var re4 = t >= a; + var re5 = t == a; + var re6 = t != a; + var re7 = t === a; + var re8 = t !== a; + + var rf1 = a < t; + var rf2 = a > t; + var rf3 = a <= t; + var rf4 = a >= t; + var rf5 = a == t; + var rf6 = a != t; + var rf7 = a === t; + var rf8 = a !== t; + + var rg1 = t < b; + var rg2 = t > b; + var rg3 = t <= b; + var rg4 = t >= b; + var rg5 = t == b; + var rg6 = t != b; + var rg7 = t === b; + var rg8 = t !== b; + + var rh1 = b < t; + var rh2 = b > t; + var rh3 = b <= t; + var rh4 = b >= t; + var rh5 = b == t; + var rh6 = b != t; + var rh7 = b === t; + var rh8 = b !== t; +} + +//// [comparisonOperatorWithTypeParameter.js] +var a; +var b; +function foo(t, u, v) { + var ra1 = t < u; + var ra2 = t > u; + var ra3 = t <= u; + var ra4 = t >= u; + var ra5 = t == u; + var ra6 = t != u; + var ra7 = t === u; + var ra8 = t !== u; + var rb1 = u < t; + var rb2 = u > t; + var rb3 = u <= t; + var rb4 = u >= t; + var rb5 = u == t; + var rb6 = u != t; + var rb7 = u === t; + var rb8 = u !== t; + var rc1 = t < v; + var rc2 = t > v; + var rc3 = t <= v; + var rc4 = t >= v; + var rc5 = t == v; + var rc6 = t != v; + var rc7 = t === v; + var rc8 = t !== v; + var rd1 = v < t; + var rd2 = v > t; + var rd3 = v <= t; + var rd4 = v >= t; + var rd5 = v == t; + var rd6 = v != t; + var rd7 = v === t; + var rd8 = v !== t; + var re1 = t < a; + var re2 = t > a; + var re3 = t <= a; + var re4 = t >= a; + var re5 = t == a; + var re6 = t != a; + var re7 = t === a; + var re8 = t !== a; + var rf1 = a < t; + var rf2 = a > t; + var rf3 = a <= t; + var rf4 = a >= t; + var rf5 = a == t; + var rf6 = a != t; + var rf7 = a === t; + var rf8 = a !== t; + var rg1 = t < b; + var rg2 = t > b; + var rg3 = t <= b; + var rg4 = t >= b; + var rg5 = t == b; + var rg6 = t != b; + var rg7 = t === b; + var rg8 = t !== b; + var rh1 = b < t; + var rh2 = b > t; + var rh3 = b <= t; + var rh4 = b >= t; + var rh5 = b == t; + var rh6 = b != t; + var rh7 = b === t; + var rh8 = b !== t; +} diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js new file mode 100644 index 0000000000000..d562905539e8f --- /dev/null +++ b/tests/baselines/reference/complexClassRelationships.js @@ -0,0 +1,134 @@ +//// [complexClassRelationships.ts] +// There should be no errors in this file +class Derived extends Base { + public static createEmpty(): Derived { + var item = new Derived(); + return item; + } +} +class BaseCollection { + constructor(f: () => T) { + (item: Thing) => { return [item.Components]; }; + } +} +class Base { + ownerCollection: BaseCollection; +} + +class Thing { + public get Components(): ComponentCollection { return null } +} + +class ComponentCollection { + private static sortComponents(p: Foo) { + return p.prop1; + } +} + +class Foo { + public get prop1() { + return new GenericType(this); + } + public populate() { + this.prop2; + } + public get prop2(): BaseCollection { + return new BaseCollection(Derived.createEmpty); + } +} + +class GenericType { + constructor(parent: FooBase) { } +} + +class FooBase { + public populate() { + + } +} + +//// [complexClassRelationships.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + Derived.createEmpty = function () { + var item = new Derived(); + return item; + }; + return Derived; +})(Base); +var BaseCollection = (function () { + function BaseCollection(f) { + (function (item) { + return [item.Components]; + }); + } + return BaseCollection; +})(); +var Base = (function () { + function Base() { + } + return Base; +})(); +var Thing = (function () { + function Thing() { + } + Object.defineProperty(Thing.prototype, "Components", { + get: function () { + return null; + }, + enumerable: true, + configurable: true + }); + return Thing; +})(); +var ComponentCollection = (function () { + function ComponentCollection() { + } + ComponentCollection.sortComponents = function (p) { + return p.prop1; + }; + return ComponentCollection; +})(); +var Foo = (function () { + function Foo() { + } + Object.defineProperty(Foo.prototype, "prop1", { + get: function () { + return new GenericType(this); + }, + enumerable: true, + configurable: true + }); + Foo.prototype.populate = function () { + this.prop2; + }; + Object.defineProperty(Foo.prototype, "prop2", { + get: function () { + return new BaseCollection(Derived.createEmpty); + }, + enumerable: true, + configurable: true + }); + return Foo; +})(); +var GenericType = (function () { + function GenericType(parent) { + } + return GenericType; +})(); +var FooBase = (function () { + function FooBase() { + } + FooBase.prototype.populate = function () { + }; + return FooBase; +})(); diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt new file mode 100644 index 0000000000000..615167a018bfc --- /dev/null +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ==== + class S18 extends S18 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + { + ~ + } + ~ +!!! Type 'S18' recursively references itself as a base type. + (new S18(123)).S18 = 0; + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js new file mode 100644 index 0000000000000..49171d4c87b51 --- /dev/null +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -0,0 +1,22 @@ +//// [complicatedGenericRecursiveBaseClassReference.ts] +class S18 extends S18 +{ +} +(new S18(123)).S18 = 0; + + +//// [complicatedGenericRecursiveBaseClassReference.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var S18 = (function (_super) { + __extends(S18, _super); + function S18() { + _super.apply(this, arguments); + } + return S18; +})(S18); +(new S18(123)).S18 = 0; diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt new file mode 100644 index 0000000000000..443fefd9487db --- /dev/null +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -0,0 +1,113 @@ +==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ==== + module m1 { + export module m2 { + + + export function f1(c1: C1) { + } + export function f2(c2: C2) { + } + + export class C2 implements m3.i3 { + public get p1(arg) { + ~~ +!!! A 'get' accessor cannot have parameters. + return new C1(); + } + + public set p1(arg1: C1) { + } + + public f55() { + return "Hello world"; + } + } + } + + export function f2(arg1: { x?: C1, y: number }) { + ~ +!!! ';' expected. + } + + export function f3(): { + (a: number) : C1; + } { + return null; + } + + export function f4(arg1: + { + [number]: C1; + ~~~~~~ +!!! An index signature parameter must have a type annotation. + }) { + } + + + export function f5(arg2: { + new (arg1: C1) : C1 + }) { + } + module m3 { + function f2(f1: C1) { + } + + export interface i3 { + f55(): string; + } + } + + class C1 { + } + + interface i { + x: number; + } + + export class C5 implements i { + public x: number; + } + + export var v2: C1[]; + } + + class C2 { + } + + module m2 { + export module m3 { + + export class c_pr implements mglo5.i5, mglo5.i6 { + ~~~~~~~~ +!!! Module 'mglo5' has no exported member 'i6'. + f1() { + return "Hello"; + } + } + + module m4 { + class C { + } + module m5 { + + export module m6 { + function f1() { + return new C(); + } + } + } + } + + } + } + + module mglo5 { + export interface i5 { + f1(): string; + } + + interface i6 { + f6(): number; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/compositeGenericFunction.js b/tests/baselines/reference/compositeGenericFunction.js new file mode 100644 index 0000000000000..0fe2e7d6f410e --- /dev/null +++ b/tests/baselines/reference/compositeGenericFunction.js @@ -0,0 +1,18 @@ +//// [compositeGenericFunction.ts] +function f(value: T) { return value; }; + +function h(func: (x: number) => R): R { return null; } + +var z: number = h(f); +var z: number = h(f); + +//// [compositeGenericFunction.js] +function f(value) { + return value; +} +; +function h(func) { + return null; +} +var z = h(f); +var z = h(f); diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js new file mode 100644 index 0000000000000..aebacb8882780 --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js @@ -0,0 +1,99 @@ +//// [compoundAdditionAssignmentLHSCanBeAssigned.ts] +enum E { a, b } + +var a: any; +var b: void; + +var x1: any; +x1 += a; +x1 += b; +x1 += true; +x1 += 0; +x1 += ''; +x1 += E.a; +x1 += {}; +x1 += null; +x1 += undefined; + +var x2: string; +x2 += a; +x2 += b; +x2 += true; +x2 += 0; +x2 += ''; +x2 += E.a; +x2 += {}; +x2 += null; +x2 += undefined; + +var x3: number; +x3 += a; +x3 += 0; +x3 += E.a; +x3 += null; +x3 += undefined; + +var x4: E; +x4 += a; +x4 += 0; +x4 += E.a; +x4 += null; +x4 += undefined; + +var x5: boolean; +x5 += a; + +var x6: {}; +x6 += a; +x6 += ''; + +var x7: void; +x7 += a; + +//// [compoundAdditionAssignmentLHSCanBeAssigned.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var x1; +x1 += a; +x1 += b; +x1 += true; +x1 += 0; +x1 += ''; +x1 += 0 /* a */; +x1 += {}; +x1 += null; +x1 += undefined; +var x2; +x2 += a; +x2 += b; +x2 += true; +x2 += 0; +x2 += ''; +x2 += 0 /* a */; +x2 += {}; +x2 += null; +x2 += undefined; +var x3; +x3 += a; +x3 += 0; +x3 += 0 /* a */; +x3 += null; +x3 += undefined; +var x4; +x4 += a; +x4 += 0; +x4 += 0 /* a */; +x4 += null; +x4 += undefined; +var x5; +x5 += a; +var x6; +x6 += a; +x6 += ''; +var x7; +x7 += a; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt new file mode 100644 index 0000000000000..6313e08471c37 --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts (5 errors) ==== + // string can add every type, and result string cannot be assigned to below types + enum E { a, b, c } + + var x1: boolean; + x1 += ''; + ~~ +!!! Type 'string' is not assignable to type 'boolean'. + + var x2: number; + x2 += ''; + ~~ +!!! Type 'string' is not assignable to type 'number'. + + var x3: E; + x3 += ''; + ~~ +!!! Type 'string' is not assignable to type 'E'. + + var x4: {a: string}; + x4 += ''; + ~~ +!!! Type 'string' is not assignable to type '{ a: string; }': +!!! Property 'a' is missing in type 'String'. + + var x5: void; + x5 += ''; + ~~ +!!! Type 'string' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js new file mode 100644 index 0000000000000..bb255b3809ea8 --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js @@ -0,0 +1,36 @@ +//// [compoundAdditionAssignmentLHSCannotBeAssigned.ts] +// string can add every type, and result string cannot be assigned to below types +enum E { a, b, c } + +var x1: boolean; +x1 += ''; + +var x2: number; +x2 += ''; + +var x3: E; +x3 += ''; + +var x4: {a: string}; +x4 += ''; + +var x5: void; +x5 += ''; + +//// [compoundAdditionAssignmentLHSCannotBeAssigned.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var x1; +x1 += ''; +var x2; +x2 += ''; +var x3; +x3 += ''; +var x4; +x4 += ''; +var x5; +x5 += ''; diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..d7a4cca8e992b --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -0,0 +1,95 @@ +==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts (27 errors) ==== + enum E { a, b } + + var a: void; + + var x1: boolean; + x1 += a; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'void'. + x1 += true; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. + x1 += 0; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'number'. + x1 += E.a; + ~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'E'. + x1 += {}; + ~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and '{}'. + x1 += null; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. + x1 += undefined; + ~~~~~~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'. + + var x2: {}; + x2 += a; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and 'void'. + x2 += true; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and 'boolean'. + x2 += 0; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and 'number'. + x2 += E.a; + ~~~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and 'E'. + x2 += {}; + ~~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and '{}'. + x2 += null; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and '{}'. + x2 += undefined; + ~~~~~~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types '{}' and '{}'. + + var x3: void; + x3 += a; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'void'. + x3 += true; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'boolean'. + x3 += 0; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'number'. + x3 += E.a; + ~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'E'. + x3 += {}; + ~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and '{}'. + x3 += null; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'void'. + x3 += undefined; + ~~~~~~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'void' and 'void'. + + var x4: number; + x4 += a; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'number' and 'void'. + x4 += true; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'number' and 'boolean'. + x4 += {}; + ~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'number' and '{}'. + + var x5: E; + x5 += a; + ~~~~~~~ +!!! Operator '+=' cannot be applied to types 'E' and 'void'. + x5 += true; + ~~~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'E' and 'boolean'. + x5 += {}; + ~~~~~~~~ +!!! Operator '+=' cannot be applied to types 'E' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js new file mode 100644 index 0000000000000..af4f1bc152193 --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js @@ -0,0 +1,81 @@ +//// [compoundAdditionAssignmentWithInvalidOperands.ts] +enum E { a, b } + +var a: void; + +var x1: boolean; +x1 += a; +x1 += true; +x1 += 0; +x1 += E.a; +x1 += {}; +x1 += null; +x1 += undefined; + +var x2: {}; +x2 += a; +x2 += true; +x2 += 0; +x2 += E.a; +x2 += {}; +x2 += null; +x2 += undefined; + +var x3: void; +x3 += a; +x3 += true; +x3 += 0; +x3 += E.a; +x3 += {}; +x3 += null; +x3 += undefined; + +var x4: number; +x4 += a; +x4 += true; +x4 += {}; + +var x5: E; +x5 += a; +x5 += true; +x5 += {}; + +//// [compoundAdditionAssignmentWithInvalidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var x1; +x1 += a; +x1 += true; +x1 += 0; +x1 += 0 /* a */; +x1 += {}; +x1 += null; +x1 += undefined; +var x2; +x2 += a; +x2 += true; +x2 += 0; +x2 += 0 /* a */; +x2 += {}; +x2 += null; +x2 += undefined; +var x3; +x3 += a; +x3 += true; +x3 += 0; +x3 += 0 /* a */; +x3 += {}; +x3 += null; +x3 += undefined; +var x4; +x4 += a; +x4 += true; +x4 += {}; +var x5; +x5 += a; +x5 += true; +x5 += {}; diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js new file mode 100644 index 0000000000000..baeaa1538db94 --- /dev/null +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js @@ -0,0 +1,56 @@ +//// [compoundArithmeticAssignmentLHSCanBeAssigned.ts] +enum E { a, b, c } + +var a: any; +var b: number; +var c: E; + +var x1: any; +x1 *= a; +x1 *= b; +x1 *= c; +x1 *= null; +x1 *= undefined; + +var x2: number; +x2 *= a; +x2 *= b; +x2 *= c; +x2 *= null; +x2 *= undefined; + +var x3: E; +x3 *= a; +x3 *= b; +x3 *= c; +x3 *= null; +x3 *= undefined; + +//// [compoundArithmeticAssignmentLHSCanBeAssigned.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a; +var b; +var c; +var x1; +x1 *= a; +x1 *= b; +x1 *= c; +x1 *= null; +x1 *= undefined; +var x2; +x2 *= a; +x2 *= b; +x2 *= c; +x2 *= null; +x2 *= undefined; +var x3; +x3 *= a; +x3 *= b; +x3 *= c; +x3 *= null; +x3 *= undefined; diff --git a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..d0045d92aa0c6 --- /dev/null +++ b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.errors.txt @@ -0,0 +1,197 @@ +==== tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentWithInvalidOperands.ts (68 errors) ==== + enum E { a, b } + + var a: any; + var b: void; + + var x1: boolean; + x1 *= a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= b; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= true; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= 0; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= '' + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= E.a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= {}; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x1 *= undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x2: string; + x2 *= a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= b; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= true; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= 0; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= '' + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= E.a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= {}; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x2 *= undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x3: {}; + x3 *= a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= b; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= true; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= 0; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= '' + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= E.a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= {}; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x3 *= undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x4: void; + x4 *= a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= b; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= true; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= 0; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= '' + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= E.a; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= {}; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= null; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x4 *= undefined; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x5: number; + x5 *= b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 *= true; + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 *= '' + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x5 *= {}; + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var x6: E; + x6 *= b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 *= true; + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 *= '' + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + x6 *= {}; + ~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js new file mode 100644 index 0000000000000..61722df0fb043 --- /dev/null +++ b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js @@ -0,0 +1,120 @@ +//// [compoundArithmeticAssignmentWithInvalidOperands.ts] +enum E { a, b } + +var a: any; +var b: void; + +var x1: boolean; +x1 *= a; +x1 *= b; +x1 *= true; +x1 *= 0; +x1 *= '' +x1 *= E.a; +x1 *= {}; +x1 *= null; +x1 *= undefined; + +var x2: string; +x2 *= a; +x2 *= b; +x2 *= true; +x2 *= 0; +x2 *= '' +x2 *= E.a; +x2 *= {}; +x2 *= null; +x2 *= undefined; + +var x3: {}; +x3 *= a; +x3 *= b; +x3 *= true; +x3 *= 0; +x3 *= '' +x3 *= E.a; +x3 *= {}; +x3 *= null; +x3 *= undefined; + +var x4: void; +x4 *= a; +x4 *= b; +x4 *= true; +x4 *= 0; +x4 *= '' +x4 *= E.a; +x4 *= {}; +x4 *= null; +x4 *= undefined; + +var x5: number; +x5 *= b; +x5 *= true; +x5 *= '' +x5 *= {}; + +var x6: E; +x6 *= b; +x6 *= true; +x6 *= '' +x6 *= {}; + +//// [compoundArithmeticAssignmentWithInvalidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +var a; +var b; +var x1; +x1 *= a; +x1 *= b; +x1 *= true; +x1 *= 0; +x1 *= ''; +x1 *= 0 /* a */; +x1 *= {}; +x1 *= null; +x1 *= undefined; +var x2; +x2 *= a; +x2 *= b; +x2 *= true; +x2 *= 0; +x2 *= ''; +x2 *= 0 /* a */; +x2 *= {}; +x2 *= null; +x2 *= undefined; +var x3; +x3 *= a; +x3 *= b; +x3 *= true; +x3 *= 0; +x3 *= ''; +x3 *= 0 /* a */; +x3 *= {}; +x3 *= null; +x3 *= undefined; +var x4; +x4 *= a; +x4 *= b; +x4 *= true; +x4 *= 0; +x4 *= ''; +x4 *= 0 /* a */; +x4 *= {}; +x4 *= null; +x4 *= undefined; +var x5; +x5 *= b; +x5 *= true; +x5 *= ''; +x5 *= {}; +var x6; +x6 *= b; +x6 *= true; +x6 *= ''; +x6 *= {}; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.js b/tests/baselines/reference/compoundAssignmentLHSIsReference.js new file mode 100644 index 0000000000000..ebc3d7be11864 --- /dev/null +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.js @@ -0,0 +1,60 @@ +//// [compoundAssignmentLHSIsReference.ts] +var value; + +// identifiers: variable and parameter +var x1: number; +x1 *= value; +x1 += value; + +function fn1(x2: number) { + x2 *= value; + x2 += value; +} + +// property accesses +var x3: { a: number }; +x3.a *= value; +x3.a += value; + +x3['a'] *= value; +x3['a'] += value; + +// parentheses, the contained expression is reference +(x1) *= value; +(x1) += value; + +function fn2(x4: number) { + (x4) *= value; + (x4) += value; +} + +(x3.a) *= value; +(x3.a) += value; + +(x3['a']) *= value; +(x3['a']) += value; + +//// [compoundAssignmentLHSIsReference.js] +var value; +var x1; +x1 *= value; +x1 += value; +function fn1(x2) { + x2 *= value; + x2 += value; +} +var x3; +x3.a *= value; +x3.a += value; +x3['a'] *= value; +x3['a'] += value; +(x1) *= value; +(x1) += value; +function fn2(x4) { + (x4) *= value; + (x4) += value; +} +(x3.a) *= value; +(x3.a) += value; +(x3['a']) *= value; +(x3['a']) += value; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt new file mode 100644 index 0000000000000..a2c2eb188bcfa --- /dev/null +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -0,0 +1,283 @@ +==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (80 errors) ==== + // expected error for all the LHS of compound assignments (arithmetic and addition) + var value; + + // this + class C { + constructor() { + this *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + this += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + } + foo() { + this *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + this += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + } + static sfoo() { + this *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + this += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + } + } + + function foo() { + this *= value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + this += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + } + + this *= value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + this += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + + // identifiers: module, class, enum, function + module M { export var a; } + M *= value; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + M += value; + ~ +!!! Invalid left-hand side of assignment expression. + + C *= value; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + C += value; + ~ +!!! Invalid left-hand side of assignment expression. + + enum E { } + E *= value; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + E += value; + ~ +!!! Invalid left-hand side of assignment expression. + + foo *= value; + ~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + foo += value; + ~~~ +!!! Invalid left-hand side of assignment expression. + + // literals + null *= value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + null += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + true *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + true += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + false *= value; + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + false += value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + 0 *= value; + ~ +!!! Invalid left-hand side of assignment expression. + 0 += value; + ~ +!!! Invalid left-hand side of assignment expression. + '' *= value; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + '' += value; + ~~ +!!! Invalid left-hand side of assignment expression. + /d+/ *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + /d+/ += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + + // object literals + { a: 0} *= value; + ~~ +!!! Declaration or statement expected. + { a: 0} += value; + ~~ +!!! Declaration or statement expected. + + // array literals + ['', ''] *= value; + ~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ['', ''] += value; + ~~~~~~~~ +!!! Invalid left-hand side of assignment expression. + + // super + class Derived extends C { + constructor() { + super(); + super *= value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + super += value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + } + + foo() { + super *= value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + super += value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + } + + static sfoo() { + super *= value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + super += value; + ~~ +!!! 'super' must be followed by argument list or member access. + ~~~~~ +!!! Invalid left-hand side of assignment expression. + } + } + + // function expression + function bar1() { } *= value; + ~~ +!!! Declaration or statement expected. + function bar2() { } += value; + ~~ +!!! Declaration or statement expected. + () => { } *= value; + ~~ +!!! ';' expected. + () => { } += value; + ~~ +!!! ';' expected. + + // function calls + foo() *= value; + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + foo() += value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + + // parentheses, the containted expression is value + (this) *= value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (this) += value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (M) *= value; + ~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (M) += value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (C) *= value; + ~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (C) += value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (E) *= value; + ~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (E) += value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (foo) *= value; + ~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (foo) += value; + ~~~~~ +!!! Invalid left-hand side of assignment expression. + (null) *= value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (null) += value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (true) *= value; + ~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (true) += value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + (0) *= value; + ~~~ +!!! Invalid left-hand side of assignment expression. + (0) += value; + ~~~ +!!! Invalid left-hand side of assignment expression. + ('') *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ('') += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + (/d+/) *= value; + ~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (/d+/) += value; + ~~~~~~ +!!! Invalid left-hand side of assignment expression. + ({}) *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ({}) += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + ([]) *= value; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ([]) += value; + ~~~~ +!!! Invalid left-hand side of assignment expression. + (function baz1() { }) *= value; + ~~~~~~~~~~~~~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (function baz2() { }) += value; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Invalid left-hand side of assignment expression. + (foo()) *= value; + ~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + (foo()) += value; + ~~~~~~~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/compoundVarDecl1.js b/tests/baselines/reference/compoundVarDecl1.js new file mode 100644 index 0000000000000..99450b8b2851c --- /dev/null +++ b/tests/baselines/reference/compoundVarDecl1.js @@ -0,0 +1,12 @@ +//// [compoundVarDecl1.ts] +module Foo { var a = 1, b = 1; a = b + 2; } + +var foo = 4, bar = 5; + +//// [compoundVarDecl1.js] +var Foo; +(function (Foo) { + var a = 1, b = 1; + a = b + 2; +})(Foo || (Foo = {})); +var foo = 4, bar = 5; diff --git a/tests/baselines/reference/concatClassAndString.errors.txt b/tests/baselines/reference/concatClassAndString.errors.txt new file mode 100644 index 0000000000000..e97ff01d75433 --- /dev/null +++ b/tests/baselines/reference/concatClassAndString.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/concatClassAndString.ts (1 errors) ==== + // Shouldn't compile (the long form f = f + ""; doesn't): + class f { } + + f += ''; + ~ +!!! Invalid left-hand side of assignment expression. + \ No newline at end of file diff --git a/tests/baselines/reference/concatClassAndString.js b/tests/baselines/reference/concatClassAndString.js new file mode 100644 index 0000000000000..0d063a0e83447 --- /dev/null +++ b/tests/baselines/reference/concatClassAndString.js @@ -0,0 +1,14 @@ +//// [concatClassAndString.ts] +// Shouldn't compile (the long form f = f + ""; doesn't): +class f { } + +f += ''; + + +//// [concatClassAndString.js] +var f = (function () { + function f() { + } + return f; +})(); +f += ''; diff --git a/tests/baselines/reference/concatError.js b/tests/baselines/reference/concatError.js new file mode 100644 index 0000000000000..3a7613484c58c --- /dev/null +++ b/tests/baselines/reference/concatError.js @@ -0,0 +1,39 @@ +//// [concatError.ts] + +var n1: number[]; +/* +interface Array { + concat(...items: T[][]): T[]; // Note: This overload needs to be picked for arrays of arrays, even though both are applicable + concat(...items: T[]): T[]; +} +*/ +var fa: number[]; + +fa = fa.concat([0]); +fa = fa.concat(0); + + + + + +/* + + + + +declare class C { + public m(p1: C>): C; + //public p: T; +} + +var c: C; +var cc: C>; + +c = c.m(cc); +*/ + +//// [concatError.js] +var n1; +var fa; +fa = fa.concat([0]); +fa = fa.concat(0); diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt new file mode 100644 index 0000000000000..ee54b20f71006 --- /dev/null +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/conditionalExpression1.ts (2 errors) ==== + var x: boolean = (true ? 1 : ""); // should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'boolean'. + ~~~~~~~~~~~~~ +!!! No best common type exists between 'number' and 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpression1.js b/tests/baselines/reference/conditionalExpression1.js new file mode 100644 index 0000000000000..920109085532e --- /dev/null +++ b/tests/baselines/reference/conditionalExpression1.js @@ -0,0 +1,5 @@ +//// [conditionalExpression1.ts] +var x: boolean = (true ? 1 : ""); // should be an error + +//// [conditionalExpression1.js] +var x = (true ? 1 : ""); diff --git a/tests/baselines/reference/conditionalExpressions2.js b/tests/baselines/reference/conditionalExpressions2.js new file mode 100644 index 0000000000000..b8870b564ecc5 --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.js @@ -0,0 +1,28 @@ +//// [conditionalExpressions2.ts] +var a = false ? 1 : null; +var b = false ? undefined : 0; +var c = false ? 1 : 0; +var d = false ? false : true; +var e = false ? "foo" : "bar"; +var f = false ? null : undefined; +var g = true ? {g:5} : null; +var h = [{h:5}, null]; +function i() { if (true) { return { x: 5 }; } else { return null; } } + +//// [conditionalExpressions2.js] +var a = false ? 1 : null; +var b = false ? undefined : 0; +var c = false ? 1 : 0; +var d = false ? false : true; +var e = false ? "foo" : "bar"; +var f = false ? null : undefined; +var g = true ? { g: 5 } : null; +var h = [{ h: 5 }, null]; +function i() { + if (true) { + return { x: 5 }; + } + else { + return null; + } +} diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js new file mode 100644 index 0000000000000..2f2791009549e --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js @@ -0,0 +1,99 @@ +//// [conditionalOperatorConditionIsBooleanType.ts] +//Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type +var condBoolean: boolean; + +var exprAny1: any; +var exprBoolean1: boolean; +var exprNumber1: number; +var exprString1: string; +var exprIsObject1: Object; + +var exprAny2: any; +var exprBoolean2: boolean; +var exprNumber2: number; +var exprString2: string; +var exprIsObject2: Object; + +//Cond is a boolean type variable +condBoolean ? exprAny1 : exprAny2; +condBoolean ? exprBoolean1 : exprBoolean2; +condBoolean ? exprNumber1 : exprNumber2; +condBoolean ? exprString1 : exprString2; +condBoolean ? exprIsObject1 : exprIsObject2; + +//Cond is a boolean type literal +true ? exprAny1 : exprAny2; +false ? exprBoolean1 : exprBoolean2; +true ? exprNumber1 : exprNumber2; +false ? exprString1 : exprString2; +true ? exprIsObject1 : exprIsObject2; + +//Cond is a boolean type expression +!true ? exprAny1 : exprAny2; +typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +2 > 1 ? exprNumber1 : exprNumber2; +null === undefined ? exprString1 : exprString2; +true || false ? exprIsObject1 : exprIsObject2; + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; +var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; +var resultIsString1 = condBoolean ? exprString1 : exprString2; +var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; + +var resultIsAny2 = true ? exprAny1 : exprAny2; +var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = true ? exprNumber1 : exprNumber2; +var resultIsString2 = false ? exprString1 : exprString2; +var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; + +var resultIsAny3 = !true ? exprAny1 : exprAny2; +var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; +var resultIsString3 = null === undefined ? exprString1 : exprString2; +var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; + + +//// [conditionalOperatorConditionIsBooleanType.js] +var condBoolean; +var exprAny1; +var exprBoolean1; +var exprNumber1; +var exprString1; +var exprIsObject1; +var exprAny2; +var exprBoolean2; +var exprNumber2; +var exprString2; +var exprIsObject2; +condBoolean ? exprAny1 : exprAny2; +condBoolean ? exprBoolean1 : exprBoolean2; +condBoolean ? exprNumber1 : exprNumber2; +condBoolean ? exprString1 : exprString2; +condBoolean ? exprIsObject1 : exprIsObject2; +true ? exprAny1 : exprAny2; +false ? exprBoolean1 : exprBoolean2; +true ? exprNumber1 : exprNumber2; +false ? exprString1 : exprString2; +true ? exprIsObject1 : exprIsObject2; +!true ? exprAny1 : exprAny2; +typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +2 > 1 ? exprNumber1 : exprNumber2; +null === undefined ? exprString1 : exprString2; +true || false ? exprIsObject1 : exprIsObject2; +var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; +var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; +var resultIsString1 = condBoolean ? exprString1 : exprString2; +var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; +var resultIsAny2 = true ? exprAny1 : exprAny2; +var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = true ? exprNumber1 : exprNumber2; +var resultIsString2 = false ? exprString1 : exprString2; +var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; +var resultIsAny3 = !true ? exprAny1 : exprAny2; +var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; +var resultIsString3 = null === undefined ? exprString1 : exprString2; +var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js new file mode 100644 index 0000000000000..37ee498784b4f --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js @@ -0,0 +1,107 @@ +//// [conditionalOperatorConditionIsNumberType.ts] +//Cond ? Expr1 : Expr2, Cond is of number type, Expr1 and Expr2 have the same type +var condNumber: number; + +var exprAny1: any; +var exprBoolean1: boolean; +var exprNumber1: number; +var exprString1: string; +var exprIsObject1: Object; + +var exprAny2: any; +var exprBoolean2: boolean; +var exprNumber2: number; +var exprString2: string; +var exprIsObject2: Object; + +//Cond is a number type variable +condNumber ? exprAny1 : exprAny2; +condNumber ? exprBoolean1 : exprBoolean2; +condNumber ? exprNumber1 : exprNumber2; +condNumber ? exprString1 : exprString2; +condNumber ? exprIsObject1 : exprIsObject2; + +//Cond is a number type literal +1 ? exprAny1 : exprAny2; +0 ? exprBoolean1 : exprBoolean2; +0.123456789 ? exprNumber1 : exprNumber2; +- 10000000000000 ? exprString1 : exprString2; +1000000000000 ? exprIsObject1 : exprIsObject2; + +//Cond is a number type expression +function foo() { return 1 }; +var array = [1, 2, 3]; + +1 * 0 ? exprAny1 : exprAny2; +1 + 1 ? exprBoolean1 : exprBoolean2; +"string".length ? exprNumber1 : exprNumber2; +foo() ? exprString1 : exprString2; +foo() / array[1] ? exprIsObject1 : exprIsObject2; + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condNumber ? exprAny1 : exprAny2; +var resultIsBoolean1 = condNumber ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condNumber ? exprNumber1 : exprNumber2; +var resultIsString1 = condNumber ? exprString1 : exprString2; +var resultIsObject1 = condNumber ? exprIsObject1 : exprIsObject2; + +var resultIsAny2 = 1 ? exprAny1 : exprAny2; +var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; +var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; +var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; + +var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; +var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; +var resultIsString3 = foo() ? exprString1 : exprString2; +var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; + + +//// [conditionalOperatorConditionIsNumberType.js] +var condNumber; +var exprAny1; +var exprBoolean1; +var exprNumber1; +var exprString1; +var exprIsObject1; +var exprAny2; +var exprBoolean2; +var exprNumber2; +var exprString2; +var exprIsObject2; +condNumber ? exprAny1 : exprAny2; +condNumber ? exprBoolean1 : exprBoolean2; +condNumber ? exprNumber1 : exprNumber2; +condNumber ? exprString1 : exprString2; +condNumber ? exprIsObject1 : exprIsObject2; +1 ? exprAny1 : exprAny2; +0 ? exprBoolean1 : exprBoolean2; +0.123456789 ? exprNumber1 : exprNumber2; +-10000000000000 ? exprString1 : exprString2; +1000000000000 ? exprIsObject1 : exprIsObject2; +function foo() { + return 1; +} +; +var array = [1, 2, 3]; +1 * 0 ? exprAny1 : exprAny2; +1 + 1 ? exprBoolean1 : exprBoolean2; +"string".length ? exprNumber1 : exprNumber2; +foo() ? exprString1 : exprString2; +foo() / array[1] ? exprIsObject1 : exprIsObject2; +var resultIsAny1 = condNumber ? exprAny1 : exprAny2; +var resultIsBoolean1 = condNumber ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condNumber ? exprNumber1 : exprNumber2; +var resultIsString1 = condNumber ? exprString1 : exprString2; +var resultIsObject1 = condNumber ? exprIsObject1 : exprIsObject2; +var resultIsAny2 = 1 ? exprAny1 : exprAny2; +var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; +var resultIsString2 = -10000000000000 ? exprString1 : exprString2; +var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; +var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; +var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; +var resultIsString3 = foo() ? exprString1 : exprString2; +var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js new file mode 100644 index 0000000000000..f10533a23327a --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js @@ -0,0 +1,111 @@ +//// [conditionalOperatorConditionIsObjectType.ts] +//Cond ? Expr1 : Expr2, Cond is of object type, Expr1 and Expr2 have the same type +var condObject: Object; + +var exprAny1: any; +var exprBoolean1: boolean; +var exprNumber1: number; +var exprString1: string; +var exprIsObject1: Object; + +var exprAny2: any; +var exprBoolean2: boolean; +var exprNumber2: number; +var exprString2: string; +var exprIsObject2: Object; + +function foo() { }; +class C { static doIt: () => void }; + +//Cond is an object type variable +condObject ? exprAny1 : exprAny2; +condObject ? exprBoolean1 : exprBoolean2; +condObject ? exprNumber1 : exprNumber2; +condObject ? exprString1 : exprString2; +condObject ? exprIsObject1 : exprIsObject2; + +//Cond is an object type literal +((a: string) => a.length) ? exprAny1 : exprAny2; +((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +({}) ? exprNumber1 : exprNumber2; +({ a: 1, b: "s" }) ? exprString1 : exprString2; +({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; + +//Cond is an object type expression +foo() ? exprAny1 : exprAny2; +new Date() ? exprBoolean1 : exprBoolean2; +new C() ? exprNumber1 : exprNumber2; +C.doIt() ? exprString1 : exprString2; +condObject.valueOf() ? exprIsObject1 : exprIsObject2; + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condObject ? exprAny1 : exprAny2; +var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; +var resultIsString1 = condObject ? exprString1 : exprString2; +var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; + +var resultIsAny2 = ((a: string) => a.length) ? exprAny1 : exprAny2; +var resultIsBoolean2 = ((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; +var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; +var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; + +var resultIsAny3 = foo() ? exprAny1 : exprAny2; +var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; +var resultIsString3 = C.doIt() ? exprString1 : exprString2; +var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; + + +//// [conditionalOperatorConditionIsObjectType.js] +var condObject; +var exprAny1; +var exprBoolean1; +var exprNumber1; +var exprString1; +var exprIsObject1; +var exprAny2; +var exprBoolean2; +var exprNumber2; +var exprString2; +var exprIsObject2; +function foo() { +} +; +var C = (function () { + function C() { + } + return C; +})(); +; +condObject ? exprAny1 : exprAny2; +condObject ? exprBoolean1 : exprBoolean2; +condObject ? exprNumber1 : exprNumber2; +condObject ? exprString1 : exprString2; +condObject ? exprIsObject1 : exprIsObject2; +(function (a) { return a.length; }) ? exprAny1 : exprAny2; +(function (a) { return a.length; }) ? exprBoolean1 : exprBoolean2; +({}) ? exprNumber1 : exprNumber2; +({ a: 1, b: "s" }) ? exprString1 : exprString2; +({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +foo() ? exprAny1 : exprAny2; +new Date() ? exprBoolean1 : exprBoolean2; +new C() ? exprNumber1 : exprNumber2; +C.doIt() ? exprString1 : exprString2; +condObject.valueOf() ? exprIsObject1 : exprIsObject2; +var resultIsAny1 = condObject ? exprAny1 : exprAny2; +var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; +var resultIsString1 = condObject ? exprString1 : exprString2; +var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; +var resultIsAny2 = (function (a) { return a.length; }) ? exprAny1 : exprAny2; +var resultIsBoolean2 = (function (a) { return a.length; }) ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; +var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; +var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +var resultIsAny3 = foo() ? exprAny1 : exprAny2; +var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; +var resultIsString3 = C.doIt() ? exprString1 : exprString2; +var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js new file mode 100644 index 0000000000000..92de4bd4d5385 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js @@ -0,0 +1,101 @@ +//// [conditionalOperatorConditoinIsAnyType.ts] +//Cond ? Expr1 : Expr2, Cond is of any type, Expr1 and Expr2 have the same type +var condAny: any; +var x: any; + +var exprAny1: any; +var exprBoolean1: boolean; +var exprNumber1: number; +var exprString1: string; +var exprIsObject1: Object; + +var exprAny2: any; +var exprBoolean2: boolean; +var exprNumber2: number; +var exprString2: string; +var exprIsObject2: Object; + +//Cond is an any type variable +condAny ? exprAny1 : exprAny2; +condAny ? exprBoolean1 : exprBoolean2; +condAny ? exprNumber1 : exprNumber2; +condAny ? exprString1 : exprString2; +condAny ? exprIsObject1 : exprIsObject2; + +//Cond is an any type literal +null ? exprAny1 : exprAny2; +null ? exprBoolean1 : exprBoolean2; +undefined ? exprNumber1 : exprNumber2; +[null, undefined] ? exprString1 : exprString2; +[null, undefined] ? exprIsObject1 : exprIsObject2; + +//Cond is an any type expression +x.doSomeThing() ? exprAny1 : exprAny2; +x("x") ? exprBoolean1 : exprBoolean2; +x(x) ? exprNumber1 : exprNumber2; +x("x") ? exprString1 : exprString2; +x.doSomeThing() ? exprIsObject1 : exprIsObject2; + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condAny ? exprAny1 : exprAny2; +var resultIsBoolean1 = condAny ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condAny ? exprNumber1 : exprNumber2; +var resultIsString1 = condAny ? exprString1 : exprString2; +var resultIsObject1 = condAny ? exprIsObject1 : exprIsObject2; + +var resultIsAny2 = null ? exprAny1 : exprAny2; +var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = undefined ? exprNumber1 : exprNumber2; +var resultIsString2 = [null, undefined] ? exprString1 : exprString2; +var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; + +var resultIsAny3 = x.doSomeThing() ? exprAny1 : exprAny2; +var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = x(x) ? exprNumber1 : exprNumber2; +var resultIsString3 = x("x") ? exprString1 : exprString2; +var resultIsObject3 = x.doSomeThing() ? exprIsObject1 : exprIsObject2; + + +//// [conditionalOperatorConditoinIsAnyType.js] +var condAny; +var x; +var exprAny1; +var exprBoolean1; +var exprNumber1; +var exprString1; +var exprIsObject1; +var exprAny2; +var exprBoolean2; +var exprNumber2; +var exprString2; +var exprIsObject2; +condAny ? exprAny1 : exprAny2; +condAny ? exprBoolean1 : exprBoolean2; +condAny ? exprNumber1 : exprNumber2; +condAny ? exprString1 : exprString2; +condAny ? exprIsObject1 : exprIsObject2; +null ? exprAny1 : exprAny2; +null ? exprBoolean1 : exprBoolean2; +undefined ? exprNumber1 : exprNumber2; +[null, undefined] ? exprString1 : exprString2; +[null, undefined] ? exprIsObject1 : exprIsObject2; +x.doSomeThing() ? exprAny1 : exprAny2; +x("x") ? exprBoolean1 : exprBoolean2; +x(x) ? exprNumber1 : exprNumber2; +x("x") ? exprString1 : exprString2; +x.doSomeThing() ? exprIsObject1 : exprIsObject2; +var resultIsAny1 = condAny ? exprAny1 : exprAny2; +var resultIsBoolean1 = condAny ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condAny ? exprNumber1 : exprNumber2; +var resultIsString1 = condAny ? exprString1 : exprString2; +var resultIsObject1 = condAny ? exprIsObject1 : exprIsObject2; +var resultIsAny2 = null ? exprAny1 : exprAny2; +var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = undefined ? exprNumber1 : exprNumber2; +var resultIsString2 = [null, undefined] ? exprString1 : exprString2; +var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; +var resultIsAny3 = x.doSomeThing() ? exprAny1 : exprAny2; +var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = x(x) ? exprNumber1 : exprNumber2; +var resultIsString3 = x("x") ? exprString1 : exprString2; +var resultIsObject3 = x.doSomeThing() ? exprIsObject1 : exprIsObject2; diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js new file mode 100644 index 0000000000000..048787d6061d0 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js @@ -0,0 +1,107 @@ +//// [conditionalOperatorConditoinIsStringType.ts] +//Cond ? Expr1 : Expr2, Cond is of string type, Expr1 and Expr2 have the same type +var condString: string; + +var exprAny1: any; +var exprBoolean1: boolean; +var exprNumber1: number; +var exprString1: string; +var exprIsObject1: Object; + +var exprAny2: any; +var exprBoolean2: boolean; +var exprNumber2: number; +var exprString2: string; +var exprIsObject2: Object; + +//Cond is a string type variable +condString ? exprAny1 : exprAny2; +condString ? exprBoolean1 : exprBoolean2; +condString ? exprNumber1 : exprNumber2; +condString ? exprString1 : exprString2; +condString ? exprIsObject1 : exprIsObject2; + +//Cond is a string type literal +"" ? exprAny1 : exprAny2; +"string" ? exprBoolean1 : exprBoolean2; +'c' ? exprNumber1 : exprNumber2; +'string' ? exprString1 : exprString2; +" " ? exprIsObject1 : exprIsObject2; + +//Cond is a string type expression +function foo() { return "string" }; +var array = ["1", "2", "3"]; + +typeof condString ? exprAny1 : exprAny2; +condString.toUpperCase ? exprBoolean1 : exprBoolean2; +condString + "string" ? exprNumber1 : exprNumber2; +foo() ? exprString1 : exprString2; +array[1] ? exprIsObject1 : exprIsObject2; + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condString ? exprAny1 : exprAny2; +var resultIsBoolean1 = condString ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condString ? exprNumber1 : exprNumber2; +var resultIsString1 = condString ? exprString1 : exprString2; +var resultIsObject1 = condString ? exprIsObject1 : exprIsObject2; + +var resultIsAny2 = "" ? exprAny1 : exprAny2; +var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; +var resultIsString2 = 'string' ? exprString1 : exprString2; +var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; + +var resultIsAny3 = typeof condString ? exprAny1 : exprAny2; +var resultIsBoolean3 = condString.toUpperCase ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; +var resultIsString3 = foo() ? exprString1 : exprString2; +var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; + + +//// [conditionalOperatorConditoinIsStringType.js] +var condString; +var exprAny1; +var exprBoolean1; +var exprNumber1; +var exprString1; +var exprIsObject1; +var exprAny2; +var exprBoolean2; +var exprNumber2; +var exprString2; +var exprIsObject2; +condString ? exprAny1 : exprAny2; +condString ? exprBoolean1 : exprBoolean2; +condString ? exprNumber1 : exprNumber2; +condString ? exprString1 : exprString2; +condString ? exprIsObject1 : exprIsObject2; +"" ? exprAny1 : exprAny2; +"string" ? exprBoolean1 : exprBoolean2; +'c' ? exprNumber1 : exprNumber2; +'string' ? exprString1 : exprString2; +" " ? exprIsObject1 : exprIsObject2; +function foo() { + return "string"; +} +; +var array = ["1", "2", "3"]; +typeof condString ? exprAny1 : exprAny2; +condString.toUpperCase ? exprBoolean1 : exprBoolean2; +condString + "string" ? exprNumber1 : exprNumber2; +foo() ? exprString1 : exprString2; +array[1] ? exprIsObject1 : exprIsObject2; +var resultIsAny1 = condString ? exprAny1 : exprAny2; +var resultIsBoolean1 = condString ? exprBoolean1 : exprBoolean2; +var resultIsNumber1 = condString ? exprNumber1 : exprNumber2; +var resultIsString1 = condString ? exprString1 : exprString2; +var resultIsObject1 = condString ? exprIsObject1 : exprIsObject2; +var resultIsAny2 = "" ? exprAny1 : exprAny2; +var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; +var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; +var resultIsString2 = 'string' ? exprString1 : exprString2; +var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; +var resultIsAny3 = typeof condString ? exprAny1 : exprAny2; +var resultIsBoolean3 = condString.toUpperCase ? exprBoolean1 : exprBoolean2; +var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; +var resultIsString3 = foo() ? exprString1 : exprString2; +var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js new file mode 100644 index 0000000000000..f7c6b97c0bbcc --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -0,0 +1,100 @@ +//// [conditionalOperatorWithIdenticalBCT.ts] +//Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type +class X { propertyX: any; propertyX1: number; propertyX2: string }; +class A extends X { propertyA: number }; +class B extends X { propertyB: string }; + +var x: X; +var a: A; +var b: B; + +//Cond ? Expr1 : Expr2, Expr1 is supertype +//Be Not contextually typed +true ? x : a; +var result1 = true ? x : a; + +//Expr1 and Expr2 are literals +true ? {} : 1; +true ? { a: 1 } : { a: 2, b: 'string' }; +var result2 = true ? {} : 1; +var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; + +//Contextually typed +var resultIsX1: X = true ? x : a; +var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; + +//Cond ? Expr1 : Expr2, Expr2 is supertype +//Be Not contextually typed +true ? a : x; +var result5 = true ? a : x; + +//Expr1 and Expr2 are literals +true ? 1 : {}; +true ? { a: 2, b: 'string' } : { a: 1 }; +var result6 = true ? 1 : {}; +var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; + +//Contextually typed +var resultIsX2: X = true ? x : a; +var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; + +//Result = Cond ? Expr1 : Expr2, Result is supertype +//Contextually typed +var resultIsX3: X = true ? a : b; +var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + +//Expr1 and Expr2 are literals +var result11: any = true ? 1 : 'string'; + + +//// [conditionalOperatorWithIdenticalBCT.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var X = (function () { + function X() { + } + return X; +})(); +; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(X); +; +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(X); +; +var x; +var a; +var b; +true ? x : a; +var result1 = true ? x : a; +true ? {} : 1; +true ? { a: 1 } : { a: 2, b: 'string' }; +var result2 = true ? {} : 1; +var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; +var resultIsX1 = true ? x : a; +var result4 = true ? function (m) { return m.propertyX; } : function (n) { return n.propertyA; }; +true ? a : x; +var result5 = true ? a : x; +true ? 1 : {}; +true ? { a: 2, b: 'string' } : { a: 1 }; +var result6 = true ? 1 : {}; +var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; +var resultIsX2 = true ? x : a; +var result8 = true ? function (m) { return m.propertyA; } : function (n) { return n.propertyX; }; +var resultIsX3 = true ? a : b; +var result10 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result11 = true ? 1 : 'string'; diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt new file mode 100644 index 0000000000000..09846d2310db1 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts (12 errors) ==== + //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type + class X { propertyX: any; propertyX1: number; propertyX2: string }; + class A extends X { propertyA: number }; + class B extends X { propertyB: string }; + + var x: X; + var a: A; + var b: B; + + //Expect to have compiler errors + //Be not contextually typed + true ? a : b; + ~~~~~~~~~~~~ +!!! No best common type exists between 'A' and 'B'. + var result1 = true ? a : b; + ~~~~~~~~~~~~ +!!! No best common type exists between 'A' and 'B'. + + //Be contextually typed and and bct is not identical + var result2: A = true ? a : b; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'A': +!!! Property 'propertyA' is missing in type '{}'. + ~~~~~~~~~~~~ +!!! No best common type exists between 'A', 'A', and 'B'. + var result3: B = true ? a : b; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'B': +!!! Property 'propertyB' is missing in type '{}'. + ~~~~~~~~~~~~ +!!! No best common type exists between 'B', 'A', and 'B'. + + var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type '(t: X) => number'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! No best common type exists between '(t: X) => number', '(m: X) => number', and '(n: X) => string'. + var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type '(t: X) => string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! No best common type exists between '(t: X) => string', '(m: X) => number', and '(n: X) => string'. + var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type '(t: X) => boolean'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! No best common type exists between '(t: X) => boolean', '(m: X) => number', and '(n: X) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js new file mode 100644 index 0000000000000..d96b5ec9d1e7d --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -0,0 +1,62 @@ +//// [conditionalOperatorWithoutIdenticalBCT.ts] +//Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type +class X { propertyX: any; propertyX1: number; propertyX2: string }; +class A extends X { propertyA: number }; +class B extends X { propertyB: string }; + +var x: X; +var a: A; +var b: B; + +//Expect to have compiler errors +//Be not contextually typed +true ? a : b; +var result1 = true ? a : b; + +//Be contextually typed and and bct is not identical +var result2: A = true ? a : b; +var result3: B = true ? a : b; + +var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; +var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; +var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + +//// [conditionalOperatorWithoutIdenticalBCT.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var X = (function () { + function X() { + } + return X; +})(); +; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(X); +; +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(X); +; +var x; +var a; +var b; +true ? a : b; +var result1 = true ? a : b; +var result2 = true ? a : b; +var result3 = true ? a : b; +var result4 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result5 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; +var result6 = true ? function (m) { return m.propertyX1; } : function (n) { return n.propertyX2; }; diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js new file mode 100644 index 0000000000000..e2029d1bf375b --- /dev/null +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js @@ -0,0 +1,32 @@ +//// [conditionallyDuplicateOverloadsCausedByOverloadResolution.ts] +declare function foo(func: (x: string, y: string) => any): boolean; +declare function foo(func: (x: string, y: number) => any): string; + +var out = foo((x, y) => { + function bar(a: typeof x): void; + function bar(b: typeof y): void; + function bar() { } + return bar; +}); + +declare function foo2(func: (x: string, y: string) => any): boolean; +declare function foo2(func: (x: string, y: number) => any): string; + +var out2 = foo2((x, y) => { + var bar: { + (a: typeof x): void; + (b: typeof y): void; + }; + return bar; +}); + +//// [conditionallyDuplicateOverloadsCausedByOverloadResolution.js] +var out = foo(function (x, y) { + function bar() { + } + return bar; +}); +var out2 = foo2(function (x, y) { + var bar; + return bar; +}); diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt new file mode 100644 index 0000000000000..9bf1480f8bbb8 --- /dev/null +++ b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ==== + interface A { + m: string; + } + interface B extends A { + } + interface C { + m: number; + } + interface D extends C { + } + + interface E extends B { } // Error here for extending B and D + ~ +!!! Interface 'E' cannot simultaneously extend types 'B' and 'D': +!!! Named properties 'm' of types 'B' and 'D' are not identical. + interface E extends D { } // No duplicate error here + \ No newline at end of file diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.js b/tests/baselines/reference/conflictingMemberTypesInBases.js new file mode 100644 index 0000000000000..d0702507e0b62 --- /dev/null +++ b/tests/baselines/reference/conflictingMemberTypesInBases.js @@ -0,0 +1,17 @@ +//// [conflictingMemberTypesInBases.ts] +interface A { + m: string; +} +interface B extends A { +} +interface C { + m: number; +} +interface D extends C { +} + +interface E extends B { } // Error here for extending B and D +interface E extends D { } // No duplicate error here + + +//// [conflictingMemberTypesInBases.js] diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt new file mode 100644 index 0000000000000..85867f5e573e3 --- /dev/null +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (2 errors) ==== + var foo: string; + function foo(): number { } + ~~~ +!!! Duplicate identifier 'foo'. + function foo(): number { } + ~~~ +!!! Duplicate identifier 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.js b/tests/baselines/reference/conflictingTypeAnnotatedVar.js new file mode 100644 index 0000000000000..b44dc6f1e3376 --- /dev/null +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.js @@ -0,0 +1,11 @@ +//// [conflictingTypeAnnotatedVar.ts] +var foo: string; +function foo(): number { } +function foo(): number { } + +//// [conflictingTypeAnnotatedVar.js] +var foo; +function foo() { +} +function foo() { +} diff --git a/tests/baselines/reference/conformanceFunctionOverloads.js b/tests/baselines/reference/conformanceFunctionOverloads.js new file mode 100644 index 0000000000000..021dc73f3ff1f --- /dev/null +++ b/tests/baselines/reference/conformanceFunctionOverloads.js @@ -0,0 +1,26 @@ +//// [conformanceFunctionOverloads.ts] +// Function overloads do not emit code + +// Function overload signature with optional parameter + +// Function overload signature with optional parameter + +// Function overloads with generic and non-generic overloads + +// Function overloads whose only difference is returning different unconstrained generic parameters + +// Function overloads whose only difference is returning different constrained generic parameters + +// Function overloads that differ only by type parameter constraints + +// Function overloads with matching accessibility + +// Function overloads with matching export + +// Function overloads with more params than implementation signature + +// Function overloads where return types are same infinitely recursive type reference + + + +//// [conformanceFunctionOverloads.js] diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js new file mode 100644 index 0000000000000..12e84e2077fdf --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -0,0 +1,59 @@ +//// [constantOverloadFunction.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +class Derived2 extends Base { baz() { } } +class Derived3 extends Base { biz() { } } + +function foo(tagName: 'canvas'): Derived1; +function foo(tagName: 'div'): Derived2; +function foo(tagName: 'span'): Derived3; +function foo(tagName: string): Base; +function foo(tagName: any): Base { + return null; +} + + +//// [constantOverloadFunction.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + Derived2.prototype.baz = function () { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + _super.apply(this, arguments); + } + Derived3.prototype.biz = function () { + }; + return Derived3; +})(Base); +function foo(tagName) { + return null; +} diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt new file mode 100644 index 0000000000000..3501f1b79beba --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts (3 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + class Derived2 extends Base { baz() { } } + class Derived3 extends Base { biz() { } } + + function foo(tagName: 'canvas'): Derived3; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(tagName: 'div'): Derived2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(tagName: 'span'): Derived1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(tagName: number): Base; + function foo(tagName: any): Base { + + return null; + } + \ No newline at end of file diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js new file mode 100644 index 0000000000000..563b73d7e5b00 --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -0,0 +1,60 @@ +//// [constantOverloadFunctionNoSubtypeError.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +class Derived2 extends Base { baz() { } } +class Derived3 extends Base { biz() { } } + +function foo(tagName: 'canvas'): Derived3; +function foo(tagName: 'div'): Derived2; +function foo(tagName: 'span'): Derived1; +function foo(tagName: number): Base; +function foo(tagName: any): Base { + + return null; +} + + +//// [constantOverloadFunctionNoSubtypeError.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + Derived2.prototype.baz = function () { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + _super.apply(this, arguments); + } + Derived3.prototype.biz = function () { + }; + return Derived3; +})(Base); +function foo(tagName) { + return null; +} diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js new file mode 100644 index 0000000000000..71f885cb80395 --- /dev/null +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -0,0 +1,60 @@ +//// [constraintCheckInGenericBaseTypeReference.ts] +// No errors +class Constraint { + public method() { } +} +class GenericBase { + public items: any; +} +class Derived extends GenericBase { + +} +class TypeArg { + public method() { + Container.People.items; + } +} + +class Container { + public static People: Derived +} + +//// [constraintCheckInGenericBaseTypeReference.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Constraint = (function () { + function Constraint() { + } + Constraint.prototype.method = function () { + }; + return Constraint; +})(); +var GenericBase = (function () { + function GenericBase() { + } + return GenericBase; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(GenericBase); +var TypeArg = (function () { + function TypeArg() { + } + TypeArg.prototype.method = function () { + Container.People.items; + }; + return TypeArg; +})(); +var Container = (function () { + function Container() { + } + return Container; +})(); diff --git a/tests/baselines/reference/constraintErrors1.errors.txt b/tests/baselines/reference/constraintErrors1.errors.txt new file mode 100644 index 0000000000000..f081959d02883 --- /dev/null +++ b/tests/baselines/reference/constraintErrors1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/constraintErrors1.ts (1 errors) ==== + function foo5(test: T) { } + ~~ +!!! Cannot find name 'hm'. \ No newline at end of file diff --git a/tests/baselines/reference/constraintErrors1.js b/tests/baselines/reference/constraintErrors1.js new file mode 100644 index 0000000000000..c8da89d574c30 --- /dev/null +++ b/tests/baselines/reference/constraintErrors1.js @@ -0,0 +1,6 @@ +//// [constraintErrors1.ts] +function foo5(test: T) { } + +//// [constraintErrors1.js] +function foo5(test) { +} diff --git a/tests/baselines/reference/constraintPropagationThroughReturnTypes.js b/tests/baselines/reference/constraintPropagationThroughReturnTypes.js new file mode 100644 index 0000000000000..823c2ac84b847 --- /dev/null +++ b/tests/baselines/reference/constraintPropagationThroughReturnTypes.js @@ -0,0 +1,19 @@ +//// [constraintPropagationThroughReturnTypes.ts] +function g(x: T): T { + return x; +} + +function f(x: S) { + var y = g(x); + y; +} + + +//// [constraintPropagationThroughReturnTypes.js] +function g(x) { + return x; +} +function f(x) { + var y = g(x); + y; +} diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt new file mode 100644 index 0000000000000..09a54bb89e947 --- /dev/null +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts (6 errors) ==== + // used to be valid, now an error to do this + + interface IComparable { + } + function f>() { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + interface I1> { // Error, any does not satisfy the constraint I1 + ~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + interface I2 { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + interface I4 T> { + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + // No error + interface I3 { + method1(); + } + + function foo(v: V) => void>() { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js new file mode 100644 index 0000000000000..3eaeba7ae8335 --- /dev/null +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js @@ -0,0 +1,31 @@ +//// [constraintReferencingTypeParameterFromSameTypeParameterList.ts] +// used to be valid, now an error to do this + +interface IComparable { +} +function f>() { +} + +interface I1> { // Error, any does not satisfy the constraint I1 +} +interface I2 { +} + +interface I4 T> { +} + +// No error +interface I3 { + method1(); +} + +function foo(v: V) => void>() { +} + + + +//// [constraintReferencingTypeParameterFromSameTypeParameterList.js] +function f() { +} +function foo() { +} diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.js b/tests/baselines/reference/constraintSatisfactionWithAny.js new file mode 100644 index 0000000000000..2de3a3dd25056 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny.js @@ -0,0 +1,96 @@ +//// [constraintSatisfactionWithAny.ts] +// any is not a valid type argument unless there is no constraint, or the constraint is any + +function foo(x: T): T { return null; } +function foo2(x: T): T { return null; } +//function foo3(x: T): T { return null; } +function foo4(x: T) => void>(x: T): T { return null; } +var a; +foo(a); +foo2(a); +//foo3(a); +foo4(a); + +var b: number; +foo(b); +foo2(b); +//foo3(b); +foo4(b); + +//function foo5(x: T, y: U): T { return null; } +//foo5(a, a); +//foo5(b, b); + +class C { + constructor(public x: T) { } +} + +var c1 = new C(a); +var c2 = new C(b); + +class C2 { + constructor(public x: T) { } +} + +var c3 = new C2(a); +var c4 = new C2(b); + +//class C3 { +// constructor(public x: T) { } +//} + +//var c5 = new C3(a); +//var c6 = new C3(b); + +class C4(x:T) => T> { + constructor(public x: T) { } +} + +var c7 = new C4(a); +var c8 = new C4(b); + + + + +//// [constraintSatisfactionWithAny.js] +function foo(x) { + return null; +} +function foo2(x) { + return null; +} +function foo4(x) { + return null; +} +var a; +foo(a); +foo2(a); +foo4(a); +var b; +foo(b); +foo2(b); +foo4(b); +var C = (function () { + function C(x) { + this.x = x; + } + return C; +})(); +var c1 = new C(a); +var c2 = new C(b); +var C2 = (function () { + function C2(x) { + this.x = x; + } + return C2; +})(); +var c3 = new C2(a); +var c4 = new C2(b); +var C4 = (function () { + function C4(x) { + this.x = x; + } + return C4; +})(); +var c7 = new C4(a); +var c8 = new C4(b); diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt b/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt new file mode 100644 index 0000000000000..c3f3b04a44128 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts (1 errors) ==== + // errors expected for type parameter cannot be referenced in the constraints of the same list + // any is not a valid type argument unless there is no constraint, or the constraint is any + + declare function foo(x: U) => Z>(y: T): Z; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var a: any; + + foo(a); + foo(a); \ No newline at end of file diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.js b/tests/baselines/reference/constraintSatisfactionWithAny2.js new file mode 100644 index 0000000000000..cb59e5edd0518 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.js @@ -0,0 +1,14 @@ +//// [constraintSatisfactionWithAny2.ts] +// errors expected for type parameter cannot be referenced in the constraints of the same list +// any is not a valid type argument unless there is no constraint, or the constraint is any + +declare function foo(x: U) => Z>(y: T): Z; +var a: any; + +foo(a); +foo(a); + +//// [constraintSatisfactionWithAny2.js] +var a; +foo(a); +foo(a); diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js new file mode 100644 index 0000000000000..baa4c7f29cc0d --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js @@ -0,0 +1,66 @@ +//// [constraintSatisfactionWithEmptyObject.ts] +// valid uses of a basic object constraint, no errors expected + +// Object constraint +function foo(x: T) { } +var r = foo({}); +var a = {}; +var r = foo({}); + +class C { + constructor(public x: T) { } +} + +var r2 = new C({}); + +interface I { + x: T; +} +var i: I<{}>; + +// {} constraint +function foo2(x: T) { } +var r = foo2({}); +var a = {}; +var r = foo2({}); + +class C2 { + constructor(public x: T) { } +} + +var r2 = new C2({}); + +interface I2 { + x: T; +} +var i2: I2<{}>; + + + +//// [constraintSatisfactionWithEmptyObject.js] +function foo(x) { +} +var r = foo({}); +var a = {}; +var r = foo({}); +var C = (function () { + function C(x) { + this.x = x; + } + return C; +})(); +var r2 = new C({}); +var i; +function foo2(x) { +} +var r = foo2({}); +var a = {}; +var r = foo2({}); +var C2 = (function () { + function C2(x) { + this.x = x; + } + return C2; +})(); +var r2 = new C2({}); +var i2; diff --git a/tests/baselines/reference/constraints0.errors.txt b/tests/baselines/reference/constraints0.errors.txt new file mode 100644 index 0000000000000..1ace0a1b18f91 --- /dev/null +++ b/tests/baselines/reference/constraints0.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/constraints0.ts (1 errors) ==== + interface A { + a: number; + } + + interface B { + b: string; + } + + interface C { + x: T; + } + + var v1: C; // should work + var v2: C; // should not work + ~~~~ +!!! Type 'B' does not satisfy the constraint 'A': +!!! Property 'a' is missing in type 'B'. + + var y = v1.x.a; // 'a' should be of type 'number' \ No newline at end of file diff --git a/tests/baselines/reference/constraints0.js b/tests/baselines/reference/constraints0.js new file mode 100644 index 0000000000000..17a71a9225927 --- /dev/null +++ b/tests/baselines/reference/constraints0.js @@ -0,0 +1,22 @@ +//// [constraints0.ts] +interface A { + a: number; +} + +interface B { + b: string; +} + +interface C { + x: T; +} + +var v1: C; // should work +var v2: C; // should not work + +var y = v1.x.a; // 'a' should be of type 'number' + +//// [constraints0.js] +var v1; +var v2; +var y = v1.x.a; diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt new file mode 100644 index 0000000000000..13b6be52ae290 --- /dev/null +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts (2 errors) ==== + interface Object { } + + class Foo { } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + class Bar { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. + } + + var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type + \ No newline at end of file diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js new file mode 100644 index 0000000000000..61b6717966b5f --- /dev/null +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js @@ -0,0 +1,23 @@ +//// [constraintsThatReferenceOtherContstraints1.ts] +interface Object { } + +class Foo { } +class Bar { + data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. +} + +var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type + + +//// [constraintsThatReferenceOtherContstraints1.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var x; diff --git a/tests/baselines/reference/constraintsUsedInPrototypeProperty.js b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js new file mode 100644 index 0000000000000..fc5bae9a3d9ab --- /dev/null +++ b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js @@ -0,0 +1,11 @@ +//// [constraintsUsedInPrototypeProperty.ts] +class Foo { } +Foo.prototype; // Foo + +//// [constraintsUsedInPrototypeProperty.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +Foo.prototype; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt new file mode 100644 index 0000000000000..e33107575e485 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -0,0 +1,77 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts (1 errors) ==== + // Checking basic subtype relations with construct signatures + + module ConstructSignature { + interface Base { // T + // M's + new (x: number): void; // BUG 842221 + new (x: number, y: number): number; + } + + // S's + interface I extends Base { + // N's + new (x: number): number; // satisfies subtype for both of base's call signatures + new (x: number, y: number): boolean; // so this one hides the base type member that is identical modulo return types + } + + interface Base2 { // T + // M's + new (x: number): number; + } + + // S's + interface I2 extends Base2 { + // N's + new (x: number): string; // error because return types don't match + } + + // S's + interface I3 extends Base2 { + // N's + new (x: T): string; // ok, adds a new call signature + } + } + + module MemberWithConstructSignature { + interface Base { // T + // M's + a: new (x: number) => void; + a2: new (x: number, y: number) => void; + a3: new (x: T) => void; + } + + var b: Base; + var r = new b.a(1); + + // S's + interface I extends Base { + // N's + a: new (x: number) => number; // ok because base returns void + a2: new (x: number, y: number) => boolean; // ok because base returns void + a3: new (x: T) => string; // ok because base returns void + } + + interface Base2 { // T + // M's + a: new (x: number) => number; + a2: new (x: T) => T; + } + + // S's + interface I2 extends Base2 { + ~~ +!!! Interface 'I2' incorrectly extends interface 'Base2': +!!! Types of property 'a' are incompatible: +!!! Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': +!!! Type 'string' is not assignable to type 'number'. + // N's + a: new (x: number) => string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + a2: new (x: T) => string; // error because base returns non-void; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js new file mode 100644 index 0000000000000..ba7d4d0deacdc --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js @@ -0,0 +1,79 @@ +//// [constructSignatureAssignabilityInInheritance.ts] +// Checking basic subtype relations with construct signatures + +module ConstructSignature { + interface Base { // T + // M's + new (x: number): void; // BUG 842221 + new (x: number, y: number): number; + } + + // S's + interface I extends Base { + // N's + new (x: number): number; // satisfies subtype for both of base's call signatures + new (x: number, y: number): boolean; // so this one hides the base type member that is identical modulo return types + } + + interface Base2 { // T + // M's + new (x: number): number; + } + + // S's + interface I2 extends Base2 { + // N's + new (x: number): string; // error because return types don't match + } + + // S's + interface I3 extends Base2 { + // N's + new (x: T): string; // ok, adds a new call signature + } +} + +module MemberWithConstructSignature { + interface Base { // T + // M's + a: new (x: number) => void; + a2: new (x: number, y: number) => void; + a3: new (x: T) => void; + } + + var b: Base; + var r = new b.a(1); + + // S's + interface I extends Base { + // N's + a: new (x: number) => number; // ok because base returns void + a2: new (x: number, y: number) => boolean; // ok because base returns void + a3: new (x: T) => string; // ok because base returns void + } + + interface Base2 { // T + // M's + a: new (x: number) => number; + a2: new (x: T) => T; + } + + // S's + interface I2 extends Base2 { + // N's + a: new (x: number) => string; // error because base returns non-void; + } + + // S's + interface I3 extends Base2 { + // N's + a2: new (x: T) => string; // error because base returns non-void; + } +} + +//// [constructSignatureAssignabilityInInheritance.js] +var MemberWithConstructSignature; +(function (MemberWithConstructSignature) { + var b; + var r = new b.a(1); +})(MemberWithConstructSignature || (MemberWithConstructSignature = {})); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js new file mode 100644 index 0000000000000..89eab63f93485 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -0,0 +1,104 @@ +//// [constructSignatureAssignabilityInInheritance2.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: new (x: number) => number[]; + a2: new (x: number) => string[]; + a3: new (x: number) => void; + a4: new (x: string, y: number) => string; + a5: new (x: (arg: string) => number) => string; + a6: new (x: (arg: Base) => Derived) => Base; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Derived[]) => Derived; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a13: new (x: Array, y: Array) => Array; + a14: new (x: { a: string; b: number }) => Object; + a15: { + new (x: number): number[]; + new (x: string): string[]; + }; + a16: { + new (x: T): number[]; + new (x: U): number[]; + }; + a17: { + new (x: new (a: number) => number): number[]; + new (x: new (a: string) => string): string[]; + }; + a18: { + new (x: { + new (a: number): number; + new (a: string): string; + }): any[]; + new (x: { + new (a: boolean): boolean; + new (a: Date): Date; + }): any[]; + }; +} + +// S's +interface I extends A { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: new (x: (arg: T) => U) => (r: T) => U; // ok + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: new (...x: T[]) => T; // ok + a11: new (x: T, y: T) => T; // ok + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature + a15: new (x: T) => T[]; // ok + a16: new (x: T) => number[]; // ok + a17: new (x: new (a: T) => T) => T[]; // ok + a18: new (x: new (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +} + +//// [constructSignatureAssignabilityInInheritance2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt new file mode 100644 index 0000000000000..2d267d5a260db --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -0,0 +1,128 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + // error cases + + module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // base type with non-generic call signatures + interface A { + a2: new (x: number) => string[]; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Base[]) => Base; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a14: { + new (x: number): number[]; + new (x: string): string[]; + }; + a15: new (x: { a: string; b: number }) => number; + a16: { + // type of parameter is overload set which means we can't do inference based on this type + new (x: { + new (a: number): number; + new (a?: number): number; + }): number[]; + new (x: { + new (a: boolean): boolean; + new (a?: boolean): boolean; + }): boolean[]; + }; + } + + interface I extends A { + a2: new (x: T) => U[]; // error, contextual signature instantiation doesn't relate return types so U is {}, not a subtype of string[] + } + + interface I2 extends A { + ~~ +!!! Interface 'I2' incorrectly extends interface 'A': +!!! Types of property 'a2' are incompatible: +!!! Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'T' is not assignable to type 'number'. + a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic + } + + interface I3 extends A { + // valid, no inferences for V so it defaults to Derived2 + a7: new (x: (arg: T) => U) => (r: T) => V; + } + + interface I4 extends A { + ~~ +!!! Interface 'I4' incorrectly extends interface 'A': +!!! Types of property 'a8' are incompatible: +!!! Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': +!!! Types of parameters 'arg2' and 'arg2' are incompatible: +!!! Type '{ foo: number; }' is not assignable to type 'Base': +!!! Types of property 'foo' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch + } + + interface I4B extends A { + a10: new (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation + } + + interface I4C extends A { + a11: new (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation + } + + interface I4E extends A { + a12: new >(x: Array, y: Array) => T; // valid, no inferences for T, defaults to Array + } + + interface I6 extends A { + a15: new (x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type + } + + interface I7 extends A { + a15: new (x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string + } + + interface I8 extends A { + // ok, we relate each signature of a16 to b16, and within that, we make inferences from two different signatures in the respective A.a16 signature + a16: new (x: new (a: T) => T) => T[]; + } + } + + module WithGenericSignaturesInBaseType { + // base type has generic call signature + interface B { + a2: new (x: T) => T[]; + } + + interface I6 extends B { + a2: new (x: T) => string[]; // error + } + + // base type has generic call signature + interface C { + a2: new (x: T) => string[]; + } + + interface I7 extends C { + a2: new (x: T) => T[]; // error + } + + // base type has a generic call signature with overloads + interface D { + a14: { + new (x: T): number[]; + new (x: U): number[]; + }; + } + + interface I8 extends D { + a14: new (x: T) => number[]; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js new file mode 100644 index 0000000000000..4706e9a49f403 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -0,0 +1,149 @@ +//// [constructSignatureAssignabilityInInheritance3.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// error cases + +module Errors { + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + module WithNonGenericSignaturesInBaseType { + // base type with non-generic call signatures + interface A { + a2: new (x: number) => string[]; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Base[]) => Base; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a14: { + new (x: number): number[]; + new (x: string): string[]; + }; + a15: new (x: { a: string; b: number }) => number; + a16: { + // type of parameter is overload set which means we can't do inference based on this type + new (x: { + new (a: number): number; + new (a?: number): number; + }): number[]; + new (x: { + new (a: boolean): boolean; + new (a?: boolean): boolean; + }): boolean[]; + }; + } + + interface I extends A { + a2: new (x: T) => U[]; // error, contextual signature instantiation doesn't relate return types so U is {}, not a subtype of string[] + } + + interface I2 extends A { + a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic + } + + interface I3 extends A { + // valid, no inferences for V so it defaults to Derived2 + a7: new (x: (arg: T) => U) => (r: T) => V; + } + + interface I4 extends A { + a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch + } + + interface I4B extends A { + a10: new (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation + } + + interface I4C extends A { + a11: new (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation + } + + interface I4E extends A { + a12: new >(x: Array, y: Array) => T; // valid, no inferences for T, defaults to Array + } + + interface I6 extends A { + a15: new (x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type + } + + interface I7 extends A { + a15: new (x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string + } + + interface I8 extends A { + // ok, we relate each signature of a16 to b16, and within that, we make inferences from two different signatures in the respective A.a16 signature + a16: new (x: new (a: T) => T) => T[]; + } + } + + module WithGenericSignaturesInBaseType { + // base type has generic call signature + interface B { + a2: new (x: T) => T[]; + } + + interface I6 extends B { + a2: new (x: T) => string[]; // error + } + + // base type has generic call signature + interface C { + a2: new (x: T) => string[]; + } + + interface I7 extends C { + a2: new (x: T) => T[]; // error + } + + // base type has a generic call signature with overloads + interface D { + a14: { + new (x: T): number[]; + new (x: U): number[]; + }; + } + + interface I8 extends D { + a14: new (x: T) => number[]; + } + } +} + +//// [constructSignatureAssignabilityInInheritance3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Errors; +(function (Errors) { + var Base = (function () { + function Base() { + } + return Base; + })(); + var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; + })(Base); + var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; + })(Derived); + var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; + })(Base); +})(Errors || (Errors = {})); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js new file mode 100644 index 0000000000000..19adbba4b8e3e --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -0,0 +1,94 @@ +//// [constructSignatureAssignabilityInInheritance4.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: new (x: T) => T[]; + a2: new (x: T) => string[]; + a3: new (x: T) => void; + a4: new (x: T, y: U) => string; + a5: new (x: (arg: T) => U) => T; + a6: new (x: (arg: T) => Derived) => T; + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: new (x: { a: T; b: T }) => T[]; + a16: new (x: { a: T; b: T }) => T[]; + a17: { + new (x: T): T[]; + new (x: U): U[]; + }; + a18: { + new (x: T): number[]; + new (x: U): number[]; + }; + a19: { + new (x: new (a: T) => T): T[]; + new (x: new (a: U) => U): U[]; + }; + a20: { + new (x: { + new (a: T): T; + new (a: U): U; + }): any[]; + new (x: { + new (a: T): T; + new (a: U): U; + }): any[]; + }; +} + +// S's +interface I extends A { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok + a15: new (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V + a16: new (x: { a: T; b: T }) => T[]; // ok, more general parameter type + a17: new (x: T) => T[]; // ok, more general parameter type + a18: new (x: T) => number[]; // ok, more general parameter type + a19: new (x: new (a: T) => T) => T[]; // ok + a20: new (x: new (a: T) => T) => any[]; // ok +} + +//// [constructSignatureAssignabilityInInheritance4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js new file mode 100644 index 0000000000000..2440670d379a5 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -0,0 +1,83 @@ +//// [constructSignatureAssignabilityInInheritance5.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: new (x: number) => number[]; + a2: new (x: number) => string[]; + a3: new (x: number) => void; + a4: new (x: string, y: number) => string; + a5: new (x: (arg: string) => number) => string; + a6: new (x: (arg: Base) => Derived) => Base; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Derived[]) => Derived; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a13: new (x: Array, y: Array) => Array; + a14: new (x: { a: string; b: number }) => Object; +} + +interface B extends A { + a: new (x: T) => T[]; +} + +// S's +interface I extends B { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: new (x: (arg: T) => U) => (r: T) => U; // ok + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: new (...x: T[]) => T; // ok + a11: new (x: T, y: T) => T; // ok + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +} + +//// [constructSignatureAssignabilityInInheritance5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js new file mode 100644 index 0000000000000..a6f56fdbe69e9 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -0,0 +1,85 @@ +//// [constructSignatureAssignabilityInInheritance6.ts] +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +class OtherDerived extends Base { bing: string; } + +interface A { // T + // M's + a: new (x: T) => T[]; + a2: new (x: T) => string[]; + a3: new (x: T) => void; + a4: new (x: T, y: U) => string; + a5: new (x: (arg: T) => U) => T; + a6: new (x: (arg: T) => Derived) => T; + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: new (x: { a: T; b: T }) => T[]; + a16: new (x: { a: T; b: T }) => T[]; +} + +// S's +interface I extends A { + a: new (x: T) => T[]; +} + +interface I2 extends A { + a2: new (x: T) => string[]; +} + +interface I3 extends A { + a3: new (x: T) => T; +} + +interface I4 extends A { + a4: new (x: T, y: U) => string; +} + +interface I5 extends A { + a5: new (x: (arg: T) => U) => T; +} + +interface I7 extends A { + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +} + +interface I9 extends A { + a16: new (x: { a: T; b: T }) => T[]; +} + +//// [constructSignatureAssignabilityInInheritance6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var OtherDerived = (function (_super) { + __extends(OtherDerived, _super); + function OtherDerived() { + _super.apply(this, arguments); + } + return OtherDerived; +})(Base); diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt new file mode 100644 index 0000000000000..970bafa492757 --- /dev/null +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters.ts (4 errors) ==== + // Parameter properties are only valid in constructor definitions, not even in other forms of construct signatures + + class C { + constructor(public x, private y) { } + } + + class C2 { + constructor(public x) { } + } + + class C3 { + constructor(private x) { } + } + + interface I { + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + interface I2 { + new (private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + var a: { + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + var b: { + new (private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js new file mode 100644 index 0000000000000..9f04781828a7d --- /dev/null +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js @@ -0,0 +1,53 @@ +//// [constructSignatureWithAccessibilityModifiersOnParameters.ts] +// Parameter properties are only valid in constructor definitions, not even in other forms of construct signatures + +class C { + constructor(public x, private y) { } +} + +class C2 { + constructor(public x) { } +} + +class C3 { + constructor(private x) { } +} + +interface I { + new (public x); +} + +interface I2 { + new (private x); +} + +var a: { + new (public x); +} + +var b: { + new (private x); +} + +//// [constructSignatureWithAccessibilityModifiersOnParameters.js] +var C = (function () { + function C(x, y) { + this.x = x; + this.y = y; + } + return C; +})(); +var C2 = (function () { + function C2(x) { + this.x = x; + } + return C2; +})(); +var C3 = (function () { + function C3(x) { + this.x = x; + } + return C3; +})(); +var a; +var b; diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt new file mode 100644 index 0000000000000..5d208c89133b2 --- /dev/null +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.errors.txt @@ -0,0 +1,67 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (15 errors) ==== + // Parameter properties are not valid in overloads of constructors + + class C { + constructor(public x, private y); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public x, private y) { } + ~ +!!! Duplicate identifier 'x'. + ~ +!!! Duplicate identifier 'y'. + } + + class C2 { + constructor(private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public x) { } + ~ +!!! Duplicate identifier 'x'. + } + + class C3 { + constructor(private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(private y) { } + } + + interface I { + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + interface I2 { + new (private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + new (private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + var a: { + new (public x); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + new (public y); + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + var b: { + new (private x); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + new (private y); + ~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js new file mode 100644 index 0000000000000..ddf8ced41cffd --- /dev/null +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js @@ -0,0 +1,60 @@ +//// [constructSignatureWithAccessibilityModifiersOnParameters2.ts] +// Parameter properties are not valid in overloads of constructors + +class C { + constructor(public x, private y); + constructor(public x, private y) { } +} + +class C2 { + constructor(private x); + constructor(public x) { } +} + +class C3 { + constructor(private x); + constructor(private y) { } +} + +interface I { + new (public x); + new (public x); +} + +interface I2 { + new (private x); + new (private x); +} + +var a: { + new (public x); + new (public y); +} + +var b: { + new (private x); + new (private y); +} + +//// [constructSignatureWithAccessibilityModifiersOnParameters2.js] +var C = (function () { + function C(x, y) { + this.x = x; + this.y = y; + } + return C; +})(); +var C2 = (function () { + function C2(x) { + this.x = x; + } + return C2; +})(); +var C3 = (function () { + function C3(y) { + this.y = y; + } + return C3; +})(); +var a; +var b; diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js new file mode 100644 index 0000000000000..4dd31fdfa1ea5 --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js @@ -0,0 +1,72 @@ +//// [constructSignaturesWithIdenticalOverloads.ts] +// Duplicate overloads of construct signatures should generate errors + +class C { + constructor(x: number, y: string); + constructor(x: number, y: string); // error + constructor(x: number) { } +} + +var r1 = new C(1, ''); + +class C2 { + constructor(x: T, y: string); + constructor(x: T, y: string); // error + constructor(x: T) { } +} + +var r2 = new C2(1, ''); + +interface I { + new (x: number, y: string): C; + new (x: number, y: string): C; // error +} + +var i: I; +var r3 = new i(1, ''); + +interface I2 { + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error +} + +var i2: I2; +var r4 = new i2(1, ''); + +var a: { + new (x: number, y: string): C; + new (x: number, y: string): C; // error +} + +var r5 = new a(1, ''); + +var b: { + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error +} + +var r6 = new b(1, ''); + +//// [constructSignaturesWithIdenticalOverloads.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var r1 = new C(1, ''); +var C2 = (function () { + function C2(x) { + } + return C2; +})(); +var r2 = new C2(1, ''); +var i; +var r3 = new i(1, ''); +var i2; +var r4 = new i2(1, ''); +var a; +var r5 = new a(1, ''); +var b; +var r6 = new b(1, ''); diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.js b/tests/baselines/reference/constructSignaturesWithOverloads.js new file mode 100644 index 0000000000000..da7a0be2578df --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads.js @@ -0,0 +1,73 @@ +//// [constructSignaturesWithOverloads.ts] +// No errors expected for basic overloads of construct signatures + +class C { + constructor(x: number, y?: string); + constructor(x: number, y: string); + constructor(x: number) { } +} + +var r1 = new C(1, ''); + +class C2 { + constructor(x: T, y?: string); + constructor(x: T, y: string); + constructor(x: T) { } +} + +var r2 = new C2(1, ''); + +interface I { + new(x: number, y?: string): C; + new(x: number, y: string): C; +} + +var i: I; +var r3 = new i(1, ''); + +interface I2 { + new (x: T, y?: string): C2; + new (x: T, y: string): C2; + new (x: T, y?: string): C2; + new (x: T, y: string): C2; + +} + +var i2: I2; +var r4 = new i2(1, ''); + +var a: { + new(x: number, y?: string): C; + new(x: number, y: string): C; +} + +var r5 = new a(1, ''); + +var b: { + new(x: T, y?: string): C2; + new(x: T, y: string): C2; +} + +var r6 = new b(1, ''); + +//// [constructSignaturesWithOverloads.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var r1 = new C(1, ''); +var C2 = (function () { + function C2(x) { + } + return C2; +})(); +var r2 = new C2(1, ''); +var i; +var r3 = new i(1, ''); +var i2; +var r4 = new i2(1, ''); +var a; +var r5 = new a(1, ''); +var b; +var r6 = new b(1, ''); diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt new file mode 100644 index 0000000000000..2d08a7ae1c695 --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt @@ -0,0 +1,42 @@ +==== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads2.ts (1 errors) ==== + // No errors expected for basic overloads of construct signatures with merged declarations + + // clodules + class C { + constructor(x: number, y?: string); + constructor(x: number, y: string); + constructor(x: number) { } + } + module C { + export var x = 1; + } + + var r1 = new C(1, ''); + + class C2 { + constructor(x: T, y?: string); + constructor(x: T, y: string); + constructor(x: T) { } + } + module C2 { + export var x = 1; + } + + var r2 = new C2(1, ''); + + // merged interfaces + interface I { + new (x: number, y?: string): C; + new (x: number, y: string): C; + } + + interface I { + ~ +!!! All declarations of an interface must have identical type parameters. + new (x: T, y?: number): C2; + new (x: T, y: number): C2; + } + + var i2: I; + var r4 = new i2(1, ''); + var r5 = new i2(1, 1); \ No newline at end of file diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.js b/tests/baselines/reference/constructSignaturesWithOverloads2.js new file mode 100644 index 0000000000000..026a907e99ade --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.js @@ -0,0 +1,65 @@ +//// [constructSignaturesWithOverloads2.ts] +// No errors expected for basic overloads of construct signatures with merged declarations + +// clodules +class C { + constructor(x: number, y?: string); + constructor(x: number, y: string); + constructor(x: number) { } +} +module C { + export var x = 1; +} + +var r1 = new C(1, ''); + +class C2 { + constructor(x: T, y?: string); + constructor(x: T, y: string); + constructor(x: T) { } +} +module C2 { + export var x = 1; +} + +var r2 = new C2(1, ''); + +// merged interfaces +interface I { + new (x: number, y?: string): C; + new (x: number, y: string): C; +} + +interface I { + new (x: T, y?: number): C2; + new (x: T, y: number): C2; +} + +var i2: I; +var r4 = new i2(1, ''); +var r5 = new i2(1, 1); + +//// [constructSignaturesWithOverloads2.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var C; +(function (C) { + C.x = 1; +})(C || (C = {})); +var r1 = new C(1, ''); +var C2 = (function () { + function C2(x) { + } + return C2; +})(); +var C2; +(function (C2) { + C2.x = 1; +})(C2 || (C2 = {})); +var r2 = new C2(1, ''); +var i2; +var r4 = new i2(1, ''); +var r5 = new i2(1, 1); diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js new file mode 100644 index 0000000000000..4c9fe2b10857d --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js @@ -0,0 +1,47 @@ +//// [constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts] +// Error for construct signature overloads to differ only by return type + +class C { + constructor(x: number) { } +} + +class C2 { + constructor(x: T, y?: string) { } +} + +interface I { + new(x: number, y: string): C; + new(x: number, y: string): C2; // error +} + +interface I2 { + new (x: T, y: string): C2; + new (x: T, y: string): C; // error + new (x: T, y: string): C2; + new (x: T, y: string): C; // error + +} + +var a: { + new (x: number, y: string): C2; + new (x: number, y: string): C; // error +} + +var b: { + new (x: T, y: string): C2; + new (x: T, y: string): C; // error +} + +//// [constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var C2 = (function () { + function C2(x, y) { + } + return C2; +})(); +var a; +var b; diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.js b/tests/baselines/reference/constructorArgWithGenericCallSignature.js new file mode 100644 index 0000000000000..90eada7cec4bf --- /dev/null +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.js @@ -0,0 +1,32 @@ +//// [constructorArgWithGenericCallSignature.ts] +module Test { + export interface MyFunc { + (value1: T): T; + } + export class MyClass { + constructor(func: MyFunc) { } + } + + export function F(func: MyFunc) { } +} +var func: Test.MyFunc; +Test.F(func); // OK +var test = new Test.MyClass(func); // Should be OK + + +//// [constructorArgWithGenericCallSignature.js] +var Test; +(function (Test) { + var MyClass = (function () { + function MyClass(func) { + } + return MyClass; + })(); + Test.MyClass = MyClass; + function F(func) { + } + Test.F = F; +})(Test || (Test = {})); +var func; +Test.F(func); +var test = new Test.MyClass(func); diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js new file mode 100644 index 0000000000000..e77c6ed8e0f3e --- /dev/null +++ b/tests/baselines/reference/constructorArgs.js @@ -0,0 +1,37 @@ +//// [constructorArgs.ts] +interface Options { + value: number; +} + +class Super { + constructor(value:number) { + } +} + +class Sub extends Super { + constructor(public options:Options) { + super(options.value); + } +} + + +//// [constructorArgs.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Super = (function () { + function Super(value) { + } + return Super; +})(); +var Sub = (function (_super) { + __extends(Sub, _super); + function Sub(options) { + _super.call(this, options.value); + this.options = options; + } + return Sub; +})(Super); diff --git a/tests/baselines/reference/constructorArgsErrors1.errors.txt b/tests/baselines/reference/constructorArgsErrors1.errors.txt new file mode 100644 index 0000000000000..2b7754f86007b --- /dev/null +++ b/tests/baselines/reference/constructorArgsErrors1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/constructorArgsErrors1.ts (1 errors) ==== + class foo { + constructor (static a: number) { + ~~~~~~ +!!! 'static' modifier cannot appear on a parameter. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors2.errors.txt b/tests/baselines/reference/constructorArgsErrors2.errors.txt new file mode 100644 index 0000000000000..75af200513801 --- /dev/null +++ b/tests/baselines/reference/constructorArgsErrors2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/constructorArgsErrors2.ts (1 errors) ==== + class foo { + constructor (public static a: number) { + ~~~~~~ +!!! 'static' modifier cannot appear on a parameter. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors3.errors.txt b/tests/baselines/reference/constructorArgsErrors3.errors.txt new file mode 100644 index 0000000000000..b01950da27985 --- /dev/null +++ b/tests/baselines/reference/constructorArgsErrors3.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/constructorArgsErrors3.ts (1 errors) ==== + class foo { + constructor (public public a: number) { + ~~~~~~ +!!! Accessibility modifier already seen. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors4.errors.txt b/tests/baselines/reference/constructorArgsErrors4.errors.txt new file mode 100644 index 0000000000000..431844358ee74 --- /dev/null +++ b/tests/baselines/reference/constructorArgsErrors4.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/constructorArgsErrors4.ts (1 errors) ==== + class foo { + constructor (private public a: number) { + ~~~~~~ +!!! Accessibility modifier already seen. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors5.errors.txt b/tests/baselines/reference/constructorArgsErrors5.errors.txt new file mode 100644 index 0000000000000..176a2b7db06fc --- /dev/null +++ b/tests/baselines/reference/constructorArgsErrors5.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/constructorArgsErrors5.ts (1 errors) ==== + class foo { + constructor (export a: number) { + ~~~~~~ +!!! 'export' modifier cannot appear on a parameter. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorAsType.errors.txt b/tests/baselines/reference/constructorAsType.errors.txt new file mode 100644 index 0000000000000..8c5407a4f5df4 --- /dev/null +++ b/tests/baselines/reference/constructorAsType.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/constructorAsType.ts (1 errors) ==== + var Person:new () => {name: string;} = function () {return {name:"joe"};}; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. + + var Person2:{new() : {name:string;};}; + + Person = Person2; \ No newline at end of file diff --git a/tests/baselines/reference/constructorAsType.js b/tests/baselines/reference/constructorAsType.js new file mode 100644 index 0000000000000..1f48f214dd40b --- /dev/null +++ b/tests/baselines/reference/constructorAsType.js @@ -0,0 +1,13 @@ +//// [constructorAsType.ts] +var Person:new () => {name: string;} = function () {return {name:"joe"};}; + +var Person2:{new() : {name:string;};}; + +Person = Person2; + +//// [constructorAsType.js] +var Person = function () { + return { name: "joe" }; +}; +var Person2; +Person = Person2; diff --git a/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt b/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt new file mode 100644 index 0000000000000..07bd240bfabad --- /dev/null +++ b/tests/baselines/reference/constructorDefaultValuesReferencingThis.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorDefaultValuesReferencingThis.ts (3 errors) ==== + class C { + constructor(x = this) { } + ~~~~ +!!! 'this' cannot be referenced in constructor arguments. + } + + class D { + constructor(x = this) { } + ~~~~ +!!! 'this' cannot be referenced in constructor arguments. + } + + class E { + constructor(public x = this) { } + ~~~~ +!!! 'this' cannot be referenced in constructor arguments. + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorDefaultValuesReferencingThis.js b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js new file mode 100644 index 0000000000000..e022f46a5283e --- /dev/null +++ b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js @@ -0,0 +1,33 @@ +//// [constructorDefaultValuesReferencingThis.ts] +class C { + constructor(x = this) { } +} + +class D { + constructor(x = this) { } +} + +class E { + constructor(public x = this) { } +} + +//// [constructorDefaultValuesReferencingThis.js] +var C = (function () { + function C(x) { + if (x === void 0) { x = this; } + } + return C; +})(); +var D = (function () { + function D(x) { + if (x === void 0) { x = this; } + } + return D; +})(); +var E = (function () { + function E(x) { + if (x === void 0) { x = this; } + this.x = x; + } + return E; +})(); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js new file mode 100644 index 0000000000000..7262e5b7e0d64 --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -0,0 +1,47 @@ +//// [constructorFunctionTypeIsAssignableToBaseType.ts] +class Base { + static foo: { + bar: Object; + } +} + +class Derived extends Base { + // ok + static foo: { + bar: number; + } +} + +class Derived2 extends Base { + // ok, use assignability here + static foo: { + bar: any; + } +} + +//// [constructorFunctionTypeIsAssignableToBaseType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js new file mode 100644 index 0000000000000..c75848040374c --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -0,0 +1,61 @@ +//// [constructorFunctionTypeIsAssignableToBaseType2.ts] +// the constructor function itself does not need to be a subtype of the base type constructor function + +class Base { + static foo: { + bar: Object; + } + constructor(x: Object) { + } +} + +class Derived extends Base { + // ok + static foo: { + bar: number; + } + + constructor(x: number) { + super(x); + } +} + +class Derived2 extends Base { + static foo: { + bar: number; + } + + // ok, not enforcing assignability relation on this + constructor(x: any) { + super(x); + return 1; + } +} + +//// [constructorFunctionTypeIsAssignableToBaseType2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(x) { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(x) { + _super.call(this, x); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2(x) { + _super.call(this, x); + return 1; + } + return Derived2; +})(Base); diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js new file mode 100644 index 0000000000000..2f0587255b21b --- /dev/null +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -0,0 +1,78 @@ +//// [constructorHasPrototypeProperty.ts] +module NonGeneric { + class C { + foo: string; + } + + class D extends C { + bar: string; + } + + var r = C.prototype; + r.foo; + var r2 = D.prototype; + r2.bar; +} + +module Generic { + class C { + foo: T; + bar: U; + } + + class D extends C { + baz: T; + bing: U; + } + + var r = C.prototype; // C + var ra = r.foo; // any + var r2 = D.prototype; // D + var rb = r2.baz; // any +} + +//// [constructorHasPrototypeProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var NonGeneric; +(function (NonGeneric) { + var C = (function () { + function C() { + } + return C; + })(); + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C); + var r = C.prototype; + r.foo; + var r2 = D.prototype; + r2.bar; +})(NonGeneric || (NonGeneric = {})); +var Generic; +(function (Generic) { + var C = (function () { + function C() { + } + return C; + })(); + var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; + })(C); + var r = C.prototype; + var ra = r.foo; + var r2 = D.prototype; + var rb = r2.baz; +})(Generic || (Generic = {})); diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.js b/tests/baselines/reference/constructorImplementationWithDefaultValues.js new file mode 100644 index 0000000000000..2279b13f21dfb --- /dev/null +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.js @@ -0,0 +1,44 @@ +//// [constructorImplementationWithDefaultValues.ts] +class C { + constructor(x); + constructor(x = 1) { + var y = x; + } +} + +class D { + constructor(x); + constructor(x:T = null) { + var y = x; + } +} + +class E { + constructor(x); + constructor(x: T = null) { + var y = x; + } +} + +//// [constructorImplementationWithDefaultValues.js] +var C = (function () { + function C(x) { + if (x === void 0) { x = 1; } + var y = x; + } + return C; +})(); +var D = (function () { + function D(x) { + if (x === void 0) { x = null; } + var y = x; + } + return D; +})(); +var E = (function () { + function E(x) { + if (x === void 0) { x = null; } + var y = x; + } + return E; +})(); diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt new file mode 100644 index 0000000000000..9e25a43bec659 --- /dev/null +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts (4 errors) ==== + class C { + constructor(x); + constructor(public x: string = 1) { // error + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + var y = x; + } + } + + class D { + constructor(x: T, y: U); + constructor(x: T = 1, public y: U = x) { // error + ~~~~~~~~ +!!! Type 'number' is not assignable to type 'T'. + ~~~~~~~~~~~~~~~ +!!! Type 'T' is not assignable to type 'U'. + var z = x; + } + } + + class E { + constructor(x); + constructor(x: T = new Date()) { // error + ~~~~~~~~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'T'. + var y = x; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.js b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js new file mode 100644 index 0000000000000..217a8287f14f2 --- /dev/null +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js @@ -0,0 +1,47 @@ +//// [constructorImplementationWithDefaultValues2.ts] +class C { + constructor(x); + constructor(public x: string = 1) { // error + var y = x; + } +} + +class D { + constructor(x: T, y: U); + constructor(x: T = 1, public y: U = x) { // error + var z = x; + } +} + +class E { + constructor(x); + constructor(x: T = new Date()) { // error + var y = x; + } +} + +//// [constructorImplementationWithDefaultValues2.js] +var C = (function () { + function C(x) { + if (x === void 0) { x = 1; } + this.x = x; + var y = x; + } + return C; +})(); +var D = (function () { + function D(x, y) { + if (x === void 0) { x = 1; } + if (y === void 0) { y = x; } + this.y = y; + var z = x; + } + return D; +})(); +var E = (function () { + function E(x) { + if (x === void 0) { x = new Date(); } + var y = x; + } + return E; +})(); diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt new file mode 100644 index 0000000000000..c2021bb97f134 --- /dev/null +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/constructorInvocationWithTooFewTypeArgs.ts (1 errors) ==== + class D { + + x: T + + y: U + + } + + var d = new D(); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js new file mode 100644 index 0000000000000..e43276dfef122 --- /dev/null +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js @@ -0,0 +1,19 @@ +//// [constructorInvocationWithTooFewTypeArgs.ts] +class D { + + x: T + + y: U + +} + +var d = new D(); + + +//// [constructorInvocationWithTooFewTypeArgs.js] +var D = (function () { + function D() { + } + return D; +})(); +var d = new D(); diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt new file mode 100644 index 0000000000000..afb043e8b6481 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/constructorOverloads1.ts (3 errors) ==== + class Foo { + constructor(s: string); + constructor(n: number); + constructor(x: any) { + + } + constructor(x: any) { + ~~~~~~~~~~~~~~~~~~~~~ + + + } + ~~~~~ +!!! Multiple constructor implementations are not allowed. + bar1() { /*WScript.Echo("bar1");*/ } + bar2() { /*WScript.Echo("bar1");*/ } + } + + var f1 = new Foo("hey"); + var f2 = new Foo(0); + var f3 = new Foo(f1); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var f4 = new Foo([f1,f2,f3]); + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + f1.bar1(); + f1.bar2(); + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads1.js b/tests/baselines/reference/constructorOverloads1.js new file mode 100644 index 0000000000000..2e6dda4bd201c --- /dev/null +++ b/tests/baselines/reference/constructorOverloads1.js @@ -0,0 +1,39 @@ +//// [constructorOverloads1.ts] +class Foo { + constructor(s: string); + constructor(n: number); + constructor(x: any) { + + } + constructor(x: any) { + + } + bar1() { /*WScript.Echo("bar1");*/ } + bar2() { /*WScript.Echo("bar1");*/ } +} + +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1,f2,f3]); + +f1.bar1(); +f1.bar2(); + + +//// [constructorOverloads1.js] +var Foo = (function () { + function Foo(x) { + } + Foo.prototype.bar1 = function () { + }; + Foo.prototype.bar2 = function () { + }; + return Foo; +})(); +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1, f2, f3]); +f1.bar1(); +f1.bar2(); diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js new file mode 100644 index 0000000000000..6ab367d84346f --- /dev/null +++ b/tests/baselines/reference/constructorOverloads2.js @@ -0,0 +1,55 @@ +//// [constructorOverloads2.ts] +class FooBase { + constructor(s: string); + constructor(n: number); + constructor(x: any) { + } + bar1() { /*WScript.Echo("base bar1");*/ } +} + +class Foo extends FooBase { + constructor(s: string); + constructor(n: number); + constructor(a:any); + constructor(x: any, y?: any) { + super(x); + } + bar1() { /*WScript.Echo("bar1");*/ } +} + +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1,f2,f3]); + +f1.bar1(); + + +//// [constructorOverloads2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var FooBase = (function () { + function FooBase(x) { + } + FooBase.prototype.bar1 = function () { + }; + return FooBase; +})(); +var Foo = (function (_super) { + __extends(Foo, _super); + function Foo(x, y) { + _super.call(this, x); + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(FooBase); +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1, f2, f3]); +f1.bar1(); diff --git a/tests/baselines/reference/constructorOverloads3.errors.txt b/tests/baselines/reference/constructorOverloads3.errors.txt new file mode 100644 index 0000000000000..0e106af99dcdf --- /dev/null +++ b/tests/baselines/reference/constructorOverloads3.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/constructorOverloads3.ts (1 errors) ==== + declare class FooBase { + constructor(s: string); + constructor(n: number); + constructor(x: any); + } + + + class Foo extends FooBase { + constructor(s: string); + constructor(n: number); + constructor(a: any); + constructor(x: any, y?: any) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + bar1() { /*WScript.Echo("Yo");*/} + } + + var f1 = new Foo("hey"); + var f2 = new Foo(0); + var f3 = new Foo(f1); + var f4 = new Foo([f1,f2,f3]); + + f1.bar1(); + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js new file mode 100644 index 0000000000000..08f43cf9301e9 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads3.js @@ -0,0 +1,44 @@ +//// [constructorOverloads3.ts] +declare class FooBase { + constructor(s: string); + constructor(n: number); + constructor(x: any); +} + + + class Foo extends FooBase { + constructor(s: string); + constructor(n: number); + constructor(a: any); + constructor(x: any, y?: any) { } + bar1() { /*WScript.Echo("Yo");*/} +} + +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1,f2,f3]); + +f1.bar1(); + + +//// [constructorOverloads3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function (_super) { + __extends(Foo, _super); + function Foo(x, y) { + } + Foo.prototype.bar1 = function () { + }; + return Foo; +})(FooBase); +var f1 = new Foo("hey"); +var f2 = new Foo(0); +var f3 = new Foo(f1); +var f4 = new Foo([f1, f2, f3]); +f1.bar1(); diff --git a/tests/baselines/reference/constructorOverloads4.errors.txt b/tests/baselines/reference/constructorOverloads4.errors.txt new file mode 100644 index 0000000000000..5f46390fae1e1 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads4.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/constructorOverloads4.ts (4 errors) ==== + declare module M { + export class Function { + constructor(...args: string[]); + } + export function Function(...args: any[]): any; + ~~~~~~~~ +!!! Duplicate identifier 'Function'. + export function Function(...args: string[]): Function; + ~~~~~~~~ +!!! Duplicate identifier 'Function'. + } + + + (new M.Function("return 5"))(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + M.Function("yo"); + ~~~~~~~~~~~~~~~~ +!!! Value of type 'typeof Function' is not callable. Did you mean to include 'new'? + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads4.js b/tests/baselines/reference/constructorOverloads4.js new file mode 100644 index 0000000000000..b2a437a1b56fd --- /dev/null +++ b/tests/baselines/reference/constructorOverloads4.js @@ -0,0 +1,17 @@ +//// [constructorOverloads4.ts] +declare module M { + export class Function { + constructor(...args: string[]); + } + export function Function(...args: any[]): any; + export function Function(...args: string[]): Function; +} + + +(new M.Function("return 5"))(); +M.Function("yo"); + + +//// [constructorOverloads4.js] +(new M.Function("return 5"))(); +M.Function("yo"); diff --git a/tests/baselines/reference/constructorOverloads5.errors.txt b/tests/baselines/reference/constructorOverloads5.errors.txt new file mode 100644 index 0000000000000..706d9854e1463 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads5.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/constructorOverloads5.ts (1 errors) ==== + interface IArguments {} + + declare module M { + export function RegExp(pattern: string): RegExp; + export function RegExp(pattern: string, flags: string): RegExp; + export class RegExp { + ~~~~~~ +!!! Duplicate identifier 'RegExp'. + constructor(pattern: string); + constructor(pattern: string, flags: string); + exec(string: string): string[]; + test(string: string): boolean; + source: string; + global: boolean; + ignoreCase: boolean; + multiline: boolean; + lastIndex: boolean; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads5.js b/tests/baselines/reference/constructorOverloads5.js new file mode 100644 index 0000000000000..070ed4860ce75 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads5.js @@ -0,0 +1,21 @@ +//// [constructorOverloads5.ts] + interface IArguments {} + + declare module M { + export function RegExp(pattern: string): RegExp; + export function RegExp(pattern: string, flags: string): RegExp; + export class RegExp { + constructor(pattern: string); + constructor(pattern: string, flags: string); + exec(string: string): string[]; + test(string: string): boolean; + source: string; + global: boolean; + ignoreCase: boolean; + multiline: boolean; + lastIndex: boolean; + } +} + + +//// [constructorOverloads5.js] diff --git a/tests/baselines/reference/constructorOverloads6.errors.txt b/tests/baselines/reference/constructorOverloads6.errors.txt new file mode 100644 index 0000000000000..42256f68f8d52 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads6.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/constructorOverloads6.ts (1 errors) ==== + declare class FooBase { + constructor(s: string); + constructor(n: number); + constructor(x: any) { + ~ +!!! A constructor implementation cannot be declared in an ambient context. + + } + bar1():void; + } + + declare class Foo extends FooBase { + constructor(s: string); + constructor(n: number); + constructor(x: any, y?:any); + + bar1():void; + } + + var f1 = new Foo("hey"); + var f2 = new Foo(0); + var f3 = new Foo(f1); + var f4 = new Foo([f1,f2,f3]); + + f1.bar1(); + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads7.errors.txt b/tests/baselines/reference/constructorOverloads7.errors.txt new file mode 100644 index 0000000000000..dab93a3cc2792 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads7.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/constructorOverloads7.ts (2 errors) ==== + declare class Point + { + x: number; + y: number; + constructor(x: number, y: number); + + add(dx: number, dy: number): Point; + origin: Point; + + } + + // Type provided by extern declaration + // Because Point is a constructor function, this is inferred + // to be Point and return type is inferred to be void + function Point(x, y) { + ~~~~~ +!!! Duplicate identifier 'Point'. + this.x = x; + this.y = y; + + return this; + } + + declare function EF1(a:number, b:number):number; + ~~~ +!!! Overload signatures must all be ambient or non-ambient. + + function EF1(a,b) { return a+b; } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads7.js b/tests/baselines/reference/constructorOverloads7.js new file mode 100644 index 0000000000000..c9cd83c39e5ee --- /dev/null +++ b/tests/baselines/reference/constructorOverloads7.js @@ -0,0 +1,36 @@ +//// [constructorOverloads7.ts] +declare class Point +{ + x: number; + y: number; + constructor(x: number, y: number); + + add(dx: number, dy: number): Point; + origin: Point; + +} + +// Type provided by extern declaration +// Because Point is a constructor function, this is inferred +// to be Point and return type is inferred to be void +function Point(x, y) { + this.x = x; + this.y = y; + + return this; +} + +declare function EF1(a:number, b:number):number; + +function EF1(a,b) { return a+b; } + + +//// [constructorOverloads7.js] +function Point(x, y) { + this.x = x; + this.y = y; + return this; +} +function EF1(a, b) { + return a + b; +} diff --git a/tests/baselines/reference/constructorOverloads8.errors.txt b/tests/baselines/reference/constructorOverloads8.errors.txt new file mode 100644 index 0000000000000..15f43a432f84c --- /dev/null +++ b/tests/baselines/reference/constructorOverloads8.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/constructorOverloads8.ts (1 errors) ==== + class C { + constructor(x) { } + constructor(y, x) { } // illegal, 2 constructor implementations + ~~~~~~~~~~~~~~~~~~~~~ +!!! Multiple constructor implementations are not allowed. + } + + class D { + constructor(x: number); + constructor(y: string); // legal, overload signatures for 1 implementation + constructor(x) { } + } + + interface I { + new (x); + new (x, y); // legal, overload signatures for (presumably) 1 implementation + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloads8.js b/tests/baselines/reference/constructorOverloads8.js new file mode 100644 index 0000000000000..6fc51494abacf --- /dev/null +++ b/tests/baselines/reference/constructorOverloads8.js @@ -0,0 +1,28 @@ +//// [constructorOverloads8.ts] +class C { + constructor(x) { } + constructor(y, x) { } // illegal, 2 constructor implementations +} + +class D { + constructor(x: number); + constructor(y: string); // legal, overload signatures for 1 implementation + constructor(x) { } +} + +interface I { + new (x); + new (x, y); // legal, overload signatures for (presumably) 1 implementation +} + +//// [constructorOverloads8.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var D = (function () { + function D(x) { + } + return D; +})(); diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt new file mode 100644 index 0000000000000..f594e1762698e --- /dev/null +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts (2 errors) ==== + class C { + foo: string; + constructor(x = 1); // error + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + constructor() { + } + } + + class D { + foo: string; + constructor(x = 1); // error + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + constructor() { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.js b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js new file mode 100644 index 0000000000000..9e5ffe7388ea8 --- /dev/null +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js @@ -0,0 +1,26 @@ +//// [constructorOverloadsWithDefaultValues.ts] +class C { + foo: string; + constructor(x = 1); // error + constructor() { + } +} + +class D { + foo: string; + constructor(x = 1); // error + constructor() { + } +} + +//// [constructorOverloadsWithDefaultValues.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); diff --git a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js new file mode 100644 index 0000000000000..183bc4eda01ea --- /dev/null +++ b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js @@ -0,0 +1,26 @@ +//// [constructorOverloadsWithOptionalParameters.ts] +class C { + foo: string; + constructor(x?, y?: any[]); + constructor() { + } +} + +class D { + foo: string; + constructor(x?, y?: any[]); + constructor() { + } +} + +//// [constructorOverloadsWithOptionalParameters.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); diff --git a/tests/baselines/reference/constructorParameterProperties.errors.txt b/tests/baselines/reference/constructorParameterProperties.errors.txt new file mode 100644 index 0000000000000..b92f2fd9a8cf8 --- /dev/null +++ b/tests/baselines/reference/constructorParameterProperties.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (3 errors) ==== + class C { + y: string; + constructor(private x: string) { } + } + + var c: C; + var r = c.y; + var r2 = c.x; // error + ~~~ +!!! Property 'C.x' is inaccessible. + + class D { + y: T; + constructor(a: T, private x: T) { } + } + + var d: D; + var r = d.y; + var r2 = d.x; // error + ~~~ +!!! Property 'D.x' is inaccessible. + var r3 = d.a; // error + ~ +!!! Property 'a' does not exist on type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterProperties.js b/tests/baselines/reference/constructorParameterProperties.js new file mode 100644 index 0000000000000..3c1bed9672a6c --- /dev/null +++ b/tests/baselines/reference/constructorParameterProperties.js @@ -0,0 +1,40 @@ +//// [constructorParameterProperties.ts] +class C { + y: string; + constructor(private x: string) { } +} + +var c: C; +var r = c.y; +var r2 = c.x; // error + +class D { + y: T; + constructor(a: T, private x: T) { } +} + +var d: D; +var r = d.y; +var r2 = d.x; // error +var r3 = d.a; // error + +//// [constructorParameterProperties.js] +var C = (function () { + function C(x) { + this.x = x; + } + return C; +})(); +var c; +var r = c.y; +var r2 = c.x; +var D = (function () { + function D(a, x) { + this.x = x; + } + return D; +})(); +var d; +var r = d.y; +var r2 = d.x; +var r3 = d.a; diff --git a/tests/baselines/reference/constructorParameterProperties2.errors.txt b/tests/baselines/reference/constructorParameterProperties2.errors.txt new file mode 100644 index 0000000000000..b8b04833db80e --- /dev/null +++ b/tests/baselines/reference/constructorParameterProperties2.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (2 errors) ==== + class C { + y: number; + constructor(y: number) { } // ok + } + + var c: C; + var r = c.y; + + class D { + y: number; + constructor(public y: number) { } // error + ~ +!!! Duplicate identifier 'y'. + } + + var d: D; + var r2 = d.y; + + class E { + y: number; + constructor(private y: number) { } // error + ~ +!!! Duplicate identifier 'y'. + } + + var e: E; + var r3 = e.y; // error \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterProperties2.js b/tests/baselines/reference/constructorParameterProperties2.js new file mode 100644 index 0000000000000..50509b7b3afed --- /dev/null +++ b/tests/baselines/reference/constructorParameterProperties2.js @@ -0,0 +1,49 @@ +//// [constructorParameterProperties2.ts] +class C { + y: number; + constructor(y: number) { } // ok +} + +var c: C; +var r = c.y; + +class D { + y: number; + constructor(public y: number) { } // error +} + +var d: D; +var r2 = d.y; + +class E { + y: number; + constructor(private y: number) { } // error +} + +var e: E; +var r3 = e.y; // error + +//// [constructorParameterProperties2.js] +var C = (function () { + function C(y) { + } + return C; +})(); +var c; +var r = c.y; +var D = (function () { + function D(y) { + this.y = y; + } + return D; +})(); +var d; +var r2 = d.y; +var E = (function () { + function E(y) { + this.y = y; + } + return E; +})(); +var e; +var r3 = e.y; diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt new file mode 100644 index 0000000000000..f784cd0b8bba0 --- /dev/null +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts (3 errors) ==== + // Initializer expressions for instance member variables are evaluated in the scope of the class constructor + // body but are not permitted to reference parameters or local variables of the constructor. + // This effectively means that entities from outer scopes by the same name as a constructor parameter or + // local variable are inaccessible in initializer expressions for instance member variables + + var x = 1; + class C { + b = x; // error, evaluated in scope of constructor, cannot reference x + ~ +!!! Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. + constructor(x: string) { + x = 2; // error, x is string + ~ +!!! Type 'number' is not assignable to type 'string'. + } + } + + var y = 1; + class D { + b = y; // error, evaluated in scope of constructor, cannot reference y + ~ +!!! Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. + constructor(x: string) { + var y = ""; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js new file mode 100644 index 0000000000000..73f9d8ceda9c8 --- /dev/null +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js @@ -0,0 +1,39 @@ +//// [constructorParameterShadowsOuterScopes.ts] +// Initializer expressions for instance member variables are evaluated in the scope of the class constructor +// body but are not permitted to reference parameters or local variables of the constructor. +// This effectively means that entities from outer scopes by the same name as a constructor parameter or +// local variable are inaccessible in initializer expressions for instance member variables + +var x = 1; +class C { + b = x; // error, evaluated in scope of constructor, cannot reference x + constructor(x: string) { + x = 2; // error, x is string + } +} + +var y = 1; +class D { + b = y; // error, evaluated in scope of constructor, cannot reference y + constructor(x: string) { + var y = ""; + } +} + +//// [constructorParameterShadowsOuterScopes.js] +var x = 1; +var C = (function () { + function C(x) { + this.b = x; + x = 2; + } + return C; +})(); +var y = 1; +var D = (function () { + function D(x) { + this.b = y; + var y = ""; + } + return D; +})(); diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt b/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt new file mode 100644 index 0000000000000..4afccf82d9307 --- /dev/null +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/constructorParametersInVariableDeclarations.ts (6 errors) ==== + class A { + private a = x; + ~ +!!! Cannot find name 'x'. + private b = { p: x }; + ~ +!!! Cannot find name 'x'. + private c = () => x; + ~ +!!! Cannot find name 'x'. + constructor(x: number) { + } + } + + class B { + private a = x; + ~ +!!! Cannot find name 'x'. + private b = { p: x }; + ~ +!!! Cannot find name 'x'. + private c = () => x; + ~ +!!! Cannot find name 'x'. + constructor() { + var x = 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.js b/tests/baselines/reference/constructorParametersInVariableDeclarations.js new file mode 100644 index 0000000000000..984c8c392b133 --- /dev/null +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.js @@ -0,0 +1,36 @@ +//// [constructorParametersInVariableDeclarations.ts] +class A { + private a = x; + private b = { p: x }; + private c = () => x; + constructor(x: number) { + } +} + +class B { + private a = x; + private b = { p: x }; + private c = () => x; + constructor() { + var x = 1; + } +} + +//// [constructorParametersInVariableDeclarations.js] +var A = (function () { + function A(x) { + this.a = x; + this.b = { p: x }; + this.c = function () { return x; }; + } + return A; +})(); +var B = (function () { + function B() { + this.a = x; + this.b = { p: x }; + this.c = function () { return x; }; + var x = 1; + } + return B; +})(); diff --git a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt new file mode 100644 index 0000000000000..92619b68154a4 --- /dev/null +++ b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/constructorParametersThatShadowExternalNamesInVariableDeclarations.ts (2 errors) ==== + var x = 1; + class A { + private a = x; + ~ +!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. + constructor(x: number) { + } + } + + class B { + private a = x; + ~ +!!! Initializer of instance member variable 'a' cannot reference identifier 'x' declared in the constructor. + constructor() { + var x = ""; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js new file mode 100644 index 0000000000000..9e86b185fbdc0 --- /dev/null +++ b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js @@ -0,0 +1,30 @@ +//// [constructorParametersThatShadowExternalNamesInVariableDeclarations.ts] +var x = 1; +class A { + private a = x; + constructor(x: number) { + } +} + +class B { + private a = x; + constructor() { + var x = ""; + } +} + +//// [constructorParametersThatShadowExternalNamesInVariableDeclarations.js] +var x = 1; +var A = (function () { + function A(x) { + this.a = x; + } + return A; +})(); +var B = (function () { + function B() { + this.a = x; + var x = ""; + } + return B; +})(); diff --git a/tests/baselines/reference/constructorReturningAPrimitive.js b/tests/baselines/reference/constructorReturningAPrimitive.js new file mode 100644 index 0000000000000..6e39c0c95e8d2 --- /dev/null +++ b/tests/baselines/reference/constructorReturningAPrimitive.js @@ -0,0 +1,37 @@ +//// [constructorReturningAPrimitive.ts] +// technically not allowed by JavaScript but we don't have a 'not-primitive' constraint +// functionally only possible when your class is otherwise devoid of members so of little consequence in practice + +class A { + constructor() { + return 1; + } +} + +var a = new A(); + +class B { + constructor() { + var x: T; + return x; + } +} + +var b = new B(); + +//// [constructorReturningAPrimitive.js] +var A = (function () { + function A() { + return 1; + } + return A; +})(); +var a = new A(); +var B = (function () { + function B() { + var x; + return x; + } + return B; +})(); +var b = new B(); diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt new file mode 100644 index 0000000000000..fb2ac126a9138 --- /dev/null +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/constructorReturnsInvalidType.ts (1 errors) ==== + class X { + constructor() { + return 1; + ~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + foo() { } + } + + var x = new X(); + \ No newline at end of file diff --git a/tests/baselines/reference/constructorReturnsInvalidType.js b/tests/baselines/reference/constructorReturnsInvalidType.js new file mode 100644 index 0000000000000..92afb41a3fe36 --- /dev/null +++ b/tests/baselines/reference/constructorReturnsInvalidType.js @@ -0,0 +1,21 @@ +//// [constructorReturnsInvalidType.ts] +class X { + constructor() { + return 1; + } + foo() { } +} + +var x = new X(); + + +//// [constructorReturnsInvalidType.js] +var X = (function () { + function X() { + return 1; + } + X.prototype.foo = function () { + }; + return X; +})(); +var x = new X(); diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js new file mode 100644 index 0000000000000..e269b64684a6a --- /dev/null +++ b/tests/baselines/reference/constructorStaticParamName.js @@ -0,0 +1,14 @@ +//// [constructorStaticParamName.ts] +// static as constructor parameter name should only give error if 'use strict' + +class test { + constructor (static) { } +} + + +//// [constructorStaticParamName.js] +var test = (function () { + function test(static) { + } + return test; +})(); diff --git a/tests/baselines/reference/constructorStaticParamNameErrors.js b/tests/baselines/reference/constructorStaticParamNameErrors.js new file mode 100644 index 0000000000000..0db6b5aa9959d --- /dev/null +++ b/tests/baselines/reference/constructorStaticParamNameErrors.js @@ -0,0 +1,14 @@ +//// [constructorStaticParamNameErrors.ts] +'use strict' +// static as constructor parameter name should give error if 'use strict' +class test { + constructor (static) { } +} + +//// [constructorStaticParamNameErrors.js] +'use strict'; +var test = (function () { + function test(static) { + } + return test; +})(); diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.js b/tests/baselines/reference/constructorTypeWithTypeParameters.js new file mode 100644 index 0000000000000..3c20b6ffa6882 --- /dev/null +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.js @@ -0,0 +1,14 @@ +//// [constructorTypeWithTypeParameters.ts] +declare var X: { + new (): number; +} +declare var Y: { + new (): number; +} +var anotherVar: new () => number; + +//// [constructorTypeWithTypeParameters.js] +var anotherVar; + + +//// [constructorTypeWithTypeParameters.d.ts] diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt new file mode 100644 index 0000000000000..9fc3143551547 --- /dev/null +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (2 errors) ==== + // a class constructor may return an expression, it must be assignable to the class instance type to be valid + + class C { + constructor() { + return 1; + } + } + + class D { + x: number; + constructor() { + return 1; // error + ~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class E { + x: number; + constructor() { + return { x: 1 }; + } + } + + class F { + x: T; + constructor() { + return { x: 1 }; // error + ~~~~~~~~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class G { + x: T; + constructor() { + return { x: null }; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.js b/tests/baselines/reference/constructorWithAssignableReturnExpression.js new file mode 100644 index 0000000000000..2a2a16004e8d9 --- /dev/null +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.js @@ -0,0 +1,68 @@ +//// [constructorWithAssignableReturnExpression.ts] +// a class constructor may return an expression, it must be assignable to the class instance type to be valid + +class C { + constructor() { + return 1; + } +} + +class D { + x: number; + constructor() { + return 1; // error + } +} + +class E { + x: number; + constructor() { + return { x: 1 }; + } +} + +class F { + x: T; + constructor() { + return { x: 1 }; // error + } +} + +class G { + x: T; + constructor() { + return { x: null }; + } +} + +//// [constructorWithAssignableReturnExpression.js] +var C = (function () { + function C() { + return 1; + } + return C; +})(); +var D = (function () { + function D() { + return 1; + } + return D; +})(); +var E = (function () { + function E() { + return { x: 1 }; + } + return E; +})(); +var F = (function () { + function F() { + return { x: 1 }; + } + return F; +})(); +var G = (function () { + function G() { + return { x: null }; + } + return G; +})(); diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.js b/tests/baselines/reference/constructorWithExpressionLessReturn.js new file mode 100644 index 0000000000000..c0074bdecfbde --- /dev/null +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.js @@ -0,0 +1,53 @@ +//// [constructorWithExpressionLessReturn.ts] +class C { + constructor() { + return; + } +} + +class D { + x: number; + constructor() { + return; + } +} + +class E { + constructor(public x: number) { + return; + } +} + +class F { + constructor(public x: T) { + return; + } +} + +//// [constructorWithExpressionLessReturn.js] +var C = (function () { + function C() { + return; + } + return C; +})(); +var D = (function () { + function D() { + return; + } + return D; +})(); +var E = (function () { + function E(x) { + this.x = x; + return; + } + return E; +})(); +var F = (function () { + function F(x) { + this.x = x; + return; + } + return F; +})(); diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt b/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt new file mode 100644 index 0000000000000..d7ba7dcf92b83 --- /dev/null +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/compiler/constructorsWithSpecializedSignatures.ts (8 errors) ==== + // errors + declare class C { + constructor(x: "hi"); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + constructor(x: "foo"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + constructor(x: number); + } + + // ok + declare class C2 { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: string); + } + + // errors + class D { + constructor(x: "hi"); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + constructor(x: "foo"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + constructor(x: number); + constructor(x: "hi") { } + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + } + + // overloads are ok + class D2 { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: string); + constructor(x: "hi") { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + } + + // errors + interface I { + new (x: "hi"); + ~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + new (x: "foo"); + ~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + new (x: number); + } + + // ok + interface I2 { + new (x: "hi"); + new (x: "foo"); + new (x: string); + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.js b/tests/baselines/reference/constructorsWithSpecializedSignatures.js new file mode 100644 index 0000000000000..771acaa67ca23 --- /dev/null +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.js @@ -0,0 +1,56 @@ +//// [constructorsWithSpecializedSignatures.ts] +// errors +declare class C { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: number); +} + +// ok +declare class C2 { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: string); +} + +// errors +class D { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: number); + constructor(x: "hi") { } +} + +// overloads are ok +class D2 { + constructor(x: "hi"); + constructor(x: "foo"); + constructor(x: string); + constructor(x: "hi") { } // error +} + +// errors +interface I { + new (x: "hi"); + new (x: "foo"); + new (x: number); +} + +// ok +interface I2 { + new (x: "hi"); + new (x: "foo"); + new (x: string); +} + +//// [constructorsWithSpecializedSignatures.js] +var D = (function () { + function D(x) { + } + return D; +})(); +var D2 = (function () { + function D2(x) { + } + return D2; +})(); diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.js b/tests/baselines/reference/contextualSigInstantiationRestParams.js new file mode 100644 index 0000000000000..24d0d63ef7a74 --- /dev/null +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.js @@ -0,0 +1,8 @@ +//// [contextualSigInstantiationRestParams.ts] +declare function toInstantiate(a?: A, b?: B): B; +declare function contextual(...s: string[]): string + +var sig: typeof contextual = toInstantiate; + +//// [contextualSigInstantiationRestParams.js] +var sig = toInstantiate; diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.js b/tests/baselines/reference/contextualSignatureInstantiation1.js new file mode 100644 index 0000000000000..ea83871d44548 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation1.js @@ -0,0 +1,14 @@ +//// [contextualSignatureInstantiation1.ts] +declare function map(f: (x: S) => T): (a: S[]) => T[]; +var e = (x: string, y?: K) => x.length; +var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed + +declare function map2(f: (x: S) => T): (a: S[]) => T[]; +var e2 = (x: string, y?: K) => x.length; +var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } + +//// [contextualSignatureInstantiation1.js] +var e = function (x, y) { return x.length; }; +var r99 = map(e); +var e2 = function (x, y) { return x.length; }; +var r100 = map2(e2); diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.js b/tests/baselines/reference/contextualSignatureInstantiation2.js new file mode 100644 index 0000000000000..c88467d9fb301 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation2.js @@ -0,0 +1,12 @@ +//// [contextualSignatureInstantiation2.ts] +// dot f g x = f(g(x)) +var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; +dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); +var id: (x:T) => T; +var r23 = dot(id)(id); + +//// [contextualSignatureInstantiation2.js] +var dot; +dot = function (f) { return function (g) { return function (x) { return f(g(x)); }; }; }; +var id; +var r23 = dot(id)(id); diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js new file mode 100644 index 0000000000000..eb6213f381ceb --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js @@ -0,0 +1,17 @@ +//// [contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts] +function f() { + function g(u: U): U { return null } + return g; +} +var h: (v: V, func: (v: V) => W) => W; +var x = h("", f()); // Call should succeed and x should be string. All type parameters should be instantiated to string + +//// [contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js] +function f() { + function g(u) { + return null; + } + return g; +} +var h; +var x = h("", f()); diff --git a/tests/baselines/reference/contextualSignatureInstatiationContravariance.js b/tests/baselines/reference/contextualSignatureInstatiationContravariance.js new file mode 100644 index 0000000000000..f2ea802c81ec1 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationContravariance.js @@ -0,0 +1,19 @@ +//// [contextualSignatureInstatiationContravariance.ts] +interface Animal { x } +interface Giraffe extends Animal { y } +interface Elephant extends Animal { y2 } + +var f2: (x: T, y: T) => void; + +var g2: (g: Giraffe, e: Elephant) => void; +g2 = f2; // valid because both Giraffe and Elephant satisfy the constraint. T is Animal + +var h2: (g1: Giraffe, g2: Giraffe) => void; +h2 = f2; // valid because Giraffe satisfies the constraint. It is safe in the traditional contravariant fashion. + +//// [contextualSignatureInstatiationContravariance.js] +var f2; +var g2; +g2 = f2; +var h2; +h2 = f2; diff --git a/tests/baselines/reference/contextualSignatureInstatiationCovariance.js b/tests/baselines/reference/contextualSignatureInstatiationCovariance.js new file mode 100644 index 0000000000000..c766c43e5105c --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationCovariance.js @@ -0,0 +1,19 @@ +//// [contextualSignatureInstatiationCovariance.ts] +interface Animal { x } +interface TallThing { x2 } +interface Giraffe extends Animal, TallThing { y } + +var f2: (x: T, y: T) => void; + +var g2: (a: Animal, t: TallThing) => void; +g2 = f2; // While neither Animal nor TallThing satisfy the constraint, T is at worst a Giraffe and compatible with both via covariance. + +var h2: (a1: Animal, a2: Animal) => void; +h2 = f2; // Animal does not satisfy the constraint, but T is at worst a Giraffe and compatible with Animal via covariance. + +//// [contextualSignatureInstatiationCovariance.js] +var f2; +var g2; +g2 = f2; +var h2; +h2 = f2; diff --git a/tests/baselines/reference/contextualTypeAny.js b/tests/baselines/reference/contextualTypeAny.js new file mode 100644 index 0000000000000..a88b353a89066 --- /dev/null +++ b/tests/baselines/reference/contextualTypeAny.js @@ -0,0 +1,11 @@ +//// [contextualTypeAny.ts] +var x: any; + +var obj: { [s: string]: number } = { p: "", q: x }; + +var arr: number[] = ["", x]; + +//// [contextualTypeAny.js] +var x; +var obj = { p: "", q: x }; +var arr = ["", x]; diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js new file mode 100644 index 0000000000000..c4e78318a9ce3 --- /dev/null +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js @@ -0,0 +1,34 @@ +//// [contextualTypeAppliedToVarArgs.ts] +function delegate(instance: any, method: (...args: any[]) => any, data?: any): (...args: any[]) => any { + return function () { }; +} + +class Foo{ + + + Bar() { + delegate(this, function (source, args2) + { + var a = source.node; + var b = args2.node; + } ); + } +} + + +//// [contextualTypeAppliedToVarArgs.js] +function delegate(instance, method, data) { + return function () { + }; +} +var Foo = (function () { + function Foo() { + } + Foo.prototype.Bar = function () { + delegate(this, function (source, args2) { + var a = source.node; + var b = args2.node; + }); + }; + return Foo; +})(); diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.js b/tests/baselines/reference/contextualTypeArrayReturnType.js new file mode 100644 index 0000000000000..adc568d52301d --- /dev/null +++ b/tests/baselines/reference/contextualTypeArrayReturnType.js @@ -0,0 +1,30 @@ +//// [contextualTypeArrayReturnType.ts] +interface IBookStyle { + initialLeftPageTransforms?: (width: number) => NamedTransform[]; +} + +interface NamedTransform { + [name: string]: Transform3D; +} + +interface Transform3D { + cachedCss: string; +} + +var style: IBookStyle = { + initialLeftPageTransforms: (width: number) => { + return [ + {'ry': null } + ]; + } +} + + +//// [contextualTypeArrayReturnType.js] +var style = { + initialLeftPageTransforms: function (width) { + return [ + { 'ry': null } + ]; + } +}; diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt new file mode 100644 index 0000000000000..8bcde91e32422 --- /dev/null +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -0,0 +1,238 @@ +==== tests/cases/compiler/contextualTyping.ts (3 errors) ==== + // DEFAULT INTERFACES + interface IFoo { + n: number; + s: string; + f(i: number, s: string): string; + a: number[]; + } + + interface IBar { + foo: IFoo; + } + + // CONTEXT: Class property declaration + class C1T5 { + foo: (i: number, s: string) => number = function(i) { + return i; + } + } + + // CONTEXT: Module property declaration + module C2T5 { + export var foo: (i: number, s: string) => number = function(i) { + return i; + } + } + + // CONTEXT: Variable declaration + var c3t1: (s: string) => string = (function(s) { return s }); + var c3t2 = ({ + n: 1 + }) + var c3t3: number[] = []; + var c3t4: () => IFoo = function() { return ({}) }; + var c3t5: (n: number) => IFoo = function(n) { return ({}) }; + var c3t6: (n: number, s: string) => IFoo = function(n, s) { return ({}) }; + var c3t7: { + (n: number): number; + (s1: string): number; + } = function(n) { return n; }; + + var c3t8: (n: number, s: string) => number = function(n) { return n; }; + var c3t9: number[][] = [[],[]]; + var c3t10: IFoo[] = [({}),({})]; + var c3t11: {(n: number, s: string): string;}[] = [function(n, s) { return s; }]; + var c3t12: IBar = { + foo: ({}) + } + var c3t13 = ({ + f: function(i, s) { return s; } + }) + var c3t14 = ({ + a: [] + }) + + // CONTEXT: Class property assignment + class C4T5 { + foo: (i: number, s: string) => string; + constructor() { + this.foo = function(i, s) { + return s; + } + } + } + + // CONTEXT: Module property assignment + module C5T5 { + export var foo: (i: number, s: string) => string; + foo = function(i, s) { + return s; + } + } + + // CONTEXT: Variable assignment + var c6t5: (n: number) => IFoo; + c6t5 = <(n: number) => IFoo>function(n) { return ({}) }; + + // CONTEXT: Array index assignment + var c7t2: IFoo[]; + c7t2[0] = ({n: 1}); + + // CONTEXT: Object property assignment + interface IPlaceHolder { + t1: (s: string) => string; + t2: IFoo; + t3: number[]; + t4: () => IFoo; + t5: (n: number) => IFoo; + t6: (n: number, s: string) => IFoo; + t7: { + (n: number, s: string): number; + //(s1: string, s2: string): number; + }; + t8: (n: number, s: string) => number; + t9: number[][]; + t10: IFoo[]; + t11: {(n: number, s: string): string;}[]; + t12: IBar; + t13: IFoo; + t14: IFoo; + } + + var objc8: { + t1: (s: string) => string; + t2: IFoo; + t3: number[]; + t4: () => IFoo; + t5: (n: number) => IFoo; + t6: (n: number, s: string) => IFoo; + t7: { + (n: number, s: string): number; + //(s1: string, s2: string): number; + }; + t8: (n: number, s: string) => number; + t9: number[][]; + t10: IFoo[]; + t11: {(n: number, s: string): string;}[]; + t12: IBar; + t13: IFoo; + t14: IFoo; + } = ({}); + + objc8.t1 = (function(s) { return s }); + objc8.t2 = ({ + n: 1 + }); + objc8.t3 = []; + objc8.t4 = function() { return ({}) }; + objc8.t5 = function(n) { return ({}) }; + objc8.t6 = function(n, s) { return ({}) }; + objc8.t7 = function(n: number) { return n }; + + objc8.t8 = function(n) { return n; }; + objc8.t9 = [[],[]]; + objc8.t10 = [({}),({})]; + objc8.t11 = [function(n, s) { return s; }]; + objc8.t12 = { + foo: ({}) + } + objc8.t13 = ({ + f: function(i, s) { return s; } + }) + objc8.t14 = ({ + a: [] + }) + // CONTEXT: Function call + function c9t5(f: (n: number) => IFoo) {}; + c9t5(function(n) { + return ({}); + }); + + // CONTEXT: Return statement + var c10t5: () => (n: number) => IFoo = function() { return function(n) { return ({}) } }; + + // CONTEXT: Newing a class + class C11t5 { constructor(f: (n: number) => IFoo) { } }; + var i = new C11t5(function(n) { return ({}) }); + + // CONTEXT: Type annotated expression + var c12t1 = <(s: string) => string> (function(s) { return s }); + var c12t2 = ({ + n: 1 + }); + var c12t3 = []; + var c12t4 = <() => IFoo> function() { return ({}) }; + var c12t5 = <(n: number) => IFoo> function(n) { return ({}) }; + var c12t6 = <(n: number, s: string) => IFoo> function(n, s) { return ({}) }; + var c12t7 = <{ + (n: number, s: string): number; + //(s1: string, s2: string): number; + }> function(n:number) { return n }; + + var c12t8 = <(n: number, s: string) => number> function(n) { return n; }; + var c12t9 = [[],[]]; + var c12t10 = [({}),({})]; + var c12t11 = <{(n: number, s: string): string;}[]> [function(n, s) { return s; }]; + var c12t12 = { + foo: ({}) + } + var c12t13 = ({ + f: function(i, s) { return s; } + }) + var c12t14 = ({ + a: [] + }) + + // CONTEXT: Contextual typing declarations + + // contextually typing function declarations + declare function EF1(a:number, b:number):number; + ~~~ +!!! Overload signatures must all be ambient or non-ambient. + + function EF1(a,b) { return a+b; } + + var efv = EF1(1,2); + + + // contextually typing from ambient class declarations + declare class Point + { + constructor(x: number, y: number); + x: number; + y: number; + add(dx: number, dy: number): Point; + static origin: Point; + + } + + function Point(x, y) { + ~~~~~ +!!! Duplicate identifier 'Point'. + this.x = x; + this.y = y; + + return this; + } + + Point.origin = new Point(0, 0); + + Point.prototype.add = function(dx, dy) { + return new Point(this.x + dx, this.y + dy); + }; + + Point.prototype = { + x: 0, + y: 0, + add: function(dx, dy) { + return new Point(this.x + dx, this.y + dy); + } + }; + + interface A { x: string; } + interface B extends A { } + var x: B = { }; + ~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'B': +!!! Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.js b/tests/baselines/reference/contextualTyping.js new file mode 100644 index 0000000000000..91874ac9e7bc2 --- /dev/null +++ b/tests/baselines/reference/contextualTyping.js @@ -0,0 +1,425 @@ +//// [contextualTyping.ts] +// DEFAULT INTERFACES +interface IFoo { + n: number; + s: string; + f(i: number, s: string): string; + a: number[]; +} + +interface IBar { + foo: IFoo; +} + +// CONTEXT: Class property declaration +class C1T5 { + foo: (i: number, s: string) => number = function(i) { + return i; + } +} + +// CONTEXT: Module property declaration +module C2T5 { + export var foo: (i: number, s: string) => number = function(i) { + return i; + } +} + +// CONTEXT: Variable declaration +var c3t1: (s: string) => string = (function(s) { return s }); +var c3t2 = ({ + n: 1 +}) +var c3t3: number[] = []; +var c3t4: () => IFoo = function() { return ({}) }; +var c3t5: (n: number) => IFoo = function(n) { return ({}) }; +var c3t6: (n: number, s: string) => IFoo = function(n, s) { return ({}) }; +var c3t7: { + (n: number): number; + (s1: string): number; +} = function(n) { return n; }; + +var c3t8: (n: number, s: string) => number = function(n) { return n; }; +var c3t9: number[][] = [[],[]]; +var c3t10: IFoo[] = [({}),({})]; +var c3t11: {(n: number, s: string): string;}[] = [function(n, s) { return s; }]; +var c3t12: IBar = { + foo: ({}) +} +var c3t13 = ({ + f: function(i, s) { return s; } +}) +var c3t14 = ({ + a: [] +}) + +// CONTEXT: Class property assignment +class C4T5 { + foo: (i: number, s: string) => string; + constructor() { + this.foo = function(i, s) { + return s; + } + } +} + +// CONTEXT: Module property assignment +module C5T5 { + export var foo: (i: number, s: string) => string; + foo = function(i, s) { + return s; + } +} + +// CONTEXT: Variable assignment +var c6t5: (n: number) => IFoo; +c6t5 = <(n: number) => IFoo>function(n) { return ({}) }; + +// CONTEXT: Array index assignment +var c7t2: IFoo[]; +c7t2[0] = ({n: 1}); + +// CONTEXT: Object property assignment +interface IPlaceHolder { + t1: (s: string) => string; + t2: IFoo; + t3: number[]; + t4: () => IFoo; + t5: (n: number) => IFoo; + t6: (n: number, s: string) => IFoo; + t7: { + (n: number, s: string): number; + //(s1: string, s2: string): number; + }; + t8: (n: number, s: string) => number; + t9: number[][]; + t10: IFoo[]; + t11: {(n: number, s: string): string;}[]; + t12: IBar; + t13: IFoo; + t14: IFoo; + } + +var objc8: { + t1: (s: string) => string; + t2: IFoo; + t3: number[]; + t4: () => IFoo; + t5: (n: number) => IFoo; + t6: (n: number, s: string) => IFoo; + t7: { + (n: number, s: string): number; + //(s1: string, s2: string): number; + }; + t8: (n: number, s: string) => number; + t9: number[][]; + t10: IFoo[]; + t11: {(n: number, s: string): string;}[]; + t12: IBar; + t13: IFoo; + t14: IFoo; +} = ({}); + +objc8.t1 = (function(s) { return s }); +objc8.t2 = ({ + n: 1 +}); +objc8.t3 = []; +objc8.t4 = function() { return ({}) }; +objc8.t5 = function(n) { return ({}) }; +objc8.t6 = function(n, s) { return ({}) }; +objc8.t7 = function(n: number) { return n }; + +objc8.t8 = function(n) { return n; }; +objc8.t9 = [[],[]]; +objc8.t10 = [({}),({})]; +objc8.t11 = [function(n, s) { return s; }]; +objc8.t12 = { + foo: ({}) +} +objc8.t13 = ({ + f: function(i, s) { return s; } +}) +objc8.t14 = ({ + a: [] +}) +// CONTEXT: Function call +function c9t5(f: (n: number) => IFoo) {}; +c9t5(function(n) { + return ({}); +}); + +// CONTEXT: Return statement +var c10t5: () => (n: number) => IFoo = function() { return function(n) { return ({}) } }; + +// CONTEXT: Newing a class +class C11t5 { constructor(f: (n: number) => IFoo) { } }; +var i = new C11t5(function(n) { return ({}) }); + +// CONTEXT: Type annotated expression +var c12t1 = <(s: string) => string> (function(s) { return s }); +var c12t2 = ({ + n: 1 +}); +var c12t3 = []; +var c12t4 = <() => IFoo> function() { return ({}) }; +var c12t5 = <(n: number) => IFoo> function(n) { return ({}) }; +var c12t6 = <(n: number, s: string) => IFoo> function(n, s) { return ({}) }; +var c12t7 = <{ + (n: number, s: string): number; + //(s1: string, s2: string): number; +}> function(n:number) { return n }; + +var c12t8 = <(n: number, s: string) => number> function(n) { return n; }; +var c12t9 = [[],[]]; +var c12t10 = [({}),({})]; +var c12t11 = <{(n: number, s: string): string;}[]> [function(n, s) { return s; }]; +var c12t12 = { + foo: ({}) +} +var c12t13 = ({ + f: function(i, s) { return s; } +}) +var c12t14 = ({ + a: [] +}) + +// CONTEXT: Contextual typing declarations + +// contextually typing function declarations +declare function EF1(a:number, b:number):number; + +function EF1(a,b) { return a+b; } + +var efv = EF1(1,2); + + +// contextually typing from ambient class declarations +declare class Point +{ + constructor(x: number, y: number); + x: number; + y: number; + add(dx: number, dy: number): Point; + static origin: Point; + +} + +function Point(x, y) { + this.x = x; + this.y = y; + + return this; +} + +Point.origin = new Point(0, 0); + +Point.prototype.add = function(dx, dy) { + return new Point(this.x + dx, this.y + dy); +}; + +Point.prototype = { + x: 0, + y: 0, + add: function(dx, dy) { + return new Point(this.x + dx, this.y + dy); + } +}; + +interface A { x: string; } +interface B extends A { } +var x: B = { }; + +//// [contextualTyping.js] +var C1T5 = (function () { + function C1T5() { + this.foo = function (i) { + return i; + }; + } + return C1T5; +})(); +var C2T5; +(function (C2T5) { + C2T5.foo = function (i) { + return i; + }; +})(C2T5 || (C2T5 = {})); +var c3t1 = (function (s) { + return s; +}); +var c3t2 = ({ + n: 1 +}); +var c3t3 = []; +var c3t4 = function () { + return ({}); +}; +var c3t5 = function (n) { + return ({}); +}; +var c3t6 = function (n, s) { + return ({}); +}; +var c3t7 = function (n) { + return n; +}; +var c3t8 = function (n) { + return n; +}; +var c3t9 = [[], []]; +var c3t10 = [({}), ({})]; +var c3t11 = [function (n, s) { + return s; +}]; +var c3t12 = { + foo: ({}) +}; +var c3t13 = ({ + f: function (i, s) { + return s; + } +}); +var c3t14 = ({ + a: [] +}); +var C4T5 = (function () { + function C4T5() { + this.foo = function (i, s) { + return s; + }; + } + return C4T5; +})(); +var C5T5; +(function (C5T5) { + C5T5.foo; + C5T5.foo = function (i, s) { + return s; + }; +})(C5T5 || (C5T5 = {})); +var c6t5; +c6t5 = function (n) { + return ({}); +}; +var c7t2; +c7t2[0] = ({ n: 1 }); +var objc8 = ({}); +objc8.t1 = (function (s) { + return s; +}); +objc8.t2 = ({ + n: 1 +}); +objc8.t3 = []; +objc8.t4 = function () { + return ({}); +}; +objc8.t5 = function (n) { + return ({}); +}; +objc8.t6 = function (n, s) { + return ({}); +}; +objc8.t7 = function (n) { + return n; +}; +objc8.t8 = function (n) { + return n; +}; +objc8.t9 = [[], []]; +objc8.t10 = [({}), ({})]; +objc8.t11 = [function (n, s) { + return s; +}]; +objc8.t12 = { + foo: ({}) +}; +objc8.t13 = ({ + f: function (i, s) { + return s; + } +}); +objc8.t14 = ({ + a: [] +}); +function c9t5(f) { +} +; +c9t5(function (n) { + return ({}); +}); +var c10t5 = function () { + return function (n) { + return ({}); + }; +}; +var C11t5 = (function () { + function C11t5(f) { + } + return C11t5; +})(); +; +var i = new C11t5(function (n) { + return ({}); +}); +var c12t1 = (function (s) { + return s; +}); +var c12t2 = ({ + n: 1 +}); +var c12t3 = []; +var c12t4 = function () { + return ({}); +}; +var c12t5 = function (n) { + return ({}); +}; +var c12t6 = function (n, s) { + return ({}); +}; +var c12t7 = function (n) { + return n; +}; +var c12t8 = function (n) { + return n; +}; +var c12t9 = [[], []]; +var c12t10 = [({}), ({})]; +var c12t11 = [function (n, s) { + return s; +}]; +var c12t12 = { + foo: ({}) +}; +var c12t13 = ({ + f: function (i, s) { + return s; + } +}); +var c12t14 = ({ + a: [] +}); +function EF1(a, b) { + return a + b; +} +var efv = EF1(1, 2); +function Point(x, y) { + this.x = x; + this.y = y; + return this; +} +Point.origin = new Point(0, 0); +Point.prototype.add = function (dx, dy) { + return new Point(this.x + dx, this.y + dy); +}; +Point.prototype = { + x: 0, + y: 0, + add: function (dx, dy) { + return new Point(this.x + dx, this.y + dy); + } +}; +var x = {}; +//# sourceMappingURL=contextualTyping.js.map \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.js.map b/tests/baselines/reference/contextualTyping.js.map new file mode 100644 index 0000000000000..ec75015e5b005 --- /dev/null +++ b/tests/baselines/reference/contextualTyping.js.map @@ -0,0 +1,2 @@ +//// [contextualTyping.js.map] +{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":["C1T5","C1T5.constructor","C2T5","C4T5","C4T5.constructor","C5T5","c9t5","C11t5","C11t5.constructor","EF1","Point"],"mappings":"AAaA,IAAM,IAAI;IAAVA,SAAMA,IAAIA;QACNC,QAAGA,GAAqCA,UAASA,CAACA;YAC9C,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IAADD,WAACA;AAADA,CAACA,AAJD,IAIC;AAGD,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAGA,GAAqCA,UAASA,CAACA;QACzD,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EAJM,IAAI,KAAJ,IAAI,QAIV;AAGD,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAGF,IAAM,IAAI;IAENC,SAFEA,IAAIA;QAGFC,IAAIA,CAACA,GAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;YACpB,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAAA;IACLA,CAACA;IACLD,WAACA;AAADA,CAACA,AAPD,IAOC;AAGD,IAAO,IAAI,CAKV;AALD,WAAO,IAAI,EAAC,CAAC;IACEE,QAAqCA,CAACA;IACjDA,QAAGA,GAAGA,UAASA,CAACA,EAAEA,CAACA;QACf,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAAA;AACLA,CAACA,EALM,IAAI,KAAJ,IAAI,QAKV;AAGD,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAG9D,IAAI,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,SAAS,IAAI,CAAC,CAAsB;AAAGC,CAACA;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,MAAM,CAAO,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAGH,IAAI,KAAK,GAA8B;IAAa,MAAM,CAAC,UAAS,CAAC;QAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;IAAC,CAAC,CAAA;AAAC,CAAC,CAAC;AAG/F,IAAM,KAAK;IAAGC,SAARA,KAAKA,CAAeA,CAAsBA;IAAIC,CAACA;IAACD,YAACA;AAADA,CAACA,AAAvD,IAAuD;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC,CAAC;AAGrD,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB;IAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA;AAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ;IAAI,MAAM,CAAC,CAAC,CAAA;AAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC;IAAI,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC;QAAI,MAAM,CAAC,CAAC,CAAC;IAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,SAAS,GAAG,CAAC,CAAC,EAAC,CAAC;IAAIE,MAAMA,CAACA,CAACA,GAACA,CAACA,CAACA;AAACA,CAACA;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;IACfC,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IACXA,IAAIA,CAACA,CAACA,GAAGA,CAACA,CAACA;IAEXA,MAAMA,CAACA,IAAIA,CAACA;AAChBA,CAACA;AAED,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.sourcemap.txt b/tests/baselines/reference/contextualTyping.sourcemap.txt new file mode 100644 index 0000000000000..7a9af9bb8ee23 --- /dev/null +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -0,0 +1,3774 @@ +=================================================================== +JsFile: contextualTyping.js +mapUrl: contextualTyping.js.map +sourceRoot: +sources: contextualTyping.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/contextualTyping.js +sourceFile:contextualTyping.ts +------------------------------------------------------------------- +>>>var C1T5 = (function () { +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^-> +1 >// DEFAULT INTERFACES + >interface IFoo { + > n: number; + > s: string; + > f(i: number, s: string): string; + > a: number[]; + >} + > + >interface IBar { + > foo: IFoo; + >} + > + >// CONTEXT: Class property declaration + > +2 >class +3 > C1T5 +1 >Emitted(1, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(14, 7) + SourceIndex(0) +3 >Emitted(1, 9) Source(14, 11) + SourceIndex(0) +--- +>>> function C1T5() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^-> +1-> +2 > class +3 > C1T5 +1->Emitted(2, 5) Source(14, 1) + SourceIndex(0) name (C1T5) +2 >Emitted(2, 14) Source(14, 7) + SourceIndex(0) name (C1T5) +3 >Emitted(2, 18) Source(14, 11) + SourceIndex(0) name (C1T5) +--- +>>> this.foo = function (i) { +1->^^^^^^^^ +2 > ^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^ +1-> { + > +2 > foo +3 > : (i: number, s: string) => number = +4 > function( +5 > i +1->Emitted(3, 9) Source(15, 5) + SourceIndex(0) name (C1T5.constructor) +2 >Emitted(3, 17) Source(15, 8) + SourceIndex(0) name (C1T5.constructor) +3 >Emitted(3, 20) Source(15, 45) + SourceIndex(0) name (C1T5.constructor) +4 >Emitted(3, 30) Source(15, 54) + SourceIndex(0) name (C1T5.constructor) +5 >Emitted(3, 31) Source(15, 55) + SourceIndex(0) name (C1T5.constructor) +--- +>>> return i; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { + > +2 > return +3 > +4 > i +5 > ; +1 >Emitted(4, 13) Source(16, 9) + SourceIndex(0) +2 >Emitted(4, 19) Source(16, 15) + SourceIndex(0) +3 >Emitted(4, 20) Source(16, 16) + SourceIndex(0) +4 >Emitted(4, 21) Source(16, 17) + SourceIndex(0) +5 >Emitted(4, 22) Source(16, 18) + SourceIndex(0) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^ +1 > + > +2 > } +3 > +1 >Emitted(5, 9) Source(17, 5) + SourceIndex(0) +2 >Emitted(5, 10) Source(17, 6) + SourceIndex(0) +3 >Emitted(5, 11) Source(17, 6) + SourceIndex(0) name (C1T5.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(18, 1) + SourceIndex(0) name (C1T5.constructor) +2 >Emitted(6, 6) Source(18, 2) + SourceIndex(0) name (C1T5.constructor) +--- +>>> return C1T5; +1->^^^^ +2 > ^^^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(18, 1) + SourceIndex(0) name (C1T5) +2 >Emitted(7, 16) Source(18, 2) + SourceIndex(0) name (C1T5) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^-> +1 > +2 >} +3 > +4 > class C1T5 { + > foo: (i: number, s: string) => number = function(i) { + > return i; + > } + > } +1 >Emitted(8, 1) Source(18, 1) + SourceIndex(0) name (C1T5) +2 >Emitted(8, 2) Source(18, 2) + SourceIndex(0) name (C1T5) +3 >Emitted(8, 2) Source(14, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(18, 2) + SourceIndex(0) +--- +>>>var C2T5; +1-> +2 >^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1-> + > + >// CONTEXT: Module property declaration + > +2 >module +3 > C2T5 +4 > { + > export var foo: (i: number, s: string) => number = function(i) { + > return i; + > } + > } +1->Emitted(9, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(21, 8) + SourceIndex(0) +3 >Emitted(9, 9) Source(21, 12) + SourceIndex(0) +4 >Emitted(9, 10) Source(25, 2) + SourceIndex(0) +--- +>>>(function (C2T5) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> +1-> +2 >module +3 > C2T5 +4 > +5 > { +1->Emitted(10, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(10, 12) Source(21, 8) + SourceIndex(0) +3 >Emitted(10, 16) Source(21, 12) + SourceIndex(0) +4 >Emitted(10, 18) Source(21, 13) + SourceIndex(0) +5 >Emitted(10, 19) Source(21, 14) + SourceIndex(0) +--- +>>> C2T5.foo = function (i) { +1->^^^^ +2 > ^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^ +1-> + > export var +2 > foo +3 > : (i: number, s: string) => number = +4 > function( +5 > i +1->Emitted(11, 5) Source(22, 16) + SourceIndex(0) name (C2T5) +2 >Emitted(11, 13) Source(22, 19) + SourceIndex(0) name (C2T5) +3 >Emitted(11, 16) Source(22, 56) + SourceIndex(0) name (C2T5) +4 >Emitted(11, 26) Source(22, 65) + SourceIndex(0) name (C2T5) +5 >Emitted(11, 27) Source(22, 66) + SourceIndex(0) name (C2T5) +--- +>>> return i; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { + > +2 > return +3 > +4 > i +5 > ; +1 >Emitted(12, 9) Source(23, 9) + SourceIndex(0) +2 >Emitted(12, 15) Source(23, 15) + SourceIndex(0) +3 >Emitted(12, 16) Source(23, 16) + SourceIndex(0) +4 >Emitted(12, 17) Source(23, 17) + SourceIndex(0) +5 >Emitted(12, 18) Source(23, 18) + SourceIndex(0) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +3 > +1 >Emitted(13, 5) Source(24, 5) + SourceIndex(0) +2 >Emitted(13, 6) Source(24, 6) + SourceIndex(0) +3 >Emitted(13, 7) Source(24, 6) + SourceIndex(0) name (C2T5) +--- +>>>})(C2T5 || (C2T5 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^^^ +8 > ^^^-> +1-> + > +2 >} +3 > +4 > C2T5 +5 > +6 > C2T5 +7 > { + > export var foo: (i: number, s: string) => number = function(i) { + > return i; + > } + > } +1->Emitted(14, 1) Source(25, 1) + SourceIndex(0) name (C2T5) +2 >Emitted(14, 2) Source(25, 2) + SourceIndex(0) name (C2T5) +3 >Emitted(14, 4) Source(21, 8) + SourceIndex(0) +4 >Emitted(14, 8) Source(21, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(21, 8) + SourceIndex(0) +6 >Emitted(14, 17) Source(21, 12) + SourceIndex(0) +7 >Emitted(14, 25) Source(25, 2) + SourceIndex(0) +--- +>>>var c3t1 = (function (s) { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +1-> + > + >// CONTEXT: Variable declaration + > +2 >var +3 > c3t1 +4 > : (s: string) => string = +5 > ( +6 > function( +7 > s +1->Emitted(15, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(15, 9) Source(28, 9) + SourceIndex(0) +4 >Emitted(15, 12) Source(28, 35) + SourceIndex(0) +5 >Emitted(15, 13) Source(28, 36) + SourceIndex(0) +6 >Emitted(15, 23) Source(28, 45) + SourceIndex(0) +7 >Emitted(15, 24) Source(28, 46) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > +1 >Emitted(16, 5) Source(28, 50) + SourceIndex(0) +2 >Emitted(16, 11) Source(28, 56) + SourceIndex(0) +3 >Emitted(16, 12) Source(28, 57) + SourceIndex(0) +4 >Emitted(16, 13) Source(28, 58) + SourceIndex(0) +5 >Emitted(16, 14) Source(28, 58) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^-> +1 > +2 >} +3 > ) +4 > ; +1 >Emitted(17, 1) Source(28, 59) + SourceIndex(0) +2 >Emitted(17, 2) Source(28, 60) + SourceIndex(0) +3 >Emitted(17, 3) Source(28, 61) + SourceIndex(0) +4 >Emitted(17, 4) Source(28, 62) + SourceIndex(0) +--- +>>>var c3t2 = ({ +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^ +1-> + > +2 >var +3 > c3t2 +4 > = +5 > ( +1->Emitted(18, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(18, 9) Source(29, 9) + SourceIndex(0) +4 >Emitted(18, 12) Source(29, 18) + SourceIndex(0) +5 >Emitted(18, 13) Source(29, 19) + SourceIndex(0) +--- +>>> n: 1 +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 >{ + > +2 > n +3 > : +4 > 1 +1 >Emitted(19, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(19, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(19, 8) Source(30, 8) + SourceIndex(0) +4 >Emitted(19, 9) Source(30, 9) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(20, 2) Source(31, 2) + SourceIndex(0) +2 >Emitted(20, 3) Source(31, 3) + SourceIndex(0) +3 >Emitted(20, 4) Source(31, 3) + SourceIndex(0) +--- +>>>var c3t3 = []; +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^-> +1-> + > +2 >var +3 > c3t3 +4 > : number[] = +5 > [] +6 > ; +1->Emitted(21, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(21, 9) Source(32, 9) + SourceIndex(0) +4 >Emitted(21, 12) Source(32, 22) + SourceIndex(0) +5 >Emitted(21, 14) Source(32, 24) + SourceIndex(0) +6 >Emitted(21, 15) Source(32, 25) + SourceIndex(0) +--- +>>>var c3t4 = function () { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^-> +1-> + > +2 >var +3 > c3t4 +4 > : () => IFoo = +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(22, 9) Source(33, 9) + SourceIndex(0) +4 >Emitted(22, 12) Source(33, 24) + SourceIndex(0) +--- +>>> return ({}); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1->function() { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1->Emitted(23, 5) Source(33, 37) + SourceIndex(0) +2 >Emitted(23, 11) Source(33, 43) + SourceIndex(0) +3 >Emitted(23, 12) Source(33, 50) + SourceIndex(0) +4 >Emitted(23, 13) Source(33, 51) + SourceIndex(0) +5 >Emitted(23, 15) Source(33, 53) + SourceIndex(0) +6 >Emitted(23, 16) Source(33, 54) + SourceIndex(0) +7 >Emitted(23, 17) Source(33, 54) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(24, 1) Source(33, 55) + SourceIndex(0) +2 >Emitted(24, 2) Source(33, 56) + SourceIndex(0) +3 >Emitted(24, 3) Source(33, 57) + SourceIndex(0) +--- +>>>var c3t5 = function (n) { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > +2 >var +3 > c3t5 +4 > : (n: number) => IFoo = +5 > function( +6 > n +1->Emitted(25, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(34, 5) + SourceIndex(0) +3 >Emitted(25, 9) Source(34, 9) + SourceIndex(0) +4 >Emitted(25, 12) Source(34, 33) + SourceIndex(0) +5 >Emitted(25, 22) Source(34, 42) + SourceIndex(0) +6 >Emitted(25, 23) Source(34, 43) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(26, 5) Source(34, 47) + SourceIndex(0) +2 >Emitted(26, 11) Source(34, 53) + SourceIndex(0) +3 >Emitted(26, 12) Source(34, 60) + SourceIndex(0) +4 >Emitted(26, 13) Source(34, 61) + SourceIndex(0) +5 >Emitted(26, 15) Source(34, 63) + SourceIndex(0) +6 >Emitted(26, 16) Source(34, 64) + SourceIndex(0) +7 >Emitted(26, 17) Source(34, 64) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(27, 1) Source(34, 65) + SourceIndex(0) +2 >Emitted(27, 2) Source(34, 66) + SourceIndex(0) +3 >Emitted(27, 3) Source(34, 67) + SourceIndex(0) +--- +>>>var c3t6 = function (n, s) { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +7 > ^^ +8 > ^ +1-> + > +2 >var +3 > c3t6 +4 > : (n: number, s: string) => IFoo = +5 > function( +6 > n +7 > , +8 > s +1->Emitted(28, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(28, 5) Source(35, 5) + SourceIndex(0) +3 >Emitted(28, 9) Source(35, 9) + SourceIndex(0) +4 >Emitted(28, 12) Source(35, 44) + SourceIndex(0) +5 >Emitted(28, 22) Source(35, 53) + SourceIndex(0) +6 >Emitted(28, 23) Source(35, 54) + SourceIndex(0) +7 >Emitted(28, 25) Source(35, 56) + SourceIndex(0) +8 >Emitted(28, 26) Source(35, 57) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(29, 5) Source(35, 61) + SourceIndex(0) +2 >Emitted(29, 11) Source(35, 67) + SourceIndex(0) +3 >Emitted(29, 12) Source(35, 74) + SourceIndex(0) +4 >Emitted(29, 13) Source(35, 75) + SourceIndex(0) +5 >Emitted(29, 15) Source(35, 77) + SourceIndex(0) +6 >Emitted(29, 16) Source(35, 78) + SourceIndex(0) +7 >Emitted(29, 17) Source(35, 78) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(30, 1) Source(35, 79) + SourceIndex(0) +2 >Emitted(30, 2) Source(35, 80) + SourceIndex(0) +3 >Emitted(30, 3) Source(35, 81) + SourceIndex(0) +--- +>>>var c3t7 = function (n) { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > +2 >var +3 > c3t7 +4 > : { + > (n: number): number; + > (s1: string): number; + > } = +5 > function( +6 > n +1->Emitted(31, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(31, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(31, 9) Source(36, 9) + SourceIndex(0) +4 >Emitted(31, 12) Source(39, 5) + SourceIndex(0) +5 >Emitted(31, 22) Source(39, 14) + SourceIndex(0) +6 >Emitted(31, 23) Source(39, 15) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > ; +1 >Emitted(32, 5) Source(39, 19) + SourceIndex(0) +2 >Emitted(32, 11) Source(39, 25) + SourceIndex(0) +3 >Emitted(32, 12) Source(39, 26) + SourceIndex(0) +4 >Emitted(32, 13) Source(39, 27) + SourceIndex(0) +5 >Emitted(32, 14) Source(39, 28) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(33, 1) Source(39, 29) + SourceIndex(0) +2 >Emitted(33, 2) Source(39, 30) + SourceIndex(0) +3 >Emitted(33, 3) Source(39, 31) + SourceIndex(0) +--- +>>>var c3t8 = function (n) { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > + > +2 >var +3 > c3t8 +4 > : (n: number, s: string) => number = +5 > function( +6 > n +1->Emitted(34, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(34, 5) Source(41, 5) + SourceIndex(0) +3 >Emitted(34, 9) Source(41, 9) + SourceIndex(0) +4 >Emitted(34, 12) Source(41, 46) + SourceIndex(0) +5 >Emitted(34, 22) Source(41, 55) + SourceIndex(0) +6 >Emitted(34, 23) Source(41, 56) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > ; +1 >Emitted(35, 5) Source(41, 60) + SourceIndex(0) +2 >Emitted(35, 11) Source(41, 66) + SourceIndex(0) +3 >Emitted(35, 12) Source(41, 67) + SourceIndex(0) +4 >Emitted(35, 13) Source(41, 68) + SourceIndex(0) +5 >Emitted(35, 14) Source(41, 69) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(36, 1) Source(41, 70) + SourceIndex(0) +2 >Emitted(36, 2) Source(41, 71) + SourceIndex(0) +3 >Emitted(36, 3) Source(41, 72) + SourceIndex(0) +--- +>>>var c3t9 = [[], []]; +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^ +8 > ^^ +9 > ^ +10> ^ +11> ^^^^^^-> +1-> + > +2 >var +3 > c3t9 +4 > : number[][] = +5 > [ +6 > [] +7 > , +8 > [] +9 > ] +10> ; +1->Emitted(37, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(37, 5) Source(42, 5) + SourceIndex(0) +3 >Emitted(37, 9) Source(42, 9) + SourceIndex(0) +4 >Emitted(37, 12) Source(42, 24) + SourceIndex(0) +5 >Emitted(37, 13) Source(42, 25) + SourceIndex(0) +6 >Emitted(37, 15) Source(42, 27) + SourceIndex(0) +7 >Emitted(37, 17) Source(42, 28) + SourceIndex(0) +8 >Emitted(37, 19) Source(42, 30) + SourceIndex(0) +9 >Emitted(37, 20) Source(42, 31) + SourceIndex(0) +10>Emitted(37, 21) Source(42, 32) + SourceIndex(0) +--- +>>>var c3t10 = [({}), ({})]; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^-> +1-> + > +2 >var +3 > c3t10 +4 > : IFoo[] = +5 > [ +6 > ( +7 > {} +8 > ) +9 > , +10> ( +11> {} +12> ) +13> ] +14> ; +1->Emitted(38, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(38, 5) Source(43, 5) + SourceIndex(0) +3 >Emitted(38, 10) Source(43, 10) + SourceIndex(0) +4 >Emitted(38, 13) Source(43, 21) + SourceIndex(0) +5 >Emitted(38, 14) Source(43, 28) + SourceIndex(0) +6 >Emitted(38, 15) Source(43, 29) + SourceIndex(0) +7 >Emitted(38, 17) Source(43, 31) + SourceIndex(0) +8 >Emitted(38, 18) Source(43, 32) + SourceIndex(0) +9 >Emitted(38, 20) Source(43, 39) + SourceIndex(0) +10>Emitted(38, 21) Source(43, 40) + SourceIndex(0) +11>Emitted(38, 23) Source(43, 42) + SourceIndex(0) +12>Emitted(38, 24) Source(43, 43) + SourceIndex(0) +13>Emitted(38, 25) Source(43, 44) + SourceIndex(0) +14>Emitted(38, 26) Source(43, 45) + SourceIndex(0) +--- +>>>var c3t11 = [function (n, s) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +1-> + > +2 >var +3 > c3t11 +4 > : {(n: number, s: string): string;}[] = +5 > [ +6 > function( +7 > n +8 > , +9 > s +1->Emitted(39, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(39, 5) Source(44, 5) + SourceIndex(0) +3 >Emitted(39, 10) Source(44, 10) + SourceIndex(0) +4 >Emitted(39, 13) Source(44, 50) + SourceIndex(0) +5 >Emitted(39, 14) Source(44, 51) + SourceIndex(0) +6 >Emitted(39, 24) Source(44, 60) + SourceIndex(0) +7 >Emitted(39, 25) Source(44, 61) + SourceIndex(0) +8 >Emitted(39, 27) Source(44, 63) + SourceIndex(0) +9 >Emitted(39, 28) Source(44, 64) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(40, 5) Source(44, 68) + SourceIndex(0) +2 >Emitted(40, 11) Source(44, 74) + SourceIndex(0) +3 >Emitted(40, 12) Source(44, 75) + SourceIndex(0) +4 >Emitted(40, 13) Source(44, 76) + SourceIndex(0) +5 >Emitted(40, 14) Source(44, 77) + SourceIndex(0) +--- +>>>}]; +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^-> +1 > +2 >} +3 > ] +4 > ; +1 >Emitted(41, 1) Source(44, 78) + SourceIndex(0) +2 >Emitted(41, 2) Source(44, 79) + SourceIndex(0) +3 >Emitted(41, 3) Source(44, 80) + SourceIndex(0) +4 >Emitted(41, 4) Source(44, 81) + SourceIndex(0) +--- +>>>var c3t12 = { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^-> +1-> + > +2 >var +3 > c3t12 +4 > : IBar = +1->Emitted(42, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(42, 5) Source(45, 5) + SourceIndex(0) +3 >Emitted(42, 10) Source(45, 10) + SourceIndex(0) +4 >Emitted(42, 13) Source(45, 19) + SourceIndex(0) +--- +>>> foo: ({}) +1->^^^^ +2 > ^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +1->{ + > +2 > foo +3 > : +4 > ( +5 > {} +6 > ) +1->Emitted(43, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(43, 8) Source(46, 8) + SourceIndex(0) +3 >Emitted(43, 10) Source(46, 16) + SourceIndex(0) +4 >Emitted(43, 11) Source(46, 17) + SourceIndex(0) +5 >Emitted(43, 13) Source(46, 19) + SourceIndex(0) +6 >Emitted(43, 14) Source(46, 20) + SourceIndex(0) +--- +>>>}; +1 >^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > + >} +2 > +1 >Emitted(44, 2) Source(47, 2) + SourceIndex(0) +2 >Emitted(44, 3) Source(47, 2) + SourceIndex(0) +--- +>>>var c3t13 = ({ +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^-> +1-> + > +2 >var +3 > c3t13 +4 > = +5 > ( +1->Emitted(45, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(45, 5) Source(48, 5) + SourceIndex(0) +3 >Emitted(45, 10) Source(48, 10) + SourceIndex(0) +4 >Emitted(45, 13) Source(48, 19) + SourceIndex(0) +5 >Emitted(45, 14) Source(48, 20) + SourceIndex(0) +--- +>>> f: function (i, s) { +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^^ +7 > ^ +1->{ + > +2 > f +3 > : +4 > function( +5 > i +6 > , +7 > s +1->Emitted(46, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(49, 6) + SourceIndex(0) +3 >Emitted(46, 8) Source(49, 8) + SourceIndex(0) +4 >Emitted(46, 18) Source(49, 17) + SourceIndex(0) +5 >Emitted(46, 19) Source(49, 18) + SourceIndex(0) +6 >Emitted(46, 21) Source(49, 20) + SourceIndex(0) +7 >Emitted(46, 22) Source(49, 21) + SourceIndex(0) +--- +>>> return s; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(47, 9) Source(49, 25) + SourceIndex(0) +2 >Emitted(47, 15) Source(49, 31) + SourceIndex(0) +3 >Emitted(47, 16) Source(49, 32) + SourceIndex(0) +4 >Emitted(47, 17) Source(49, 33) + SourceIndex(0) +5 >Emitted(47, 18) Source(49, 34) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > +2 > } +1 >Emitted(48, 5) Source(49, 35) + SourceIndex(0) +2 >Emitted(48, 6) Source(49, 36) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(49, 2) Source(50, 2) + SourceIndex(0) +2 >Emitted(49, 3) Source(50, 3) + SourceIndex(0) +3 >Emitted(49, 4) Source(50, 3) + SourceIndex(0) +--- +>>>var c3t14 = ({ +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +1-> + > +2 >var +3 > c3t14 +4 > = +5 > ( +1->Emitted(50, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(50, 5) Source(51, 5) + SourceIndex(0) +3 >Emitted(50, 10) Source(51, 10) + SourceIndex(0) +4 >Emitted(50, 13) Source(51, 19) + SourceIndex(0) +5 >Emitted(50, 14) Source(51, 20) + SourceIndex(0) +--- +>>> a: [] +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^^ +1 >{ + > +2 > a +3 > : +4 > [] +1 >Emitted(51, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(51, 6) Source(52, 6) + SourceIndex(0) +3 >Emitted(51, 8) Source(52, 8) + SourceIndex(0) +4 >Emitted(51, 10) Source(52, 10) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(52, 2) Source(53, 2) + SourceIndex(0) +2 >Emitted(52, 3) Source(53, 3) + SourceIndex(0) +3 >Emitted(52, 4) Source(53, 3) + SourceIndex(0) +--- +>>>var C4T5 = (function () { +1-> +2 >^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > + >// CONTEXT: Class property assignment + > +2 >class +3 > C4T5 +1->Emitted(53, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(53, 5) Source(56, 7) + SourceIndex(0) +3 >Emitted(53, 9) Source(56, 11) + SourceIndex(0) +--- +>>> function C4T5() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> { + > foo: (i: number, s: string) => string; + > +2 > +3 > C4T5 +1->Emitted(54, 5) Source(58, 5) + SourceIndex(0) name (C4T5) +2 >Emitted(54, 14) Source(56, 7) + SourceIndex(0) name (C4T5) +3 >Emitted(54, 18) Source(56, 11) + SourceIndex(0) name (C4T5) +--- +>>> this.foo = function (i, s) { +1->^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +1-> { + > foo: (i: number, s: string) => string; + > constructor() { + > +2 > this +3 > . +4 > foo +5 > = +6 > function( +7 > i +8 > , +9 > s +1->Emitted(55, 9) Source(59, 9) + SourceIndex(0) name (C4T5.constructor) +2 >Emitted(55, 13) Source(59, 13) + SourceIndex(0) name (C4T5.constructor) +3 >Emitted(55, 14) Source(59, 14) + SourceIndex(0) name (C4T5.constructor) +4 >Emitted(55, 17) Source(59, 17) + SourceIndex(0) name (C4T5.constructor) +5 >Emitted(55, 20) Source(59, 20) + SourceIndex(0) name (C4T5.constructor) +6 >Emitted(55, 30) Source(59, 29) + SourceIndex(0) name (C4T5.constructor) +7 >Emitted(55, 31) Source(59, 30) + SourceIndex(0) name (C4T5.constructor) +8 >Emitted(55, 33) Source(59, 32) + SourceIndex(0) name (C4T5.constructor) +9 >Emitted(55, 34) Source(59, 33) + SourceIndex(0) name (C4T5.constructor) +--- +>>> return s; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { + > +2 > return +3 > +4 > s +5 > ; +1 >Emitted(56, 13) Source(60, 13) + SourceIndex(0) +2 >Emitted(56, 19) Source(60, 19) + SourceIndex(0) +3 >Emitted(56, 20) Source(60, 20) + SourceIndex(0) +4 >Emitted(56, 21) Source(60, 21) + SourceIndex(0) +5 >Emitted(56, 22) Source(60, 22) + SourceIndex(0) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^ +1 > + > +2 > } +3 > +1 >Emitted(57, 9) Source(61, 9) + SourceIndex(0) +2 >Emitted(57, 10) Source(61, 10) + SourceIndex(0) +3 >Emitted(57, 11) Source(61, 10) + SourceIndex(0) name (C4T5.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(58, 5) Source(62, 5) + SourceIndex(0) name (C4T5.constructor) +2 >Emitted(58, 6) Source(62, 6) + SourceIndex(0) name (C4T5.constructor) +--- +>>> return C4T5; +1->^^^^ +2 > ^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(59, 5) Source(63, 1) + SourceIndex(0) name (C4T5) +2 >Emitted(59, 16) Source(63, 2) + SourceIndex(0) name (C4T5) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^-> +1 > +2 >} +3 > +4 > class C4T5 { + > foo: (i: number, s: string) => string; + > constructor() { + > this.foo = function(i, s) { + > return s; + > } + > } + > } +1 >Emitted(60, 1) Source(63, 1) + SourceIndex(0) name (C4T5) +2 >Emitted(60, 2) Source(63, 2) + SourceIndex(0) name (C4T5) +3 >Emitted(60, 2) Source(56, 1) + SourceIndex(0) +4 >Emitted(60, 6) Source(63, 2) + SourceIndex(0) +--- +>>>var C5T5; +1-> +2 >^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1-> + > + >// CONTEXT: Module property assignment + > +2 >module +3 > C5T5 +4 > { + > export var foo: (i: number, s: string) => string; + > foo = function(i, s) { + > return s; + > } + > } +1->Emitted(61, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(61, 5) Source(66, 8) + SourceIndex(0) +3 >Emitted(61, 9) Source(66, 12) + SourceIndex(0) +4 >Emitted(61, 10) Source(71, 2) + SourceIndex(0) +--- +>>>(function (C5T5) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^ +4 > ^^ +5 > ^ +1-> +2 >module +3 > C5T5 +4 > +5 > { +1->Emitted(62, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(62, 12) Source(66, 8) + SourceIndex(0) +3 >Emitted(62, 16) Source(66, 12) + SourceIndex(0) +4 >Emitted(62, 18) Source(66, 13) + SourceIndex(0) +5 >Emitted(62, 19) Source(66, 14) + SourceIndex(0) +--- +>>> C5T5.foo; +1 >^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > export var +2 > foo: (i: number, s: string) => string +3 > ; +1 >Emitted(63, 5) Source(67, 16) + SourceIndex(0) name (C5T5) +2 >Emitted(63, 13) Source(67, 53) + SourceIndex(0) name (C5T5) +3 >Emitted(63, 14) Source(67, 54) + SourceIndex(0) name (C5T5) +--- +>>> C5T5.foo = function (i, s) { +1->^^^^ +2 > ^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^^ +7 > ^ +1-> + > +2 > foo +3 > = +4 > function( +5 > i +6 > , +7 > s +1->Emitted(64, 5) Source(68, 5) + SourceIndex(0) name (C5T5) +2 >Emitted(64, 13) Source(68, 8) + SourceIndex(0) name (C5T5) +3 >Emitted(64, 16) Source(68, 11) + SourceIndex(0) name (C5T5) +4 >Emitted(64, 26) Source(68, 20) + SourceIndex(0) name (C5T5) +5 >Emitted(64, 27) Source(68, 21) + SourceIndex(0) name (C5T5) +6 >Emitted(64, 29) Source(68, 23) + SourceIndex(0) name (C5T5) +7 >Emitted(64, 30) Source(68, 24) + SourceIndex(0) name (C5T5) +--- +>>> return s; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { + > +2 > return +3 > +4 > s +5 > ; +1 >Emitted(65, 9) Source(69, 9) + SourceIndex(0) +2 >Emitted(65, 15) Source(69, 15) + SourceIndex(0) +3 >Emitted(65, 16) Source(69, 16) + SourceIndex(0) +4 >Emitted(65, 17) Source(69, 17) + SourceIndex(0) +5 >Emitted(65, 18) Source(69, 18) + SourceIndex(0) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +3 > +1 >Emitted(66, 5) Source(70, 5) + SourceIndex(0) +2 >Emitted(66, 6) Source(70, 6) + SourceIndex(0) +3 >Emitted(66, 7) Source(70, 6) + SourceIndex(0) name (C5T5) +--- +>>>})(C5T5 || (C5T5 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > C5T5 +5 > +6 > C5T5 +7 > { + > export var foo: (i: number, s: string) => string; + > foo = function(i, s) { + > return s; + > } + > } +1->Emitted(67, 1) Source(71, 1) + SourceIndex(0) name (C5T5) +2 >Emitted(67, 2) Source(71, 2) + SourceIndex(0) name (C5T5) +3 >Emitted(67, 4) Source(66, 8) + SourceIndex(0) +4 >Emitted(67, 8) Source(66, 12) + SourceIndex(0) +5 >Emitted(67, 13) Source(66, 8) + SourceIndex(0) +6 >Emitted(67, 17) Source(66, 12) + SourceIndex(0) +7 >Emitted(67, 25) Source(71, 2) + SourceIndex(0) +--- +>>>var c6t5; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^-> +1 > + > + >// CONTEXT: Variable assignment + > +2 >var +3 > c6t5: (n: number) => IFoo +4 > ; +1 >Emitted(68, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(68, 5) Source(74, 5) + SourceIndex(0) +3 >Emitted(68, 9) Source(74, 30) + SourceIndex(0) +4 >Emitted(68, 10) Source(74, 31) + SourceIndex(0) +--- +>>>c6t5 = function (n) { +1-> +2 >^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^ +1-> + > +2 >c6t5 +3 > = <(n: number) => IFoo> +4 > function( +5 > n +1->Emitted(69, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(69, 5) Source(75, 5) + SourceIndex(0) +3 >Emitted(69, 8) Source(75, 29) + SourceIndex(0) +4 >Emitted(69, 18) Source(75, 38) + SourceIndex(0) +5 >Emitted(69, 19) Source(75, 39) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(70, 5) Source(75, 43) + SourceIndex(0) +2 >Emitted(70, 11) Source(75, 49) + SourceIndex(0) +3 >Emitted(70, 12) Source(75, 56) + SourceIndex(0) +4 >Emitted(70, 13) Source(75, 57) + SourceIndex(0) +5 >Emitted(70, 15) Source(75, 59) + SourceIndex(0) +6 >Emitted(70, 16) Source(75, 60) + SourceIndex(0) +7 >Emitted(70, 17) Source(75, 60) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(71, 1) Source(75, 61) + SourceIndex(0) +2 >Emitted(71, 2) Source(75, 62) + SourceIndex(0) +3 >Emitted(71, 3) Source(75, 63) + SourceIndex(0) +--- +>>>var c7t2; +1-> +2 >^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^-> +1-> + > + >// CONTEXT: Array index assignment + > +2 >var +3 > c7t2: IFoo[] +4 > ; +1->Emitted(72, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(72, 5) Source(78, 5) + SourceIndex(0) +3 >Emitted(72, 9) Source(78, 17) + SourceIndex(0) +4 >Emitted(72, 10) Source(78, 18) + SourceIndex(0) +--- +>>>c7t2[0] = ({ n: 1 }); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^ +11> ^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >c7t2 +3 > [ +4 > 0 +5 > ] +6 > = +7 > ( +8 > { +9 > n +10> : +11> 1 +12> } +13> ) +14> ; +1->Emitted(73, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(73, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(73, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(73, 7) Source(79, 7) + SourceIndex(0) +5 >Emitted(73, 8) Source(79, 8) + SourceIndex(0) +6 >Emitted(73, 11) Source(79, 17) + SourceIndex(0) +7 >Emitted(73, 12) Source(79, 18) + SourceIndex(0) +8 >Emitted(73, 14) Source(79, 19) + SourceIndex(0) +9 >Emitted(73, 15) Source(79, 20) + SourceIndex(0) +10>Emitted(73, 17) Source(79, 22) + SourceIndex(0) +11>Emitted(73, 18) Source(79, 23) + SourceIndex(0) +12>Emitted(73, 20) Source(79, 24) + SourceIndex(0) +13>Emitted(73, 21) Source(79, 25) + SourceIndex(0) +14>Emitted(73, 22) Source(79, 26) + SourceIndex(0) +--- +>>>var objc8 = ({}); +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^-> +1 > + > + >// CONTEXT: Object property assignment + >interface IPlaceHolder { + > t1: (s: string) => string; + > t2: IFoo; + > t3: number[]; + > t4: () => IFoo; + > t5: (n: number) => IFoo; + > t6: (n: number, s: string) => IFoo; + > t7: { + > (n: number, s: string): number; + > //(s1: string, s2: string): number; + > }; + > t8: (n: number, s: string) => number; + > t9: number[][]; + > t10: IFoo[]; + > t11: {(n: number, s: string): string;}[]; + > t12: IBar; + > t13: IFoo; + > t14: IFoo; + > } + > + > +2 >var +3 > objc8 +4 > : { + > t1: (s: string) => string; + > t2: IFoo; + > t3: number[]; + > t4: () => IFoo; + > t5: (n: number) => IFoo; + > t6: (n: number, s: string) => IFoo; + > t7: { + > (n: number, s: string): number; + > //(s1: string, s2: string): number; + > }; + > t8: (n: number, s: string) => number; + > t9: number[][]; + > t10: IFoo[]; + > t11: {(n: number, s: string): string;}[]; + > t12: IBar; + > t13: IFoo; + > t14: IFoo; + > } = +5 > ( +6 > {} +7 > ) +8 > ; +1 >Emitted(74, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(74, 5) Source(102, 5) + SourceIndex(0) +3 >Emitted(74, 10) Source(102, 10) + SourceIndex(0) +4 >Emitted(74, 13) Source(120, 19) + SourceIndex(0) +5 >Emitted(74, 14) Source(120, 20) + SourceIndex(0) +6 >Emitted(74, 16) Source(120, 22) + SourceIndex(0) +7 >Emitted(74, 17) Source(120, 23) + SourceIndex(0) +8 >Emitted(74, 18) Source(120, 24) + SourceIndex(0) +--- +>>>objc8.t1 = (function (s) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^ +7 > ^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >objc8 +3 > . +4 > t1 +5 > = +6 > ( +7 > function( +8 > s +1->Emitted(75, 1) Source(122, 1) + SourceIndex(0) +2 >Emitted(75, 6) Source(122, 6) + SourceIndex(0) +3 >Emitted(75, 7) Source(122, 7) + SourceIndex(0) +4 >Emitted(75, 9) Source(122, 9) + SourceIndex(0) +5 >Emitted(75, 12) Source(122, 12) + SourceIndex(0) +6 >Emitted(75, 13) Source(122, 13) + SourceIndex(0) +7 >Emitted(75, 23) Source(122, 22) + SourceIndex(0) +8 >Emitted(75, 24) Source(122, 23) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > +1 >Emitted(76, 5) Source(122, 27) + SourceIndex(0) +2 >Emitted(76, 11) Source(122, 33) + SourceIndex(0) +3 >Emitted(76, 12) Source(122, 34) + SourceIndex(0) +4 >Emitted(76, 13) Source(122, 35) + SourceIndex(0) +5 >Emitted(76, 14) Source(122, 35) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^-> +1 > +2 >} +3 > ) +4 > ; +1 >Emitted(77, 1) Source(122, 36) + SourceIndex(0) +2 >Emitted(77, 2) Source(122, 37) + SourceIndex(0) +3 >Emitted(77, 3) Source(122, 38) + SourceIndex(0) +4 >Emitted(77, 4) Source(122, 39) + SourceIndex(0) +--- +>>>objc8.t2 = ({ +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^ +1-> + > +2 >objc8 +3 > . +4 > t2 +5 > = +6 > ( +1->Emitted(78, 1) Source(123, 1) + SourceIndex(0) +2 >Emitted(78, 6) Source(123, 6) + SourceIndex(0) +3 >Emitted(78, 7) Source(123, 7) + SourceIndex(0) +4 >Emitted(78, 9) Source(123, 9) + SourceIndex(0) +5 >Emitted(78, 12) Source(123, 18) + SourceIndex(0) +6 >Emitted(78, 13) Source(123, 19) + SourceIndex(0) +--- +>>> n: 1 +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 >{ + > +2 > n +3 > : +4 > 1 +1 >Emitted(79, 5) Source(124, 5) + SourceIndex(0) +2 >Emitted(79, 6) Source(124, 6) + SourceIndex(0) +3 >Emitted(79, 8) Source(124, 8) + SourceIndex(0) +4 >Emitted(79, 9) Source(124, 9) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > ; +1 >Emitted(80, 2) Source(125, 2) + SourceIndex(0) +2 >Emitted(80, 3) Source(125, 3) + SourceIndex(0) +3 >Emitted(80, 4) Source(125, 4) + SourceIndex(0) +--- +>>>objc8.t3 = []; +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^^^^-> +1-> + > +2 >objc8 +3 > . +4 > t3 +5 > = +6 > [] +7 > ; +1->Emitted(81, 1) Source(126, 1) + SourceIndex(0) +2 >Emitted(81, 6) Source(126, 6) + SourceIndex(0) +3 >Emitted(81, 7) Source(126, 7) + SourceIndex(0) +4 >Emitted(81, 9) Source(126, 9) + SourceIndex(0) +5 >Emitted(81, 12) Source(126, 12) + SourceIndex(0) +6 >Emitted(81, 14) Source(126, 14) + SourceIndex(0) +7 >Emitted(81, 15) Source(126, 15) + SourceIndex(0) +--- +>>>objc8.t4 = function () { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^^^^^-> +1-> + > +2 >objc8 +3 > . +4 > t4 +5 > = +1->Emitted(82, 1) Source(127, 1) + SourceIndex(0) +2 >Emitted(82, 6) Source(127, 6) + SourceIndex(0) +3 >Emitted(82, 7) Source(127, 7) + SourceIndex(0) +4 >Emitted(82, 9) Source(127, 9) + SourceIndex(0) +5 >Emitted(82, 12) Source(127, 12) + SourceIndex(0) +--- +>>> return ({}); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1->function() { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1->Emitted(83, 5) Source(127, 25) + SourceIndex(0) +2 >Emitted(83, 11) Source(127, 31) + SourceIndex(0) +3 >Emitted(83, 12) Source(127, 38) + SourceIndex(0) +4 >Emitted(83, 13) Source(127, 39) + SourceIndex(0) +5 >Emitted(83, 15) Source(127, 41) + SourceIndex(0) +6 >Emitted(83, 16) Source(127, 42) + SourceIndex(0) +7 >Emitted(83, 17) Source(127, 42) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(84, 1) Source(127, 43) + SourceIndex(0) +2 >Emitted(84, 2) Source(127, 44) + SourceIndex(0) +3 >Emitted(84, 3) Source(127, 45) + SourceIndex(0) +--- +>>>objc8.t5 = function (n) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^^^^^^^^^ +7 > ^ +1-> + > +2 >objc8 +3 > . +4 > t5 +5 > = +6 > function( +7 > n +1->Emitted(85, 1) Source(128, 1) + SourceIndex(0) +2 >Emitted(85, 6) Source(128, 6) + SourceIndex(0) +3 >Emitted(85, 7) Source(128, 7) + SourceIndex(0) +4 >Emitted(85, 9) Source(128, 9) + SourceIndex(0) +5 >Emitted(85, 12) Source(128, 12) + SourceIndex(0) +6 >Emitted(85, 22) Source(128, 21) + SourceIndex(0) +7 >Emitted(85, 23) Source(128, 22) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(86, 5) Source(128, 26) + SourceIndex(0) +2 >Emitted(86, 11) Source(128, 32) + SourceIndex(0) +3 >Emitted(86, 12) Source(128, 39) + SourceIndex(0) +4 >Emitted(86, 13) Source(128, 40) + SourceIndex(0) +5 >Emitted(86, 15) Source(128, 42) + SourceIndex(0) +6 >Emitted(86, 16) Source(128, 43) + SourceIndex(0) +7 >Emitted(86, 17) Source(128, 43) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(87, 1) Source(128, 44) + SourceIndex(0) +2 >Emitted(87, 2) Source(128, 45) + SourceIndex(0) +3 >Emitted(87, 3) Source(128, 46) + SourceIndex(0) +--- +>>>objc8.t6 = function (n, s) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +1-> + > +2 >objc8 +3 > . +4 > t6 +5 > = +6 > function( +7 > n +8 > , +9 > s +1->Emitted(88, 1) Source(129, 1) + SourceIndex(0) +2 >Emitted(88, 6) Source(129, 6) + SourceIndex(0) +3 >Emitted(88, 7) Source(129, 7) + SourceIndex(0) +4 >Emitted(88, 9) Source(129, 9) + SourceIndex(0) +5 >Emitted(88, 12) Source(129, 12) + SourceIndex(0) +6 >Emitted(88, 22) Source(129, 21) + SourceIndex(0) +7 >Emitted(88, 23) Source(129, 22) + SourceIndex(0) +8 >Emitted(88, 25) Source(129, 24) + SourceIndex(0) +9 >Emitted(88, 26) Source(129, 25) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(89, 5) Source(129, 29) + SourceIndex(0) +2 >Emitted(89, 11) Source(129, 35) + SourceIndex(0) +3 >Emitted(89, 12) Source(129, 42) + SourceIndex(0) +4 >Emitted(89, 13) Source(129, 43) + SourceIndex(0) +5 >Emitted(89, 15) Source(129, 45) + SourceIndex(0) +6 >Emitted(89, 16) Source(129, 46) + SourceIndex(0) +7 >Emitted(89, 17) Source(129, 46) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(90, 1) Source(129, 47) + SourceIndex(0) +2 >Emitted(90, 2) Source(129, 48) + SourceIndex(0) +3 >Emitted(90, 3) Source(129, 49) + SourceIndex(0) +--- +>>>objc8.t7 = function (n) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^^^^^^^^^ +7 > ^ +1-> + > +2 >objc8 +3 > . +4 > t7 +5 > = +6 > function( +7 > n: number +1->Emitted(91, 1) Source(130, 1) + SourceIndex(0) +2 >Emitted(91, 6) Source(130, 6) + SourceIndex(0) +3 >Emitted(91, 7) Source(130, 7) + SourceIndex(0) +4 >Emitted(91, 9) Source(130, 9) + SourceIndex(0) +5 >Emitted(91, 12) Source(130, 12) + SourceIndex(0) +6 >Emitted(91, 22) Source(130, 21) + SourceIndex(0) +7 >Emitted(91, 23) Source(130, 30) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > +1 >Emitted(92, 5) Source(130, 34) + SourceIndex(0) +2 >Emitted(92, 11) Source(130, 40) + SourceIndex(0) +3 >Emitted(92, 12) Source(130, 41) + SourceIndex(0) +4 >Emitted(92, 13) Source(130, 42) + SourceIndex(0) +5 >Emitted(92, 14) Source(130, 42) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(93, 1) Source(130, 43) + SourceIndex(0) +2 >Emitted(93, 2) Source(130, 44) + SourceIndex(0) +3 >Emitted(93, 3) Source(130, 45) + SourceIndex(0) +--- +>>>objc8.t8 = function (n) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^^^^^^^^^^ +7 > ^ +1-> + > + > +2 >objc8 +3 > . +4 > t8 +5 > = +6 > function( +7 > n +1->Emitted(94, 1) Source(132, 1) + SourceIndex(0) +2 >Emitted(94, 6) Source(132, 6) + SourceIndex(0) +3 >Emitted(94, 7) Source(132, 7) + SourceIndex(0) +4 >Emitted(94, 9) Source(132, 9) + SourceIndex(0) +5 >Emitted(94, 12) Source(132, 12) + SourceIndex(0) +6 >Emitted(94, 22) Source(132, 21) + SourceIndex(0) +7 >Emitted(94, 23) Source(132, 22) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > ; +1 >Emitted(95, 5) Source(132, 26) + SourceIndex(0) +2 >Emitted(95, 11) Source(132, 32) + SourceIndex(0) +3 >Emitted(95, 12) Source(132, 33) + SourceIndex(0) +4 >Emitted(95, 13) Source(132, 34) + SourceIndex(0) +5 >Emitted(95, 14) Source(132, 35) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(96, 1) Source(132, 36) + SourceIndex(0) +2 >Emitted(96, 2) Source(132, 37) + SourceIndex(0) +3 >Emitted(96, 3) Source(132, 38) + SourceIndex(0) +--- +>>>objc8.t9 = [[], []]; +1-> +2 >^^^^^ +3 > ^ +4 > ^^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^^ +9 > ^^ +10> ^ +11> ^ +12> ^^^^^^-> +1-> + > +2 >objc8 +3 > . +4 > t9 +5 > = +6 > [ +7 > [] +8 > , +9 > [] +10> ] +11> ; +1->Emitted(97, 1) Source(133, 1) + SourceIndex(0) +2 >Emitted(97, 6) Source(133, 6) + SourceIndex(0) +3 >Emitted(97, 7) Source(133, 7) + SourceIndex(0) +4 >Emitted(97, 9) Source(133, 9) + SourceIndex(0) +5 >Emitted(97, 12) Source(133, 12) + SourceIndex(0) +6 >Emitted(97, 13) Source(133, 13) + SourceIndex(0) +7 >Emitted(97, 15) Source(133, 15) + SourceIndex(0) +8 >Emitted(97, 17) Source(133, 16) + SourceIndex(0) +9 >Emitted(97, 19) Source(133, 18) + SourceIndex(0) +10>Emitted(97, 20) Source(133, 19) + SourceIndex(0) +11>Emitted(97, 21) Source(133, 20) + SourceIndex(0) +--- +>>>objc8.t10 = [({}), ({})]; +1-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^^^^^^-> +1-> + > +2 >objc8 +3 > . +4 > t10 +5 > = +6 > [ +7 > ( +8 > {} +9 > ) +10> , +11> ( +12> {} +13> ) +14> ] +15> ; +1->Emitted(98, 1) Source(134, 1) + SourceIndex(0) +2 >Emitted(98, 6) Source(134, 6) + SourceIndex(0) +3 >Emitted(98, 7) Source(134, 7) + SourceIndex(0) +4 >Emitted(98, 10) Source(134, 10) + SourceIndex(0) +5 >Emitted(98, 13) Source(134, 13) + SourceIndex(0) +6 >Emitted(98, 14) Source(134, 20) + SourceIndex(0) +7 >Emitted(98, 15) Source(134, 21) + SourceIndex(0) +8 >Emitted(98, 17) Source(134, 23) + SourceIndex(0) +9 >Emitted(98, 18) Source(134, 24) + SourceIndex(0) +10>Emitted(98, 20) Source(134, 31) + SourceIndex(0) +11>Emitted(98, 21) Source(134, 32) + SourceIndex(0) +12>Emitted(98, 23) Source(134, 34) + SourceIndex(0) +13>Emitted(98, 24) Source(134, 35) + SourceIndex(0) +14>Emitted(98, 25) Source(134, 36) + SourceIndex(0) +15>Emitted(98, 26) Source(134, 37) + SourceIndex(0) +--- +>>>objc8.t11 = [function (n, s) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^^^^^^^^^^ +8 > ^ +9 > ^^ +10> ^ +1-> + > +2 >objc8 +3 > . +4 > t11 +5 > = +6 > [ +7 > function( +8 > n +9 > , +10> s +1->Emitted(99, 1) Source(135, 1) + SourceIndex(0) +2 >Emitted(99, 6) Source(135, 6) + SourceIndex(0) +3 >Emitted(99, 7) Source(135, 7) + SourceIndex(0) +4 >Emitted(99, 10) Source(135, 10) + SourceIndex(0) +5 >Emitted(99, 13) Source(135, 13) + SourceIndex(0) +6 >Emitted(99, 14) Source(135, 14) + SourceIndex(0) +7 >Emitted(99, 24) Source(135, 23) + SourceIndex(0) +8 >Emitted(99, 25) Source(135, 24) + SourceIndex(0) +9 >Emitted(99, 27) Source(135, 26) + SourceIndex(0) +10>Emitted(99, 28) Source(135, 27) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(100, 5) Source(135, 31) + SourceIndex(0) +2 >Emitted(100, 11) Source(135, 37) + SourceIndex(0) +3 >Emitted(100, 12) Source(135, 38) + SourceIndex(0) +4 >Emitted(100, 13) Source(135, 39) + SourceIndex(0) +5 >Emitted(100, 14) Source(135, 40) + SourceIndex(0) +--- +>>>}]; +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^-> +1 > +2 >} +3 > ] +4 > ; +1 >Emitted(101, 1) Source(135, 41) + SourceIndex(0) +2 >Emitted(101, 2) Source(135, 42) + SourceIndex(0) +3 >Emitted(101, 3) Source(135, 43) + SourceIndex(0) +4 >Emitted(101, 4) Source(135, 44) + SourceIndex(0) +--- +>>>objc8.t12 = { +1-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^^-> +1-> + > +2 >objc8 +3 > . +4 > t12 +5 > = +1->Emitted(102, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(102, 6) Source(136, 6) + SourceIndex(0) +3 >Emitted(102, 7) Source(136, 7) + SourceIndex(0) +4 >Emitted(102, 10) Source(136, 10) + SourceIndex(0) +5 >Emitted(102, 13) Source(136, 13) + SourceIndex(0) +--- +>>> foo: ({}) +1->^^^^ +2 > ^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +1->{ + > +2 > foo +3 > : +4 > ( +5 > {} +6 > ) +1->Emitted(103, 5) Source(137, 5) + SourceIndex(0) +2 >Emitted(103, 8) Source(137, 8) + SourceIndex(0) +3 >Emitted(103, 10) Source(137, 16) + SourceIndex(0) +4 >Emitted(103, 11) Source(137, 17) + SourceIndex(0) +5 >Emitted(103, 13) Source(137, 19) + SourceIndex(0) +6 >Emitted(103, 14) Source(137, 20) + SourceIndex(0) +--- +>>>}; +1 >^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > + >} +2 > +1 >Emitted(104, 2) Source(138, 2) + SourceIndex(0) +2 >Emitted(104, 3) Source(138, 2) + SourceIndex(0) +--- +>>>objc8.t13 = ({ +1-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> + > +2 >objc8 +3 > . +4 > t13 +5 > = +6 > ( +1->Emitted(105, 1) Source(139, 1) + SourceIndex(0) +2 >Emitted(105, 6) Source(139, 6) + SourceIndex(0) +3 >Emitted(105, 7) Source(139, 7) + SourceIndex(0) +4 >Emitted(105, 10) Source(139, 10) + SourceIndex(0) +5 >Emitted(105, 13) Source(139, 19) + SourceIndex(0) +6 >Emitted(105, 14) Source(139, 20) + SourceIndex(0) +--- +>>> f: function (i, s) { +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^^ +7 > ^ +1->{ + > +2 > f +3 > : +4 > function( +5 > i +6 > , +7 > s +1->Emitted(106, 5) Source(140, 5) + SourceIndex(0) +2 >Emitted(106, 6) Source(140, 6) + SourceIndex(0) +3 >Emitted(106, 8) Source(140, 8) + SourceIndex(0) +4 >Emitted(106, 18) Source(140, 17) + SourceIndex(0) +5 >Emitted(106, 19) Source(140, 18) + SourceIndex(0) +6 >Emitted(106, 21) Source(140, 20) + SourceIndex(0) +7 >Emitted(106, 22) Source(140, 21) + SourceIndex(0) +--- +>>> return s; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(107, 9) Source(140, 25) + SourceIndex(0) +2 >Emitted(107, 15) Source(140, 31) + SourceIndex(0) +3 >Emitted(107, 16) Source(140, 32) + SourceIndex(0) +4 >Emitted(107, 17) Source(140, 33) + SourceIndex(0) +5 >Emitted(107, 18) Source(140, 34) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > +2 > } +1 >Emitted(108, 5) Source(140, 35) + SourceIndex(0) +2 >Emitted(108, 6) Source(140, 36) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(109, 2) Source(141, 2) + SourceIndex(0) +2 >Emitted(109, 3) Source(141, 3) + SourceIndex(0) +3 >Emitted(109, 4) Source(141, 3) + SourceIndex(0) +--- +>>>objc8.t14 = ({ +1-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^ +1-> + > +2 >objc8 +3 > . +4 > t14 +5 > = +6 > ( +1->Emitted(110, 1) Source(142, 1) + SourceIndex(0) +2 >Emitted(110, 6) Source(142, 6) + SourceIndex(0) +3 >Emitted(110, 7) Source(142, 7) + SourceIndex(0) +4 >Emitted(110, 10) Source(142, 10) + SourceIndex(0) +5 >Emitted(110, 13) Source(142, 19) + SourceIndex(0) +6 >Emitted(110, 14) Source(142, 20) + SourceIndex(0) +--- +>>> a: [] +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^^ +1 >{ + > +2 > a +3 > : +4 > [] +1 >Emitted(111, 5) Source(143, 5) + SourceIndex(0) +2 >Emitted(111, 6) Source(143, 6) + SourceIndex(0) +3 >Emitted(111, 8) Source(143, 8) + SourceIndex(0) +4 >Emitted(111, 10) Source(143, 10) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(112, 2) Source(144, 2) + SourceIndex(0) +2 >Emitted(112, 3) Source(144, 3) + SourceIndex(0) +3 >Emitted(112, 4) Source(144, 3) + SourceIndex(0) +--- +>>>function c9t5(f) { +1-> +2 >^^^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^ +1-> + >// CONTEXT: Function call + > +2 >function +3 > c9t5 +4 > ( +5 > f: (n: number) => IFoo +1->Emitted(113, 1) Source(146, 1) + SourceIndex(0) +2 >Emitted(113, 10) Source(146, 10) + SourceIndex(0) +3 >Emitted(113, 14) Source(146, 14) + SourceIndex(0) +4 >Emitted(113, 15) Source(146, 15) + SourceIndex(0) +5 >Emitted(113, 16) Source(146, 37) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^-> +1 >) { +2 >} +1 >Emitted(114, 1) Source(146, 40) + SourceIndex(0) name (c9t5) +2 >Emitted(114, 2) Source(146, 41) + SourceIndex(0) name (c9t5) +--- +>>>; +1-> +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1-> +2 >; +1->Emitted(115, 1) Source(146, 41) + SourceIndex(0) +2 >Emitted(115, 2) Source(146, 42) + SourceIndex(0) +--- +>>>c9t5(function (n) { +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^-> +1-> + > +2 >c9t5 +3 > ( +4 > function( +5 > n +1->Emitted(116, 1) Source(147, 1) + SourceIndex(0) +2 >Emitted(116, 5) Source(147, 5) + SourceIndex(0) +3 >Emitted(116, 6) Source(147, 6) + SourceIndex(0) +4 >Emitted(116, 16) Source(147, 15) + SourceIndex(0) +5 >Emitted(116, 17) Source(147, 16) + SourceIndex(0) +--- +>>> return ({}); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1->) { + > +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > ; +1->Emitted(117, 5) Source(148, 5) + SourceIndex(0) +2 >Emitted(117, 11) Source(148, 11) + SourceIndex(0) +3 >Emitted(117, 12) Source(148, 18) + SourceIndex(0) +4 >Emitted(117, 13) Source(148, 19) + SourceIndex(0) +5 >Emitted(117, 15) Source(148, 21) + SourceIndex(0) +6 >Emitted(117, 16) Source(148, 22) + SourceIndex(0) +7 >Emitted(117, 17) Source(148, 23) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +3 > ) +4 > ; +1 >Emitted(118, 1) Source(149, 1) + SourceIndex(0) +2 >Emitted(118, 2) Source(149, 2) + SourceIndex(0) +3 >Emitted(118, 3) Source(149, 3) + SourceIndex(0) +4 >Emitted(118, 4) Source(149, 4) + SourceIndex(0) +--- +>>>var c10t5 = function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^-> +1-> + > + >// CONTEXT: Return statement + > +2 >var +3 > c10t5 +4 > : () => (n: number) => IFoo = +1->Emitted(119, 1) Source(152, 1) + SourceIndex(0) +2 >Emitted(119, 5) Source(152, 5) + SourceIndex(0) +3 >Emitted(119, 10) Source(152, 10) + SourceIndex(0) +4 >Emitted(119, 13) Source(152, 40) + SourceIndex(0) +--- +>>> return function (n) { +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function() { +2 > return +3 > +4 > function( +5 > n +1->Emitted(120, 5) Source(152, 53) + SourceIndex(0) +2 >Emitted(120, 11) Source(152, 59) + SourceIndex(0) +3 >Emitted(120, 12) Source(152, 60) + SourceIndex(0) +4 >Emitted(120, 22) Source(152, 69) + SourceIndex(0) +5 >Emitted(120, 23) Source(152, 70) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(121, 9) Source(152, 74) + SourceIndex(0) +2 >Emitted(121, 15) Source(152, 80) + SourceIndex(0) +3 >Emitted(121, 16) Source(152, 87) + SourceIndex(0) +4 >Emitted(121, 17) Source(152, 88) + SourceIndex(0) +5 >Emitted(121, 19) Source(152, 90) + SourceIndex(0) +6 >Emitted(121, 20) Source(152, 91) + SourceIndex(0) +7 >Emitted(121, 21) Source(152, 91) + SourceIndex(0) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^ +1 > +2 > } +3 > +1 >Emitted(122, 5) Source(152, 92) + SourceIndex(0) +2 >Emitted(122, 6) Source(152, 93) + SourceIndex(0) +3 >Emitted(122, 7) Source(152, 93) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(123, 1) Source(152, 94) + SourceIndex(0) +2 >Emitted(123, 2) Source(152, 95) + SourceIndex(0) +3 >Emitted(123, 3) Source(152, 96) + SourceIndex(0) +--- +>>>var C11t5 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^-> +1-> + > + >// CONTEXT: Newing a class + > +2 >class +3 > C11t5 +1->Emitted(124, 1) Source(155, 1) + SourceIndex(0) +2 >Emitted(124, 5) Source(155, 7) + SourceIndex(0) +3 >Emitted(124, 10) Source(155, 12) + SourceIndex(0) +--- +>>> function C11t5(f) { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^ +5 > ^ +1-> { +2 > +3 > C11t5 +4 > { constructor( +5 > f: (n: number) => IFoo +1->Emitted(125, 5) Source(155, 15) + SourceIndex(0) name (C11t5) +2 >Emitted(125, 14) Source(155, 7) + SourceIndex(0) name (C11t5) +3 >Emitted(125, 19) Source(155, 12) + SourceIndex(0) name (C11t5) +4 >Emitted(125, 20) Source(155, 27) + SourceIndex(0) name (C11t5) +5 >Emitted(125, 21) Source(155, 49) + SourceIndex(0) name (C11t5) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 >) { +2 > } +1 >Emitted(126, 5) Source(155, 53) + SourceIndex(0) name (C11t5.constructor) +2 >Emitted(126, 6) Source(155, 54) + SourceIndex(0) name (C11t5.constructor) +--- +>>> return C11t5; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(127, 5) Source(155, 55) + SourceIndex(0) name (C11t5) +2 >Emitted(127, 17) Source(155, 56) + SourceIndex(0) name (C11t5) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +1 > +2 >} +3 > +4 > class C11t5 { constructor(f: (n: number) => IFoo) { } } +1 >Emitted(128, 1) Source(155, 55) + SourceIndex(0) name (C11t5) +2 >Emitted(128, 2) Source(155, 56) + SourceIndex(0) name (C11t5) +3 >Emitted(128, 2) Source(155, 1) + SourceIndex(0) +4 >Emitted(128, 6) Source(155, 56) + SourceIndex(0) +--- +>>>; +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >; +1 >Emitted(129, 1) Source(155, 56) + SourceIndex(0) +2 >Emitted(129, 2) Source(155, 57) + SourceIndex(0) +--- +>>>var i = new C11t5(function (n) { +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^ +9 > ^ +1-> + > +2 >var +3 > i +4 > = +5 > new +6 > C11t5 +7 > ( +8 > function( +9 > n +1->Emitted(130, 1) Source(156, 1) + SourceIndex(0) +2 >Emitted(130, 5) Source(156, 5) + SourceIndex(0) +3 >Emitted(130, 6) Source(156, 6) + SourceIndex(0) +4 >Emitted(130, 9) Source(156, 9) + SourceIndex(0) +5 >Emitted(130, 13) Source(156, 13) + SourceIndex(0) +6 >Emitted(130, 18) Source(156, 18) + SourceIndex(0) +7 >Emitted(130, 19) Source(156, 19) + SourceIndex(0) +8 >Emitted(130, 29) Source(156, 28) + SourceIndex(0) +9 >Emitted(130, 30) Source(156, 29) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(131, 5) Source(156, 33) + SourceIndex(0) +2 >Emitted(131, 11) Source(156, 39) + SourceIndex(0) +3 >Emitted(131, 12) Source(156, 46) + SourceIndex(0) +4 >Emitted(131, 13) Source(156, 47) + SourceIndex(0) +5 >Emitted(131, 15) Source(156, 49) + SourceIndex(0) +6 >Emitted(131, 16) Source(156, 50) + SourceIndex(0) +7 >Emitted(131, 17) Source(156, 50) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ) +4 > ; +1 >Emitted(132, 1) Source(156, 51) + SourceIndex(0) +2 >Emitted(132, 2) Source(156, 52) + SourceIndex(0) +3 >Emitted(132, 3) Source(156, 53) + SourceIndex(0) +4 >Emitted(132, 4) Source(156, 54) + SourceIndex(0) +--- +>>>var c12t1 = (function (s) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +1-> + > + >// CONTEXT: Type annotated expression + > +2 >var +3 > c12t1 +4 > = <(s: string) => string> +5 > ( +6 > function( +7 > s +1->Emitted(133, 1) Source(159, 1) + SourceIndex(0) +2 >Emitted(133, 5) Source(159, 5) + SourceIndex(0) +3 >Emitted(133, 10) Source(159, 10) + SourceIndex(0) +4 >Emitted(133, 13) Source(159, 37) + SourceIndex(0) +5 >Emitted(133, 14) Source(159, 38) + SourceIndex(0) +6 >Emitted(133, 24) Source(159, 47) + SourceIndex(0) +7 >Emitted(133, 25) Source(159, 48) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > +1 >Emitted(134, 5) Source(159, 52) + SourceIndex(0) +2 >Emitted(134, 11) Source(159, 58) + SourceIndex(0) +3 >Emitted(134, 12) Source(159, 59) + SourceIndex(0) +4 >Emitted(134, 13) Source(159, 60) + SourceIndex(0) +5 >Emitted(134, 14) Source(159, 60) + SourceIndex(0) +--- +>>>}); +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > ) +4 > ; +1 >Emitted(135, 1) Source(159, 61) + SourceIndex(0) +2 >Emitted(135, 2) Source(159, 62) + SourceIndex(0) +3 >Emitted(135, 3) Source(159, 63) + SourceIndex(0) +4 >Emitted(135, 4) Source(159, 64) + SourceIndex(0) +--- +>>>var c12t2 = ({ +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +1-> + > +2 >var +3 > c12t2 +4 > = +5 > ( +1->Emitted(136, 1) Source(160, 1) + SourceIndex(0) +2 >Emitted(136, 5) Source(160, 5) + SourceIndex(0) +3 >Emitted(136, 10) Source(160, 10) + SourceIndex(0) +4 >Emitted(136, 13) Source(160, 20) + SourceIndex(0) +5 >Emitted(136, 14) Source(160, 21) + SourceIndex(0) +--- +>>> n: 1 +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 >{ + > +2 > n +3 > : +4 > 1 +1 >Emitted(137, 5) Source(161, 5) + SourceIndex(0) +2 >Emitted(137, 6) Source(161, 6) + SourceIndex(0) +3 >Emitted(137, 8) Source(161, 8) + SourceIndex(0) +4 >Emitted(137, 9) Source(161, 9) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > ; +1 >Emitted(138, 2) Source(162, 2) + SourceIndex(0) +2 >Emitted(138, 3) Source(162, 3) + SourceIndex(0) +3 >Emitted(138, 4) Source(162, 4) + SourceIndex(0) +--- +>>>var c12t3 = []; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^-> +1-> + > +2 >var +3 > c12t3 +4 > = +5 > [] +6 > ; +1->Emitted(139, 1) Source(163, 1) + SourceIndex(0) +2 >Emitted(139, 5) Source(163, 5) + SourceIndex(0) +3 >Emitted(139, 10) Source(163, 10) + SourceIndex(0) +4 >Emitted(139, 13) Source(163, 24) + SourceIndex(0) +5 >Emitted(139, 15) Source(163, 26) + SourceIndex(0) +6 >Emitted(139, 16) Source(163, 27) + SourceIndex(0) +--- +>>>var c12t4 = function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^-> +1-> + > +2 >var +3 > c12t4 +4 > = <() => IFoo> +1->Emitted(140, 1) Source(164, 1) + SourceIndex(0) +2 >Emitted(140, 5) Source(164, 5) + SourceIndex(0) +3 >Emitted(140, 10) Source(164, 10) + SourceIndex(0) +4 >Emitted(140, 13) Source(164, 26) + SourceIndex(0) +--- +>>> return ({}); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1->function() { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1->Emitted(141, 5) Source(164, 39) + SourceIndex(0) +2 >Emitted(141, 11) Source(164, 45) + SourceIndex(0) +3 >Emitted(141, 12) Source(164, 52) + SourceIndex(0) +4 >Emitted(141, 13) Source(164, 53) + SourceIndex(0) +5 >Emitted(141, 15) Source(164, 55) + SourceIndex(0) +6 >Emitted(141, 16) Source(164, 56) + SourceIndex(0) +7 >Emitted(141, 17) Source(164, 56) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(142, 1) Source(164, 57) + SourceIndex(0) +2 >Emitted(142, 2) Source(164, 58) + SourceIndex(0) +3 >Emitted(142, 3) Source(164, 59) + SourceIndex(0) +--- +>>>var c12t5 = function (n) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > +2 >var +3 > c12t5 +4 > = <(n: number) => IFoo> +5 > function( +6 > n +1->Emitted(143, 1) Source(165, 1) + SourceIndex(0) +2 >Emitted(143, 5) Source(165, 5) + SourceIndex(0) +3 >Emitted(143, 10) Source(165, 10) + SourceIndex(0) +4 >Emitted(143, 13) Source(165, 35) + SourceIndex(0) +5 >Emitted(143, 23) Source(165, 44) + SourceIndex(0) +6 >Emitted(143, 24) Source(165, 45) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(144, 5) Source(165, 49) + SourceIndex(0) +2 >Emitted(144, 11) Source(165, 55) + SourceIndex(0) +3 >Emitted(144, 12) Source(165, 62) + SourceIndex(0) +4 >Emitted(144, 13) Source(165, 63) + SourceIndex(0) +5 >Emitted(144, 15) Source(165, 65) + SourceIndex(0) +6 >Emitted(144, 16) Source(165, 66) + SourceIndex(0) +7 >Emitted(144, 17) Source(165, 66) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(145, 1) Source(165, 67) + SourceIndex(0) +2 >Emitted(145, 2) Source(165, 68) + SourceIndex(0) +3 >Emitted(145, 3) Source(165, 69) + SourceIndex(0) +--- +>>>var c12t6 = function (n, s) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +7 > ^^ +8 > ^ +1-> + > +2 >var +3 > c12t6 +4 > = <(n: number, s: string) => IFoo> +5 > function( +6 > n +7 > , +8 > s +1->Emitted(146, 1) Source(166, 1) + SourceIndex(0) +2 >Emitted(146, 5) Source(166, 5) + SourceIndex(0) +3 >Emitted(146, 10) Source(166, 10) + SourceIndex(0) +4 >Emitted(146, 13) Source(166, 46) + SourceIndex(0) +5 >Emitted(146, 23) Source(166, 55) + SourceIndex(0) +6 >Emitted(146, 24) Source(166, 56) + SourceIndex(0) +7 >Emitted(146, 26) Source(166, 58) + SourceIndex(0) +8 >Emitted(146, 27) Source(166, 59) + SourceIndex(0) +--- +>>> return ({}); +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +1 >) { +2 > return +3 > +4 > ( +5 > {} +6 > ) +7 > +1 >Emitted(147, 5) Source(166, 63) + SourceIndex(0) +2 >Emitted(147, 11) Source(166, 69) + SourceIndex(0) +3 >Emitted(147, 12) Source(166, 76) + SourceIndex(0) +4 >Emitted(147, 13) Source(166, 77) + SourceIndex(0) +5 >Emitted(147, 15) Source(166, 79) + SourceIndex(0) +6 >Emitted(147, 16) Source(166, 80) + SourceIndex(0) +7 >Emitted(147, 17) Source(166, 80) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(148, 1) Source(166, 81) + SourceIndex(0) +2 >Emitted(148, 2) Source(166, 82) + SourceIndex(0) +3 >Emitted(148, 3) Source(166, 83) + SourceIndex(0) +--- +>>>var c12t7 = function (n) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > +2 >var +3 > c12t7 +4 > = <{ + > (n: number, s: string): number; + > //(s1: string, s2: string): number; + > }> +5 > function( +6 > n:number +1->Emitted(149, 1) Source(167, 1) + SourceIndex(0) +2 >Emitted(149, 5) Source(167, 5) + SourceIndex(0) +3 >Emitted(149, 10) Source(167, 10) + SourceIndex(0) +4 >Emitted(149, 13) Source(170, 4) + SourceIndex(0) +5 >Emitted(149, 23) Source(170, 13) + SourceIndex(0) +6 >Emitted(149, 24) Source(170, 21) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > +1 >Emitted(150, 5) Source(170, 25) + SourceIndex(0) +2 >Emitted(150, 11) Source(170, 31) + SourceIndex(0) +3 >Emitted(150, 12) Source(170, 32) + SourceIndex(0) +4 >Emitted(150, 13) Source(170, 33) + SourceIndex(0) +5 >Emitted(150, 14) Source(170, 33) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(151, 1) Source(170, 34) + SourceIndex(0) +2 >Emitted(151, 2) Source(170, 35) + SourceIndex(0) +3 >Emitted(151, 3) Source(170, 36) + SourceIndex(0) +--- +>>>var c12t8 = function (n) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +1-> + > + > +2 >var +3 > c12t8 +4 > = <(n: number, s: string) => number> +5 > function( +6 > n +1->Emitted(152, 1) Source(172, 1) + SourceIndex(0) +2 >Emitted(152, 5) Source(172, 5) + SourceIndex(0) +3 >Emitted(152, 10) Source(172, 10) + SourceIndex(0) +4 >Emitted(152, 13) Source(172, 48) + SourceIndex(0) +5 >Emitted(152, 23) Source(172, 57) + SourceIndex(0) +6 >Emitted(152, 24) Source(172, 58) + SourceIndex(0) +--- +>>> return n; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > n +5 > ; +1 >Emitted(153, 5) Source(172, 62) + SourceIndex(0) +2 >Emitted(153, 11) Source(172, 68) + SourceIndex(0) +3 >Emitted(153, 12) Source(172, 69) + SourceIndex(0) +4 >Emitted(153, 13) Source(172, 70) + SourceIndex(0) +5 >Emitted(153, 14) Source(172, 71) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > ; +1 >Emitted(154, 1) Source(172, 72) + SourceIndex(0) +2 >Emitted(154, 2) Source(172, 73) + SourceIndex(0) +3 >Emitted(154, 3) Source(172, 74) + SourceIndex(0) +--- +>>>var c12t9 = [[], []]; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^ +8 > ^^ +9 > ^ +10> ^ +11> ^^^^^^-> +1-> + > +2 >var +3 > c12t9 +4 > = +5 > [ +6 > [] +7 > , +8 > [] +9 > ] +10> ; +1->Emitted(155, 1) Source(173, 1) + SourceIndex(0) +2 >Emitted(155, 5) Source(173, 5) + SourceIndex(0) +3 >Emitted(155, 10) Source(173, 10) + SourceIndex(0) +4 >Emitted(155, 13) Source(173, 26) + SourceIndex(0) +5 >Emitted(155, 14) Source(173, 27) + SourceIndex(0) +6 >Emitted(155, 16) Source(173, 29) + SourceIndex(0) +7 >Emitted(155, 18) Source(173, 30) + SourceIndex(0) +8 >Emitted(155, 20) Source(173, 32) + SourceIndex(0) +9 >Emitted(155, 21) Source(173, 33) + SourceIndex(0) +10>Emitted(155, 22) Source(173, 34) + SourceIndex(0) +--- +>>>var c12t10 = [({}), ({})]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^-> +1-> + > +2 >var +3 > c12t10 +4 > = +5 > [ +6 > ( +7 > {} +8 > ) +9 > , +10> ( +11> {} +12> ) +13> ] +14> ; +1->Emitted(156, 1) Source(174, 1) + SourceIndex(0) +2 >Emitted(156, 5) Source(174, 5) + SourceIndex(0) +3 >Emitted(156, 11) Source(174, 11) + SourceIndex(0) +4 >Emitted(156, 14) Source(174, 23) + SourceIndex(0) +5 >Emitted(156, 15) Source(174, 30) + SourceIndex(0) +6 >Emitted(156, 16) Source(174, 31) + SourceIndex(0) +7 >Emitted(156, 18) Source(174, 33) + SourceIndex(0) +8 >Emitted(156, 19) Source(174, 34) + SourceIndex(0) +9 >Emitted(156, 21) Source(174, 41) + SourceIndex(0) +10>Emitted(156, 22) Source(174, 42) + SourceIndex(0) +11>Emitted(156, 24) Source(174, 44) + SourceIndex(0) +12>Emitted(156, 25) Source(174, 45) + SourceIndex(0) +13>Emitted(156, 26) Source(174, 46) + SourceIndex(0) +14>Emitted(156, 27) Source(174, 47) + SourceIndex(0) +--- +>>>var c12t11 = [function (n, s) { +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +1-> + > +2 >var +3 > c12t11 +4 > = <{(n: number, s: string): string;}[]> +5 > [ +6 > function( +7 > n +8 > , +9 > s +1->Emitted(157, 1) Source(175, 1) + SourceIndex(0) +2 >Emitted(157, 5) Source(175, 5) + SourceIndex(0) +3 >Emitted(157, 11) Source(175, 11) + SourceIndex(0) +4 >Emitted(157, 14) Source(175, 52) + SourceIndex(0) +5 >Emitted(157, 15) Source(175, 53) + SourceIndex(0) +6 >Emitted(157, 25) Source(175, 62) + SourceIndex(0) +7 >Emitted(157, 26) Source(175, 63) + SourceIndex(0) +8 >Emitted(157, 28) Source(175, 65) + SourceIndex(0) +9 >Emitted(157, 29) Source(175, 66) + SourceIndex(0) +--- +>>> return s; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(158, 5) Source(175, 70) + SourceIndex(0) +2 >Emitted(158, 11) Source(175, 76) + SourceIndex(0) +3 >Emitted(158, 12) Source(175, 77) + SourceIndex(0) +4 >Emitted(158, 13) Source(175, 78) + SourceIndex(0) +5 >Emitted(158, 14) Source(175, 79) + SourceIndex(0) +--- +>>>}]; +1 > +2 >^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > ] +4 > ; +1 >Emitted(159, 1) Source(175, 80) + SourceIndex(0) +2 >Emitted(159, 2) Source(175, 81) + SourceIndex(0) +3 >Emitted(159, 3) Source(175, 82) + SourceIndex(0) +4 >Emitted(159, 4) Source(175, 83) + SourceIndex(0) +--- +>>>var c12t12 = { +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^-> +1-> + > +2 >var +3 > c12t12 +4 > = +1->Emitted(160, 1) Source(176, 1) + SourceIndex(0) +2 >Emitted(160, 5) Source(176, 5) + SourceIndex(0) +3 >Emitted(160, 11) Source(176, 11) + SourceIndex(0) +4 >Emitted(160, 14) Source(176, 21) + SourceIndex(0) +--- +>>> foo: ({}) +1->^^^^ +2 > ^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +1->{ + > +2 > foo +3 > : +4 > ( +5 > {} +6 > ) +1->Emitted(161, 5) Source(177, 5) + SourceIndex(0) +2 >Emitted(161, 8) Source(177, 8) + SourceIndex(0) +3 >Emitted(161, 10) Source(177, 16) + SourceIndex(0) +4 >Emitted(161, 11) Source(177, 17) + SourceIndex(0) +5 >Emitted(161, 13) Source(177, 19) + SourceIndex(0) +6 >Emitted(161, 14) Source(177, 20) + SourceIndex(0) +--- +>>>}; +1 >^ +2 > ^ +3 > ^^^^^^^^^^^^^^-> +1 > + >} +2 > +1 >Emitted(162, 2) Source(178, 2) + SourceIndex(0) +2 >Emitted(162, 3) Source(178, 2) + SourceIndex(0) +--- +>>>var c12t13 = ({ +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1-> + > +2 >var +3 > c12t13 +4 > = +5 > ( +1->Emitted(163, 1) Source(179, 1) + SourceIndex(0) +2 >Emitted(163, 5) Source(179, 5) + SourceIndex(0) +3 >Emitted(163, 11) Source(179, 11) + SourceIndex(0) +4 >Emitted(163, 14) Source(179, 21) + SourceIndex(0) +5 >Emitted(163, 15) Source(179, 22) + SourceIndex(0) +--- +>>> f: function (i, s) { +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^^ +7 > ^ +1->{ + > +2 > f +3 > : +4 > function( +5 > i +6 > , +7 > s +1->Emitted(164, 5) Source(180, 5) + SourceIndex(0) +2 >Emitted(164, 6) Source(180, 6) + SourceIndex(0) +3 >Emitted(164, 8) Source(180, 8) + SourceIndex(0) +4 >Emitted(164, 18) Source(180, 17) + SourceIndex(0) +5 >Emitted(164, 19) Source(180, 18) + SourceIndex(0) +6 >Emitted(164, 21) Source(180, 20) + SourceIndex(0) +7 >Emitted(164, 22) Source(180, 21) + SourceIndex(0) +--- +>>> return s; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >) { +2 > return +3 > +4 > s +5 > ; +1 >Emitted(165, 9) Source(180, 25) + SourceIndex(0) +2 >Emitted(165, 15) Source(180, 31) + SourceIndex(0) +3 >Emitted(165, 16) Source(180, 32) + SourceIndex(0) +4 >Emitted(165, 17) Source(180, 33) + SourceIndex(0) +5 >Emitted(165, 18) Source(180, 34) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > +2 > } +1 >Emitted(166, 5) Source(180, 35) + SourceIndex(0) +2 >Emitted(166, 6) Source(180, 36) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(167, 2) Source(181, 2) + SourceIndex(0) +2 >Emitted(167, 3) Source(181, 3) + SourceIndex(0) +3 >Emitted(167, 4) Source(181, 3) + SourceIndex(0) +--- +>>>var c12t14 = ({ +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +1-> + > +2 >var +3 > c12t14 +4 > = +5 > ( +1->Emitted(168, 1) Source(182, 1) + SourceIndex(0) +2 >Emitted(168, 5) Source(182, 5) + SourceIndex(0) +3 >Emitted(168, 11) Source(182, 11) + SourceIndex(0) +4 >Emitted(168, 14) Source(182, 21) + SourceIndex(0) +5 >Emitted(168, 15) Source(182, 22) + SourceIndex(0) +--- +>>> a: [] +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^^ +1 >{ + > +2 > a +3 > : +4 > [] +1 >Emitted(169, 5) Source(183, 5) + SourceIndex(0) +2 >Emitted(169, 6) Source(183, 6) + SourceIndex(0) +3 >Emitted(169, 8) Source(183, 8) + SourceIndex(0) +4 >Emitted(169, 10) Source(183, 10) + SourceIndex(0) +--- +>>>}); +1 >^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^-> +1 > + >} +2 > ) +3 > +1 >Emitted(170, 2) Source(184, 2) + SourceIndex(0) +2 >Emitted(170, 3) Source(184, 3) + SourceIndex(0) +3 >Emitted(170, 4) Source(184, 3) + SourceIndex(0) +--- +>>>function EF1(a, b) { +1-> +2 >^^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^-> +1-> + > + >// CONTEXT: Contextual typing declarations + > + >// contextually typing function declarations + >declare function EF1(a:number, b:number):number; + > + > +2 >function +3 > EF1 +4 > ( +5 > a +6 > , +7 > b +1->Emitted(171, 1) Source(191, 1) + SourceIndex(0) +2 >Emitted(171, 10) Source(191, 10) + SourceIndex(0) +3 >Emitted(171, 13) Source(191, 13) + SourceIndex(0) +4 >Emitted(171, 14) Source(191, 14) + SourceIndex(0) +5 >Emitted(171, 15) Source(191, 15) + SourceIndex(0) +6 >Emitted(171, 17) Source(191, 16) + SourceIndex(0) +7 >Emitted(171, 18) Source(191, 17) + SourceIndex(0) +--- +>>> return a + b; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +1->) { +2 > return +3 > +4 > a +5 > + +6 > b +7 > ; +1->Emitted(172, 5) Source(191, 21) + SourceIndex(0) name (EF1) +2 >Emitted(172, 11) Source(191, 27) + SourceIndex(0) name (EF1) +3 >Emitted(172, 12) Source(191, 28) + SourceIndex(0) name (EF1) +4 >Emitted(172, 13) Source(191, 29) + SourceIndex(0) name (EF1) +5 >Emitted(172, 16) Source(191, 30) + SourceIndex(0) name (EF1) +6 >Emitted(172, 17) Source(191, 31) + SourceIndex(0) name (EF1) +7 >Emitted(172, 18) Source(191, 32) + SourceIndex(0) name (EF1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +1 >Emitted(173, 1) Source(191, 33) + SourceIndex(0) name (EF1) +2 >Emitted(173, 2) Source(191, 34) + SourceIndex(0) name (EF1) +--- +>>>var efv = EF1(1, 2); +1-> +2 >^^^^ +3 > ^^^ +4 > ^^^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +12> ^^^-> +1-> + > + > +2 >var +3 > efv +4 > = +5 > EF1 +6 > ( +7 > 1 +8 > , +9 > 2 +10> ) +11> ; +1->Emitted(174, 1) Source(193, 1) + SourceIndex(0) +2 >Emitted(174, 5) Source(193, 5) + SourceIndex(0) +3 >Emitted(174, 8) Source(193, 8) + SourceIndex(0) +4 >Emitted(174, 11) Source(193, 11) + SourceIndex(0) +5 >Emitted(174, 14) Source(193, 14) + SourceIndex(0) +6 >Emitted(174, 15) Source(193, 15) + SourceIndex(0) +7 >Emitted(174, 16) Source(193, 16) + SourceIndex(0) +8 >Emitted(174, 18) Source(193, 17) + SourceIndex(0) +9 >Emitted(174, 19) Source(193, 18) + SourceIndex(0) +10>Emitted(174, 20) Source(193, 19) + SourceIndex(0) +11>Emitted(174, 21) Source(193, 20) + SourceIndex(0) +--- +>>>function Point(x, y) { +1-> +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^ +1-> + > + > + >// contextually typing from ambient class declarations + >declare class Point + >{ + > constructor(x: number, y: number); + > x: number; + > y: number; + > add(dx: number, dy: number): Point; + > static origin: Point; + > + >} + > + > +2 >function +3 > Point +4 > ( +5 > x +6 > , +7 > y +1->Emitted(175, 1) Source(207, 1) + SourceIndex(0) +2 >Emitted(175, 10) Source(207, 10) + SourceIndex(0) +3 >Emitted(175, 15) Source(207, 15) + SourceIndex(0) +4 >Emitted(175, 16) Source(207, 16) + SourceIndex(0) +5 >Emitted(175, 17) Source(207, 17) + SourceIndex(0) +6 >Emitted(175, 19) Source(207, 19) + SourceIndex(0) +7 >Emitted(175, 20) Source(207, 20) + SourceIndex(0) +--- +>>> this.x = x; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^-> +1 >) { + > +2 > this +3 > . +4 > x +5 > = +6 > x +7 > ; +1 >Emitted(176, 5) Source(208, 5) + SourceIndex(0) name (Point) +2 >Emitted(176, 9) Source(208, 9) + SourceIndex(0) name (Point) +3 >Emitted(176, 10) Source(208, 10) + SourceIndex(0) name (Point) +4 >Emitted(176, 11) Source(208, 11) + SourceIndex(0) name (Point) +5 >Emitted(176, 14) Source(208, 14) + SourceIndex(0) name (Point) +6 >Emitted(176, 15) Source(208, 15) + SourceIndex(0) name (Point) +7 >Emitted(176, 16) Source(208, 16) + SourceIndex(0) name (Point) +--- +>>> this.y = y; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^-> +1-> + > +2 > this +3 > . +4 > y +5 > = +6 > y +7 > ; +1->Emitted(177, 5) Source(209, 5) + SourceIndex(0) name (Point) +2 >Emitted(177, 9) Source(209, 9) + SourceIndex(0) name (Point) +3 >Emitted(177, 10) Source(209, 10) + SourceIndex(0) name (Point) +4 >Emitted(177, 11) Source(209, 11) + SourceIndex(0) name (Point) +5 >Emitted(177, 14) Source(209, 14) + SourceIndex(0) name (Point) +6 >Emitted(177, 15) Source(209, 15) + SourceIndex(0) name (Point) +7 >Emitted(177, 16) Source(209, 16) + SourceIndex(0) name (Point) +--- +>>> return this; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1-> + > + > +2 > return +3 > +4 > this +5 > ; +1->Emitted(178, 5) Source(211, 5) + SourceIndex(0) name (Point) +2 >Emitted(178, 11) Source(211, 11) + SourceIndex(0) name (Point) +3 >Emitted(178, 12) Source(211, 12) + SourceIndex(0) name (Point) +4 >Emitted(178, 16) Source(211, 16) + SourceIndex(0) name (Point) +5 >Emitted(178, 17) Source(211, 17) + SourceIndex(0) name (Point) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(179, 1) Source(212, 1) + SourceIndex(0) name (Point) +2 >Emitted(179, 2) Source(212, 2) + SourceIndex(0) name (Point) +--- +>>>Point.origin = new Point(0, 0); +1-> +2 >^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ +14> ^^^^^^^^^^^-> +1-> + > + > +2 >Point +3 > . +4 > origin +5 > = +6 > new +7 > Point +8 > ( +9 > 0 +10> , +11> 0 +12> ) +13> ; +1->Emitted(180, 1) Source(214, 1) + SourceIndex(0) +2 >Emitted(180, 6) Source(214, 6) + SourceIndex(0) +3 >Emitted(180, 7) Source(214, 7) + SourceIndex(0) +4 >Emitted(180, 13) Source(214, 13) + SourceIndex(0) +5 >Emitted(180, 16) Source(214, 16) + SourceIndex(0) +6 >Emitted(180, 20) Source(214, 20) + SourceIndex(0) +7 >Emitted(180, 25) Source(214, 25) + SourceIndex(0) +8 >Emitted(180, 26) Source(214, 26) + SourceIndex(0) +9 >Emitted(180, 27) Source(214, 27) + SourceIndex(0) +10>Emitted(180, 29) Source(214, 29) + SourceIndex(0) +11>Emitted(180, 30) Source(214, 30) + SourceIndex(0) +12>Emitted(180, 31) Source(214, 31) + SourceIndex(0) +13>Emitted(180, 32) Source(214, 32) + SourceIndex(0) +--- +>>>Point.prototype.add = function (dx, dy) { +1-> +2 >^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +6 > ^^^ +7 > ^^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^ +12> ^^^^^^^^^^-> +1-> + > + > +2 >Point +3 > . +4 > prototype +5 > . +6 > add +7 > = +8 > function( +9 > dx +10> , +11> dy +1->Emitted(181, 1) Source(216, 1) + SourceIndex(0) +2 >Emitted(181, 6) Source(216, 6) + SourceIndex(0) +3 >Emitted(181, 7) Source(216, 7) + SourceIndex(0) +4 >Emitted(181, 16) Source(216, 16) + SourceIndex(0) +5 >Emitted(181, 17) Source(216, 17) + SourceIndex(0) +6 >Emitted(181, 20) Source(216, 20) + SourceIndex(0) +7 >Emitted(181, 23) Source(216, 23) + SourceIndex(0) +8 >Emitted(181, 33) Source(216, 32) + SourceIndex(0) +9 >Emitted(181, 35) Source(216, 34) + SourceIndex(0) +10>Emitted(181, 37) Source(216, 36) + SourceIndex(0) +11>Emitted(181, 39) Source(216, 38) + SourceIndex(0) +--- +>>> return new Point(this.x + dx, this.y + dy); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^ +16> ^^^ +17> ^^ +18> ^ +19> ^ +1->) { + > +2 > return +3 > +4 > new +5 > Point +6 > ( +7 > this +8 > . +9 > x +10> + +11> dx +12> , +13> this +14> . +15> y +16> + +17> dy +18> ) +19> ; +1->Emitted(182, 5) Source(217, 5) + SourceIndex(0) +2 >Emitted(182, 11) Source(217, 11) + SourceIndex(0) +3 >Emitted(182, 12) Source(217, 12) + SourceIndex(0) +4 >Emitted(182, 16) Source(217, 16) + SourceIndex(0) +5 >Emitted(182, 21) Source(217, 21) + SourceIndex(0) +6 >Emitted(182, 22) Source(217, 22) + SourceIndex(0) +7 >Emitted(182, 26) Source(217, 26) + SourceIndex(0) +8 >Emitted(182, 27) Source(217, 27) + SourceIndex(0) +9 >Emitted(182, 28) Source(217, 28) + SourceIndex(0) +10>Emitted(182, 31) Source(217, 31) + SourceIndex(0) +11>Emitted(182, 33) Source(217, 33) + SourceIndex(0) +12>Emitted(182, 35) Source(217, 35) + SourceIndex(0) +13>Emitted(182, 39) Source(217, 39) + SourceIndex(0) +14>Emitted(182, 40) Source(217, 40) + SourceIndex(0) +15>Emitted(182, 41) Source(217, 41) + SourceIndex(0) +16>Emitted(182, 44) Source(217, 44) + SourceIndex(0) +17>Emitted(182, 46) Source(217, 46) + SourceIndex(0) +18>Emitted(182, 47) Source(217, 47) + SourceIndex(0) +19>Emitted(182, 48) Source(217, 48) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +3 > ; +1 >Emitted(183, 1) Source(218, 1) + SourceIndex(0) +2 >Emitted(183, 2) Source(218, 2) + SourceIndex(0) +3 >Emitted(183, 3) Source(218, 3) + SourceIndex(0) +--- +>>>Point.prototype = { +1-> +2 >^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^^^ +1-> + > + > +2 >Point +3 > . +4 > prototype +5 > = +1->Emitted(184, 1) Source(220, 1) + SourceIndex(0) +2 >Emitted(184, 6) Source(220, 6) + SourceIndex(0) +3 >Emitted(184, 7) Source(220, 7) + SourceIndex(0) +4 >Emitted(184, 16) Source(220, 16) + SourceIndex(0) +5 >Emitted(184, 19) Source(220, 19) + SourceIndex(0) +--- +>>> x: 0, +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^-> +1 >{ + > +2 > x +3 > : +4 > 0 +1 >Emitted(185, 5) Source(221, 5) + SourceIndex(0) +2 >Emitted(185, 6) Source(221, 6) + SourceIndex(0) +3 >Emitted(185, 8) Source(221, 8) + SourceIndex(0) +4 >Emitted(185, 9) Source(221, 9) + SourceIndex(0) +--- +>>> y: 0, +1->^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > y +3 > : +4 > 0 +1->Emitted(186, 5) Source(222, 5) + SourceIndex(0) +2 >Emitted(186, 6) Source(222, 6) + SourceIndex(0) +3 >Emitted(186, 8) Source(222, 8) + SourceIndex(0) +4 >Emitted(186, 9) Source(222, 9) + SourceIndex(0) +--- +>>> add: function (dx, dy) { +1->^^^^ +2 > ^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > add +3 > : +4 > function( +5 > dx +6 > , +7 > dy +1->Emitted(187, 5) Source(223, 5) + SourceIndex(0) +2 >Emitted(187, 8) Source(223, 8) + SourceIndex(0) +3 >Emitted(187, 10) Source(223, 10) + SourceIndex(0) +4 >Emitted(187, 20) Source(223, 19) + SourceIndex(0) +5 >Emitted(187, 22) Source(223, 21) + SourceIndex(0) +6 >Emitted(187, 24) Source(223, 23) + SourceIndex(0) +7 >Emitted(187, 26) Source(223, 25) + SourceIndex(0) +--- +>>> return new Point(this.x + dx, this.y + dy); +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^ +16> ^^^ +17> ^^ +18> ^ +19> ^ +1->) { + > +2 > return +3 > +4 > new +5 > Point +6 > ( +7 > this +8 > . +9 > x +10> + +11> dx +12> , +13> this +14> . +15> y +16> + +17> dy +18> ) +19> ; +1->Emitted(188, 9) Source(224, 9) + SourceIndex(0) +2 >Emitted(188, 15) Source(224, 15) + SourceIndex(0) +3 >Emitted(188, 16) Source(224, 16) + SourceIndex(0) +4 >Emitted(188, 20) Source(224, 20) + SourceIndex(0) +5 >Emitted(188, 25) Source(224, 25) + SourceIndex(0) +6 >Emitted(188, 26) Source(224, 26) + SourceIndex(0) +7 >Emitted(188, 30) Source(224, 30) + SourceIndex(0) +8 >Emitted(188, 31) Source(224, 31) + SourceIndex(0) +9 >Emitted(188, 32) Source(224, 32) + SourceIndex(0) +10>Emitted(188, 35) Source(224, 35) + SourceIndex(0) +11>Emitted(188, 37) Source(224, 37) + SourceIndex(0) +12>Emitted(188, 39) Source(224, 39) + SourceIndex(0) +13>Emitted(188, 43) Source(224, 43) + SourceIndex(0) +14>Emitted(188, 44) Source(224, 44) + SourceIndex(0) +15>Emitted(188, 45) Source(224, 45) + SourceIndex(0) +16>Emitted(188, 48) Source(224, 48) + SourceIndex(0) +17>Emitted(188, 50) Source(224, 50) + SourceIndex(0) +18>Emitted(188, 51) Source(224, 51) + SourceIndex(0) +19>Emitted(188, 52) Source(224, 52) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(189, 5) Source(225, 5) + SourceIndex(0) +2 >Emitted(189, 6) Source(225, 6) + SourceIndex(0) +--- +>>>}; +1 >^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > + >} +2 > ; +1 >Emitted(190, 2) Source(226, 2) + SourceIndex(0) +2 >Emitted(190, 3) Source(226, 3) + SourceIndex(0) +--- +>>>var x = {}; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >interface A { x: string; } + >interface B extends A { } + > +2 >var +3 > x +4 > : B = +5 > { } +6 > ; +1->Emitted(191, 1) Source(230, 1) + SourceIndex(0) +2 >Emitted(191, 5) Source(230, 5) + SourceIndex(0) +3 >Emitted(191, 6) Source(230, 6) + SourceIndex(0) +4 >Emitted(191, 9) Source(230, 12) + SourceIndex(0) +5 >Emitted(191, 11) Source(230, 15) + SourceIndex(0) +6 >Emitted(191, 12) Source(230, 16) + SourceIndex(0) +--- +>>>//# sourceMappingURL=contextualTyping.js.map \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping1.js b/tests/baselines/reference/contextualTyping1.js new file mode 100644 index 0000000000000..7ceb3b582e56a --- /dev/null +++ b/tests/baselines/reference/contextualTyping1.js @@ -0,0 +1,5 @@ +//// [contextualTyping1.ts] +var foo: {id:number;} = {id:4}; + +//// [contextualTyping1.js] +var foo = { id: 4 }; diff --git a/tests/baselines/reference/contextualTyping10.js b/tests/baselines/reference/contextualTyping10.js new file mode 100644 index 0000000000000..08a2172b69ae2 --- /dev/null +++ b/tests/baselines/reference/contextualTyping10.js @@ -0,0 +1,10 @@ +//// [contextualTyping10.ts] +class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } + +//// [contextualTyping10.js] +var foo = (function () { + function foo() { + this.bar = [{ id: 1 }, { id: 2 }]; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping11.errors.txt b/tests/baselines/reference/contextualTyping11.errors.txt new file mode 100644 index 0000000000000..b6e8970c7646e --- /dev/null +++ b/tests/baselines/reference/contextualTyping11.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/contextualTyping11.ts (1 errors) ==== + class foo { public bar:{id:number;}[] = [({})]; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'foo[]' is not assignable to type '{ id: number; }[]': +!!! Type 'foo' is not assignable to type '{ id: number; }': +!!! Property 'id' is missing in type 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping11.js b/tests/baselines/reference/contextualTyping11.js new file mode 100644 index 0000000000000..a7ec3815fae70 --- /dev/null +++ b/tests/baselines/reference/contextualTyping11.js @@ -0,0 +1,10 @@ +//// [contextualTyping11.ts] +class foo { public bar:{id:number;}[] = [({})]; } + +//// [contextualTyping11.js] +var foo = (function () { + function foo() { + this.bar = [({})]; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping12.js b/tests/baselines/reference/contextualTyping12.js new file mode 100644 index 0000000000000..c41ccbed99067 --- /dev/null +++ b/tests/baselines/reference/contextualTyping12.js @@ -0,0 +1,10 @@ +//// [contextualTyping12.ts] +class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } + +//// [contextualTyping12.js] +var foo = (function () { + function foo() { + this.bar = [{ id: 1 }, { id: 2, name: "foo" }]; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping13.js b/tests/baselines/reference/contextualTyping13.js new file mode 100644 index 0000000000000..c035434342ee0 --- /dev/null +++ b/tests/baselines/reference/contextualTyping13.js @@ -0,0 +1,7 @@ +//// [contextualTyping13.ts] +var foo:(a:number)=>number = function(a){return a}; + +//// [contextualTyping13.js] +var foo = function (a) { + return a; +}; diff --git a/tests/baselines/reference/contextualTyping14.js b/tests/baselines/reference/contextualTyping14.js new file mode 100644 index 0000000000000..ea9539ef41e56 --- /dev/null +++ b/tests/baselines/reference/contextualTyping14.js @@ -0,0 +1,12 @@ +//// [contextualTyping14.ts] +class foo { public bar:(a:number)=>number = function(a){return a}; } + +//// [contextualTyping14.js] +var foo = (function () { + function foo() { + this.bar = function (a) { + return a; + }; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping15.js b/tests/baselines/reference/contextualTyping15.js new file mode 100644 index 0000000000000..99855681571a7 --- /dev/null +++ b/tests/baselines/reference/contextualTyping15.js @@ -0,0 +1,12 @@ +//// [contextualTyping15.ts] +class foo { public bar: { (): number; (i: number): number; } = function() { return 1 }; } + +//// [contextualTyping15.js] +var foo = (function () { + function foo() { + this.bar = function () { + return 1; + }; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping16.js b/tests/baselines/reference/contextualTyping16.js new file mode 100644 index 0000000000000..1a4c28ba74598 --- /dev/null +++ b/tests/baselines/reference/contextualTyping16.js @@ -0,0 +1,6 @@ +//// [contextualTyping16.ts] +var foo: {id:number;} = {id:4}; foo = {id:5}; + +//// [contextualTyping16.js] +var foo = { id: 4 }; +foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping17.js b/tests/baselines/reference/contextualTyping17.js new file mode 100644 index 0000000000000..0ae2605dbd623 --- /dev/null +++ b/tests/baselines/reference/contextualTyping17.js @@ -0,0 +1,6 @@ +//// [contextualTyping17.ts] +var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; + +//// [contextualTyping17.js] +var foo = { id: 4 }; +foo = { id: 5, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping18.js b/tests/baselines/reference/contextualTyping18.js new file mode 100644 index 0000000000000..fb058032ed2cd --- /dev/null +++ b/tests/baselines/reference/contextualTyping18.js @@ -0,0 +1,6 @@ +//// [contextualTyping18.ts] +var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; + +//// [contextualTyping18.js] +var foo = ({}); +foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping19.js b/tests/baselines/reference/contextualTyping19.js new file mode 100644 index 0000000000000..e4e513728584e --- /dev/null +++ b/tests/baselines/reference/contextualTyping19.js @@ -0,0 +1,6 @@ +//// [contextualTyping19.ts] +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; + +//// [contextualTyping19.js] +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping2.js b/tests/baselines/reference/contextualTyping2.js new file mode 100644 index 0000000000000..4dc3f71e9b0b9 --- /dev/null +++ b/tests/baselines/reference/contextualTyping2.js @@ -0,0 +1,5 @@ +//// [contextualTyping2.ts] +var foo: {id:number;} = {id:4, name:"foo"}; + +//// [contextualTyping2.js] +var foo = { id: 4, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping20.js b/tests/baselines/reference/contextualTyping20.js new file mode 100644 index 0000000000000..f53a7f7554b79 --- /dev/null +++ b/tests/baselines/reference/contextualTyping20.js @@ -0,0 +1,6 @@ +//// [contextualTyping20.ts] +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; + +//// [contextualTyping20.js] +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt new file mode 100644 index 0000000000000..12f7d53db8f05 --- /dev/null +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== + var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; + ~~~ +!!! Type '{}[]' is not assignable to type '{ id: number; }[]': +!!! Type '{}' is not assignable to type '{ id: number; }': +!!! Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.js b/tests/baselines/reference/contextualTyping21.js new file mode 100644 index 0000000000000..3d87d9e4245ec --- /dev/null +++ b/tests/baselines/reference/contextualTyping21.js @@ -0,0 +1,6 @@ +//// [contextualTyping21.ts] +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; + +//// [contextualTyping21.js] +var foo = [{ id: 1 }]; +foo = [{ id: 1 }, 1]; diff --git a/tests/baselines/reference/contextualTyping22.js b/tests/baselines/reference/contextualTyping22.js new file mode 100644 index 0000000000000..b8ebfd3ecb74f --- /dev/null +++ b/tests/baselines/reference/contextualTyping22.js @@ -0,0 +1,10 @@ +//// [contextualTyping22.ts] +var foo:(a:number)=>number = function(a){return a}; foo = function(b){return b}; + +//// [contextualTyping22.js] +var foo = function (a) { + return a; +}; +foo = function (b) { + return b; +}; diff --git a/tests/baselines/reference/contextualTyping23.js b/tests/baselines/reference/contextualTyping23.js new file mode 100644 index 0000000000000..187fd3f86d3ca --- /dev/null +++ b/tests/baselines/reference/contextualTyping23.js @@ -0,0 +1,8 @@ +//// [contextualTyping23.ts] +var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5}; + +//// [contextualTyping23.js] +var foo; +foo = function (a) { + return 5; +}; diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt new file mode 100644 index 0000000000000..5c5a54d280ba4 --- /dev/null +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== + var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; + ~~~ +!!! Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': +!!! Types of parameters 'a' and 'a' are incompatible: +!!! Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.js b/tests/baselines/reference/contextualTyping24.js new file mode 100644 index 0000000000000..170a6983b9f62 --- /dev/null +++ b/tests/baselines/reference/contextualTyping24.js @@ -0,0 +1,8 @@ +//// [contextualTyping24.ts] +var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; + +//// [contextualTyping24.js] +var foo; +foo = function (a) { + return 5; +}; diff --git a/tests/baselines/reference/contextualTyping25.js b/tests/baselines/reference/contextualTyping25.js new file mode 100644 index 0000000000000..808ee2202ec6e --- /dev/null +++ b/tests/baselines/reference/contextualTyping25.js @@ -0,0 +1,8 @@ +//// [contextualTyping25.ts] +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); + +//// [contextualTyping25.js] +function foo(param) { +} +; +foo(({})); diff --git a/tests/baselines/reference/contextualTyping26.js b/tests/baselines/reference/contextualTyping26.js new file mode 100644 index 0000000000000..fabd810c8f595 --- /dev/null +++ b/tests/baselines/reference/contextualTyping26.js @@ -0,0 +1,8 @@ +//// [contextualTyping26.ts] +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); + +//// [contextualTyping26.js] +function foo(param) { +} +; +foo(({})); diff --git a/tests/baselines/reference/contextualTyping27.js b/tests/baselines/reference/contextualTyping27.js new file mode 100644 index 0000000000000..11b8c2514160f --- /dev/null +++ b/tests/baselines/reference/contextualTyping27.js @@ -0,0 +1,8 @@ +//// [contextualTyping27.ts] +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); + +//// [contextualTyping27.js] +function foo(param) { +} +; +foo(({})); diff --git a/tests/baselines/reference/contextualTyping28.js b/tests/baselines/reference/contextualTyping28.js new file mode 100644 index 0000000000000..24f269efb10a2 --- /dev/null +++ b/tests/baselines/reference/contextualTyping28.js @@ -0,0 +1,8 @@ +//// [contextualTyping28.ts] +function foo(param:number[]){}; foo([1]); + +//// [contextualTyping28.js] +function foo(param) { +} +; +foo([1]); diff --git a/tests/baselines/reference/contextualTyping29.js b/tests/baselines/reference/contextualTyping29.js new file mode 100644 index 0000000000000..3f29d16060cc2 --- /dev/null +++ b/tests/baselines/reference/contextualTyping29.js @@ -0,0 +1,8 @@ +//// [contextualTyping29.ts] +function foo(param:number[]){}; foo([1, 3]); + +//// [contextualTyping29.js] +function foo(param) { +} +; +foo([1, 3]); diff --git a/tests/baselines/reference/contextualTyping3.js b/tests/baselines/reference/contextualTyping3.js new file mode 100644 index 0000000000000..19d71f4ca714e --- /dev/null +++ b/tests/baselines/reference/contextualTyping3.js @@ -0,0 +1,10 @@ +//// [contextualTyping3.ts] +class foo { public bar:{id:number;} = {id:5}; } + +//// [contextualTyping3.js] +var foo = (function () { + function foo() { + this.bar = { id: 5 }; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt new file mode 100644 index 0000000000000..fe41113ea09fe --- /dev/null +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/contextualTyping30.ts (1 errors) ==== + function foo(param:number[]){}; foo([1, "a"]); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping30.js b/tests/baselines/reference/contextualTyping30.js new file mode 100644 index 0000000000000..daf74ff9f6b44 --- /dev/null +++ b/tests/baselines/reference/contextualTyping30.js @@ -0,0 +1,8 @@ +//// [contextualTyping30.ts] +function foo(param:number[]){}; foo([1, "a"]); + +//// [contextualTyping30.js] +function foo(param) { +} +; +foo([1, "a"]); diff --git a/tests/baselines/reference/contextualTyping31.js b/tests/baselines/reference/contextualTyping31.js new file mode 100644 index 0000000000000..346f753cd1d4c --- /dev/null +++ b/tests/baselines/reference/contextualTyping31.js @@ -0,0 +1,8 @@ +//// [contextualTyping31.ts] +function foo(param:number[]){}; foo([1]); + +//// [contextualTyping31.js] +function foo(param) { +} +; +foo([1]); diff --git a/tests/baselines/reference/contextualTyping32.js b/tests/baselines/reference/contextualTyping32.js new file mode 100644 index 0000000000000..0c02caac75da0 --- /dev/null +++ b/tests/baselines/reference/contextualTyping32.js @@ -0,0 +1,12 @@ +//// [contextualTyping32.ts] +function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); + +//// [contextualTyping32.js] +function foo(param) { +} +; +foo([function () { + return 1; +}, function () { + return 4; +}]); diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt new file mode 100644 index 0000000000000..96068e5722683 --- /dev/null +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/contextualTyping33.ts (1 errors) ==== + function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.js b/tests/baselines/reference/contextualTyping33.js new file mode 100644 index 0000000000000..d61e6fe2d5f6e --- /dev/null +++ b/tests/baselines/reference/contextualTyping33.js @@ -0,0 +1,12 @@ +//// [contextualTyping33.ts] +function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); + +//// [contextualTyping33.js] +function foo(param) { +} +; +foo([function () { + return 1; +}, function () { + return "foo"; +}]); diff --git a/tests/baselines/reference/contextualTyping34.js b/tests/baselines/reference/contextualTyping34.js new file mode 100644 index 0000000000000..5e12ba602aec7 --- /dev/null +++ b/tests/baselines/reference/contextualTyping34.js @@ -0,0 +1,5 @@ +//// [contextualTyping34.ts] +var foo = <{ id: number;}> ({id:4}); + +//// [contextualTyping34.js] +var foo = ({ id: 4 }); diff --git a/tests/baselines/reference/contextualTyping35.js b/tests/baselines/reference/contextualTyping35.js new file mode 100644 index 0000000000000..34d9e6b39a885 --- /dev/null +++ b/tests/baselines/reference/contextualTyping35.js @@ -0,0 +1,5 @@ +//// [contextualTyping35.ts] +var foo = <{ id: number;}> {id:4, name: "as"}; + +//// [contextualTyping35.js] +var foo = { id: 4, name: "as" }; diff --git a/tests/baselines/reference/contextualTyping36.js b/tests/baselines/reference/contextualTyping36.js new file mode 100644 index 0000000000000..3bdaf5a8d05f8 --- /dev/null +++ b/tests/baselines/reference/contextualTyping36.js @@ -0,0 +1,5 @@ +//// [contextualTyping36.ts] +var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; + +//// [contextualTyping36.js] +var foo = [{ id: 4 }, ({})]; diff --git a/tests/baselines/reference/contextualTyping37.js b/tests/baselines/reference/contextualTyping37.js new file mode 100644 index 0000000000000..4bb6e7b350ff1 --- /dev/null +++ b/tests/baselines/reference/contextualTyping37.js @@ -0,0 +1,5 @@ +//// [contextualTyping37.ts] +var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; + +//// [contextualTyping37.js] +var foo = [{ foo: "s" }, {}]; diff --git a/tests/baselines/reference/contextualTyping38.js b/tests/baselines/reference/contextualTyping38.js new file mode 100644 index 0000000000000..71ed8ece57d5f --- /dev/null +++ b/tests/baselines/reference/contextualTyping38.js @@ -0,0 +1,7 @@ +//// [contextualTyping38.ts] +var foo = <{ (): number; }> function(a) { return a }; + +//// [contextualTyping38.js] +var foo = function (a) { + return a; +}; diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt new file mode 100644 index 0000000000000..c0907b8fe7b8c --- /dev/null +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== + var foo = <{ (): number; }> function() { return "err"; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Neither type '() => number' nor type '() => string' is assignable to the other. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.js b/tests/baselines/reference/contextualTyping39.js new file mode 100644 index 0000000000000..9a97b7eb3cce4 --- /dev/null +++ b/tests/baselines/reference/contextualTyping39.js @@ -0,0 +1,7 @@ +//// [contextualTyping39.ts] +var foo = <{ (): number; }> function() { return "err"; }; + +//// [contextualTyping39.js] +var foo = function () { + return "err"; +}; diff --git a/tests/baselines/reference/contextualTyping4.js b/tests/baselines/reference/contextualTyping4.js new file mode 100644 index 0000000000000..af79e3732f242 --- /dev/null +++ b/tests/baselines/reference/contextualTyping4.js @@ -0,0 +1,10 @@ +//// [contextualTyping4.ts] +class foo { public bar:{id:number;} = {id:5, name:"foo"}; } + +//// [contextualTyping4.js] +var foo = (function () { + function foo() { + this.bar = { id: 5, name: "foo" }; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping40.js b/tests/baselines/reference/contextualTyping40.js new file mode 100644 index 0000000000000..ba2c447b10f68 --- /dev/null +++ b/tests/baselines/reference/contextualTyping40.js @@ -0,0 +1,7 @@ +//// [contextualTyping40.ts] +var foo = <{():number; (i:number):number; }> function(){return 1;}; + +//// [contextualTyping40.js] +var foo = function () { + return 1; +}; diff --git a/tests/baselines/reference/contextualTyping41.errors.txt b/tests/baselines/reference/contextualTyping41.errors.txt new file mode 100644 index 0000000000000..d74e45f8a08cc --- /dev/null +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== + var foo = <{():number; (i:number):number; }> (function(){return "err";}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Neither type '{ (): number; (i: number): number; }' nor type '() => string' is assignable to the other. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping41.js b/tests/baselines/reference/contextualTyping41.js new file mode 100644 index 0000000000000..720f1d178f6b7 --- /dev/null +++ b/tests/baselines/reference/contextualTyping41.js @@ -0,0 +1,7 @@ +//// [contextualTyping41.ts] +var foo = <{():number; (i:number):number; }> (function(){return "err";}); + +//// [contextualTyping41.js] +var foo = (function () { + return "err"; +}); diff --git a/tests/baselines/reference/contextualTyping5.errors.txt b/tests/baselines/reference/contextualTyping5.errors.txt new file mode 100644 index 0000000000000..b72968af35c5e --- /dev/null +++ b/tests/baselines/reference/contextualTyping5.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/contextualTyping5.ts (1 errors) ==== + class foo { public bar:{id:number;} = { }; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type '{ id: number; }': +!!! Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping5.js b/tests/baselines/reference/contextualTyping5.js new file mode 100644 index 0000000000000..3fcc1530f68bb --- /dev/null +++ b/tests/baselines/reference/contextualTyping5.js @@ -0,0 +1,10 @@ +//// [contextualTyping5.ts] +class foo { public bar:{id:number;} = { }; } + +//// [contextualTyping5.js] +var foo = (function () { + function foo() { + this.bar = {}; + } + return foo; +})(); diff --git a/tests/baselines/reference/contextualTyping6.js b/tests/baselines/reference/contextualTyping6.js new file mode 100644 index 0000000000000..df2d2ac15cb56 --- /dev/null +++ b/tests/baselines/reference/contextualTyping6.js @@ -0,0 +1,5 @@ +//// [contextualTyping6.ts] +var foo:{id:number;}[] = [{id:1}, {id:2}]; + +//// [contextualTyping6.js] +var foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping7.js b/tests/baselines/reference/contextualTyping7.js new file mode 100644 index 0000000000000..2cd2494c3bfc7 --- /dev/null +++ b/tests/baselines/reference/contextualTyping7.js @@ -0,0 +1,5 @@ +//// [contextualTyping7.ts] +var foo:{id:number;}[] = [<{id:number;}>({})]; + +//// [contextualTyping7.js] +var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping8.js b/tests/baselines/reference/contextualTyping8.js new file mode 100644 index 0000000000000..a0e3b5b9ef57f --- /dev/null +++ b/tests/baselines/reference/contextualTyping8.js @@ -0,0 +1,5 @@ +//// [contextualTyping8.ts] +var foo:{id:number;}[] = [<{id:number;}>({})]; + +//// [contextualTyping8.js] +var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping9.js b/tests/baselines/reference/contextualTyping9.js new file mode 100644 index 0000000000000..71384cf8b0413 --- /dev/null +++ b/tests/baselines/reference/contextualTyping9.js @@ -0,0 +1,5 @@ +//// [contextualTyping9.ts] +var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; + +//// [contextualTyping9.js] +var foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js new file mode 100644 index 0000000000000..ffe00308636d3 --- /dev/null +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -0,0 +1,46 @@ +//// [contextualTypingArrayOfLambdas.ts] +class A { + foo: string; +} + +class B extends A { + bar: string; +} + +class C extends A { + baz: string; +} + +var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; + + +//// [contextualTypingArrayOfLambdas.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(A); +var xs = [function (x) { +}, function (x) { +}, function (x) { +}]; diff --git a/tests/baselines/reference/contextualTypingOfAccessors.errors.txt b/tests/baselines/reference/contextualTypingOfAccessors.errors.txt new file mode 100644 index 0000000000000..93ae5f8586532 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfAccessors.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/contextualTypingOfAccessors.ts (2 errors) ==== + // not contextually typing accessors + + var x: { + foo: (x: number) => number; + } + + x = { + get foo() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return (n)=>n + }, + set foo(x) {} + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt new file mode 100644 index 0000000000000..1110ce60aa6d9 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/contextualTypingOfArrayLiterals1.ts (1 errors) ==== + interface I { + [x: number]: Date; + } + + var x3: I = [new Date(), 1]; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}[]' is not assignable to type 'I': +!!! Index signatures are incompatible: +!!! Type '{}' is not assignable to type 'Date': +!!! Property 'toDateString' is missing in type '{}'. + var r2 = x3[1]; + r2.getDate(); + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.js b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js new file mode 100644 index 0000000000000..e7513093402fc --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js @@ -0,0 +1,14 @@ +//// [contextualTypingOfArrayLiterals1.ts] +interface I { + [x: number]: Date; +} + +var x3: I = [new Date(), 1]; +var r2 = x3[1]; +r2.getDate(); + + +//// [contextualTypingOfArrayLiterals1.js] +var x3 = [new Date(), 1]; +var r2 = x3[1]; +r2.getDate(); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js new file mode 100644 index 0000000000000..b1100ba80a940 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -0,0 +1,44 @@ +//// [contextualTypingOfConditionalExpression.ts] +var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed(); + +class A { + foo: number; +} +class B extends A { + bar: number; +} +class C extends A { + baz: number; +} + +var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; + + +//// [contextualTypingOfConditionalExpression.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var x = true ? function (a) { return a.toExponential(); } : function (b) { return b.toFixed(); }; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(A); +var x2 = true ? function (a) { return a.foo; } : function (b) { return b.foo; }; diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt new file mode 100644 index 0000000000000..5702cbe059517 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (2 errors) ==== + class A { + foo: number; + } + class B extends A { + bar: number; + } + class C extends A { + baz: number; + } + + var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type '(a: A) => void'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! No best common type exists between '(a: A) => void', '(a: C) => number', and '(b: number) => void'. + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js new file mode 100644 index 0000000000000..e0008bd49c61f --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -0,0 +1,42 @@ +//// [contextualTypingOfConditionalExpression2.ts] +class A { + foo: number; +} +class B extends A { + bar: number; +} +class C extends A { + baz: number; +} + +var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; + + +//// [contextualTypingOfConditionalExpression2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(A); +var x2 = true ? function (a) { return a.foo; } : function (b) { +}; diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt new file mode 100644 index 0000000000000..a2884fa27bf52 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ==== + interface Collection { + length: number; + add(x: T): void; + remove(x: T): boolean; + } + + interface Combinators { + forEach(c: Collection, f: (x: T) => Date): void; + } + + var c2: Collection; + var _: Combinators; + + // errors on all 3 lines, bug was that r5 was the only line with errors + var f = (x: number) => { return x.toFixed() }; + var r5 = _.forEach(c2, f); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6 = _.forEach(c2, (x) => { return x.toFixed() }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js new file mode 100644 index 0000000000000..d5b2779260337 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js @@ -0,0 +1,30 @@ +//// [contextualTypingOfGenericFunctionTypedArguments1.ts] +interface Collection { + length: number; + add(x: T): void; + remove(x: T): boolean; +} + +interface Combinators { + forEach(c: Collection, f: (x: T) => Date): void; +} + +var c2: Collection; +var _: Combinators; + +// errors on all 3 lines, bug was that r5 was the only line with errors +var f = (x: number) => { return x.toFixed() }; +var r5 = _.forEach(c2, f); +var r6 = _.forEach(c2, (x) => { return x.toFixed() }); + + +//// [contextualTypingOfGenericFunctionTypedArguments1.js] +var c2; +var _; +var f = function (x) { + return x.toFixed(); +}; +var r5 = _.forEach(c2, f); +var r6 = _.forEach(c2, function (x) { + return x.toFixed(); +}); diff --git a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt new file mode 100644 index 0000000000000..4f04803d0adf8 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/contextualTypingOfLambdaReturnExpression.ts (2 errors) ==== + function callb(lam: (l: number) => void); + function callb(lam: (n: string) => void); + function callb(a) { } + + callb((a) => a.length); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. + callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js new file mode 100644 index 0000000000000..d72fd1352c0f7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js @@ -0,0 +1,15 @@ +//// [contextualTypingOfLambdaReturnExpression.ts] +function callb(lam: (l: number) => void); +function callb(lam: (n: string) => void); +function callb(a) { } + +callb((a) => a.length); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type +callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body + +//// [contextualTypingOfLambdaReturnExpression.js] +function callb(a) { +} +callb(function (a) { return a.length; }); +callb(function (a) { + a.length; +}); diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js new file mode 100644 index 0000000000000..400a052a7bbb9 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js @@ -0,0 +1,13 @@ +//// [contextualTypingOfLambdaWithMultipleSignatures.ts] +interface Foo { + getFoo(n: number): void; + getFoo(s: string): void; +} + +var foo: Foo; +foo.getFoo = bar => { }; + +//// [contextualTypingOfLambdaWithMultipleSignatures.js] +var foo; +foo.getFoo = function (bar) { +}; diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js new file mode 100644 index 0000000000000..415fc3acd2ec7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js @@ -0,0 +1,13 @@ +//// [contextualTypingOfLambdaWithMultipleSignatures2.ts] +var f: { + (x: string): string; + (x: number): string +}; + +f = (a) => { return a.asdf } + +//// [contextualTypingOfLambdaWithMultipleSignatures2.js] +var f; +f = function (a) { + return a.asdf; +}; diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt new file mode 100644 index 0000000000000..7696ee6efe404 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/contextualTypingOfObjectLiterals.ts (2 errors) ==== + var obj1: { [x: string]: string; }; + var obj2 = {x: ""}; + obj1 = {}; // Ok + obj1 = obj2; // Error - indexer doesn't match + ~~~~ +!!! Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': +!!! Index signature is missing in type '{ x: string; }'. + + function f(x: { [s: string]: string }) { } + + f({}); // Ok + f(obj1); // Ok + f(obj2); // Error - indexer doesn't match + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.js b/tests/baselines/reference/contextualTypingOfObjectLiterals.js new file mode 100644 index 0000000000000..6311b242bca12 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.js @@ -0,0 +1,22 @@ +//// [contextualTypingOfObjectLiterals.ts] +var obj1: { [x: string]: string; }; +var obj2 = {x: ""}; +obj1 = {}; // Ok +obj1 = obj2; // Error - indexer doesn't match + +function f(x: { [s: string]: string }) { } + +f({}); // Ok +f(obj1); // Ok +f(obj2); // Error - indexer doesn't match + +//// [contextualTypingOfObjectLiterals.js] +var obj1; +var obj2 = { x: "" }; +obj1 = {}; +obj1 = obj2; +function f(x) { +} +f({}); +f(obj1); +f(obj2); diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt new file mode 100644 index 0000000000000..a91abdb2954e7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/contextualTypingOfObjectLiterals2.ts (1 errors) ==== + interface Foo { + foo: (t: string) => string; + } + function f2(args: Foo) { } + f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error + ~~~ +!!! Property 'hmm' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals2.js b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js new file mode 100644 index 0000000000000..52cbaa48d77eb --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js @@ -0,0 +1,11 @@ +//// [contextualTypingOfObjectLiterals2.ts] +interface Foo { + foo: (t: string) => string; +} +function f2(args: Foo) { } +f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error + +//// [contextualTypingOfObjectLiterals2.js] +function f2(args) { +} +f2({ foo: function (s) { return s.hmm; } }); diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js new file mode 100644 index 0000000000000..4b392bac80af7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js @@ -0,0 +1,11 @@ +//// [contextualTypingTwoInstancesOfSameTypeParameter.ts] +function f6(x: (a: T) => T) { + return null; +} +f6(x => f6(y => x = y)); + +//// [contextualTypingTwoInstancesOfSameTypeParameter.js] +function f6(x) { + return null; +} +f6(function (x) { return f6(function (y) { return x = y; }); }); diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt new file mode 100644 index 0000000000000..e9de74b27ec7d --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (1 errors) ==== + var f10: (x: T, b: () => (a: T) => void, y: T) => T; + f10('', () => a => a.foo, ''); // a is string, fixed by first parameter + ~~~ +!!! Property 'foo' does not exist on type 'string'. + var r9 = f10('', () => (a => a.foo), 1); // now a should be any \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js new file mode 100644 index 0000000000000..fd9317cec94fd --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -0,0 +1,9 @@ +//// [contextualTypingWithFixedTypeParameters1.ts] +var f10: (x: T, b: () => (a: T) => void, y: T) => T; +f10('', () => a => a.foo, ''); // a is string, fixed by first parameter +var r9 = f10('', () => (a => a.foo), 1); // now a should be any + +//// [contextualTypingWithFixedTypeParameters1.js] +var f10; +f10('', function () { return function (a) { return a.foo; }; }, ''); +var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js new file mode 100644 index 0000000000000..8e69f08601ee5 --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js @@ -0,0 +1,27 @@ +//// [contextualTypingWithGenericAndNonGenericSignature.ts] +//• If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. + +var f2: { + (x: string, y: number): string; + (x: T, y: U): T +}; + +f2 = (x, y) => { return x } + +var f3: { + (x: T, y: U): T + (x: string, y: number): string; +}; + +f3 = (x, y) => { return x } + + +//// [contextualTypingWithGenericAndNonGenericSignature.js] +var f2; +f2 = function (x, y) { + return x; +}; +var f3; +f3 = function (x, y) { + return x; +}; diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericSignature.js new file mode 100644 index 0000000000000..8eb51fe6b996e --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.js @@ -0,0 +1,14 @@ +//// [contextualTypingWithGenericSignature.ts] +// If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. + +var f2: { + (x: T, y: U): T +}; + +f2 = (x, y) => { return x } + +//// [contextualTypingWithGenericSignature.js] +var f2; +f2 = function (x, y) { + return x; +}; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.js b/tests/baselines/reference/contextuallyTypingOrOperator.js new file mode 100644 index 0000000000000..8d7babbbe6b6b --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator.js @@ -0,0 +1,19 @@ +//// [contextuallyTypingOrOperator.ts] +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; + +var v2 = (s: string) => s.length || function (s) { s.length }; + +var v3 = (s: string) => s.length || function (s: number) { return 1 }; +var v4 = (s: number) => 1 || function (s: string) { return s.length }; + +//// [contextuallyTypingOrOperator.js] +var v = { a: function (s) { return s.length; } } || { a: function (s) { return 1; } }; +var v2 = function (s) { return s.length || function (s) { + s.length; +}; }; +var v3 = function (s) { return s.length || function (s) { + return 1; +}; }; +var v4 = function (s) { return 1 || function (s) { + return s.length; +}; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.js b/tests/baselines/reference/contextuallyTypingOrOperator2.js new file mode 100644 index 0000000000000..9aa2c77834536 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.js @@ -0,0 +1,10 @@ +//// [contextuallyTypingOrOperator2.ts] +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; + +var v2 = (s: string) => s.length || function (s) { s.aaa }; + +//// [contextuallyTypingOrOperator2.js] +var v = { a: function (s) { return s.length; } } || { a: function (s) { return 1; } }; +var v2 = function (s) { return s.length || function (s) { + s.aaa; +}; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt b/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt new file mode 100644 index 0000000000000..8c22771ad8fb0 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/contextuallyTypingOrOperator3.ts (1 errors) ==== + function foo(u: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var x3: U = u || u; + } \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.js b/tests/baselines/reference/contextuallyTypingOrOperator3.js new file mode 100644 index 0000000000000..ceaa4621a6eaf --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.js @@ -0,0 +1,9 @@ +//// [contextuallyTypingOrOperator3.ts] +function foo(u: U) { + var x3: U = u || u; +} + +//// [contextuallyTypingOrOperator3.js] +function foo(u) { + var x3 = u || u; +} diff --git a/tests/baselines/reference/continueInIterationStatement1.js b/tests/baselines/reference/continueInIterationStatement1.js new file mode 100644 index 0000000000000..e1c787ae7ea85 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement1.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement1.ts] +while (true) { + continue; +} + +//// [continueInIterationStatement1.js] +while (true) { + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement2.js b/tests/baselines/reference/continueInIterationStatement2.js new file mode 100644 index 0000000000000..d7ff84895f6ee --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement2.js @@ -0,0 +1,10 @@ +//// [continueInIterationStatement2.ts] +do { + continue; +} +while (true); + +//// [continueInIterationStatement2.js] +do { + continue; +} while (true); diff --git a/tests/baselines/reference/continueInIterationStatement3.js b/tests/baselines/reference/continueInIterationStatement3.js new file mode 100644 index 0000000000000..90619118ac501 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement3.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement3.ts] +for (;;) { + continue; +} + +//// [continueInIterationStatement3.js] +for (;;) { + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement4.errors.txt b/tests/baselines/reference/continueInIterationStatement4.errors.txt new file mode 100644 index 0000000000000..c0f4388cf793d --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/continueInIterationStatement4.ts (1 errors) ==== + for (var i in something) { + ~~~~~~~~~ +!!! Cannot find name 'something'. + continue; + } \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement4.js b/tests/baselines/reference/continueInIterationStatement4.js new file mode 100644 index 0000000000000..e72ab3ed9abe8 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement4.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement4.ts] +for (var i in something) { + continue; +} + +//// [continueInIterationStatement4.js] +for (var i in something) { + continue; +} diff --git a/tests/baselines/reference/continueLabel.js b/tests/baselines/reference/continueLabel.js new file mode 100644 index 0000000000000..390566353eb75 --- /dev/null +++ b/tests/baselines/reference/continueLabel.js @@ -0,0 +1,9 @@ +//// [continueLabel.ts] +label1: for(var i = 0; i < 1; i++) { + continue label1; +} + +//// [continueLabel.js] +label1: for (var i = 0; i < 1; i++) { + continue label1; +} diff --git a/tests/baselines/reference/continueNotInIterationStatement1.js b/tests/baselines/reference/continueNotInIterationStatement1.js new file mode 100644 index 0000000000000..b6fd1786cdf00 --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement1.js @@ -0,0 +1,5 @@ +//// [continueNotInIterationStatement1.ts] +continue; + +//// [continueNotInIterationStatement1.js] +continue; diff --git a/tests/baselines/reference/continueNotInIterationStatement2.js b/tests/baselines/reference/continueNotInIterationStatement2.js new file mode 100644 index 0000000000000..047c3b49f0602 --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement2.js @@ -0,0 +1,13 @@ +//// [continueNotInIterationStatement2.ts] +while (true) { + function f() { + continue; + } +} + +//// [continueNotInIterationStatement2.js] +while (true) { + function f() { + continue; + } +} diff --git a/tests/baselines/reference/continueNotInIterationStatement3.js b/tests/baselines/reference/continueNotInIterationStatement3.js new file mode 100644 index 0000000000000..110180198717c --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement3.js @@ -0,0 +1,11 @@ +//// [continueNotInIterationStatement3.ts] +switch (0) { + default: + continue; +} + +//// [continueNotInIterationStatement3.js] +switch (0) { + default: + continue; +} diff --git a/tests/baselines/reference/continueNotInIterationStatement4.js b/tests/baselines/reference/continueNotInIterationStatement4.js new file mode 100644 index 0000000000000..f3f52ecb48ca3 --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement4.js @@ -0,0 +1,15 @@ +//// [continueNotInIterationStatement4.ts] +TWO: +while (true){ + var x = () => { + continue TWO; + } +} + + +//// [continueNotInIterationStatement4.js] +TWO: while (true) { + var x = function () { + continue TWO; + }; +} diff --git a/tests/baselines/reference/continueTarget1.js b/tests/baselines/reference/continueTarget1.js new file mode 100644 index 0000000000000..07e5a7b9b50bf --- /dev/null +++ b/tests/baselines/reference/continueTarget1.js @@ -0,0 +1,6 @@ +//// [continueTarget1.ts] +target: + continue target; + +//// [continueTarget1.js] +target: continue target; diff --git a/tests/baselines/reference/continueTarget2.js b/tests/baselines/reference/continueTarget2.js new file mode 100644 index 0000000000000..eb3b4118f7fdd --- /dev/null +++ b/tests/baselines/reference/continueTarget2.js @@ -0,0 +1,10 @@ +//// [continueTarget2.ts] +target: +while (true) { + continue target; +} + +//// [continueTarget2.js] +target: while (true) { + continue target; +} diff --git a/tests/baselines/reference/continueTarget3.js b/tests/baselines/reference/continueTarget3.js new file mode 100644 index 0000000000000..052b7b593c31d --- /dev/null +++ b/tests/baselines/reference/continueTarget3.js @@ -0,0 +1,11 @@ +//// [continueTarget3.ts] +target1: +target2: +while (true) { + continue target1; +} + +//// [continueTarget3.js] +target1: target2: while (true) { + continue target1; +} diff --git a/tests/baselines/reference/continueTarget4.js b/tests/baselines/reference/continueTarget4.js new file mode 100644 index 0000000000000..0f6211f9202cb --- /dev/null +++ b/tests/baselines/reference/continueTarget4.js @@ -0,0 +1,11 @@ +//// [continueTarget4.ts] +target1: +target2: +while (true) { + continue target2; +} + +//// [continueTarget4.js] +target1: target2: while (true) { + continue target2; +} diff --git a/tests/baselines/reference/continueTarget5.js b/tests/baselines/reference/continueTarget5.js new file mode 100644 index 0000000000000..5bf309d2690e8 --- /dev/null +++ b/tests/baselines/reference/continueTarget5.js @@ -0,0 +1,18 @@ +//// [continueTarget5.ts] +target: +while (true) { + function f() { + while (true) { + continue target; + } + } +} + +//// [continueTarget5.js] +target: while (true) { + function f() { + while (true) { + continue target; + } + } +} diff --git a/tests/baselines/reference/continueTarget6.js b/tests/baselines/reference/continueTarget6.js new file mode 100644 index 0000000000000..aefa8e9765223 --- /dev/null +++ b/tests/baselines/reference/continueTarget6.js @@ -0,0 +1,9 @@ +//// [continueTarget6.ts] +while (true) { + continue target; +} + +//// [continueTarget6.js] +while (true) { + continue target; +} diff --git a/tests/baselines/reference/convertKeywords.js b/tests/baselines/reference/convertKeywords.js new file mode 100644 index 0000000000000..e1a0753074829 --- /dev/null +++ b/tests/baselines/reference/convertKeywords.js @@ -0,0 +1,8 @@ +//// [convertKeywords.ts] +var abstract; + + + + +//// [convertKeywords.js] +var abstract; diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js new file mode 100644 index 0000000000000..b6572cf9cf966 --- /dev/null +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -0,0 +1,573 @@ +//// [convertKeywordsYes.ts] +// reserved ES5 future in strict mode + +var constructor = 0; +var any = 0; +var boolean = 0; +var implements = 0; +var interface = 0; +var let = 0; +var module = 0; +var number = 0; +var package = 0; +var private = 0; +var protected = 0; +var public = 0; +var set = 0; +var static = 0; +var string = 0; +var get = 0; +var yield = 0; +var declare = 0; + +function bigGeneric< + constructor, + implements , + interface , + let, + module , + package, + private , + protected, + public , + set , + static , + get , + yield, + declare + >(c: constructor, + a: any, + b2: boolean, + i: implements , + i2: interface , + l: let, + m: module , + n: number, + p: package, + p2: private , + p3: protected, + p4: public , + s: set , + s2: static , + s3: string, + g: get , + y: yield, + d: declare ) { } + +var bigObject = { + constructor: 0, + any: 0, + boolean: 0, + implements: 0, + interface: 0, + let: 0, + module: 0, + number: 0, + package: 0, + private: 0, + protected: 0, + public: 0, + set: 0, + static: 0, + string: 0, + get: 0, + yield: 0, + break: 0, + case: 0, + catch: 0, + class: 0, + continue: 0, + const: 0, + + debugger: 0, + declare: 0, + default: 0, + delete: 0, + do: 0, + else: 0, + enum: 0, + export: 0, + extends: 0, + false: 0, + finally: 0, + for: 0, + function: 0, + if: 0, + + import: 0, + in: 0, + instanceof: 0, + new: 0, + null: 0, + return: 0, + super: 0, + switch: 0, + this: 0, + throw: 0, + true: 0, + try: 0, + typeof: 0, + var: 0, + void: 0, + while: 0, + with: 0, +}; + +interface bigInterface { + constructor; + any; + boolean; + implements; + interface; + let; + module; + number; + package; + private; + protected; + public; + set; + static; + string; + get; + yield; + break; + case; + catch; + class; + continue; + const; + + debugger; + declare; + default; + delete; + do; + else; + enum; + export; + extends; + false; + finally; + for; + function; + if; + + import; + in; + instanceof; + new; + null; + return; + super; + switch; + this; + throw; + true; + try; + typeof; + var; + void; + while; + with; +} + +class bigClass { + public "constructor" = 0; + public any = 0; + public boolean = 0; + public implements = 0; + public interface = 0; + public let = 0; + public module = 0; + public number = 0; + public package = 0; + public private = 0; + public protected = 0; + public public = 0; + public set = 0; + public static = 0; + public string = 0; + public get = 0; + public yield = 0; + public break = 0; + public case = 0; + public catch = 0; + public class = 0; + public continue = 0; + public const = 0; + public debugger = 0; + public declare = 0; + public default = 0; + public delete = 0; + public do = 0; + public else = 0; + public enum = 0; + public export = 0; + public extends = 0; + public false = 0; + public finally = 0; + public for = 0; + public function = 0; + public if = 0; + public import = 0; + public in = 0; + public instanceof = 0; + public new = 0; + public null = 0; + public return = 0; + public super = 0; + public switch = 0; + public this = 0; + public throw = 0; + public true = 0; + public try = 0; + public typeof = 0; + public var = 0; + public void = 0; + public while = 0; + public with = 0; +} + +enum bigEnum { + constructor, + any, + boolean, + implements, + interface, + let, + module, + number, + package, + private, + protected, + public, + set, + static, + string, + get, + yield, + break, + case, + catch, + class, + continue, + const, + + debugger, + declare, + default, + delete, + do, + else, + enum, + export, + extends, + false, + finally, + for, + function, + if, + + import, + in, + instanceof, + new, + null, + return, + super, + switch, + this, + throw, + true, + try, + typeof, + var, + void, + while, + with, +} + +module bigModule { + class constructor { } + class implements { } + class interface { } + class let { } + class module { } + class package { } + class private { } + class protected { } + class public { } + class set { } + class static { } + class get { } + class yield { } + class declare { } +} + +//// [convertKeywordsYes.js] +var constructor = 0; +var any = 0; +var boolean = 0; +var implements = 0; +var interface = 0; +var let = 0; +var module = 0; +var number = 0; +var package = 0; +var private = 0; +var protected = 0; +var public = 0; +var set = 0; +var static = 0; +var string = 0; +var get = 0; +var yield = 0; +var declare = 0; +function bigGeneric(c, a, b2, i, i2, l, m, n, p, p2, p3, p4, s, s2, s3, g, y, d) { +} +var bigObject = { + constructor: 0, + any: 0, + boolean: 0, + implements: 0, + interface: 0, + let: 0, + module: 0, + number: 0, + package: 0, + private: 0, + protected: 0, + public: 0, + set: 0, + static: 0, + string: 0, + get: 0, + yield: 0, + break: 0, + case: 0, + catch: 0, + class: 0, + continue: 0, + const: 0, + debugger: 0, + declare: 0, + default: 0, + delete: 0, + do: 0, + else: 0, + enum: 0, + export: 0, + extends: 0, + false: 0, + finally: 0, + for: 0, + function: 0, + if: 0, + import: 0, + in: 0, + instanceof: 0, + new: 0, + null: 0, + return: 0, + super: 0, + switch: 0, + this: 0, + throw: 0, + true: 0, + try: 0, + typeof: 0, + var: 0, + void: 0, + while: 0, + with: 0 +}; +var bigClass = (function () { + function bigClass() { + this["constructor"] = 0; + this.any = 0; + this.boolean = 0; + this.implements = 0; + this.interface = 0; + this.let = 0; + this.module = 0; + this.number = 0; + this.package = 0; + this.private = 0; + this.protected = 0; + this.public = 0; + this.set = 0; + this.static = 0; + this.string = 0; + this.get = 0; + this.yield = 0; + this.break = 0; + this.case = 0; + this.catch = 0; + this.class = 0; + this.continue = 0; + this.const = 0; + this.debugger = 0; + this.declare = 0; + this.default = 0; + this.delete = 0; + this.do = 0; + this.else = 0; + this.enum = 0; + this.export = 0; + this.extends = 0; + this.false = 0; + this.finally = 0; + this.for = 0; + this.function = 0; + this.if = 0; + this.import = 0; + this.in = 0; + this.instanceof = 0; + this.new = 0; + this.null = 0; + this.return = 0; + this.super = 0; + this.switch = 0; + this.this = 0; + this.throw = 0; + this.true = 0; + this.try = 0; + this.typeof = 0; + this.var = 0; + this.void = 0; + this.while = 0; + this.with = 0; + } + return bigClass; +})(); +var bigEnum; +(function (bigEnum) { + bigEnum[bigEnum["constructor"] = 0] = "constructor"; + bigEnum[bigEnum["any"] = 1] = "any"; + bigEnum[bigEnum["boolean"] = 2] = "boolean"; + bigEnum[bigEnum["implements"] = 3] = "implements"; + bigEnum[bigEnum["interface"] = 4] = "interface"; + bigEnum[bigEnum["let"] = 5] = "let"; + bigEnum[bigEnum["module"] = 6] = "module"; + bigEnum[bigEnum["number"] = 7] = "number"; + bigEnum[bigEnum["package"] = 8] = "package"; + bigEnum[bigEnum["private"] = 9] = "private"; + bigEnum[bigEnum["protected"] = 10] = "protected"; + bigEnum[bigEnum["public"] = 11] = "public"; + bigEnum[bigEnum["set"] = 12] = "set"; + bigEnum[bigEnum["static"] = 13] = "static"; + bigEnum[bigEnum["string"] = 14] = "string"; + bigEnum[bigEnum["get"] = 15] = "get"; + bigEnum[bigEnum["yield"] = 16] = "yield"; + bigEnum[bigEnum["break"] = 17] = "break"; + bigEnum[bigEnum["case"] = 18] = "case"; + bigEnum[bigEnum["catch"] = 19] = "catch"; + bigEnum[bigEnum["class"] = 20] = "class"; + bigEnum[bigEnum["continue"] = 21] = "continue"; + bigEnum[bigEnum["const"] = 22] = "const"; + bigEnum[bigEnum["debugger"] = 23] = "debugger"; + bigEnum[bigEnum["declare"] = 24] = "declare"; + bigEnum[bigEnum["default"] = 25] = "default"; + bigEnum[bigEnum["delete"] = 26] = "delete"; + bigEnum[bigEnum["do"] = 27] = "do"; + bigEnum[bigEnum["else"] = 28] = "else"; + bigEnum[bigEnum["enum"] = 29] = "enum"; + bigEnum[bigEnum["export"] = 30] = "export"; + bigEnum[bigEnum["extends"] = 31] = "extends"; + bigEnum[bigEnum["false"] = 32] = "false"; + bigEnum[bigEnum["finally"] = 33] = "finally"; + bigEnum[bigEnum["for"] = 34] = "for"; + bigEnum[bigEnum["function"] = 35] = "function"; + bigEnum[bigEnum["if"] = 36] = "if"; + bigEnum[bigEnum["import"] = 37] = "import"; + bigEnum[bigEnum["in"] = 38] = "in"; + bigEnum[bigEnum["instanceof"] = 39] = "instanceof"; + bigEnum[bigEnum["new"] = 40] = "new"; + bigEnum[bigEnum["null"] = 41] = "null"; + bigEnum[bigEnum["return"] = 42] = "return"; + bigEnum[bigEnum["super"] = 43] = "super"; + bigEnum[bigEnum["switch"] = 44] = "switch"; + bigEnum[bigEnum["this"] = 45] = "this"; + bigEnum[bigEnum["throw"] = 46] = "throw"; + bigEnum[bigEnum["true"] = 47] = "true"; + bigEnum[bigEnum["try"] = 48] = "try"; + bigEnum[bigEnum["typeof"] = 49] = "typeof"; + bigEnum[bigEnum["var"] = 50] = "var"; + bigEnum[bigEnum["void"] = 51] = "void"; + bigEnum[bigEnum["while"] = 52] = "while"; + bigEnum[bigEnum["with"] = 53] = "with"; +})(bigEnum || (bigEnum = {})); +var bigModule; +(function (bigModule) { + var constructor = (function () { + function constructor() { + } + return constructor; + })(); + var implements = (function () { + function implements() { + } + return implements; + })(); + var interface = (function () { + function interface() { + } + return interface; + })(); + var let = (function () { + function let() { + } + return let; + })(); + var module = (function () { + function module() { + } + return module; + })(); + var package = (function () { + function package() { + } + return package; + })(); + var private = (function () { + function private() { + } + return private; + })(); + var protected = (function () { + function protected() { + } + return protected; + })(); + var public = (function () { + function public() { + } + return public; + })(); + var set = (function () { + function set() { + } + return set; + })(); + var static = (function () { + function static() { + } + return static; + })(); + var get = (function () { + function get() { + } + return get; + })(); + var yield = (function () { + function yield() { + } + return yield; + })(); + var declare = (function () { + function declare() { + } + return declare; + })(); +})(bigModule || (bigModule = {})); diff --git a/tests/baselines/reference/copyrightWithNewLine1.errors.txt b/tests/baselines/reference/copyrightWithNewLine1.errors.txt new file mode 100644 index 0000000000000..a389197bf394a --- /dev/null +++ b/tests/baselines/reference/copyrightWithNewLine1.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/copyrightWithNewLine1.ts (2 errors) ==== + /***************************** + * (c) Copyright - Important + ****************************/ + + import model = require("./greeter") + ~~~~~~~~~~~ +!!! Cannot find external module './greeter'. + var el = document.getElementById('content'); + ~~~~~~~~ +!!! Cannot find name 'document'. + var greeter = new model.Greeter(el); + /** things */ + greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithNewLine1.js b/tests/baselines/reference/copyrightWithNewLine1.js new file mode 100644 index 0000000000000..47d0571adc58a --- /dev/null +++ b/tests/baselines/reference/copyrightWithNewLine1.js @@ -0,0 +1,17 @@ +//// [copyrightWithNewLine1.ts] +/***************************** +* (c) Copyright - Important +****************************/ + +import model = require("./greeter") +var el = document.getElementById('content'); +var greeter = new model.Greeter(el); +/** things */ +greeter.start(); + +//// [copyrightWithNewLine1.js] +define(["require", "exports", "./greeter"], function (require, exports, model) { + var el = document.getElementById('content'); + var greeter = new model.Greeter(el); + greeter.start(); +}); diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt new file mode 100644 index 0000000000000..429764799e24d --- /dev/null +++ b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/copyrightWithoutNewLine1.ts (2 errors) ==== + /***************************** + * (c) Copyright - Important + ****************************/ + import model = require("./greeter") + ~~~~~~~~~~~ +!!! Cannot find external module './greeter'. + var el = document.getElementById('content'); + ~~~~~~~~ +!!! Cannot find name 'document'. + var greeter = new model.Greeter(el); + /** things */ + greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.js b/tests/baselines/reference/copyrightWithoutNewLine1.js new file mode 100644 index 0000000000000..f7b343cdc6009 --- /dev/null +++ b/tests/baselines/reference/copyrightWithoutNewLine1.js @@ -0,0 +1,16 @@ +//// [copyrightWithoutNewLine1.ts] +/***************************** +* (c) Copyright - Important +****************************/ +import model = require("./greeter") +var el = document.getElementById('content'); +var greeter = new model.Greeter(el); +/** things */ +greeter.start(); + +//// [copyrightWithoutNewLine1.js] +define(["require", "exports", "./greeter"], function (require, exports, model) { + var el = document.getElementById('content'); + var greeter = new model.Greeter(el); + greeter.start(); +}); diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt b/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt new file mode 100644 index 0000000000000..8a813a1b432a8 --- /dev/null +++ b/tests/baselines/reference/couldNotSelectGenericOverload.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/couldNotSelectGenericOverload.ts (2 errors) ==== + function makeArray(items: T[]): T[] { return items; } + var b = [1, ""]; + var b1G = makeArray(1, ""); // any, no error + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var b2G = makeArray(b); // any[] + + function makeArray2(items: any[]): any[] { return items; } + var b3G = makeArray2(1, ""); // error + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.js b/tests/baselines/reference/couldNotSelectGenericOverload.js new file mode 100644 index 0000000000000..45b1d6d455896 --- /dev/null +++ b/tests/baselines/reference/couldNotSelectGenericOverload.js @@ -0,0 +1,21 @@ +//// [couldNotSelectGenericOverload.ts] +function makeArray(items: T[]): T[] { return items; } +var b = [1, ""]; +var b1G = makeArray(1, ""); // any, no error +var b2G = makeArray(b); // any[] + +function makeArray2(items: any[]): any[] { return items; } +var b3G = makeArray2(1, ""); // error + + +//// [couldNotSelectGenericOverload.js] +function makeArray(items) { + return items; +} +var b = [1, ""]; +var b1G = makeArray(1, ""); +var b2G = makeArray(b); +function makeArray2(items) { + return items; +} +var b3G = makeArray2(1, ""); diff --git a/tests/baselines/reference/covariance1.js b/tests/baselines/reference/covariance1.js new file mode 100644 index 0000000000000..4c19c9d203839 --- /dev/null +++ b/tests/baselines/reference/covariance1.js @@ -0,0 +1,37 @@ +//// [covariance1.ts] +module M { + + interface X { m1:number; } + export class XX implements X { constructor(public m1:number) { } } + + interface Y { x:X; } + + export function f(y:Y) { } + + var a:X; + f({x:a}); // ok + + var b:XX; + f({x:b}); // ok covariant subtype +} + + + +//// [covariance1.js] +var M; +(function (M) { + var XX = (function () { + function XX(m1) { + this.m1 = m1; + } + return XX; + })(); + M.XX = XX; + function f(y) { + } + M.f = f; + var a; + f({ x: a }); + var b; + f({ x: b }); +})(M || (M = {})); diff --git a/tests/baselines/reference/crashInResolveInterface.js b/tests/baselines/reference/crashInResolveInterface.js new file mode 100644 index 0000000000000..6feb855c46f38 --- /dev/null +++ b/tests/baselines/reference/crashInResolveInterface.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/crashInResolveInterface.ts] //// + +//// [file1.ts] +interface Q { + each(action: (item: T, index: number) => void): void; +} +var q1: Q<{ a: number; }>; +var x = q1.each(x => c.log(x)); + +//// [file2.ts] +/// +declare var c: C; +interface C { + count(countTitle?: string): void; +} +interface C { + log(message?: any, ...optionalParams: any[]): void; +} + + +//// [file1.js] +var q1; +var x = q1.each(function (x) { return c.log(x); }); +//// [file2.js] diff --git a/tests/baselines/reference/crashInresolveReturnStatement.js b/tests/baselines/reference/crashInresolveReturnStatement.js new file mode 100644 index 0000000000000..72ece3c8cfc0a --- /dev/null +++ b/tests/baselines/reference/crashInresolveReturnStatement.js @@ -0,0 +1,47 @@ +//// [crashInresolveReturnStatement.ts] +class WorkItemToolbar { + public onToolbarItemClick() { + WITDialogs.createCopyOfWorkItem(); + } +} +class CreateCopyOfWorkItemDialog { + public getDialogResult() { + return null; + } +} +function createWorkItemDialog(dialogType: P0) { +} +class WITDialogs { + public static createCopyOfWorkItem() { + createWorkItemDialog(CreateCopyOfWorkItemDialog); + } +} + + +//// [crashInresolveReturnStatement.js] +var WorkItemToolbar = (function () { + function WorkItemToolbar() { + } + WorkItemToolbar.prototype.onToolbarItemClick = function () { + WITDialogs.createCopyOfWorkItem(); + }; + return WorkItemToolbar; +})(); +var CreateCopyOfWorkItemDialog = (function () { + function CreateCopyOfWorkItemDialog() { + } + CreateCopyOfWorkItemDialog.prototype.getDialogResult = function () { + return null; + }; + return CreateCopyOfWorkItemDialog; +})(); +function createWorkItemDialog(dialogType) { +} +var WITDialogs = (function () { + function WITDialogs() { + } + WITDialogs.createCopyOfWorkItem = function () { + createWorkItemDialog(CreateCopyOfWorkItemDialog); + }; + return WITDialogs; +})(); diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt new file mode 100644 index 0000000000000..917adf117688f --- /dev/null +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts (2 errors) ==== + class C { + private x = 1; + } + class D extends C { } + function foo(x: "hi", items: string[]): typeof foo; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(x: string, items: string[]): typeof foo { + return null; + } + var a: D = foo("hi", []); + ~~~~~~~~~~~~~~~~~~~~ +!!! Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': +!!! Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js new file mode 100644 index 0000000000000..8928e45694ce8 --- /dev/null +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -0,0 +1,36 @@ +//// [crashInsourcePropertyIsRelatableToTargetProperty.ts] +class C { + private x = 1; +} +class D extends C { } +function foo(x: "hi", items: string[]): typeof foo; +function foo(x: string, items: string[]): typeof foo { + return null; +} +var a: D = foo("hi", []); + + +//// [crashInsourcePropertyIsRelatableToTargetProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + this.x = 1; + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +function foo(x, items) { + return null; +} +var a = foo("hi", []); diff --git a/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt b/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt new file mode 100644 index 0000000000000..46693ee572634 --- /dev/null +++ b/tests/baselines/reference/crashIntypeCheckInvocationExpression.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/crashIntypeCheckInvocationExpression.ts (4 errors) ==== + var nake; + function doCompile(fileset: P0, moduleType: P1) { + + return undefined; + } + export var compileServer = task(() => { + ~~~~ +!!! Cannot find name 'task'. + + var folder = path.join(), + ~~~~ +!!! Cannot find name 'path'. + fileset = nake.fileSetSync(folder) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + return doCompile(fileset, moduleType); + ~~~~~~~~~~ +!!! Cannot find name 'moduleType'. + }); + \ No newline at end of file diff --git a/tests/baselines/reference/crashIntypeCheckInvocationExpression.js b/tests/baselines/reference/crashIntypeCheckInvocationExpression.js new file mode 100644 index 0000000000000..e373afe9b2072 --- /dev/null +++ b/tests/baselines/reference/crashIntypeCheckInvocationExpression.js @@ -0,0 +1,25 @@ +//// [crashIntypeCheckInvocationExpression.ts] +var nake; +function doCompile(fileset: P0, moduleType: P1) { + + return undefined; +} +export var compileServer = task(() => { + + var folder = path.join(), + fileset = nake.fileSetSync(folder) + return doCompile(fileset, moduleType); +}); + + +//// [crashIntypeCheckInvocationExpression.js] +define(["require", "exports"], function (require, exports) { + var nake; + function doCompile(fileset, moduleType) { + return undefined; + } + exports.compileServer = task(function () { + var folder = path.join(), fileset = nake.fileSetSync(folder); + return doCompile(fileset, moduleType); + }); +}); diff --git a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt new file mode 100644 index 0000000000000..3399c75914c19 --- /dev/null +++ b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/crashIntypeCheckObjectCreationExpression.ts (1 errors) ==== + export class BuildWorkspaceService { + public injectRequestService(service: P0) { + this.injectBuildService(new X(service)); + ~ +!!! Cannot find name 'X'. + } + public injectBuildService(service: P0) { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js new file mode 100644 index 0000000000000..87deabbdf6b8e --- /dev/null +++ b/tests/baselines/reference/crashIntypeCheckObjectCreationExpression.js @@ -0,0 +1,24 @@ +//// [crashIntypeCheckObjectCreationExpression.ts] +export class BuildWorkspaceService { + public injectRequestService(service: P0) { + this.injectBuildService(new X(service)); + } + public injectBuildService(service: P0) { + } +} + + +//// [crashIntypeCheckObjectCreationExpression.js] +define(["require", "exports"], function (require, exports) { + var BuildWorkspaceService = (function () { + function BuildWorkspaceService() { + } + BuildWorkspaceService.prototype.injectRequestService = function (service) { + this.injectBuildService(new X(service)); + }; + BuildWorkspaceService.prototype.injectBuildService = function (service) { + }; + return BuildWorkspaceService; + })(); + exports.BuildWorkspaceService = BuildWorkspaceService; +}); diff --git a/tests/baselines/reference/crashOnMethodSignatures.errors.txt b/tests/baselines/reference/crashOnMethodSignatures.errors.txt new file mode 100644 index 0000000000000..ceba3908f4363 --- /dev/null +++ b/tests/baselines/reference/crashOnMethodSignatures.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/crashOnMethodSignatures.ts (1 errors) ==== + class A { + a(completed: () => any): void; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/crashOnMethodSignatures.js b/tests/baselines/reference/crashOnMethodSignatures.js new file mode 100644 index 0000000000000..8475020f30747 --- /dev/null +++ b/tests/baselines/reference/crashOnMethodSignatures.js @@ -0,0 +1,12 @@ +//// [crashOnMethodSignatures.ts] +class A { + a(completed: () => any): void; +} + + +//// [crashOnMethodSignatures.js] +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/crashRegressionTest.errors.txt b/tests/baselines/reference/crashRegressionTest.errors.txt new file mode 100644 index 0000000000000..a08d118139752 --- /dev/null +++ b/tests/baselines/reference/crashRegressionTest.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/crashRegressionTest.ts (1 errors) ==== + module MsPortal.Util.TemplateEngine { + "use strict"; + + interface TemplateKeyValue { + [name: string]: string; + } + + class StringTemplate { + private _templateStorage: TemplateStorage; + + constructor(templateStorage: TemplateStorage) { + this._templateStorage = templateStorage; + } + + public text(value?: string): any { + this._templateStorage.templateSources[this._name] = value; + ~~~~~ +!!! Property '_name' does not exist on type 'StringTemplate'. + } + } + + export class TemplateStorage { + public templateSources: TemplateKeyValue = {}; + public templateData: TemplateKeyValue = {}; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/crashRegressionTest.js b/tests/baselines/reference/crashRegressionTest.js new file mode 100644 index 0000000000000..cd4cc40d5531c --- /dev/null +++ b/tests/baselines/reference/crashRegressionTest.js @@ -0,0 +1,55 @@ +//// [crashRegressionTest.ts] +module MsPortal.Util.TemplateEngine { + "use strict"; + + interface TemplateKeyValue { + [name: string]: string; + } + + class StringTemplate { + private _templateStorage: TemplateStorage; + + constructor(templateStorage: TemplateStorage) { + this._templateStorage = templateStorage; + } + + public text(value?: string): any { + this._templateStorage.templateSources[this._name] = value; + } + } + + export class TemplateStorage { + public templateSources: TemplateKeyValue = {}; + public templateData: TemplateKeyValue = {}; + } +} + + +//// [crashRegressionTest.js] +var MsPortal; +(function (MsPortal) { + (function (Util) { + (function (TemplateEngine) { + "use strict"; + var StringTemplate = (function () { + function StringTemplate(templateStorage) { + this._templateStorage = templateStorage; + } + StringTemplate.prototype.text = function (value) { + this._templateStorage.templateSources[this._name] = value; + }; + return StringTemplate; + })(); + var TemplateStorage = (function () { + function TemplateStorage() { + this.templateSources = {}; + this.templateData = {}; + } + return TemplateStorage; + })(); + TemplateEngine.TemplateStorage = TemplateStorage; + })(Util.TemplateEngine || (Util.TemplateEngine = {})); + var TemplateEngine = Util.TemplateEngine; + })(MsPortal.Util || (MsPortal.Util = {})); + var Util = MsPortal.Util; +})(MsPortal || (MsPortal = {})); diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt new file mode 100644 index 0000000000000..41426d307faef --- /dev/null +++ b/tests/baselines/reference/createArray.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/createArray.ts (7 errors) ==== + var na=new number[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~ +!!! Cannot find name 'number'. + + class C { + } + + new C[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + var ba=new boolean[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~~ +!!! Cannot find name 'boolean'. + var sa=new string[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~ +!!! Cannot find name 'string'. + function f(s:string):number { return 0; + } + if (ba[14]) { + na[2]=f(sa[3]); + } + + new C[1]; // not an error \ No newline at end of file diff --git a/tests/baselines/reference/customEventDetail.errors.txt b/tests/baselines/reference/customEventDetail.errors.txt new file mode 100644 index 0000000000000..7cddf40e6ff0e --- /dev/null +++ b/tests/baselines/reference/customEventDetail.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/customEventDetail.ts (1 errors) ==== + var x: CustomEvent; + ~~~~~~~~~~~ +!!! Cannot find name 'CustomEvent'. + + // valid since detail is any + x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); + var y = x.detail.name; \ No newline at end of file diff --git a/tests/baselines/reference/customEventDetail.js b/tests/baselines/reference/customEventDetail.js new file mode 100644 index 0000000000000..2ad8d60b8c850 --- /dev/null +++ b/tests/baselines/reference/customEventDetail.js @@ -0,0 +1,11 @@ +//// [customEventDetail.ts] +var x: CustomEvent; + +// valid since detail is any +x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); +var y = x.detail.name; + +//// [customEventDetail.js] +var x; +x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); +var y = x.detail.name; diff --git a/tests/baselines/reference/cyclicModuleImport.js b/tests/baselines/reference/cyclicModuleImport.js new file mode 100644 index 0000000000000..08f3c7d614705 --- /dev/null +++ b/tests/baselines/reference/cyclicModuleImport.js @@ -0,0 +1,22 @@ +//// [cyclicModuleImport.ts] +declare module "SubModule" { + import MainModule = require('MainModule'); + class SubModule { + public static StaticVar: number; + public InstanceVar: number; + public main: MainModule; + constructor(); + } + export = SubModule; +} +declare module "MainModule" { + import SubModule = require('SubModule'); + class MainModule { + public SubModule: SubModule; + constructor(); + } + export = MainModule; +} + + +//// [cyclicModuleImport.js] diff --git a/tests/baselines/reference/debugger.js b/tests/baselines/reference/debugger.js new file mode 100644 index 0000000000000..0406e6da047f8 --- /dev/null +++ b/tests/baselines/reference/debugger.js @@ -0,0 +1,13 @@ +//// [debugger.ts] +debugger; + +function foo() { + debugger; + +} + +//// [debugger.js] +debugger; +function foo() { + debugger; +} diff --git a/tests/baselines/reference/debuggerEmit.js b/tests/baselines/reference/debuggerEmit.js new file mode 100644 index 0000000000000..c2f730271beba --- /dev/null +++ b/tests/baselines/reference/debuggerEmit.js @@ -0,0 +1,9 @@ +//// [debuggerEmit.ts] +var x = function () { debugger; } +x(); + +//// [debuggerEmit.js] +var x = function () { + debugger; +}; +x(); diff --git a/tests/baselines/reference/declFileAccessors.js b/tests/baselines/reference/declFileAccessors.js new file mode 100644 index 0000000000000..04471c4ee7328 --- /dev/null +++ b/tests/baselines/reference/declFileAccessors.js @@ -0,0 +1,264 @@ +//// [tests/cases/compiler/declFileAccessors.ts] //// + +//// [declFileAccessors_0.ts] + +/** This is comment for c1*/ +export class c1 { + /** getter property*/ + public get p3() { + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { + } + /** private getter property*/ + private get pp3() { + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { + } + /** static getter property*/ + static get s3() { + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { + } + public get nc_p3() { + return 10; + } + public set nc_p3(value: number) { + } + private get nc_pp3() { + return 10; + } + private set nc_pp3(value: number) { + } + static get nc_s3() { + return ""; + } + static set nc_s3(value: string) { + } + + // Only getter property + public get onlyGetter() { + return 10; + } + + // Only setter property + public set onlySetter(value: number) { + } +} + +//// [declFileAccessors_1.ts] +/** This is comment for c2 - the global class*/ +class c2 { + /** getter property*/ + public get p3() { + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { + } + /** private getter property*/ + private get pp3() { + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { + } + /** static getter property*/ + static get s3() { + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { + } + public get nc_p3() { + return 10; + } + public set nc_p3(value: number) { + } + private get nc_pp3() { + return 10; + } + private set nc_pp3(value: number) { + } + static get nc_s3() { + return ""; + } + static set nc_s3(value: string) { + } + + // Only getter property + public get onlyGetter() { + return 10; + } + + // Only setter property + public set onlySetter(value: number) { + } +} + +//// [declFileAccessors_0.js] +var c1 = (function () { + function c1() { + } + Object.defineProperty(c1.prototype, "p3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1.prototype, "pp3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1, "s3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1.prototype, "nc_p3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1.prototype, "nc_pp3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1, "nc_s3", { + get: function () { + return ""; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1.prototype, "onlyGetter", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c1.prototype, "onlySetter", { + set: function (value) { + }, + enumerable: true, + configurable: true + }); + return c1; +})(); +exports.c1 = c1; +//// [declFileAccessors_1.js] +var c2 = (function () { + function c2() { + } + Object.defineProperty(c2.prototype, "p3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2.prototype, "pp3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2, "s3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2.prototype, "nc_p3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2.prototype, "nc_pp3", { + get: function () { + return 10; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2, "nc_s3", { + get: function () { + return ""; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2.prototype, "onlyGetter", { + get: function () { + return 10; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c2.prototype, "onlySetter", { + set: function (value) { + }, + enumerable: true, + configurable: true + }); + return c2; +})(); + + +//// [declFileAccessors_0.d.ts] +export declare class c1 { + p3; + private pp3; + static s3; + nc_p3; + private nc_pp3; + static nc_s3; + onlyGetter; + onlySetter; +} +//// [declFileAccessors_1.d.ts] diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js new file mode 100644 index 0000000000000..5e124586d1033 --- /dev/null +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule.ts] //// + +//// [declFileAmbientExternalModuleWithSingleExportedModule_0.ts] + +declare module "SubModule" { + export module m { + export module m3 { + interface c { + } + } + } +} + +//// [declFileAmbientExternalModuleWithSingleExportedModule_1.ts] +/// +import SubModule = require('SubModule'); +export var x: SubModule.m.m3.c; + + + +//// [declFileAmbientExternalModuleWithSingleExportedModule_0.js] +//// [declFileAmbientExternalModuleWithSingleExportedModule_1.js] +exports.x; + + +//// [declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts] +//// [declFileAmbientExternalModuleWithSingleExportedModule_1.d.ts] +/// +export declare var x; diff --git a/tests/baselines/reference/declFileCallSignatures.js b/tests/baselines/reference/declFileCallSignatures.js new file mode 100644 index 0000000000000..f824425d313c8 --- /dev/null +++ b/tests/baselines/reference/declFileCallSignatures.js @@ -0,0 +1,92 @@ +//// [tests/cases/compiler/declFileCallSignatures.ts] //// + +//// [declFileCallSignatures_0.ts] + +export interface ICallSignature { + /** This comment should appear for foo*/ + (): string; +} + +export interface ICallSignatureWithParameters { + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number): void; +} + +export interface ICallSignatureWithRestParameters { + (a: string, ...rests: string[]): string; +} + +export interface ICallSignatureWithOverloads { + (a: string): string; + (a: number): number; +} + +export interface ICallSignatureWithTypeParameters { + /** This comment should appear for foo*/ + (a: T): string; +} + +export interface ICallSignatureWithOwnTypeParametes { + (a: T): string; +} + +//// [declFileCallSignatures_1.ts] +interface IGlobalCallSignature { + /** This comment should appear for foo*/ + (): string; +} + +interface IGlobalCallSignatureWithParameters { + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number): void; +} + +interface IGlobalCallSignatureWithRestParameters { + + (a: string, ...rests: string[]): string; + +} + +interface IGlobalCallSignatureWithOverloads { + (a: string): string; + (a: number): number; +} + +interface IGlobalCallSignatureWithTypeParameters { + /** This comment should appear for foo*/ + (a: T): string; +} + +interface IGlobalCallSignatureWithOwnTypeParametes { + (a: T): string; +} + +//// [declFileCallSignatures_0.js] +//// [declFileCallSignatures_1.js] + + +//// [declFileCallSignatures_0.d.ts] +export interface ICallSignature { + (); +} +export interface ICallSignatureWithParameters { + (a, b); +} +export interface ICallSignatureWithRestParameters { + (a, ...rests); +} +export interface ICallSignatureWithOverloads { + (a); + (a); +} +export interface ICallSignatureWithTypeParameters { + (a); +} +export interface ICallSignatureWithOwnTypeParametes { + (a); +} +//// [declFileCallSignatures_1.d.ts] diff --git a/tests/baselines/reference/declFileClassWithIndexSignature.js b/tests/baselines/reference/declFileClassWithIndexSignature.js new file mode 100644 index 0000000000000..139a68452034b --- /dev/null +++ b/tests/baselines/reference/declFileClassWithIndexSignature.js @@ -0,0 +1,15 @@ +//// [declFileClassWithIndexSignature.ts] + +class BlockIntrinsics { + [s: string]: string; +} + +//// [declFileClassWithIndexSignature.js] +var BlockIntrinsics = (function () { + function BlockIntrinsics() { + } + return BlockIntrinsics; +})(); + + +//// [declFileClassWithIndexSignature.d.ts] diff --git a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js new file mode 100644 index 0000000000000..b7271cfba464f --- /dev/null +++ b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.js @@ -0,0 +1,24 @@ +//// [declFileClassWithStaticMethodReturningConstructor.ts] + +export class Enhancement { + public static getType() { + return this; + } +} + +//// [declFileClassWithStaticMethodReturningConstructor.js] +var Enhancement = (function () { + function Enhancement() { + } + Enhancement.getType = function () { + return this; + }; + return Enhancement; +})(); +exports.Enhancement = Enhancement; + + +//// [declFileClassWithStaticMethodReturningConstructor.d.ts] +export declare class Enhancement { + static getType(); +} diff --git a/tests/baselines/reference/declFileConstructSignatures.js b/tests/baselines/reference/declFileConstructSignatures.js new file mode 100644 index 0000000000000..edd9ad1d4d1ac --- /dev/null +++ b/tests/baselines/reference/declFileConstructSignatures.js @@ -0,0 +1,92 @@ +//// [tests/cases/compiler/declFileConstructSignatures.ts] //// + +//// [declFileConstructSignatures_0.ts] + +export interface IConstructSignature { + /** This comment should appear for foo*/ + new (): string; +} + +export interface IConstructSignatureWithParameters { + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number); +} + +export interface IConstructSignatureWithRestParameters { + new (a: string, ...rests: string[]): string; +} + +export interface IConstructSignatureWithOverloads { + new (a: string): string; + new (a: number): number; +} + +export interface IConstructSignatureWithTypeParameters { + /** This comment should appear for foo*/ + new (a: T): T; +} + +export interface IConstructSignatureWithOwnTypeParametes { + new (a: T): T; +} + +//// [declFileConstructSignatures_1.ts] +interface IGlobalConstructSignature { + /** This comment should appear for foo*/ + new (): string; +} + +interface IGlobalConstructSignatureWithParameters { + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number); +} + +interface IGlobalConstructSignatureWithRestParameters { + + new (a: string, ...rests: string[]): string; + +} + +interface IGlobalConstructSignatureWithOverloads { + new (a: string): string; + new (a: number): number; +} + +interface IGlobalConstructSignatureWithTypeParameters { + /** This comment should appear for foo*/ + new (a: T): T; +} + +interface IGlobalConstructSignatureWithOwnTypeParametes { + new (a: T): T; +} + +//// [declFileConstructSignatures_0.js] +//// [declFileConstructSignatures_1.js] + + +//// [declFileConstructSignatures_0.d.ts] +export interface IConstructSignature { + new (); +} +export interface IConstructSignatureWithParameters { + new (a, b); +} +export interface IConstructSignatureWithRestParameters { + new (a, ...rests); +} +export interface IConstructSignatureWithOverloads { + new (a); + new (a); +} +export interface IConstructSignatureWithTypeParameters { + new (a); +} +export interface IConstructSignatureWithOwnTypeParametes { + new (a); +} +//// [declFileConstructSignatures_1.d.ts] diff --git a/tests/baselines/reference/declFileConstructors.js b/tests/baselines/reference/declFileConstructors.js new file mode 100644 index 0000000000000..faa83b25aa592 --- /dev/null +++ b/tests/baselines/reference/declFileConstructors.js @@ -0,0 +1,245 @@ +//// [tests/cases/compiler/declFileConstructors.ts] //// + +//// [declFileConstructors_0.ts] + +export class SimpleConstructor { + /** This comment should appear for foo*/ + constructor() { + } +} +export class ConstructorWithParameters { + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } +} + +export class ConstructorWithRestParamters { + constructor(a: string, ...rests: string[]) { + return a + rests.join(""); + } +} + +export class ConstructorWithOverloads { + constructor(a: string); + constructor(a: number); + constructor(a: any) { + } +} + +export class ConstructorWithPublicParameterProperty { + constructor(public x: string) { + } +} + +export class ConstructorWithPrivateParameterProperty { + constructor(private x: string) { + } +} + +export class ConstructorWithOptionalParameterProperty { + constructor(public x?: string) { + } +} + +export class ConstructorWithParameterInitializer { + constructor(public x = "hello") { + } +} + +//// [declFileConstructors_1.ts] +class GlobalSimpleConstructor { + /** This comment should appear for foo*/ + constructor() { + } +} +class GlobalConstructorWithParameters { + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } +} + +class GlobalConstructorWithRestParamters { + constructor(a: string, ...rests: string[]) { + return a + rests.join(""); + } +} + +class GlobalConstructorWithOverloads { + constructor(a: string); + constructor(a: number); + constructor(a: any) { + } +} + +class GlobalConstructorWithPublicParameterProperty { + constructor(public x: string) { + } +} + +class GlobalConstructorWithPrivateParameterProperty { + constructor(private x: string) { + } +} + +class GlobalConstructorWithOptionalParameterProperty { + constructor(public x?: string) { + } +} + +class GlobalConstructorWithParameterInitializer { + constructor(public x = "hello") { + } +} + +//// [declFileConstructors_0.js] +var SimpleConstructor = (function () { + function SimpleConstructor() { + } + return SimpleConstructor; +})(); +exports.SimpleConstructor = SimpleConstructor; +var ConstructorWithParameters = (function () { + function ConstructorWithParameters(a, b) { + var d = a; + } + return ConstructorWithParameters; +})(); +exports.ConstructorWithParameters = ConstructorWithParameters; +var ConstructorWithRestParamters = (function () { + function ConstructorWithRestParamters(a, rests) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + } + return ConstructorWithRestParamters; +})(); +exports.ConstructorWithRestParamters = ConstructorWithRestParamters; +var ConstructorWithOverloads = (function () { + function ConstructorWithOverloads(a) { + } + return ConstructorWithOverloads; +})(); +exports.ConstructorWithOverloads = ConstructorWithOverloads; +var ConstructorWithPublicParameterProperty = (function () { + function ConstructorWithPublicParameterProperty(x) { + this.x = x; + } + return ConstructorWithPublicParameterProperty; +})(); +exports.ConstructorWithPublicParameterProperty = ConstructorWithPublicParameterProperty; +var ConstructorWithPrivateParameterProperty = (function () { + function ConstructorWithPrivateParameterProperty(x) { + this.x = x; + } + return ConstructorWithPrivateParameterProperty; +})(); +exports.ConstructorWithPrivateParameterProperty = ConstructorWithPrivateParameterProperty; +var ConstructorWithOptionalParameterProperty = (function () { + function ConstructorWithOptionalParameterProperty(x) { + this.x = x; + } + return ConstructorWithOptionalParameterProperty; +})(); +exports.ConstructorWithOptionalParameterProperty = ConstructorWithOptionalParameterProperty; +var ConstructorWithParameterInitializer = (function () { + function ConstructorWithParameterInitializer(x) { + if (x === void 0) { x = "hello"; } + this.x = x; + } + return ConstructorWithParameterInitializer; +})(); +exports.ConstructorWithParameterInitializer = ConstructorWithParameterInitializer; +//// [declFileConstructors_1.js] +var GlobalSimpleConstructor = (function () { + function GlobalSimpleConstructor() { + } + return GlobalSimpleConstructor; +})(); +var GlobalConstructorWithParameters = (function () { + function GlobalConstructorWithParameters(a, b) { + var d = a; + } + return GlobalConstructorWithParameters; +})(); +var GlobalConstructorWithRestParamters = (function () { + function GlobalConstructorWithRestParamters(a, rests) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + } + return GlobalConstructorWithRestParamters; +})(); +var GlobalConstructorWithOverloads = (function () { + function GlobalConstructorWithOverloads(a) { + } + return GlobalConstructorWithOverloads; +})(); +var GlobalConstructorWithPublicParameterProperty = (function () { + function GlobalConstructorWithPublicParameterProperty(x) { + this.x = x; + } + return GlobalConstructorWithPublicParameterProperty; +})(); +var GlobalConstructorWithPrivateParameterProperty = (function () { + function GlobalConstructorWithPrivateParameterProperty(x) { + this.x = x; + } + return GlobalConstructorWithPrivateParameterProperty; +})(); +var GlobalConstructorWithOptionalParameterProperty = (function () { + function GlobalConstructorWithOptionalParameterProperty(x) { + this.x = x; + } + return GlobalConstructorWithOptionalParameterProperty; +})(); +var GlobalConstructorWithParameterInitializer = (function () { + function GlobalConstructorWithParameterInitializer(x) { + if (x === void 0) { x = "hello"; } + this.x = x; + } + return GlobalConstructorWithParameterInitializer; +})(); + + +//// [declFileConstructors_0.d.ts] +export declare class SimpleConstructor { + constructor (); +} +export declare class ConstructorWithParameters { + constructor (a, b); +} +export declare class ConstructorWithRestParamters { + constructor (a, ...rests); +} +export declare class ConstructorWithOverloads { + constructor (a); + constructor (a); + constructor (a); +} +export declare class ConstructorWithPublicParameterProperty { + x; + constructor (x); +} +export declare class ConstructorWithPrivateParameterProperty { + private x; + constructor (x); +} +export declare class ConstructorWithOptionalParameterProperty { + x; + constructor (x?); +} +export declare class ConstructorWithParameterInitializer { + x; + constructor (x?); +} +//// [declFileConstructors_1.d.ts] diff --git a/tests/baselines/reference/declFileEnumUsedAsValue.js b/tests/baselines/reference/declFileEnumUsedAsValue.js new file mode 100644 index 0000000000000..941d169e874e9 --- /dev/null +++ b/tests/baselines/reference/declFileEnumUsedAsValue.js @@ -0,0 +1,20 @@ +//// [declFileEnumUsedAsValue.ts] + +enum e { + a, + b, + c +} +var x = e; + +//// [declFileEnumUsedAsValue.js] +var e; +(function (e) { + e[e["a"] = 0] = "a"; + e[e["b"] = 1] = "b"; + e[e["c"] = 2] = "c"; +})(e || (e = {})); +var x = e; + + +//// [declFileEnumUsedAsValue.d.ts] diff --git a/tests/baselines/reference/declFileEnums.js b/tests/baselines/reference/declFileEnums.js new file mode 100644 index 0000000000000..33eb1f7a8a67e --- /dev/null +++ b/tests/baselines/reference/declFileEnums.js @@ -0,0 +1,75 @@ +//// [declFileEnums.ts] + +enum e1 { + a, + b, + c +} + +enum e2 { + a = 10, + b = a + 2, + c = 10, +} + +enum e3 { + a = 10, + b = Math.PI, + c = a + 3 +} + +enum e4 { + a, + b, + c, + d = 10, + e +} + +enum e5 { + "Friday", + "Saturday", + "Sunday", + "Weekend days" +} + + + + +//// [declFileEnums.js] +var e1; +(function (e1) { + e1[e1["a"] = 0] = "a"; + e1[e1["b"] = 1] = "b"; + e1[e1["c"] = 2] = "c"; +})(e1 || (e1 = {})); +var e2; +(function (e2) { + e2[e2["a"] = 10] = "a"; + e2[e2["b"] = e2.a + 2] = "b"; + e2[e2["c"] = 10] = "c"; +})(e2 || (e2 = {})); +var e3; +(function (e3) { + e3[e3["a"] = 10] = "a"; + e3[e3["b"] = Math.PI] = "b"; + e3[e3["c"] = e3.a + 3] = "c"; +})(e3 || (e3 = {})); +var e4; +(function (e4) { + e4[e4["a"] = 0] = "a"; + e4[e4["b"] = 1] = "b"; + e4[e4["c"] = 2] = "c"; + e4[e4["d"] = 10] = "d"; + e4[e4["e"] = 11] = "e"; +})(e4 || (e4 = {})); +var e5; +(function (e5) { + e5[e5["Friday"] = 0] = "Friday"; + e5[e5["Saturday"] = 1] = "Saturday"; + e5[e5["Sunday"] = 2] = "Sunday"; + e5[e5["Weekend days"] = 3] = "Weekend days"; +})(e5 || (e5 = {})); + + +//// [declFileEnums.d.ts] diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.js b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.js new file mode 100644 index 0000000000000..1608f4c8d89f8 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.js @@ -0,0 +1,34 @@ +//// [declFileExportAssignmentImportInternalModule.ts] +module m3 { + export module m2 { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + export var server: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; +} + +import m = m3 +export = m; + +//// [declFileExportAssignmentImportInternalModule.js] +var m3; +(function (m3) { + m3.server; +})(m3 || (m3 = {})); +var m = m3; +module.exports = m; + + +//// [declFileExportAssignmentImportInternalModule.d.ts] +export = m; diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js new file mode 100644 index 0000000000000..0451afdfa6159 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/declFileExportAssignmentOfGenericInterface.ts] //// + +//// [declFileExportAssignmentOfGenericInterface_0.ts] + +interface Foo { + a: string; +} +export = Foo; + +//// [declFileExportAssignmentOfGenericInterface_1.ts] +import a = require('declFileExportAssignmentOfGenericInterface_0'); +export var x: a>; +x.a; + +//// [declFileExportAssignmentOfGenericInterface_0.js] +define(["require", "exports"], function (require, exports) { +}); +//// [declFileExportAssignmentOfGenericInterface_1.js] +define(["require", "exports"], function (require, exports) { + exports.x; + exports.x.a; +}); + + +//// [declFileExportAssignmentOfGenericInterface_0.d.ts] +export = Foo; +//// [declFileExportAssignmentOfGenericInterface_1.d.ts] +export declare var x; diff --git a/tests/baselines/reference/declFileExportImportChain.js b/tests/baselines/reference/declFileExportImportChain.js new file mode 100644 index 0000000000000..7613b45d5b0c6 --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain.js @@ -0,0 +1,70 @@ +//// [tests/cases/compiler/declFileExportImportChain.ts] //// + +//// [declFileExportImportChain_a.ts] + +module m1 { + export module m2 { + export class c1 { + } + } +} +export = m1; + +//// [declFileExportImportChain_b.ts] +export import a = require("declFileExportImportChain_a"); + +//// [declFileExportImportChain_b1.ts] +import b = require("declFileExportImportChain_b"); +export = b; + +//// [declFileExportImportChain_c.ts] +export import b1 = require("declFileExportImportChain_b1"); + +//// [declFileExportImportChain_d.ts] +import c = require("declFileExportImportChain_c"); +export var x: c.b1.a.m2.c1; + +//// [declFileExportImportChain_a.js] +define(["require", "exports"], function (require, exports) { + var m1; + (function (m1) { + (function (m2) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m2.c1 = c1; + })(m1.m2 || (m1.m2 = {})); + var m2 = m1.m2; + })(m1 || (m1 = {})); + return m1; +}); +//// [declFileExportImportChain_b.js] +define(["require", "exports", "declFileExportImportChain_a"], function (require, exports, a) { + exports.a = a; +}); +//// [declFileExportImportChain_b1.js] +define(["require", "exports", "declFileExportImportChain_b"], function (require, exports, b) { + return b; +}); +//// [declFileExportImportChain_c.js] +define(["require", "exports", "declFileExportImportChain_b1"], function (require, exports, b1) { + exports.b1 = b1; +}); +//// [declFileExportImportChain_d.js] +define(["require", "exports"], function (require, exports) { + exports.x; +}); + + +//// [declFileExportImportChain_a.d.ts] +export = m1; +//// [declFileExportImportChain_b.d.ts] +export import a = require("declFileExportImportChain_a"); +//// [declFileExportImportChain_b1.d.ts] +export = b; +//// [declFileExportImportChain_c.d.ts] +export import b1 = require("declFileExportImportChain_b1"); +//// [declFileExportImportChain_d.d.ts] +export declare var x; diff --git a/tests/baselines/reference/declFileExportImportChain2.js b/tests/baselines/reference/declFileExportImportChain2.js new file mode 100644 index 0000000000000..46e340af8a09c --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain2.js @@ -0,0 +1,61 @@ +//// [tests/cases/compiler/declFileExportImportChain2.ts] //// + +//// [declFileExportImportChain2_a.ts] + +module m1 { + export module m2 { + export class c1 { + } + } +} +export = m1; + +//// [declFileExportImportChain2_b.ts] +import a = require("declFileExportImportChain2_a"); +export = a; + +//// [declFileExportImportChain2_c.ts] +export import b = require("declFileExportImportChain2_b"); + +//// [declFileExportImportChain2_d.ts] +import c = require("declFileExportImportChain2_c"); +export var x: c.b.m2.c1; + +//// [declFileExportImportChain2_a.js] +define(["require", "exports"], function (require, exports) { + var m1; + (function (m1) { + (function (m2) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m2.c1 = c1; + })(m1.m2 || (m1.m2 = {})); + var m2 = m1.m2; + })(m1 || (m1 = {})); + return m1; +}); +//// [declFileExportImportChain2_b.js] +define(["require", "exports", "declFileExportImportChain2_a"], function (require, exports, a) { + return a; +}); +//// [declFileExportImportChain2_c.js] +define(["require", "exports", "declFileExportImportChain2_b"], function (require, exports, b) { + exports.b = b; +}); +//// [declFileExportImportChain2_d.js] +define(["require", "exports"], function (require, exports) { + exports.x; +}); + + +//// [declFileExportImportChain2_a.d.ts] +export = m1; +//// [declFileExportImportChain2_b.d.ts] +export = a; +//// [declFileExportImportChain2_c.d.ts] +export import b = require("declFileExportImportChain2_b"); +//// [declFileExportImportChain2_d.d.ts] +export declare var x; diff --git a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js new file mode 100644 index 0000000000000..96f578f8b9b55 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.js @@ -0,0 +1,60 @@ +//// [declFileForClassWithMultipleBaseClasses.ts] + +class A { + foo() { } +} + +class B { + bar() { } +} + +interface I { + baz(); +} + +interface J { + bat(); +} + + +class D implements I, J { + baz() { } + bat() { } + foo() { } + bar() { } +} + +interface I extends A, B { +} + +//// [declFileForClassWithMultipleBaseClasses.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +var D = (function () { + function D() { + } + D.prototype.baz = function () { + }; + D.prototype.bat = function () { + }; + D.prototype.foo = function () { + }; + D.prototype.bar = function () { + }; + return D; +})(); + + +//// [declFileForClassWithMultipleBaseClasses.d.ts] diff --git a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js new file mode 100644 index 0000000000000..47e64832145e8 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.js @@ -0,0 +1,19 @@ +//// [declFileForClassWithPrivateOverloadedFunction.ts] + +class C { + private foo(x: number); + private foo(x: string); + private foo(x: any) { } +} + +//// [declFileForClassWithPrivateOverloadedFunction.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); + + +//// [declFileForClassWithPrivateOverloadedFunction.d.ts] diff --git a/tests/baselines/reference/declFileForExportedImport.js b/tests/baselines/reference/declFileForExportedImport.js new file mode 100644 index 0000000000000..ad3c1ca92e3bc --- /dev/null +++ b/tests/baselines/reference/declFileForExportedImport.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/declFileForExportedImport.ts] //// + +//// [declFileForExportedImport_0.ts] +export var x: number; + +//// [declFileForExportedImport_1.ts] +/// +export import a = require('declFileForExportedImport_0'); +var y = a.x; + +export import b = a; +var z = b.x; + +//// [declFileForExportedImport_0.js] +exports.x; +//// [declFileForExportedImport_1.js] +exports.a = require('declFileForExportedImport_0'); +var y = exports.a.x; +exports.b = exports.a; +var z = exports.b.x; + + +//// [declFileForExportedImport_0.d.ts] +export declare var x; +//// [declFileForExportedImport_1.d.ts] +/// +export import a = require('declFileForExportedImport_0'); +export import b = a; diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js new file mode 100644 index 0000000000000..3b89866aca3af --- /dev/null +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -0,0 +1,33 @@ +//// [declFileForFunctionTypeAsTypeParameter.ts] + +class X { +} +class C extends X<() => number> { +} +interface I extends X<() => number> { +} + + + +//// [declFileForFunctionTypeAsTypeParameter.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var X = (function () { + function X() { + } + return X; +})(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(X); + + +//// [declFileForFunctionTypeAsTypeParameter.d.ts] diff --git a/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.js b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.js new file mode 100644 index 0000000000000..0275a801a1cde --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.js @@ -0,0 +1,11 @@ +//// [declFileForInterfaceWithOptionalFunction.ts] + +interface I { + foo? (x?); + foo2? (x?: number): number; +} + +//// [declFileForInterfaceWithOptionalFunction.js] + + +//// [declFileForInterfaceWithOptionalFunction.d.ts] diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.js b/tests/baselines/reference/declFileForInterfaceWithRestParams.js new file mode 100644 index 0000000000000..c56bce67d33d7 --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.js @@ -0,0 +1,12 @@ +//// [declFileForInterfaceWithRestParams.ts] + +interface I { + foo(...x): typeof x; + foo2(a: number, ...x): typeof x; + foo3(b: string, ...x: string[]): typeof x; +} + +//// [declFileForInterfaceWithRestParams.js] + + +//// [declFileForInterfaceWithRestParams.d.ts] diff --git a/tests/baselines/reference/declFileForTypeParameters.js b/tests/baselines/reference/declFileForTypeParameters.js new file mode 100644 index 0000000000000..2b780582b8a9c --- /dev/null +++ b/tests/baselines/reference/declFileForTypeParameters.js @@ -0,0 +1,21 @@ +//// [declFileForTypeParameters.ts] + +class C { + x: T; + foo(a: T): T { + return this.x; + } +} + +//// [declFileForTypeParameters.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (a) { + return this.x; + }; + return C; +})(); + + +//// [declFileForTypeParameters.d.ts] diff --git a/tests/baselines/reference/declFileForVarList.js b/tests/baselines/reference/declFileForVarList.js new file mode 100644 index 0000000000000..efbc7e3c6a132 --- /dev/null +++ b/tests/baselines/reference/declFileForVarList.js @@ -0,0 +1,11 @@ +//// [declFileForVarList.ts] + +var x, y, z = 1; +var x1 = 1, y2 = 2, z2 = 3; + +//// [declFileForVarList.js] +var x, y, z = 1; +var x1 = 1, y2 = 2, z2 = 3; + + +//// [declFileForVarList.d.ts] diff --git a/tests/baselines/reference/declFileFunctions.js b/tests/baselines/reference/declFileFunctions.js new file mode 100644 index 0000000000000..9142051cc4803 --- /dev/null +++ b/tests/baselines/reference/declFileFunctions.js @@ -0,0 +1,122 @@ +//// [tests/cases/compiler/declFileFunctions.ts] //// + +//// [declFileFunctions_0.ts] + +/** This comment should appear for foo*/ +export function foo() { +} +/** This is comment for function signature*/ +export function fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; +} +export function fooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); +} + +export function fooWithOverloads(a: string): string; +export function fooWithOverloads(a: number): number; +export function fooWithOverloads(a: any): any { + return a; +} + +/** This comment should appear for nonExportedFoo*/ +function nonExportedFoo() { +} +/** This is comment for function signature*/ +function nonExportedFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; +} +function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); +} + +function nonExportedFooWithOverloads(a: string): string; +function nonExportedFooWithOverloads(a: number): number; +function nonExportedFooWithOverloads(a: any): any { + return a; +} + +//// [declFileFunctions_1.ts] +/** This comment should appear for foo*/ +function globalfoo() { +} +/** This is comment for function signature*/ +function globalfooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; +} +function globalfooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); +} +function globalfooWithOverloads(a: string): string; +function globalfooWithOverloads(a: number): number; +function globalfooWithOverloads(a: any): any { + return a; +} + +//// [declFileFunctions_0.js] +function foo() { +} +exports.foo = foo; +function fooWithParameters(a, b) { + var d = a; +} +exports.fooWithParameters = fooWithParameters; +function fooWithRestParameters(a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); +} +exports.fooWithRestParameters = fooWithRestParameters; +function fooWithOverloads(a) { + return a; +} +exports.fooWithOverloads = fooWithOverloads; +function nonExportedFoo() { +} +function nonExportedFooWithParameters(a, b) { + var d = a; +} +function nonExportedFooWithRestParameters(a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); +} +function nonExportedFooWithOverloads(a) { + return a; +} +//// [declFileFunctions_1.js] +function globalfoo() { +} +function globalfooWithParameters(a, b) { + var d = a; +} +function globalfooWithRestParameters(a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); +} +function globalfooWithOverloads(a) { + return a; +} + + +//// [declFileFunctions_0.d.ts] +export declare function foo(); +export declare function fooWithParameters(a, b); +export declare function fooWithRestParameters(a, ...rests); +export declare function fooWithOverloads(a); +export declare function fooWithOverloads(a); +export declare function fooWithOverloads(a); +//// [declFileFunctions_1.d.ts] diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js new file mode 100644 index 0000000000000..833fedd76453b --- /dev/null +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -0,0 +1,41 @@ +//// [declFileGenericClassWithGenericExtendedClass.ts] +interface IFoo { + baz: Baz; +} +class Base { } +class Derived extends Base { } +interface IBar { + derived: Derived; +} +class Baz implements IBar { + derived: Derived; +} + + +//// [declFileGenericClassWithGenericExtendedClass.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Baz = (function () { + function Baz() { + } + return Baz; +})(); + + +//// [declFileGenericClassWithGenericExtendedClass.d.ts] diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js new file mode 100644 index 0000000000000..33c6be4aba138 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType.js @@ -0,0 +1,145 @@ +//// [declFileGenericType.ts] +export module C { + export class A{ } + export class B { } + + export function F(x: T): A { return null; } + export function F2(x: T): C.A { return null; } + export function F3(x: T): C.A[] { return null; } + export function F4>(x: T): Array> { return null; } + + export function F5(): T { return null; } + + export function F6>(x: T): T { return null; } + + export class D{ + + constructor(public val: T) { } + + } +} + +export var a: C.A; + +export var b = C.F; +export var c = C.F2; +export var d = C.F3; +export var e = C.F4; + +export var x = (new C.D>(new C.A())).val; + +export function f>() { } + +export var g = C.F5>(); + +export class h extends C.A{ } + +export interface i extends C.A { } + +export var j = C.F6; + + +//// [declFileGenericType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +(function (C) { + var A = (function () { + function A() { + } + return A; + })(); + C.A = A; + var B = (function () { + function B() { + } + return B; + })(); + C.B = B; + function F(x) { + return null; + } + C.F = F; + function F2(x) { + return null; + } + C.F2 = F2; + function F3(x) { + return null; + } + C.F3 = F3; + function F4(x) { + return null; + } + C.F4 = F4; + function F5() { + return null; + } + C.F5 = F5; + function F6(x) { + return null; + } + C.F6 = F6; + var D = (function () { + function D(val) { + this.val = val; + } + return D; + })(); + C.D = D; +})(exports.C || (exports.C = {})); +var C = exports.C; +exports.a; +exports.b = C.F; +exports.c = C.F2; +exports.d = C.F3; +exports.e = C.F4; +exports.x = (new C.D(new C.A())).val; +function f() { +} +exports.f = f; +exports.g = C.F5(); +var h = (function (_super) { + __extends(h, _super); + function h() { + _super.apply(this, arguments); + } + return h; +})(C.A); +exports.h = h; +exports.j = C.F6; + + +//// [declFileGenericType.d.ts] +export declare module C { + class A { + } + class B { + } + function F(x); + function F2(x); + function F3(x); + function F4>(x); + function F5(); + function F6>(x); + class D { + val; + constructor (val); + } +} +export declare var a; +export declare var b; +export declare var c; +export declare var d; +export declare var e; +export declare var x; +export declare function f>(); +export declare var g; +export declare class h extends C.A { +} +export interface i extends C.A { +} +export declare var j; diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js new file mode 100644 index 0000000000000..c621eb7c74490 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType2.js @@ -0,0 +1,92 @@ +//// [declFileGenericType2.ts] + +declare module templa.mvc { + interface IModel { + } +} +declare module templa.mvc { + interface IController { + } +} +declare module templa.mvc { + class AbstractController implements mvc.IController { + } +} +declare module templa.mvc.composite { + interface ICompositeControllerModel extends mvc.IModel { + getControllers(): mvc.IController[]; + } +} +module templa.dom.mvc { + export interface IElementController extends templa.mvc.IController { + } +} +// Module +module templa.dom.mvc { + + export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { + constructor() { + super(); + } + } +} +// Module +module templa.dom.mvc.composite { + export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { + public _controllers: templa.mvc.IController[]; + constructor() { + super(); + this._controllers = []; + } + } +} + + +//// [declFileGenericType2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var templa; +(function (templa) { + (function (dom) { + (function (mvc) { + var AbstractElementController = (function (_super) { + __extends(AbstractElementController, _super); + function AbstractElementController() { + _super.call(this); + } + return AbstractElementController; + })(templa.mvc.AbstractController); + mvc.AbstractElementController = AbstractElementController; + })(dom.mvc || (dom.mvc = {})); + var mvc = dom.mvc; + })(templa.dom || (templa.dom = {})); + var dom = templa.dom; +})(templa || (templa = {})); +var templa; +(function (templa) { + (function (dom) { + (function (mvc) { + (function (composite) { + var AbstractCompositeElementController = (function (_super) { + __extends(AbstractCompositeElementController, _super); + function AbstractCompositeElementController() { + _super.call(this); + this._controllers = []; + } + return AbstractCompositeElementController; + })(templa.dom.mvc.AbstractElementController); + composite.AbstractCompositeElementController = AbstractCompositeElementController; + })(mvc.composite || (mvc.composite = {})); + var composite = mvc.composite; + })(dom.mvc || (dom.mvc = {})); + var mvc = dom.mvc; + })(templa.dom || (templa.dom = {})); + var dom = templa.dom; +})(templa || (templa = {})); + + +//// [declFileGenericType2.d.ts] diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.js b/tests/baselines/reference/declFileImportModuleWithExportAssignment.js new file mode 100644 index 0000000000000..c876c98d4f152 --- /dev/null +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.js @@ -0,0 +1,41 @@ +//// [tests/cases/compiler/declFileImportModuleWithExportAssignment.ts] //// + +//// [declFileImportModuleWithExportAssignment_0.ts] + +module m2 { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + +} +var m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; +}; +export = m2; + +//// [declFileImportModuleWithExportAssignment_1.ts] +/**This is on import declaration*/ +import a1 = require("declFileImportModuleWithExportAssignment_0"); +export var a = a1; +a.test1(null, null, null); + + +//// [declFileImportModuleWithExportAssignment_0.js] +var m2; +module.exports = m2; +//// [declFileImportModuleWithExportAssignment_1.js] +var a1 = require("declFileImportModuleWithExportAssignment_0"); +exports.a = a1; +exports.a.test1(null, null, null); + + +//// [declFileImportModuleWithExportAssignment_0.d.ts] +export = m2; +//// [declFileImportModuleWithExportAssignment_1.d.ts] +export declare var a; diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js new file mode 100644 index 0000000000000..4812862a4c20c --- /dev/null +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.js @@ -0,0 +1,24 @@ +//// [declFileImportedTypeUseInTypeArgPosition.ts] +class List { } +declare module 'mod1' { + class Foo { + } +} + +declare module 'moo' { + import x = require('mod1'); + export var p: List; +} + + + + +//// [declFileImportedTypeUseInTypeArgPosition.js] +var List = (function () { + function List() { + } + return List; +})(); + + +//// [declFileImportedTypeUseInTypeArgPosition.d.ts] diff --git a/tests/baselines/reference/declFileIndexSignatures.js b/tests/baselines/reference/declFileIndexSignatures.js new file mode 100644 index 0000000000000..80c818ebb0095 --- /dev/null +++ b/tests/baselines/reference/declFileIndexSignatures.js @@ -0,0 +1,56 @@ +//// [tests/cases/compiler/declFileIndexSignatures.ts] //// + +//// [declFileIndexSignatures_0.ts] + +export interface IStringIndexSignature { + [s: string]: string; +} +export interface INumberIndexSignature { + [n: number]: number; +} + +export interface IBothIndexSignature { + [s: string]: any; + [n: number]: number; +} + +export interface IIndexSignatureWithTypeParameter { + [a: string]: T; +} + +//// [declFileIndexSignatures_1.ts] +interface IGlobalStringIndexSignature { + [s: string]: string; +} +interface IGlobalNumberIndexSignature { + [n: number]: number; +} + +interface IGlobalBothIndexSignature { + [s: string]: any; + [n: number]: number; +} + +interface IGlobalIndexSignatureWithTypeParameter { + [a: string]: T; +} + +//// [declFileIndexSignatures_0.js] +//// [declFileIndexSignatures_1.js] + + +//// [declFileIndexSignatures_0.d.ts] +export interface IStringIndexSignature { + [s]; +} +export interface INumberIndexSignature { + [n]; +} +export interface IBothIndexSignature { + [s]; + [n]; +} +export interface IIndexSignatureWithTypeParameter { + [a]; +} +//// [declFileIndexSignatures_1.d.ts] diff --git a/tests/baselines/reference/declFileInternalAliases.js b/tests/baselines/reference/declFileInternalAliases.js new file mode 100644 index 0000000000000..1c15770542929 --- /dev/null +++ b/tests/baselines/reference/declFileInternalAliases.js @@ -0,0 +1,37 @@ +//// [declFileInternalAliases.ts] +module m { + export class c { + } +} +module m1 { + import x = m.c; + export var d = new x(); // emit the type as m.c +} +module m2 { + export import x = m.c; + export var d = new x(); // emit the type as x +} + +//// [declFileInternalAliases.js] +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; +})(m || (m = {})); +var m1; +(function (m1) { + var x = m.c; + m1.d = new x(); +})(m1 || (m1 = {})); +var m2; +(function (m2) { + m2.x = m.c; + m2.d = new m2.x(); +})(m2 || (m2 = {})); + + +//// [declFileInternalAliases.d.ts] diff --git a/tests/baselines/reference/declFileMethods.js b/tests/baselines/reference/declFileMethods.js new file mode 100644 index 0000000000000..71d5d9359ba4b --- /dev/null +++ b/tests/baselines/reference/declFileMethods.js @@ -0,0 +1,362 @@ +//// [tests/cases/compiler/declFileMethods.ts] //// + +//// [declFileMethods_0.ts] + +export class c1 { + /** This comment should appear for foo*/ + public foo() { + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + public fooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + + public fooWithOverloads(a: string): string; + public fooWithOverloads(a: number): number; + public fooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + private privateFooWithOverloads(a: string): string; + private privateFooWithOverloads(a: number): number; + private privateFooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for static foo*/ + static staticFoo() { + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + static staticFooWithOverloads(a: string): string; + static staticFooWithOverloads(a: number): number; + static staticFooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + private static privateStaticFooWithOverloads(a: string): string; + private static privateStaticFooWithOverloads(a: number): number; + private static privateStaticFooWithOverloads(a: any): any { + return a; + } +} + +export interface I1 { + /** This comment should appear for foo*/ + foo(): string; + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number): void; + + fooWithRestParameters(a: string, ...rests: string[]): string; + + fooWithOverloads(a: string): string; + fooWithOverloads(a: number): number; +} + +//// [declFileMethods_1.ts] +class c2 { + /** This comment should appear for foo*/ + public foo() { + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + public fooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + + public fooWithOverloads(a: string): string; + public fooWithOverloads(a: number): number; + public fooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + private privateFooWithOverloads(a: string): string; + private privateFooWithOverloads(a: number): number; + private privateFooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for static foo*/ + static staticFoo() { + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + static staticFooWithOverloads(a: string): string; + static staticFooWithOverloads(a: number): number; + static staticFooWithOverloads(a: any): any { + return a; + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number) { + var d = a; + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { + return a + rests.join(""); + } + private static privateStaticFooWithOverloads(a: string): string; + private static privateStaticFooWithOverloads(a: number): number; + private static privateStaticFooWithOverloads(a: any): any { + return a; + } +} + +interface I2 { + /** This comment should appear for foo*/ + foo(): string; + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, + /** this is comment for b*/ + b: number): void; + + fooWithRestParameters(a: string, ...rests: string[]): string; + + fooWithOverloads(a: string): string; + fooWithOverloads(a: number): number; +} + + +//// [declFileMethods_0.js] +var c1 = (function () { + function c1() { + } + c1.prototype.foo = function () { + }; + c1.prototype.fooWithParameters = function (a, b) { + var d = a; + }; + c1.prototype.fooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c1.prototype.fooWithOverloads = function (a) { + return a; + }; + c1.prototype.privateFoo = function () { + }; + c1.prototype.privateFooWithParameters = function (a, b) { + var d = a; + }; + c1.prototype.privateFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c1.prototype.privateFooWithOverloads = function (a) { + return a; + }; + c1.staticFoo = function () { + }; + c1.staticFooWithParameters = function (a, b) { + var d = a; + }; + c1.staticFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c1.staticFooWithOverloads = function (a) { + return a; + }; + c1.privateStaticFoo = function () { + }; + c1.privateStaticFooWithParameters = function (a, b) { + var d = a; + }; + c1.privateStaticFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c1.privateStaticFooWithOverloads = function (a) { + return a; + }; + return c1; +})(); +exports.c1 = c1; +//// [declFileMethods_1.js] +var c2 = (function () { + function c2() { + } + c2.prototype.foo = function () { + }; + c2.prototype.fooWithParameters = function (a, b) { + var d = a; + }; + c2.prototype.fooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c2.prototype.fooWithOverloads = function (a) { + return a; + }; + c2.prototype.privateFoo = function () { + }; + c2.prototype.privateFooWithParameters = function (a, b) { + var d = a; + }; + c2.prototype.privateFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c2.prototype.privateFooWithOverloads = function (a) { + return a; + }; + c2.staticFoo = function () { + }; + c2.staticFooWithParameters = function (a, b) { + var d = a; + }; + c2.staticFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c2.staticFooWithOverloads = function (a) { + return a; + }; + c2.privateStaticFoo = function () { + }; + c2.privateStaticFooWithParameters = function (a, b) { + var d = a; + }; + c2.privateStaticFooWithRestParameters = function (a) { + var rests = []; + for (var _i = 1; _i < arguments.length; _i++) { + rests[_i - 1] = arguments[_i]; + } + return a + rests.join(""); + }; + c2.privateStaticFooWithOverloads = function (a) { + return a; + }; + return c2; +})(); + + +//// [declFileMethods_0.d.ts] +export declare class c1 { + foo(); + fooWithParameters(a, b); + fooWithRestParameters(a, ...rests); + fooWithOverloads(a); + fooWithOverloads(a); + fooWithOverloads(a); + private privateFoo(); + private privateFooWithParameters(a, b); + private privateFooWithRestParameters(a, ...rests); + private privateFooWithOverloads(a); + private privateFooWithOverloads(a); + private privateFooWithOverloads(a); + static staticFoo(); + static staticFooWithParameters(a, b); + static staticFooWithRestParameters(a, ...rests); + static staticFooWithOverloads(a); + static staticFooWithOverloads(a); + static staticFooWithOverloads(a); + private static privateStaticFoo(); + private static privateStaticFooWithParameters(a, b); + private static privateStaticFooWithRestParameters(a, ...rests); + private static privateStaticFooWithOverloads(a); + private static privateStaticFooWithOverloads(a); + private static privateStaticFooWithOverloads(a); +} +export interface I1 { + foo(); + fooWithParameters(a, b); + fooWithRestParameters(a, ...rests); + fooWithOverloads(a); + fooWithOverloads(a); +} +//// [declFileMethods_1.d.ts] diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js new file mode 100644 index 0000000000000..a518b8efa05e7 --- /dev/null +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.js @@ -0,0 +1,28 @@ +//// [declFileModuleAssignmentInObjectLiteralProperty.ts] + +module m1 { + export class c { + } +} +var d = { + m1: { m: m1 }, + m2: { c: m1.c }, +}; + +//// [declFileModuleAssignmentInObjectLiteralProperty.js] +var m1; +(function (m1) { + var c = (function () { + function c() { + } + return c; + })(); + m1.c = c; +})(m1 || (m1 = {})); +var d = { + m1: { m: m1 }, + m2: { c: m1.c } +}; + + +//// [declFileModuleAssignmentInObjectLiteralProperty.d.ts] diff --git a/tests/baselines/reference/declFileModuleContinuation.js b/tests/baselines/reference/declFileModuleContinuation.js new file mode 100644 index 0000000000000..45be49ce98eae --- /dev/null +++ b/tests/baselines/reference/declFileModuleContinuation.js @@ -0,0 +1,30 @@ +//// [declFileModuleContinuation.ts] +module A.C { + export interface Z { + } +} + +module A.B.C { + export class W implements A.C.Z { + } +} + +//// [declFileModuleContinuation.js] +var A; +(function (A) { + (function (B) { + (function (C) { + var W = (function () { + function W() { + } + return W; + })(); + C.W = W; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); + + +//// [declFileModuleContinuation.d.ts] diff --git a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js new file mode 100644 index 0000000000000..53d422d83cf49 --- /dev/null +++ b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.js @@ -0,0 +1,23 @@ +//// [declFileModuleWithPropertyOfTypeModule.ts] + +module m { + export class c { + } + + export var a = m; +} + +//// [declFileModuleWithPropertyOfTypeModule.js] +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + m.a = m; +})(m || (m = {})); + + +//// [declFileModuleWithPropertyOfTypeModule.d.ts] diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt new file mode 100644 index 0000000000000..bb0e82e470b61 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/declFileObjectLiteralWithAccessors.ts (2 errors) ==== + + function /*1*/makePoint(x: number) { + return { + b: 10, + get x() { return x; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set x(a: number) { this.b = a; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + }; + var /*4*/point = makePoint(2); + var /*2*/x = point.x; + point./*3*/x = 30; \ No newline at end of file diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt new file mode 100644 index 0000000000000..17d42cfbbb1f9 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/declFileObjectLiteralWithOnlyGetter.ts (1 errors) ==== + + function /*1*/makePoint(x: number) { + return { + get x() { return x; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + }; + var /*4*/point = makePoint(2); + var /*2*/x = point./*3*/x; + \ No newline at end of file diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt new file mode 100644 index 0000000000000..5499492feae09 --- /dev/null +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts (1 errors) ==== + + function /*1*/makePoint(x: number) { + return { + b: 10, + set x(a: number) { this.b = a; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + }; + var /*3*/point = makePoint(2); + point./*2*/x = 30; \ No newline at end of file diff --git a/tests/baselines/reference/declFileOptionalInterfaceMethod.js b/tests/baselines/reference/declFileOptionalInterfaceMethod.js new file mode 100644 index 0000000000000..ae3ee140f076e --- /dev/null +++ b/tests/baselines/reference/declFileOptionalInterfaceMethod.js @@ -0,0 +1,10 @@ +//// [declFileOptionalInterfaceMethod.ts] +interface X { + f? (); +} + + +//// [declFileOptionalInterfaceMethod.js] + + +//// [declFileOptionalInterfaceMethod.d.ts] diff --git a/tests/baselines/reference/declFilePrivateStatic.errors.txt b/tests/baselines/reference/declFilePrivateStatic.errors.txt new file mode 100644 index 0000000000000..14d69a0653bf3 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateStatic.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/declFilePrivateStatic.ts (4 errors) ==== + + class C { + private static x = 1; + static y = 1; + + private static a() { } + static b() { } + + private static get c() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static get d() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + private static set e(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set f(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileRegressionTests.js b/tests/baselines/reference/declFileRegressionTests.js new file mode 100644 index 0000000000000..9b80ded4e0b8d --- /dev/null +++ b/tests/baselines/reference/declFileRegressionTests.js @@ -0,0 +1,13 @@ +//// [declFileRegressionTests.ts] +// 'null' not converted to 'any' in d.ts +// function types not piped through correctly +var n = { w: null, x: '', y: () => { }, z: 32 }; + + + +//// [declFileRegressionTests.js] +var n = { w: null, x: '', y: function () { +}, z: 32 }; + + +//// [declFileRegressionTests.d.ts] diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js new file mode 100644 index 0000000000000..96d15b05dc7a4 --- /dev/null +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js @@ -0,0 +1,33 @@ +//// [declFileRestParametersOfFunctionAndFunctionType.ts] + +function f1(...args) { } +function f2(x: (...args) => void) { } +function f3(x: { (...args): void }) { } +function f4 void>() { } +function f5() { } +var f6 = () => { return [10]; } + + + + +//// [declFileRestParametersOfFunctionAndFunctionType.js] +function f1() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } +} +function f2(x) { +} +function f3(x) { +} +function f4() { +} +function f5() { +} +var f6 = function () { + return [10]; +}; + + +//// [declFileRestParametersOfFunctionAndFunctionType.d.ts] diff --git a/tests/baselines/reference/declFileTypeofClass.js b/tests/baselines/reference/declFileTypeofClass.js new file mode 100644 index 0000000000000..fb75d5c8770f0 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofClass.js @@ -0,0 +1,36 @@ +//// [declFileTypeofClass.ts] + +class c { + static x : string; + private static y: number; + private x3: string; + public y3: number; +} + +var x: c; +var y = c; +var z: typeof c; +class genericC +{ +} +var genericX = genericC; + + +//// [declFileTypeofClass.js] +var c = (function () { + function c() { + } + return c; +})(); +var x; +var y = c; +var z; +var genericC = (function () { + function genericC() { + } + return genericC; +})(); +var genericX = genericC; + + +//// [declFileTypeofClass.d.ts] diff --git a/tests/baselines/reference/declFileTypeofEnum.js b/tests/baselines/reference/declFileTypeofEnum.js new file mode 100644 index 0000000000000..8b09b99230b79 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofEnum.js @@ -0,0 +1,33 @@ +//// [declFileTypeofEnum.ts] + +enum days { + monday, + tuesday, + wednesday, + thursday, + friday, + saturday, + sunday +} + +var weekendDay = days.saturday; +var daysOfMonth = days; +var daysOfYear: typeof days; + +//// [declFileTypeofEnum.js] +var days; +(function (days) { + days[days["monday"] = 0] = "monday"; + days[days["tuesday"] = 1] = "tuesday"; + days[days["wednesday"] = 2] = "wednesday"; + days[days["thursday"] = 3] = "thursday"; + days[days["friday"] = 4] = "friday"; + days[days["saturday"] = 5] = "saturday"; + days[days["sunday"] = 6] = "sunday"; +})(days || (days = {})); +var weekendDay = 5 /* saturday */; +var daysOfMonth = days; +var daysOfYear; + + +//// [declFileTypeofEnum.d.ts] diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js new file mode 100644 index 0000000000000..28467b225c790 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -0,0 +1,66 @@ +//// [declFileTypeofFunction.ts] + +function f(n: typeof f): string; +function f(n: typeof g): string; +function f() { return undefined; } +function g(n: typeof g): number; +function g(n: typeof f): number; +function g() { return undefined; } + +var b: () => typeof b; + +function b1() { + return b1; +} + +function foo(): typeof foo { + return null; +} +var foo1: typeof foo; +var foo2 = foo; + +var foo3 = function () { + return foo3; +} +var x = () => { + return x; +} + +function foo5(x: number) { + function bar(x: number) { + return x; + } + return bar; +} + +//// [declFileTypeofFunction.js] +function f() { + return undefined; +} +function g() { + return undefined; +} +var b; +function b1() { + return b1; +} +function foo() { + return null; +} +var foo1; +var foo2 = foo; +var foo3 = function () { + return foo3; +}; +var x = function () { + return x; +}; +function foo5(x) { + function bar(x) { + return x; + } + return bar; +} + + +//// [declFileTypeofFunction.d.ts] diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.js b/tests/baselines/reference/declFileTypeofInAnonymousType.js new file mode 100644 index 0000000000000..042a89d60e3ec --- /dev/null +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.js @@ -0,0 +1,55 @@ +//// [declFileTypeofInAnonymousType.ts] + +module m1 { + export class c { + } + export enum e { + weekday, + weekend, + holiday + } +} +var a: { c: m1.c; }; +var b = { + c: m1.c, + m1: m1 +}; +var c = { m1: m1 }; +var d = { + m: { mod: m1 }, + mc: { cl: m1.c }, + me: { en: m1.e }, + mh: m1.e.holiday +}; + +//// [declFileTypeofInAnonymousType.js] +var m1; +(function (m1) { + var c = (function () { + function c() { + } + return c; + })(); + m1.c = c; + (function (e) { + e[e["weekday"] = 0] = "weekday"; + e[e["weekend"] = 1] = "weekend"; + e[e["holiday"] = 2] = "holiday"; + })(m1.e || (m1.e = {})); + var e = m1.e; +})(m1 || (m1 = {})); +var a; +var b = { + c: m1.c, + m1: m1 +}; +var c = { m1: m1 }; +var d = { + m: { mod: m1 }, + mc: { cl: m1.c }, + me: { en: m1.e }, + mh: 2 /* holiday */ +}; + + +//// [declFileTypeofInAnonymousType.d.ts] diff --git a/tests/baselines/reference/declFileTypeofModule.js b/tests/baselines/reference/declFileTypeofModule.js new file mode 100644 index 0000000000000..86b4ebc6f5bc6 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofModule.js @@ -0,0 +1,31 @@ +//// [declFileTypeofModule.ts] + +module m1 { + export var c: string; +} +var m1_1 = m1; +var m1_2: typeof m1; + +module m2 { + export var d: typeof m2; +} + +var m2_1 = m2; +var m2_2: typeof m2; + +//// [declFileTypeofModule.js] +var m1; +(function (m1) { + m1.c; +})(m1 || (m1 = {})); +var m1_1 = m1; +var m1_2; +var m2; +(function (m2) { + m2.d; +})(m2 || (m2 = {})); +var m2_1 = m2; +var m2_2; + + +//// [declFileTypeofModule.d.ts] diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js new file mode 100644 index 0000000000000..ab87c06856694 --- /dev/null +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -0,0 +1,69 @@ +//// [declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts] + +declare module A.B.Base { + export class W { + id: number; + } +} +module X.Y.base { + + export class W extends A.B.Base.W { + name: string; + } +} + +module X.Y.base.Z { + + export class W extends X.Y.base.W { + value: boolean; + } +} + + +//// [declFileWithClassNameConflictingWithClassReferredByExtendsClause.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var X; +(function (X) { + (function (Y) { + (function (base) { + var W = (function (_super) { + __extends(W, _super); + function W() { + _super.apply(this, arguments); + } + return W; + })(A.B.Base.W); + base.W = W; + })(Y.base || (Y.base = {})); + var base = Y.base; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var X; +(function (X) { + (function (Y) { + (function (base) { + (function (Z) { + var W = (function (_super) { + __extends(W, _super); + function W() { + _super.apply(this, arguments); + } + return W; + })(X.Y.base.W); + Z.W = W; + })(base.Z || (base.Z = {})); + var Z = base.Z; + })(Y.base || (Y.base = {})); + var base = Y.base; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); + + +//// [declFileWithClassNameConflictingWithClassReferredByExtendsClause.d.ts] diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js new file mode 100644 index 0000000000000..43e333456a51d --- /dev/null +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -0,0 +1,59 @@ +//// [declFileWithExtendsClauseThatHasItsContainerNameConflict.ts] + +declare module A.B.C { + class B { + } +} + +module A.B { + export class EventManager { + id: number; + + } +} + +module A.B.C { + export class ContextMenu extends EventManager { + name: string; + } +} + +//// [declFileWithExtendsClauseThatHasItsContainerNameConflict.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A; +(function (A) { + (function (B) { + var EventManager = (function () { + function EventManager() { + } + return EventManager; + })(); + B.EventManager = EventManager; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var A; +(function (A) { + (function (B) { + (function (C) { + var ContextMenu = (function (_super) { + __extends(ContextMenu, _super); + function ContextMenu() { + _super.apply(this, arguments); + } + return ContextMenu; + })(B.EventManager); + C.ContextMenu = ContextMenu; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); + + +//// [declFileWithExtendsClauseThatHasItsContainerNameConflict.d.ts] diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js new file mode 100644 index 0000000000000..e4aa93dbabc74 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.js @@ -0,0 +1,35 @@ +//// [declFileWithInternalModuleNameConflictsInExtendsClause1.ts] + +module X.A.C { + export interface Z { + } +} +module X.A.B.C { + module A { + } + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict + } +} + +//// [declFileWithInternalModuleNameConflictsInExtendsClause1.js] +var X; +(function (X) { + (function (A) { + (function (B) { + (function (C) { + var W = (function () { + function W() { + } + return W; + })(); + C.W = W; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; + })(X.A || (X.A = {})); + var A = X.A; +})(X || (X = {})); + + +//// [declFileWithInternalModuleNameConflictsInExtendsClause1.d.ts] diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js new file mode 100644 index 0000000000000..450785c7ac5d8 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.js @@ -0,0 +1,38 @@ +//// [declFileWithInternalModuleNameConflictsInExtendsClause2.ts] + +module X.A.C { + export interface Z { + } +} +module X.A.B.C { + export class W implements A.C.Z { // This can refer to it as A.C.Z + } +} + +module X.A.B.C { + module A { + } +} + +//// [declFileWithInternalModuleNameConflictsInExtendsClause2.js] +var X; +(function (X) { + (function (A) { + (function (B) { + (function (C) { + var W = (function () { + function W() { + } + return W; + })(); + C.W = W; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; + })(X.A || (X.A = {})); + var A = X.A; +})(X || (X = {})); + + +//// [declFileWithInternalModuleNameConflictsInExtendsClause2.d.ts] diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js new file mode 100644 index 0000000000000..f0d4cf123c9fd --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.js @@ -0,0 +1,38 @@ +//// [declFileWithInternalModuleNameConflictsInExtendsClause3.ts] + +module X.A.C { + export interface Z { + } +} +module X.A.B.C { + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict + } +} + +module X.A.B.C { + export module A { + } +} + +//// [declFileWithInternalModuleNameConflictsInExtendsClause3.js] +var X; +(function (X) { + (function (A) { + (function (B) { + (function (C) { + var W = (function () { + function W() { + } + return W; + })(); + C.W = W; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; + })(X.A || (X.A = {})); + var A = X.A; +})(X || (X = {})); + + +//// [declFileWithInternalModuleNameConflictsInExtendsClause3.d.ts] diff --git a/tests/baselines/reference/declInput-2.js b/tests/baselines/reference/declInput-2.js new file mode 100644 index 0000000000000..057d26fc15077 --- /dev/null +++ b/tests/baselines/reference/declInput-2.js @@ -0,0 +1,63 @@ +//// [declInput-2.ts] +module M { + class C { } + export class E {} + export interface I1 {} + interface I2 {} + export class D { + private c: C; // don't generate + public m1: number; + public m2: string; + public m22: C; // don't generate + public m23: E; + public m24: I1; + public m25: I2; // don't generate + public m232(): E { return null;} + public m242(): I1 { return null; } + public m252(): I2 { return null; } // don't generate + public m26(i:I1) {} + public m262(i:I2) {} + public m3():C { return new C(); } + } +} + +//// [declInput-2.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var E = (function () { + function E() { + } + return E; + })(); + M.E = E; + var D = (function () { + function D() { + } + D.prototype.m232 = function () { + return null; + }; + D.prototype.m242 = function () { + return null; + }; + D.prototype.m252 = function () { + return null; + }; + D.prototype.m26 = function (i) { + }; + D.prototype.m262 = function (i) { + }; + D.prototype.m3 = function () { + return new C(); + }; + return D; + })(); + M.D = D; +})(M || (M = {})); + + +//// [declInput-2.d.ts] diff --git a/tests/baselines/reference/declInput.errors.txt b/tests/baselines/reference/declInput.errors.txt new file mode 100644 index 0000000000000..c2d4c37e9e664 --- /dev/null +++ b/tests/baselines/reference/declInput.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/declInput.ts (1 errors) ==== + interface bar { + + } + + class bar { + ~~~ +!!! Duplicate identifier 'bar'. + public f() { return ''; } + public g() { return {a: null, b: undefined, c: void 4 }; } + public h(x = 4, y = null, z = '') { x++; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declInput.js b/tests/baselines/reference/declInput.js new file mode 100644 index 0000000000000..94c825d87f01d --- /dev/null +++ b/tests/baselines/reference/declInput.js @@ -0,0 +1,30 @@ +//// [declInput.ts] +interface bar { + +} + +class bar { + public f() { return ''; } + public g() { return {a: null, b: undefined, c: void 4 }; } + public h(x = 4, y = null, z = '') { x++; } +} + + +//// [declInput.js] +var bar = (function () { + function bar() { + } + bar.prototype.f = function () { + return ''; + }; + bar.prototype.g = function () { + return { a: null, b: undefined, c: void 4 }; + }; + bar.prototype.h = function (x, y, z) { + if (x === void 0) { x = 4; } + if (y === void 0) { y = null; } + if (z === void 0) { z = ''; } + x++; + }; + return bar; +})(); diff --git a/tests/baselines/reference/declInput3.js b/tests/baselines/reference/declInput3.js new file mode 100644 index 0000000000000..798d4a706558b --- /dev/null +++ b/tests/baselines/reference/declInput3.js @@ -0,0 +1,33 @@ +//// [declInput3.ts] +interface bar2 { + +} + +class bar { + public f() { return ''; } + public g() { return {a: null, b: undefined, c: void 4 }; } + public h(x = 4, y = null, z = '') { x++; } +} + + +//// [declInput3.js] +var bar = (function () { + function bar() { + } + bar.prototype.f = function () { + return ''; + }; + bar.prototype.g = function () { + return { a: null, b: undefined, c: void 4 }; + }; + bar.prototype.h = function (x, y, z) { + if (x === void 0) { x = 4; } + if (y === void 0) { y = null; } + if (z === void 0) { z = ''; } + x++; + }; + return bar; +})(); + + +//// [declInput3.d.ts] diff --git a/tests/baselines/reference/declInput4.js b/tests/baselines/reference/declInput4.js new file mode 100644 index 0000000000000..bc013b5fcdd9f --- /dev/null +++ b/tests/baselines/reference/declInput4.js @@ -0,0 +1,49 @@ +//// [declInput4.ts] +module M { + class C { } + export class E {} + export interface I1 {} + interface I2 {} + export class D { + public m1: number; + public m2: string; + public m23: E; + public m24: I1; + public m232(): E { return null;} + public m242(): I1 { return null; } + public m26(i:I1) {} + } +} + +//// [declInput4.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var E = (function () { + function E() { + } + return E; + })(); + M.E = E; + var D = (function () { + function D() { + } + D.prototype.m232 = function () { + return null; + }; + D.prototype.m242 = function () { + return null; + }; + D.prototype.m26 = function (i) { + }; + return D; + })(); + M.D = D; +})(M || (M = {})); + + +//// [declInput4.d.ts] diff --git a/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.js b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.js new file mode 100644 index 0000000000000..6cf56814900e8 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.js @@ -0,0 +1,8 @@ +//// [declarationEmit_array-types-from-generic-array-usage.ts] +interface A extends Array { } + + +//// [declarationEmit_array-types-from-generic-array-usage.js] + + +//// [declarationEmit_array-types-from-generic-array-usage.d.ts] diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt b/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt new file mode 100644 index 0000000000000..6a202ec3e609e --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/declarationEmit_nameConflicts_0.ts (1 errors) ==== + import im = require('declarationEmit_nameConflicts_1'); + export module M { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + + export import a = M.f; + export import b = M.C; + export import c = N; + export import d = im; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'im'. + } + + export module M.P { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export import im = M.P.f; + // Bug 887180: Invalid .d.ts when an aliased entity is referenced, and a different entity is closer in scope + export var a = M.a; // emitted incorrectly as typeof f + export var b = M.b; // ok + export var c = M.c; // ok + export var g = M.c.g; // ok + export var d = M.d; // emitted incorrectly as typeof im + } + + export module M.Q { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export interface b extends M.b { } // ok + export interface I extends M.c.I { } // ok + export module c { + export interface I extends M.c.I { } // ok + } + } +==== tests/cases/compiler/declarationEmit_nameConflicts_1.ts (1 errors) ==== + function f() { } + export = f; + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js new file mode 100644 index 0000000000000..1f9b13b7df630 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -0,0 +1,129 @@ +//// [tests/cases/compiler/declarationEmit_nameConflicts.ts] //// + +//// [declarationEmit_nameConflicts_1.ts] +function f() { } +export = f; + +//// [declarationEmit_nameConflicts_0.ts] +import im = require('declarationEmit_nameConflicts_1'); +export module M { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + + export import a = M.f; + export import b = M.C; + export import c = N; + export import d = im; +} + +export module M.P { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export import im = M.P.f; + // Bug 887180: Invalid .d.ts when an aliased entity is referenced, and a different entity is closer in scope + export var a = M.a; // emitted incorrectly as typeof f + export var b = M.b; // ok + export var c = M.c; // ok + export var g = M.c.g; // ok + export var d = M.d; // emitted incorrectly as typeof im +} + +export module M.Q { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export interface b extends M.b { } // ok + export interface I extends M.c.I { } // ok + export module c { + export interface I extends M.c.I { } // ok + } +} + +//// [declarationEmit_nameConflicts_1.js] +function f() { +} +module.exports = f; +//// [declarationEmit_nameConflicts_0.js] +(function (M) { + function f() { + } + M.f = f; + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; + (function (N) { + function g() { + } + N.g = g; + ; + })(M.N || (M.N = {})); + var N = M.N; + M.a = M.f; + M.b = M.C; + M.c = N; +})(exports.M || (exports.M = {})); +var M = exports.M; +(function (M) { + (function (P) { + function f() { + } + P.f = f; + var C = (function () { + function C() { + } + return C; + })(); + P.C = C; + (function (N) { + function g() { + } + N.g = g; + ; + })(P.N || (P.N = {})); + var N = P.N; + P.im = M.P.f; + P.a = M.a; + P.b = M.b; + P.c = M.c; + P.g = M.c.g; + P.d = M.d; + })(M.P || (M.P = {})); + var P = M.P; +})(exports.M || (exports.M = {})); +var M = exports.M; +(function (M) { + (function (Q) { + function f() { + } + Q.f = f; + var C = (function () { + function C() { + } + return C; + })(); + Q.C = C; + (function (N) { + function g() { + } + N.g = g; + ; + })(Q.N || (Q.N = {})); + var N = Q.N; + })(M.Q || (M.Q = {})); + var Q = M.Q; +})(exports.M || (exports.M = {})); +var M = exports.M; diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.js b/tests/baselines/reference/declarationEmit_nameConflicts2.js new file mode 100644 index 0000000000000..64cb4509bae22 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.js @@ -0,0 +1,63 @@ +//// [declarationEmit_nameConflicts2.ts] +module X.Y.base { + export function f() { } + export class C { } + export module M { + export var v; + } + export enum E { } +} + +module X.Y.base.Z { + // Bug 887180 + export var f = X.Y.base.f; // Should be base.f + export var C = X.Y.base.C; // Should be base.C + export var M = X.Y.base.M; // Should be base.M + export var E = X.Y.base.E; // Should be base.E +} + +//// [declarationEmit_nameConflicts2.js] +var X; +(function (X) { + (function (Y) { + (function (base) { + function f() { + } + base.f = f; + var C = (function () { + function C() { + } + return C; + })(); + base.C = C; + (function (M) { + M.v; + })(base.M || (base.M = {})); + var M = base.M; + (function (E) { + })(base.E || (base.E = {})); + var E = base.E; + })(Y.base || (Y.base = {})); + var base = Y.base; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var X; +(function (X) { + (function (Y) { + (function (base) { + (function (Z) { + Z.f = X.Y.base.f; + Z.C = X.Y.base.C; + Z.M = X.Y.base.M; + Z.E = X.Y.base.E; + })(base.Z || (base.Z = {})); + var Z = base.Z; + })(Y.base || (Y.base = {})); + var base = Y.base; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); + + +//// [declarationEmit_nameConflicts2.d.ts] diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js new file mode 100644 index 0000000000000..879491b6c7abd --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -0,0 +1,90 @@ +//// [declarationEmit_nameConflicts3.ts] +module M { + export interface D { } + export module D { + export function f() { } + } + export module C { + export function f() { } + } + export module E { + export function f() { } + } +} + +module M.P { + export class C { + static f() { } + } + export class E extends C { } + export enum D { + f + } + // Bug 887180 + export var v: M.D; // ok + export var w = M.D.f; // error, should be typeof M.D.f + export var x = M.C.f; // error, should be typeof M.C.f + export var x = M.E.f; // error, should be typeof M.E.f +} + +//// [declarationEmit_nameConflicts3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + (function (D) { + function f() { + } + D.f = f; + })(M.D || (M.D = {})); + var D = M.D; + (function (C) { + function f() { + } + C.f = f; + })(M.C || (M.C = {})); + var C = M.C; + (function (E) { + function f() { + } + E.f = f; + })(M.E || (M.E = {})); + var E = M.E; +})(M || (M = {})); +var M; +(function (M) { + (function (P) { + var C = (function () { + function C() { + } + C.f = function () { + }; + return C; + })(); + P.C = C; + var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; + })(C); + P.E = E; + (function (D) { + D[D["f"] = 0] = "f"; + })(P.D || (P.D = {})); + var D = P.D; + P.v; + P.w = M.D.f; + P.x = M.C.f; + P.x = M.E.f; + })(M.P || (M.P = {})); + var P = M.P; +})(M || (M = {})); + + +//// [declarationEmit_nameConflicts3.d.ts] diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt new file mode 100644 index 0000000000000..100bf85427e75 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts (1 errors) ==== + // Bug 887180 + export module C { export interface I { } } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export import v = C; + export module M { + export module C { export interface I { } } + export var w: v.I; // Gets emitted as C.I, which is the wrong interface + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js new file mode 100644 index 0000000000000..eade0352272d2 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js @@ -0,0 +1,14 @@ +//// [declarationEmit_nameConflictsWithAlias.ts] +// Bug 887180 +export module C { export interface I { } } +export import v = C; +export module M { + export module C { export interface I { } } + export var w: v.I; // Gets emitted as C.I, which is the wrong interface +} + +//// [declarationEmit_nameConflictsWithAlias.js] +(function (M) { + M.w; +})(exports.M || (exports.M = {})); +var M = exports.M; diff --git a/tests/baselines/reference/declareAlreadySeen.errors.txt b/tests/baselines/reference/declareAlreadySeen.errors.txt new file mode 100644 index 0000000000000..0c765edf9dda6 --- /dev/null +++ b/tests/baselines/reference/declareAlreadySeen.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/declareAlreadySeen.ts (4 errors) ==== + module M { + declare declare var x; + ~~~~~~~ +!!! 'declare' modifier already seen. + declare declare function f(); + ~~~~~~~ +!!! 'declare' modifier already seen. + + declare declare module N { } + ~~~~~~~ +!!! 'declare' modifier already seen. + + declare declare class C { } + ~~~~~~~ +!!! 'declare' modifier already seen. + } \ No newline at end of file diff --git a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt new file mode 100644 index 0000000000000..8fc743d97feeb --- /dev/null +++ b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/declareClassInterfaceImplementation.ts (1 errors) ==== + interface IBuffer { + [index: number]: number; + } + + declare class Buffer implements IBuffer { + ~~~~~~ +!!! Class 'Buffer' incorrectly implements interface 'IBuffer': +!!! Index signature is missing in type 'Buffer'. + + } + \ No newline at end of file diff --git a/tests/baselines/reference/declareClassInterfaceImplementation.js b/tests/baselines/reference/declareClassInterfaceImplementation.js new file mode 100644 index 0000000000000..7cba291f76b52 --- /dev/null +++ b/tests/baselines/reference/declareClassInterfaceImplementation.js @@ -0,0 +1,11 @@ +//// [declareClassInterfaceImplementation.ts] +interface IBuffer { + [index: number]: number; +} + +declare class Buffer implements IBuffer { + +} + + +//// [declareClassInterfaceImplementation.js] diff --git a/tests/baselines/reference/declareDottedExtend.js b/tests/baselines/reference/declareDottedExtend.js new file mode 100644 index 0000000000000..974a678abdada --- /dev/null +++ b/tests/baselines/reference/declareDottedExtend.js @@ -0,0 +1,35 @@ +//// [declareDottedExtend.ts] +declare module A.B +{ + export class C{ } +} + +import ab = A.B; + +class D extends ab.C{ } + +class E extends A.B.C{ } + + +//// [declareDottedExtend.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ab = A.B; +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(ab.C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(A.B.C); diff --git a/tests/baselines/reference/declareDottedModuleName.js b/tests/baselines/reference/declareDottedModuleName.js new file mode 100644 index 0000000000000..93e39ed0103cf --- /dev/null +++ b/tests/baselines/reference/declareDottedModuleName.js @@ -0,0 +1,16 @@ +//// [declareDottedModuleName.ts] +module M { + module P.Q { } // This shouldnt be emitted +} + +module M { + export module R.S { } //This should be emitted +} + +module T.U { // This needs to be emitted +} + +//// [declareDottedModuleName.js] + + +//// [declareDottedModuleName.d.ts] diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.js b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.js new file mode 100644 index 0000000000000..bdbcb208fb541 --- /dev/null +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.js @@ -0,0 +1,27 @@ +//// [declareExternalModuleWithExportAssignedFundule.ts] +declare module "express" { + + export = express; + + function express(): express.ExpressServer; + + module express { + + export interface ExpressServer { + + enable(name: string): ExpressServer; + + post(path: RegExp, handler: (req: Function) => void ): void; + + } + + export class ExpressServerRequest { + + } + + } + +} + + +//// [declareExternalModuleWithExportAssignedFundule.js] diff --git a/tests/baselines/reference/declareFileExportAssignment.js b/tests/baselines/reference/declareFileExportAssignment.js new file mode 100644 index 0000000000000..5b8d65bbc3bb1 --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignment.js @@ -0,0 +1,27 @@ +//// [declareFileExportAssignment.ts] +module m2 { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + +} + +var m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; +}; + +export = m2; + +//// [declareFileExportAssignment.js] +var m2; +module.exports = m2; + + +//// [declareFileExportAssignment.d.ts] +export = m2; diff --git a/tests/baselines/reference/declaredExternalModule.js b/tests/baselines/reference/declaredExternalModule.js new file mode 100644 index 0000000000000..414c03bb39556 --- /dev/null +++ b/tests/baselines/reference/declaredExternalModule.js @@ -0,0 +1,30 @@ +//// [declaredExternalModule.ts] +declare module 'connect' { + + interface connectModule { + + (res, req, next): void; + + } + + interface connectExport { + + use: (mod: connectModule) => connectExport; + + listen: (port: number) => void; + + } + + var server: { + + (): connectExport; + + test1: connectModule; // No error + + test2(): connectModule; // ERROR: Return type of method from exported interface has or is using private type ''connect'.connectModule'. + + }; +} + + +//// [declaredExternalModule.js] diff --git a/tests/baselines/reference/declaredExternalModuleWithExportAssignment.js b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.js new file mode 100644 index 0000000000000..a5427bfc18235 --- /dev/null +++ b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.js @@ -0,0 +1,21 @@ +//// [declaredExternalModuleWithExportAssignment.ts] +declare module 'connect' { + interface connectModule { + (res, req, next): void; + } + + interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + var server: { + (): connectExport; + test1: connectModule; + test2(): connectModule; + }; + export = server; +} + + +//// [declaredExternalModuleWithExportAssignment.js] diff --git a/tests/baselines/reference/decrementAndIncrementOperators.errors.txt b/tests/baselines/reference/decrementAndIncrementOperators.errors.txt new file mode 100644 index 0000000000000..27c6c19ed1f51 --- /dev/null +++ b/tests/baselines/reference/decrementAndIncrementOperators.errors.txt @@ -0,0 +1,65 @@ +==== tests/cases/compiler/decrementAndIncrementOperators.ts (13 errors) ==== + var x = 0; + + // errors + 1 ++; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + (1)++; + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + (1)--; + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + ++(1); + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --(1); + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + (1 + 2)++; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + (1 + 2)--; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + ++(1 + 2); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --(1 + 2); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + (x + x)++; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + (x + x)--; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + ++(x + x); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --(x + x); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + //OK + x++; + x--; + + ++x; + --x; + + (x)++; + --(x); + + ((x))++; + ((x))--; + + x[x++]++; + \ No newline at end of file diff --git a/tests/baselines/reference/decrementAndIncrementOperators.js b/tests/baselines/reference/decrementAndIncrementOperators.js new file mode 100644 index 0000000000000..c5a1c6d8d1410 --- /dev/null +++ b/tests/baselines/reference/decrementAndIncrementOperators.js @@ -0,0 +1,64 @@ +//// [decrementAndIncrementOperators.ts] +var x = 0; + +// errors +1 ++; + +(1)++; +(1)--; + +++(1); +--(1); + +(1 + 2)++; +(1 + 2)--; + +++(1 + 2); +--(1 + 2); + +(x + x)++; +(x + x)--; + +++(x + x); +--(x + x); + +//OK +x++; +x--; + +++x; +--x; + +(x)++; +--(x); + +((x))++; +((x))--; + +x[x++]++; + + +//// [decrementAndIncrementOperators.js] +var x = 0; +1++; +(1)++; +(1)--; +++(1); +--(1); +(1 + 2)++; +(1 + 2)--; +++(1 + 2); +--(1 + 2); +(x + x)++; +(x + x)--; +++(x + x); +--(x + x); +x++; +x--; +++x; +--x; +(x)++; +--(x); +((x))++; +((x))--; +x[x++]++; diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.js b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..2b6216a7851f4 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.js @@ -0,0 +1,91 @@ +//// [decrementOperatorWithAnyOtherType.ts] +// -- operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj = {x:1,y:null}; +class A { + public a: any; +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsNumber1 = --ANY; +var ResultIsNumber2 = --ANY1; + +var ResultIsNumber3 = ANY1--; +var ResultIsNumber4 = ANY1--; + +// expressions +var ResultIsNumber5 = --ANY2[0]; +var ResultIsNumber6 = --obj.x; +var ResultIsNumber7 = --obj.y; +var ResultIsNumber8 = --objA.a; +var ResultIsNumber = --M.n; + +var ResultIsNumber9 = ANY2[0]--; +var ResultIsNumber10 = obj.x--; +var ResultIsNumber11 = obj.y--; +var ResultIsNumber12 = objA.a--; +var ResultIsNumber13 = M.n--; + +// miss assignment opertors +--ANY; +--ANY1; +--ANY2[0]; +--ANY, --ANY1; +--objA.a; +--M.n; + +ANY--; +ANY1--; +ANY2[0]--; +ANY--, ANY1--; +objA.a--; +M.n--; + +//// [decrementOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj = { x: 1, y: null }; +var A = (function () { + function A() { + } + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --ANY; +var ResultIsNumber2 = --ANY1; +var ResultIsNumber3 = ANY1--; +var ResultIsNumber4 = ANY1--; +var ResultIsNumber5 = --ANY2[0]; +var ResultIsNumber6 = --obj.x; +var ResultIsNumber7 = --obj.y; +var ResultIsNumber8 = --objA.a; +var ResultIsNumber = --M.n; +var ResultIsNumber9 = ANY2[0]--; +var ResultIsNumber10 = obj.x--; +var ResultIsNumber11 = obj.y--; +var ResultIsNumber12 = objA.a--; +var ResultIsNumber13 = M.n--; +--ANY; +--ANY1; +--ANY2[0]; +--ANY, --ANY1; +--objA.a; +--M.n; +ANY--; +ANY1--; +ANY2[0]--; +ANY--, ANY1--; +objA.a--; +M.n--; diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..5bc5153a61095 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -0,0 +1,161 @@ +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts (44 errors) ==== + // -- operator on any type + var ANY1; + var ANY2: any[] = ["", ""]; + + var obj: () => {} + var obj1 = { x: "", y: () => { } }; + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = --ANY2; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = --A; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber3 = --M; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = --obj; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = --obj1; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = ANY2--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = A--; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = M--; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber9 = obj--; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = obj1--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // any type literal + var ResultIsNumber11 = --{}; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = --null; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber13 = --undefined; + ~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber14 = null--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = {}--; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = undefined--; + ~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // any type expressions + var ResultIsNumber17 = --foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber18 = --A.foo(); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber19 = --(null + undefined); + ~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber20 = --(null + null); + ~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber21 = --(undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber22 = --obj1.x; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber23 = --obj1.y; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber24 = foo()--; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber25 = A.foo()--; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber26 = (null + undefined)--; + ~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber27 = (null + null)--; + ~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber28 = (undefined + undefined)--; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber29 = obj1.x--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber30 = obj1.y--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + --ANY2; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ANY2--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + --ANY1--; + ~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --ANY1++; + ~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++ANY1--; + ~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --ANY2[0]--; + ~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --ANY2[0]++; + ~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++ANY2[0]--; + ~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js new file mode 100644 index 0000000000000..30dce46eba316 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -0,0 +1,136 @@ +//// [decrementOperatorWithAnyOtherTypeInvalidOperations.ts] +// -- operator on any type +var ANY1; +var ANY2: any[] = ["", ""]; + +var obj: () => {} +var obj1 = { x: "", y: () => { } }; +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsNumber1 = --ANY2; +var ResultIsNumber2 = --A; +var ResultIsNumber3 = --M; +var ResultIsNumber4 = --obj; +var ResultIsNumber5 = --obj1; + +var ResultIsNumber6 = ANY2--; +var ResultIsNumber7 = A--; +var ResultIsNumber8 = M--; +var ResultIsNumber9 = obj--; +var ResultIsNumber10 = obj1--; + +// any type literal +var ResultIsNumber11 = --{}; +var ResultIsNumber12 = --null; +var ResultIsNumber13 = --undefined; + +var ResultIsNumber14 = null--; +var ResultIsNumber15 = {}--; +var ResultIsNumber16 = undefined--; + +// any type expressions +var ResultIsNumber17 = --foo(); +var ResultIsNumber18 = --A.foo(); +var ResultIsNumber19 = --(null + undefined); +var ResultIsNumber20 = --(null + null); +var ResultIsNumber21 = --(undefined + undefined); +var ResultIsNumber22 = --obj1.x; +var ResultIsNumber23 = --obj1.y; + +var ResultIsNumber24 = foo()--; +var ResultIsNumber25 = A.foo()--; +var ResultIsNumber26 = (null + undefined)--; +var ResultIsNumber27 = (null + null)--; +var ResultIsNumber28 = (undefined + undefined)--; +var ResultIsNumber29 = obj1.x--; +var ResultIsNumber30 = obj1.y--; + +// miss assignment operators +--ANY2; + +ANY2--; + +--ANY1--; +--ANY1++; +++ANY1--; +--ANY2[0]--; +--ANY2[0]++; +++ANY2[0]--; + +//// [decrementOperatorWithAnyOtherTypeInvalidOperations.js] +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --ANY2; +var ResultIsNumber2 = --A; +var ResultIsNumber3 = --M; +var ResultIsNumber4 = --obj; +var ResultIsNumber5 = --obj1; +var ResultIsNumber6 = ANY2--; +var ResultIsNumber7 = A--; +var ResultIsNumber8 = M--; +var ResultIsNumber9 = obj--; +var ResultIsNumber10 = obj1--; +var ResultIsNumber11 = --{}; +var ResultIsNumber12 = --null; +var ResultIsNumber13 = --undefined; +var ResultIsNumber14 = null--; +var ResultIsNumber15 = {}--; +var ResultIsNumber16 = undefined--; +var ResultIsNumber17 = --foo(); +var ResultIsNumber18 = --A.foo(); +var ResultIsNumber19 = --(null + undefined); +var ResultIsNumber20 = --(null + null); +var ResultIsNumber21 = --(undefined + undefined); +var ResultIsNumber22 = --obj1.x; +var ResultIsNumber23 = --obj1.y; +var ResultIsNumber24 = foo()--; +var ResultIsNumber25 = A.foo()--; +var ResultIsNumber26 = (null + undefined)--; +var ResultIsNumber27 = (null + null)--; +var ResultIsNumber28 = (undefined + undefined)--; +var ResultIsNumber29 = obj1.x--; +var ResultIsNumber30 = obj1.y--; +--ANY2; +ANY2--; +--ANY1--; +--ANY1++; +++ANY1--; +--ANY2[0]--; +--ANY2[0]++; +++ANY2[0]--; diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.js b/tests/baselines/reference/decrementOperatorWithEnumType.js new file mode 100644 index 0000000000000..993fe2487bb69 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithEnumType.js @@ -0,0 +1,26 @@ +//// [decrementOperatorWithEnumType.ts] +// -- operator on enum type + +enum ENUM1 { 1, 2, "" }; + +// expression +var ResultIsNumber1 = --ENUM1[1]; +var ResultIsNumber2 = ENUM1[1]--; + +// miss assignment operator +--ENUM1[1]; + +ENUM1[1]--; + +//// [decrementOperatorWithEnumType.js] +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = --ENUM1[1]; +var ResultIsNumber2 = ENUM1[1]--; +--ENUM1[1]; +ENUM1[1]--; diff --git a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..de547e5b70b26 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ==== + // -- operator on enum type + + enum ENUM { }; + enum ENUM1 { 1, 2, "" }; + + // enum type var + var ResultIsNumber1 = --ENUM; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = --ENUM1; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber3 = ENUM--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = ENUM1--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // enum type expressions + var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); + ~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; + ~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operator + --ENUM; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --ENUM1; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ENUM--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ENUM1--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js new file mode 100644 index 0000000000000..a8c552ada59f5 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.js @@ -0,0 +1,46 @@ +//// [decrementOperatorWithEnumTypeInvalidOperations.ts] +// -- operator on enum type + +enum ENUM { }; +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsNumber1 = --ENUM; +var ResultIsNumber2 = --ENUM1; + +var ResultIsNumber3 = ENUM--; +var ResultIsNumber4 = ENUM1--; + +// enum type expressions +var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); +var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; + +// miss assignment operator +--ENUM; +--ENUM1; + +ENUM--; +ENUM1--; + +//// [decrementOperatorWithEnumTypeInvalidOperations.js] +var ENUM; +(function (ENUM) { +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = --ENUM; +var ResultIsNumber2 = --ENUM1; +var ResultIsNumber3 = ENUM--; +var ResultIsNumber4 = ENUM1--; +var ResultIsNumber5 = --(ENUM[1] + ENUM[2]); +var ResultIsNumber6 = (ENUM[1] + ENUM[2])--; +--ENUM; +--ENUM1; +ENUM--; +ENUM1--; diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.js b/tests/baselines/reference/decrementOperatorWithNumberType.js new file mode 100644 index 0000000000000..381ad2b534ff3 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberType.js @@ -0,0 +1,71 @@ +//// [decrementOperatorWithNumberType.ts] +// -- operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +class A { + public a: number; +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsNumber1 = --NUMBER; + +var ResultIsNumber2 = NUMBER--; + +// expressions +var ResultIsNumber3 = --objA.a; +var ResultIsNumber4 = --M.n; + +var ResultIsNumber5 = objA.a--; +var ResultIsNumber6 = M.n--; +var ResultIsNumber7 = NUMBER1[0]--; + +// miss assignment operators +--NUMBER; + +--NUMBER1[0]; +--objA.a; +--M.n; +--objA.a, M.n; + +NUMBER--; +NUMBER1[0]--; +objA.a--; +M.n--; +objA.a--, M.n--; + +//// [decrementOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +var A = (function () { + function A() { + } + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --NUMBER; +var ResultIsNumber2 = NUMBER--; +var ResultIsNumber3 = --objA.a; +var ResultIsNumber4 = --M.n; +var ResultIsNumber5 = objA.a--; +var ResultIsNumber6 = M.n--; +var ResultIsNumber7 = NUMBER1[0]--; +--NUMBER; +--NUMBER1[0]; +--objA.a; +--M.n; +--objA.a, M.n; +NUMBER--; +NUMBER1[0]--; +objA.a--; +M.n--; +objA.a--, M.n--; diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..ced764db19ee1 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -0,0 +1,87 @@ +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== + // -- operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + //number type var + var ResultIsNumber1 = --NUMBER1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = NUMBER1--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // number type literal + var ResultIsNumber3 = --1; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber4 = --{ x: 1, y: 2}; + ~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = --{ x: 1, y: (n: number) => { return n; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = 1--; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber7 = { x: 1, y: 2 }--; + ~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }--; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // number type expressions + var ResultIsNumber9 = --foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber10 = --A.foo(); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber11 = --(NUMBER + NUMBER); + ~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + var ResultIsNumber12 = foo()--; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber13 = A.foo()--; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber14 = (NUMBER + NUMBER)--; + ~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + // miss assignment operator + --1; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --NUMBER1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + 1--; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + NUMBER1--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()--; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js new file mode 100644 index 0000000000000..e9b2ff0e87f07 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.js @@ -0,0 +1,91 @@ +//// [decrementOperatorWithNumberTypeInvalidOperations.ts] +// -- operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +//number type var +var ResultIsNumber1 = --NUMBER1; +var ResultIsNumber2 = NUMBER1--; + +// number type literal +var ResultIsNumber3 = --1; +var ResultIsNumber4 = --{ x: 1, y: 2}; +var ResultIsNumber5 = --{ x: 1, y: (n: number) => { return n; } }; + +var ResultIsNumber6 = 1--; +var ResultIsNumber7 = { x: 1, y: 2 }--; +var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }--; + +// number type expressions +var ResultIsNumber9 = --foo(); +var ResultIsNumber10 = --A.foo(); +var ResultIsNumber11 = --(NUMBER + NUMBER); + +var ResultIsNumber12 = foo()--; +var ResultIsNumber13 = A.foo()--; +var ResultIsNumber14 = (NUMBER + NUMBER)--; + +// miss assignment operator +--1; +--NUMBER1; +--foo(); + +1--; +NUMBER1--; +foo()--; + +//// [decrementOperatorWithNumberTypeInvalidOperations.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --NUMBER1; +var ResultIsNumber2 = NUMBER1--; +var ResultIsNumber3 = --1; +var ResultIsNumber4 = --{ x: 1, y: 2 }; +var ResultIsNumber5 = --{ x: 1, y: function (n) { + return n; +} }; +var ResultIsNumber6 = 1--; +var ResultIsNumber7 = { x: 1, y: 2 }--; +var ResultIsNumber8 = { x: 1, y: function (n) { + return n; +} }--; +var ResultIsNumber9 = --foo(); +var ResultIsNumber10 = --A.foo(); +var ResultIsNumber11 = --(NUMBER + NUMBER); +var ResultIsNumber12 = foo()--; +var ResultIsNumber13 = A.foo()--; +var ResultIsNumber14 = (NUMBER + NUMBER)--; +--1; +--NUMBER1; +--foo(); +1--; +NUMBER1--; +foo()--; diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt new file mode 100644 index 0000000000000..3f986e98e10c7 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt @@ -0,0 +1,113 @@ +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== + // -- operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return true; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = --BOOLEAN; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber2 = BOOLEAN--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // boolean type literal + var ResultIsNumber3 = --true; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = --{ x: true, y: false }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = --{ x: true, y: (n: boolean) => { return n; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = true--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = { x: true, y: false }--; + ~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }--; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // boolean type expressions + var ResultIsNumber9 = --objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = --M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber11 = --foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = --A.foo(); + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber13 = foo()--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber14 = A.foo()--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = objA.a--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = M.n--; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + --true; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --BOOLEAN; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --objA.a, M.n; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + true--; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + BOOLEAN--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + M.n--; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a--, M.n--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js new file mode 100644 index 0000000000000..cffee5084312d --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.js @@ -0,0 +1,106 @@ +//// [decrementOperatorWithUnsupportedBooleanType.ts] +// -- operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return true; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsNumber1 = --BOOLEAN; + +var ResultIsNumber2 = BOOLEAN--; + +// boolean type literal +var ResultIsNumber3 = --true; +var ResultIsNumber4 = --{ x: true, y: false }; +var ResultIsNumber5 = --{ x: true, y: (n: boolean) => { return n; } }; + +var ResultIsNumber6 = true--; +var ResultIsNumber7 = { x: true, y: false }--; +var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }--; + +// boolean type expressions +var ResultIsNumber9 = --objA.a; +var ResultIsNumber10 = --M.n; +var ResultIsNumber11 = --foo(); +var ResultIsNumber12 = --A.foo(); + +var ResultIsNumber13 = foo()--; +var ResultIsNumber14 = A.foo()--; +var ResultIsNumber15 = objA.a--; +var ResultIsNumber16 = M.n--; + +// miss assignment operators +--true; +--BOOLEAN; +--foo(); +--objA.a; +--M.n; +--objA.a, M.n; + +true--; +BOOLEAN--; +foo()--; +objA.a--; +M.n--; +objA.a--, M.n--; + +//// [decrementOperatorWithUnsupportedBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return true; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --BOOLEAN; +var ResultIsNumber2 = BOOLEAN--; +var ResultIsNumber3 = --true; +var ResultIsNumber4 = --{ x: true, y: false }; +var ResultIsNumber5 = --{ x: true, y: function (n) { + return n; +} }; +var ResultIsNumber6 = true--; +var ResultIsNumber7 = { x: true, y: false }--; +var ResultIsNumber8 = { x: true, y: function (n) { + return n; +} }--; +var ResultIsNumber9 = --objA.a; +var ResultIsNumber10 = --M.n; +var ResultIsNumber11 = --foo(); +var ResultIsNumber12 = --A.foo(); +var ResultIsNumber13 = foo()--; +var ResultIsNumber14 = A.foo()--; +var ResultIsNumber15 = objA.a--; +var ResultIsNumber16 = M.n--; +--true; +--BOOLEAN; +--foo(); +--objA.a; +--M.n; +--objA.a, M.n; +true--; +BOOLEAN--; +foo()--; +objA.a--; +M.n--; +objA.a--, M.n--; diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt new file mode 100644 index 0000000000000..9ec8deb20818c --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt @@ -0,0 +1,144 @@ +==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedStringType.ts (39 errors) ==== + // -- operator on string type + var STRING: string; + var STRING1: string[] = ["", ""]; + + function foo(): string { return ""; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = --STRING; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = --STRING1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber3 = STRING--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = STRING1--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // string type literal + var ResultIsNumber5 = --""; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber6 = --{ x: "", y: "" }; + ~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = --{ x: "", y: (s: string) => { return s; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber8 = ""--; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber9 = { x: "", y: "" }--; + ~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }--; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // string type expressions + var ResultIsNumber11 = --objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = --M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber13 = --STRING1[0]; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber14 = --foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = --A.foo(); + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = --(STRING + STRING); + ~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber17 = objA.a--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber18 = M.n--; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber19 = STRING1[0]--; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber20 = foo()--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber21 = A.foo()--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber22 = (STRING + STRING)--; + ~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + --""; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --STRING; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --STRING1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --STRING1[0]; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + --objA.a, M.n; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ""--; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING1--; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING1[0]--; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()--; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + M.n--; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a--, M.n--; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js new file mode 100644 index 0000000000000..7eb26de8a6781 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.js @@ -0,0 +1,128 @@ +//// [decrementOperatorWithUnsupportedStringType.ts] +// -- operator on string type +var STRING: string; +var STRING1: string[] = ["", ""]; + +function foo(): string { return ""; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsNumber1 = --STRING; +var ResultIsNumber2 = --STRING1; + +var ResultIsNumber3 = STRING--; +var ResultIsNumber4 = STRING1--; + +// string type literal +var ResultIsNumber5 = --""; +var ResultIsNumber6 = --{ x: "", y: "" }; +var ResultIsNumber7 = --{ x: "", y: (s: string) => { return s; } }; + +var ResultIsNumber8 = ""--; +var ResultIsNumber9 = { x: "", y: "" }--; +var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }--; + +// string type expressions +var ResultIsNumber11 = --objA.a; +var ResultIsNumber12 = --M.n; +var ResultIsNumber13 = --STRING1[0]; +var ResultIsNumber14 = --foo(); +var ResultIsNumber15 = --A.foo(); +var ResultIsNumber16 = --(STRING + STRING); + +var ResultIsNumber17 = objA.a--; +var ResultIsNumber18 = M.n--; +var ResultIsNumber19 = STRING1[0]--; +var ResultIsNumber20 = foo()--; +var ResultIsNumber21 = A.foo()--; +var ResultIsNumber22 = (STRING + STRING)--; + +// miss assignment operators +--""; +--STRING; +--STRING1; +--STRING1[0]; +--foo(); +--objA.a; +--M.n; +--objA.a, M.n; + +""--; +STRING--; +STRING1--; +STRING1[0]--; +foo()--; +objA.a--; +M.n--; +objA.a--, M.n--; + +//// [decrementOperatorWithUnsupportedStringType.js] +var STRING; +var STRING1 = ["", ""]; +function foo() { + return ""; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = --STRING; +var ResultIsNumber2 = --STRING1; +var ResultIsNumber3 = STRING--; +var ResultIsNumber4 = STRING1--; +var ResultIsNumber5 = --""; +var ResultIsNumber6 = --{ x: "", y: "" }; +var ResultIsNumber7 = --{ x: "", y: function (s) { + return s; +} }; +var ResultIsNumber8 = ""--; +var ResultIsNumber9 = { x: "", y: "" }--; +var ResultIsNumber10 = { x: "", y: function (s) { + return s; +} }--; +var ResultIsNumber11 = --objA.a; +var ResultIsNumber12 = --M.n; +var ResultIsNumber13 = --STRING1[0]; +var ResultIsNumber14 = --foo(); +var ResultIsNumber15 = --A.foo(); +var ResultIsNumber16 = --(STRING + STRING); +var ResultIsNumber17 = objA.a--; +var ResultIsNumber18 = M.n--; +var ResultIsNumber19 = STRING1[0]--; +var ResultIsNumber20 = foo()--; +var ResultIsNumber21 = A.foo()--; +var ResultIsNumber22 = (STRING + STRING)--; +--""; +--STRING; +--STRING1; +--STRING1[0]; +--foo(); +--objA.a; +--M.n; +--objA.a, M.n; +""--; +STRING--; +STRING1--; +STRING1[0]--; +foo()--; +objA.a--; +M.n--; +objA.a--, M.n--; diff --git a/tests/baselines/reference/defaultArgsForwardReferencing.errors.txt b/tests/baselines/reference/defaultArgsForwardReferencing.errors.txt new file mode 100644 index 0000000000000..7f317049695da --- /dev/null +++ b/tests/baselines/reference/defaultArgsForwardReferencing.errors.txt @@ -0,0 +1,62 @@ +==== tests/cases/compiler/defaultArgsForwardReferencing.ts (12 errors) ==== + function left(a, b = a, c = b) { + a; + b; + } + + function right(a = b, b = a) { + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + a; + b; + } + + function right2(a = b, b = c, c = a) { + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + ~ +!!! Initializer of parameter 'b' cannot reference identifier 'c' declared after it. + a; + b; + c; + } + + function inside(a = b) { + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + var b; + } + + function outside() { + var b; + function inside(a = b) { // Still an error because b is declared inside the function + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + var b; + } + } + + function defaultArgFunction(a = function () { return b; }, b = 1) { } + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + function defaultArgArrow(a = () => () => b, b = 3) { } + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + + class C { + constructor(a = b, b = 1) { } + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + method(a = b, b = 1) { } + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + } + + // Function expressions + var x = (a = b, b = c, c = d) => { var d; }; + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + ~ +!!! Initializer of parameter 'b' cannot reference identifier 'c' declared after it. + ~ +!!! Initializer of parameter 'c' cannot reference identifier 'd' declared after it. \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsForwardReferencing.js b/tests/baselines/reference/defaultArgsForwardReferencing.js new file mode 100644 index 0000000000000..5926dd7105f59 --- /dev/null +++ b/tests/baselines/reference/defaultArgsForwardReferencing.js @@ -0,0 +1,98 @@ +//// [defaultArgsForwardReferencing.ts] +function left(a, b = a, c = b) { + a; + b; +} + +function right(a = b, b = a) { + a; + b; +} + +function right2(a = b, b = c, c = a) { + a; + b; + c; +} + +function inside(a = b) { + var b; +} + +function outside() { + var b; + function inside(a = b) { // Still an error because b is declared inside the function + var b; + } +} + +function defaultArgFunction(a = function () { return b; }, b = 1) { } +function defaultArgArrow(a = () => () => b, b = 3) { } + +class C { + constructor(a = b, b = 1) { } + method(a = b, b = 1) { } +} + +// Function expressions +var x = (a = b, b = c, c = d) => { var d; }; + +//// [defaultArgsForwardReferencing.js] +function left(a, b, c) { + if (b === void 0) { b = a; } + if (c === void 0) { c = b; } + a; + b; +} +function right(a, b) { + if (a === void 0) { a = b; } + if (b === void 0) { b = a; } + a; + b; +} +function right2(a, b, c) { + if (a === void 0) { a = b; } + if (b === void 0) { b = c; } + if (c === void 0) { c = a; } + a; + b; + c; +} +function inside(a) { + if (a === void 0) { a = b; } + var b; +} +function outside() { + var b; + function inside(a) { + if (a === void 0) { a = b; } + var b; + } +} +function defaultArgFunction(a, b) { + if (a === void 0) { a = function () { + return b; + }; } + if (b === void 0) { b = 1; } +} +function defaultArgArrow(a, b) { + if (a === void 0) { a = function () { return function () { return b; }; }; } + if (b === void 0) { b = 3; } +} +var C = (function () { + function C(a, b) { + if (a === void 0) { a = b; } + if (b === void 0) { b = 1; } + } + C.prototype.method = function (a, b) { + if (a === void 0) { a = b; } + if (b === void 0) { b = 1; } + }; + return C; +})(); +var x = function (a, b, c) { + if (a === void 0) { a = b; } + if (b === void 0) { b = c; } + if (c === void 0) { c = d; } + var d; +}; diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt new file mode 100644 index 0000000000000..b0b923d4550cf --- /dev/null +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (8 errors) ==== + var f = function (a = 3) { return a; }; // Type should be (a?: number) => number + var n: number = f(4); + n = f(); + var s: string = f(''); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + s = f(); + ~ +!!! Type 'number' is not assignable to type 'string'. + + // Type check the default argument with the type annotation + var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; + ~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + s = f2(''); + s = f2(); + n = f2(); + ~ +!!! Type 'string' is not assignable to type 'number'. + + // Contextually type the default arg with the type annotation + var f3 = function (a: (s: string) => any = (s) => s) { }; + ~~~~~~~~~ +!!! Neither type 'number' nor type 'string' is assignable to the other. + + // Type check using the function's contextual type + var f4: (a: number) => void = function (a = "") { }; + ~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + // Contextually type the default arg using the function's contextual type + var f5: (a: (s: string) => any) => void = function (a = s => s) { }; + ~~~~~~~~~ +!!! Neither type 'number' nor type 'string' is assignable to the other. + + // Instantiated module + module T { } + module U { + export var x; + } + + var f6 = (t = T) => { }; + ~ +!!! Cannot find name 'T'. + var f7 = (t = U) => { return t; }; + + f7().x; \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.js b/tests/baselines/reference/defaultArgsInFunctionExpressions.js new file mode 100644 index 0000000000000..a5872ceac7ba5 --- /dev/null +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.js @@ -0,0 +1,70 @@ +//// [defaultArgsInFunctionExpressions.ts] +var f = function (a = 3) { return a; }; // Type should be (a?: number) => number +var n: number = f(4); +n = f(); +var s: string = f(''); +s = f(); + +// Type check the default argument with the type annotation +var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; +s = f2(''); +s = f2(); +n = f2(); + +// Contextually type the default arg with the type annotation +var f3 = function (a: (s: string) => any = (s) => s) { }; + +// Type check using the function's contextual type +var f4: (a: number) => void = function (a = "") { }; + +// Contextually type the default arg using the function's contextual type +var f5: (a: (s: string) => any) => void = function (a = s => s) { }; + +// Instantiated module +module T { } +module U { + export var x; +} + +var f6 = (t = T) => { }; +var f7 = (t = U) => { return t; }; + +f7().x; + +//// [defaultArgsInFunctionExpressions.js] +var f = function (a) { + if (a === void 0) { a = 3; } + return a; +}; +var n = f(4); +n = f(); +var s = f(''); +s = f(); +var f2 = function (a) { + if (a === void 0) { a = 3; } + return a; +}; +s = f2(''); +s = f2(); +n = f2(); +var f3 = function (a) { + if (a === void 0) { a = function (s) { return s; }; } +}; +var f4 = function (a) { + if (a === void 0) { a = ""; } +}; +var f5 = function (a) { + if (a === void 0) { a = function (s) { return s; }; } +}; +var U; +(function (U) { + U.x; +})(U || (U = {})); +var f6 = function (t) { + if (t === void 0) { t = T; } +}; +var f7 = function (t) { + if (t === void 0) { t = U; } + return t; +}; +f7().x; diff --git a/tests/baselines/reference/defaultArgsInOverloads.errors.txt b/tests/baselines/reference/defaultArgsInOverloads.errors.txt new file mode 100644 index 0000000000000..93f8856052017 --- /dev/null +++ b/tests/baselines/reference/defaultArgsInOverloads.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/defaultArgsInOverloads.ts (5 errors) ==== + function fun(a: string); + function fun(a = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + function fun(a = null) { } + + class C { + fun(a: string); + fun(a = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + fun(a = null) { } + static fun(a: string); + static fun(a = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + static fun(a = null) { } + } + + interface I { + fun(a: string); + fun(a = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + var f: (a = 3) => number; + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInOverloads.js b/tests/baselines/reference/defaultArgsInOverloads.js new file mode 100644 index 0000000000000..defc4f3e223e8 --- /dev/null +++ b/tests/baselines/reference/defaultArgsInOverloads.js @@ -0,0 +1,37 @@ +//// [defaultArgsInOverloads.ts] +function fun(a: string); +function fun(a = 3); +function fun(a = null) { } + +class C { + fun(a: string); + fun(a = 3); + fun(a = null) { } + static fun(a: string); + static fun(a = 3); + static fun(a = null) { } +} + +interface I { + fun(a: string); + fun(a = 3); +} + +var f: (a = 3) => number; + +//// [defaultArgsInOverloads.js] +function fun(a) { + if (a === void 0) { a = null; } +} +var C = (function () { + function C() { + } + C.prototype.fun = function (a) { + if (a === void 0) { a = null; } + }; + C.fun = function (a) { + if (a === void 0) { a = null; } + }; + return C; +})(); +var f; diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt new file mode 100644 index 0000000000000..df98b965347b8 --- /dev/null +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== + + var obj1: {}; + + obj1.length; + ~~~~~~ +!!! Property 'length' does not exist on type '{}'. + + + + var obj2: Object; + + obj2.length; + ~~~~~~ +!!! Property 'length' does not exist on type 'Object'. + + + + function concat(x: T, y: T): T { return null; } + + var result = concat(1, ""); + + var elementCount = result.length; // would like to get an error by now + ~~~~~~ +!!! Property 'length' does not exist on type '{}'. + \ No newline at end of file diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js new file mode 100644 index 0000000000000..8924198b7dc07 --- /dev/null +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js @@ -0,0 +1,31 @@ +//// [defaultBestCommonTypesHaveDecls.ts] + +var obj1: {}; + +obj1.length; + + + +var obj2: Object; + +obj2.length; + + + +function concat(x: T, y: T): T { return null; } + +var result = concat(1, ""); + +var elementCount = result.length; // would like to get an error by now + + +//// [defaultBestCommonTypesHaveDecls.js] +var obj1; +obj1.length; +var obj2; +obj2.length; +function concat(x, y) { + return null; +} +var result = concat(1, ""); +var elementCount = result.length; diff --git a/tests/baselines/reference/defaultIndexProps1.js b/tests/baselines/reference/defaultIndexProps1.js new file mode 100644 index 0000000000000..fc8fe52b9fc52 --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps1.js @@ -0,0 +1,25 @@ +//// [defaultIndexProps1.ts] +class Foo { + public v = "Yo"; +} + +var f = new Foo(); + +var q = f["v"]; + +var o = {v:"Yo2"}; + +var q2 = o["v"]; + + +//// [defaultIndexProps1.js] +var Foo = (function () { + function Foo() { + this.v = "Yo"; + } + return Foo; +})(); +var f = new Foo(); +var q = f["v"]; +var o = { v: "Yo2" }; +var q2 = o["v"]; diff --git a/tests/baselines/reference/defaultIndexProps2.js b/tests/baselines/reference/defaultIndexProps2.js new file mode 100644 index 0000000000000..67a894bf9e1ae --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps2.js @@ -0,0 +1,28 @@ +//// [defaultIndexProps2.ts] +class Foo { + public v = "Yo"; +} + +var f = new Foo(); + +// WScript.Echo(f[0]); + +var o = {v:"Yo2"}; + +// WScript.Echo(o[0]); + +1[0]; +var q = "s"[0]; + + +//// [defaultIndexProps2.js] +var Foo = (function () { + function Foo() { + this.v = "Yo"; + } + return Foo; +})(); +var f = new Foo(); +var o = { v: "Yo2" }; +1[0]; +var q = "s"[0]; diff --git a/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt b/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt new file mode 100644 index 0000000000000..c762d0919d95c --- /dev/null +++ b/tests/baselines/reference/defaultValueInConstructorOverload1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/defaultValueInConstructorOverload1.ts (1 errors) ==== + class C { + constructor(x = ''); + ~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + constructor(x = '') { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/defaultValueInConstructorOverload1.js b/tests/baselines/reference/defaultValueInConstructorOverload1.js new file mode 100644 index 0000000000000..968876bf7ec23 --- /dev/null +++ b/tests/baselines/reference/defaultValueInConstructorOverload1.js @@ -0,0 +1,14 @@ +//// [defaultValueInConstructorOverload1.ts] +class C { + constructor(x = ''); + constructor(x = '') { + } +} + +//// [defaultValueInConstructorOverload1.js] +var C = (function () { + function C(x) { + if (x === void 0) { x = ''; } + } + return C; +})(); diff --git a/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt b/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt new file mode 100644 index 0000000000000..283e287e9da0c --- /dev/null +++ b/tests/baselines/reference/defaultValueInFunctionOverload1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/defaultValueInFunctionOverload1.ts (1 errors) ==== + function foo(x: string = ''); + ~~~~~~~~~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + function foo(x = '') { } \ No newline at end of file diff --git a/tests/baselines/reference/defaultValueInFunctionOverload1.js b/tests/baselines/reference/defaultValueInFunctionOverload1.js new file mode 100644 index 0000000000000..0f33fe9ff2e41 --- /dev/null +++ b/tests/baselines/reference/defaultValueInFunctionOverload1.js @@ -0,0 +1,8 @@ +//// [defaultValueInFunctionOverload1.ts] +function foo(x: string = ''); +function foo(x = '') { } + +//// [defaultValueInFunctionOverload1.js] +function foo(x) { + if (x === void 0) { x = ''; } +} diff --git a/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt b/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt new file mode 100644 index 0000000000000..22a0c718c7c99 --- /dev/null +++ b/tests/baselines/reference/defaultValueInFunctionTypes.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/defaultValueInFunctionTypes.ts (1 errors) ==== + var x: (a: number = 1) => number; + ~~~~~~~~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + var y = <(a : string = "") => any>(undefined) \ No newline at end of file diff --git a/tests/baselines/reference/defaultValueInFunctionTypes.js b/tests/baselines/reference/defaultValueInFunctionTypes.js new file mode 100644 index 0000000000000..c3f2bf6082957 --- /dev/null +++ b/tests/baselines/reference/defaultValueInFunctionTypes.js @@ -0,0 +1,7 @@ +//// [defaultValueInFunctionTypes.ts] +var x: (a: number = 1) => number; +var y = <(a : string = "") => any>(undefined) + +//// [defaultValueInFunctionTypes.js] +var x; +var y = (undefined); diff --git a/tests/baselines/reference/deleteOperator1.errors.txt b/tests/baselines/reference/deleteOperator1.errors.txt new file mode 100644 index 0000000000000..de583703cdc7a --- /dev/null +++ b/tests/baselines/reference/deleteOperator1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/deleteOperator1.ts (1 errors) ==== + var a; + var x: boolean = delete a; + var y: any = delete a; + var z: number = delete a; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperator1.js b/tests/baselines/reference/deleteOperator1.js new file mode 100644 index 0000000000000..f896b2ccd436e --- /dev/null +++ b/tests/baselines/reference/deleteOperator1.js @@ -0,0 +1,11 @@ +//// [deleteOperator1.ts] +var a; +var x: boolean = delete a; +var y: any = delete a; +var z: number = delete a; + +//// [deleteOperator1.js] +var a; +var x = delete a; +var y = delete a; +var z = delete a; diff --git a/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt b/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt new file mode 100644 index 0000000000000..89980ef9bc06d --- /dev/null +++ b/tests/baselines/reference/deleteOperatorInvalidOperations.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorInvalidOperations.ts (3 errors) ==== + // Unary operator delete + var ANY; + + // operand before delete operator + var BOOLEAN1 = ANY delete ; //expect error + ~~~~~~ +!!! ',' expected. + ~ +!!! Expression expected. + + // miss an operand + var BOOLEAN2 = delete ; + ~ +!!! Expression expected. + + // delete global variable s + class testADelx { + constructor(public s: () => {}) { + delete s; //expect error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..18382a6f45351 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,68 @@ +==== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithAnyOtherType.ts (3 errors) ==== + // delete operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {}; + var obj1 = { x: "", y: () => { }}; + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsBoolean1 = delete ANY1; + var ResultIsBoolean2 = delete ANY2; + var ResultIsBoolean3 = delete A; + var ResultIsBoolean4 = delete M; + var ResultIsBoolean5 = delete obj; + var ResultIsBoolean6 = delete obj1; + + // any type literal + var ResultIsBoolean7 = delete undefined; + var ResultIsBoolean8 = delete null; + + // any type expressions + var ResultIsBoolean9 = delete ANY2[0]; + var ResultIsBoolean10 = delete obj1.x; + var ResultIsBoolean11 = delete obj1.y; + var ResultIsBoolean12 = delete objA.a; + var ResultIsBoolean13 = delete M.n; + var ResultIsBoolean14 = delete foo(); + var ResultIsBoolean15 = delete A.foo(); + var ResultIsBoolean16 = delete (ANY + ANY1); + var ResultIsBoolean17 = delete (null + undefined); + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsBoolean18 = delete (null + null); + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsBoolean19 = delete (undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + // multiple delete operators + var ResultIsBoolean20 = delete delete ANY; + var ResultIsBoolean21 = delete delete delete (ANY + ANY1); + + // miss assignment operators + delete ANY; + delete ANY1; + delete ANY2[0]; + delete ANY, ANY1; + delete obj1.x; + delete obj1.y; + delete objA.a; + delete M.n; \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.js b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..167ce961b3a56 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.js @@ -0,0 +1,117 @@ +//// [deleteOperatorWithAnyOtherType.ts] +// delete operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj: () => {}; +var obj1 = { x: "", y: () => { }}; +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsBoolean1 = delete ANY1; +var ResultIsBoolean2 = delete ANY2; +var ResultIsBoolean3 = delete A; +var ResultIsBoolean4 = delete M; +var ResultIsBoolean5 = delete obj; +var ResultIsBoolean6 = delete obj1; + +// any type literal +var ResultIsBoolean7 = delete undefined; +var ResultIsBoolean8 = delete null; + +// any type expressions +var ResultIsBoolean9 = delete ANY2[0]; +var ResultIsBoolean10 = delete obj1.x; +var ResultIsBoolean11 = delete obj1.y; +var ResultIsBoolean12 = delete objA.a; +var ResultIsBoolean13 = delete M.n; +var ResultIsBoolean14 = delete foo(); +var ResultIsBoolean15 = delete A.foo(); +var ResultIsBoolean16 = delete (ANY + ANY1); +var ResultIsBoolean17 = delete (null + undefined); +var ResultIsBoolean18 = delete (null + null); +var ResultIsBoolean19 = delete (undefined + undefined); + +// multiple delete operators +var ResultIsBoolean20 = delete delete ANY; +var ResultIsBoolean21 = delete delete delete (ANY + ANY1); + +// miss assignment operators +delete ANY; +delete ANY1; +delete ANY2[0]; +delete ANY, ANY1; +delete obj1.x; +delete obj1.y; +delete objA.a; +delete M.n; + +//// [deleteOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = delete ANY1; +var ResultIsBoolean2 = delete ANY2; +var ResultIsBoolean3 = delete A; +var ResultIsBoolean4 = delete M; +var ResultIsBoolean5 = delete obj; +var ResultIsBoolean6 = delete obj1; +var ResultIsBoolean7 = delete undefined; +var ResultIsBoolean8 = delete null; +var ResultIsBoolean9 = delete ANY2[0]; +var ResultIsBoolean10 = delete obj1.x; +var ResultIsBoolean11 = delete obj1.y; +var ResultIsBoolean12 = delete objA.a; +var ResultIsBoolean13 = delete M.n; +var ResultIsBoolean14 = delete foo(); +var ResultIsBoolean15 = delete A.foo(); +var ResultIsBoolean16 = delete (ANY + ANY1); +var ResultIsBoolean17 = delete (null + undefined); +var ResultIsBoolean18 = delete (null + null); +var ResultIsBoolean19 = delete (undefined + undefined); +var ResultIsBoolean20 = delete delete ANY; +var ResultIsBoolean21 = delete delete delete (ANY + ANY1); +delete ANY; +delete ANY1; +delete ANY2[0]; +delete ANY, ANY1; +delete obj1.x; +delete obj1.y; +delete objA.a; +delete M.n; diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.js b/tests/baselines/reference/deleteOperatorWithBooleanType.js new file mode 100644 index 0000000000000..198e3c73b7a93 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.js @@ -0,0 +1,72 @@ +//// [deleteOperatorWithBooleanType.ts] +// delete operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return false; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsBoolean1 = delete BOOLEAN; + +// boolean type literal +var ResultIsBoolean2 = delete true; +var ResultIsBoolean3 = delete { x: true, y: false }; + +// boolean type expressions +var ResultIsBoolean4 = delete objA.a; +var ResultIsBoolean5 = delete M.n; +var ResultIsBoolean6 = delete foo(); +var ResultIsBoolean7 = delete A.foo(); + +// multiple delete operator +var ResultIsBoolean8 = delete delete BOOLEAN; + +// miss assignment operators +delete true; +delete BOOLEAN; +delete foo(); +delete true, false; +delete objA.a; +delete M.n; + +//// [deleteOperatorWithBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return false; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = delete BOOLEAN; +var ResultIsBoolean2 = delete true; +var ResultIsBoolean3 = delete { x: true, y: false }; +var ResultIsBoolean4 = delete objA.a; +var ResultIsBoolean5 = delete M.n; +var ResultIsBoolean6 = delete foo(); +var ResultIsBoolean7 = delete A.foo(); +var ResultIsBoolean8 = delete delete BOOLEAN; +delete true; +delete BOOLEAN; +delete foo(); +delete true, false; +delete objA.a; +delete M.n; diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.js b/tests/baselines/reference/deleteOperatorWithEnumType.js new file mode 100644 index 0000000000000..fd5e1e674f6f8 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithEnumType.js @@ -0,0 +1,46 @@ +//// [deleteOperatorWithEnumType.ts] +// delete operator on enum type + +enum ENUM { }; +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsBoolean1 = delete ENUM; +var ResultIsBoolean2 = delete ENUM1; + +// enum type expressions +var ResultIsBoolean3 = delete ENUM1[0]; +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]); + +// multiple delete operators +var ResultIsBoolean5 = delete delete ENUM; +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]); + +// miss assignment operators +delete ENUM; +delete ENUM1; +delete ENUM1[1]; +delete ENUM, ENUM1; + +//// [deleteOperatorWithEnumType.js] +var ENUM; +(function (ENUM) { +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsBoolean1 = delete ENUM; +var ResultIsBoolean2 = delete ENUM1; +var ResultIsBoolean3 = delete ENUM1[0]; +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]); +var ResultIsBoolean5 = delete delete ENUM; +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]); +delete ENUM; +delete ENUM1; +delete ENUM1[1]; +delete ENUM, ENUM1; diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.js b/tests/baselines/reference/deleteOperatorWithNumberType.js new file mode 100644 index 0000000000000..7b6cdcb962b1f --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithNumberType.js @@ -0,0 +1,88 @@ +//// [deleteOperatorWithNumberType.ts] +// delete operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsBoolean1 = delete NUMBER; +var ResultIsBoolean2 = delete NUMBER1; + +// number type literal +var ResultIsBoolean3 = delete 1; +var ResultIsBoolean4 = delete { x: 1, y: 2}; +var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; + +// number type expressions +var ResultIsBoolean6 = delete objA.a; +var ResultIsBoolean7 = delete M.n; +var ResultIsBoolean8 = delete NUMBER1[0]; +var ResultIsBoolean9 = delete foo(); +var ResultIsBoolean10 = delete A.foo(); +var ResultIsBoolean11 = delete (NUMBER + NUMBER); + +// multiple delete operator +var ResultIsBoolean12 = delete delete NUMBER; +var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); + +// miss assignment operators +delete 1; +delete NUMBER; +delete NUMBER1; +delete foo(); +delete objA.a; +delete M.n; +delete objA.a, M.n; + +//// [deleteOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = delete NUMBER; +var ResultIsBoolean2 = delete NUMBER1; +var ResultIsBoolean3 = delete 1; +var ResultIsBoolean4 = delete { x: 1, y: 2 }; +var ResultIsBoolean5 = delete { x: 1, y: function (n) { + return n; +} }; +var ResultIsBoolean6 = delete objA.a; +var ResultIsBoolean7 = delete M.n; +var ResultIsBoolean8 = delete NUMBER1[0]; +var ResultIsBoolean9 = delete foo(); +var ResultIsBoolean10 = delete A.foo(); +var ResultIsBoolean11 = delete (NUMBER + NUMBER); +var ResultIsBoolean12 = delete delete NUMBER; +var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); +delete 1; +delete NUMBER; +delete NUMBER1; +delete foo(); +delete objA.a; +delete M.n; +delete objA.a, M.n; diff --git a/tests/baselines/reference/deleteOperatorWithStringType.js b/tests/baselines/reference/deleteOperatorWithStringType.js new file mode 100644 index 0000000000000..65a1ed5ef18fb --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithStringType.js @@ -0,0 +1,86 @@ +//// [deleteOperatorWithStringType.ts] +// delete operator on string type +var STRING: string; +var STRING1: string[] = ["", "abc"]; + +function foo(): string { return "abc"; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsBoolean1 = delete STRING; +var ResultIsBoolean2 = delete STRING1; + +// string type literal +var ResultIsBoolean3 = delete ""; +var ResultIsBoolean4 = delete { x: "", y: "" }; +var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; + +// string type expressions +var ResultIsBoolean6 = delete objA.a; +var ResultIsBoolean7 = delete M.n; +var ResultIsBoolean8 = delete STRING1[0]; +var ResultIsBoolean9 = delete foo(); +var ResultIsBoolean10 = delete A.foo(); +var ResultIsBoolean11 = delete (STRING + STRING); +var ResultIsBoolean12 = delete STRING.charAt(0); + +// multiple delete operator +var ResultIsBoolean13 = delete delete STRING; +var ResultIsBoolean14 = delete delete delete (STRING + STRING); + +// miss assignment operators +delete ""; +delete STRING; +delete STRING1; +delete foo(); +delete objA.a,M.n; + +//// [deleteOperatorWithStringType.js] +var STRING; +var STRING1 = ["", "abc"]; +function foo() { + return "abc"; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = delete STRING; +var ResultIsBoolean2 = delete STRING1; +var ResultIsBoolean3 = delete ""; +var ResultIsBoolean4 = delete { x: "", y: "" }; +var ResultIsBoolean5 = delete { x: "", y: function (s) { + return s; +} }; +var ResultIsBoolean6 = delete objA.a; +var ResultIsBoolean7 = delete M.n; +var ResultIsBoolean8 = delete STRING1[0]; +var ResultIsBoolean9 = delete foo(); +var ResultIsBoolean10 = delete A.foo(); +var ResultIsBoolean11 = delete (STRING + STRING); +var ResultIsBoolean12 = delete STRING.charAt(0); +var ResultIsBoolean13 = delete delete STRING; +var ResultIsBoolean14 = delete delete delete (STRING + STRING); +delete ""; +delete STRING; +delete STRING1; +delete foo(); +delete objA.a, M.n; diff --git a/tests/baselines/reference/dependencyViaImportAlias.js b/tests/baselines/reference/dependencyViaImportAlias.js new file mode 100644 index 0000000000000..e94be4a0affe8 --- /dev/null +++ b/tests/baselines/reference/dependencyViaImportAlias.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/dependencyViaImportAlias.ts] //// + +//// [A.ts] +export class A { +} +//// [B.ts] +import a = require('A'); + +import A = a.A; + +export = A; + +//// [A.js] +define(["require", "exports"], function (require, exports) { + var A = (function () { + function A() { + } + return A; + })(); + exports.A = A; +}); +//// [B.js] +define(["require", "exports", 'A'], function (require, exports, a) { + var A = a.A; + return A; +}); diff --git a/tests/baselines/reference/deprecatedBool.js b/tests/baselines/reference/deprecatedBool.js new file mode 100644 index 0000000000000..5cb529236a654 --- /dev/null +++ b/tests/baselines/reference/deprecatedBool.js @@ -0,0 +1,8 @@ +//// [deprecatedBool.ts] +var b4: boolean; +var bool: boolean; + + +//// [deprecatedBool.js] +var b4; +var bool; diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt new file mode 100644 index 0000000000000..363892227ffd5 --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassConstructorWithoutSuperCall.ts (5 errors) ==== + // derived class constructors must contain a super call + + class Base { + x: string; + } + + class Derived extends Base { + constructor() { // error + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class Base2 { + x: T; + } + + class Derived2 extends Base2 { + constructor() { // error for no super call (nested scopes don't count) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var r2 = () => super(); // error for misplaced super call (nested function) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class Derived3 extends Base2 { + constructor() { // error + ~~~~~~~~~~~~~~~~~~~~~~~~ + var r = function () { super() } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class Derived4 extends Base2 { + constructor() { + var r = super(); // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js new file mode 100644 index 0000000000000..cc23b6804a2ae --- /dev/null +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -0,0 +1,80 @@ +//// [derivedClassConstructorWithoutSuperCall.ts] +// derived class constructors must contain a super call + +class Base { + x: string; +} + +class Derived extends Base { + constructor() { // error + } +} + +class Base2 { + x: T; +} + +class Derived2 extends Base2 { + constructor() { // error for no super call (nested scopes don't count) + var r2 = () => super(); // error for misplaced super call (nested function) + } +} + +class Derived3 extends Base2 { + constructor() { // error + var r = function () { super() } // error + } +} + +class Derived4 extends Base2 { + constructor() { + var r = super(); // ok + } +} + +//// [derivedClassConstructorWithoutSuperCall.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + } + return Derived; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + var r2 = function () { return _super.call(this); }; + } + return Derived2; +})(Base2); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + var r = function () { + _super.call(this); + }; + } + return Derived3; +})(Base2); +var Derived4 = (function (_super) { + __extends(Derived4, _super); + function Derived4() { + var r = _super.call(this); + } + return Derived4; +})(Base2); diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt new file mode 100644 index 0000000000000..35b6ca92c18b1 --- /dev/null +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts (4 errors) ==== + class Base { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + set x(v) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + // error + class Derived extends Base { + ~~~~~~~ +!!! Class 'Derived' incorrectly extends base class 'Base': +!!! Types of property 'x' are incompatible: +!!! Type '() => number' is not assignable to type 'number'. + x() { + ~ +!!! Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt b/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt new file mode 100644 index 0000000000000..307aad8dd2e29 --- /dev/null +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassIncludesInheritedMembers.ts (4 errors) ==== + class Base { + a: string; + b() { } + get c() { return ''; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set c(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + static r: string; + static s() { } + static get t() { return ''; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set t(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + constructor(x) { } + } + + class Derived extends Base { + } + + var d: Derived = new Derived(1); + var r1 = d.a; + var r2 = d.b(); + var r3 = d.c; + d.c = ''; + var r4 = Derived.r; + var r5 = Derived.s(); + var r6 = Derived.t; + Derived.t = ''; + + class Base2 { + [x: string]: Object; + [x: number]: Date; + } + + class Derived2 extends Base2 { + } + + var d2: Derived2; + var r7 = d2['']; + var r8 = d2[1]; + + \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js new file mode 100644 index 0000000000000..b72f391ccfe48 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -0,0 +1,50 @@ +//// [derivedClassOverridesIndexersWithAssignmentCompatibility.ts] +class Base { + [x: string]: Object; +} + +// ok, use assignment compatibility +class Derived extends Base { + [x: string]: any; +} + +class Base2 { + [x: number]: Object; +} + +// ok, use assignment compatibility +class Derived2 extends Base2 { + [x: number]: any; +} + +//// [derivedClassOverridesIndexersWithAssignmentCompatibility.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt new file mode 100644 index 0000000000000..3eb2f197ca0f0 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts (1 errors) ==== + class BaseClass { + constructor() { + this._init(); + } + private _init() { + } + } + class DerivedClass extends BaseClass { + ~~~~~~~~~~~~ +!!! Class 'DerivedClass' incorrectly extends base class 'BaseClass': +!!! Private property '_init' cannot be reimplemented. + constructor() { + super(); + } + private _init() { + } + } + new DerivedClass(); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js new file mode 100644 index 0000000000000..c1519f7695ca2 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -0,0 +1,42 @@ +//// [derivedClassOverridesPrivateFunction1.ts] +class BaseClass { + constructor() { + this._init(); + } + private _init() { + } +} +class DerivedClass extends BaseClass { + constructor() { + super(); + } + private _init() { + } +} +new DerivedClass(); + +//// [derivedClassOverridesPrivateFunction1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var BaseClass = (function () { + function BaseClass() { + this._init(); + } + BaseClass.prototype._init = function () { + }; + return BaseClass; +})(); +var DerivedClass = (function (_super) { + __extends(DerivedClass, _super); + function DerivedClass() { + _super.call(this); + } + DerivedClass.prototype._init = function () { + }; + return DerivedClass; +})(BaseClass); +new DerivedClass(); diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt new file mode 100644 index 0000000000000..c6d8f2305893d --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts (2 errors) ==== + class Base { + private x: { foo: string }; + } + + class Derived extends Base { + ~~~~~~~ +!!! Class 'Derived' incorrectly extends base class 'Base': +!!! Private property 'x' cannot be reimplemented. + private x: { foo: string; bar: string; }; // error + } + + class Base2 { + private static y: { foo: string }; + } + + class Derived2 extends Base2 { + ~~~~~~~~ +!!! Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +!!! Private property 'y' cannot be reimplemented. + private static y: { foo: string; bar: string; }; // error + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js new file mode 100644 index 0000000000000..f6a704e076a4c --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -0,0 +1,48 @@ +//// [derivedClassOverridesPrivates.ts] +class Base { + private x: { foo: string }; +} + +class Derived extends Base { + private x: { foo: string; bar: string; }; // error +} + +class Base2 { + private static y: { foo: string }; +} + +class Derived2 extends Base2 { + private static y: { foo: string; bar: string; }; // error +} + +//// [derivedClassOverridesPrivates.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt b/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt new file mode 100644 index 0000000000000..efd8f968ea3ee --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.errors.txt @@ -0,0 +1,79 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPublicMembers.ts (8 errors) ==== + var x: { foo: string; } + var y: { foo: string; bar: string; } + + class Base { + a: typeof x; + b(a: typeof x) { } + get c() { return x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set c(v: typeof x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + d: (a: typeof x) => void; + + static r: typeof x; + static s(a: typeof x) { } + static get t() { return x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set t(v: typeof x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static u: (a: typeof x) => void; + + constructor(a: typeof x) { } + } + + class Derived extends Base { + a: typeof y; + b(a: typeof y) { } + get c() { return y; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set c(v: typeof y) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + d: (a: typeof y) => void; + + static r: typeof y; + static s(a: typeof y) { } + static get t() { return y; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set t(a: typeof y) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static u: (a: typeof y) => void; + + constructor(a: typeof y) { super(x) } + } + + var d: Derived = new Derived(y); + var r1 = d.a; + var r2 = d.b(y); + var r3 = d.c; + var r3a = d.d; + d.c = y; + var r4 = Derived.r; + var r5 = Derived.s(y); + var r6 = Derived.t; + var r6a = Derived.u; + Derived.t = y; + + class Base2 { + [i: string]: Object; + [i: number]: typeof x; + } + + class Derived2 extends Base2 { + [i: string]: typeof x; + [i: number]: typeof y; + } + + var d2: Derived2; + var r7 = d2['']; + var r8 = d2[1]; + + \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js new file mode 100644 index 0000000000000..7a18c0d71a5ca --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -0,0 +1,56 @@ +//// [derivedClassOverridesWithoutSubtype.ts] +class Base { + x: { + foo: string; + } +} + +class Derived extends Base { + x: { + foo: any; + } +} + +class Base2 { + static y: { + foo: string; + } +} + +class Derived2 extends Base2 { + static y: { + foo: any; + } +} + +//// [derivedClassOverridesWithoutSubtype.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); diff --git a/tests/baselines/reference/derivedClassParameterProperties.errors.txt b/tests/baselines/reference/derivedClassParameterProperties.errors.txt new file mode 100644 index 0000000000000..cd7d774b30c1e --- /dev/null +++ b/tests/baselines/reference/derivedClassParameterProperties.errors.txt @@ -0,0 +1,117 @@ +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassParameterProperties.ts (4 errors) ==== + // ordering of super calls in derived constructors matters depending on other class contents + + class Base { + x: string; + } + + class Derived extends Base { + constructor(y: string) { + var a = 1; + super(); // ok + } + } + + class Derived2 extends Base { + constructor(public y: string) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var a = 1; + ~~~~~~~~~~~~~~~~~~ + super(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class Derived3 extends Base { + constructor(public y: string) { + super(); // ok + var a = 1; + } + } + + class Derived4 extends Base { + a = 1; + constructor(y: string) { + ~~~~~~~~~~~~~~~~~~~~~~~~ + var b = 2; + ~~~~~~~~~~~~~~~~~~ + super(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class Derived5 extends Base { + a = 1; + constructor(y: string) { + super(); // ok + var b = 2; + } + } + + class Derived6 extends Base { + a: number; + constructor(y: string) { + this.a = 1; + var b = 2; + super(); // ok + } + } + + class Derived7 extends Base { + a = 1; + b: number; + constructor(y: string) { + ~~~~~~~~~~~~~~~~~~~~~~~~ + this.a = 3; + ~~~~~~~~~~~~~~~~~~~ + this.b = 3; + ~~~~~~~~~~~~~~~~~~~ + super(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class Derived8 extends Base { + a = 1; + b: number; + constructor(y: string) { + super(); // ok + this.a = 3; + this.b = 3; + } + } + + // generic cases of Derived7 and Derived8 + class Base2 { x: T; } + + class Derived9 extends Base2 { + a = 1; + b: number; + constructor(y: string) { + ~~~~~~~~~~~~~~~~~~~~~~~~ + this.a = 3; + ~~~~~~~~~~~~~~~~~~~ + this.b = 3; + ~~~~~~~~~~~~~~~~~~~ + super(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class Derived10 extends Base2 { + a = 1; + b: number; + constructor(y: string) { + super(); // ok + this.a = 3; + this.b = 3; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js new file mode 100644 index 0000000000000..cb8115c966125 --- /dev/null +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -0,0 +1,206 @@ +//// [derivedClassParameterProperties.ts] +// ordering of super calls in derived constructors matters depending on other class contents + +class Base { + x: string; +} + +class Derived extends Base { + constructor(y: string) { + var a = 1; + super(); // ok + } +} + +class Derived2 extends Base { + constructor(public y: string) { + var a = 1; + super(); // error + } +} + +class Derived3 extends Base { + constructor(public y: string) { + super(); // ok + var a = 1; + } +} + +class Derived4 extends Base { + a = 1; + constructor(y: string) { + var b = 2; + super(); // error + } +} + +class Derived5 extends Base { + a = 1; + constructor(y: string) { + super(); // ok + var b = 2; + } +} + +class Derived6 extends Base { + a: number; + constructor(y: string) { + this.a = 1; + var b = 2; + super(); // ok + } +} + +class Derived7 extends Base { + a = 1; + b: number; + constructor(y: string) { + this.a = 3; + this.b = 3; + super(); // error + } +} + +class Derived8 extends Base { + a = 1; + b: number; + constructor(y: string) { + super(); // ok + this.a = 3; + this.b = 3; + } +} + +// generic cases of Derived7 and Derived8 +class Base2 { x: T; } + +class Derived9 extends Base2 { + a = 1; + b: number; + constructor(y: string) { + this.a = 3; + this.b = 3; + super(); // error + } +} + +class Derived10 extends Base2 { + a = 1; + b: number; + constructor(y: string) { + super(); // ok + this.a = 3; + this.b = 3; + } +} + +//// [derivedClassParameterProperties.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(y) { + var a = 1; + _super.call(this); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2(y) { + this.y = y; + var a = 1; + _super.call(this); + } + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3(y) { + _super.call(this); + this.y = y; + var a = 1; + } + return Derived3; +})(Base); +var Derived4 = (function (_super) { + __extends(Derived4, _super); + function Derived4(y) { + this.a = 1; + var b = 2; + _super.call(this); + } + return Derived4; +})(Base); +var Derived5 = (function (_super) { + __extends(Derived5, _super); + function Derived5(y) { + _super.call(this); + this.a = 1; + var b = 2; + } + return Derived5; +})(Base); +var Derived6 = (function (_super) { + __extends(Derived6, _super); + function Derived6(y) { + this.a = 1; + var b = 2; + _super.call(this); + } + return Derived6; +})(Base); +var Derived7 = (function (_super) { + __extends(Derived7, _super); + function Derived7(y) { + this.a = 1; + this.a = 3; + this.b = 3; + _super.call(this); + } + return Derived7; +})(Base); +var Derived8 = (function (_super) { + __extends(Derived8, _super); + function Derived8(y) { + _super.call(this); + this.a = 1; + this.a = 3; + this.b = 3; + } + return Derived8; +})(Base); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived9 = (function (_super) { + __extends(Derived9, _super); + function Derived9(y) { + this.a = 1; + this.a = 3; + this.b = 3; + _super.call(this); + } + return Derived9; +})(Base2); +var Derived10 = (function (_super) { + __extends(Derived10, _super); + function Derived10(y) { + _super.call(this); + this.a = 1; + this.a = 3; + this.b = 3; + } + return Derived10; +})(Base2); diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt new file mode 100644 index 0000000000000..6c2625223c2bf --- /dev/null +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (14 errors) ==== + // error to use super calls outside a constructor + + class Base { + x: string; + } + + class Derived extends Base { + a: super(); + ~~~~~ +!!! Type expected. + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + b() { + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + get C() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + return 1; + } + set C(v) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + + static a: super(); + ~~~~~ +!!! Type expected. + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + static b() { + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + static get C() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + return 1; + } + static set C(v) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt new file mode 100644 index 0000000000000..86a6a4d37e41a --- /dev/null +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsWithThisArg.ts (2 errors) ==== + class Base { + x: string; + constructor(a) { } + } + + class Derived extends Base { + constructor() { + super(this); // ok + } + } + + class Derived2 extends Base { + constructor(public a: string) { + super(this); // error + ~~~~ +!!! 'this' cannot be referenced in current location. + } + } + + class Derived3 extends Base { + constructor(public a: string) { + super(() => this); // error + ~~~~ +!!! 'this' cannot be referenced in current location. + } + } + + class Derived4 extends Base { + constructor(public a: string) { + super(function () { return this; }); // ok + } + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js new file mode 100644 index 0000000000000..163337ae12e74 --- /dev/null +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -0,0 +1,76 @@ +//// [derivedClassSuperCallsWithThisArg.ts] +class Base { + x: string; + constructor(a) { } +} + +class Derived extends Base { + constructor() { + super(this); // ok + } +} + +class Derived2 extends Base { + constructor(public a: string) { + super(this); // error + } +} + +class Derived3 extends Base { + constructor(public a: string) { + super(() => this); // error + } +} + +class Derived4 extends Base { + constructor(public a: string) { + super(function () { return this; }); // ok + } +} + +//// [derivedClassSuperCallsWithThisArg.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(a) { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.call(this, this); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2(a) { + _super.call(this, this); + this.a = a; + } + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3(a) { + _super.call(this, function () { return _this; }); + this.a = a; + var _this = this; + } + return Derived3; +})(Base); +var Derived4 = (function (_super) { + __extends(Derived4, _super); + function Derived4(a) { + _super.call(this, function () { + return this; + }); + this.a = a; + } + return Derived4; +})(Base); diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt new file mode 100644 index 0000000000000..c5e60abe5d4ac --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts (1 errors) ==== + // subclassing is not transitive when you can remove required parameters and add optional parameters + + class C { + foo(x: number) { } + } + + class D extends C { + foo() { } // ok to drop parameters + } + + class E extends D { + foo(x?: string) { } // ok to add optional parameters + } + + var c: C; + var d: D; + var e: E; + c = e; + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Types of property 'foo' are incompatible: +!!! Type '(x?: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var r = c.foo(1); + var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js new file mode 100644 index 0000000000000..828e4d3d8c915 --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -0,0 +1,60 @@ +//// [derivedClassTransitivity.ts] +// subclassing is not transitive when you can remove required parameters and add optional parameters + +class C { + foo(x: number) { } +} + +class D extends C { + foo() { } // ok to drop parameters +} + +class E extends D { + foo(x?: string) { } // ok to add optional parameters +} + +var c: C; +var d: D; +var e: E; +c = e; +var r = c.foo(1); +var r2 = e.foo(''); + +//// [derivedClassTransitivity.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.foo = function () { + }; + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + E.prototype.foo = function (x) { + }; + return E; +})(D); +var c; +var d; +var e; +c = e; +var r = c.foo(1); +var r2 = e.foo(''); diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt new file mode 100644 index 0000000000000..b2b3fca897993 --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts (1 errors) ==== + // subclassing is not transitive when you can remove required parameters and add optional parameters + + class C { + foo(x: number, y: number) { } + } + + class D extends C { + foo(x: number) { } // ok to drop parameters + } + + class E extends D { + foo(x: number, y?: string) { } // ok to add optional parameters + } + + var c: C; + var d: D; + var e: E; + c = e; + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var r = c.foo(1, 1); + var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js new file mode 100644 index 0000000000000..eaac47847b77e --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -0,0 +1,60 @@ +//// [derivedClassTransitivity2.ts] +// subclassing is not transitive when you can remove required parameters and add optional parameters + +class C { + foo(x: number, y: number) { } +} + +class D extends C { + foo(x: number) { } // ok to drop parameters +} + +class E extends D { + foo(x: number, y?: string) { } // ok to add optional parameters +} + +var c: C; +var d: D; +var e: E; +c = e; +var r = c.foo(1, 1); +var r2 = e.foo(1, ''); + +//// [derivedClassTransitivity2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.foo = function (x) { + }; + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + E.prototype.foo = function (x, y) { + }; + return E; +})(D); +var c; +var d; +var e; +c = e; +var r = c.foo(1, 1); +var r2 = e.foo(1, ''); diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt new file mode 100644 index 0000000000000..8013f894b30a8 --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts (1 errors) ==== + // subclassing is not transitive when you can remove required parameters and add optional parameters + + class C { + foo(x: T, y: T) { } + } + + class D extends C { + foo(x: T) { } // ok to drop parameters + } + + class E extends D { + foo(x: T, y?: number) { } // ok to add optional parameters + } + + var c: C; + var d: D; + var e: E; + c = e; + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': +!!! Types of parameters 'y' and 'y' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var r = c.foo('', ''); + var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js new file mode 100644 index 0000000000000..155f4c0cd5625 --- /dev/null +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -0,0 +1,60 @@ +//// [derivedClassTransitivity3.ts] +// subclassing is not transitive when you can remove required parameters and add optional parameters + +class C { + foo(x: T, y: T) { } +} + +class D extends C { + foo(x: T) { } // ok to drop parameters +} + +class E extends D { + foo(x: T, y?: number) { } // ok to add optional parameters +} + +var c: C; +var d: D; +var e: E; +c = e; +var r = c.foo('', ''); +var r2 = e.foo('', 1); + +//// [derivedClassTransitivity3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.foo = function (x) { + }; + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + E.prototype.foo = function (x, y) { + }; + return E; +})(D); +var c; +var d; +var e; +c = e; +var r = c.foo('', ''); +var r2 = e.foo('', 1); diff --git a/tests/baselines/reference/derivedClassWithAny.errors.txt b/tests/baselines/reference/derivedClassWithAny.errors.txt new file mode 100644 index 0000000000000..ca961b5e1bb14 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithAny.errors.txt @@ -0,0 +1,76 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts (7 errors) ==== + class C { + x: number; + get X(): number { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + foo(): number { + return 1; + } + + static y: number; + static get Y(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + static bar(): number { + return 1; + } + } + + class D extends C { + x: any; + get X(): any { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + foo(): any { + return 1; + } + + static y: any; + static get Y(): any { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + static bar(): any { + return null; + } + } + + // if D is a valid class definition than E is now not safe tranisitively through C + class E extends D { + x: string; + get X(): string{ return ''; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + foo(): string { + return ''; + } + + static y: string; + static get Y(): string { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return ''; + } + static bar(): string { + return ''; + } + } + + var c: C; + var d: D; + var e: E; + + c = d; + c = e; + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var r = c.foo(); // e.foo would return string + \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt new file mode 100644 index 0000000000000..c467c5530969f --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts (13 errors) ==== + class Base { + public x: string; + public fn(): string { + return ''; + } + + public get a() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set a(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + // error, not a subtype + class Derived extends Base { + ~~~~~~~ +!!! Class 'Derived' incorrectly extends base class 'Base': +!!! Private property 'x' cannot be reimplemented. + private x: string; + private fn(): string { + return ''; + } + + private get a() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private set a(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + var r = Base.x; // ok + ~ +!!! Property 'x' does not exist on type 'typeof Base'. + var r2 = Derived.x; // error + ~ +!!! Property 'x' does not exist on type 'typeof Derived'. + + var r3 = Base.fn(); // ok + ~~ +!!! Property 'fn' does not exist on type 'typeof Base'. + var r4 = Derived.fn(); // error + ~~ +!!! Property 'fn' does not exist on type 'typeof Derived'. + + var r5 = Base.a; // ok + ~ +!!! Property 'a' does not exist on type 'typeof Base'. + Base.a = 2; // ok + ~ +!!! Property 'a' does not exist on type 'typeof Base'. + + var r6 = Derived.a; // error + ~ +!!! Property 'a' does not exist on type 'typeof Derived'. + Derived.a = 2; // error + ~ +!!! Property 'a' does not exist on type 'typeof Derived'. \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt new file mode 100644 index 0000000000000..9d5ee12954177 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts (9 errors) ==== + class Base { + public static x: string; + public static fn(): string { + return ''; + } + + public static get a() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public static set a(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + // BUG 847404 + // should be error + class Derived extends Base { + ~~~~~~~ +!!! Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': +!!! Private property 'x' cannot be reimplemented. + private static x: string; + private static fn(): string { + return ''; + } + + private static get a() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static set a(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + var r = Base.x; // ok + var r2 = Derived.x; // error + ~~~~~~~~~ +!!! Property 'Derived.x' is inaccessible. + + var r3 = Base.fn(); // ok + var r4 = Derived.fn(); // error + ~~~~~~~~~~ +!!! Property 'Derived.fn' is inaccessible. + + var r5 = Base.a; // ok + Base.a = 2; // ok + + var r6 = Derived.a; // error + ~~~~~~~~~ +!!! Property 'Derived.a' is inaccessible. + Derived.a = 2; // error + ~~~~~~~~~ +!!! Property 'Derived.a' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt new file mode 100644 index 0000000000000..2d453788701c2 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor.ts (2 errors) ==== + class Base { + a = 1; + constructor(x: number) { this.a = x; } + } + + class Derived extends Base { + x = 1 + y = 'hello'; + } + + var r = new Derived(); // error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2 = new Derived(1); + + class Base2 { + a: T; + constructor(x: T) { this.a = x; } + } + + class D extends Base2 { + x = 2 + y: T = null; + } + + var d = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D(new Date()); // ok \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js new file mode 100644 index 0000000000000..5b9068256a953 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -0,0 +1,69 @@ +//// [derivedClassWithoutExplicitConstructor.ts] +class Base { + a = 1; + constructor(x: number) { this.a = x; } +} + +class Derived extends Base { + x = 1 + y = 'hello'; +} + +var r = new Derived(); // error +var r2 = new Derived(1); + +class Base2 { + a: T; + constructor(x: T) { this.a = x; } +} + +class D extends Base2 { + x = 2 + y: T = null; +} + +var d = new D(); // error +var d2 = new D(new Date()); // ok + +//// [derivedClassWithoutExplicitConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(x) { + this.a = 1; + this.a = x; + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + this.x = 1; + this.y = 'hello'; + } + return Derived; +})(Base); +var r = new Derived(); +var r2 = new Derived(1); +var Base2 = (function () { + function Base2(x) { + this.a = x; + } + return Base2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + this.x = 2; + this.y = null; + } + return D; +})(Base2); +var d = new D(); +var d2 = new D(new Date()); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt new file mode 100644 index 0000000000000..62dc521d94a74 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor2.ts (2 errors) ==== + class Base { + a = 1; + constructor(x: number, y?: number, z?: number); + constructor(x: number, y?: number); + constructor(x: number) { this.a = x; } + } + + class Derived extends Base { + x = 1 + y = 'hello'; + } + + var r = new Derived(); // error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2 = new Derived(1); + var r3 = new Derived(1, 2); + var r4 = new Derived(1, 2, 3); + + class Base2 { + a: T; + constructor(x: T, y?: T, z?: T); + constructor(x: T, y?: T); + constructor(x: T) { this.a = x; } + } + + class D extends Base2 { + x = 2 + y: T = null; + } + + var d = new D(); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D(new Date()); // ok + var d3 = new D(new Date(), new Date()); + var d4 = new D(new Date(), new Date(), new Date()); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js new file mode 100644 index 0000000000000..06ca55acb3e4a --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -0,0 +1,81 @@ +//// [derivedClassWithoutExplicitConstructor2.ts] +class Base { + a = 1; + constructor(x: number, y?: number, z?: number); + constructor(x: number, y?: number); + constructor(x: number) { this.a = x; } +} + +class Derived extends Base { + x = 1 + y = 'hello'; +} + +var r = new Derived(); // error +var r2 = new Derived(1); +var r3 = new Derived(1, 2); +var r4 = new Derived(1, 2, 3); + +class Base2 { + a: T; + constructor(x: T, y?: T, z?: T); + constructor(x: T, y?: T); + constructor(x: T) { this.a = x; } +} + +class D extends Base2 { + x = 2 + y: T = null; +} + +var d = new D(); // error +var d2 = new D(new Date()); // ok +var d3 = new D(new Date(), new Date()); +var d4 = new D(new Date(), new Date(), new Date()); + +//// [derivedClassWithoutExplicitConstructor2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(x) { + this.a = 1; + this.a = x; + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + this.x = 1; + this.y = 'hello'; + } + return Derived; +})(Base); +var r = new Derived(); +var r2 = new Derived(1); +var r3 = new Derived(1, 2); +var r4 = new Derived(1, 2, 3); +var Base2 = (function () { + function Base2(x) { + this.a = x; + } + return Base2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + this.x = 2; + this.y = null; + } + return D; +})(Base2); +var d = new D(); +var d2 = new D(new Date()); +var d3 = new D(new Date(), new Date()); +var d4 = new D(new Date(), new Date(), new Date()); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt new file mode 100644 index 0000000000000..5e524399caa84 --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/classes/constructorDeclarations/automaticConstructors/derivedClassWithoutExplicitConstructor3.ts (4 errors) ==== + // automatic constructors with a class hieararchy of depth > 2 + + class Base { + a = 1; + constructor(x: number) { this.a = x; } + } + + class Derived extends Base { + b = ''; + constructor(y: string, z: string) { + super(2); + this.b = y; + } + } + + class Derived2 extends Derived { + x = 1 + y = 'hello'; + } + + var r = new Derived(); // error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2 = new Derived2(1); // error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r3 = new Derived('', ''); + + class Base2 { + a: T; + constructor(x: T) { this.a = x; } + } + + class D extends Base { + b: T = null; + constructor(y: T, z: T) { + super(2); + this.b = y; + } + } + + + class D2 extends D { + x = 2 + y: T = null; + } + + var d = new D2(); // error + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new D2(new Date()); // error + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d3 = new D2(new Date(), new Date()); // ok \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js new file mode 100644 index 0000000000000..798ee7445bd2a --- /dev/null +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -0,0 +1,110 @@ +//// [derivedClassWithoutExplicitConstructor3.ts] +// automatic constructors with a class hieararchy of depth > 2 + +class Base { + a = 1; + constructor(x: number) { this.a = x; } +} + +class Derived extends Base { + b = ''; + constructor(y: string, z: string) { + super(2); + this.b = y; + } +} + +class Derived2 extends Derived { + x = 1 + y = 'hello'; +} + +var r = new Derived(); // error +var r2 = new Derived2(1); // error +var r3 = new Derived('', ''); + +class Base2 { + a: T; + constructor(x: T) { this.a = x; } +} + +class D extends Base { + b: T = null; + constructor(y: T, z: T) { + super(2); + this.b = y; + } +} + + +class D2 extends D { + x = 2 + y: T = null; +} + +var d = new D2(); // error +var d2 = new D2(new Date()); // error +var d3 = new D2(new Date(), new Date()); // ok + +//// [derivedClassWithoutExplicitConstructor3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(x) { + this.a = 1; + this.a = x; + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived(y, z) { + _super.call(this, 2); + this.b = ''; + this.b = y; + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + this.x = 1; + this.y = 'hello'; + } + return Derived2; +})(Derived); +var r = new Derived(); +var r2 = new Derived2(1); +var r3 = new Derived('', ''); +var Base2 = (function () { + function Base2(x) { + this.a = x; + } + return Base2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D(y, z) { + _super.call(this, 2); + this.b = null; + this.b = y; + } + return D; +})(Base); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + this.x = 2; + this.y = null; + } + return D2; +})(D); +var d = new D2(); +var d2 = new D2(new Date()); +var d3 = new D2(new Date(), new Date()); diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js new file mode 100644 index 0000000000000..a0d6de6a81994 --- /dev/null +++ b/tests/baselines/reference/derivedClasses.js @@ -0,0 +1,84 @@ +//// [derivedClasses.ts] +class Red extends Color { + public shade() { + var getHue = () => { return this.hue(); }; + return getHue() + " red"; + } +} + +class Color { + public shade() { return "some shade"; } + public hue() { return "some hue"; } +} + +class Blue extends Color { + + public shade() { + var getHue = () => { return this.hue(); }; + return getHue() + " blue"; + } +} + +var r = new Red(); +var b = new Blue(); + +r.shade(); +r.hue(); +b.shade(); +b.hue(); + + + + +//// [derivedClasses.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Red = (function (_super) { + __extends(Red, _super); + function Red() { + _super.apply(this, arguments); + } + Red.prototype.shade = function () { + var _this = this; + var getHue = function () { + return _this.hue(); + }; + return getHue() + " red"; + }; + return Red; +})(Color); +var Color = (function () { + function Color() { + } + Color.prototype.shade = function () { + return "some shade"; + }; + Color.prototype.hue = function () { + return "some hue"; + }; + return Color; +})(); +var Blue = (function (_super) { + __extends(Blue, _super); + function Blue() { + _super.apply(this, arguments); + } + Blue.prototype.shade = function () { + var _this = this; + var getHue = function () { + return _this.hue(); + }; + return getHue() + " blue"; + }; + return Blue; +})(Color); +var r = new Red(); +var b = new Blue(); +r.shade(); +r.hue(); +b.shade(); +b.hue(); diff --git a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt new file mode 100644 index 0000000000000..8464f8b3d0bbf --- /dev/null +++ b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt @@ -0,0 +1,59 @@ +==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts (7 errors) ==== + class C { + x: T; + get X(): T { return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + foo(): T { + return null; + } + } + + class D extends C { + x: any; + get X(): any { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + foo(): any { + return 1; + } + + static y: any; + static get Y(): any { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + static bar(): any { + return null; + } + } + + // if D is a valid class definition than E is now not safe tranisitively through C + class E extends D { + x: T; + get X(): T { return ''; } // error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! Type 'string' is not assignable to type 'T'. + foo(): T { + return ''; // error + ~~ +!!! Type 'string' is not assignable to type 'T'. + } + } + + var c: C; + var d: D; + var e: E; + + c = d; + c = e; + ~ +!!! Type 'E' is not assignable to type 'C': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt new file mode 100644 index 0000000000000..cdde532333b64 --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/derivedInterfaceCallSignature.ts (1 errors) ==== + interface D3SvgPath { + (data: any, index?: number): string; + + x(): (data: any, index?: number) => number; + y(): (data: any, index?: number) => number; + interpolate(): string; + tension(): number; + defined(): (data: any, index?: number) => boolean; + } + + interface D3SvgArea extends D3SvgPath { + ~~~~~~~~~ +!!! Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': +!!! Types of property 'x' are incompatible: +!!! Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. + x(x: (data: any, index?: number) => number): D3SvgArea; + y(y: (data: any, index?: number) => number): D3SvgArea; + y0(): (data: any, index?: number) => number; + y0(y: number): D3SvgArea; + y0(y: (data: any, index?: number) => number): D3SvgArea; + y1(): (data: any, index?: number) => number; + y1(y: number): D3SvgArea; + y1(y: (data: any, index?: number) => number): D3SvgArea; + + interpolate(interpolator: string): D3SvgArea; + tension(tension: number): D3SvgArea; + defined(defined: (data: any, index?: number) => boolean): D3SvgArea; + } + + var area: D3SvgArea; + area.interpolate('two')('one'); \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.js b/tests/baselines/reference/derivedInterfaceCallSignature.js new file mode 100644 index 0000000000000..2953883dbc916 --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceCallSignature.js @@ -0,0 +1,32 @@ +//// [derivedInterfaceCallSignature.ts] +interface D3SvgPath { + (data: any, index?: number): string; + + x(): (data: any, index?: number) => number; + y(): (data: any, index?: number) => number; + interpolate(): string; + tension(): number; + defined(): (data: any, index?: number) => boolean; +} + +interface D3SvgArea extends D3SvgPath { + x(x: (data: any, index?: number) => number): D3SvgArea; + y(y: (data: any, index?: number) => number): D3SvgArea; + y0(): (data: any, index?: number) => number; + y0(y: number): D3SvgArea; + y0(y: (data: any, index?: number) => number): D3SvgArea; + y1(): (data: any, index?: number) => number; + y1(y: number): D3SvgArea; + y1(y: (data: any, index?: number) => number): D3SvgArea; + + interpolate(interpolator: string): D3SvgArea; + tension(tension: number): D3SvgArea; + defined(defined: (data: any, index?: number) => boolean): D3SvgArea; +} + +var area: D3SvgArea; +area.interpolate('two')('one'); + +//// [derivedInterfaceCallSignature.js] +var area; +area.interpolate('two')('one'); diff --git a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt new file mode 100644 index 0000000000000..32e58ff78c4fb --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (8 errors) ==== + interface Base { + [x: number]: { x: number; y: number; }; + [x: string]: { x: number; } + } + + interface Derived extends Base { + 1: { y: number } // error + ~~~~~~~~~~~~~~~~ +!!! Property '1' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. + ~~~~~~~~~~~~~~~~ +!!! Property '1' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. + } + + interface Derived2 extends Base { + '1': { y: number } // error + ~~~~~~~~~~~~~~~~~~ +!!! Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. + ~~~~~~~~~~~~~~~~~~ +!!! Property ''1'' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. + } + + interface Derived3 extends Base { + foo: { y: number } // error + ~~~~~~~~~~~~~~~~~~ +!!! Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'. + } + + interface Derived4 extends Base { + foo(): { x: number } // error + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'. + } + + // satisifies string indexer but not numeric indexer + interface Derived5 extends Base { + 1: { x: number } // error + ~~~~~~~~~~~~~~~~ +!!! Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'. + } + + interface Derived5 extends Base { + '1': { x: number } // error + ~~~ +!!! Duplicate identifier ''1''. + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.js b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.js new file mode 100644 index 0000000000000..cf0326bd07803 --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceIncompatibleWithBaseIndexer.js @@ -0,0 +1,32 @@ +//// [derivedInterfaceIncompatibleWithBaseIndexer.ts] +interface Base { + [x: number]: { x: number; y: number; }; + [x: string]: { x: number; } +} + +interface Derived extends Base { + 1: { y: number } // error +} + +interface Derived2 extends Base { + '1': { y: number } // error +} + +interface Derived3 extends Base { + foo: { y: number } // error +} + +interface Derived4 extends Base { + foo(): { x: number } // error +} + +// satisifies string indexer but not numeric indexer +interface Derived5 extends Base { + 1: { x: number } // error +} + +interface Derived5 extends Base { + '1': { x: number } // error +} + +//// [derivedInterfaceIncompatibleWithBaseIndexer.js] diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js new file mode 100644 index 0000000000000..7873bf11c3ec1 --- /dev/null +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -0,0 +1,49 @@ +//// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts] +class Base { + foo(x: { a: number }): { a: number } { + return null; + } +} + +class Derived extends Base { + foo(x: { a: number; b: number }): { a: number; b: number } { + return null; + } + + bar() { + var r = super.foo({ a: 1 }); // { a: number } + var r2 = super.foo({ a: 1, b: 2 }); // { a: number } + var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } + } +} + +//// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function (x) { + return null; + }; + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + Derived.prototype.foo = function (x) { + return null; + }; + Derived.prototype.bar = function () { + var r = _super.prototype.foo.call(this, { a: 1 }); + var r2 = _super.prototype.foo.call(this, { a: 1, b: 2 }); + var r3 = this.foo({ a: 1, b: 2 }); + }; + return Derived; +})(Base); diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt new file mode 100644 index 0000000000000..cf63d1a719882 --- /dev/null +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/derivedTypeCallingBaseImplWithOptionalParams.ts (1 errors) ==== + interface MyInterface { + myMethod(...myList: any[]); + } + class MyClass implements MyInterface { + myMethod(myList: any[]) { // valid + } + } + + var x: MyInterface = new MyClass(); + x.myMethod(); // should be valid, but MyClass has no implementation to handle it. + + var y: MyClass = new MyClass(); + y.myMethod(); // error + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js new file mode 100644 index 0000000000000..fc82f7f287292 --- /dev/null +++ b/tests/baselines/reference/derivedTypeCallingBaseImplWithOptionalParams.js @@ -0,0 +1,27 @@ +//// [derivedTypeCallingBaseImplWithOptionalParams.ts] +interface MyInterface { + myMethod(...myList: any[]); +} +class MyClass implements MyInterface { + myMethod(myList: any[]) { // valid + } +} + +var x: MyInterface = new MyClass(); +x.myMethod(); // should be valid, but MyClass has no implementation to handle it. + +var y: MyClass = new MyClass(); +y.myMethod(); // error + +//// [derivedTypeCallingBaseImplWithOptionalParams.js] +var MyClass = (function () { + function MyClass() { + } + MyClass.prototype.myMethod = function (myList) { + }; + return MyClass; +})(); +var x = new MyClass(); +x.myMethod(); +var y = new MyClass(); +y.myMethod(); diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js new file mode 100644 index 0000000000000..50c8aba1ef8fc --- /dev/null +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -0,0 +1,52 @@ +//// [derivedTypeDoesNotRequireExtendsClause.ts] +class Base { + foo: string; +} + +class Derived { + foo: string; + bar: number; +} + +class Derived2 extends Base { + bar: string; +} + +var b: Base; +var d1: Derived; +var d2: Derived2; +b = d1; +b = d2; + +var r: Base[] = [d1, d2]; + +//// [derivedTypeDoesNotRequireExtendsClause.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function () { + function Derived() { + } + return Derived; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +var b; +var d1; +var d2; +b = d1; +b = d2; +var r = [d1, d2]; diff --git a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt new file mode 100644 index 0000000000000..9247d98d03d20 --- /dev/null +++ b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/derivedTypeIncompatibleSignatures.ts (2 errors) ==== + interface A { + (a: string): string; + } + + interface B extends A { + (a: string): number; // Number is not a subtype of string. Should error. + } + + interface C { + new (a: string): string; + } + + interface D extends C { + new (a: string): number; // Number is not a subtype of string. Should error. + } + + interface E { + [a: string]: string; + } + + interface F extends E { + ~ +!!! Interface 'F' incorrectly extends interface 'E': +!!! Index signatures are incompatible: +!!! Type 'number' is not assignable to type 'string'. + [a: string]: number; // Number is not a subtype of string. Should error. + } + + interface G { + [a: number]: string; + } + + interface H extends G { + ~ +!!! Interface 'H' incorrectly extends interface 'G': +!!! Index signatures are incompatible: +!!! Type 'number' is not assignable to type 'string'. + [a: number]: number; // Should error for the same reason + } \ No newline at end of file diff --git a/tests/baselines/reference/derivedTypeIncompatibleSignatures.js b/tests/baselines/reference/derivedTypeIncompatibleSignatures.js new file mode 100644 index 0000000000000..fc495db2849de --- /dev/null +++ b/tests/baselines/reference/derivedTypeIncompatibleSignatures.js @@ -0,0 +1,34 @@ +//// [derivedTypeIncompatibleSignatures.ts] +interface A { + (a: string): string; +} + +interface B extends A { + (a: string): number; // Number is not a subtype of string. Should error. +} + +interface C { + new (a: string): string; +} + +interface D extends C { + new (a: string): number; // Number is not a subtype of string. Should error. +} + +interface E { + [a: string]: string; +} + +interface F extends E { + [a: string]: number; // Number is not a subtype of string. Should error. +} + +interface G { + [a: number]: string; +} + +interface H extends G { + [a: number]: number; // Should error for the same reason +} + +//// [derivedTypeIncompatibleSignatures.js] diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt new file mode 100644 index 0000000000000..72b6e60b05f49 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/detachedCommentAtStartOfFunctionBody1.ts (1 errors) ==== + class TestFile { + foo(message: string): () => string { + /// Test summary + /// + /// + return () => message + this.name; + ~~~~ +!!! Property 'name' does not exist on type 'TestFile'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js new file mode 100644 index 0000000000000..19838179d5bf3 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody1.js @@ -0,0 +1,20 @@ +//// [detachedCommentAtStartOfFunctionBody1.ts] +class TestFile { + foo(message: string): () => string { + /// Test summary + /// + /// + return () => message + this.name; + } +} + +//// [detachedCommentAtStartOfFunctionBody1.js] +var TestFile = (function () { + function TestFile() { + } + TestFile.prototype.foo = function (message) { + var _this = this; + return function () { return message + _this.name; }; + }; + return TestFile; +})(); diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt new file mode 100644 index 0000000000000..1afac3232e3e8 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/detachedCommentAtStartOfFunctionBody2.ts (1 errors) ==== + class TestFile { + foo(message: string): () => string { + /// Test summary + /// + /// + + return () => message + this.name; + ~~~~ +!!! Property 'name' does not exist on type 'TestFile'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js new file mode 100644 index 0000000000000..7a640e6fd46d6 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfFunctionBody2.js @@ -0,0 +1,21 @@ +//// [detachedCommentAtStartOfFunctionBody2.ts] +class TestFile { + foo(message: string): () => string { + /// Test summary + /// + /// + + return () => message + this.name; + } +} + +//// [detachedCommentAtStartOfFunctionBody2.js] +var TestFile = (function () { + function TestFile() { + } + TestFile.prototype.foo = function (message) { + var _this = this; + return function () { return message + _this.name; }; + }; + return TestFile; +})(); diff --git a/tests/baselines/reference/directReferenceToNull.errors.txt b/tests/baselines/reference/directReferenceToNull.errors.txt new file mode 100644 index 0000000000000..23a280fc2edad --- /dev/null +++ b/tests/baselines/reference/directReferenceToNull.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/types/primitives/null/directReferenceToNull.ts (1 errors) ==== + var x: Null; + ~~~~ +!!! Cannot find name 'Null'. \ No newline at end of file diff --git a/tests/baselines/reference/directReferenceToNull.js b/tests/baselines/reference/directReferenceToNull.js new file mode 100644 index 0000000000000..9a4f6b4e2da8d --- /dev/null +++ b/tests/baselines/reference/directReferenceToNull.js @@ -0,0 +1,5 @@ +//// [directReferenceToNull.ts] +var x: Null; + +//// [directReferenceToNull.js] +var x; diff --git a/tests/baselines/reference/directReferenceToUndefined.errors.txt b/tests/baselines/reference/directReferenceToUndefined.errors.txt new file mode 100644 index 0000000000000..1534b27e02cfb --- /dev/null +++ b/tests/baselines/reference/directReferenceToUndefined.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/conformance/types/primitives/undefined/directReferenceToUndefined.ts (1 errors) ==== + var x: Undefined; + ~~~~~~~~~ +!!! Cannot find name 'Undefined'. + var y = undefined; \ No newline at end of file diff --git a/tests/baselines/reference/directReferenceToUndefined.js b/tests/baselines/reference/directReferenceToUndefined.js new file mode 100644 index 0000000000000..59f4a3202aea0 --- /dev/null +++ b/tests/baselines/reference/directReferenceToUndefined.js @@ -0,0 +1,7 @@ +//// [directReferenceToUndefined.ts] +var x: Undefined; +var y = undefined; + +//// [directReferenceToUndefined.js] +var x; +var y = undefined; diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js new file mode 100644 index 0000000000000..07fa97fae79d7 --- /dev/null +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js @@ -0,0 +1,15 @@ +//// [doNotWidenAtObjectLiteralPropertyAssignment.ts] +interface ITestEventInterval { + begin: number; +} + +interface IIntervalTreeNode { + interval: ITestEventInterval; + children?: IIntervalTreeNode[]; +} + +var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} + + +//// [doNotWidenAtObjectLiteralPropertyAssignment.js] +var test = [{ interval: { begin: 0 }, children: null }]; diff --git a/tests/baselines/reference/doWhileBreakStatements.js b/tests/baselines/reference/doWhileBreakStatements.js new file mode 100644 index 0000000000000..9162c629898aa --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.js @@ -0,0 +1,72 @@ +//// [doWhileBreakStatements.ts] +do { + break; +} while(true) + +ONE: +do { + break ONE; +} +while (true) + +TWO: +THREE: +do { + break THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + break FOUR; + }while (true) +}while (true) + +do { + SIX: + do break SIX; while(true) +}while (true) + +SEVEN: +do do do break SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } + break EIGHT; +}while(true) + + +//// [doWhileBreakStatements.js] +do { + break; +} while (true); +ONE: do { + break ONE; +} while (true); +TWO: THREE: do { + break THREE; +} while (true); +FOUR: do { + FIVE: do { + break FOUR; + } while (true); +} while (true); +do { + SIX: do + break SIX; + while (true); +} while (true); +SEVEN: do + do + do + break SEVEN; + while (true); + while (true); +while (true); +EIGHT: do { + var fn = function () { + }; + break EIGHT; +} while (true); diff --git a/tests/baselines/reference/doWhileContinueStatements.js b/tests/baselines/reference/doWhileContinueStatements.js new file mode 100644 index 0000000000000..a39495e162eb4 --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.js @@ -0,0 +1,72 @@ +//// [doWhileContinueStatements.ts] +do { + continue; +} while(true) + +ONE: +do { + continue ONE; +} +while (true) + +TWO: +THREE: +do { + continue THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + continue FOUR; + }while (true) +}while (true) + +do { + SIX: + do continue SIX; while(true) +}while (true) + +SEVEN: +do do do continue SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } + continue EIGHT; +}while(true) + + +//// [doWhileContinueStatements.js] +do { + continue; +} while (true); +ONE: do { + continue ONE; +} while (true); +TWO: THREE: do { + continue THREE; +} while (true); +FOUR: do { + FIVE: do { + continue FOUR; + } while (true); +} while (true); +do { + SIX: do + continue SIX; + while (true); +} while (true); +SEVEN: do + do + do + continue SEVEN; + while (true); + while (true); +while (true); +EIGHT: do { + var fn = function () { + }; + continue EIGHT; +} while (true); diff --git a/tests/baselines/reference/doWhileLoop.js b/tests/baselines/reference/doWhileLoop.js new file mode 100644 index 0000000000000..0c1abd7aed91b --- /dev/null +++ b/tests/baselines/reference/doWhileLoop.js @@ -0,0 +1,8 @@ +//// [doWhileLoop.ts] +do { } while (false); +var n; + +//// [doWhileLoop.js] +do { +} while (false); +var n; diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt new file mode 100644 index 0000000000000..29171ebbcb488 --- /dev/null +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== + var f: { + ~~~~ + x: number; + ~~~~~~~~~~~~~~ + <- + ~ +!!! Type parameter list cannot be empty. + ~ +!!! '(' expected. + ~ +!!! Type parameter declaration expected. + ~~~~~~ +!!! Type 'number' is not assignable to type '{ <>(): any; x: number; }': +!!! Property 'x' is missing in type 'Number'. + }; + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/dottedModuleName.errors.txt b/tests/baselines/reference/dottedModuleName.errors.txt new file mode 100644 index 0000000000000..5a207c96bd08b --- /dev/null +++ b/tests/baselines/reference/dottedModuleName.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/dottedModuleName.ts (3 errors) ==== + module M { + export module N { + export function f(x:number)=>2*x; + ~~ +!!! Block or ';' expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~ +!!! Cannot find name 'x'. + export module X.Y.Z { + export var v2=f(v); + } + } + } + + + + module M.N { + export module X { + export module Y.Z { + export var v=f(10); + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/dottedModuleName2.js b/tests/baselines/reference/dottedModuleName2.js new file mode 100644 index 0000000000000..5103eceaf0056 --- /dev/null +++ b/tests/baselines/reference/dottedModuleName2.js @@ -0,0 +1,72 @@ +//// [dottedModuleName2.ts] +module A.B { + + export var x = 1; + +} + + + +module AA { export module B { + + export var x = 1; + +} } + + + +var tmpOK = AA.B.x; + +var tmpError = A.B.x; + + +module A.B.C + +{ + + export var x = 1; + +} + + + +module M + +{ + + import X1 = A; + + import X2 = A.B; + + import X3 = A.B.C; + +} + + +//// [dottedModuleName2.js] +var A; +(function (A) { + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var AA; +(function (AA) { + (function (B) { + B.x = 1; + })(AA.B || (AA.B = {})); + var B = AA.B; +})(AA || (AA = {})); +var tmpOK = AA.B.x; +var tmpError = A.B.x; +var A; +(function (A) { + (function (B) { + (function (C) { + C.x = 1; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); diff --git a/tests/baselines/reference/dottedSymbolResolution1.js b/tests/baselines/reference/dottedSymbolResolution1.js new file mode 100644 index 0000000000000..369d9336d9f97 --- /dev/null +++ b/tests/baselines/reference/dottedSymbolResolution1.js @@ -0,0 +1,44 @@ +//// [dottedSymbolResolution1.ts] +interface JQuery { + find(selector: string): JQuery; +} + +interface JQueryStatic { + + (selector: string): JQuery; + (object: JQuery): JQuery; +} + +class Base { foo() { } } + +function each(collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; +function each(collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; +function each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any { + return null; +} + +function _setBarAndText(): void { + var x: JQuery, $: JQueryStatic + each(x.find(" "), function () { + var $this: JQuery = $(''), + thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here + } ); +} + +//// [dottedSymbolResolution1.js] +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +function each(collection, callback) { + return null; +} +function _setBarAndText() { + var x, $; + each(x.find(" "), function () { + var $this = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); + }); +} diff --git a/tests/baselines/reference/duplicateAnonymousInners1.js b/tests/baselines/reference/duplicateAnonymousInners1.js new file mode 100644 index 0000000000000..58b6aa476c93b --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousInners1.js @@ -0,0 +1,50 @@ +//// [duplicateAnonymousInners1.ts] +module Foo { + + class Helper { + + } + + class Inner {} + // Inner should show up in intellisense + + export var Outer=0; +} + + +module Foo { + + // Should not be an error + class Helper { + + } + + // Inner should not show up in intellisense + // Outer should show up in intellisense + +} + + +//// [duplicateAnonymousInners1.js] +var Foo; +(function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); + var Inner = (function () { + function Inner() { + } + return Inner; + })(); + Foo.Outer = 0; +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.js b/tests/baselines/reference/duplicateAnonymousModuleClasses.js new file mode 100644 index 0000000000000..0d973b1ed3538 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.js @@ -0,0 +1,110 @@ +//// [duplicateAnonymousModuleClasses.ts] +module F { + + class Helper { + + } + +} + + +module F { + + // Should not be an error + class Helper { + + } + +} + +module Foo { + + class Helper { + + } + +} + + +module Foo { + + // Should not be an error + class Helper { + + } + +} + +module Gar { + module Foo { + + class Helper { + + } + + } + + + module Foo { + + // Should not be an error + class Helper { + + } + + } +} + + +//// [duplicateAnonymousModuleClasses.js] +var F; +(function (F) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); +})(F || (F = {})); +var F; +(function (F) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); +})(F || (F = {})); +var Foo; +(function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); +})(Foo || (Foo = {})); +var Gar; +(function (Gar) { + var Foo; + (function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); + })(Foo || (Foo = {})); + var Foo; + (function (Foo) { + var Helper = (function () { + function Helper() { + } + return Helper; + })(); + })(Foo || (Foo = {})); +})(Gar || (Gar = {})); diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt new file mode 100644 index 0000000000000..7822af473ecb0 --- /dev/null +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -0,0 +1,82 @@ +==== tests/cases/compiler/duplicateClassElements.ts (18 errors) ==== + class a { + public a; + public a; + ~ +!!! Duplicate identifier 'a'. + public b() { + } + public b() { + ~~~~~~~~~~~~ + } + ~~~~~ +!!! Duplicate function implementation. + public x; + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + return 10; + } + set x(_x: number) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + } + + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "Hello"; + } + set y(_y: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public z() { + } + get z() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'z'. + return "Hello"; + } + set z(_y: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'z'. + } + + get x2() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 10; + } + set x2(_x: number) { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + public x2; + ~~ +!!! Duplicate identifier 'x2'. + + get z2() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "Hello"; + } + set z2(_y: string) { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + public z2() { + ~~ +!!! Duplicate identifier 'z2'. + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateConstructSignature.js b/tests/baselines/reference/duplicateConstructSignature.js new file mode 100644 index 0000000000000..97c3573eee668 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature.js @@ -0,0 +1,7 @@ +//// [duplicateConstructSignature.ts] +interface I { + (): number; + (): string; +} + +//// [duplicateConstructSignature.js] diff --git a/tests/baselines/reference/duplicateConstructSignature2.js b/tests/baselines/reference/duplicateConstructSignature2.js new file mode 100644 index 0000000000000..5474004777677 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature2.js @@ -0,0 +1,7 @@ +//// [duplicateConstructSignature2.ts] +interface I { + (x: T): number; + (x: T): string; +} + +//// [duplicateConstructSignature2.js] diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature.js b/tests/baselines/reference/duplicateConstructorOverloadSignature.js new file mode 100644 index 0000000000000..08bad59f53107 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature.js @@ -0,0 +1,13 @@ +//// [duplicateConstructorOverloadSignature.ts] +class C { + constructor(x: number); + constructor(x: number); + constructor(x: any) { } +} + +//// [duplicateConstructorOverloadSignature.js] +var C = (function () { + function C(x) { + } + return C; +})(); diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature2.js b/tests/baselines/reference/duplicateConstructorOverloadSignature2.js new file mode 100644 index 0000000000000..d739150a58823 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature2.js @@ -0,0 +1,13 @@ +//// [duplicateConstructorOverloadSignature2.ts] +class C { + constructor(x: T); + constructor(x: T); + constructor(x: any) { } +} + +//// [duplicateConstructorOverloadSignature2.js] +var C = (function () { + function C(x) { + } + return C; +})(); diff --git a/tests/baselines/reference/duplicateExportAssignments.errors.txt b/tests/baselines/reference/duplicateExportAssignments.errors.txt new file mode 100644 index 0000000000000..ebaba3630769b --- /dev/null +++ b/tests/baselines/reference/duplicateExportAssignments.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/conformance/externalModules/foo1.ts (3 errors) ==== + var x = 10; + var y = 20; + export = x; + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = y; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + +==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== + var x = 10; + class y {}; + export = x; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = y; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + +==== tests/cases/conformance/externalModules/foo3.ts (2 errors) ==== + module x { + export var x = 10; + } + class y { + y: number; + } + export = x; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = y; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + +==== tests/cases/conformance/externalModules/foo4.ts (2 errors) ==== + export = x; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + function x(){ + return 42; + } + function y(){ + return 42; + } + export = y; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + +==== tests/cases/conformance/externalModules/foo5.ts (3 errors) ==== + var x = 5; + var y = "test"; + var z = {}; + export = x; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = y; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = z; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateExportAssignments.js b/tests/baselines/reference/duplicateExportAssignments.js new file mode 100644 index 0000000000000..84ad616d7cc5c --- /dev/null +++ b/tests/baselines/reference/duplicateExportAssignments.js @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/externalModules/duplicateExportAssignments.ts] //// + +//// [foo1.ts] +var x = 10; +var y = 20; +export = x; +export = y; + +//// [foo2.ts] +var x = 10; +class y {}; +export = x; +export = y; + +//// [foo3.ts] +module x { + export var x = 10; +} +class y { + y: number; +} +export = x; +export = y; + +//// [foo4.ts] +export = x; +function x(){ + return 42; +} +function y(){ + return 42; +} +export = y; + +//// [foo5.ts] +var x = 5; +var y = "test"; +var z = {}; +export = x; +export = y; +export = z; + + +//// [foo1.js] +var x = 10; +var y = 20; +module.exports = x; +//// [foo2.js] +var x = 10; +var y = (function () { + function y() { + } + return y; +})(); +; +module.exports = x; +//// [foo3.js] +var x; +(function (x) { + x.x = 10; +})(x || (x = {})); +var y = (function () { + function y() { + } + return y; +})(); +module.exports = x; +//// [foo4.js] +function x() { + return 42; +} +function y() { + return 42; +} +module.exports = x; +//// [foo5.js] +var x = 5; +var y = "test"; +var z = {}; +module.exports = x; diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt new file mode 100644 index 0000000000000..f20e5d626eb3e --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (4 errors) ==== + var v; + try { } catch (e) { + function v() { } + ~ +!!! Duplicate identifier 'v'. + } + + function w() { } + try { } catch (e) { + var w; + ~ +!!! Duplicate identifier 'w'. + } + + try { } catch (e) { + var x; + function x() { } // error + ~ +!!! Duplicate identifier 'x'. + function e() { } // error + var p: string; + var p: number; // error + ~ +!!! Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.js b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js new file mode 100644 index 0000000000000..b961fa64df6e8 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js @@ -0,0 +1,45 @@ +//// [duplicateIdentifierInCatchBlock.ts] +var v; +try { } catch (e) { + function v() { } +} + +function w() { } +try { } catch (e) { + var w; +} + +try { } catch (e) { + var x; + function x() { } // error + function e() { } // error + var p: string; + var p: number; // error +} + +//// [duplicateIdentifierInCatchBlock.js] +var v; +try { +} +catch (e) { + function v() { + } +} +function w() { +} +try { +} +catch (e) { + var w; +} +try { +} +catch (e) { + var x; + function x() { + } + function e() { + } + var p; + var p; +} diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js new file mode 100644 index 0000000000000..d86925f1fd328 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js @@ -0,0 +1,4 @@ +//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts] + + +//// [duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.js] diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt new file mode 100644 index 0000000000000..fee03fe78075d --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt @@ -0,0 +1,59 @@ +==== tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts (3 errors) ==== + module M { + export interface I { } + } + module M { + export class I { } // error + ~ +!!! Duplicate identifier 'I'. + } + + module M { + export function f() { } + } + module M { + export class f { } // error + ~ +!!! Duplicate identifier 'f'. + } + + module M { + function g() { } + } + module M { + export class g { } // no error + } + + module M { + export class C { } + } + module M { + function C() { } // no error + } + + module M { + export var v = 3; + } + module M { + export var v = 3; // error for redeclaring var in a different parent + } + + class Foo { + static x: number; + } + + module Foo { + export var x: number; // error for redeclaring var in a different parent + ~ +!!! Duplicate identifier 'x'. + } + + module N { + export module F { + var t; + } + } + declare module N { + export function F(); // no error because function is ambient + } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js new file mode 100644 index 0000000000000..c2529b2e0375c --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js @@ -0,0 +1,131 @@ +//// [duplicateIdentifiersAcrossContainerBoundaries.ts] +module M { + export interface I { } +} +module M { + export class I { } // error +} + +module M { + export function f() { } +} +module M { + export class f { } // error +} + +module M { + function g() { } +} +module M { + export class g { } // no error +} + +module M { + export class C { } +} +module M { + function C() { } // no error +} + +module M { + export var v = 3; +} +module M { + export var v = 3; // error for redeclaring var in a different parent +} + +class Foo { + static x: number; +} + +module Foo { + export var x: number; // error for redeclaring var in a different parent +} + +module N { + export module F { + var t; + } +} +declare module N { + export function F(); // no error because function is ambient +} + + +//// [duplicateIdentifiersAcrossContainerBoundaries.js] +var M; +(function (M) { + var I = (function () { + function I() { + } + return I; + })(); + M.I = I; +})(M || (M = {})); +var M; +(function (M) { + function f() { + } + M.f = f; +})(M || (M = {})); +var M; +(function (M) { + var f = (function () { + function f() { + } + return f; + })(); + M.f = f; +})(M || (M = {})); +var M; +(function (M) { + function g() { + } +})(M || (M = {})); +var M; +(function (M) { + var g = (function () { + function g() { + } + return g; + })(); + M.g = g; +})(M || (M = {})); +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; +})(M || (M = {})); +var M; +(function (M) { + function C() { + } +})(M || (M = {})); +var M; +(function (M) { + M.v = 3; +})(M || (M = {})); +var M; +(function (M) { + M.v = 3; +})(M || (M = {})); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Foo; +(function (Foo) { + Foo.x; +})(Foo || (Foo = {})); +var N; +(function (N) { + (function (F) { + var t; + })(N.F || (N.F = {})); + var F = N.F; +})(N || (N = {})); diff --git a/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt b/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt new file mode 100644 index 0000000000000..be2e3d0e6bbc8 --- /dev/null +++ b/tests/baselines/reference/duplicateInterfaceMembers1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/duplicateInterfaceMembers1.ts (1 errors) ==== + interface Bar { + x: number; + x: number; + ~ +!!! Duplicate identifier 'x'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateInterfaceMembers1.js b/tests/baselines/reference/duplicateInterfaceMembers1.js new file mode 100644 index 0000000000000..d905dff63a772 --- /dev/null +++ b/tests/baselines/reference/duplicateInterfaceMembers1.js @@ -0,0 +1,8 @@ +//// [duplicateInterfaceMembers1.ts] +interface Bar { + x: number; + x: number; +} + + +//// [duplicateInterfaceMembers1.js] diff --git a/tests/baselines/reference/duplicateLabel1.js b/tests/baselines/reference/duplicateLabel1.js new file mode 100644 index 0000000000000..e7976895c94d8 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel1.js @@ -0,0 +1,9 @@ +//// [duplicateLabel1.ts] +target: +target: +while (true) { +} + +//// [duplicateLabel1.js] +target: target: while (true) { +} diff --git a/tests/baselines/reference/duplicateLabel2.js b/tests/baselines/reference/duplicateLabel2.js new file mode 100644 index 0000000000000..9ee9671d59de8 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel2.js @@ -0,0 +1,13 @@ +//// [duplicateLabel2.ts] +target: +while (true) { + target: + while (true) { + } +} + +//// [duplicateLabel2.js] +target: while (true) { + target: while (true) { + } +} diff --git a/tests/baselines/reference/duplicateLabel3.js b/tests/baselines/reference/duplicateLabel3.js new file mode 100644 index 0000000000000..37e9619e8f6bb --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.js @@ -0,0 +1,17 @@ +//// [duplicateLabel3.ts] +target: +while (true) { + function f() { + target: + while (true) { + } + } +} + +//// [duplicateLabel3.js] +target: while (true) { + function f() { + target: while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel4.js b/tests/baselines/reference/duplicateLabel4.js new file mode 100644 index 0000000000000..22d072d38d730 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.js @@ -0,0 +1,14 @@ +//// [duplicateLabel4.ts] +target: +while (true) { +} + +target: +while (true) { +} + +//// [duplicateLabel4.js] +target: while (true) { +} +target: while (true) { +} diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt new file mode 100644 index 0000000000000..3bddf320db11e --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -0,0 +1,346 @@ +==== tests/cases/compiler/duplicateLocalVariable1.ts (1 errors) ==== + + //import FileManager = require('filemanager'); + //import App = require('app'); + + declare var FileManager: any; + declare var App: any; + + var TestFileDir = ".\\TempTestFiles"; + + export class TestCase { + constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { + } + } + export class TestRunner { + private tests: TestCase[] = []; + + static arrayCompare(arg1: any[], arg2: any[]): boolean { + return (arg1.every(function (val, index) { return val === arg2[index] })); + } + + public addTest(test: TestCase) { + this.tests.push(test); + } + public run() { + var success = true; + for (var test in this.tests) { + var exception = false; + var testcase = this.tests[test] + var testResult: boolean = false; + try { + testResult = testcase.test(); + } + catch (e) { + exception = true; + testResult = false; + if (typeof testcase.errorMessageRegEx === "string") { + if (testcase.errorMessageRegEx === "") { // Any error is fine + testResult = true; + } else if (e.message) { + var regex = new RegExp(testcase.errorMessageRegEx); + testResult = regex.test(e.message); + } + } + if (testResult === false) { + //console.log(e.message); + } + } + if ((testcase.errorMessageRegEx !== undefined) && !exception) { + success = false; + } else if (!testResult) { + success = false; + } + } + if (success) { + } else { + } + } + } + + export var tests: TestRunner = (function () { + var testRunner = new TestRunner(); + // First 3 are for simple harness validation + testRunner.addTest(new TestCase("Basic test", function () { return true; })); + testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); + testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); + testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); + testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); + + // File detection tests + testRunner.addTest(new TestCase("Check file exists", + function () { + return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); + })); + testRunner.addTest(new TestCase("Check file doesn't exist", + function () { + return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); + })); + + // File pattern matching tests + testRunner.addTest(new TestCase("Check text file match", + function () { + return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && + FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && + FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) + })); + testRunner.addTest(new TestCase("Check makefile match", + function () { + return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); + })); + testRunner.addTest(new TestCase("Check binary file doesn't match", + function () { + return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && + !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); + })); + + // Command-line parameter tests + testRunner.addTest(new TestCase("Check App defaults", + function () { + var app = new App.App([]); + return (app.fixLines === false && + app.recurse === true && + app.lineEndings === "CRLF" && + app.matchPattern === undefined && + app.rootDirectory === ".\\" && + app.encodings[0] === "ascii" && + app.encodings[1] === "utf8nobom"); + })); + testRunner.addTest(new TestCase("Check App params", + function () { + var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); + return (app.fixLines === true && + app.lineEndings === "LF" && + app.recurse === false && + app.matchPattern === undefined && + app.rootDirectory === "C:\\test dir" && + app.encodings[0] === "utf16be" && + app.encodings[1] === "ascii" && + app.encodings.length === 2); + })); + + // File BOM detection tests + testRunner.addTest(new TestCase("Check encoding detection no BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + return fb.bom === 'utf8' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); + return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); + return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; + })); + testRunner.addTest(new TestCase("Check encoding on 1 bytes file", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding on 0 bytes file", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + + // UTF8 encoding tests + testRunner.addTest(new TestCase("Check byte reader", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 11; i++) { + chars.push(fb.readByte()); + } + return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); + })); + + + testRunner.addTest(new TestCase("Check UTF8 decoding", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 6; i++) { + chars.push(fb.readUtf8CodePoint()); + } + return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); + })); + + testRunner.addTest(new TestCase("Check UTF8 encoding", + function () { + var fb = new FileManager.FileBuffer(20); + fb.writeUtf8Bom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + ~ +!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. + bytes.push(fb.readByte()); + } + var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; + return TestRunner.arrayCompare(bytes, expected); + })); + + // Test reading and writing files + testRunner.addTest(new TestCase("Check saving a file", + function () { + var filename = TestFileDir + "\\tmpUTF16LE.txt"; + var fb = new FileManager.FileBuffer(14); + fb.writeUtf16leBom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); + fb.save(filename); + + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00] + savedFile.index = 0; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + + testRunner.addTest(new TestCase("Check reading past buffer asserts", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var result = fb.readByte(200); + return true; + }, "read beyond buffer length")); + testRunner.addTest(new TestCase("Check writing past buffer asserts", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + fb.writeByte(5, 200); + return true; + }, "write beyond buffer length")); + + // Non-BMP unicode char tests + testRunner.addTest(new TestCase("Read non-BMP utf16 chars", + function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf16CodePoint(false)); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + + testRunner.addTest(new TestCase("Read non-BMP utf8 chars", + function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf8CodePoint()); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + + testRunner.addTest(new TestCase("Write non-BMP utf8 chars", + function () { + var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; + var fb = new FileManager.FileBuffer(15); + var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); + fb.save(filename); + + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + + testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", + function () { + var filename = TestFileDir + "\\utf8BadLeadByte.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Invalid UTF8 byte sequence at index: 4")); + + testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", + function () { + var filename = TestFileDir + "\\utf8InvalidTail.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 8")); + + testRunner.addTest(new TestCase("Test ANSI fails validation", + function () { + var filename = TestFileDir + "\\ansi.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 6")); + + testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", + function () { + var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + + testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", + function () { + var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Byte sequence starts with a trail surrogate")); + + testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", + function () { + var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + + // Count of CRs & LFs + testRunner.addTest(new TestCase("Count character occurrences", + function () { + var filename = TestFileDir + "\\charCountASCII.txt"; + var fb = new FileManager.FileBuffer(filename); + var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); + return result; + })); + + // Control characters in text + testRunner.addTest(new TestCase("Test file with control character", + function () { + var filename = TestFileDir + "\\controlChar.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Codepoint at index: 3 has control value: 8")); + + return testRunner; + })(); \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable1.js b/tests/baselines/reference/duplicateLocalVariable1.js new file mode 100644 index 0000000000000..f6c4813cecdcb --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable1.js @@ -0,0 +1,625 @@ +//// [duplicateLocalVariable1.ts] + +//import FileManager = require('filemanager'); +//import App = require('app'); + +declare var FileManager: any; +declare var App: any; + +var TestFileDir = ".\\TempTestFiles"; + +export class TestCase { + constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { + } +} +export class TestRunner { + private tests: TestCase[] = []; + + static arrayCompare(arg1: any[], arg2: any[]): boolean { + return (arg1.every(function (val, index) { return val === arg2[index] })); + } + + public addTest(test: TestCase) { + this.tests.push(test); + } + public run() { + var success = true; + for (var test in this.tests) { + var exception = false; + var testcase = this.tests[test] + var testResult: boolean = false; + try { + testResult = testcase.test(); + } + catch (e) { + exception = true; + testResult = false; + if (typeof testcase.errorMessageRegEx === "string") { + if (testcase.errorMessageRegEx === "") { // Any error is fine + testResult = true; + } else if (e.message) { + var regex = new RegExp(testcase.errorMessageRegEx); + testResult = regex.test(e.message); + } + } + if (testResult === false) { + //console.log(e.message); + } + } + if ((testcase.errorMessageRegEx !== undefined) && !exception) { + success = false; + } else if (!testResult) { + success = false; + } + } + if (success) { + } else { + } + } +} + +export var tests: TestRunner = (function () { + var testRunner = new TestRunner(); + // First 3 are for simple harness validation + testRunner.addTest(new TestCase("Basic test", function () { return true; })); + testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false; }, "")); + testRunner.addTest(new TestCase("Test RegEx error message match", function () { throw new Error("Should also pass"); return false; }, "Should [also]+ pass")); + testRunner.addTest(new TestCase("Test array compare true", function () { return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); })); + testRunner.addTest(new TestCase("Test array compare false", function () { return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); })); + + // File detection tests + testRunner.addTest(new TestCase("Check file exists", + function () { + return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); + })); + testRunner.addTest(new TestCase("Check file doesn't exist", + function () { + return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); + })); + + // File pattern matching tests + testRunner.addTest(new TestCase("Check text file match", + function () { + return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && + FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && + FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")) + })); + testRunner.addTest(new TestCase("Check makefile match", + function () { + return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); + })); + testRunner.addTest(new TestCase("Check binary file doesn't match", + function () { + return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && + !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); + })); + + // Command-line parameter tests + testRunner.addTest(new TestCase("Check App defaults", + function () { + var app = new App.App([]); + return (app.fixLines === false && + app.recurse === true && + app.lineEndings === "CRLF" && + app.matchPattern === undefined && + app.rootDirectory === ".\\" && + app.encodings[0] === "ascii" && + app.encodings[1] === "utf8nobom"); + })); + testRunner.addTest(new TestCase("Check App params", + function () { + var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); + return (app.fixLines === true && + app.lineEndings === "LF" && + app.recurse === false && + app.matchPattern === undefined && + app.rootDirectory === "C:\\test dir" && + app.encodings[0] === "utf16be" && + app.encodings[1] === "ascii" && + app.encodings.length === 2); + })); + + // File BOM detection tests + testRunner.addTest(new TestCase("Check encoding detection no BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + return fb.bom === 'utf8' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); + return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); + return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; + })); + testRunner.addTest(new TestCase("Check encoding on 1 bytes file", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding on 0 bytes file", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + + // UTF8 encoding tests + testRunner.addTest(new TestCase("Check byte reader", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 11; i++) { + chars.push(fb.readByte()); + } + return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); + })); + + + testRunner.addTest(new TestCase("Check UTF8 decoding", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 6; i++) { + chars.push(fb.readUtf8CodePoint()); + } + return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); + })); + + testRunner.addTest(new TestCase("Check UTF8 encoding", + function () { + var fb = new FileManager.FileBuffer(20); + fb.writeUtf8Bom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + bytes.push(fb.readByte()); + } + var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; + return TestRunner.arrayCompare(bytes, expected); + })); + + // Test reading and writing files + testRunner.addTest(new TestCase("Check saving a file", + function () { + var filename = TestFileDir + "\\tmpUTF16LE.txt"; + var fb = new FileManager.FileBuffer(14); + fb.writeUtf16leBom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + chars.forEach(function (val) { fb.writeUtf16CodePoint(val, false); }); + fb.save(filename); + + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00] + savedFile.index = 0; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + + testRunner.addTest(new TestCase("Check reading past buffer asserts", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var result = fb.readByte(200); + return true; + }, "read beyond buffer length")); + testRunner.addTest(new TestCase("Check writing past buffer asserts", + function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + fb.writeByte(5, 200); + return true; + }, "write beyond buffer length")); + + // Non-BMP unicode char tests + testRunner.addTest(new TestCase("Read non-BMP utf16 chars", + function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf16CodePoint(false)); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + + testRunner.addTest(new TestCase("Read non-BMP utf8 chars", + function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf8CodePoint()); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + + testRunner.addTest(new TestCase("Write non-BMP utf8 chars", + function () { + var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; + var fb = new FileManager.FileBuffer(15); + var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + chars.forEach(function (val) { fb.writeUtf8CodePoint(val); }); + fb.save(filename); + + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + + testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", + function () { + var filename = TestFileDir + "\\utf8BadLeadByte.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Invalid UTF8 byte sequence at index: 4")); + + testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", + function () { + var filename = TestFileDir + "\\utf8InvalidTail.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 8")); + + testRunner.addTest(new TestCase("Test ANSI fails validation", + function () { + var filename = TestFileDir + "\\ansi.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 6")); + + testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", + function () { + var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + + testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", + function () { + var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Byte sequence starts with a trail surrogate")); + + testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", + function () { + var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + + // Count of CRs & LFs + testRunner.addTest(new TestCase("Count character occurrences", + function () { + var filename = TestFileDir + "\\charCountASCII.txt"; + var fb = new FileManager.FileBuffer(filename); + var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); + return result; + })); + + // Control characters in text + testRunner.addTest(new TestCase("Test file with control character", + function () { + var filename = TestFileDir + "\\controlChar.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Codepoint at index: 3 has control value: 8")); + + return testRunner; +})(); + +//// [duplicateLocalVariable1.js] +var TestFileDir = ".\\TempTestFiles"; +var TestCase = (function () { + function TestCase(name, test, errorMessageRegEx) { + this.name = name; + this.test = test; + this.errorMessageRegEx = errorMessageRegEx; + } + return TestCase; +})(); +exports.TestCase = TestCase; +var TestRunner = (function () { + function TestRunner() { + this.tests = []; + } + TestRunner.arrayCompare = function (arg1, arg2) { + return (arg1.every(function (val, index) { + return val === arg2[index]; + })); + }; + TestRunner.prototype.addTest = function (test) { + this.tests.push(test); + }; + TestRunner.prototype.run = function () { + var success = true; + for (var test in this.tests) { + var exception = false; + var testcase = this.tests[test]; + var testResult = false; + try { + testResult = testcase.test(); + } + catch (e) { + exception = true; + testResult = false; + if (typeof testcase.errorMessageRegEx === "string") { + if (testcase.errorMessageRegEx === "") { + testResult = true; + } + else if (e.message) { + var regex = new RegExp(testcase.errorMessageRegEx); + testResult = regex.test(e.message); + } + } + if (testResult === false) { + } + } + if ((testcase.errorMessageRegEx !== undefined) && !exception) { + success = false; + } + else if (!testResult) { + success = false; + } + } + if (success) { + } + else { + } + }; + return TestRunner; +})(); +exports.TestRunner = TestRunner; +exports.tests = (function () { + var testRunner = new TestRunner(); + testRunner.addTest(new TestCase("Basic test", function () { + return true; + })); + testRunner.addTest(new TestCase("Test for any error", function () { + throw new Error(); + return false; + }, "")); + testRunner.addTest(new TestCase("Test RegEx error message match", function () { + throw new Error("Should also pass"); + return false; + }, "Should [also]+ pass")); + testRunner.addTest(new TestCase("Test array compare true", function () { + return TestRunner.arrayCompare([1, 2, 3], [1, 2, 3]); + })); + testRunner.addTest(new TestCase("Test array compare false", function () { + return !TestRunner.arrayCompare([3, 2, 3], [1, 2, 3]); + })); + testRunner.addTest(new TestCase("Check file exists", function () { + return FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test.txt"); + })); + testRunner.addTest(new TestCase("Check file doesn't exist", function () { + return !FileManager.DirectoryManager.fileExists(TestFileDir + "\\Test2.txt"); + })); + testRunner.addTest(new TestCase("Check text file match", function () { + return (FileManager.FileBuffer.isTextFile("C:\\somedir\\readme.txt") && FileManager.FileBuffer.isTextFile("C:\\spaces path\\myapp.str") && FileManager.FileBuffer.isTextFile("C:\\somedir\\code.js")); + })); + testRunner.addTest(new TestCase("Check makefile match", function () { + return FileManager.FileBuffer.isTextFile("C:\\some dir\\makefile"); + })); + testRunner.addTest(new TestCase("Check binary file doesn't match", function () { + return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") && !FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll")); + })); + testRunner.addTest(new TestCase("Check App defaults", function () { + var app = new App.App([]); + return (app.fixLines === false && app.recurse === true && app.lineEndings === "CRLF" && app.matchPattern === undefined && app.rootDirectory === ".\\" && app.encodings[0] === "ascii" && app.encodings[1] === "utf8nobom"); + })); + testRunner.addTest(new TestCase("Check App params", function () { + var app = new App.App(["-dir=C:\\test dir", "-lineEndings=LF", "-encodings=utf16be,ascii", "-recurse=false", "-fixlines"]); + return (app.fixLines === true && app.lineEndings === "LF" && app.recurse === false && app.matchPattern === undefined && app.rootDirectory === "C:\\test dir" && app.encodings[0] === "utf16be" && app.encodings[1] === "ascii" && app.encodings.length === 2); + })); + testRunner.addTest(new TestCase("Check encoding detection no BOM", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\noBOM.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF8 BOM", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + return fb.bom === 'utf8' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16be BOM", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16BE.txt"); + return fb.bom === 'utf16be' && fb.encoding === 'utf16be'; + })); + testRunner.addTest(new TestCase("Check encoding detection UTF16le BOM", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF16LE.txt"); + return fb.bom === 'utf16le' && fb.encoding === 'utf16le'; + })); + testRunner.addTest(new TestCase("Check encoding on 1 bytes file", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\1bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check encoding on 0 bytes file", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\0bytefile.txt"); + return fb.bom === 'none' && fb.encoding === 'utf8'; + })); + testRunner.addTest(new TestCase("Check byte reader", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 11; i++) { + chars.push(fb.readByte()); + } + return TestRunner.arrayCompare(chars, [0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]); + })); + testRunner.addTest(new TestCase("Check UTF8 decoding", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var chars = []; + for (var i = 0; i < 6; i++) { + chars.push(fb.readUtf8CodePoint()); + } + return TestRunner.arrayCompare(chars, [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]); + })); + testRunner.addTest(new TestCase("Check UTF8 encoding", function () { + var fb = new FileManager.FileBuffer(20); + fb.writeUtf8Bom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + bytes.push(fb.readByte()); + } + var expected = [0xEF, 0xBB, 0xBF, 0x54, 0xC3, 0xA8, 0xE1, 0xB4, 0xA3, 0xE2, 0x80, 0xA0, 0x0D, 0x0A]; + return TestRunner.arrayCompare(bytes, expected); + })); + testRunner.addTest(new TestCase("Check saving a file", function () { + var filename = TestFileDir + "\\tmpUTF16LE.txt"; + var fb = new FileManager.FileBuffer(14); + fb.writeUtf16leBom(); + var chars = [0x0054, 0x00E8, 0x1D23, 0x2020, 0x000D, 0x000A]; + chars.forEach(function (val) { + fb.writeUtf16CodePoint(val, false); + }); + fb.save(filename); + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xFF, 0xFE, 0x54, 0x00, 0xE8, 0x00, 0x23, 0x1D, 0x20, 0x20, 0x0D, 0x00, 0x0A, 0x00]; + savedFile.index = 0; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + testRunner.addTest(new TestCase("Check reading past buffer asserts", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + var result = fb.readByte(200); + return true; + }, "read beyond buffer length")); + testRunner.addTest(new TestCase("Check writing past buffer asserts", function () { + var fb = new FileManager.FileBuffer(TestFileDir + "\\UTF8BOM.txt"); + fb.writeByte(5, 200); + return true; + }, "write beyond buffer length")); + testRunner.addTest(new TestCase("Read non-BMP utf16 chars", function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt"); + if (savedFile.encoding !== 'utf16le') { + throw Error("Incorrect encoding"); + } + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf16CodePoint(false)); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + testRunner.addTest(new TestCase("Read non-BMP utf8 chars", function () { + var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf8NonBmp.txt"); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + var codePoints = []; + for (var i = 0; i < 6; i++) { + codePoints.push(savedFile.readUtf8CodePoint()); + } + var expectedCodePoints = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + return TestRunner.arrayCompare(codePoints, expectedCodePoints); + })); + testRunner.addTest(new TestCase("Write non-BMP utf8 chars", function () { + var filename = TestFileDir + "\\tmpUTF8nonBmp.txt"; + var fb = new FileManager.FileBuffer(15); + var chars = [0x10480, 0x10481, 0x10482, 0x54, 0x68, 0x69]; + chars.forEach(function (val) { + fb.writeUtf8CodePoint(val); + }); + fb.save(filename); + var savedFile = new FileManager.FileBuffer(filename); + if (savedFile.encoding !== 'utf8') { + throw Error("Incorrect encoding"); + } + var expectedBytes = [0xF0, 0x90, 0x92, 0x80, 0xF0, 0x90, 0x92, 0x81, 0xF0, 0x90, 0x92, 0x82, 0x54, 0x68, 0x69]; + expectedBytes.forEach(function (val) { + var byteVal = savedFile.readByte(); + if (byteVal !== val) { + throw Error("Incorrect byte value"); + } + }); + return true; + })); + testRunner.addTest(new TestCase("Test invalid lead UTF8 byte", function () { + var filename = TestFileDir + "\\utf8BadLeadByte.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Invalid UTF8 byte sequence at index: 4")); + testRunner.addTest(new TestCase("Test invalid tail UTF8 byte", function () { + var filename = TestFileDir + "\\utf8InvalidTail.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 8")); + testRunner.addTest(new TestCase("Test ANSI fails validation", function () { + var filename = TestFileDir + "\\ansi.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trailing byte invalid at index: 6")); + testRunner.addTest(new TestCase("Test UTF-16LE with invalid surrogate trail fails", function () { + var filename = TestFileDir + "\\utf16leInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + testRunner.addTest(new TestCase("Test UTF-16BE with invalid surrogate head fails", function () { + var filename = TestFileDir + "\\UTF16BEInvalidSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Byte sequence starts with a trail surrogate")); + testRunner.addTest(new TestCase("Test UTF-16LE with missing trail surrogate fails", function () { + var filename = TestFileDir + "\\utf16leMissingTrailSurrogate.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Trail surrogate has an invalid value")); + testRunner.addTest(new TestCase("Count character occurrences", function () { + var filename = TestFileDir + "\\charCountASCII.txt"; + var fb = new FileManager.FileBuffer(filename); + var result = (fb.countCR === 5 && fb.countLF === 4 && fb.countCRLF === 5 && fb.countHT === 3); + return result; + })); + testRunner.addTest(new TestCase("Test file with control character", function () { + var filename = TestFileDir + "\\controlChar.txt"; + var fb = new FileManager.FileBuffer(filename); + return true; + }, "Codepoint at index: 3 has control value: 8")); + return testRunner; +})(); diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt new file mode 100644 index 0000000000000..d176a82608256 --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/duplicateLocalVariable2.ts (1 errors) ==== + export class TestCase { + constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { + } + } + export class TestRunner { + static arrayCompare(arg1: any[], arg2: any[]): boolean { + return false; + } + + public addTest(test: TestCase) { + } + } + + export var tests: TestRunner = (function () { + var testRunner = new TestRunner(); + + testRunner.addTest(new TestCase("Check UTF8 encoding", + function () { + var fb: any; + fb.writeUtf8Bom(); + var chars = [0x0054]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + ~ +!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'. + bytes.push(fb.readByte()); + } + var expected = [0xEF]; + return TestRunner.arrayCompare(bytes, expected); + })); + + return testRunner; + })(); \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable2.js b/tests/baselines/reference/duplicateLocalVariable2.js new file mode 100644 index 0000000000000..a8370f317091e --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable2.js @@ -0,0 +1,79 @@ +//// [duplicateLocalVariable2.ts] +export class TestCase { + constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) { + } +} +export class TestRunner { + static arrayCompare(arg1: any[], arg2: any[]): boolean { + return false; + } + + public addTest(test: TestCase) { + } +} + +export var tests: TestRunner = (function () { + var testRunner = new TestRunner(); + + testRunner.addTest(new TestCase("Check UTF8 encoding", + function () { + var fb: any; + fb.writeUtf8Bom(); + var chars = [0x0054]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + bytes.push(fb.readByte()); + } + var expected = [0xEF]; + return TestRunner.arrayCompare(bytes, expected); + })); + + return testRunner; +})(); + +//// [duplicateLocalVariable2.js] +define(["require", "exports"], function (require, exports) { + var TestCase = (function () { + function TestCase(name, test, errorMessageRegEx) { + this.name = name; + this.test = test; + this.errorMessageRegEx = errorMessageRegEx; + } + return TestCase; + })(); + exports.TestCase = TestCase; + var TestRunner = (function () { + function TestRunner() { + } + TestRunner.arrayCompare = function (arg1, arg2) { + return false; + }; + TestRunner.prototype.addTest = function (test) { + }; + return TestRunner; + })(); + exports.TestRunner = TestRunner; + exports.tests = (function () { + var testRunner = new TestRunner(); + testRunner.addTest(new TestCase("Check UTF8 encoding", function () { + var fb; + fb.writeUtf8Bom(); + var chars = [0x0054]; + for (var i in chars) { + fb.writeUtf8CodePoint(chars[i]); + } + fb.index = 0; + var bytes = []; + for (var i = 0; i < 14; i++) { + bytes.push(fb.readByte()); + } + var expected = [0xEF]; + return TestRunner.arrayCompare(bytes, expected); + })); + return testRunner; + })(); +}); diff --git a/tests/baselines/reference/duplicateLocalVariable3.errors.txt b/tests/baselines/reference/duplicateLocalVariable3.errors.txt new file mode 100644 index 0000000000000..b99d0772292c9 --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable3.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/duplicateLocalVariable3.ts (1 errors) ==== + var x = 1; + var x = 2; + + function f() { + var y = 1; + var y = 2; + } + + function f2() { + var z = 3; + var z = ""; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable3.js b/tests/baselines/reference/duplicateLocalVariable3.js new file mode 100644 index 0000000000000..d44a956317729 --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable3.js @@ -0,0 +1,25 @@ +//// [duplicateLocalVariable3.ts] +var x = 1; +var x = 2; + +function f() { + var y = 1; + var y = 2; +} + +function f2() { + var z = 3; + var z = ""; +} + +//// [duplicateLocalVariable3.js] +var x = 1; +var x = 2; +function f() { + var y = 1; + var y = 2; +} +function f2() { + var z = 3; + var z = ""; +} diff --git a/tests/baselines/reference/duplicateLocalVariable4.errors.txt b/tests/baselines/reference/duplicateLocalVariable4.errors.txt new file mode 100644 index 0000000000000..6038986971f4f --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable4.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/duplicateLocalVariable4.ts (1 errors) ==== + enum E{ + a + } + + var x = E; + var x = E.a; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable4.js b/tests/baselines/reference/duplicateLocalVariable4.js new file mode 100644 index 0000000000000..d7d67f28d5099 --- /dev/null +++ b/tests/baselines/reference/duplicateLocalVariable4.js @@ -0,0 +1,15 @@ +//// [duplicateLocalVariable4.ts] +enum E{ +a +} + +var x = E; +var x = E.a; + +//// [duplicateLocalVariable4.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; +})(E || (E = {})); +var x = E; +var x = 0 /* a */; diff --git a/tests/baselines/reference/duplicateNumericIndexers.errors.txt b/tests/baselines/reference/duplicateNumericIndexers.errors.txt new file mode 100644 index 0000000000000..74438877558bc --- /dev/null +++ b/tests/baselines/reference/duplicateNumericIndexers.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (8 errors) ==== + // it is an error to have duplicate index signatures of the same kind in a type + + interface Number { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + interface String { + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + interface Array { + [x: number]: T; + ~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + [x: number]: T; + ~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + class C { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + interface I { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + var a: { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateNumericIndexers.js b/tests/baselines/reference/duplicateNumericIndexers.js new file mode 100644 index 0000000000000..670c0329511e6 --- /dev/null +++ b/tests/baselines/reference/duplicateNumericIndexers.js @@ -0,0 +1,42 @@ +//// [duplicateNumericIndexers.ts] +// it is an error to have duplicate index signatures of the same kind in a type + +interface Number { + [x: number]: string; + [x: number]: string; +} + +interface String { + [x: number]: string; + [x: number]: string; +} + +interface Array { + [x: number]: T; + [x: number]: T; +} + +class C { + [x: number]: string; + [x: number]: string; +} + +interface I { + [x: number]: string; + [x: number]: string; +} + +var a: { + [x: number]: string; + [x: number]: string; +} + + + +//// [duplicateNumericIndexers.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; diff --git a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt new file mode 100644 index 0000000000000..ec1752971c9b2 --- /dev/null +++ b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (8 errors) ==== + var x = { + a: 1, + b: true, // OK + a: 56, // Duplicate + ~ +!!! Duplicate identifier 'a'. + \u0061: "ss", // Duplicate + ~~~~~~ +!!! Duplicate identifier '\u0061'. + a: { + ~ +!!! Duplicate identifier 'a'. + c: 1, + "c": 56, // Duplicate + ~~~ +!!! Duplicate identifier '"c"'. + } + }; + + + var y = { + get a() { return 0; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set a(v: number) { }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + get a() { return 0; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'a'. + }; + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js new file mode 100644 index 0000000000000..5f55a8b1d22c5 --- /dev/null +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js @@ -0,0 +1,13 @@ +//// [duplicateOverloadInTypeAugmentation1.ts] +interface Array { + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, + initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, + initialValue: U): U; +} +var a: Array; +var r5 = a.reduce((x, y) => x + y); + +//// [duplicateOverloadInTypeAugmentation1.js] +var a; +var r5 = a.reduce(function (x, y) { return x + y; }); diff --git a/tests/baselines/reference/duplicatePropertyNames.errors.txt b/tests/baselines/reference/duplicatePropertyNames.errors.txt new file mode 100644 index 0000000000000..6e9f95e0c42bd --- /dev/null +++ b/tests/baselines/reference/duplicatePropertyNames.errors.txt @@ -0,0 +1,69 @@ +==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (10 errors) ==== + // duplicate property names are an error in all types + + interface Number { + foo: string; + foo: string; + ~~~ +!!! Duplicate identifier 'foo'. + } + + interface String { + foo(): string; + foo(): string; + } + + interface Array { + foo: T; + foo: T; + ~~~ +!!! Duplicate identifier 'foo'. + } + + class C { + foo: string; + foo: string; + ~~~ +!!! Duplicate identifier 'foo'. + + bar(x) { } + bar(x) { } + ~~~~~~~~~~ +!!! Duplicate function implementation. + + baz = () => { } + baz = () => { } + ~~~ +!!! Duplicate identifier 'baz'. + } + + interface I { + foo: string; + foo: string; + ~~~ +!!! Duplicate identifier 'foo'. + } + + var a: { + foo: string; + foo: string; + ~~~ +!!! Duplicate identifier 'foo'. + + bar: () => {}; + bar: () => {}; + ~~~ +!!! Duplicate identifier 'bar'. + } + + var b = { + foo: '', + foo: '', + ~~~ +!!! Duplicate identifier 'foo'. + bar: () => { }, + bar: () => { } + ~~~ +!!! Duplicate identifier 'bar'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePropertyNames.js b/tests/baselines/reference/duplicatePropertyNames.js new file mode 100644 index 0000000000000..afe584c680303 --- /dev/null +++ b/tests/baselines/reference/duplicatePropertyNames.js @@ -0,0 +1,73 @@ +//// [duplicatePropertyNames.ts] +// duplicate property names are an error in all types + +interface Number { + foo: string; + foo: string; +} + +interface String { + foo(): string; + foo(): string; +} + +interface Array { + foo: T; + foo: T; +} + +class C { + foo: string; + foo: string; + + bar(x) { } + bar(x) { } + + baz = () => { } + baz = () => { } +} + +interface I { + foo: string; + foo: string; +} + +var a: { + foo: string; + foo: string; + + bar: () => {}; + bar: () => {}; +} + +var b = { + foo: '', + foo: '', + bar: () => { }, + bar: () => { } +} + + +//// [duplicatePropertyNames.js] +var C = (function () { + function C() { + this.baz = function () { + }; + this.baz = function () { + }; + } + C.prototype.bar = function (x) { + }; + C.prototype.bar = function (x) { + }; + return C; +})(); +var a; +var b = { + foo: '', + foo: '', + bar: function () { + }, + bar: function () { + } +}; diff --git a/tests/baselines/reference/duplicateStringIndexers.errors.txt b/tests/baselines/reference/duplicateStringIndexers.errors.txt new file mode 100644 index 0000000000000..d5a31bd238eb1 --- /dev/null +++ b/tests/baselines/reference/duplicateStringIndexers.errors.txt @@ -0,0 +1,138 @@ +==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (52 errors) ==== + // it is an error to have duplicate index signatures of the same kind in a type + + interface Number { + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toExponential' of type '(fractionDigits?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toFixed' of type '(fractionDigits?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toPrecision' of type '(precision?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toString' of type '(radix?: number) => string' is not assignable to string index type 'string'. + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + interface String { + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'charAt' of type '(pos: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'charCodeAt' of type '(index: number) => number' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'concat' of type '(...strings: string[]) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'indexOf' of type '(searchString: string, position?: number) => number' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'lastIndexOf' of type '(searchString: string, position?: number) => number' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'length' of type 'number' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'localeCompare' of type '(that: string) => number' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'match' of type '{ (regexp: string): string[]; (regexp: RegExp): string[]; }' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'replace' of type '{ (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'search' of type '{ (regexp: string): number; (regexp: RegExp): number; }' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'slice' of type '(start?: number, end?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'split' of type '{ (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; }' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'substr' of type '(from: number, length?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'substring' of type '(start: number, end?: number) => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toLocaleLowerCase' of type '() => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toLocaleUpperCase' of type '() => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toLowerCase' of type '() => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toString' of type '() => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toUpperCase' of type '() => string' is not assignable to string index type 'string'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'trim' of type '() => string' is not assignable to string index type 'string'. + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + interface Array { + [x: string]: T; + ~~~~~~~~~~~~~~~ +!!! Property 'concat' of type '{ (...items: U[]): T[]; (...items: T[]): T[]; }' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'every' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'filter' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => T[]' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'forEach' of type '(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'indexOf' of type '(searchElement: T, fromIndex?: number) => number' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'join' of type '(separator?: string) => string' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'lastIndexOf' of type '(searchElement: T, fromIndex?: number) => number' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'length' of type 'number' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'map' of type '(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'pop' of type '() => T' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'push' of type '(...items: T[]) => number' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'reduce' of type '{ (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'reduceRight' of type '{ (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'reverse' of type '() => T[]' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'shift' of type '() => T' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'slice' of type '(start?: number, end?: number) => T[]' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'some' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'sort' of type '(compareFn?: (a: T, b: T) => number) => T[]' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'splice' of type '{ (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; }' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'toString' of type '() => string' is not assignable to string index type 'T'. + ~~~~~~~~~~~~~~~ +!!! Property 'unshift' of type '(...items: T[]) => number' is not assignable to string index type 'T'. + [x: string]: T; + ~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + class C { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + interface I { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + var a: { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringIndexers.js b/tests/baselines/reference/duplicateStringIndexers.js new file mode 100644 index 0000000000000..bace9c152288e --- /dev/null +++ b/tests/baselines/reference/duplicateStringIndexers.js @@ -0,0 +1,42 @@ +//// [duplicateStringIndexers.ts] +// it is an error to have duplicate index signatures of the same kind in a type + +interface Number { + [x: string]: string; + [x: string]: string; +} + +interface String { + [x: string]: string; + [x: string]: string; +} + +interface Array { + [x: string]: T; + [x: string]: T; +} + +class C { + [x: string]: string; + [x: string]: string; +} + +interface I { + [x: string]: string; + [x: string]: string; +} + +var a: { + [x: string]: string; + [x: string]: string; +} + + + +//// [duplicateStringIndexers.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; diff --git a/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt b/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt new file mode 100644 index 0000000000000..9fdd666880782 --- /dev/null +++ b/tests/baselines/reference/duplicateStringNamedProperty1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/duplicateStringNamedProperty1.ts (1 errors) ==== + export interface Album { + "artist": string; + artist: string; + ~~~~~~ +!!! Duplicate identifier 'artist'. + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringNamedProperty1.js b/tests/baselines/reference/duplicateStringNamedProperty1.js new file mode 100644 index 0000000000000..f5e5f90c78d7b --- /dev/null +++ b/tests/baselines/reference/duplicateStringNamedProperty1.js @@ -0,0 +1,7 @@ +//// [duplicateStringNamedProperty1.ts] +export interface Album { + "artist": string; + artist: string; +} + +//// [duplicateStringNamedProperty1.js] diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt new file mode 100644 index 0000000000000..3bc10adf7ea9f --- /dev/null +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt @@ -0,0 +1,82 @@ +==== tests/cases/compiler/duplicateSymbolsExportMatching.ts (8 errors) ==== + module M { + export interface E { } + interface I { } + } + module M { + export interface E { } // ok + interface I { } // ok + } + + // Doesn't match export visibility, but it's in a different parent, so it's ok + module M { + interface E { } // ok + export interface I { } // ok + } + + module N { + interface I { } + interface I { } // ok + export interface E { } + export interface E { } // ok + } + + module N2 { + interface I { } + export interface I { } // error + ~ +!!! Duplicate identifier 'I'. + export interface E { } + interface E { } // error + ~ +!!! Duplicate identifier 'E'. + } + + // Should report error only once for instantiated module + module M { + module inst { + var t; + } + export module inst { // one error + ~~~~ +!!! Duplicate identifier 'inst'. + var t; + } + } + + // Variables of the same / different type + module M2 { + var v: string; + export var v: string; // one error (visibility) + ~ +!!! Duplicate identifier 'v'. + var w: number; + export var w: string; // two errors (visibility and type mismatch) + ~ +!!! Duplicate identifier 'w'. + } + + module M { + module F { + var t; + } + export function F() { } // Only one error for duplicate identifier (don't consider visibility) + ~ +!!! Duplicate identifier 'F'. + } + + module M { + class C { } + module C { } + export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol) + ~ +!!! Duplicate identifier 'C'. + var t; + } + } + + // Top level + interface D { } + export interface D { } + ~ +!!! Duplicate identifier 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.js b/tests/baselines/reference/duplicateSymbolsExportMatching.js new file mode 100644 index 0000000000000..a6ec9e73aeb3a --- /dev/null +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.js @@ -0,0 +1,110 @@ +//// [duplicateSymbolsExportMatching.ts] +module M { + export interface E { } + interface I { } +} +module M { + export interface E { } // ok + interface I { } // ok +} + +// Doesn't match export visibility, but it's in a different parent, so it's ok +module M { + interface E { } // ok + export interface I { } // ok +} + +module N { + interface I { } + interface I { } // ok + export interface E { } + export interface E { } // ok +} + +module N2 { + interface I { } + export interface I { } // error + export interface E { } + interface E { } // error +} + +// Should report error only once for instantiated module +module M { + module inst { + var t; + } + export module inst { // one error + var t; + } +} + +// Variables of the same / different type +module M2 { + var v: string; + export var v: string; // one error (visibility) + var w: number; + export var w: string; // two errors (visibility and type mismatch) +} + +module M { + module F { + var t; + } + export function F() { } // Only one error for duplicate identifier (don't consider visibility) +} + +module M { + class C { } + module C { } + export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol) + var t; + } +} + +// Top level +interface D { } +export interface D { } + +//// [duplicateSymbolsExportMatching.js] +define(["require", "exports"], function (require, exports) { + var M; + (function (M) { + var inst; + (function (inst) { + var t; + })(inst || (inst = {})); + (function (inst) { + var t; + })(M.inst || (M.inst = {})); + var inst = M.inst; + })(M || (M = {})); + var M2; + (function (M2) { + var v; + M2.v; + var w; + M2.w; + })(M2 || (M2 = {})); + var M; + (function (M) { + var F; + (function (F) { + var t; + })(F || (F = {})); + function F() { + } + M.F = F; + })(M || (M = {})); + var M; + (function (M) { + var C = (function () { + function C() { + } + return C; + })(); + (function (C) { + var t; + })(M.C || (M.C = {})); + var C = M.C; + })(M || (M = {})); +}); diff --git a/tests/baselines/reference/duplicateTypeParameters1.errors.txt b/tests/baselines/reference/duplicateTypeParameters1.errors.txt new file mode 100644 index 0000000000000..798411f6b6db6 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/duplicateTypeParameters1.ts (1 errors) ==== + function A() { } + ~ +!!! Duplicate identifier 'X'. + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters1.js b/tests/baselines/reference/duplicateTypeParameters1.js new file mode 100644 index 0000000000000..167688719ab71 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters1.js @@ -0,0 +1,7 @@ +//// [duplicateTypeParameters1.ts] +function A() { } + + +//// [duplicateTypeParameters1.js] +function A() { +} diff --git a/tests/baselines/reference/duplicateTypeParameters2.errors.txt b/tests/baselines/reference/duplicateTypeParameters2.errors.txt new file mode 100644 index 0000000000000..52c6b799e9e26 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/duplicateTypeParameters2.ts (1 errors) ==== + class A { public foo() { } } + class B { public bar() { } } + + interface I {} + ~ +!!! Duplicate identifier 'T'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters2.js b/tests/baselines/reference/duplicateTypeParameters2.js new file mode 100644 index 0000000000000..c89f0d15fe367 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters2.js @@ -0,0 +1,21 @@ +//// [duplicateTypeParameters2.ts] +class A { public foo() { } } +class B { public bar() { } } + +interface I {} + +//// [duplicateTypeParameters2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); diff --git a/tests/baselines/reference/duplicateTypeParameters3.errors.txt b/tests/baselines/reference/duplicateTypeParameters3.errors.txt new file mode 100644 index 0000000000000..88bbf127abb59 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters3.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/duplicateTypeParameters3.ts (1 errors) ==== + interface X { + x: () => () => void; + ~ +!!! Duplicate identifier 'A'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateTypeParameters3.js b/tests/baselines/reference/duplicateTypeParameters3.js new file mode 100644 index 0000000000000..4786c58cabe16 --- /dev/null +++ b/tests/baselines/reference/duplicateTypeParameters3.js @@ -0,0 +1,8 @@ +//// [duplicateTypeParameters3.ts] +interface X { +x: () => () => void; +} + + + +//// [duplicateTypeParameters3.js] diff --git a/tests/baselines/reference/duplicateVariableDeclaration1.js b/tests/baselines/reference/duplicateVariableDeclaration1.js new file mode 100644 index 0000000000000..5bedb68594fc3 --- /dev/null +++ b/tests/baselines/reference/duplicateVariableDeclaration1.js @@ -0,0 +1,7 @@ +//// [duplicateVariableDeclaration1.ts] +var v +var v + +//// [duplicateVariableDeclaration1.js] +var v; +var v; diff --git a/tests/baselines/reference/duplicateVariablesByScope.js b/tests/baselines/reference/duplicateVariablesByScope.js new file mode 100644 index 0000000000000..38bd7a0181e6e --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.js @@ -0,0 +1,64 @@ +//// [duplicateVariablesByScope.ts] +// duplicate local variables are only reported at global scope + +module M { + for (var j = 0; j < 10; j++) { + } + + for (var j = 0; j < 10; j++) { + } +} + +function foo() { + var x = 2; + var x = 1; + if (true) { + var result = 1; + } + else { + var result = 2; + } +} + +class C { + foo() { + try { + var x = 1; + } + catch (e) { + var x = 2; + } + } +} + +//// [duplicateVariablesByScope.js] +var M; +(function (M) { + for (var j = 0; j < 10; j++) { + } + for (var j = 0; j < 10; j++) { + } +})(M || (M = {})); +function foo() { + var x = 2; + var x = 1; + if (true) { + var result = 1; + } + else { + var result = 2; + } +} +var C = (function () { + function C() { + } + C.prototype.foo = function () { + try { + var x = 1; + } + catch (e) { + var x = 2; + } + }; + return C; +})(); diff --git a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt new file mode 100644 index 0000000000000..0cfc4b1a72063 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/duplicateVariablesWithAny.ts (4 errors) ==== + // They should have to be the same even when one of the types is 'any' + var x: any; + var x = 2; //error + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. + + var y = ""; + var y; //error + ~ +!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. + + module N { + var x: any; + var x = 2; //error + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. + + var y = ""; + var y; //error + ~ +!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. + } + + var z: any; + var z; // ok \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesWithAny.js b/tests/baselines/reference/duplicateVariablesWithAny.js new file mode 100644 index 0000000000000..44b52ed04d10d --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesWithAny.js @@ -0,0 +1,33 @@ +//// [duplicateVariablesWithAny.ts] +// They should have to be the same even when one of the types is 'any' +var x: any; +var x = 2; //error + +var y = ""; +var y; //error + +module N { + var x: any; + var x = 2; //error + + var y = ""; + var y; //error +} + +var z: any; +var z; // ok + +//// [duplicateVariablesWithAny.js] +var x; +var x = 2; +var y = ""; +var y; +var N; +(function (N) { + var x; + var x = 2; + var y = ""; + var y; +})(N || (N = {})); +var z; +var z; diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt new file mode 100644 index 0000000000000..5f9d572747580 --- /dev/null +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ==== + var x = 3; + var y = ""; + +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts (1 errors) ==== + var x = true; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'. + var z = 3; + +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts (3 errors) ==== + var x = ""; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. + var y = 3; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. + var z = false; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. + +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ==== + var x = 0; + var y = ""; + var z = 0; + +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_4.ts (0 errors) ==== + module P { } + import p = P; + var q; + +==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_5.ts (0 errors) ==== + module Q { } + import q = Q; + var p; \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.js b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.js new file mode 100644 index 0000000000000..f26b866991aa8 --- /dev/null +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/duplicateVarsAcrossFileBoundaries.ts] //// + +//// [duplicateVarsAcrossFileBoundaries_0.ts] +var x = 3; +var y = ""; + +//// [duplicateVarsAcrossFileBoundaries_1.ts] +var x = true; +var z = 3; + +//// [duplicateVarsAcrossFileBoundaries_2.ts] +var x = ""; +var y = 3; +var z = false; + +//// [duplicateVarsAcrossFileBoundaries_3.ts] +var x = 0; +var y = ""; +var z = 0; + +//// [duplicateVarsAcrossFileBoundaries_4.ts] +module P { } +import p = P; +var q; + +//// [duplicateVarsAcrossFileBoundaries_5.ts] +module Q { } +import q = Q; +var p; + +//// [duplicateVarsAcrossFileBoundaries_0.js] +var x = 3; +var y = ""; +//// [duplicateVarsAcrossFileBoundaries_1.js] +var x = true; +var z = 3; +//// [duplicateVarsAcrossFileBoundaries_2.js] +var x = ""; +var y = 3; +var z = false; +//// [duplicateVarsAcrossFileBoundaries_3.js] +var x = 0; +var y = ""; +var z = 0; +//// [duplicateVarsAcrossFileBoundaries_4.js] +var q; +//// [duplicateVarsAcrossFileBoundaries_5.js] +var p; diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.js b/tests/baselines/reference/dynamicModuleTypecheckError.js new file mode 100644 index 0000000000000..065eee59a5ee4 --- /dev/null +++ b/tests/baselines/reference/dynamicModuleTypecheckError.js @@ -0,0 +1,15 @@ +//// [dynamicModuleTypecheckError.ts] +export var x = 1; + +for(var i = 0; i < 30; i++) { + + x = i * 1000; // should not be an error here + +} + + +//// [dynamicModuleTypecheckError.js] +exports.x = 1; +for (var i = 0; i < 30; i++) { + exports.x = i * 1000; +} diff --git a/tests/baselines/reference/emitCommentsOnlyFile.js b/tests/baselines/reference/emitCommentsOnlyFile.js new file mode 100644 index 0000000000000..263e9dd2588bc --- /dev/null +++ b/tests/baselines/reference/emitCommentsOnlyFile.js @@ -0,0 +1,31 @@ +//// [emitCommentsOnlyFile.ts] + +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + + +//// [emitCommentsOnlyFile.js] diff --git a/tests/baselines/reference/emitMemberAccessExpression.js b/tests/baselines/reference/emitMemberAccessExpression.js new file mode 100644 index 0000000000000..260ce49c59977 --- /dev/null +++ b/tests/baselines/reference/emitMemberAccessExpression.js @@ -0,0 +1,64 @@ +//// [tests/cases/compiler/emitMemberAccessExpression.ts] //// + +//// [emitMemberAccessExpression_file1.ts] +/// +"use strict"; + +//// [emitMemberAccessExpression_file2.ts] +/// +"use strict"; +module Microsoft.PeopleAtWork.Model { + export class _Person { + public populate(raw: any) { + var res = Model.KnockoutExtentions; + } + } +} + +//// [emitMemberAccessExpression_file3.ts] +/// +/// +declare var OData: any; +module Microsoft.PeopleAtWork.Model { + export class KnockoutExtentions { + } +} + +//// [emitMemberAccessExpression_file2.js] +"use strict"; +var Microsoft; +(function (Microsoft) { + (function (PeopleAtWork) { + (function (Model) { + var _Person = (function () { + function _Person() { + } + _Person.prototype.populate = function (raw) { + var res = Model.KnockoutExtentions; + }; + return _Person; + })(); + Model._Person = _Person; + })(PeopleAtWork.Model || (PeopleAtWork.Model = {})); + var Model = PeopleAtWork.Model; + })(Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {})); + var PeopleAtWork = Microsoft.PeopleAtWork; +})(Microsoft || (Microsoft = {})); +//// [emitMemberAccessExpression_file1.js] +"use strict"; +//// [emitMemberAccessExpression_file3.js] +var Microsoft; +(function (Microsoft) { + (function (PeopleAtWork) { + (function (Model) { + var KnockoutExtentions = (function () { + function KnockoutExtentions() { + } + return KnockoutExtentions; + })(); + Model.KnockoutExtentions = KnockoutExtentions; + })(PeopleAtWork.Model || (PeopleAtWork.Model = {})); + var Model = PeopleAtWork.Model; + })(Microsoft.PeopleAtWork || (Microsoft.PeopleAtWork = {})); + var PeopleAtWork = Microsoft.PeopleAtWork; +})(Microsoft || (Microsoft = {})); diff --git a/tests/baselines/reference/emitPostComments.js b/tests/baselines/reference/emitPostComments.js new file mode 100644 index 0000000000000..98d1d59457bf4 --- /dev/null +++ b/tests/baselines/reference/emitPostComments.js @@ -0,0 +1,33 @@ +//// [emitPostComments.ts] + +var y = 10; +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + + +//// [emitPostComments.js] +var y = 10; diff --git a/tests/baselines/reference/emitPreComments.js b/tests/baselines/reference/emitPreComments.js new file mode 100644 index 0000000000000..4b70720cd5e59 --- /dev/null +++ b/tests/baselines/reference/emitPreComments.js @@ -0,0 +1,34 @@ +//// [emitPreComments.ts] + +// This is pre comment +var y = 10; +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + + +//// [emitPreComments.js] +var y = 10; diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt b/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt new file mode 100644 index 0000000000000..0df438756cf7b --- /dev/null +++ b/tests/baselines/reference/emitThisInSuperMethodCall.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/emitThisInSuperMethodCall.ts (3 errors) ==== + class User { + sayHello() { + } + } + + class RegisteredUser extends User { + f() { + () => { + function inner() { + super.sayHello(); + ~~~~~ +!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + } + }; + } + g() { + function inner() { + () => { + super.sayHello(); + ~~~~~ +!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + } + } + } + h() { + function inner() { + super.sayHello(); + ~~~~~ +!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js new file mode 100644 index 0000000000000..383da7d419f26 --- /dev/null +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -0,0 +1,69 @@ +//// [emitThisInSuperMethodCall.ts] +class User { + sayHello() { + } +} + +class RegisteredUser extends User { + f() { + () => { + function inner() { + super.sayHello(); + } + }; + } + g() { + function inner() { + () => { + super.sayHello(); + } + } + } + h() { + function inner() { + super.sayHello(); + } + } +} + + +//// [emitThisInSuperMethodCall.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var User = (function () { + function User() { + } + User.prototype.sayHello = function () { + }; + return User; +})(); +var RegisteredUser = (function (_super) { + __extends(RegisteredUser, _super); + function RegisteredUser() { + _super.apply(this, arguments); + } + RegisteredUser.prototype.f = function () { + (function () { + function inner() { + super.sayHello.call(this); + } + }); + }; + RegisteredUser.prototype.g = function () { + function inner() { + (function () { + super.sayHello.call(this); + }); + } + }; + RegisteredUser.prototype.h = function () { + function inner() { + super.sayHello.call(this); + } + }; + return RegisteredUser; +})(User); diff --git a/tests/baselines/reference/emptyEnum.js b/tests/baselines/reference/emptyEnum.js new file mode 100644 index 0000000000000..0188e1ecbaed0 --- /dev/null +++ b/tests/baselines/reference/emptyEnum.js @@ -0,0 +1,8 @@ +//// [emptyEnum.ts] +enum E { +} + +//// [emptyEnum.js] +var E; +(function (E) { +})(E || (E = {})); diff --git a/tests/baselines/reference/emptyExpr.js b/tests/baselines/reference/emptyExpr.js new file mode 100644 index 0000000000000..1ab216b685368 --- /dev/null +++ b/tests/baselines/reference/emptyExpr.js @@ -0,0 +1,5 @@ +//// [emptyExpr.ts] +[{},] + +//// [emptyExpr.js] +[{}]; diff --git a/tests/baselines/reference/emptyFile-declaration.js b/tests/baselines/reference/emptyFile-declaration.js new file mode 100644 index 0000000000000..83f47258925ee --- /dev/null +++ b/tests/baselines/reference/emptyFile-declaration.js @@ -0,0 +1,7 @@ +//// [emptyFile-declaration.ts] + + +//// [emptyFile-declaration.js] +//# sourceMappingURL=emptyFile-declaration.js.map + +//// [emptyFile-declaration.d.ts] diff --git a/tests/baselines/reference/emptyFile-declaration.js.map b/tests/baselines/reference/emptyFile-declaration.js.map new file mode 100644 index 0000000000000..2b96d26832783 --- /dev/null +++ b/tests/baselines/reference/emptyFile-declaration.js.map @@ -0,0 +1,2 @@ +//// [emptyFile-declaration.js.map] +{"version":3,"file":"emptyFile-declaration.js","sourceRoot":"","sources":["emptyFile-declaration.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-declaration.sourcemap.txt b/tests/baselines/reference/emptyFile-declaration.sourcemap.txt new file mode 100644 index 0000000000000..027af4c7ba024 --- /dev/null +++ b/tests/baselines/reference/emptyFile-declaration.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: emptyFile-declaration.js +mapUrl: emptyFile-declaration.js.map +sourceRoot: +sources: emptyFile-declaration.ts +=================================================================== +>>>//# sourceMappingURL=emptyFile-declaration.js.map \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-souremap.js b/tests/baselines/reference/emptyFile-souremap.js new file mode 100644 index 0000000000000..677037d8689fc --- /dev/null +++ b/tests/baselines/reference/emptyFile-souremap.js @@ -0,0 +1,7 @@ +//// [emptyFile-souremap.ts] + + +//// [emptyFile-souremap.js] +//# sourceMappingURL=emptyFile-souremap.js.map + +//// [emptyFile-souremap.d.ts] diff --git a/tests/baselines/reference/emptyFile-souremap.js.map b/tests/baselines/reference/emptyFile-souremap.js.map new file mode 100644 index 0000000000000..9b1e0e1517b59 --- /dev/null +++ b/tests/baselines/reference/emptyFile-souremap.js.map @@ -0,0 +1,2 @@ +//// [emptyFile-souremap.js.map] +{"version":3,"file":"emptyFile-souremap.js","sourceRoot":"","sources":["emptyFile-souremap.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-souremap.sourcemap.txt b/tests/baselines/reference/emptyFile-souremap.sourcemap.txt new file mode 100644 index 0000000000000..a1e1d5d5ac57f --- /dev/null +++ b/tests/baselines/reference/emptyFile-souremap.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: emptyFile-souremap.js +mapUrl: emptyFile-souremap.js.map +sourceRoot: +sources: emptyFile-souremap.ts +=================================================================== +>>>//# sourceMappingURL=emptyFile-souremap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile.js b/tests/baselines/reference/emptyFile.js new file mode 100644 index 0000000000000..c6aba284dc947 --- /dev/null +++ b/tests/baselines/reference/emptyFile.js @@ -0,0 +1,4 @@ +//// [emptyFile.ts] + + +//// [emptyFile.js] diff --git a/tests/baselines/reference/emptyGenericParamList.errors.txt b/tests/baselines/reference/emptyGenericParamList.errors.txt new file mode 100644 index 0000000000000..841c41be08472 --- /dev/null +++ b/tests/baselines/reference/emptyGenericParamList.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/emptyGenericParamList.ts (2 errors) ==== + class I {} + var x: I<>; + ~~ +!!! Type argument list cannot be empty. + ~~~ +!!! Generic type 'I' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/emptyIndexer.js b/tests/baselines/reference/emptyIndexer.js new file mode 100644 index 0000000000000..8e3abd0cab42a --- /dev/null +++ b/tests/baselines/reference/emptyIndexer.js @@ -0,0 +1,17 @@ +//// [emptyIndexer.ts] +interface I1 { + m(): number; +} + +interface I2 { + [s:string]: I1; +} + + +var x: I2; + +var n = x[''].m(); // should not crash compiler + +//// [emptyIndexer.js] +var x; +var n = x[''].m(); diff --git a/tests/baselines/reference/emptyMemberAccess.errors.txt b/tests/baselines/reference/emptyMemberAccess.errors.txt new file mode 100644 index 0000000000000..4c3b417338f89 --- /dev/null +++ b/tests/baselines/reference/emptyMemberAccess.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/emptyMemberAccess.ts (1 errors) ==== + function getObj() { + + ().toString(); + ~ +!!! '=>' expected. + + } + \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt new file mode 100644 index 0000000000000..e05930401f7b4 --- /dev/null +++ b/tests/baselines/reference/emptyTypeArgumentList.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== + function foo() { } + foo<>(); + ~~ +!!! Type argument list cannot be empty. + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt new file mode 100644 index 0000000000000..aad58ddfdce15 --- /dev/null +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== + class foo { } + new foo<>(); + ~~ +!!! Type argument list cannot be empty. + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt new file mode 100644 index 0000000000000..1ab0326885628 --- /dev/null +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -0,0 +1,104 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (21 errors) ==== + // enums assignable to number, any, Object, errors unless otherwise noted + + enum E { A } + enum F { B } + + var e = E.A; + var f = F.B; + + e = f; + ~ +!!! Type 'F' is not assignable to type 'E'. + f = e; + ~ +!!! Type 'E' is not assignable to type 'F'. + e = 1; // ok + f = 1; // ok + var x: number = e; // ok + x = f; // ok + + module Others { + var a: any = e; // ok + + class C { + foo: string; + } + var ac: C; + interface I { + foo: string; + } + var ai: I; + + var b: number = e; // ok + var c: string = e; + ~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'string'. + var d: boolean = e; + ~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'boolean'. + var ee: Date = e; + ~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'Date': +!!! Property 'toDateString' is missing in type 'Number'. + var f: any = e; // ok + var g: void = e; + ~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'void'. + var h: Object = e; + var i: {} = e; + var j: () => {} = e; + ~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type '() => {}'. + var k: Function = e; + ~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'Function': +!!! Property 'apply' is missing in type 'Number'. + var l: (x: number) => string = e; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type '(x: number) => string'. + ac = e; + ~~ +!!! Type 'E' is not assignable to type 'C': +!!! Property 'foo' is missing in type 'Number'. + ai = e; + ~~ +!!! Type 'E' is not assignable to type 'I': +!!! Property 'foo' is missing in type 'Number'. + var m: number[] = e; + ~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'number[]': +!!! Property 'concat' is missing in type 'Number'. + var n: { foo: string } = e; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type '{ foo: string; }': +!!! Property 'foo' is missing in type 'Number'. + var o: (x: T) => T = e; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type '(x: T) => T'. + var p: Number = e; + var q: String = e; + ~~~~~~~~~~~~~ +!!! Type 'E' is not assignable to type 'String': +!!! Property 'charAt' is missing in type 'Number'. + + function foo(x: T, y: U, z: V) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + x = e; + ~ +!!! Type 'E' is not assignable to type 'T'. + y = e; + ~ +!!! Type 'E' is not assignable to type 'U'. + z = e; + ~ +!!! Type 'E' is not assignable to type 'V'. + var a: A = e; + ~~~~~~~~ +!!! Type 'E' is not assignable to type 'A'. + var b: B = e; + ~~~~~~~~ +!!! Type 'E' is not assignable to type 'B'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignability.js b/tests/baselines/reference/enumAssignability.js new file mode 100644 index 0000000000000..0b38e3a314a6a --- /dev/null +++ b/tests/baselines/reference/enumAssignability.js @@ -0,0 +1,109 @@ +//// [enumAssignability.ts] +// enums assignable to number, any, Object, errors unless otherwise noted + +enum E { A } +enum F { B } + +var e = E.A; +var f = F.B; + +e = f; +f = e; +e = 1; // ok +f = 1; // ok +var x: number = e; // ok +x = f; // ok + +module Others { + var a: any = e; // ok + + class C { + foo: string; + } + var ac: C; + interface I { + foo: string; + } + var ai: I; + + var b: number = e; // ok + var c: string = e; + var d: boolean = e; + var ee: Date = e; + var f: any = e; // ok + var g: void = e; + var h: Object = e; + var i: {} = e; + var j: () => {} = e; + var k: Function = e; + var l: (x: number) => string = e; + ac = e; + ai = e; + var m: number[] = e; + var n: { foo: string } = e; + var o: (x: T) => T = e; + var p: Number = e; + var q: String = e; + + function foo(x: T, y: U, z: V) { + x = e; + y = e; + z = e; + var a: A = e; + var b: B = e; + } +} + +//// [enumAssignability.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var F; +(function (F) { + F[F["B"] = 0] = "B"; +})(F || (F = {})); +var e = 0 /* A */; +var f = 0 /* B */; +e = f; +f = e; +e = 1; +f = 1; +var x = e; +x = f; +var Others; +(function (Others) { + var a = e; + var C = (function () { + function C() { + } + return C; + })(); + var ac; + var ai; + var b = e; + var c = e; + var d = e; + var ee = e; + var f = e; + var g = e; + var h = e; + var i = e; + var j = e; + var k = e; + var l = e; + ac = e; + ai = e; + var m = e; + var n = e; + var o = e; + var p = e; + var q = e; + function foo(x, y, z) { + x = e; + y = e; + z = e; + var a = e; + var b = e; + } +})(Others || (Others = {})); diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt new file mode 100644 index 0000000000000..de9232d72b1bd --- /dev/null +++ b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt @@ -0,0 +1,114 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts (2 errors) ==== + // enum is only a subtype of number, no types are subtypes of enum, all of these except the first are errors + + + enum E { A } + + interface I0 { + [x: string]: E; + foo: E; // identical and subtype, ok + } + + + declare function foo(x: E): E; + declare function foo(x: number): number; + declare function foo(x: any): any; + var r = foo(E.A); // E + var r2 = foo(1); // number + var r3 = foo(null); // any + + declare function foo2(x: string): string; + declare function foo2(x: E): E; + + var r4 = foo2(E.A); + + declare function foo3(x: boolean): boolean; + declare function foo3(x: E): E; + + var r4 = foo3(E.A); + + declare function foo4(x: Date): Date; + declare function foo4(x: E): E; + + var r4 = foo4(E.A); + + declare function foo5(x: RegExp): RegExp; + declare function foo5(x: E): E; + + var r4 = foo5(E.A); + + declare function foo6(x: { bar: number }): { bar: number }; + declare function foo6(x: E): E; + + var r4 = foo6(E.A); + + declare function foo7(x: number[]): number[]; + declare function foo7(x: E): E; + + var r4 = foo7(E.A); + + interface I8 { foo: string; } + declare function foo8(x: I8): I8; + declare function foo8(x: E): E; + + var r4 = foo8(E.A); + + class A { foo: number; } + declare function foo9(x: A): A; + declare function foo9(x: E): E; + + var r4 = foo9(E.A); + + class A2 { foo: T; } + declare function foo10(x: A2): A2; + declare function foo10(x: E): E; + + var r4 = foo10(E.A); + + declare function foo11(x: (x) => number): (x) => number; + declare function foo11(x: E): E; + + var r4 = foo11(E.A); + + declare function foo12(x: (x: T) => T): (x: T) => T; + declare function foo12(x: E): E; + + var r4 = foo12(E.A); + + enum E2 { A } + declare function foo13(x: E2): E2; + declare function foo13(x: E): E; + + var r4 = foo13(E.A); + + function f() { } + module f { + export var bar = 1; + } + declare function foo14(x: typeof f): typeof f; + declare function foo14(x: E): E; + + var r4 = foo14(E.A); + + class CC { baz: string } + module CC { + export var bar = 1; + } + declare function foo15(x: CC): CC; + declare function foo15(x: E): E; + + var r4 = foo15(E.A); + + declare function foo16(x: Object): Object; + declare function foo16(x: E): E; + + var r4 = foo16(E.A); + ~~ +!!! Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. + + declare function foo17(x: {}): {}; + declare function foo17(x: E): E; + + var r4 = foo16(E.A); + ~~ +!!! Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.js b/tests/baselines/reference/enumAssignabilityInInheritance.js new file mode 100644 index 0000000000000..39457d6dcd1cb --- /dev/null +++ b/tests/baselines/reference/enumAssignabilityInInheritance.js @@ -0,0 +1,164 @@ +//// [enumAssignabilityInInheritance.ts] +// enum is only a subtype of number, no types are subtypes of enum, all of these except the first are errors + + +enum E { A } + +interface I0 { + [x: string]: E; + foo: E; // identical and subtype, ok +} + + +declare function foo(x: E): E; +declare function foo(x: number): number; +declare function foo(x: any): any; +var r = foo(E.A); // E +var r2 = foo(1); // number +var r3 = foo(null); // any + +declare function foo2(x: string): string; +declare function foo2(x: E): E; + +var r4 = foo2(E.A); + +declare function foo3(x: boolean): boolean; +declare function foo3(x: E): E; + +var r4 = foo3(E.A); + +declare function foo4(x: Date): Date; +declare function foo4(x: E): E; + +var r4 = foo4(E.A); + +declare function foo5(x: RegExp): RegExp; +declare function foo5(x: E): E; + +var r4 = foo5(E.A); + +declare function foo6(x: { bar: number }): { bar: number }; +declare function foo6(x: E): E; + +var r4 = foo6(E.A); + +declare function foo7(x: number[]): number[]; +declare function foo7(x: E): E; + +var r4 = foo7(E.A); + +interface I8 { foo: string; } +declare function foo8(x: I8): I8; +declare function foo8(x: E): E; + +var r4 = foo8(E.A); + +class A { foo: number; } +declare function foo9(x: A): A; +declare function foo9(x: E): E; + +var r4 = foo9(E.A); + +class A2 { foo: T; } +declare function foo10(x: A2): A2; +declare function foo10(x: E): E; + +var r4 = foo10(E.A); + +declare function foo11(x: (x) => number): (x) => number; +declare function foo11(x: E): E; + +var r4 = foo11(E.A); + +declare function foo12(x: (x: T) => T): (x: T) => T; +declare function foo12(x: E): E; + +var r4 = foo12(E.A); + +enum E2 { A } +declare function foo13(x: E2): E2; +declare function foo13(x: E): E; + +var r4 = foo13(E.A); + +function f() { } +module f { + export var bar = 1; +} +declare function foo14(x: typeof f): typeof f; +declare function foo14(x: E): E; + +var r4 = foo14(E.A); + +class CC { baz: string } +module CC { + export var bar = 1; +} +declare function foo15(x: CC): CC; +declare function foo15(x: E): E; + +var r4 = foo15(E.A); + +declare function foo16(x: Object): Object; +declare function foo16(x: E): E; + +var r4 = foo16(E.A); + +declare function foo17(x: {}): {}; +declare function foo17(x: E): E; + +var r4 = foo16(E.A); + +//// [enumAssignabilityInInheritance.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var r = foo(0 /* A */); +var r2 = foo(1); +var r3 = foo(null); +var r4 = foo2(0 /* A */); +var r4 = foo3(0 /* A */); +var r4 = foo4(0 /* A */); +var r4 = foo5(0 /* A */); +var r4 = foo6(0 /* A */); +var r4 = foo7(0 /* A */); +var r4 = foo8(0 /* A */); +var A = (function () { + function A() { + } + return A; +})(); +var r4 = foo9(0 /* A */); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var r4 = foo10(0 /* A */); +var r4 = foo11(0 /* A */); +var r4 = foo12(0 /* A */); +var E2; +(function (E2) { + E2[E2["A"] = 0] = "A"; +})(E2 || (E2 = {})); +var r4 = foo13(0 /* A */); +function f() { +} +var f; +(function (f) { + f.bar = 1; +})(f || (f = {})); +var r4 = foo14(0 /* A */); +var CC = (function () { + function CC() { + } + return CC; +})(); +var CC; +(function (CC) { + CC.bar = 1; +})(CC || (CC = {})); +var r4 = foo15(0 /* A */); +var r4 = foo16(0 /* A */); +var r4 = foo16(0 /* A */); diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..f49df3231dbeb --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== + module W { + export class D { } + } + + enum W { + + a, b, c, + + } + + + interface WStatic { + + a: W; + + b: W; + + c: W; + + } + + + + var x: WStatic = W; + var y: typeof W = W; + var z: number = W; // error + ~~~~~~~~~~~~~ +!!! Type 'typeof W' is not assignable to type 'number'. + var a: number = W.a; + var b: typeof W = W.a; // error + ~~~~~~~~~~~~~~~~~ +!!! Type 'W' is not assignable to type 'typeof W': +!!! Property 'D' is missing in type 'Number'. + var c: typeof W.a = W.a; + var d: typeof W = 3; // error + ~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'typeof W'. + var e: typeof W.a = 4; + var f: WStatic = W.a; // error + ~~~~~~~~~~~~~~~~ +!!! Type 'W' is not assignable to type 'WStatic': +!!! Property 'a' is missing in type 'Number'. + var g: WStatic = 5; // error + ~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'WStatic'. + var h: W = 3; + var i: W = W.a; + i = W.a; + W.D; + var p: W.D; \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat.js b/tests/baselines/reference/enumAssignmentCompat.js new file mode 100644 index 0000000000000..f7fb01ff69cc8 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat.js @@ -0,0 +1,71 @@ +//// [enumAssignmentCompat.ts] +module W { + export class D { } +} + +enum W { + + a, b, c, + +} + + +interface WStatic { + + a: W; + + b: W; + + c: W; + +} + + + +var x: WStatic = W; +var y: typeof W = W; +var z: number = W; // error +var a: number = W.a; +var b: typeof W = W.a; // error +var c: typeof W.a = W.a; +var d: typeof W = 3; // error +var e: typeof W.a = 4; +var f: WStatic = W.a; // error +var g: WStatic = 5; // error +var h: W = 3; +var i: W = W.a; +i = W.a; +W.D; +var p: W.D; + +//// [enumAssignmentCompat.js] +var W; +(function (W) { + var D = (function () { + function D() { + } + return D; + })(); + W.D = D; +})(W || (W = {})); +var W; +(function (W) { + W[W["a"] = 0] = "a"; + W[W["b"] = 1] = "b"; + W[W["c"] = 2] = "c"; +})(W || (W = {})); +var x = W; +var y = W; +var z = W; +var a = 0 /* a */; +var b = 0 /* a */; +var c = 0 /* a */; +var d = 3; +var e = 4; +var f = 0 /* a */; +var g = 5; +var h = 3; +var i = 0 /* a */; +i = 0 /* a */; +W.D; +var p; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt new file mode 100644 index 0000000000000..d5e7d58a4d1e8 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== + enum W { + + a, b, c, + + } + + module W { + export class D { } + } + + interface WStatic { + + a: W; + + b: W; + + c: W; + + } + + + + var x: WStatic = W; + var y: typeof W = W; + var z: number = W; // error + ~~~~~~~~~~~~~ +!!! Type 'typeof W' is not assignable to type 'number'. + var a: number = W.a; + var b: typeof W = W.a; // error + ~~~~~~~~~~~~~~~~~ +!!! Type 'W' is not assignable to type 'typeof W': +!!! Property 'a' is missing in type 'Number'. + var c: typeof W.a = W.a; + var d: typeof W = 3; // error + ~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'typeof W'. + var e: typeof W.a = 4; + var f: WStatic = W.a; // error + ~~~~~~~~~~~~~~~~ +!!! Type 'W' is not assignable to type 'WStatic': +!!! Property 'a' is missing in type 'Number'. + var g: WStatic = 5; // error + ~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'WStatic'. + var h: W = 3; + var i: W = W.a; + i = W.a; + W.D; + var p: W.D; \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat2.js b/tests/baselines/reference/enumAssignmentCompat2.js new file mode 100644 index 0000000000000..41ac87e1587e8 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat2.js @@ -0,0 +1,70 @@ +//// [enumAssignmentCompat2.ts] +enum W { + + a, b, c, + +} + +module W { + export class D { } +} + +interface WStatic { + + a: W; + + b: W; + + c: W; + +} + + + +var x: WStatic = W; +var y: typeof W = W; +var z: number = W; // error +var a: number = W.a; +var b: typeof W = W.a; // error +var c: typeof W.a = W.a; +var d: typeof W = 3; // error +var e: typeof W.a = 4; +var f: WStatic = W.a; // error +var g: WStatic = 5; // error +var h: W = 3; +var i: W = W.a; +i = W.a; +W.D; +var p: W.D; + +//// [enumAssignmentCompat2.js] +var W; +(function (W) { + W[W["a"] = 0] = "a"; + W[W["b"] = 1] = "b"; + W[W["c"] = 2] = "c"; +})(W || (W = {})); +var W; +(function (W) { + var D = (function () { + function D() { + } + return D; + })(); + W.D = D; +})(W || (W = {})); +var x = W; +var y = W; +var z = W; +var a = 0 /* a */; +var b = 0 /* a */; +var c = 0 /* a */; +var d = 3; +var e = 4; +var f = 0 /* a */; +var g = 5; +var h = 3; +var i = 0 /* a */; +i = 0 /* a */; +W.D; +var p; diff --git a/tests/baselines/reference/enumBasics.js b/tests/baselines/reference/enumBasics.js new file mode 100644 index 0000000000000..3cf1ca50d9507 --- /dev/null +++ b/tests/baselines/reference/enumBasics.js @@ -0,0 +1,156 @@ +//// [enumBasics.ts] +// Enum without initializers have first member = 0 and successive members = N + 1 +enum E1 { + A, + B, + C +} + +// Enum type is a subtype of Number +var x: number = E1.A; + +// Enum object type is anonymous with properties of the enum type and numeric indexer +var e = E1; +var e: { + A: E1; + B: E1; + C: E1; + [n: number]: string; +}; +var e: typeof E1; + +// Reverse mapping of enum returns string name of property +var s = E1[e.A]; +var s: string; + + +// Enum with only constant members +enum E2 { + A = 1, B = 2, C = 3 +} + +// Enum with only computed members +enum E3 { + X = 'foo'.length, Y = 4 + 3, Z = +'foo' +} + +// Enum with constant members followed by computed members +enum E4 { + X = 0, Y, Z = 'foo'.length +} + +// Enum with > 2 constant members with no initializer for first member, non zero initializer for second element +enum E5 { + A, + B = 3, + C // 4 +} + +enum E6 { + A, + B = 0, + C // 1 +} + +// Enum with computed member initializer of type 'any' +enum E7 { + A = 'foo'['foo'] +} + +// Enum with computed member initializer of type number +enum E8 { + B = 'foo'['foo'] +} + +//Enum with computed member intializer of same enum type +enum E9 { + A, + B = A +} + +// (refer to .js to validate) +// Enum constant members are propagated +var doNotPropagate = [ + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z +]; +// Enum computed members are not propagated +var doPropagate = [ + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C +]; + + + +//// [enumBasics.js] +var E1; +(function (E1) { + E1[E1["A"] = 0] = "A"; + E1[E1["B"] = 1] = "B"; + E1[E1["C"] = 2] = "C"; +})(E1 || (E1 = {})); +var x = 0 /* A */; +var e = E1; +var e; +var e; +var s = E1[0 /* A */]; +var s; +var E2; +(function (E2) { + E2[E2["A"] = 1] = "A"; + E2[E2["B"] = 2] = "B"; + E2[E2["C"] = 3] = "C"; +})(E2 || (E2 = {})); +var E3; +(function (E3) { + E3[E3["X"] = 'foo'.length] = "X"; + E3[E3["Y"] = 4 + 3] = "Y"; + E3[E3["Z"] = +'foo'] = "Z"; +})(E3 || (E3 = {})); +var E4; +(function (E4) { + E4[E4["X"] = 0] = "X"; + E4[E4["Y"] = 1] = "Y"; + E4[E4["Z"] = 'foo'.length] = "Z"; +})(E4 || (E4 = {})); +var E5; +(function (E5) { + E5[E5["A"] = 0] = "A"; + E5[E5["B"] = 3] = "B"; + E5[E5["C"] = 4] = "C"; +})(E5 || (E5 = {})); +var E6; +(function (E6) { + E6[E6["A"] = 0] = "A"; + E6[E6["B"] = 0] = "B"; + E6[E6["C"] = 1] = "C"; +})(E6 || (E6 = {})); +var E7; +(function (E7) { + E7[E7["A"] = 'foo'['foo']] = "A"; +})(E7 || (E7 = {})); +var E8; +(function (E8) { + E8[E8["B"] = 'foo'['foo']] = "B"; +})(E8 || (E8 = {})); +var E9; +(function (E9) { + E9[E9["A"] = 0] = "A"; + E9[E9["B"] = E9.A] = "B"; +})(E9 || (E9 = {})); +var doNotPropagate = [ + E8.B, + E7.A, + E4.Z, + E3.X, + E3.Y, + E3.Z +]; +var doPropagate = [ + 0 /* A */, + E9.B, + 0 /* B */, + 1 /* C */, + 0 /* A */, + 0 /* A */, + 3 /* B */, + 4 /* C */ +]; diff --git a/tests/baselines/reference/enumBasics1.errors.txt b/tests/baselines/reference/enumBasics1.errors.txt new file mode 100644 index 0000000000000..8f193634fede4 --- /dev/null +++ b/tests/baselines/reference/enumBasics1.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/enumBasics1.ts (1 errors) ==== + enum E { + A = 1, + B, + C + } + + /* + var a: E; + var b = E["B"]; // shouldn't error + + + function foo(e: E) {} + + foo(a); // shouldn't error + + + class C { + public e: E; + + public m(): E { return this.e; } // shouldn't error + } + + + var e = E; // shouldn't error + */ + E.A.A; // should error + ~ +!!! Property 'A' does not exist on type 'E'. + + + enum E2 { + A, + B, + } + + enum E2 { // shouldn't error + C, + D, + } \ No newline at end of file diff --git a/tests/baselines/reference/enumBasics1.js b/tests/baselines/reference/enumBasics1.js new file mode 100644 index 0000000000000..3d3253ea92cae --- /dev/null +++ b/tests/baselines/reference/enumBasics1.js @@ -0,0 +1,57 @@ +//// [enumBasics1.ts] +enum E { + A = 1, + B, + C +} + +/* +var a: E; +var b = E["B"]; // shouldn't error + + +function foo(e: E) {} + +foo(a); // shouldn't error + + +class C { + public e: E; + + public m(): E { return this.e; } // shouldn't error +} + + +var e = E; // shouldn't error +*/ +E.A.A; // should error + + +enum E2 { + A, + B, +} + +enum E2 { // shouldn't error + C, + D, +} + +//// [enumBasics1.js] +var E; +(function (E) { + E[E["A"] = 1] = "A"; + E[E["B"] = 2] = "B"; + E[E["C"] = 3] = "C"; +})(E || (E = {})); +1 /* A */.A; +var E2; +(function (E2) { + E2[E2["A"] = 0] = "A"; + E2[E2["B"] = 1] = "B"; +})(E2 || (E2 = {})); +var E2; +(function (E2) { + E2[E2["C"] = 0] = "C"; + E2[E2["D"] = 1] = "D"; +})(E2 || (E2 = {})); diff --git a/tests/baselines/reference/enumCodeGenNewLines1.js b/tests/baselines/reference/enumCodeGenNewLines1.js new file mode 100644 index 0000000000000..6bdc967792268 --- /dev/null +++ b/tests/baselines/reference/enumCodeGenNewLines1.js @@ -0,0 +1,15 @@ +//// [enumCodeGenNewLines1.ts] +enum foo { + b = 1, + c = 2, + d = 3 +} + + +//// [enumCodeGenNewLines1.js] +var foo; +(function (foo) { + foo[foo["b"] = 1] = "b"; + foo[foo["c"] = 2] = "c"; + foo[foo["d"] = 3] = "d"; +})(foo || (foo = {})); diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt new file mode 100644 index 0000000000000..7fb893354a9dd --- /dev/null +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts (2 errors) ==== + enum Position { + IgnoreRulesSpecific = 0, + } + var x = IgnoreRulesSpecific. + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IgnoreRulesSpecific'. + var y = Position.IgnoreRulesSpecific; + ~ +!!! ',' expected. + \ No newline at end of file diff --git a/tests/baselines/reference/enumDecl1.js b/tests/baselines/reference/enumDecl1.js new file mode 100644 index 0000000000000..091d58c69098f --- /dev/null +++ b/tests/baselines/reference/enumDecl1.js @@ -0,0 +1,15 @@ +//// [enumDecl1.ts] + +declare module mAmbient { + enum e { + x, + y, + z + } +} + + +//// [enumDecl1.js] + + +//// [enumDecl1.d.ts] diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt new file mode 100644 index 0000000000000..69993d81099b1 --- /dev/null +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/conformance/enums/enumErrors.ts (11 errors) ==== + // Enum named with PredefinedTypes + enum any { } + ~~~ +!!! Enum name cannot be 'any' + enum number { } + ~~~~~~ +!!! Enum name cannot be 'number' + enum string { } + ~~~~~~ +!!! Enum name cannot be 'string' + enum boolean { } + ~~~~~~~ +!!! Enum name cannot be 'boolean' + + // Enum with computed member initializer of type Number + enum E5 { + C = new Number(30) + ~~~~~~~~~~~~~~ +!!! Type 'Number' is not assignable to type 'E5'. + } + + enum E9 { + A, + B = A + } + + //Enum with computed member intializer of different enum type + // Bug 707850: This should be allowed + enum E10 { + A = E9.A, + ~~~~ +!!! Type 'E9' is not assignable to type 'E10'. + B = E9.B + ~~~~ +!!! Type 'E9' is not assignable to type 'E10'. + } + + // Enum with computed member intializer of other types + enum E11 { + A = '', + ~~ +!!! Type 'string' is not assignable to type 'E11'. + B = new Date(), + ~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'E11'. + C = window, + ~~~~~~ +!!! Cannot find name 'window'. + D = {} + ~~ +!!! Type '{}' is not assignable to type 'E11'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/enumErrors.js b/tests/baselines/reference/enumErrors.js new file mode 100644 index 0000000000000..44830d14f3f43 --- /dev/null +++ b/tests/baselines/reference/enumErrors.js @@ -0,0 +1,67 @@ +//// [enumErrors.ts] +// Enum named with PredefinedTypes +enum any { } +enum number { } +enum string { } +enum boolean { } + +// Enum with computed member initializer of type Number +enum E5 { + C = new Number(30) +} + +enum E9 { + A, + B = A +} + +//Enum with computed member intializer of different enum type +// Bug 707850: This should be allowed +enum E10 { + A = E9.A, + B = E9.B +} + +// Enum with computed member intializer of other types +enum E11 { + A = '', + B = new Date(), + C = window, + D = {} +} + + +//// [enumErrors.js] +var any; +(function (any) { +})(any || (any = {})); +var number; +(function (number) { +})(number || (number = {})); +var string; +(function (string) { +})(string || (string = {})); +var boolean; +(function (boolean) { +})(boolean || (boolean = {})); +var E5; +(function (E5) { + E5[E5["C"] = new Number(30)] = "C"; +})(E5 || (E5 = {})); +var E9; +(function (E9) { + E9[E9["A"] = 0] = "A"; + E9[E9["B"] = E9.A] = "B"; +})(E9 || (E9 = {})); +var E10; +(function (E10) { + E10[E10["A"] = 0 /* A */] = "A"; + E10[E10["B"] = E9.B] = "B"; +})(E10 || (E10 = {})); +var E11; +(function (E11) { + E11[E11["A"] = ''] = "A"; + E11[E11["B"] = new Date()] = "B"; + E11[E11["C"] = window] = "C"; + E11[E11["D"] = {}] = "D"; +})(E11 || (E11 = {})); diff --git a/tests/baselines/reference/enumFromExternalModule.js b/tests/baselines/reference/enumFromExternalModule.js new file mode 100644 index 0000000000000..7d15d9c394b97 --- /dev/null +++ b/tests/baselines/reference/enumFromExternalModule.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/enumFromExternalModule.ts] //// + +//// [enumFromExternalModule_0.ts] +export enum Mode { Open } + +//// [enumFromExternalModule_1.ts] +/// +import f = require('enumFromExternalModule_0'); + +var x = f.Mode.Open; + + +//// [enumFromExternalModule_0.js] +(function (Mode) { + Mode[Mode["Open"] = 0] = "Open"; +})(exports.Mode || (exports.Mode = {})); +var Mode = exports.Mode; +//// [enumFromExternalModule_1.js] +var f = require('enumFromExternalModule_0'); +var x = 0 /* Open */; diff --git a/tests/baselines/reference/enumGenericTypeClash.errors.txt b/tests/baselines/reference/enumGenericTypeClash.errors.txt new file mode 100644 index 0000000000000..df7f1d77ed0b4 --- /dev/null +++ b/tests/baselines/reference/enumGenericTypeClash.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/enumGenericTypeClash.ts (1 errors) ==== + class X { } + enum X { MyVal } + ~ +!!! Duplicate identifier 'X'. + \ No newline at end of file diff --git a/tests/baselines/reference/enumGenericTypeClash.js b/tests/baselines/reference/enumGenericTypeClash.js new file mode 100644 index 0000000000000..849fd2c59d63d --- /dev/null +++ b/tests/baselines/reference/enumGenericTypeClash.js @@ -0,0 +1,15 @@ +//// [enumGenericTypeClash.ts] +class X { } +enum X { MyVal } + + +//// [enumGenericTypeClash.js] +var X = (function () { + function X() { + } + return X; +})(); +var X; +(function (X) { + X[X["MyVal"] = 0] = "MyVal"; +})(X || (X = {})); diff --git a/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt b/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt new file mode 100644 index 0000000000000..0ddd45d5ed9a9 --- /dev/null +++ b/tests/baselines/reference/enumIdenticalIdentifierValues.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/enumIdenticalIdentifierValues.ts (1 errors) ==== + enum Enum { + 1, + 1.0 + ~~~ +!!! Duplicate identifier '1.0'. + } \ No newline at end of file diff --git a/tests/baselines/reference/enumIdenticalIdentifierValues.js b/tests/baselines/reference/enumIdenticalIdentifierValues.js new file mode 100644 index 0000000000000..3f435ac653773 --- /dev/null +++ b/tests/baselines/reference/enumIdenticalIdentifierValues.js @@ -0,0 +1,12 @@ +//// [enumIdenticalIdentifierValues.ts] +enum Enum { + 1, + 1.0 +} + +//// [enumIdenticalIdentifierValues.js] +var Enum; +(function (Enum) { + Enum[Enum["1"] = 0] = "1"; + Enum[Enum["1"] = 1] = "1"; +})(Enum || (Enum = {})); diff --git a/tests/baselines/reference/enumIdentifierLiterals.js b/tests/baselines/reference/enumIdentifierLiterals.js new file mode 100644 index 0000000000000..72a8a56570c8b --- /dev/null +++ b/tests/baselines/reference/enumIdentifierLiterals.js @@ -0,0 +1,18 @@ +//// [enumIdentifierLiterals.ts] +enum Nums { + 1.0, + 11e-1, + 0.12e1, + "13e-1", + 0xF00D +} + +//// [enumIdentifierLiterals.js] +var Nums; +(function (Nums) { + Nums[Nums["1"] = 0] = "1"; + Nums[Nums["1.1"] = 1] = "1.1"; + Nums[Nums["1.2"] = 2] = "1.2"; + Nums[Nums["13e-1"] = 3] = "13e-1"; + Nums[Nums["61453"] = 4] = "61453"; +})(Nums || (Nums = {})); diff --git a/tests/baselines/reference/enumIndexer.js b/tests/baselines/reference/enumIndexer.js new file mode 100644 index 0000000000000..b2b7244121144 --- /dev/null +++ b/tests/baselines/reference/enumIndexer.js @@ -0,0 +1,18 @@ +//// [enumIndexer.ts] +enum MyEnumType { + foo, bar +} +var _arr = [{ key: 'foo' }, { key: 'bar' }] +var enumValue = MyEnumType.foo; +var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type + + +//// [enumIndexer.js] +var MyEnumType; +(function (MyEnumType) { + MyEnumType[MyEnumType["foo"] = 0] = "foo"; + MyEnumType[MyEnumType["bar"] = 1] = "bar"; +})(MyEnumType || (MyEnumType = {})); +var _arr = [{ key: 'foo' }, { key: 'bar' }]; +var enumValue = 0 /* foo */; +var x = _arr.map(function (o) { return MyEnumType[o.key] === enumValue; }); diff --git a/tests/baselines/reference/enumInitializersWithExponents.errors.txt b/tests/baselines/reference/enumInitializersWithExponents.errors.txt new file mode 100644 index 0000000000000..60649475f78e6 --- /dev/null +++ b/tests/baselines/reference/enumInitializersWithExponents.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/enumInitializersWithExponents.ts (2 errors) ==== + // Must be integer literals. + declare enum E { + a = 1e3, // ok + b = 1e25, // ok + c = 1e-3, // error + ~ +!!! Ambient enum elements can only have integer literal initializers. + d = 1e-9, // error + ~ +!!! Ambient enum elements can only have integer literal initializers. + e = 1e0, // ok + f = 1e+25 // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt new file mode 100644 index 0000000000000..28798c1e4769b --- /dev/null +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt @@ -0,0 +1,165 @@ +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts (17 errors) ==== + // enums are only subtypes of number, any and no other types + + enum E { A } + interface I { + [x: string]: any; + foo: E; // ok + } + + + interface I2 { + [x: string]: number; + foo: E; // ok + } + + // error cases + interface I3 { + [x: string]: string; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'string'. + } + + + interface I4 { + [x: string]: boolean; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'boolean'. + } + + + interface I5 { + [x: string]: Date; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'Date'. + } + + + interface I6 { + [x: string]: RegExp; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'RegExp'. + } + + + interface I7 { + [x: string]: { bar: number }; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type '{ bar: number; }'. + } + + + interface I8 { + [x: string]: number[]; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'number[]'. + } + + + interface I9 { + [x: string]: I8; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'I8'. + } + + class A { foo: number; } + interface I10 { + [x: string]: A; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'A'. + } + + class A2 { foo: T; } + interface I11 { + [x: string]: A2; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'A2'. + } + + + interface I12 { + [x: string]: (x) => number; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type '(x: any) => number'. + } + + + interface I13 { + [x: string]: (x: T) => T; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type '(x: T) => T'. + } + + + enum E2 { A } + interface I14 { + [x: string]: E2; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'E2'. + } + + + function f() { } + module f { + export var bar = 1; + } + interface I15 { + [x: string]: typeof f; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'typeof f'. + } + + + class c { baz: string } + module c { + export var bar = 1; + } + interface I16 { + [x: string]: typeof c; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'typeof c'. + } + + + interface I17 { + [x: string]: T; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'T'. + } + + + interface I18 { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + [x: string]: U; + foo: E; + ~~~~~~~ +!!! Property 'foo' of type 'E' is not assignable to string index type 'U'. + } + + + interface I19 { + [x: string]: Object; + foo: E; // BUG 831833 + } + + + interface I20 { + [x: string]: {}; + foo: E; // BUG 831833 + } \ No newline at end of file diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js new file mode 100644 index 0000000000000..a3ac71b5200b5 --- /dev/null +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.js @@ -0,0 +1,166 @@ +//// [enumIsNotASubtypeOfAnythingButNumber.ts] +// enums are only subtypes of number, any and no other types + +enum E { A } +interface I { + [x: string]: any; + foo: E; // ok +} + + +interface I2 { + [x: string]: number; + foo: E; // ok +} + +// error cases +interface I3 { + [x: string]: string; + foo: E; +} + + +interface I4 { + [x: string]: boolean; + foo: E; +} + + +interface I5 { + [x: string]: Date; + foo: E; +} + + +interface I6 { + [x: string]: RegExp; + foo: E; +} + + +interface I7 { + [x: string]: { bar: number }; + foo: E; +} + + +interface I8 { + [x: string]: number[]; + foo: E; +} + + +interface I9 { + [x: string]: I8; + foo: E; +} + +class A { foo: number; } +interface I10 { + [x: string]: A; + foo: E; +} + +class A2 { foo: T; } +interface I11 { + [x: string]: A2; + foo: E; +} + + +interface I12 { + [x: string]: (x) => number; + foo: E; +} + + +interface I13 { + [x: string]: (x: T) => T; + foo: E; +} + + +enum E2 { A } +interface I14 { + [x: string]: E2; + foo: E; +} + + +function f() { } +module f { + export var bar = 1; +} +interface I15 { + [x: string]: typeof f; + foo: E; +} + + +class c { baz: string } +module c { + export var bar = 1; +} +interface I16 { + [x: string]: typeof c; + foo: E; +} + + +interface I17 { + [x: string]: T; + foo: E; +} + + +interface I18 { + [x: string]: U; + foo: E; +} + + +interface I19 { + [x: string]: Object; + foo: E; // BUG 831833 +} + + +interface I20 { + [x: string]: {}; + foo: E; // BUG 831833 +} + +//// [enumIsNotASubtypeOfAnythingButNumber.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var A = (function () { + function A() { + } + return A; +})(); +var A2 = (function () { + function A2() { + } + return A2; +})(); +var E2; +(function (E2) { + E2[E2["A"] = 0] = "A"; +})(E2 || (E2 = {})); +function f() { +} +var f; +(function (f) { + f.bar = 1; +})(f || (f = {})); +var c = (function () { + function c() { + } + return c; +})(); +var c; +(function (c) { + c.bar = 1; +})(c || (c = {})); diff --git a/tests/baselines/reference/enumMapBackIntoItself.js b/tests/baselines/reference/enumMapBackIntoItself.js new file mode 100644 index 0000000000000..3402e3375df9e --- /dev/null +++ b/tests/baselines/reference/enumMapBackIntoItself.js @@ -0,0 +1,21 @@ +//// [enumMapBackIntoItself.ts] +enum TShirtSize { + Small, + Medium, + Large +} +var mySize = TShirtSize.Large; +var test = TShirtSize[mySize]; +// specifically checking output here, bug was that test used to be undefined at runtime +test + '' + +//// [enumMapBackIntoItself.js] +var TShirtSize; +(function (TShirtSize) { + TShirtSize[TShirtSize["Small"] = 0] = "Small"; + TShirtSize[TShirtSize["Medium"] = 1] = "Medium"; + TShirtSize[TShirtSize["Large"] = 2] = "Large"; +})(TShirtSize || (TShirtSize = {})); +var mySize = 2 /* Large */; +var test = TShirtSize[mySize]; +test + ''; diff --git a/tests/baselines/reference/enumMemberResolution.errors.txt b/tests/baselines/reference/enumMemberResolution.errors.txt new file mode 100644 index 0000000000000..71f6f8e45b516 --- /dev/null +++ b/tests/baselines/reference/enumMemberResolution.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/enumMemberResolution.ts (2 errors) ==== + enum Position2 { + IgnoreRulesSpecific = 0 + } + var x = IgnoreRulesSpecific. // error + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IgnoreRulesSpecific'. + var y = 1; + ~ +!!! ',' expected. + var z = Position2.IgnoreRulesSpecific; // no error + \ No newline at end of file diff --git a/tests/baselines/reference/enumMerging.js b/tests/baselines/reference/enumMerging.js new file mode 100644 index 0000000000000..c92e2aad3474c --- /dev/null +++ b/tests/baselines/reference/enumMerging.js @@ -0,0 +1,169 @@ +//// [enumMerging.ts] +// Enum with only constant members across 2 declarations with the same root module +// Enum with initializer in all declarations with constant members with the same root module +module M1 { + enum EImpl1 { + A, B, C + } + + enum EImpl1 { + D = 1, E, F + } + + export enum EConst1 { + A = 3, B = 2, C = 1 + } + + export enum EConst1 { + D = 7, E = 9, F = 8 + } + + var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; +} + +// Enum with only computed members across 2 declarations with the same root module +module M2 { + export enum EComp2 { + A = 'foo'.length, B = 'foo'.length, C = 'foo'.length + } + + export enum EComp2 { + D = 'foo'.length, E = 'foo'.length, F = 'foo'.length + } + + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; +} + +// Enum with initializer in only one of two declarations with constant members with the same root module +module M3 { + enum EInit { + A, + B + } + + enum EInit { + C = 1, D, E + } +} + +// Enums with same name but different root module +module M4 { + export enum Color { Red, Green, Blue } +} +module M5 { + export enum Color { Red, Green, Blue } +} + +module M6.A { + export enum Color { Red, Green, Blue } +} +module M6 { + export module A { + export enum Color { Yellow = 1 } + } + var t = A.Color.Yellow; + t = A.Color.Red; +} + + +//// [enumMerging.js] +var M1; +(function (M1) { + var EImpl1; + (function (EImpl1) { + EImpl1[EImpl1["A"] = 0] = "A"; + EImpl1[EImpl1["B"] = 1] = "B"; + EImpl1[EImpl1["C"] = 2] = "C"; + })(EImpl1 || (EImpl1 = {})); + var EImpl1; + (function (EImpl1) { + EImpl1[EImpl1["D"] = 1] = "D"; + EImpl1[EImpl1["E"] = 2] = "E"; + EImpl1[EImpl1["F"] = 3] = "F"; + })(EImpl1 || (EImpl1 = {})); + (function (EConst1) { + EConst1[EConst1["A"] = 3] = "A"; + EConst1[EConst1["B"] = 2] = "B"; + EConst1[EConst1["C"] = 1] = "C"; + })(M1.EConst1 || (M1.EConst1 = {})); + var EConst1 = M1.EConst1; + (function (EConst1) { + EConst1[EConst1["D"] = 7] = "D"; + EConst1[EConst1["E"] = 9] = "E"; + EConst1[EConst1["F"] = 8] = "F"; + })(M1.EConst1 || (M1.EConst1 = {})); + var EConst1 = M1.EConst1; + var x = [3 /* A */, 2 /* B */, 1 /* C */, 7 /* D */, 9 /* E */, 8 /* F */]; +})(M1 || (M1 = {})); +var M2; +(function (M2) { + (function (EComp2) { + EComp2[EComp2["A"] = 'foo'.length] = "A"; + EComp2[EComp2["B"] = 'foo'.length] = "B"; + EComp2[EComp2["C"] = 'foo'.length] = "C"; + })(M2.EComp2 || (M2.EComp2 = {})); + var EComp2 = M2.EComp2; + (function (EComp2) { + EComp2[EComp2["D"] = 'foo'.length] = "D"; + EComp2[EComp2["E"] = 'foo'.length] = "E"; + EComp2[EComp2["F"] = 'foo'.length] = "F"; + })(M2.EComp2 || (M2.EComp2 = {})); + var EComp2 = M2.EComp2; + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; +})(M2 || (M2 = {})); +var M3; +(function (M3) { + var EInit; + (function (EInit) { + EInit[EInit["A"] = 0] = "A"; + EInit[EInit["B"] = 1] = "B"; + })(EInit || (EInit = {})); + var EInit; + (function (EInit) { + EInit[EInit["C"] = 1] = "C"; + EInit[EInit["D"] = 2] = "D"; + EInit[EInit["E"] = 3] = "E"; + })(EInit || (EInit = {})); +})(M3 || (M3 = {})); +var M4; +(function (M4) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + Color[Color["Blue"] = 2] = "Blue"; + })(M4.Color || (M4.Color = {})); + var Color = M4.Color; +})(M4 || (M4 = {})); +var M5; +(function (M5) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + Color[Color["Blue"] = 2] = "Blue"; + })(M5.Color || (M5.Color = {})); + var Color = M5.Color; +})(M5 || (M5 = {})); +var M6; +(function (M6) { + (function (A) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + Color[Color["Blue"] = 2] = "Blue"; + })(A.Color || (A.Color = {})); + var Color = A.Color; + })(M6.A || (M6.A = {})); + var A = M6.A; +})(M6 || (M6 = {})); +var M6; +(function (M6) { + (function (A) { + (function (Color) { + Color[Color["Yellow"] = 1] = "Yellow"; + })(A.Color || (A.Color = {})); + var Color = A.Color; + })(M6.A || (M6.A = {})); + var A = M6.A; + var t = 1 /* Yellow */; + t = 0 /* Red */; +})(M6 || (M6 = {})); diff --git a/tests/baselines/reference/enumMergingErrors.js b/tests/baselines/reference/enumMergingErrors.js new file mode 100644 index 0000000000000..8bca227f17378 --- /dev/null +++ b/tests/baselines/reference/enumMergingErrors.js @@ -0,0 +1,132 @@ +//// [enumMergingErrors.ts] +// Enum with constant, computed, constant members split across 3 declarations with the same root module +module M { + export enum E1 { A = 0 } + export enum E2 { C } + export enum E3 { A = 0 } +} +module M { + export enum E1 { B = 'foo'.length } + export enum E2 { B = 'foo'.length } + export enum E3 { C } +} +module M { + export enum E1 { C } + export enum E2 { A = 0 } + export enum E3 { B = 'foo'.length } +} + +// Enum with no initializer in either declaration with constant members with the same root module +module M1 { + export enum E1 { A = 0 } +} +module M1 { + export enum E1 { B } +} +module M1 { + export enum E1 { C } +} + + +// Enum with initializer in only one of three declarations with constant members with the same root module +module M2 { + export enum E1 { A } +} +module M2 { + export enum E1 { B = 0 } +} +module M2 { + export enum E1 { C } +} + + + + +//// [enumMergingErrors.js] +var M; +(function (M) { + (function (E1) { + E1[E1["A"] = 0] = "A"; + })(M.E1 || (M.E1 = {})); + var E1 = M.E1; + (function (E2) { + E2[E2["C"] = 0] = "C"; + })(M.E2 || (M.E2 = {})); + var E2 = M.E2; + (function (E3) { + E3[E3["A"] = 0] = "A"; + })(M.E3 || (M.E3 = {})); + var E3 = M.E3; +})(M || (M = {})); +var M; +(function (M) { + (function (E1) { + E1[E1["B"] = 'foo'.length] = "B"; + })(M.E1 || (M.E1 = {})); + var E1 = M.E1; + (function (E2) { + E2[E2["B"] = 'foo'.length] = "B"; + })(M.E2 || (M.E2 = {})); + var E2 = M.E2; + (function (E3) { + E3[E3["C"] = 0] = "C"; + })(M.E3 || (M.E3 = {})); + var E3 = M.E3; +})(M || (M = {})); +var M; +(function (M) { + (function (E1) { + E1[E1["C"] = 0] = "C"; + })(M.E1 || (M.E1 = {})); + var E1 = M.E1; + (function (E2) { + E2[E2["A"] = 0] = "A"; + })(M.E2 || (M.E2 = {})); + var E2 = M.E2; + (function (E3) { + E3[E3["B"] = 'foo'.length] = "B"; + })(M.E3 || (M.E3 = {})); + var E3 = M.E3; +})(M || (M = {})); +var M1; +(function (M1) { + (function (E1) { + E1[E1["A"] = 0] = "A"; + })(M1.E1 || (M1.E1 = {})); + var E1 = M1.E1; +})(M1 || (M1 = {})); +var M1; +(function (M1) { + (function (E1) { + E1[E1["B"] = 0] = "B"; + })(M1.E1 || (M1.E1 = {})); + var E1 = M1.E1; +})(M1 || (M1 = {})); +var M1; +(function (M1) { + (function (E1) { + E1[E1["C"] = 0] = "C"; + })(M1.E1 || (M1.E1 = {})); + var E1 = M1.E1; +})(M1 || (M1 = {})); +var M2; +(function (M2) { + (function (E1) { + E1[E1["A"] = 0] = "A"; + })(M2.E1 || (M2.E1 = {})); + var E1 = M2.E1; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (E1) { + E1[E1["B"] = 0] = "B"; + })(M2.E1 || (M2.E1 = {})); + var E1 = M2.E1; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (E1) { + E1[E1["C"] = 0] = "C"; + })(M2.E1 || (M2.E1 = {})); + var E1 = M2.E1; +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/enumNegativeLiteral1.js b/tests/baselines/reference/enumNegativeLiteral1.js new file mode 100644 index 0000000000000..39b03acb7265f --- /dev/null +++ b/tests/baselines/reference/enumNegativeLiteral1.js @@ -0,0 +1,13 @@ +//// [enumNegativeLiteral1.ts] +enum E { + a = -5, b, c +} + + +//// [enumNegativeLiteral1.js] +var E; +(function (E) { + E[E["a"] = -5] = "a"; + E[E["b"] = -4] = "b"; + E[E["c"] = -3] = "c"; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumNumbering1.js b/tests/baselines/reference/enumNumbering1.js new file mode 100644 index 0000000000000..40bf821a0882d --- /dev/null +++ b/tests/baselines/reference/enumNumbering1.js @@ -0,0 +1,19 @@ +//// [enumNumbering1.ts] +enum Test { + A, + B, + C = Math.floor(Math.random() * 1000), + D = 10, + E // Error but shouldn't be +} + + +//// [enumNumbering1.js] +var Test; +(function (Test) { + Test[Test["A"] = 0] = "A"; + Test[Test["B"] = 1] = "B"; + Test[Test["C"] = Math.floor(Math.random() * 1000)] = "C"; + Test[Test["D"] = 10] = "D"; + Test[Test["E"] = 11] = "E"; +})(Test || (Test = {})); diff --git a/tests/baselines/reference/enumOperations.js b/tests/baselines/reference/enumOperations.js new file mode 100644 index 0000000000000..902079c04c08d --- /dev/null +++ b/tests/baselines/reference/enumOperations.js @@ -0,0 +1,35 @@ +//// [enumOperations.ts] +enum Enum { None = 0 } +var enumType: Enum = Enum.None; +var numberType: number = 0; +var anyType: any = 0; + +enumType ^ numberType; +numberType ^ anyType; + +enumType & anyType; +enumType | anyType; +enumType ^ anyType; +~anyType; +enumType <>anyType; +enumType >>>anyType; + + +//// [enumOperations.js] +var Enum; +(function (Enum) { + Enum[Enum["None"] = 0] = "None"; +})(Enum || (Enum = {})); +var enumType = 0 /* None */; +var numberType = 0; +var anyType = 0; +enumType ^ numberType; +numberType ^ anyType; +enumType & anyType; +enumType | anyType; +enumType ^ anyType; +~anyType; +enumType << anyType; +enumType >> anyType; +enumType >>> anyType; diff --git a/tests/baselines/reference/enumPropertyAccess.errors.txt b/tests/baselines/reference/enumPropertyAccess.errors.txt new file mode 100644 index 0000000000000..6a9886c09685e --- /dev/null +++ b/tests/baselines/reference/enumPropertyAccess.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/enumPropertyAccess.ts (2 errors) ==== + enum Colors { + Red, + Green + } + + var x = Colors.Red; // type of 'x' should be 'Colors' + var p = x.Green; // error + ~~~~~ +!!! Property 'Green' does not exist on type 'Colors'. + x.toFixed(); // ok + + // Now with generics + function fill(f: B) { + f.Green; // error + ~~~~~ +!!! Property 'Green' does not exist on type 'B'. + f.toFixed(); // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/enumPropertyAccess.js b/tests/baselines/reference/enumPropertyAccess.js new file mode 100644 index 0000000000000..156bf0d4ef2b0 --- /dev/null +++ b/tests/baselines/reference/enumPropertyAccess.js @@ -0,0 +1,29 @@ +//// [enumPropertyAccess.ts] +enum Colors { + Red, + Green +} + +var x = Colors.Red; // type of 'x' should be 'Colors' +var p = x.Green; // error +x.toFixed(); // ok + +// Now with generics +function fill(f: B) { + f.Green; // error + f.toFixed(); // ok +} + +//// [enumPropertyAccess.js] +var Colors; +(function (Colors) { + Colors[Colors["Red"] = 0] = "Red"; + Colors[Colors["Green"] = 1] = "Green"; +})(Colors || (Colors = {})); +var x = 0 /* Red */; +var p = x.Green; +x.toFixed(); +function fill(f) { + f.Green; + f.toFixed(); +} diff --git a/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt b/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt new file mode 100644 index 0000000000000..9279067d7fa83 --- /dev/null +++ b/tests/baselines/reference/enumWithParenthesizedInitializer1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/enumWithParenthesizedInitializer1.ts (1 errors) ==== + enum E { + e = -(3 + } + ~ +!!! ')' expected. \ No newline at end of file diff --git a/tests/baselines/reference/enumWithPrimitiveName.errors.txt b/tests/baselines/reference/enumWithPrimitiveName.errors.txt new file mode 100644 index 0000000000000..6274cdcd43d67 --- /dev/null +++ b/tests/baselines/reference/enumWithPrimitiveName.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/enumWithPrimitiveName.ts (3 errors) ==== + enum string { } + ~~~~~~ +!!! Enum name cannot be 'string' + enum number { } + ~~~~~~ +!!! Enum name cannot be 'number' + enum any { } + ~~~ +!!! Enum name cannot be 'any' \ No newline at end of file diff --git a/tests/baselines/reference/enumWithPrimitiveName.js b/tests/baselines/reference/enumWithPrimitiveName.js new file mode 100644 index 0000000000000..4b894b58a803f --- /dev/null +++ b/tests/baselines/reference/enumWithPrimitiveName.js @@ -0,0 +1,15 @@ +//// [enumWithPrimitiveName.ts] +enum string { } +enum number { } +enum any { } + +//// [enumWithPrimitiveName.js] +var string; +(function (string) { +})(string || (string = {})); +var number; +(function (number) { +})(number || (number = {})); +var any; +(function (any) { +})(any || (any = {})); diff --git a/tests/baselines/reference/enumWithQuotedElementName1.js b/tests/baselines/reference/enumWithQuotedElementName1.js new file mode 100644 index 0000000000000..22f6f02f1b76b --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName1.js @@ -0,0 +1,10 @@ +//// [enumWithQuotedElementName1.ts] +enum E { + 'fo"o', +} + +//// [enumWithQuotedElementName1.js] +var E; +(function (E) { + E[E['fo"o'] = 0] = 'fo"o'; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumWithQuotedElementName2.js b/tests/baselines/reference/enumWithQuotedElementName2.js new file mode 100644 index 0000000000000..8490c2b763fb5 --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName2.js @@ -0,0 +1,10 @@ +//// [enumWithQuotedElementName2.ts] +enum E { + "fo'o", +} + +//// [enumWithQuotedElementName2.js] +var E; +(function (E) { + E[E["fo'o"] = 0] = "fo'o"; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumWithUnicodeEscape1.js b/tests/baselines/reference/enumWithUnicodeEscape1.js new file mode 100644 index 0000000000000..df6034924ffb3 --- /dev/null +++ b/tests/baselines/reference/enumWithUnicodeEscape1.js @@ -0,0 +1,11 @@ +//// [enumWithUnicodeEscape1.ts] +enum E { + 'gold \u2730' +} + + +//// [enumWithUnicodeEscape1.js] +var E; +(function (E) { + E[E['gold \u2730'] = 0] = 'gold \u2730'; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt new file mode 100644 index 0000000000000..571bb6906e54d --- /dev/null +++ b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/enumWithoutInitializerAfterComputedMember.ts (1 errors) ==== + enum E { + a, + b = a, + c + ~ +!!! Enum member must have initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations1.js b/tests/baselines/reference/enumsWithMultipleDeclarations1.js new file mode 100644 index 0000000000000..35da126205d77 --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations1.js @@ -0,0 +1,26 @@ +//// [enumsWithMultipleDeclarations1.ts] +enum E { + A +} + +enum E { + B +} + +enum E { + C +} + +//// [enumsWithMultipleDeclarations1.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var E; +(function (E) { + E[E["B"] = 0] = "B"; +})(E || (E = {})); +var E; +(function (E) { + E[E["C"] = 0] = "C"; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations2.js b/tests/baselines/reference/enumsWithMultipleDeclarations2.js new file mode 100644 index 0000000000000..53d0d717711be --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations2.js @@ -0,0 +1,26 @@ +//// [enumsWithMultipleDeclarations2.ts] +enum E { + A +} + +enum E { + B = 1 +} + +enum E { + C +} + +//// [enumsWithMultipleDeclarations2.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var E; +(function (E) { + E[E["B"] = 1] = "B"; +})(E || (E = {})); +var E; +(function (E) { + E[E["C"] = 0] = "C"; +})(E || (E = {})); diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations3.js b/tests/baselines/reference/enumsWithMultipleDeclarations3.js new file mode 100644 index 0000000000000..b6ff6da451ba7 --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations3.js @@ -0,0 +1,13 @@ +//// [enumsWithMultipleDeclarations3.ts] +module E { +} + +enum E { + A +} + +//// [enumsWithMultipleDeclarations3.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt new file mode 100644 index 0000000000000..4a94b22ee7674 --- /dev/null +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/errorForwardReferenceForwadingConstructor.ts (1 errors) ==== + // Error forward referencing derived class with forwarding constructor + + function f() { + var d1 = new derived(); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var d2 = new derived(4); + } + + class base { constructor(public n: number) { } } + class derived extends base { } + \ No newline at end of file diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js new file mode 100644 index 0000000000000..fb68bace6e07b --- /dev/null +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -0,0 +1,36 @@ +//// [errorForwardReferenceForwadingConstructor.ts] +// Error forward referencing derived class with forwarding constructor + +function f() { + var d1 = new derived(); + var d2 = new derived(4); +} + +class base { constructor(public n: number) { } } +class derived extends base { } + + +//// [errorForwardReferenceForwadingConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function f() { + var d1 = new derived(); + var d2 = new derived(4); +} +var base = (function () { + function base(n) { + this.n = n; + } + return base; +})(); +var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + return derived; +})(base); diff --git a/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt new file mode 100644 index 0000000000000..a015fc902abd9 --- /dev/null +++ b/tests/baselines/reference/errorLocationForInterfaceExtension.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/errorLocationForInterfaceExtension.ts (1 errors) ==== + var n = ''; + + interface x extends string { } + ~~~~~~ +!!! Cannot find name 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/errorLocationForInterfaceExtension.js b/tests/baselines/reference/errorLocationForInterfaceExtension.js new file mode 100644 index 0000000000000..df28f40975248 --- /dev/null +++ b/tests/baselines/reference/errorLocationForInterfaceExtension.js @@ -0,0 +1,8 @@ +//// [errorLocationForInterfaceExtension.ts] +var n = ''; + +interface x extends string { } + + +//// [errorLocationForInterfaceExtension.js] +var n = ''; diff --git a/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt new file mode 100644 index 0000000000000..9b19634265d1d --- /dev/null +++ b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/errorMessageOnObjectLiteralType.ts (2 errors) ==== + var x: { + a: string; + b: number; + }; + x.getOwnPropertyNamess(); + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'getOwnPropertyNamess' does not exist on type '{ a: string; b: number; }'. + Object.getOwnPropertyNamess(null); + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'getOwnPropertyNamess' does not exist on type '{ (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/errorMessageOnObjectLiteralType.js b/tests/baselines/reference/errorMessageOnObjectLiteralType.js new file mode 100644 index 0000000000000..656c433ca0ec5 --- /dev/null +++ b/tests/baselines/reference/errorMessageOnObjectLiteralType.js @@ -0,0 +1,12 @@ +//// [errorMessageOnObjectLiteralType.ts] +var x: { + a: string; + b: number; +}; +x.getOwnPropertyNamess(); +Object.getOwnPropertyNamess(null); + +//// [errorMessageOnObjectLiteralType.js] +var x; +x.getOwnPropertyNamess(); +Object.getOwnPropertyNamess(null); diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt new file mode 100644 index 0000000000000..2a563bcada0c9 --- /dev/null +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (1 errors) ==== + var n1: () => boolean = function () { }; // expect an error here + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type '() => boolean': +!!! Type 'void' is not assignable to type 'boolean'. + var n2: () => boolean = function ():boolean { }; // expect an error here + \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.js b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js new file mode 100644 index 0000000000000..45e92ab5099fd --- /dev/null +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js @@ -0,0 +1,10 @@ +//// [errorOnContextuallyTypedReturnType.ts] +var n1: () => boolean = function () { }; // expect an error here +var n2: () => boolean = function ():boolean { }; // expect an error here + + +//// [errorOnContextuallyTypedReturnType.js] +var n1 = function () { +}; +var n2 = function () { +}; diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt new file mode 100644 index 0000000000000..c1975cccdac8c --- /dev/null +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -0,0 +1,115 @@ +==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (20 errors) ==== + //super call in class constructor with no base type + class NoBase { + constructor() { + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + //super call in class member function with no base type + fn() { + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + //super call in class accessor (get and set) with no base type + get foo() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + return null; + } + set foo(v) { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + //super call in class member initializer with no base type + p = super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + + //super call in static class member function with no base type + static fn() { + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + //super call in static class member initializer with no base type + static k = super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + + //super call in static class accessor (get and set) with no base type + static get q() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + return null; + } + static set q(n) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + } + + class Base { private n: T; } + class Derived extends Base { + //super call with type arguments + constructor() { + super(); + ~ +!!! 'super' must be followed by argument list or member access. + super(); + } + } + + + class OtherBase { + private n: string; + } + + class OtherDerived extends OtherBase { + //super call in class member initializer of derived type + t = super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + + fn() { + //super call in class member function of derived type + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + + //super call in class accessor (get and set) of derived type + get foo() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + return null; + } + set foo(n) { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super(); + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/errorSuperPropertyAccess.errors.txt b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt new file mode 100644 index 0000000000000..9833e64eba513 --- /dev/null +++ b/tests/baselines/reference/errorSuperPropertyAccess.errors.txt @@ -0,0 +1,205 @@ +==== tests/cases/conformance/expressions/superPropertyAccess/errorSuperPropertyAccess.ts (38 errors) ==== + //super property access in constructor of class with no base type + //super property access in instance member function of class with no base type + //super property access in instance member accessor(get and set) of class with no base type + class NoBase { + constructor() { + var a = super.prototype; + ~~~~~ +!!! 'super' can only be referenced in a derived class. + var b = super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + fn() { + var a = super.prototype; + ~~~~~ +!!! 'super' can only be referenced in a derived class. + var b = super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + m = super.prototype; + ~~~~~ +!!! 'super' can only be referenced in a derived class. + n = super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + + //super static property access in static member function of class with no base type + //super static property access in static member accessor(get and set) of class with no base type + public static static1() { + super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + + public static get static2() { + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + return ''; + } + + public static set static2(n) { + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super.hasOwnProperty(''); + ~~~~~ +!!! 'super' can only be referenced in a derived class. + } + } + + class SomeBase { + private privateFunc() { } + private privateMember = 0; + + public publicFunc() { } + public publicMember = 0; + + private static privateStaticFunc() { } + private static privateStaticMember = 0; + + public static publicStaticFunc() { } + public static publicStaticMember = 0; + + } + + + //super.publicInstanceMemberNotFunction in constructor of derived class + //super.publicInstanceMemberNotFunction in instance member function of derived class + //super.publicInstanceMemberNotFunction in instance member accessor(get and set) of derived class + //super property access only available with typed this + class SomeDerived1 extends SomeBase { + constructor() { + super(); + super.publicMember = 1; + ~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + + fn() { + var x = super.publicMember; + ~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + + get a() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = super.publicMember; + ~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + return undefined; + } + set a(n) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + n = super.publicMember; + ~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + fn2() { + function inner() { + super.publicFunc(); + ~~~~~ +!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + } + var x = { + test: function () { return super.publicFunc(); } + ~~~~~ +!!! 'super' property access is permitted only in a constructor, member function, or member accessor of a derived class + } + } + } + + //super.privateProperty in constructor of derived class + //super.privateProperty in instance member function of derived class + //super.privateProperty in instance member accessor(get and set) of derived class + class SomeDerived2 extends SomeBase { + constructor() { + super(); + super.privateMember = 1; + ~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + + fn() { + var x = super.privateMember; + ~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + + get a() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x = super.privateMember; + ~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + return undefined; + } + set a(n) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + n = super.privateMember; + ~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + } + + //super.publicStaticMemberNotFunction in static member function of derived class + //super.publicStaticMemberNotFunction in static member accessor(get and set) of derived class + //super.privateStaticProperty in static member function of derived class + //super.privateStaticProperty in static member accessor(get and set) of derived class + class SomeDerived3 extends SomeBase { + static fn() { + super.publicStaticMember = 3; + ~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticMember = 3; + ~~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticFunc(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'SomeBase.privateStaticFunc' is inaccessible. + } + static get a() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super.publicStaticMember = 3; + ~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticMember = 3; + ~~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticFunc(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'SomeBase.privateStaticFunc' is inaccessible. + return ''; + } + static set a(n) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + super.publicStaticMember = 3; + ~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticMember = 3; + ~~~~~~~~~~~~~~~~~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + super.privateStaticFunc(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'SomeBase.privateStaticFunc' is inaccessible. + } + } + + // In object literal + var obj = { n: super.wat, p: super.foo() }; + ~~~~~ +!!! 'super' can only be referenced in a derived class. + ~~~~~ +!!! 'super' can only be referenced in a derived class. + \ No newline at end of file diff --git a/tests/baselines/reference/errorSupression1.errors.txt b/tests/baselines/reference/errorSupression1.errors.txt new file mode 100644 index 0000000000000..f702ea6e643f7 --- /dev/null +++ b/tests/baselines/reference/errorSupression1.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/errorSupression1.ts (1 errors) ==== + + class Foo { static bar() { return "x"; } } + + var baz = Foo.b; + ~ +!!! Property 'b' does not exist on type 'typeof Foo'. + // Foo.b won't bind. + baz.concat("y"); + + // So we don't want an error on 'concat'. \ No newline at end of file diff --git a/tests/baselines/reference/errorSupression1.js b/tests/baselines/reference/errorSupression1.js new file mode 100644 index 0000000000000..47d9811b85e4f --- /dev/null +++ b/tests/baselines/reference/errorSupression1.js @@ -0,0 +1,21 @@ +//// [errorSupression1.ts] + +class Foo { static bar() { return "x"; } } + +var baz = Foo.b; + // Foo.b won't bind. +baz.concat("y"); + + // So we don't want an error on 'concat'. + +//// [errorSupression1.js] +var Foo = (function () { + function Foo() { + } + Foo.bar = function () { + return "x"; + }; + return Foo; +})(); +var baz = Foo.b; +baz.concat("y"); diff --git a/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt b/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt new file mode 100644 index 0000000000000..90c3f43dc4efa --- /dev/null +++ b/tests/baselines/reference/errorTypesAsTypeArguments.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/errorTypesAsTypeArguments.ts (2 errors) ==== + interface Foo { + bar(baz: Foo): Foo; + ~ +!!! Cannot find name 'B'. + ~ +!!! Cannot find name 'C'. + } \ No newline at end of file diff --git a/tests/baselines/reference/errorTypesAsTypeArguments.js b/tests/baselines/reference/errorTypesAsTypeArguments.js new file mode 100644 index 0000000000000..afd35e549562c --- /dev/null +++ b/tests/baselines/reference/errorTypesAsTypeArguments.js @@ -0,0 +1,6 @@ +//// [errorTypesAsTypeArguments.ts] +interface Foo { + bar(baz: Foo): Foo; +} + +//// [errorTypesAsTypeArguments.js] diff --git a/tests/baselines/reference/errorsInGenericTypeReference.errors.txt b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt new file mode 100644 index 0000000000000..0dc6b5a0ab078 --- /dev/null +++ b/tests/baselines/reference/errorsInGenericTypeReference.errors.txt @@ -0,0 +1,117 @@ +==== tests/cases/compiler/errorsInGenericTypeReference.ts (22 errors) ==== + + interface IFoo { } + + class Foo { } + + + // in call type arguments + class testClass1 { + method(): void { } + } + var tc1 = new testClass1(); + tc1.method<{ x: V }>(); // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in constructor type arguments + class testClass2 { + } + var tc2 = new testClass2<{ x: V }>(); // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in method return type annotation + class testClass3 { + testMethod1(): Foo<{ x: V }> { return null; } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + static testMethod2(): Foo<{ x: V }> { return null } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + set a(value: Foo<{ x: V }>) { } // error: could not find symbol V + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Cannot find name 'V'. + property: Foo<{ x: V }>; // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + } + + + // in function return type annotation + function testFunction1(): Foo<{ x: V }> { return null; } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in paramter types + function testFunction2(p: Foo<{ x: V }>) { }// error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in var type annotation + var f: Foo<{ x: V }>; // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in constraints + class testClass4 { } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + interface testClass5> { } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + class testClass6 { + method(): void { } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + } + + interface testInterface1 { + new (a: M); // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + } + + + // in extends clause + class testClass7 extends Foo<{ x: V }> { } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in implements clause + class testClass8 implements IFoo<{ x: V }> { } // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + + + // in signatures + interface testInterface2 { + new (a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V + ~ +!!! Cannot find name 'V'. + ~ +!!! Cannot find name 'V'. + [x: string]: Foo<{ x: V }>; // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + method(a: Foo<{ x: V }>): Foo<{ x: V }>; //2x: error: could not find symbol V + ~ +!!! Cannot find name 'V'. + ~ +!!! Cannot find name 'V'. + property: Foo<{ x: V }>; // error: could not find symbol V + ~ +!!! Cannot find name 'V'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnImportedSymbol.errors.txt b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt new file mode 100644 index 0000000000000..9261bab93fc5a --- /dev/null +++ b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/errorsOnImportedSymbol_1.ts (2 errors) ==== + import Sammy = require("errorsOnImportedSymbol_0"); + var x = new Sammy.Sammy(); + ~~~~~ +!!! Cannot find name 'Sammy'. + var y = Sammy.Sammy(); + ~~~~~ +!!! Cannot find name 'Sammy'. + + +==== tests/cases/compiler/errorsOnImportedSymbol_0.ts (0 errors) ==== + + interface Sammy { + new (): any; + (): number; + } + export = Sammy; + \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnImportedSymbol.js b/tests/baselines/reference/errorsOnImportedSymbol.js new file mode 100644 index 0000000000000..6a001bcd0f106 --- /dev/null +++ b/tests/baselines/reference/errorsOnImportedSymbol.js @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/errorsOnImportedSymbol.ts] //// + +//// [errorsOnImportedSymbol_0.ts] + +interface Sammy { + new (): any; + (): number; +} +export = Sammy; + +//// [errorsOnImportedSymbol_1.ts] +import Sammy = require("errorsOnImportedSymbol_0"); +var x = new Sammy.Sammy(); +var y = Sammy.Sammy(); + + + +//// [errorsOnImportedSymbol_0.js] +//// [errorsOnImportedSymbol_1.js] +var x = new Sammy.Sammy(); +var y = Sammy.Sammy(); diff --git a/tests/baselines/reference/es3-amd.js b/tests/baselines/reference/es3-amd.js new file mode 100644 index 0000000000000..c36c979aac2ed --- /dev/null +++ b/tests/baselines/reference/es3-amd.js @@ -0,0 +1,27 @@ +//// [es3-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es3-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es3-amd.js.map + +//// [es3-amd.d.ts] diff --git a/tests/baselines/reference/es3-amd.js.map b/tests/baselines/reference/es3-amd.js.map new file mode 100644 index 0000000000000..c587e10f9049c --- /dev/null +++ b/tests/baselines/reference/es3-amd.js.map @@ -0,0 +1,2 @@ +//// [es3-amd.js.map] +{"version":3,"file":"es3-amd.js","sourceRoot":"","sources":["es3-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es3-amd.sourcemap.txt b/tests/baselines/reference/es3-amd.sourcemap.txt new file mode 100644 index 0000000000000..226904108dfad --- /dev/null +++ b/tests/baselines/reference/es3-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es3-amd.js +mapUrl: es3-amd.js.map +sourceRoot: +sources: es3-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es3-amd.js +sourceFile:es3-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es3-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es3-declaration-amd.js b/tests/baselines/reference/es3-declaration-amd.js new file mode 100644 index 0000000000000..d05ea891ba8a8 --- /dev/null +++ b/tests/baselines/reference/es3-declaration-amd.js @@ -0,0 +1,27 @@ +//// [es3-declaration-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es3-declaration-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es3-declaration-amd.js.map + +//// [es3-declaration-amd.d.ts] diff --git a/tests/baselines/reference/es3-declaration-amd.js.map b/tests/baselines/reference/es3-declaration-amd.js.map new file mode 100644 index 0000000000000..ccd05b446f774 --- /dev/null +++ b/tests/baselines/reference/es3-declaration-amd.js.map @@ -0,0 +1,2 @@ +//// [es3-declaration-amd.js.map] +{"version":3,"file":"es3-declaration-amd.js","sourceRoot":"","sources":["es3-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es3-declaration-amd.sourcemap.txt b/tests/baselines/reference/es3-declaration-amd.sourcemap.txt new file mode 100644 index 0000000000000..35e5474dd8470 --- /dev/null +++ b/tests/baselines/reference/es3-declaration-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es3-declaration-amd.js +mapUrl: es3-declaration-amd.js.map +sourceRoot: +sources: es3-declaration-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es3-declaration-amd.js +sourceFile:es3-declaration-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es3-declaration-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es3-sourcemap-amd.js b/tests/baselines/reference/es3-sourcemap-amd.js new file mode 100644 index 0000000000000..df673a2fe5600 --- /dev/null +++ b/tests/baselines/reference/es3-sourcemap-amd.js @@ -0,0 +1,25 @@ +//// [es3-sourcemap-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es3-sourcemap-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es3-sourcemap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es3-sourcemap-amd.js.map b/tests/baselines/reference/es3-sourcemap-amd.js.map new file mode 100644 index 0000000000000..d3f8fafc960d8 --- /dev/null +++ b/tests/baselines/reference/es3-sourcemap-amd.js.map @@ -0,0 +1,2 @@ +//// [es3-sourcemap-amd.js.map] +{"version":3,"file":"es3-sourcemap-amd.js","sourceRoot":"","sources":["es3-sourcemap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt new file mode 100644 index 0000000000000..c39c3ccd4b1c5 --- /dev/null +++ b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es3-sourcemap-amd.js +mapUrl: es3-sourcemap-amd.js.map +sourceRoot: +sources: es3-sourcemap-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es3-sourcemap-amd.js +sourceFile:es3-sourcemap-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es3-sourcemap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-amd.js b/tests/baselines/reference/es5-amd.js new file mode 100644 index 0000000000000..d6414f28eeb26 --- /dev/null +++ b/tests/baselines/reference/es5-amd.js @@ -0,0 +1,27 @@ +//// [es5-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es5-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es5-amd.js.map + +//// [es5-amd.d.ts] diff --git a/tests/baselines/reference/es5-amd.js.map b/tests/baselines/reference/es5-amd.js.map new file mode 100644 index 0000000000000..84512d7eece16 --- /dev/null +++ b/tests/baselines/reference/es5-amd.js.map @@ -0,0 +1,2 @@ +//// [es5-amd.js.map] +{"version":3,"file":"es5-amd.js","sourceRoot":"","sources":["es5-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-amd.sourcemap.txt b/tests/baselines/reference/es5-amd.sourcemap.txt new file mode 100644 index 0000000000000..e7586b02a4e87 --- /dev/null +++ b/tests/baselines/reference/es5-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es5-amd.js +mapUrl: es5-amd.js.map +sourceRoot: +sources: es5-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-amd.js +sourceFile:es5-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es5-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-declaration-amd.js b/tests/baselines/reference/es5-declaration-amd.js new file mode 100644 index 0000000000000..c5e6cba8732f9 --- /dev/null +++ b/tests/baselines/reference/es5-declaration-amd.js @@ -0,0 +1,27 @@ +//// [es5-declaration-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es5-declaration-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es5-declaration-amd.js.map + +//// [es5-declaration-amd.d.ts] diff --git a/tests/baselines/reference/es5-declaration-amd.js.map b/tests/baselines/reference/es5-declaration-amd.js.map new file mode 100644 index 0000000000000..8ed2d06ab3f77 --- /dev/null +++ b/tests/baselines/reference/es5-declaration-amd.js.map @@ -0,0 +1,2 @@ +//// [es5-declaration-amd.js.map] +{"version":3,"file":"es5-declaration-amd.js","sourceRoot":"","sources":["es5-declaration-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-declaration-amd.sourcemap.txt b/tests/baselines/reference/es5-declaration-amd.sourcemap.txt new file mode 100644 index 0000000000000..80a60ca6c6aac --- /dev/null +++ b/tests/baselines/reference/es5-declaration-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es5-declaration-amd.js +mapUrl: es5-declaration-amd.js.map +sourceRoot: +sources: es5-declaration-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-declaration-amd.js +sourceFile:es5-declaration-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es5-declaration-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-souremap-amd.js b/tests/baselines/reference/es5-souremap-amd.js new file mode 100644 index 0000000000000..8bfb47fc3b8d6 --- /dev/null +++ b/tests/baselines/reference/es5-souremap-amd.js @@ -0,0 +1,25 @@ +//// [es5-souremap-amd.ts] + +class A +{ + constructor () + { + + } + + public B() + { + return 42; + } +} + +//// [es5-souremap-amd.js] +var A = (function () { + function A() { + } + A.prototype.B = function () { + return 42; + }; + return A; +})(); +//# sourceMappingURL=es5-souremap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es5-souremap-amd.js.map b/tests/baselines/reference/es5-souremap-amd.js.map new file mode 100644 index 0000000000000..64d882aae4727 --- /dev/null +++ b/tests/baselines/reference/es5-souremap-amd.js.map @@ -0,0 +1,2 @@ +//// [es5-souremap-amd.js.map] +{"version":3,"file":"es5-souremap-amd.js","sourceRoot":"","sources":["es5-souremap-amd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA,IAAM,CAAC;IAEHA,SAFEA,CAACA;IAKHC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-souremap-amd.sourcemap.txt b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt new file mode 100644 index 0000000000000..dc614195e28c7 --- /dev/null +++ b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt @@ -0,0 +1,128 @@ +=================================================================== +JsFile: es5-souremap-amd.js +mapUrl: es5-souremap-amd.js.map +sourceRoot: +sources: es5-souremap-amd.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/es5-souremap-amd.js +sourceFile:es5-souremap-amd.ts +------------------------------------------------------------------- +>>>var A = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > A +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) +--- +>>> function A() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> + >{ + > +2 > +3 > A +1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) +3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > constructor () + > { + > + > +2 > } +1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) +2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) +--- +>>> A.prototype.B = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > B +3 > +1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) +2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) +3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public B() + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) +2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) +3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) +2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) +--- +>>> return A; +1->^^^^ +2 > ^^^^^^^^ +1-> + > +2 > } +1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class A + > { + > constructor () + > { + > + > } + > + > public B() + > { + > return 42; + > } + > } +1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) +2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) +3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=es5-souremap-amd.js.map \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js new file mode 100644 index 0000000000000..c5d668c2f3d7e --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -0,0 +1,39 @@ +//// [es6ClassSuperCodegenBug.ts] +class A { + constructor(str1:string, str2:string) {} +} +class B extends A { + constructor() { + if (true) { + super('a1', 'b1'); + } else { + super('a2', 'b2'); + } + } +} + + +//// [es6ClassSuperCodegenBug.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A(str1, str2) { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + if (true) { + _super.call(this, 'a1', 'b1'); + } + else { + _super.call(this, 'a2', 'b2'); + } + } + return B; +})(A); diff --git a/tests/baselines/reference/es6ClassTest.errors.txt b/tests/baselines/reference/es6ClassTest.errors.txt new file mode 100644 index 0000000000000..717089ddeb9d6 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest.errors.txt @@ -0,0 +1,87 @@ +==== tests/cases/compiler/es6ClassTest.ts (1 errors) ==== + class Bar { + public goo: number; + public prop1(x) { + return x; + } + + constructor (n) { } + } + + // new-style class + class Foo extends Bar { + foo:number; + gar = 0; + zoo:string = "zoo"; + x: any; + + bar() { return 0; } + + private boo(); + private boo(x?) { return x; } + + static statVal = 0; + + constructor(); + constructor(x?, private y?:string, public z?=0) { + ~ +!!! Parameter cannot have question mark and initializer. + super(x); + this.x = x; + this.gar = 5; + } + } + + var f = new Foo(); + + declare module AmbientMod { + export class Provide { + foo:number; + zoo:string; + + constructor(); + + private boo(); + bar(); + } + } + + + //class GetSetMonster { + + + // // attack(target) { + // // WScript.Echo("Attacks " + target); + // // } + // // The contextual keyword "get" followed by an identifier and + // // a curly body defines a getter in the same way that "get" + // // defines one in an object literal. + // // get isAlive() { + // // return this.health > 0; + // // } + + // // Likewise, "set" can be used to define setters. + // set health(value:number) { + // if (value < 0) { + // throw new Error('Health must be non-negative.') + // } + // this.health = value + // } + // get health() { return 0; } + + // constructor(this.name: string, health: number) { + // this.health = 0; + // } + //} + + + //class bar { + + // static fnOverload( ); + + // static fnOverload(foo: string){ } // no error + + // constructor(){}; + + //} + \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest2.errors.txt b/tests/baselines/reference/es6ClassTest2.errors.txt new file mode 100644 index 0000000000000..3e3fa2bbee607 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest2.errors.txt @@ -0,0 +1,165 @@ +==== tests/cases/compiler/es6ClassTest2.ts (3 errors) ==== + class BasicMonster { + constructor(public name: string, public health: number) { + + } + + attack(target) { + // WScript.Echo("Attacks " + target); + } + + isAlive = true; + } + + var m1 = new BasicMonster("1", 100); + var m2 = new BasicMonster("2", 100); + m1.attack(m2); + m1.health = 0; + console.log((m5.isAlive).toString()); + ~~~~~~~ +!!! Cannot find name 'console'. + + class GetSetMonster { + constructor(public name: string, private _health: number) { + + } + + attack(target) { + // WScript.Echo("Attacks " + target); + } + // The contextual keyword "get" followed by an identifier and + // a curly body defines a getter in the same way that "get" + // defines one in an object literal. + get isAlive() { + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this._health > 0; + } + + // Likewise, "set" can be used to define setters. + set health(value: number) { + ~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + if (value < 0) { + throw new Error('Health must be non-negative.') + } + this._health = value + } + } + + var m3 = new BasicMonster("1", 100); + var m4 = new BasicMonster("2", 100); + m3.attack(m4); + m3.health = 0; + var x = (m5.isAlive).toString() + + class OverloadedMonster { + constructor(name: string); + constructor(public name: string, public health?: number) { + + } + + attack(); + attack(a: any); + attack(target?) { + //WScript.Echo("Attacks " + target); + } + + isAlive = true; + } + + var m5 = new OverloadedMonster("1"); + var m6 = new OverloadedMonster("2"); + m5.attack(m6); + m5.health = 0; + var y = (m5.isAlive).toString() + + class SplatMonster { + constructor(...args: string[]) { } + roar(name: string, ...args: number[]) { } + } + + + function foo() { return true; } + class PrototypeMonster { + age: number = 1; + name: string; + b = foo(); + } + + class SuperParent { + constructor(a: number) { + + } + + b(b: string) { + + } + + c() { + + } + } + + class SuperChild extends SuperParent { + constructor() { + super(1); + } + + b() { + super.b('str'); + } + + c() { + super.c(); + } + } + + class Statics { + static foo = 1; + static bar: string; + + static baz() { + return ""; + } + } + + var stat = new Statics(); + + interface IFoo { + x: number; + z: string; + } + + class ImplementsInterface implements IFoo { + public x: number; + public z: string; + constructor() { + this.x = 1; + this.z = "foo"; + } + } + + class Visibility { + public foo() { } + private bar() { } + private x: number; + public y: number; + public z: number; + constructor() { + this.x = 1; + this.y = 2; + } + } + + class BaseClassWithConstructor { + constructor(public x: number, public s: string) { } + } + + // used to test codegen + class ChildClassWithoutConstructor extends BaseClassWithConstructor { } + + + var ccwc = new ChildClassWithoutConstructor(1, "s"); + + \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest3.errors.txt b/tests/baselines/reference/es6ClassTest3.errors.txt new file mode 100644 index 0000000000000..d16568b7c2470 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/compiler/es6ClassTest3.ts (15 errors) ==== + module M { + class Visibility { + public foo() { }; + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + private bar() { }; + ~~~~~~~ +!!! Declaration or statement expected. + ~ +!!! ';' expected. + ~~~ +!!! Cannot find name 'bar'. + private x: number; + ~~~~~~~ +!!! Declaration or statement expected. + ~~~~~~ +!!! Cannot find name 'number'. + public y: number; + ~~~~~~ +!!! Declaration or statement expected. + ~~~~~~ +!!! Cannot find name 'number'. + public z: number; + ~~~~~~ +!!! Declaration or statement expected. + ~~~~~~ +!!! Cannot find name 'number'. + + constructor() { + ~ +!!! ';' expected. + ~~~~~~~~~~~ +!!! Cannot find name 'constructor'. + this.x = 1; + ~~~~ +!!! 'this' cannot be referenced in a module body. + this.y = 2; + ~~~~ +!!! 'this' cannot be referenced in a module body. + } + } + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest4.js b/tests/baselines/reference/es6ClassTest4.js new file mode 100644 index 0000000000000..2e7ace047e498 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest4.js @@ -0,0 +1,13 @@ +//// [es6ClassTest4.ts] +declare class Point +{ + x: number; + y: number; + add(dx: number, dy: number): Point; + mult(p: Point): Point; + static origin: Point; + constructor(x: number, y: number); +} + + +//// [es6ClassTest4.js] diff --git a/tests/baselines/reference/es6ClassTest5.js b/tests/baselines/reference/es6ClassTest5.js new file mode 100644 index 0000000000000..b6d3e55b8e1d1 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest5.js @@ -0,0 +1,29 @@ +//// [es6ClassTest5.ts] +class C1T5 { + foo: (i: number, s: string) => number = + (i) => { + return i; + } +} +module C2T5 {} + +class bigClass { + public break = 1; +} + + +//// [es6ClassTest5.js] +var C1T5 = (function () { + function C1T5() { + this.foo = function (i) { + return i; + }; + } + return C1T5; +})(); +var bigClass = (function () { + function bigClass() { + this.break = 1; + } + return bigClass; +})(); diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js new file mode 100644 index 0000000000000..728b4d0a40485 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest7.js @@ -0,0 +1,24 @@ +//// [es6ClassTest7.ts] +declare module M { + export class Foo { + } +} + +class Bar extends M.Foo { +} + + +//// [es6ClassTest7.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; +})(M.Foo); diff --git a/tests/baselines/reference/es6ClassTest8.js b/tests/baselines/reference/es6ClassTest8.js new file mode 100644 index 0000000000000..0ce4982a38fec --- /dev/null +++ b/tests/baselines/reference/es6ClassTest8.js @@ -0,0 +1,88 @@ +//// [es6ClassTest8.ts] +function f1(x:any) {return x;} + +class C { + constructor() { + var bar:any = (function() { + return bar; // 'bar' should be resolvable + }); + var b = f1(f1(bar)); + } + +} + +class Vector { + static norm(v:Vector):Vector {return null;} + static minus(v1:Vector, v2:Vector):Vector {return null;} + static times(v1:Vector, v2:Vector):Vector {return null;} + static cross(v1:Vector, v2:Vector):Vector {return null;} + + constructor(public x: number, + public y: number, + public z: number) { + } + + static dot(v1:Vector, v2:Vector):Vector {return null;} + +} + +class Camera { + public forward: Vector; + public right: Vector; + public up: Vector; + constructor(public pos: Vector, lookAt: Vector) { + var down = new Vector(0.0, -1.0, 0.0); + this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); + this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); + this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); + } +} + + + +//// [es6ClassTest8.js] +function f1(x) { + return x; +} +var C = (function () { + function C() { + var bar = (function () { + return bar; + }); + var b = f1(f1(bar)); + } + return C; +})(); +var Vector = (function () { + function Vector(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + Vector.norm = function (v) { + return null; + }; + Vector.minus = function (v1, v2) { + return null; + }; + Vector.times = function (v1, v2) { + return null; + }; + Vector.cross = function (v1, v2) { + return null; + }; + Vector.dot = function (v1, v2) { + return null; + }; + return Vector; +})(); +var Camera = (function () { + function Camera(pos, lookAt) { + this.pos = pos; + var down = new Vector(0.0, -1.0, 0.0); + this.forward = Vector.norm(Vector.minus(lookAt, this.pos)); + this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); + this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); + } + return Camera; +})(); diff --git a/tests/baselines/reference/es6ClassTest9.errors.txt b/tests/baselines/reference/es6ClassTest9.errors.txt new file mode 100644 index 0000000000000..f5856c71918cc --- /dev/null +++ b/tests/baselines/reference/es6ClassTest9.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/es6ClassTest9.ts (3 errors) ==== + declare class foo(); + ~ +!!! '{' expected. + ~ +!!! '=>' expected. + function foo() {} + ~~~ +!!! Duplicate identifier 'foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/es6DeclOrdering.errors.txt b/tests/baselines/reference/es6DeclOrdering.errors.txt new file mode 100644 index 0000000000000..4d890d0423859 --- /dev/null +++ b/tests/baselines/reference/es6DeclOrdering.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/es6DeclOrdering.ts (2 errors) ==== + class Bar { + + //public bar() { } + + public foo() { + return this._store.length; + ~~~~~~ +!!! Property '_store' does not exist on type 'Bar'. + + } + + constructor(store: string) { + this._store = store; // this is an error for some reason? Unresolved symbol store + ~~~~~~ +!!! Property '_store' does not exist on type 'Bar'. + + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/es6DeclOrdering.js b/tests/baselines/reference/es6DeclOrdering.js new file mode 100644 index 0000000000000..1696ba7ae93e4 --- /dev/null +++ b/tests/baselines/reference/es6DeclOrdering.js @@ -0,0 +1,28 @@ +//// [es6DeclOrdering.ts] +class Bar { + + //public bar() { } + + public foo() { + return this._store.length; + + } + + constructor(store: string) { + this._store = store; // this is an error for some reason? Unresolved symbol store + + } +} + + + +//// [es6DeclOrdering.js] +var Bar = (function () { + function Bar(store) { + this._store = store; + } + Bar.prototype.foo = function () { + return this._store.length; + }; + return Bar; +})(); diff --git a/tests/baselines/reference/es6MemberScoping.errors.txt b/tests/baselines/reference/es6MemberScoping.errors.txt new file mode 100644 index 0000000000000..37c8eeb0d2041 --- /dev/null +++ b/tests/baselines/reference/es6MemberScoping.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/es6MemberScoping.ts (1 errors) ==== + + + class Foo { + constructor(store: string) { } + + public foo() { + return this._store.length; + } + public _store = store; // should be an error. + ~~~~~ +!!! Cannot find name 'store'. + } + + class Foo2 { + + static Foo2():number { return 0; } // should not be an error + + } + \ No newline at end of file diff --git a/tests/baselines/reference/es6MemberScoping.js b/tests/baselines/reference/es6MemberScoping.js new file mode 100644 index 0000000000000..6cfdef9e74334 --- /dev/null +++ b/tests/baselines/reference/es6MemberScoping.js @@ -0,0 +1,37 @@ +//// [es6MemberScoping.ts] + + +class Foo { + constructor(store: string) { } + + public foo() { + return this._store.length; + } + public _store = store; // should be an error. +} + +class Foo2 { + + static Foo2():number { return 0; } // should not be an error + +} + + +//// [es6MemberScoping.js] +var Foo = (function () { + function Foo(store) { + this._store = store; + } + Foo.prototype.foo = function () { + return this._store.length; + }; + return Foo; +})(); +var Foo2 = (function () { + function Foo2() { + } + Foo2.Foo2 = function () { + return 0; + }; + return Foo2; +})(); diff --git a/tests/baselines/reference/escapedIdentifiers.js b/tests/baselines/reference/escapedIdentifiers.js new file mode 100644 index 0000000000000..f68e540cee426 --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.js @@ -0,0 +1,207 @@ +//// [escapedIdentifiers.ts] +/* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za +*/ + +// var decl +var \u0061 = 1; +a ++; +\u0061 ++; + +var b = 1; +b ++; +\u0062 ++; + +// modules +module moduleType1 { + export var baz1: number; +} +module moduleType\u0032 { + export var baz2: number; +} + +moduleType1.baz1 = 3; +moduleType\u0031.baz1 = 3; +moduleType2.baz2 = 3; +moduleType\u0032.baz2 = 3; + +// classes + +class classType1 { + public foo1: number; +} +class classType\u0032 { + public foo2: number; +} + +var classType1Object1 = new classType1(); +classType1Object1.foo1 = 2; +var classType1Object2 = new classType\u0031(); +classType1Object2.foo1 = 2; +var classType2Object1 = new classType2(); +classType2Object1.foo2 = 2; +var classType2Object2 = new classType\u0032(); +classType2Object2.foo2 = 2; + +// interfaces +interface interfaceType1 { + bar1: number; +} +interface interfaceType\u0032 { + bar2: number; +} + +var interfaceType1Object1 = { bar1: 0 }; +interfaceType1Object1.bar1 = 2; +var interfaceType1Object2 = { bar1: 0 }; +interfaceType1Object2.bar1 = 2; +var interfaceType2Object1 = { bar2: 0 }; +interfaceType2Object1.bar2 = 2; +var interfaceType2Object2 = { bar2: 0 }; +interfaceType2Object2.bar2 = 2; + + +// arguments +class testClass { + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { + arg\u0031 = 1; + arg2 = 'string'; + arg\u0033 = true; + arg4 = 2; + } +} + +// constructors +class constructorTestClass { + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { + } +} +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +constructorTestObject.arg\u0031 = 1; +constructorTestObject.arg2 = 'string'; +constructorTestObject.arg\u0033 = true; +constructorTestObject.arg4 = 2; + +// Lables + +l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + +label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + +label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + +l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } + +//// [escapedIdentifiers.js] +var \u0061 = 1; +a++; +\u0061++; +var b = 1; +b++; +\u0062++; +var moduleType1; +(function (moduleType1) { + moduleType1.baz1; +})(moduleType1 || (moduleType1 = {})); +var moduleType\u0032; +(function (moduleType\u0032) { + moduleType\u0032.baz2; +})(moduleType\u0032 || (moduleType\u0032 = {})); +moduleType1.baz1 = 3; +moduleType\u0031.baz1 = 3; +moduleType2.baz2 = 3; +moduleType\u0032.baz2 = 3; +var classType1 = (function () { + function classType1() { + } + return classType1; +})(); +var classType\u0032 = (function () { + function classType\u0032() { + } + return classType\u0032; +})(); +var classType1Object1 = new classType1(); +classType1Object1.foo1 = 2; +var classType1Object2 = new classType\u0031(); +classType1Object2.foo1 = 2; +var classType2Object1 = new classType2(); +classType2Object1.foo2 = 2; +var classType2Object2 = new classType\u0032(); +classType2Object2.foo2 = 2; +var interfaceType1Object1 = { bar1: 0 }; +interfaceType1Object1.bar1 = 2; +var interfaceType1Object2 = { bar1: 0 }; +interfaceType1Object2.bar1 = 2; +var interfaceType2Object1 = { bar2: 0 }; +interfaceType2Object1.bar2 = 2; +var interfaceType2Object2 = { bar2: 0 }; +interfaceType2Object2.bar2 = 2; +var testClass = (function () { + function testClass() { + } + testClass.prototype.func = function (arg1, arg\u0032, arg\u0033, arg4) { + arg\u0031 = 1; + arg2 = 'string'; + arg\u0033 = true; + arg4 = 2; + }; + return testClass; +})(); +var constructorTestClass = (function () { + function constructorTestClass(arg1, arg\u0032, arg\u0033, arg4) { + this.arg1 = arg1; + this.arg\u0032 = arg\u0032; + this.arg\u0033 = arg\u0033; + this.arg4 = arg4; + } + return constructorTestClass; +})(); +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +constructorTestObject.arg\u0031 = 1; +constructorTestObject.arg2 = 'string'; +constructorTestObject.arg\u0033 = true; +constructorTestObject.arg4 = 2; +l\u0061bel1: while (false) { + while (false) + continue label1; +} +label2: while (false) { + while (false) + continue l\u0061bel2; +} +label3: while (false) { + while (false) + continue label3; +} +l\u0061bel4: while (false) { + while (false) + continue l\u0061bel4; +} diff --git a/tests/baselines/reference/everyTypeAssignableToAny.js b/tests/baselines/reference/everyTypeAssignableToAny.js new file mode 100644 index 0000000000000..5ff22ce19626c --- /dev/null +++ b/tests/baselines/reference/everyTypeAssignableToAny.js @@ -0,0 +1,115 @@ +//// [everyTypeAssignableToAny.ts] +var a: any; + +class C { + foo: string; +} +var ac: C; +interface I { + foo: string; +} +var ai: I; + +enum E { A } +var ae: E; + +var b: number; +var c: string; +var d: boolean; +var e: Date; +var f: any; +var g: void; +var h: Object; +var i: {}; +var j: () => {}; +var k: Function; +var l: (x: number) => string; +var m: number[]; +var n: { foo: string }; +var o: (x: T) => T; +var p: Number; +var q: String; + +a = b; +a = c; +a = d; +a = e; +a = f; +a = g; +a = h; +a = i; +a = j; +a = k; +a = l; +a = m; +a = o; +a = p; +a = q; +a = ac; +a = ai; +a = ae; + +function foo(x: T, y: U, z: V) { + a = x; + a = y; + a = z; +} +//function foo(x: T, y: U, z: V) { +// a = x; +// a = y; +// a = z; +//} + +//// [everyTypeAssignableToAny.js] +var a; +var C = (function () { + function C() { + } + return C; +})(); +var ac; +var ai; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var ae; +var b; +var c; +var d; +var e; +var f; +var g; +var h; +var i; +var j; +var k; +var l; +var m; +var n; +var o; +var p; +var q; +a = b; +a = c; +a = d; +a = e; +a = f; +a = g; +a = h; +a = i; +a = j; +a = k; +a = l; +a = m; +a = o; +a = p; +a = q; +a = ac; +a = ai; +a = ae; +function foo(x, y, z) { + a = x; + a = y; + a = z; +} diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js new file mode 100644 index 0000000000000..291bcfcb68f08 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.js @@ -0,0 +1,95 @@ +//// [everyTypeWithAnnotationAndInitializer.ts] +interface I { + id: number; +} + +class C implements I { + id: number; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +var aNumber: number = 9.9; +var aString: string = 'this is a string'; +var aDate: Date = new Date(12); +var anObject: Object = new Object(); + +var anAny: any = null; +var aSecondAny: any = undefined; +var aVoid: void = undefined; + +var anInterface: I = new C(); +var aClass: C = new C(); +var aGenericClass: D = new D(); +var anObjectLiteral: I = { id: 12 }; +var anOtherObjectLiteral: { id: number } = new C(); + +var aFunction: typeof F = F; +var anOtherFunction: (x: string) => number = F; +var aLambda: typeof F = (x) => 2; + +var aModule: typeof M = M; +var aClassInModule: M.A = new M.A(); +var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; + + + +//// [everyTypeWithAnnotationAndInitializer.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +var aNumber = 9.9; +var aString = 'this is a string'; +var aDate = new Date(12); +var anObject = new Object(); +var anAny = null; +var aSecondAny = undefined; +var aVoid = undefined; +var anInterface = new C(); +var aClass = new C(); +var aGenericClass = new D(); +var anObjectLiteral = { id: 12 }; +var anOtherObjectLiteral = new C(); +var aFunction = F; +var anOtherFunction = F; +var aLambda = function (x) { return 2; }; +var aModule = M; +var aClassInModule = new M.A(); +var aFunctionInModule = function (x) { return 'this is a string'; }; diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt new file mode 100644 index 0000000000000..1139ba42b0d5f --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -0,0 +1,104 @@ +==== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + function F2(x: number): boolean { return x < 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + module N { + export class A { + id: number; + } + + export function F2(x: number): string { return x.toString(); } + } + + var aNumber: number = 'this is a string'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + var aString: string = 9.9; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + var aDate: Date = 9.9; + ~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'Date': +!!! Property 'toDateString' is missing in type 'Number'. + + var aVoid: void = 9.9; + ~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'void'. + + var anInterface: I = new D(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'D<{}>' is not assignable to type 'I': +!!! Property 'id' is missing in type 'D<{}>'. + var aClass: C = new D(); + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'D<{}>' is not assignable to type 'C': +!!! Property 'id' is missing in type 'D<{}>'. + var aGenericClass: D = new C(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' is not assignable to type 'D': +!!! Property 'source' is missing in type 'C'. + var anObjectLiteral: I = { id: 'a string' }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ id: string; }' is not assignable to type 'I': +!!! Types of property 'id' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var anOtherObjectLiteral: { id: string } = new C(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' is not assignable to type '{ id: string; }': +!!! Types of property 'id' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + var aFunction: typeof F = F2; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(x: number) => boolean' is not assignable to type '(x: string) => number': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var anOtherFunction: (x: string) => number = F2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(x: number) => boolean' is not assignable to type '(x: string) => number': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var aLambda: typeof F = (x) => 'a string'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(x: string) => string' is not assignable to type '(x: string) => number': +!!! Type 'string' is not assignable to type 'number'. + + var aModule: typeof M = N; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'typeof N' is not assignable to type 'typeof M': +!!! Types of property 'A' are incompatible: +!!! Type 'typeof A' is not assignable to type 'typeof A': +!!! Type 'A' is not assignable to type 'A': +!!! Property 'name' is missing in type 'A'. + var aClassInModule: M.A = new N.A(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A' is not assignable to type 'A': +!!! Property 'name' is missing in type 'A'. + var aFunctionInModule: typeof M.F2 = F2; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(x: number) => boolean' is not assignable to type '(x: number) => string': +!!! Type 'boolean' is not assignable to type 'string'. + + \ No newline at end of file diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js new file mode 100644 index 0000000000000..7191aef20bf3d --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.js @@ -0,0 +1,114 @@ +//// [everyTypeWithAnnotationAndInvalidInitializer.ts] +interface I { + id: number; +} + +class C implements I { + id: number; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } +function F2(x: number): boolean { return x < 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +module N { + export class A { + id: number; + } + + export function F2(x: number): string { return x.toString(); } +} + +var aNumber: number = 'this is a string'; +var aString: string = 9.9; +var aDate: Date = 9.9; + +var aVoid: void = 9.9; + +var anInterface: I = new D(); +var aClass: C = new D(); +var aGenericClass: D = new C(); +var anObjectLiteral: I = { id: 'a string' }; +var anOtherObjectLiteral: { id: string } = new C(); + +var aFunction: typeof F = F2; +var anOtherFunction: (x: string) => number = F2; +var aLambda: typeof F = (x) => 'a string'; + +var aModule: typeof M = N; +var aClassInModule: M.A = new N.A(); +var aFunctionInModule: typeof M.F2 = F2; + + + +//// [everyTypeWithAnnotationAndInvalidInitializer.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +function F2(x) { + return x < 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +var N; +(function (N) { + var A = (function () { + function A() { + } + return A; + })(); + N.A = A; + function F2(x) { + return x.toString(); + } + N.F2 = F2; +})(N || (N = {})); +var aNumber = 'this is a string'; +var aString = 9.9; +var aDate = 9.9; +var aVoid = 9.9; +var anInterface = new D(); +var aClass = new D(); +var aGenericClass = new C(); +var anObjectLiteral = { id: 'a string' }; +var anOtherObjectLiteral = new C(); +var aFunction = F2; +var anOtherFunction = F2; +var aLambda = function (x) { return 'a string'; }; +var aModule = N; +var aClassInModule = new N.A(); +var aFunctionInModule = F2; diff --git a/tests/baselines/reference/everyTypeWithInitializer.js b/tests/baselines/reference/everyTypeWithInitializer.js new file mode 100644 index 0000000000000..59b00b2c37c81 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithInitializer.js @@ -0,0 +1,94 @@ +//// [everyTypeWithInitializer.ts] +interface I { + id: number; +} + +class C implements I { + id: number; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +var aNumber = 9.9; +var aString = 'this is a string'; +var aDate = new Date(12); +var anObject = new Object(); + +var anAny = null; +var anOtherAny = new C(); +var anUndefined = undefined; + + +var aClass = new C(); +var aGenericClass = new D(); +var anObjectLiteral = { id: 12 }; + +var aFunction = F; +var aLambda = (x) => 2; + +var aModule = M; +var aClassInModule = new M.A(); +var aFunctionInModule = M.F2; + +// no initializer or annotation, so this is an 'any' +var x; + + + +//// [everyTypeWithInitializer.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +var aNumber = 9.9; +var aString = 'this is a string'; +var aDate = new Date(12); +var anObject = new Object(); +var anAny = null; +var anOtherAny = new C(); +var anUndefined = undefined; +var aClass = new C(); +var aGenericClass = new D(); +var anObjectLiteral = { id: 12 }; +var aFunction = F; +var aLambda = function (x) { return 2; }; +var aModule = M; +var aClassInModule = new M.A(); +var aFunctionInModule = M.F2; +var x; diff --git a/tests/baselines/reference/exportAlreadySeen.errors.txt b/tests/baselines/reference/exportAlreadySeen.errors.txt new file mode 100644 index 0000000000000..b80498feb5e8b --- /dev/null +++ b/tests/baselines/reference/exportAlreadySeen.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/exportAlreadySeen.ts (10 errors) ==== + module M { + export export var x = 1; + ~~~~~~ +!!! 'export' modifier already seen. + export export function f() { } + ~~~~~~ +!!! 'export' modifier already seen. + + export export module N { + ~~~~~~ +!!! 'export' modifier already seen. + export export class C { } + ~~~~~~ +!!! 'export' modifier already seen. + export export interface I { } + ~~~~~~ +!!! 'export' modifier already seen. + } + } + + declare module A { + export export var x; + ~~~~~~ +!!! 'export' modifier already seen. + export export function f() + ~~~~~~ +!!! 'export' modifier already seen. + + export export module N { + ~~~~~~ +!!! 'export' modifier already seen. + export export class C { } + ~~~~~~ +!!! 'export' modifier already seen. + export export interface I { } + ~~~~~~ +!!! 'export' modifier already seen. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignClassAndModule.js b/tests/baselines/reference/exportAssignClassAndModule.js new file mode 100644 index 0000000000000..37fecdcc53f78 --- /dev/null +++ b/tests/baselines/reference/exportAssignClassAndModule.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/exportAssignClassAndModule.ts] //// + +//// [exportAssignClassAndModule_0.ts] +class Foo { + x: Foo.Bar; +} +module Foo { + export interface Bar { + } +} +export = Foo; + +//// [exportAssignClassAndModule_1.ts] +/// +import Foo = require('exportAssignClassAndModule_0'); + +var z: Foo.Bar; +var zz: Foo; +zz.x; + +//// [exportAssignClassAndModule_0.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +module.exports = Foo; +//// [exportAssignClassAndModule_1.js] +var z; +var zz; +zz.x; diff --git a/tests/baselines/reference/exportAssignDottedName.errors.txt b/tests/baselines/reference/exportAssignDottedName.errors.txt new file mode 100644 index 0000000000000..7faf84e114abd --- /dev/null +++ b/tests/baselines/reference/exportAssignDottedName.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== + import foo1 = require('./foo1'); + export = foo1.x; // Error, export assignment must be identifier only + ~ +!!! ';' expected. + ~ +!!! Cannot find name 'x'. + +==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== + export function x(){ + ~~~~~~~~~~~~~~~~~~~~ + return true; + ~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt new file mode 100644 index 0000000000000..b1e124896e75d --- /dev/null +++ b/tests/baselines/reference/exportAssignImportedIdentifier.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ==== + import foo2 = require('./foo2'); + var x = foo2(); // should be boolean +==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== + export function x(){ + ~~~~~~~~~~~~~~~~~~~~ + return true; + ~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== + import foo1 = require('./foo1'); + var x = foo1.x; + export = x; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.js b/tests/baselines/reference/exportAssignImportedIdentifier.js new file mode 100644 index 0000000000000..0367c270ddf51 --- /dev/null +++ b/tests/baselines/reference/exportAssignImportedIdentifier.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/externalModules/exportAssignImportedIdentifier.ts] //// + +//// [foo1.ts] +export function x(){ + return true; +} + +//// [foo2.ts] +import foo1 = require('./foo1'); +var x = foo1.x; +export = x; + +//// [foo3.ts] +import foo2 = require('./foo2'); +var x = foo2(); // should be boolean + +//// [foo1.js] +function x() { + return true; +} +exports.x = x; +//// [foo2.js] +var foo1 = require('./foo1'); +var x = foo1.x; +module.exports = x; +//// [foo3.js] +var foo2 = require('./foo2'); +var x = foo2(); diff --git a/tests/baselines/reference/exportAssignNonIdentifier.errors.txt b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt new file mode 100644 index 0000000000000..2e2ad680a03e8 --- /dev/null +++ b/tests/baselines/reference/exportAssignNonIdentifier.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== + var x = 10; + export = typeof x; // Error + ~~~~~~ +!!! Identifier expected. + ~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ==== + export = "sausages"; // Error + ~~~~~~~~~~ +!!! Identifier expected. + +==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ==== + export = class Foo3 {}; // Error + ~~~~~ +!!! Identifier expected. + +==== tests/cases/conformance/externalModules/foo4.ts (1 errors) ==== + export = true; // Error + ~~~~ +!!! Identifier expected. + +==== tests/cases/conformance/externalModules/foo5.ts (0 errors) ==== + export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript + +==== tests/cases/conformance/externalModules/foo6.ts (2 errors) ==== + export = void; // Error + ~~~~ +!!! Identifier expected. + ~ +!!! Expression expected. + +==== tests/cases/conformance/externalModules/foo7.ts (1 errors) ==== + export = Date || String; // Error + ~~ +!!! ';' expected. + +==== tests/cases/conformance/externalModules/foo8.ts (1 errors) ==== + export = null; // Error + ~~~~ +!!! Identifier expected. + + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignTypes.errors.txt b/tests/baselines/reference/exportAssignTypes.errors.txt new file mode 100644 index 0000000000000..6481447e3555f --- /dev/null +++ b/tests/baselines/reference/exportAssignTypes.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/externalModules/consumer.ts (0 errors) ==== + import iString = require('./expString'); + var v1: string = iString; + + import iNumber = require('./expNumber'); + var v2: number = iNumber; + + import iBoolean = require('./expBoolean'); + var v3: boolean = iBoolean; + + import iArray = require('./expArray'); + var v4: Array = iArray; + + import iObject = require('./expObject'); + var v5: Object = iObject; + + import iAny = require('./expAny'); + var v6 = iAny; + + import iGeneric = require('./expGeneric'); + var v7: {(p1: x): x} = iGeneric; + +==== tests/cases/conformance/externalModules/expString.ts (1 errors) ==== + var x = "test"; + export = x; + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/conformance/externalModules/expNumber.ts (0 errors) ==== + var x = 42; + export = x; + +==== tests/cases/conformance/externalModules/expBoolean.ts (1 errors) ==== + var x = true; + export = x; + ~~~~~~~~~ + + +!!! Cannot compile external modules unless the '--module' flag is provided. +==== tests/cases/conformance/externalModules/expArray.ts (0 errors) ==== + var x = [1,2]; + export = x; + +==== tests/cases/conformance/externalModules/expObject.ts (0 errors) ==== + var x = { answer: 42, when: 1776}; + export = x; + +==== tests/cases/conformance/externalModules/expAny.ts (0 errors) ==== + var x; + export = x; + +==== tests/cases/conformance/externalModules/expGeneric.ts (1 errors) ==== + function x(a: T){ + ~~~~ + return a; + ~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + } + export = x; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignTypes.js b/tests/baselines/reference/exportAssignTypes.js new file mode 100644 index 0000000000000..e898f798a7c50 --- /dev/null +++ b/tests/baselines/reference/exportAssignTypes.js @@ -0,0 +1,93 @@ +//// [tests/cases/conformance/externalModules/exportAssignTypes.ts] //// + +//// [expString.ts] +var x = "test"; +export = x; + +//// [expNumber.ts] +var x = 42; +export = x; + +//// [expBoolean.ts] +var x = true; +export = x; + +//// [expArray.ts] +var x = [1,2]; +export = x; + +//// [expObject.ts] +var x = { answer: 42, when: 1776}; +export = x; + +//// [expAny.ts] +var x; +export = x; + +//// [expGeneric.ts] +function x(a: T){ + return a; +} +export = x; + +//// [consumer.ts] +import iString = require('./expString'); +var v1: string = iString; + +import iNumber = require('./expNumber'); +var v2: number = iNumber; + +import iBoolean = require('./expBoolean'); +var v3: boolean = iBoolean; + +import iArray = require('./expArray'); +var v4: Array = iArray; + +import iObject = require('./expObject'); +var v5: Object = iObject; + +import iAny = require('./expAny'); +var v6 = iAny; + +import iGeneric = require('./expGeneric'); +var v7: {(p1: x): x} = iGeneric; + + +//// [expString.js] +var x = "test"; +module.exports = x; +//// [expNumber.js] +var x = 42; +module.exports = x; +//// [expBoolean.js] +var x = true; +module.exports = x; +//// [expArray.js] +var x = [1, 2]; +module.exports = x; +//// [expObject.js] +var x = { answer: 42, when: 1776 }; +module.exports = x; +//// [expAny.js] +var x; +module.exports = x; +//// [expGeneric.js] +function x(a) { + return a; +} +module.exports = x; +//// [consumer.js] +var iString = require('./expString'); +var v1 = iString; +var iNumber = require('./expNumber'); +var v2 = iNumber; +var iBoolean = require('./expBoolean'); +var v3 = iBoolean; +var iArray = require('./expArray'); +var v4 = iArray; +var iObject = require('./expObject'); +var v5 = iObject; +var iAny = require('./expAny'); +var v6 = iAny; +var iGeneric = require('./expGeneric'); +var v7 = iGeneric; diff --git a/tests/baselines/reference/exportAssignValueAndType.js b/tests/baselines/reference/exportAssignValueAndType.js new file mode 100644 index 0000000000000..016ce6f24c1cf --- /dev/null +++ b/tests/baselines/reference/exportAssignValueAndType.js @@ -0,0 +1,20 @@ +//// [exportAssignValueAndType.ts] +declare module http { + export interface Server { openPort: number; } +} + +interface server { + (): http.Server; + startTime: Date; +} + +var x = 5; +var server = new Date(); +export = server; + + + +//// [exportAssignValueAndType.js] +var x = 5; +var server = new Date(); +module.exports = server; diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js new file mode 100644 index 0000000000000..71ca42ca9de10 --- /dev/null +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/exportAssignedTypeAsTypeAnnotation.ts] //// + +//// [exportAssignedTypeAsTypeAnnotation_0.ts] + +interface x { + (): Date; + foo: string; +} +export = x; + +//// [exportAssignedTypeAsTypeAnnotation_1.ts] +/// +import test = require('exportAssignedTypeAsTypeAnnotation_0'); +var t2: test; // should not raise a 'container type' error + + +//// [exportAssignedTypeAsTypeAnnotation_0.js] +define(["require", "exports"], function (require, exports) { +}); +//// [exportAssignedTypeAsTypeAnnotation_1.js] +define(["require", "exports"], function (require, exports) { + var t2; +}); diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt new file mode 100644 index 0000000000000..ecae497202e5f --- /dev/null +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts (1 errors) ==== + export enum E1 { + A,B,C + } + + class C1 { + + } + + // Invalid, as there is already an exported member. + export = C1; + ~~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentAndDeclaration.js b/tests/baselines/reference/exportAssignmentAndDeclaration.js new file mode 100644 index 0000000000000..ed9f92d88ef86 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentAndDeclaration.js @@ -0,0 +1,27 @@ +//// [exportAssignmentAndDeclaration.ts] +export enum E1 { + A,B,C +} + +class C1 { + +} + +// Invalid, as there is already an exported member. +export = C1; + +//// [exportAssignmentAndDeclaration.js] +define(["require", "exports"], function (require, exports) { + (function (E1) { + E1[E1["A"] = 0] = "A"; + E1[E1["B"] = 1] = "B"; + E1[E1["C"] = 2] = "C"; + })(exports.E1 || (exports.E1 = {})); + var E1 = exports.E1; + var C1 = (function () { + function C1() { + } + return C1; + })(); + return C1; +}); diff --git a/tests/baselines/reference/exportAssignmentCircularModules.js b/tests/baselines/reference/exportAssignmentCircularModules.js new file mode 100644 index 0000000000000..7634418179bca --- /dev/null +++ b/tests/baselines/reference/exportAssignmentCircularModules.js @@ -0,0 +1,48 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentCircularModules.ts] //// + +//// [foo_0.ts] +import foo1 = require('./foo_1'); +module Foo { + export var x = foo1.x; +} +export = Foo; + +//// [foo_1.ts] +import foo2 = require("./foo_2"); +module Foo { + export var x = foo2.x; +} +export = Foo; + +//// [foo_2.ts] +import foo0 = require("./foo_0"); +module Foo { + export var x = foo0.x; +} +export = Foo; + + +//// [foo_1.js] +define(["require", "exports", "./foo_2"], function (require, exports, foo2) { + var Foo; + (function (Foo) { + Foo.x = foo2.x; + })(Foo || (Foo = {})); + return Foo; +}); +//// [foo_0.js] +define(["require", "exports", './foo_1'], function (require, exports, foo1) { + var Foo; + (function (Foo) { + Foo.x = foo1.x; + })(Foo || (Foo = {})); + return Foo; +}); +//// [foo_2.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo0) { + var Foo; + (function (Foo) { + Foo.x = foo0.x; + })(Foo || (Foo = {})); + return Foo; +}); diff --git a/tests/baselines/reference/exportAssignmentClass.js b/tests/baselines/reference/exportAssignmentClass.js new file mode 100644 index 0000000000000..a010a1e1cd2f4 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentClass.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/exportAssignmentClass.ts] //// + +//// [exportAssignmentClass_A.ts] +class C { public p = 0; } + +export = C; + +//// [exportAssignmentClass_B.ts] +import D = require("exportAssignmentClass_A"); + +var d = new D(); +var x = d.p; + +//// [exportAssignmentClass_A.js] +define(["require", "exports"], function (require, exports) { + var C = (function () { + function C() { + this.p = 0; + } + return C; + })(); + return C; +}); +//// [exportAssignmentClass_B.js] +define(["require", "exports", "exportAssignmentClass_A"], function (require, exports, D) { + var d = new D(); + var x = d.p; +}); diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt new file mode 100644 index 0000000000000..86666ea1ff86f --- /dev/null +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== + import foo = require("./foo_0"); + var x = new foo(true); // Should error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var y = new foo({a: "test", b: 42}); // Should be OK + var z: number = y.test.b; +==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== + class Foo{ + test: T; + constructor(x: T){} + } + + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js new file mode 100644 index 0000000000000..b7223d84f59ad --- /dev/null +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentConstrainedGenericType.ts] //// + +//// [foo_0.ts] +class Foo{ + test: T; + constructor(x: T){} +} + +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +var x = new foo(true); // Should error +var y = new foo({a: "test", b: 42}); // Should be OK +var z: number = y.test.b; + +//// [foo_0.js] +var Foo = (function () { + function Foo(x) { + } + return Foo; +})(); +module.exports = Foo; +//// [foo_1.js] +var foo = require("./foo_0"); +var x = new foo(true); +var y = new foo({ a: "test", b: 42 }); +var z = y.test.b; diff --git a/tests/baselines/reference/exportAssignmentEnum.js b/tests/baselines/reference/exportAssignmentEnum.js new file mode 100644 index 0000000000000..7b9981d97337c --- /dev/null +++ b/tests/baselines/reference/exportAssignmentEnum.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/exportAssignmentEnum.ts] //// + +//// [exportAssignmentEnum_A.ts] +enum E { + A, + B, + C, +} + +export = E; + +//// [exportAssignmentEnum_B.ts] +import EnumE = require("exportAssignmentEnum_A"); + +var a = EnumE.A; +var b = EnumE.B; +var c = EnumE.C; + +//// [exportAssignmentEnum_A.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; +})(E || (E = {})); +module.exports = E; +//// [exportAssignmentEnum_B.js] +var EnumE = require("exportAssignmentEnum_A"); +var a = 0 /* A */; +var b = 1 /* B */; +var c = 2 /* C */; diff --git a/tests/baselines/reference/exportAssignmentError.js b/tests/baselines/reference/exportAssignmentError.js new file mode 100644 index 0000000000000..3a9e57029a956 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentError.js @@ -0,0 +1,19 @@ +//// [exportAssignmentError.ts] +module M { + export var x; +} + +import M2 = M; + +export = M2; // should not error + + +//// [exportAssignmentError.js] +define(["require", "exports"], function (require, exports) { + var M; + (function (M) { + M.x; + })(M || (M = {})); + var M2 = M; + return M2; +}); diff --git a/tests/baselines/reference/exportAssignmentFunction.js b/tests/baselines/reference/exportAssignmentFunction.js new file mode 100644 index 0000000000000..6d4336bd4bdb3 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentFunction.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/exportAssignmentFunction.ts] //// + +//// [exportAssignmentFunction_A.ts] +function foo() { return 0; } + +export = foo; + +//// [exportAssignmentFunction_B.ts] +import fooFunc = require("exportAssignmentFunction_A"); + +var n: number = fooFunc(); + +//// [exportAssignmentFunction_A.js] +define(["require", "exports"], function (require, exports) { + function foo() { + return 0; + } + return foo; +}); +//// [exportAssignmentFunction_B.js] +define(["require", "exports", "exportAssignmentFunction_A"], function (require, exports, fooFunc) { + var n = fooFunc(); +}); diff --git a/tests/baselines/reference/exportAssignmentGenericType.js b/tests/baselines/reference/exportAssignmentGenericType.js new file mode 100644 index 0000000000000..b087287c34f58 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentGenericType.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentGenericType.ts] //// + +//// [foo_0.ts] +class Foo{ + test: T; +} +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +var x = new foo(); +var y:number = x.test; + + +//// [foo_0.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +module.exports = Foo; +//// [foo_1.js] +var foo = require("./foo_0"); +var x = new foo(); +var y = x.test; diff --git a/tests/baselines/reference/exportAssignmentInterface.js b/tests/baselines/reference/exportAssignmentInterface.js new file mode 100644 index 0000000000000..22b30c03db6b4 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInterface.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/exportAssignmentInterface.ts] //// + +//// [exportAssignmentInterface_A.ts] +interface A { + p1: number; +} + +export = A; + +//// [exportAssignmentInterface_B.ts] +import I1 = require("exportAssignmentInterface_A"); + +var i: I1; + +var n: number = i.p1; + +//// [exportAssignmentInterface_A.js] +define(["require", "exports"], function (require, exports) { +}); +//// [exportAssignmentInterface_B.js] +define(["require", "exports"], function (require, exports) { + var i; + var n = i.p1; +}); diff --git a/tests/baselines/reference/exportAssignmentInternalModule.js b/tests/baselines/reference/exportAssignmentInternalModule.js new file mode 100644 index 0000000000000..fb9adfd5650e1 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInternalModule.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/exportAssignmentInternalModule.ts] //// + +//// [exportAssignmentInternalModule_A.ts] +module M { + export var x; +} + +export = M; + +//// [exportAssignmentInternalModule_B.ts] +import modM = require("exportAssignmentInternalModule_A"); + +var n: number = modM.x; + +//// [exportAssignmentInternalModule_A.js] +define(["require", "exports"], function (require, exports) { + var M; + (function (M) { + M.x; + })(M || (M = {})); + return M; +}); +//// [exportAssignmentInternalModule_B.js] +define(["require", "exports", "exportAssignmentInternalModule_A"], function (require, exports, modM) { + var n = modM.x; +}); diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.js b/tests/baselines/reference/exportAssignmentMergedInterface.js new file mode 100644 index 0000000000000..3f0c0cfde2966 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedInterface.js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentMergedInterface.ts] //// + +//// [foo_0.ts] +interface Foo { + (a: string): void; + b: string; +} +interface Foo { + (a: number): number; + c: boolean; + d: {x: number; y: number}; +} +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +var x: foo; +x("test"); +x(42); +var y: string = x.b; +if(!!x.c){ } +var z = {x: 1, y: 2}; +z = x.d; + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { +}); +//// [foo_1.js] +define(["require", "exports"], function (require, exports) { + var x; + x("test"); + x(42); + var y = x.b; + if (!!x.c) { + } + var z = { x: 1, y: 2 }; + z = x.d; +}); diff --git a/tests/baselines/reference/exportAssignmentMergedModule.js b/tests/baselines/reference/exportAssignmentMergedModule.js new file mode 100644 index 0000000000000..b8e40412ff8c7 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedModule.js @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentMergedModule.ts] //// + +//// [foo_0.ts] +module Foo { + export function a(){ + return 5; + } + export var b = true; +} +module Foo { + export function c(a: number){ + return a; + } + export module Test { + export var answer = 42; + } +} +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +var a: number = foo.a(); +if(!!foo.b){ + foo.Test.answer = foo.c(42); +} + +//// [foo_0.js] +var Foo; +(function (Foo) { + function a() { + return 5; + } + Foo.a = a; + Foo.b = true; +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + function c(a) { + return a; + } + Foo.c = c; + (function (Test) { + Test.answer = 42; + })(Foo.Test || (Foo.Test = {})); + var Test = Foo.Test; +})(Foo || (Foo = {})); +module.exports = Foo; +//// [foo_1.js] +var foo = require("./foo_0"); +var a = foo.a(); +if (!!foo.b) { + foo.Test.answer = foo.c(42); +} diff --git a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt new file mode 100644 index 0000000000000..74518bb9c3cbc --- /dev/null +++ b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts (2 errors) ==== + /// + import Sammy = require('exportAssignmentOfDeclaredExternalModule_0'); + var x = new Sammy(); // error to use as constructor as there is not constructor symbol + ~~~~~ +!!! Cannot find name 'Sammy'. + var y = Sammy(); // error to use interface name as call target + ~~~~~ +!!! Cannot find name 'Sammy'. + var z: Sammy; // no error - z is of type interface Sammy from module 'M' + var a = new z(); // constructor - no error + var b = z(); // call signature - no error +==== tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_0.ts (0 errors) ==== + interface Sammy { + new (): any; // a constructor signature + (): number; // a 0 arg call signature + } + export = Sammy; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js new file mode 100644 index 0000000000000..3a6f9022f7745 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/exportAssignmentOfDeclaredExternalModule.ts] //// + +//// [exportAssignmentOfDeclaredExternalModule_0.ts] +interface Sammy { + new (): any; // a constructor signature + (): number; // a 0 arg call signature + } +export = Sammy; + +//// [exportAssignmentOfDeclaredExternalModule_1.ts] +/// +import Sammy = require('exportAssignmentOfDeclaredExternalModule_0'); +var x = new Sammy(); // error to use as constructor as there is not constructor symbol +var y = Sammy(); // error to use interface name as call target +var z: Sammy; // no error - z is of type interface Sammy from module 'M' +var a = new z(); // constructor - no error +var b = z(); // call signature - no error + +//// [exportAssignmentOfDeclaredExternalModule_0.js] +//// [exportAssignmentOfDeclaredExternalModule_1.js] +var x = new Sammy(); +var y = Sammy(); +var z; +var a = new z(); +var b = z(); diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js new file mode 100644 index 0000000000000..0b8c4f2596c18 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/exportAssignmentOfGenericType1.ts] //// + +//// [exportAssignmentOfGenericType1_0.ts] +export = T; +class T { foo: X; } + +//// [exportAssignmentOfGenericType1_1.ts] +/// +import q = require("exportAssignmentOfGenericType1_0"); + +class M extends q { } +var m: M; +var r: string = m.foo; + + +//// [exportAssignmentOfGenericType1_0.js] +define(["require", "exports"], function (require, exports) { + var T = (function () { + function T() { + } + return T; + })(); + return T; +}); +//// [exportAssignmentOfGenericType1_1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (require, exports, q) { + var M = (function (_super) { + __extends(M, _super); + function M() { + _super.apply(this, arguments); + } + return M; + })(q); + var m; + var r = m.foo; +}); diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.js b/tests/baselines/reference/exportAssignmentTopLevelClodule.js new file mode 100644 index 0000000000000..e0946dc48f2a2 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentTopLevelClodule.ts] //// + +//// [foo_0.ts] +class Foo { + test = "test"; +} +module Foo { + export var answer = 42; +} +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +if(foo.answer === 42){ + var x = new foo(); +} + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + var Foo = (function () { + function Foo() { + this.test = "test"; + } + return Foo; + })(); + var Foo; + (function (Foo) { + Foo.answer = 42; + })(Foo || (Foo = {})); + return Foo; +}); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + if (foo.answer === 42) { + var x = new foo(); + } +}); diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js new file mode 100644 index 0000000000000..fe6b80292d5e5 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentTopLevelEnumdule.ts] //// + +//// [foo_0.ts] +enum foo { + red, green, blue +} +module foo { + export var answer = 42; +} +export = foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +var color: foo; +if(color === foo.green){ + color = foo.answer; +} + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + var foo; + (function (foo) { + foo[foo["red"] = 0] = "red"; + foo[foo["green"] = 1] = "green"; + foo[foo["blue"] = 2] = "blue"; + })(foo || (foo = {})); + var foo; + (function (foo) { + foo.answer = 42; + })(foo || (foo = {})); + return foo; +}); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + var color; + if (color === 1 /* green */) { + color = foo.answer; + } +}); diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.js b/tests/baselines/reference/exportAssignmentTopLevelFundule.js new file mode 100644 index 0000000000000..cccde9ede3af6 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentTopLevelFundule.ts] //// + +//// [foo_0.ts] +function foo() { + return "test"; +} +module foo { + export var answer = 42; +} +export = foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +if(foo.answer === 42){ + var x = foo(); +} + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + function foo() { + return "test"; + } + var foo; + (function (foo) { + foo.answer = 42; + })(foo || (foo = {})); + return foo; +}); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + if (foo.answer === 42) { + var x = foo(); + } +}); diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.js b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.js new file mode 100644 index 0000000000000..a89559a055024 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/externalModules/exportAssignmentTopLevelIdentifier.ts] //// + +//// [foo_0.ts] +module Foo { + export var answer = 42; +} +export = Foo; + +//// [foo_1.ts] +import foo = require("./foo_0"); +if(foo.answer === 42){ + +} + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + var Foo; + (function (Foo) { + Foo.answer = 42; + })(Foo || (Foo = {})); + return Foo; +}); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + if (foo.answer === 42) { + } +}); diff --git a/tests/baselines/reference/exportAssignmentVariable.js b/tests/baselines/reference/exportAssignmentVariable.js new file mode 100644 index 0000000000000..c20e6ec4f7b74 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentVariable.js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/exportAssignmentVariable.ts] //// + +//// [exportAssignmentVariable_A.ts] +var x = 0; + +export = x; + +//// [exportAssignmentVariable_B.ts] +import y = require("exportAssignmentVariable_A"); + +var n: number = y; + +//// [exportAssignmentVariable_A.js] +var x = 0; +module.exports = x; +//// [exportAssignmentVariable_B.js] +var y = require("exportAssignmentVariable_A"); +var n = y; diff --git a/tests/baselines/reference/exportAssignmentWithExports.errors.txt b/tests/baselines/reference/exportAssignmentWithExports.errors.txt new file mode 100644 index 0000000000000..7ddda9db538bf --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithExports.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/exportAssignmentWithExports.ts (1 errors) ==== + export class C { } + class D { } + export = D; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExports.js b/tests/baselines/reference/exportAssignmentWithExports.js new file mode 100644 index 0000000000000..65d2253e3f86d --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithExports.js @@ -0,0 +1,18 @@ +//// [exportAssignmentWithExports.ts] +export class C { } +class D { } +export = D; + +//// [exportAssignmentWithExports.js] +var C = (function () { + function C() { + } + return C; +})(); +exports.C = C; +var D = (function () { + function D() { + } + return D; +})(); +module.exports = D; diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.js b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.js new file mode 100644 index 0000000000000..cb4cb3269b17e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.js @@ -0,0 +1,31 @@ +//// [exportAssignmentWithImportStatementPrivacyError.ts] +module m2 { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + +} + +module M { + export var server: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; +} +import M22 = M; + +export = M; + +//// [exportAssignmentWithImportStatementPrivacyError.js] +define(["require", "exports"], function (require, exports) { + var M; + (function (M) { + M.server; + })(M || (M = {})); + return M; +}); diff --git a/tests/baselines/reference/exportAssignmentWithPrivacyError.js b/tests/baselines/reference/exportAssignmentWithPrivacyError.js new file mode 100644 index 0000000000000..57d3ae6c487ff --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithPrivacyError.js @@ -0,0 +1,24 @@ +//// [exportAssignmentWithPrivacyError.ts] +interface connectmodule { + (res, req, next): void; +} +interface connectexport { + use: (mod: connectmodule) => connectexport; + listen: (port: number) => void; +} + +var server: { + (): connectexport; + test1: connectmodule; + test2(): connectmodule; +}; + +export = server; + + + +//// [exportAssignmentWithPrivacyError.js] +define(["require", "exports"], function (require, exports) { + var server; + return server; +}); diff --git a/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt new file mode 100644 index 0000000000000..396d932e35895 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts (1 errors) ==== + function Greeter() { + //... + } + Greeter.prototype.greet = function () { + //... + } + export = new Greeter(); + ~~~ +!!! Identifier expected. + \ No newline at end of file diff --git a/tests/baselines/reference/exportCodeGen.js b/tests/baselines/reference/exportCodeGen.js new file mode 100644 index 0000000000000..a35c2372280b9 --- /dev/null +++ b/tests/baselines/reference/exportCodeGen.js @@ -0,0 +1,122 @@ +//// [exportCodeGen.ts] + +// should replace all refs to 'x' in the body, +// with fully qualified +module A { + export var x = 12; + function lt12() { + return x < 12; + } +} + +// should not fully qualify 'x' +module B { + var x = 12; + function lt12() { + return x < 12; + } +} + +// not copied, since not exported +module C { + function no() { + return false; + } +} + +// copies, since exported +module D { + export function yes() { + return true; + } +} + +// validate all exportable statements +module E { + export enum Color { Red } + export function fn() { } + export interface I { id: number } + export class C { name: string } + export module M { + export var x = 42; + } +} + +// validate all exportable statements, +// which are not exported +module F { + enum Color { Red } + function fn() { } + interface I { id: number } + class C { name: string } + module M { + var x = 42; + } +} + +//// [exportCodeGen.js] +var A; +(function (A) { + A.x = 12; + function lt12() { + return A.x < 12; + } +})(A || (A = {})); +var B; +(function (B) { + var x = 12; + function lt12() { + return x < 12; + } +})(B || (B = {})); +var C; +(function (C) { + function no() { + return false; + } +})(C || (C = {})); +var D; +(function (D) { + function yes() { + return true; + } + D.yes = yes; +})(D || (D = {})); +var E; +(function (E) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + })(E.Color || (E.Color = {})); + var Color = E.Color; + function fn() { + } + E.fn = fn; + var C = (function () { + function C() { + } + return C; + })(); + E.C = C; + (function (M) { + M.x = 42; + })(E.M || (E.M = {})); + var M = E.M; +})(E || (E = {})); +var F; +(function (F) { + var Color; + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + })(Color || (Color = {})); + function fn() { + } + var C = (function () { + function C() { + } + return C; + })(); + var M; + (function (M) { + var x = 42; + })(M || (M = {})); +})(F || (F = {})); diff --git a/tests/baselines/reference/exportDeclareClass1.errors.txt b/tests/baselines/reference/exportDeclareClass1.errors.txt new file mode 100644 index 0000000000000..dee40634d35d2 --- /dev/null +++ b/tests/baselines/reference/exportDeclareClass1.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/exportDeclareClass1.ts (9 errors) ==== + export declare class eaC { + static tF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + static tsF(param:any) { }; + ~~~~~~ +!!! Declaration or statement expected. + ~ +!!! ',' expected. + ~ +!!! ';' expected. + ~~~ +!!! Cannot find name 'tsF'. + ~~~~~ +!!! Cannot find name 'param'. + ~~~ +!!! Cannot find name 'any'. + }; + ~ +!!! Declaration or statement expected. + + export declare class eaC2 { + static tF(); + static tsF(param:any); + }; \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclaredModule.errors.txt b/tests/baselines/reference/exportDeclaredModule.errors.txt new file mode 100644 index 0000000000000..ffa54e92dcf38 --- /dev/null +++ b/tests/baselines/reference/exportDeclaredModule.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== + import foo1 = require('./foo1'); + var x: number = foo1.b(); +==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== + + declare module M1 { + export var a: string; + export function b(): number; + } + export = M1; + ~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclaredModule.js b/tests/baselines/reference/exportDeclaredModule.js new file mode 100644 index 0000000000000..7aa75288bff11 --- /dev/null +++ b/tests/baselines/reference/exportDeclaredModule.js @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/externalModules/exportDeclaredModule.ts] //// + +//// [foo1.ts] + +declare module M1 { + export var a: string; + export function b(): number; +} +export = M1; + +//// [foo2.ts] +import foo1 = require('./foo1'); +var x: number = foo1.b(); + +//// [foo1.js] +module.exports = M1; +//// [foo2.js] +var foo1 = require('./foo1'); +var x = foo1.b(); diff --git a/tests/baselines/reference/exportEqualCallable.js b/tests/baselines/reference/exportEqualCallable.js new file mode 100644 index 0000000000000..34df64f5e482b --- /dev/null +++ b/tests/baselines/reference/exportEqualCallable.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/exportEqualCallable.ts] //// + +//// [exportEqualCallable_0.ts] + +var server: { + (): any; +}; +export = server; + +//// [exportEqualCallable_1.ts] +/// +import connect = require('exportEqualCallable_0'); +connect(); + + +//// [exportEqualCallable_0.js] +define(["require", "exports"], function (require, exports) { + var server; + return server; +}); +//// [exportEqualCallable_1.js] +define(["require", "exports", 'exportEqualCallable_0'], function (require, exports, connect) { + connect(); +}); diff --git a/tests/baselines/reference/exportEqualErrorType.errors.txt b/tests/baselines/reference/exportEqualErrorType.errors.txt new file mode 100644 index 0000000000000..1023e9eff2527 --- /dev/null +++ b/tests/baselines/reference/exportEqualErrorType.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/exportEqualErrorType_1.ts (1 errors) ==== + /// + import connect = require('exportEqualErrorType_0'); + connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. + ~~~~~~ +!!! Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. + +==== tests/cases/compiler/exportEqualErrorType_0.ts (0 errors) ==== + module server { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + } + } + var server: { + (): server.connectExport; + foo: Date; + }; + export = server; + \ No newline at end of file diff --git a/tests/baselines/reference/exportEqualErrorType.js b/tests/baselines/reference/exportEqualErrorType.js new file mode 100644 index 0000000000000..dfa6383d8dec8 --- /dev/null +++ b/tests/baselines/reference/exportEqualErrorType.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/exportEqualErrorType.ts] //// + +//// [exportEqualErrorType_0.ts] +module server { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + } +} +var server: { + (): server.connectExport; + foo: Date; +}; +export = server; + +//// [exportEqualErrorType_1.ts] +/// +import connect = require('exportEqualErrorType_0'); +connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. + + +//// [exportEqualErrorType_0.js] +define(["require", "exports"], function (require, exports) { + var server; + return server; +}); +//// [exportEqualErrorType_1.js] +define(["require", "exports", 'exportEqualErrorType_0'], function (require, exports, connect) { + connect().use(connect.static('foo')); +}); diff --git a/tests/baselines/reference/exportEqualMemberMissing.errors.txt b/tests/baselines/reference/exportEqualMemberMissing.errors.txt new file mode 100644 index 0000000000000..da061bc303e2d --- /dev/null +++ b/tests/baselines/reference/exportEqualMemberMissing.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/exportEqualMemberMissing_1.ts (1 errors) ==== + /// + import connect = require('exportEqualMemberMissing_0'); + connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. + ~~~~~~ +!!! Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. + +==== tests/cases/compiler/exportEqualMemberMissing_0.ts (0 errors) ==== + module server { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + } + } + var server: { + (): server.connectExport; + foo: Date; + }; + export = server; + \ No newline at end of file diff --git a/tests/baselines/reference/exportEqualMemberMissing.js b/tests/baselines/reference/exportEqualMemberMissing.js new file mode 100644 index 0000000000000..714fb700198bb --- /dev/null +++ b/tests/baselines/reference/exportEqualMemberMissing.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/exportEqualMemberMissing.ts] //// + +//// [exportEqualMemberMissing_0.ts] +module server { + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + } +} +var server: { + (): server.connectExport; + foo: Date; +}; +export = server; + +//// [exportEqualMemberMissing_1.ts] +/// +import connect = require('exportEqualMemberMissing_0'); +connect().use(connect.static('foo')); // Error 1 The property 'static' does not exist on value of type ''. + + +//// [exportEqualMemberMissing_0.js] +var server; +module.exports = server; +//// [exportEqualMemberMissing_1.js] +var connect = require('exportEqualMemberMissing_0'); +connect().use(connect.static('foo')); diff --git a/tests/baselines/reference/exportEqualNamespaces.js b/tests/baselines/reference/exportEqualNamespaces.js new file mode 100644 index 0000000000000..a95d1fd3d58e3 --- /dev/null +++ b/tests/baselines/reference/exportEqualNamespaces.js @@ -0,0 +1,21 @@ +//// [exportEqualNamespaces.ts] +declare module server { + interface Server extends Object { } +} + +interface server { + (): server.Server; + startTime: Date; +} + +var x = 5; +var server = new Date(); +export = server; + + +//// [exportEqualNamespaces.js] +define(["require", "exports"], function (require, exports) { + var x = 5; + var server = new Date(); + return server; +}); diff --git a/tests/baselines/reference/exportImport.js b/tests/baselines/reference/exportImport.js new file mode 100644 index 0000000000000..56e48ddb8f343 --- /dev/null +++ b/tests/baselines/reference/exportImport.js @@ -0,0 +1,46 @@ +//// [tests/cases/compiler/exportImport.ts] //// + +//// [w1.ts] + +export = Widget1 +class Widget1 { name = 'one'; } + +//// [exporter.ts] +export import w = require('./w1'); + +//// [consumer.ts] +import e = require('./exporter'); + +export function w(): e.w { // Should be OK + return new e.w(); +} + +//// [w1.js] +define(["require", "exports"], function (require, exports) { + var Widget1 = (function () { + function Widget1() { + this.name = 'one'; + } + return Widget1; + })(); + return Widget1; +}); +//// [exporter.js] +define(["require", "exports", './w1'], function (require, exports, w) { + exports.w = w; +}); +//// [consumer.js] +define(["require", "exports", './exporter'], function (require, exports, e) { + function w() { + return new e.w(); + } + exports.w = w; +}); + + +//// [w1.d.ts] +export = Widget1; +//// [exporter.d.ts] +export import w = require('./w1'); +//// [consumer.d.ts] +export declare function w(); diff --git a/tests/baselines/reference/exportImportAlias.js b/tests/baselines/reference/exportImportAlias.js new file mode 100644 index 0000000000000..e8cac426b3d63 --- /dev/null +++ b/tests/baselines/reference/exportImportAlias.js @@ -0,0 +1,137 @@ +//// [exportImportAlias.ts] +// expect no errors here + +module A { + + export var x = 'hello world' + export class Point { + constructor(public x: number, public y: number) { } + } + export module B { + export interface Id { + name: string; + } + } +} + +module C { + export import a = A; +} + +var a: string = C.a.x; +var b: { x: number; y: number; } = new C.a.Point(0, 0); +var c: { name: string }; +var c: C.a.B.Id; + +module X { + export function Y() { + return 42; + } + + export module Y { + export class Point { + constructor(public x: number, public y: number) { } + } + } +} + +module Z { + + // 'y' should be a fundule here + export import y = X.Y; +} + +var m: number = Z.y(); +var n: { x: number; y: number; } = new Z.y.Point(0, 0); + +module K { + export class L { + constructor(public name: string) { } + } + + export module L { + export var y = 12; + export interface Point { + x: number; + y: number; + } + } +} + +module M { + export import D = K.L; +} + +var o: { name: string }; +var o = new M.D('Hello'); + +var p: { x: number; y: number; } +var p: M.D.Point; + +//// [exportImportAlias.js] +var A; +(function (A) { + A.x = 'hello world'; + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Point = Point; +})(A || (A = {})); +var C; +(function (C) { + C.a = A; +})(C || (C = {})); +var a = C.a.x; +var b = new C.a.Point(0, 0); +var c; +var c; +var X; +(function (X) { + function Y() { + return 42; + } + X.Y = Y; + (function (Y) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + Y.Point = Point; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var Z; +(function (Z) { + Z.y = X.Y; +})(Z || (Z = {})); +var m = Z.y(); +var n = new Z.y.Point(0, 0); +var K; +(function (K) { + var L = (function () { + function L(name) { + this.name = name; + } + return L; + })(); + K.L = L; + (function (L) { + L.y = 12; + })(K.L || (K.L = {})); + var L = K.L; +})(K || (K = {})); +var M; +(function (M) { + M.D = K.L; +})(M || (M = {})); +var o; +var o = new M.D('Hello'); +var p; +var p; diff --git a/tests/baselines/reference/exportImportAndClodule.js b/tests/baselines/reference/exportImportAndClodule.js new file mode 100644 index 0000000000000..32362686c95bb --- /dev/null +++ b/tests/baselines/reference/exportImportAndClodule.js @@ -0,0 +1,44 @@ +//// [exportImportAndClodule.ts] +module K { + export class L { + constructor(public name: string) { } + } + export module L { + export var y = 12; + export interface Point { + x: number; + y: number; + } + } +} +module M { + export import D = K.L; +} +var o: { name: string }; +var o = new M.D('Hello'); +var p: { x: number; y: number; } +var p: M.D.Point; + +//// [exportImportAndClodule.js] +var K; +(function (K) { + var L = (function () { + function L(name) { + this.name = name; + } + return L; + })(); + K.L = L; + (function (L) { + L.y = 12; + })(K.L || (K.L = {})); + var L = K.L; +})(K || (K = {})); +var M; +(function (M) { + M.D = K.L; +})(M || (M = {})); +var o; +var o = new M.D('Hello'); +var p; +var p; diff --git a/tests/baselines/reference/exportImportMultipleFiles.js b/tests/baselines/reference/exportImportMultipleFiles.js new file mode 100644 index 0000000000000..f6424cb8a9b8b --- /dev/null +++ b/tests/baselines/reference/exportImportMultipleFiles.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/exportImportMultipleFiles.ts] //// + +//// [exportImportMultipleFiles_math.ts] +export function add(a, b) { return a + b; } + +//// [exportImportMultipleFiles_library.ts] +export import math = require("exportImportMultipleFiles_math"); +math.add(3, 4); // OK + +//// [exportImportMultipleFiles_userCode.ts] +import lib = require('./exportImportMultipleFiles_library'); +lib.math.add(3, 4); // Shouldnt be error + + +//// [exportImportMultipleFiles_math.js] +define(["require", "exports"], function (require, exports) { + function add(a, b) { + return a + b; + } + exports.add = add; +}); +//// [exportImportMultipleFiles_library.js] +define(["require", "exports", "exportImportMultipleFiles_math"], function (require, exports, math) { + exports.math = math; + exports.math.add(3, 4); +}); +//// [exportImportMultipleFiles_userCode.js] +define(["require", "exports", './exportImportMultipleFiles_library'], function (require, exports, lib) { + lib.math.add(3, 4); +}); diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.js b/tests/baselines/reference/exportImportNonInstantiatedModule.js new file mode 100644 index 0000000000000..d9081efcd3619 --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.js @@ -0,0 +1,17 @@ +//// [exportImportNonInstantiatedModule.ts] +module A { + export interface I { x: number } +} + +module B { + export import A1 = A + +} + +var x: B.A1.I = { x: 1 }; + +//// [exportImportNonInstantiatedModule.js] +var B; +(function (B) { +})(B || (B = {})); +var x = { x: 1 }; diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.js b/tests/baselines/reference/exportImportNonInstantiatedModule2.js new file mode 100644 index 0000000000000..85e8f33ffd8a7 --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.js @@ -0,0 +1,38 @@ +//// [tests/cases/compiler/exportImportNonInstantiatedModule2.ts] //// + +//// [w1.ts] + +export = Widget1 +interface Widget1 { name: string; } + +//// [exporter.ts] +export import w = require('./w1'); + +//// [consumer.ts] +import e = require('./exporter'); + +export function w(): e.w { // Should be OK + return {name: 'value' }; +} + +//// [w1.js] +define(["require", "exports"], function (require, exports) { +}); +//// [exporter.js] +define(["require", "exports"], function (require, exports) { +}); +//// [consumer.js] +define(["require", "exports"], function (require, exports) { + function w() { + return { name: 'value' }; + } + exports.w = w; +}); + + +//// [w1.d.ts] +export = Widget1; +//// [exporter.d.ts] +export import w = require('./w1'); +//// [consumer.d.ts] +export declare function w(); diff --git a/tests/baselines/reference/exportNonVisibleType.errors.txt b/tests/baselines/reference/exportNonVisibleType.errors.txt new file mode 100644 index 0000000000000..7f615efc6155b --- /dev/null +++ b/tests/baselines/reference/exportNonVisibleType.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ==== + interface I1 { + a: string; + b: number; + } + + var x: I1 = {a: "test", b: 42}; + export = x; // Should fail, I1 not exported. + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + +==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ==== + interface I1 { + a: string; + b: number; + } + + class C1 { + m1: I1; + } + + export = C1; // Should fail, type I1 of visible member C1.m1 not exported. + +==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ==== + interface I1 { + a: string; + b: number; + } + + class C1 { + private m1: I1; + } + + export = C1; // Should work, private type I1 of visible class C1 only used in private member m1. + \ No newline at end of file diff --git a/tests/baselines/reference/exportNonVisibleType.js b/tests/baselines/reference/exportNonVisibleType.js new file mode 100644 index 0000000000000..101c356d582a5 --- /dev/null +++ b/tests/baselines/reference/exportNonVisibleType.js @@ -0,0 +1,54 @@ +//// [tests/cases/conformance/externalModules/exportNonVisibleType.ts] //// + +//// [foo1.ts] +interface I1 { + a: string; + b: number; +} + +var x: I1 = {a: "test", b: 42}; +export = x; // Should fail, I1 not exported. + + +//// [foo2.ts] +interface I1 { + a: string; + b: number; +} + +class C1 { + m1: I1; +} + +export = C1; // Should fail, type I1 of visible member C1.m1 not exported. + +//// [foo3.ts] +interface I1 { + a: string; + b: number; +} + +class C1 { + private m1: I1; +} + +export = C1; // Should work, private type I1 of visible class C1 only used in private member m1. + + +//// [foo1.js] +var x = { a: "test", b: 42 }; +module.exports = x; +//// [foo2.js] +var C1 = (function () { + function C1() { + } + return C1; +})(); +module.exports = C1; +//// [foo3.js] +var C1 = (function () { + function C1() { + } + return C1; +})(); +module.exports = C1; diff --git a/tests/baselines/reference/exportPrivateType.js b/tests/baselines/reference/exportPrivateType.js new file mode 100644 index 0000000000000..0fd36aa5d8fd5 --- /dev/null +++ b/tests/baselines/reference/exportPrivateType.js @@ -0,0 +1,54 @@ +//// [exportPrivateType.ts] +module foo { + class C1 { + x: string; + y: C1; + } + + class C2 { + test() { return true; } + } + + interface I1 { + (a: string, b: string): string; + (x: number, y: number): I1; + } + + interface I2 { + x: string; + y: number; + } + + // None of the types are exported, so per section 10.3, should all be errors + export var e: C1; + export var f: I1; + export var g: C2; + export var h: I2; +} + +var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'. + + + +//// [exportPrivateType.js] +var foo; +(function (foo) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + var C2 = (function () { + function C2() { + } + C2.prototype.test = function () { + return true; + }; + return C2; + })(); + foo.e; + foo.f; + foo.g; + foo.h; +})(foo || (foo = {})); +var y = foo.g; diff --git a/tests/baselines/reference/exportSameNameFuncVar.errors.txt b/tests/baselines/reference/exportSameNameFuncVar.errors.txt new file mode 100644 index 0000000000000..44d0c5446bd0a --- /dev/null +++ b/tests/baselines/reference/exportSameNameFuncVar.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/exportSameNameFuncVar.ts (1 errors) ==== + export var a = 10; + export function a() { + ~ +!!! Duplicate identifier 'a'. + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSameNameFuncVar.js b/tests/baselines/reference/exportSameNameFuncVar.js new file mode 100644 index 0000000000000..600bdf1223476 --- /dev/null +++ b/tests/baselines/reference/exportSameNameFuncVar.js @@ -0,0 +1,12 @@ +//// [exportSameNameFuncVar.ts] +export var a = 10; +export function a() { +} + +//// [exportSameNameFuncVar.js] +define(["require", "exports"], function (require, exports) { + exports.a = 10; + function a() { + } + exports.a = a; +}); diff --git a/tests/baselines/reference/exportVisibility.js b/tests/baselines/reference/exportVisibility.js new file mode 100644 index 0000000000000..a18d54d8e4880 --- /dev/null +++ b/tests/baselines/reference/exportVisibility.js @@ -0,0 +1,23 @@ +//// [exportVisibility.ts] +export class Foo { +} + +export var foo = new Foo(); + +export function test(foo: Foo) { + return true; +} + + +//// [exportVisibility.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +exports.Foo = Foo; +exports.foo = new Foo(); +function test(foo) { + return true; +} +exports.test = test; diff --git a/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.js b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.js new file mode 100644 index 0000000000000..341de323694cc --- /dev/null +++ b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.js @@ -0,0 +1,17 @@ +//// [exportedInterfaceInaccessibleInCallbackInModule.ts] +export interface ProgressCallback { + (progress:any):any; +} + +// --- Generic promise +export declare class TPromise { + + constructor(init:(complete: (value:V)=>void, error:(err:any)=>void, progress:ProgressCallback)=>void, oncancel?: any); + + // removing this method fixes the error squiggle..... + public then(success?: (value:V)=>TPromise, error?: (err:any)=>TPromise, progress?:ProgressCallback): TPromise; +} + +//// [exportedInterfaceInaccessibleInCallbackInModule.js] +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/exportedVariable1.js b/tests/baselines/reference/exportedVariable1.js new file mode 100644 index 0000000000000..39eea8d34b584 --- /dev/null +++ b/tests/baselines/reference/exportedVariable1.js @@ -0,0 +1,10 @@ +//// [exportedVariable1.ts] +export var foo = {name: "Bill"}; +var upper = foo.name.toUpperCase(); + + +//// [exportedVariable1.js] +define(["require", "exports"], function (require, exports) { + exports.foo = { name: "Bill" }; + var upper = exports.foo.name.toUpperCase(); +}); diff --git a/tests/baselines/reference/exportingContainingVisibleType.errors.txt b/tests/baselines/reference/exportingContainingVisibleType.errors.txt new file mode 100644 index 0000000000000..8649494ddb4e7 --- /dev/null +++ b/tests/baselines/reference/exportingContainingVisibleType.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/exportingContainingVisibleType.ts (1 errors) ==== + class Foo { + public get foo() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var i: Foo; + return i; // Should be fine (previous bug report visibility error). + + } + } + + export var x = 5; + \ No newline at end of file diff --git a/tests/baselines/reference/expr.errors.txt b/tests/baselines/reference/expr.errors.txt new file mode 100644 index 0000000000000..5b233d8a2da1b --- /dev/null +++ b/tests/baselines/reference/expr.errors.txt @@ -0,0 +1,384 @@ +==== tests/cases/compiler/expr.ts (69 errors) ==== + interface I { + } + + enum E { + Red, Green, Blue + } + + function f() { + var a; + var n=3; + var s=""; + var b=false; + var i:I; + var e:E; + + n&&a; + n&&s; + n&&b; + n&&i; + n&&n; + n&&e; + + s&&a; + s&&n; + s&&b; + s&&i; + s&&s; + s&&e; + + a&&n; + a&&s; + a&&b; + a&&i; + a&&a; + a&&e; + + i&&n; + i&&s; + i&&b; + i&&a; + i&&i; + i&&e; + + e&&n; + e&&s; + e&&b; + e&&a; + e&&i; + e&&e; + + n||a; + n||s; + n||b; + n||i; + n||n; + n||e; + + s||a; + s||n; + s||b; + s||i; + s||s; + s||e; + + a||n; + a||s; + a||b; + a||i; + a||a; + a||e; + + i||n; + i||s; + i||b; + i||a; + i||i; + i||e; + + e||n; + e||s; + e||b; + e||a; + e||i; + e||e; + + n==a; + n==s; + ~~~~ +!!! Operator '==' cannot be applied to types 'number' and 'string'. + n==b; + ~~~~ +!!! Operator '==' cannot be applied to types 'number' and 'boolean'. + n==i; + n==n; + n==e; + + s==a; + s==n; + ~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'number'. + s==b; + ~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'boolean'. + s==i; + s==s; + s==e; + ~~~~ +!!! Operator '==' cannot be applied to types 'string' and 'E'. + + a==n; + a==s; + a==b; + a==i; + a==a; + a==e; + + i==n; + i==s; + i==b; + i==a; + i==i; + i==e; + + e==n; + e==s; + ~~~~ +!!! Operator '==' cannot be applied to types 'E' and 'string'. + e==b; + ~~~~ +!!! Operator '==' cannot be applied to types 'E' and 'boolean'. + e==a; + e==i; + e==e; + + +i; + +s; + +n; + +a; + +b; + + -i; + -s; + -n; + -a; + -b; + + !i; + !s; + !n; + !a; + !b; + + + n+a; + n+s; + n+b; + ~~~ +!!! Operator '+' cannot be applied to types 'number' and 'boolean'. + n+i; + ~~~ +!!! Operator '+' cannot be applied to types 'number' and 'I'. + n+n; + n+e; + + s+a; + s+n; + s+b; + s+i; + s+s; + s+e; + + a+n; + a+s; + a+b; + a+i; + a+a; + a+e; + + i+n; + ~~~ +!!! Operator '+' cannot be applied to types 'I' and 'number'. + i+s; + i+b; + ~~~ +!!! Operator '+' cannot be applied to types 'I' and 'boolean'. + i+a; + i+i; + ~~~ +!!! Operator '+' cannot be applied to types 'I' and 'I'. + i+e; + ~~~ +!!! Operator '+' cannot be applied to types 'I' and 'E'. + + e+n; + e+s; + e+b; + ~~~ +!!! Operator '+' cannot be applied to types 'E' and 'boolean'. + e+a; + e+i; + ~~~ +!!! Operator '+' cannot be applied to types 'E' and 'I'. + e+e; + + n^a; + n^s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n^b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n^i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n^n; + n^e; + + s^a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s^n; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s^b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s^i; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s^s; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s^e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + a^n; + a^s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a^b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a^i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a^a; + a^e; + + i^n; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i^s; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i^b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i^a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i^i; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i^e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + e^n; + e^s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e^b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e^a; + e^i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e^e; + + n-a; + n-s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n-b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n-i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + n-n; + n-e; + + s-a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s-n; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s-b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s-i; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s-s; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + s-e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + a-n; + a-s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a-b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a-i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + a-a; + a-e; + + i-n; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i-s; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i-b; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i-a; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i-i; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + i-e; + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + e-n; + e-s; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e-b; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e-a; + e-i; + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + e-e; + + } \ No newline at end of file diff --git a/tests/baselines/reference/expr.js b/tests/baselines/reference/expr.js new file mode 100644 index 0000000000000..9baf55084c12d --- /dev/null +++ b/tests/baselines/reference/expr.js @@ -0,0 +1,457 @@ +//// [expr.ts] +interface I { +} + +enum E { + Red, Green, Blue +} + +function f() { + var a; + var n=3; + var s=""; + var b=false; + var i:I; + var e:E; + + n&&a; + n&&s; + n&&b; + n&&i; + n&&n; + n&&e; + + s&&a; + s&&n; + s&&b; + s&&i; + s&&s; + s&&e; + + a&&n; + a&&s; + a&&b; + a&&i; + a&&a; + a&&e; + + i&&n; + i&&s; + i&&b; + i&&a; + i&&i; + i&&e; + + e&&n; + e&&s; + e&&b; + e&&a; + e&&i; + e&&e; + + n||a; + n||s; + n||b; + n||i; + n||n; + n||e; + + s||a; + s||n; + s||b; + s||i; + s||s; + s||e; + + a||n; + a||s; + a||b; + a||i; + a||a; + a||e; + + i||n; + i||s; + i||b; + i||a; + i||i; + i||e; + + e||n; + e||s; + e||b; + e||a; + e||i; + e||e; + + n==a; + n==s; + n==b; + n==i; + n==n; + n==e; + + s==a; + s==n; + s==b; + s==i; + s==s; + s==e; + + a==n; + a==s; + a==b; + a==i; + a==a; + a==e; + + i==n; + i==s; + i==b; + i==a; + i==i; + i==e; + + e==n; + e==s; + e==b; + e==a; + e==i; + e==e; + + +i; + +s; + +n; + +a; + +b; + + -i; + -s; + -n; + -a; + -b; + + !i; + !s; + !n; + !a; + !b; + + + n+a; + n+s; + n+b; + n+i; + n+n; + n+e; + + s+a; + s+n; + s+b; + s+i; + s+s; + s+e; + + a+n; + a+s; + a+b; + a+i; + a+a; + a+e; + + i+n; + i+s; + i+b; + i+a; + i+i; + i+e; + + e+n; + e+s; + e+b; + e+a; + e+i; + e+e; + + n^a; + n^s; + n^b; + n^i; + n^n; + n^e; + + s^a; + s^n; + s^b; + s^i; + s^s; + s^e; + + a^n; + a^s; + a^b; + a^i; + a^a; + a^e; + + i^n; + i^s; + i^b; + i^a; + i^i; + i^e; + + e^n; + e^s; + e^b; + e^a; + e^i; + e^e; + + n-a; + n-s; + n-b; + n-i; + n-n; + n-e; + + s-a; + s-n; + s-b; + s-i; + s-s; + s-e; + + a-n; + a-s; + a-b; + a-i; + a-a; + a-e; + + i-n; + i-s; + i-b; + i-a; + i-i; + i-e; + + e-n; + e-s; + e-b; + e-a; + e-i; + e-e; + +} + +//// [expr.js] +var E; +(function (E) { + E[E["Red"] = 0] = "Red"; + E[E["Green"] = 1] = "Green"; + E[E["Blue"] = 2] = "Blue"; +})(E || (E = {})); +function f() { + var a; + var n = 3; + var s = ""; + var b = false; + var i; + var e; + n && a; + n && s; + n && b; + n && i; + n && n; + n && e; + s && a; + s && n; + s && b; + s && i; + s && s; + s && e; + a && n; + a && s; + a && b; + a && i; + a && a; + a && e; + i && n; + i && s; + i && b; + i && a; + i && i; + i && e; + e && n; + e && s; + e && b; + e && a; + e && i; + e && e; + n || a; + n || s; + n || b; + n || i; + n || n; + n || e; + s || a; + s || n; + s || b; + s || i; + s || s; + s || e; + a || n; + a || s; + a || b; + a || i; + a || a; + a || e; + i || n; + i || s; + i || b; + i || a; + i || i; + i || e; + e || n; + e || s; + e || b; + e || a; + e || i; + e || e; + n == a; + n == s; + n == b; + n == i; + n == n; + n == e; + s == a; + s == n; + s == b; + s == i; + s == s; + s == e; + a == n; + a == s; + a == b; + a == i; + a == a; + a == e; + i == n; + i == s; + i == b; + i == a; + i == i; + i == e; + e == n; + e == s; + e == b; + e == a; + e == i; + e == e; + +i; + +s; + +n; + +a; + +b; + -i; + -s; + -n; + -a; + -b; + !i; + !s; + !n; + !a; + !b; + n + a; + n + s; + n + b; + n + i; + n + n; + n + e; + s + a; + s + n; + s + b; + s + i; + s + s; + s + e; + a + n; + a + s; + a + b; + a + i; + a + a; + a + e; + i + n; + i + s; + i + b; + i + a; + i + i; + i + e; + e + n; + e + s; + e + b; + e + a; + e + i; + e + e; + n ^ a; + n ^ s; + n ^ b; + n ^ i; + n ^ n; + n ^ e; + s ^ a; + s ^ n; + s ^ b; + s ^ i; + s ^ s; + s ^ e; + a ^ n; + a ^ s; + a ^ b; + a ^ i; + a ^ a; + a ^ e; + i ^ n; + i ^ s; + i ^ b; + i ^ a; + i ^ i; + i ^ e; + e ^ n; + e ^ s; + e ^ b; + e ^ a; + e ^ i; + e ^ e; + n - a; + n - s; + n - b; + n - i; + n - n; + n - e; + s - a; + s - n; + s - b; + s - i; + s - s; + s - e; + a - n; + a - s; + a - b; + a - i; + a - a; + a - e; + i - n; + i - s; + i - b; + i - a; + i - i; + i - e; + e - n; + e - s; + e - b; + e - a; + e - i; + e - e; +} diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js new file mode 100644 index 0000000000000..7997944ee7a4d --- /dev/null +++ b/tests/baselines/reference/extBaseClass1.js @@ -0,0 +1,68 @@ +//// [extBaseClass1.ts] +module M { + export class B { + public x=10; + } + + export class C extends B { + } +} + +module M { + export class C2 extends B { + } +} + +module N { + export class C3 extends M.B { + } +} + + +//// [extBaseClass1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var B = (function () { + function B() { + this.x = 10; + } + return B; + })(); + M.B = B; + var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; + })(B); + M.C = C; +})(M || (M = {})); +var M; +(function (M) { + var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; + })(M.B); + M.C2 = C2; +})(M || (M = {})); +var N; +(function (N) { + var C3 = (function (_super) { + __extends(C3, _super); + function C3() { + _super.apply(this, arguments); + } + return C3; + })(M.B); + N.C3 = C3; +})(N || (N = {})); diff --git a/tests/baselines/reference/extBaseClass2.errors.txt b/tests/baselines/reference/extBaseClass2.errors.txt new file mode 100644 index 0000000000000..79e8525a8f3d9 --- /dev/null +++ b/tests/baselines/reference/extBaseClass2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/extBaseClass2.ts (2 errors) ==== + module N { + export class C4 extends M.B { + ~~~ +!!! Module 'M' has no exported member 'B'. + } + } + + module M { + export class C5 extends B { + ~ +!!! Cannot find name 'B'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js new file mode 100644 index 0000000000000..eff9754901056 --- /dev/null +++ b/tests/baselines/reference/extBaseClass2.js @@ -0,0 +1,41 @@ +//// [extBaseClass2.ts] +module N { + export class C4 extends M.B { + } +} + +module M { + export class C5 extends B { + } +} + + +//// [extBaseClass2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var N; +(function (N) { + var C4 = (function (_super) { + __extends(C4, _super); + function C4() { + _super.apply(this, arguments); + } + return C4; + })(M.B); + N.C4 = C4; +})(N || (N = {})); +var M; +(function (M) { + var C5 = (function (_super) { + __extends(C5, _super); + function C5() { + _super.apply(this, arguments); + } + return C5; + })(B); + M.C5 = C5; +})(M || (M = {})); diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js new file mode 100644 index 0000000000000..836db4dc362a8 --- /dev/null +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -0,0 +1,43 @@ +//// [extendAndImplementTheSameBaseType.ts] +class C { + foo: number + bar() {} +} +class D extends C implements C { + baz() { } +} + +var c: C; +var d: D = new D(); +d.bar(); +d.baz(); +d.foo; + +//// [extendAndImplementTheSameBaseType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.bar = function () { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.baz = function () { + }; + return D; +})(C); +var c; +var d = new D(); +d.bar(); +d.baz(); +d.foo; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt new file mode 100644 index 0000000000000..0a70481141229 --- /dev/null +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/extendAndImplementTheSameBaseType2.ts (3 errors) ==== + class C { + foo: number + bar(): T { + return null; + } + } + class D extends C implements C { + ~ +!!! Class 'D' incorrectly implements interface 'C': +!!! Types of property 'bar' are incompatible: +!!! Type '() => string' is not assignable to type '() => number': +!!! Type 'string' is not assignable to type 'number'. + baz() { } + } + + var d: D = new D(); + var r: string = d.foo; + ~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + var r2: number = d.foo; + + var r3: string = d.bar(); + var r4: number = d.bar(); + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js new file mode 100644 index 0000000000000..8311f4d6ce6fe --- /dev/null +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -0,0 +1,47 @@ +//// [extendAndImplementTheSameBaseType2.ts] +class C { + foo: number + bar(): T { + return null; + } +} +class D extends C implements C { + baz() { } +} + +var d: D = new D(); +var r: string = d.foo; +var r2: number = d.foo; + +var r3: string = d.bar(); +var r4: number = d.bar(); + +//// [extendAndImplementTheSameBaseType2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.prototype.bar = function () { + return null; + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.baz = function () { + }; + return D; +})(C); +var d = new D(); +var r = d.foo; +var r2 = d.foo; +var r3 = d.bar(); +var r4 = d.bar(); diff --git a/tests/baselines/reference/extendArray.errors.txt b/tests/baselines/reference/extendArray.errors.txt new file mode 100644 index 0000000000000..d9524acebcbcc --- /dev/null +++ b/tests/baselines/reference/extendArray.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/extendArray.ts (2 errors) ==== + var a = [1,2]; + a.forEach(function (v,i,a) {}); + + + declare module _Core { + interface Array { + collect(fn:(e:_element) => _element[]) : any[]; + ~~~~~~~~ +!!! Cannot find name '_element'. + ~~~~~~~~ +!!! Cannot find name '_element'. + } + } + + + var arr = (Array).prototype; + arr.collect = function (fn) { + var res = []; + for (var i = 0; i < this.length; ++i) { + var tmp = fn(this[i]); + for (var j = 0; j < tmp.length; ++j) { + res.push(tmp[j]); + } + } + return res; + }; + \ No newline at end of file diff --git a/tests/baselines/reference/extendArray.js b/tests/baselines/reference/extendArray.js new file mode 100644 index 0000000000000..876bf1358d966 --- /dev/null +++ b/tests/baselines/reference/extendArray.js @@ -0,0 +1,40 @@ +//// [extendArray.ts] +var a = [1,2]; +a.forEach(function (v,i,a) {}); + + +declare module _Core { + interface Array { + collect(fn:(e:_element) => _element[]) : any[]; + } +} + + +var arr = (Array).prototype; +arr.collect = function (fn) { + var res = []; + for (var i = 0; i < this.length; ++i) { + var tmp = fn(this[i]); + for (var j = 0; j < tmp.length; ++j) { + res.push(tmp[j]); + } + } + return res; +}; + + +//// [extendArray.js] +var a = [1, 2]; +a.forEach(function (v, i, a) { +}); +var arr = Array.prototype; +arr.collect = function (fn) { + var res = []; + for (var i = 0; i < this.length; ++i) { + var tmp = fn(this[i]); + for (var j = 0; j < tmp.length; ++j) { + res.push(tmp[j]); + } + } + return res; +}; diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js new file mode 100644 index 0000000000000..5034fd966914c --- /dev/null +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -0,0 +1,25 @@ +//// [extendBaseClassBeforeItsDeclared.ts] +class derived extends base { } + +class base { constructor (public n: number) { } } + +//// [extendBaseClassBeforeItsDeclared.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + return derived; +})(base); +var base = (function () { + function base(n) { + this.n = n; + } + return base; +})(); diff --git a/tests/baselines/reference/extendBooleanInterface.js b/tests/baselines/reference/extendBooleanInterface.js new file mode 100644 index 0000000000000..4e458b14cf937 --- /dev/null +++ b/tests/baselines/reference/extendBooleanInterface.js @@ -0,0 +1,18 @@ +//// [extendBooleanInterface.ts] +interface Boolean { + doStuff(): string; + doOtherStuff(x: T): T; +} + +var x = true; +var a: string = x.doStuff(); +var b: string = x.doOtherStuff('hm'); +var c: string = x['doStuff'](); +var d: string = x['doOtherStuff']('hm'); + +//// [extendBooleanInterface.js] +var x = true; +var a = x.doStuff(); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/tests/baselines/reference/extendGenericArray.errors.txt b/tests/baselines/reference/extendGenericArray.errors.txt new file mode 100644 index 0000000000000..62f2daa78cf8e --- /dev/null +++ b/tests/baselines/reference/extendGenericArray.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/extendGenericArray.ts (1 errors) ==== + interface Array { + foo(): T; + } + + var arr: string[] = []; + var x: number = arr.foo(); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray.js b/tests/baselines/reference/extendGenericArray.js new file mode 100644 index 0000000000000..6c74e8d512cab --- /dev/null +++ b/tests/baselines/reference/extendGenericArray.js @@ -0,0 +1,11 @@ +//// [extendGenericArray.ts] +interface Array { + foo(): T; +} + +var arr: string[] = []; +var x: number = arr.foo(); + +//// [extendGenericArray.js] +var arr = []; +var x = arr.foo(); diff --git a/tests/baselines/reference/extendGenericArray2.errors.txt b/tests/baselines/reference/extendGenericArray2.errors.txt new file mode 100644 index 0000000000000..f0cdb4098e79f --- /dev/null +++ b/tests/baselines/reference/extendGenericArray2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/extendGenericArray2.ts (1 errors) ==== + interface IFoo { + x: T; + } + + interface Array extends IFoo { } + + var arr: string[] = []; + var y: number = arr.x; + ~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray2.js b/tests/baselines/reference/extendGenericArray2.js new file mode 100644 index 0000000000000..f78cd0bcb5a4e --- /dev/null +++ b/tests/baselines/reference/extendGenericArray2.js @@ -0,0 +1,13 @@ +//// [extendGenericArray2.ts] +interface IFoo { + x: T; +} + +interface Array extends IFoo { } + +var arr: string[] = []; +var y: number = arr.x; + +//// [extendGenericArray2.js] +var arr = []; +var y = arr.x; diff --git a/tests/baselines/reference/extendNonClassSymbol1.errors.txt b/tests/baselines/reference/extendNonClassSymbol1.errors.txt new file mode 100644 index 0000000000000..730427f529d1d --- /dev/null +++ b/tests/baselines/reference/extendNonClassSymbol1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/extendNonClassSymbol1.ts (1 errors) ==== + class A { foo() { } } + var x = A; + class C extends x { } // error, could not find symbol xs + ~ +!!! Cannot find name 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js new file mode 100644 index 0000000000000..cb1f6f82419ff --- /dev/null +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -0,0 +1,27 @@ +//// [extendNonClassSymbol1.ts] +class A { foo() { } } +var x = A; +class C extends x { } // error, could not find symbol xs + +//// [extendNonClassSymbol1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var x = A; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(x); diff --git a/tests/baselines/reference/extendNonClassSymbol2.errors.txt b/tests/baselines/reference/extendNonClassSymbol2.errors.txt new file mode 100644 index 0000000000000..69328a3a7136c --- /dev/null +++ b/tests/baselines/reference/extendNonClassSymbol2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/extendNonClassSymbol2.ts (1 errors) ==== + function Foo() { + this.x = 1; + } + var x = new Foo(); // legal, considered a constructor function + class C extends Foo {} // error, could not find symbol Foo + ~~~ +!!! Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js new file mode 100644 index 0000000000000..7321df4cd8827 --- /dev/null +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -0,0 +1,25 @@ +//// [extendNonClassSymbol2.ts] +function Foo() { + this.x = 1; +} +var x = new Foo(); // legal, considered a constructor function +class C extends Foo {} // error, could not find symbol Foo + +//// [extendNonClassSymbol2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function Foo() { + this.x = 1; +} +var x = new Foo(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(Foo); diff --git a/tests/baselines/reference/extendNumberInterface.js b/tests/baselines/reference/extendNumberInterface.js new file mode 100644 index 0000000000000..b497619e54d71 --- /dev/null +++ b/tests/baselines/reference/extendNumberInterface.js @@ -0,0 +1,18 @@ +//// [extendNumberInterface.ts] +interface Number { + doStuff(): string; + doOtherStuff(x:T): T; +} + +var x = 1; +var a: string = x.doStuff(); +var b: string = x.doOtherStuff('hm'); +var c: string = x['doStuff'](); +var d: string = x['doOtherStuff']('hm'); + +//// [extendNumberInterface.js] +var x = 1; +var a = x.doStuff(); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/tests/baselines/reference/extendStringInterface.js b/tests/baselines/reference/extendStringInterface.js new file mode 100644 index 0000000000000..3b4cfadc34687 --- /dev/null +++ b/tests/baselines/reference/extendStringInterface.js @@ -0,0 +1,18 @@ +//// [extendStringInterface.ts] +interface String { + doStuff(): string; + doOtherStuff(x:T): T; +} + +var x = ''; +var a: string = x.doStuff(); +var b: string = x.doOtherStuff('hm'); +var c: string = x['doStuff'](); +var d: string = x['doOtherStuff']('hm'); + +//// [extendStringInterface.js] +var x = ''; +var a = x.doStuff(); +var b = x.doOtherStuff('hm'); +var c = x['doStuff'](); +var d = x['doOtherStuff']('hm'); diff --git a/tests/baselines/reference/extendedInterfaceGenericType.js b/tests/baselines/reference/extendedInterfaceGenericType.js new file mode 100644 index 0000000000000..10875afca5f5f --- /dev/null +++ b/tests/baselines/reference/extendedInterfaceGenericType.js @@ -0,0 +1,17 @@ +//// [extendedInterfaceGenericType.ts] +interface Alpha { + takesArgOfT(arg: T): Alpha; + makeBetaOfNumber(): Beta; +} +interface Beta extends Alpha { +} + +var alpha: Alpha; +var betaOfNumber = alpha.makeBetaOfNumber(); +betaOfNumber.takesArgOfT(5); + + +//// [extendedInterfaceGenericType.js] +var alpha; +var betaOfNumber = alpha.makeBetaOfNumber(); +betaOfNumber.takesArgOfT(5); diff --git a/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt new file mode 100644 index 0000000000000..5cabc36a6b825 --- /dev/null +++ b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/extendedInterfacesWithDuplicateTypeParameters.ts (3 errors) ==== + interface InterfaceWithMultipleTypars { // should error + ~ +!!! Duplicate identifier 'A'. + bar(): void; + } + + interface InterfaceWithSomeTypars { // should not error + bar(): void; + } + + interface InterfaceWithSomeTypars { // should error + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! All declarations of an interface must have identical type parameters. + ~ +!!! Duplicate identifier 'C'. + bar2(): void; + } \ No newline at end of file diff --git a/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.js b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.js new file mode 100644 index 0000000000000..cb196fb871593 --- /dev/null +++ b/tests/baselines/reference/extendedInterfacesWithDuplicateTypeParameters.js @@ -0,0 +1,14 @@ +//// [extendedInterfacesWithDuplicateTypeParameters.ts] +interface InterfaceWithMultipleTypars { // should error + bar(): void; +} + +interface InterfaceWithSomeTypars { // should not error + bar(): void; +} + +interface InterfaceWithSomeTypars { // should error + bar2(): void; +} + +//// [extendedInterfacesWithDuplicateTypeParameters.js] diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js new file mode 100644 index 0000000000000..09280cd224a86 --- /dev/null +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -0,0 +1,83 @@ +//// [tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer.ts] //// + +//// [extendingClassFromAliasAndUsageInIndexer_backbone.ts] +export class Model { + public someData: string; +} + +//// [extendingClassFromAliasAndUsageInIndexer_moduleA.ts] +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +export class VisualizationModel extends Backbone.Model { + // interesting stuff here +} + +//// [extendingClassFromAliasAndUsageInIndexer_moduleB.ts] +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +export class VisualizationModel extends Backbone.Model { + // different interesting stuff here +} + +//// [extendingClassFromAliasAndUsageInIndexer_main.ts] +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +import moduleA = require("extendingClassFromAliasAndUsageInIndexer_moduleA"); +import moduleB = require("extendingClassFromAliasAndUsageInIndexer_moduleB"); +interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; +} +var moduleATyped: IHasVisualizationModel = moduleA; +var moduleMap: { [key: string]: IHasVisualizationModel } = { + "moduleA": moduleA, + "moduleB": moduleB +}; +var moduleName: string; +var visModel = new moduleMap[moduleName].VisualizationModel(); + +//// [extendingClassFromAliasAndUsageInIndexer_backbone.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +exports.Model = Model; +//// [extendingClassFromAliasAndUsageInIndexer_moduleA.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [extendingClassFromAliasAndUsageInIndexer_moduleB.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +var VisualizationModel = (function (_super) { + __extends(VisualizationModel, _super); + function VisualizationModel() { + _super.apply(this, arguments); + } + return VisualizationModel; +})(Backbone.Model); +exports.VisualizationModel = VisualizationModel; +//// [extendingClassFromAliasAndUsageInIndexer_main.js] +var moduleA = require("extendingClassFromAliasAndUsageInIndexer_moduleA"); +var moduleB = require("extendingClassFromAliasAndUsageInIndexer_moduleB"); +var moduleATyped = moduleA; +var moduleMap = { + "moduleA": moduleA, + "moduleB": moduleB +}; +var moduleName; +var visModel = new moduleMap[moduleName].VisualizationModel(); diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt b/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt new file mode 100644 index 0000000000000..f24e3bbc9f42d --- /dev/null +++ b/tests/baselines/reference/extendsClauseAlreadySeen.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/extendsClauseAlreadySeen.ts (4 errors) ==== + class C { + + } + class D extends C extends C { + ~~~~~~~ +!!! '{' expected. + ~ +!!! ';' expected. + baz() { } + ~ +!!! ';' expected. + ~~~ +!!! Cannot find name 'baz'. + } \ No newline at end of file diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt b/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt new file mode 100644 index 0000000000000..9e5c02a425556 --- /dev/null +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/extendsClauseAlreadySeen2.ts (3 errors) ==== + class C { + + } + class D extends C extends C { + ~~~~~~~ +!!! '{' expected. + ~~~~~~~~~~~ + ~~~~~~ +!!! Cannot find name 'string'. + baz() { } + ~~~~~~~~~~~~~ + } + ~ +!!! Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'. \ No newline at end of file diff --git a/tests/baselines/reference/extension.errors.txt b/tests/baselines/reference/extension.errors.txt new file mode 100644 index 0000000000000..1a5a8f1f01d3a --- /dev/null +++ b/tests/baselines/reference/extension.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/extension.ts (5 errors) ==== + interface I { + x; + } + + interface I { + y; + } + + declare module M { + export class C { + public p:number; + } + } + + declare module M { + export extension class C { + ~~~~~~ +!!! Declaration or statement expected. + ~~~~~ +!!! ';' expected. + ~~~~~~~~~ +!!! Cannot find name 'extension'. + ~ +!!! Duplicate identifier 'C'. + public pe:string; + } + } + + var c=new M.C(); + c.pe; + ~~ +!!! Property 'pe' does not exist on type 'C'. + c.p; + var i:I; + i.x; + i.y; + + \ No newline at end of file diff --git a/tests/baselines/reference/externFunc.js b/tests/baselines/reference/externFunc.js new file mode 100644 index 0000000000000..5fa5be0f76ef0 --- /dev/null +++ b/tests/baselines/reference/externFunc.js @@ -0,0 +1,8 @@ +//// [externFunc.ts] +declare function parseInt(s:string):number; + +parseInt("2"); + + +//// [externFunc.js] +parseInt("2"); diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt new file mode 100644 index 0000000000000..286a617432eaf --- /dev/null +++ b/tests/baselines/reference/externModule.errors.txt @@ -0,0 +1,94 @@ +==== tests/cases/compiler/externModule.ts (13 errors) ==== + declare module { + ~~~~~~ +!!! ';' expected. + ~ +!!! ';' expected. + ~~~~~~~ +!!! Cannot find name 'declare'. + ~~~~~~ +!!! Cannot find name 'module'. + export class XDate { + ~~~~~~ +!!! Statement expected. + ~~~~~~~~~~~~~~~~~~~~ + public getDay():number; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + public getXDate():number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + // etc. + ~~~~~~~~~ + + + // Called as a function + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Not supported anymore? public (): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ~~~~~ + // Called as a constructor + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number, date: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number, date: number, hours: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number, date: number, hours: number, minutes: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number, date: number, hours: number, minutes: number, seconds: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, ms: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(value: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor(); + ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ +!!! Constructor implementation expected. + + ~~~~~ + static parse(string: string): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + static UTC(year: number, month: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + static UTC(year: number, month: number, date: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + static UTC(year: number, month: number, date: number, hours: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + static UTC(year: number, month: number, date: number, hours: number, minutes: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ms: number): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + static now(): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } + ~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + } + ~ +!!! Declaration or statement expected. + + var d=new XDate(); + d.getDay(); + d=new XDate(1978,2); + d.getXDate(); + var n=XDate.parse("3/2/2004"); + n=XDate.UTC(1964,2,1); + + \ No newline at end of file diff --git a/tests/baselines/reference/externModuleClobber.js b/tests/baselines/reference/externModuleClobber.js new file mode 100644 index 0000000000000..39ee0061c4b29 --- /dev/null +++ b/tests/baselines/reference/externModuleClobber.js @@ -0,0 +1,19 @@ +//// [externModuleClobber.ts] +declare module EM { + export class Position { } + + export class EC { + public getPosition() : EM.Position; + } +} + +var x:EM.Position; +var ec:EM.EC = new EM.EC(); + +x = ec.getPosition(); + + +//// [externModuleClobber.js] +var x; +var ec = new EM.EC(); +x = ec.getPosition(); diff --git a/tests/baselines/reference/externSemantics.errors.txt b/tests/baselines/reference/externSemantics.errors.txt new file mode 100644 index 0000000000000..2732c28d1ce2b --- /dev/null +++ b/tests/baselines/reference/externSemantics.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/externSemantics.ts (2 errors) ==== + declare var x=10; + ~ +!!! Initializers are not allowed in ambient contexts. + declare var v; + declare var y:number=3; + ~ +!!! Initializers are not allowed in ambient contexts. + \ No newline at end of file diff --git a/tests/baselines/reference/externSyntax.errors.txt b/tests/baselines/reference/externSyntax.errors.txt new file mode 100644 index 0000000000000..791df1b7e0eb2 --- /dev/null +++ b/tests/baselines/reference/externSyntax.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/externSyntax.ts (1 errors) ==== + declare var v; + declare module M { + export class D { + public p; + } + export class C { + public f(); + public g() { } // error body + ~ +!!! A function implementation cannot be declared in an ambient context. + } + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleAssignToVar.js b/tests/baselines/reference/externalModuleAssignToVar.js new file mode 100644 index 0000000000000..9440fbb069cd2 --- /dev/null +++ b/tests/baselines/reference/externalModuleAssignToVar.js @@ -0,0 +1,64 @@ +//// [tests/cases/compiler/externalModuleAssignToVar.ts] //// + +//// [externalModuleAssignToVar_ext.ts] +class D { foo: string; } +export = D; + +//// [externalModuleAssignToVar_core_require.ts] +export class C { bar: string; } + +//// [externalModuleAssignToVar_core_require2.ts] +class C { baz: string; } +export = C; + +//// [externalModuleAssignToVar_core.ts] +/// +import ext = require('externalModuleAssignToVar_core_require'); +var y1: { C: new() => ext.C; } = ext; +y1 = ext; // ok + +import ext2 = require('externalModuleAssignToVar_core_require2'); +var y2: new() => ext2 = ext2; +y2 = ext2; // ok + +import ext3 = require('externalModuleAssignToVar_ext'); +var y3: new () => ext3 = ext3; +y3 = ext3; // ok + + +//// [externalModuleAssignToVar_core_require.js] +define(["require", "exports"], function (require, exports) { + var C = (function () { + function C() { + } + return C; + })(); + exports.C = C; +}); +//// [externalModuleAssignToVar_core_require2.js] +define(["require", "exports"], function (require, exports) { + var C = (function () { + function C() { + } + return C; + })(); + return C; +}); +//// [externalModuleAssignToVar_ext.js] +define(["require", "exports"], function (require, exports) { + var D = (function () { + function D() { + } + return D; + })(); + return D; +}); +//// [externalModuleAssignToVar_core.js] +define(["require", "exports", 'externalModuleAssignToVar_core_require', 'externalModuleAssignToVar_core_require2', 'externalModuleAssignToVar_ext'], function (require, exports, ext, ext2, ext3) { + var y1 = ext; + y1 = ext; + var y2 = ext2; + y2 = ext2; + var y3 = ext3; + y3 = ext3; +}); diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt new file mode 100644 index 0000000000000..651f1a2f94537 --- /dev/null +++ b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/externalModuleExportingGenericClass_file1.ts (1 errors) ==== + import a = require('externalModuleExportingGenericClass_file0'); + var v: a; // this should report error + ~ +!!! Generic type 'C' requires 1 type argument(s). + var v2: any = (new a()).foo; + var v3: number = (new a()).foo; + +==== tests/cases/compiler/externalModuleExportingGenericClass_file0.ts (0 errors) ==== + + class C { + foo: T; + } + export = C; + + \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.js b/tests/baselines/reference/externalModuleExportingGenericClass.js new file mode 100644 index 0000000000000..80e4f7bc66c08 --- /dev/null +++ b/tests/baselines/reference/externalModuleExportingGenericClass.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/externalModuleExportingGenericClass.ts] //// + +//// [externalModuleExportingGenericClass_file0.ts] + +class C { + foo: T; +} +export = C; + + +//// [externalModuleExportingGenericClass_file1.ts] +import a = require('externalModuleExportingGenericClass_file0'); +var v: a; // this should report error +var v2: any = (new a()).foo; +var v3: number = (new a()).foo; + + +//// [externalModuleExportingGenericClass_file0.js] +var C = (function () { + function C() { + } + return C; +})(); +module.exports = C; +//// [externalModuleExportingGenericClass_file1.js] +var a = require('externalModuleExportingGenericClass_file0'); +var v; +var v2 = (new a()).foo; +var v3 = (new a()).foo; diff --git a/tests/baselines/reference/externalModuleQualification.js b/tests/baselines/reference/externalModuleQualification.js new file mode 100644 index 0000000000000..f8ddbfae1405f --- /dev/null +++ b/tests/baselines/reference/externalModuleQualification.js @@ -0,0 +1,29 @@ +//// [externalModuleQualification.ts] +export var ID = "test"; +export class DiffEditor { + private previousDiffAction: NavigateAction; + constructor(id: string = ID) { + } +} +class NavigateAction { + f(editor: DiffEditor) { + } +} + + +//// [externalModuleQualification.js] +exports.ID = "test"; +var DiffEditor = (function () { + function DiffEditor(id) { + if (id === void 0) { id = exports.ID; } + } + return DiffEditor; +})(); +exports.DiffEditor = DiffEditor; +var NavigateAction = (function () { + function NavigateAction() { + } + NavigateAction.prototype.f = function (editor) { + }; + return NavigateAction; +})(); diff --git a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js new file mode 100644 index 0000000000000..73ef9b6b2964c --- /dev/null +++ b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier.ts] //// + +//// [externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts] +export function foo() { }; + +//// [externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts] +export import file1 = require('externalModuleReferenceOfImportDeclarationWithExportModifier_0'); +file1.foo(); + + +//// [externalModuleReferenceOfImportDeclarationWithExportModifier_0.js] +define(["require", "exports"], function (require, exports) { + function foo() { + } + exports.foo = foo; + ; +}); +//// [externalModuleReferenceOfImportDeclarationWithExportModifier_1.js] +define(["require", "exports", 'externalModuleReferenceOfImportDeclarationWithExportModifier_0'], function (require, exports, file1) { + exports.file1 = file1; + exports.file1.foo(); +}); diff --git a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt new file mode 100644 index 0000000000000..f2dca2d5f445a --- /dev/null +++ b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration_file3.ts (1 errors) ==== + /// + import file1 = require('externalModuleRefernceResolutionOrderInImportDeclaration_file1'); + file1.foo(); + ~~~ +!!! Property 'foo' does not exist on type 'typeof "externalModuleRefernceResolutionOrderInImportDeclaration_file1"'. + file1.bar(); + + +==== tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration_file1.ts (0 errors) ==== + export function foo() { }; + +==== tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration_file2.ts (0 errors) ==== + declare module "externalModuleRefernceResolutionOrderInImportDeclaration_file1" { + export function bar(); + } + + \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js new file mode 100644 index 0000000000000..72517dfcb42e0 --- /dev/null +++ b/tests/baselines/reference/externalModuleRefernceResolutionOrderInImportDeclaration.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/externalModuleRefernceResolutionOrderInImportDeclaration.ts] //// + +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file1.ts] +export function foo() { }; + +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file2.ts] +declare module "externalModuleRefernceResolutionOrderInImportDeclaration_file1" { + export function bar(); +} + + +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file3.ts] +/// +import file1 = require('externalModuleRefernceResolutionOrderInImportDeclaration_file1'); +file1.foo(); +file1.bar(); + + + +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file2.js] +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file1.js] +function foo() { +} +exports.foo = foo; +; +//// [externalModuleRefernceResolutionOrderInImportDeclaration_file3.js] +var file1 = require('externalModuleRefernceResolutionOrderInImportDeclaration_file1'); +file1.foo(); +file1.bar(); diff --git a/tests/baselines/reference/externalModuleResolution.js b/tests/baselines/reference/externalModuleResolution.js new file mode 100644 index 0000000000000..9c2a8073706ac --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/externalModuleResolution.ts] //// + +//// [foo.d.ts] +declare module M1 { + export var X:number; +} +export = M1 + +//// [foo.ts] +module M2 { + export var Y = 1; +} +export = M2 + +//// [consumer.ts] +import x = require('./foo'); +x.Y // .ts should be picked + +//// [foo.js] +var M2; +(function (M2) { + M2.Y = 1; +})(M2 || (M2 = {})); +module.exports = M2; +//// [consumer.js] +var x = require('./foo'); +x.Y; diff --git a/tests/baselines/reference/externalModuleResolution2.js b/tests/baselines/reference/externalModuleResolution2.js new file mode 100644 index 0000000000000..e04b0691116dd --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution2.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/externalModuleResolution2.ts] //// + +//// [foo.ts] +module M2 { + export var X = 1; +} +export = M2 + +//// [foo.d.ts] +declare module M1 { + export var Y:number; +} +export = M1 + + +//// [consumer.ts] +import x = require('./foo'); +x.X // .ts should be picked + +//// [foo.js] +var M2; +(function (M2) { + M2.X = 1; +})(M2 || (M2 = {})); +module.exports = M2; +//// [consumer.js] +var x = require('./foo'); +x.X; diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt new file mode 100644 index 0000000000000..28dce8a0a26c0 --- /dev/null +++ b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts (1 errors) ==== + + // Not on line 0 because we want to verify the error is placed in the appropriate location. + export module M { + ~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js new file mode 100644 index 0000000000000..b5c939453e666 --- /dev/null +++ b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.js @@ -0,0 +1,7 @@ +//// [externalModuleWithoutCompilerFlag1.ts] + +// Not on line 0 because we want to verify the error is placed in the appropriate location. + export module M { +} + +//// [externalModuleWithoutCompilerFlag1.js] diff --git a/tests/baselines/reference/fatArrowSelf.js b/tests/baselines/reference/fatArrowSelf.js new file mode 100644 index 0000000000000..7648cb28a4b47 --- /dev/null +++ b/tests/baselines/reference/fatArrowSelf.js @@ -0,0 +1,55 @@ +//// [fatArrowSelf.ts] +module Events { + export interface ListenerCallback { + (value:any):void; + } + export class EventEmitter { + public addListener(type:string, listener:ListenerCallback) { + } + } +} + +module Consumer { + class EventEmitterConsummer { + constructor (private emitter: Events.EventEmitter) { } + + private register() { + this.emitter.addListener('change', (e) => { + this.changed(); + }); + } + + private changed() { + } + } +} + +//// [fatArrowSelf.js] +var Events; +(function (Events) { + var EventEmitter = (function () { + function EventEmitter() { + } + EventEmitter.prototype.addListener = function (type, listener) { + }; + return EventEmitter; + })(); + Events.EventEmitter = EventEmitter; +})(Events || (Events = {})); +var Consumer; +(function (Consumer) { + var EventEmitterConsummer = (function () { + function EventEmitterConsummer(emitter) { + this.emitter = emitter; + } + EventEmitterConsummer.prototype.register = function () { + var _this = this; + this.emitter.addListener('change', function (e) { + _this.changed(); + }); + }; + EventEmitterConsummer.prototype.changed = function () { + }; + return EventEmitterConsummer; + })(); +})(Consumer || (Consumer = {})); diff --git a/tests/baselines/reference/fatArrowfunctionAsType.js b/tests/baselines/reference/fatArrowfunctionAsType.js new file mode 100644 index 0000000000000..bd2dc4310d93c --- /dev/null +++ b/tests/baselines/reference/fatArrowfunctionAsType.js @@ -0,0 +1,13 @@ +//// [fatArrowfunctionAsType.ts] +declare var b: (x: T) => void ; + +var c: (x: T) => void = function (x: T) { return 42; } + +b = c; + + +//// [fatArrowfunctionAsType.js] +var c = function (x) { + return 42; +}; +b = c; diff --git a/tests/baselines/reference/fatarrowfunctions.js b/tests/baselines/reference/fatarrowfunctions.js new file mode 100644 index 0000000000000..1ad00820990a0 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctions.js @@ -0,0 +1,104 @@ +//// [fatarrowfunctions.ts] + +function foo(x:any) { + return x(); +} + + +foo((x:number,y,z)=>{return x+y+z;}); +foo((x,y,z)=>{return x+y+z;}); +foo((x,y:number,z)=>{return x+y+z;}); +foo((x,y:number,z:number)=>{return x+y+z;}); +foo((x,y,z:number)=>{return x+y+z;}); +foo(()=>{return 0;}); + +foo((x:number,y,z)=>x+y+z); +foo((x,y,z)=>x+y+z); +foo((x,y:number,z)=>{return x+y+z;}); +foo((x,y:number,z:number)=>{return x+y+z;}); +foo((x,y,z:number)=>{return x+y+z;}); +foo(()=>{return 0;}); + + +foo(((x) => x)); + +foo(x => x*x); + +var y = x => x*x; +var z = (x:number) => x*x; + +var w = () => 3; + +function ternaryTest(isWhile:boolean) { + + var f = isWhile ? function (n) { return n > 0; } : function (n) { return n === 0; }; + +} + +declare function setTimeout(expression: any, msec?: number, language?: any): number; + +var messenger = { + message: "Hello World", + start: function() { + setTimeout(() => { this.message.toString(); }, 3000); + } +}; + + +//// [fatarrowfunctions.js] +function foo(x) { + return x(); +} +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function () { + return 0; +}); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { return x + y + z; }); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function (x, y, z) { + return x + y + z; +}); +foo(function () { + return 0; +}); +foo((function (x) { return x; })); +foo(function (x) { return x * x; }); +var y = function (x) { return x * x; }; +var z = function (x) { return x * x; }; +var w = function () { return 3; }; +function ternaryTest(isWhile) { + var f = isWhile ? function (n) { + return n > 0; + } : function (n) { + return n === 0; + }; +} +var messenger = { + message: "Hello World", + start: function () { + var _this = this; + setTimeout(function () { + _this.message.toString(); + }, 3000); + } +}; diff --git a/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt new file mode 100644 index 0000000000000..d04b93b10ad42 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsErrors.errors.txt @@ -0,0 +1,63 @@ +==== tests/cases/compiler/fatarrowfunctionsErrors.ts (25 errors) ==== + foo((...Far:any[])=>{return 0;}) + ~~~ +!!! Cannot find name 'foo'. + foo((1)=>{return 0;}); + ~~ +!!! ',' expected. + ~ +!!! ':' expected. + ~ +!!! ',' expected. + ~ +!!! Declaration or statement expected. + ~ +!!! Declaration or statement expected. + ~~~ +!!! Cannot find name 'foo'. + foo((x?)=>{return x;}) + ~~~ +!!! Cannot find name 'foo'. + foo((x=0)=>{return x;}) + ~~~ +!!! Cannot find name 'foo'. + var y = x:number => x*x; + ~ +!!! ',' expected. + ~~ +!!! ';' expected. + ~ +!!! Cannot find name 'x'. + ~ +!!! Cannot find name 'x'. + ~ +!!! Cannot find name 'x'. + false? (() => null): null; + + // missing fatarrow + var x1 = () :void {}; + ~ +!!! '=>' expected. + var x2 = (a:number) :void {}; + ~ +!!! ')' expected. + ~ +!!! ',' expected. + ~ +!!! Variable declaration expected. + ~~~~ +!!! Variable declaration expected. + ~ +!!! Cannot find name 'a'. + var x3 = (a:number) {}; + ~ +!!! ')' expected. + ~ +!!! ',' expected. + ~ +!!! Variable declaration expected. + ~ +!!! Cannot find name 'a'. + var x4= (...a: any[]) { }; + ~ +!!! '=>' expected. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js new file mode 100644 index 0000000000000..033c2231689e7 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js @@ -0,0 +1,19 @@ +//// [fatarrowfunctionsInFunctionParameterDefaults.ts] +function fn(x = () => this, y = x()) { + + // should be 4 + return y; + +} + +fn.call(4); // Should be 4 + + +//// [fatarrowfunctionsInFunctionParameterDefaults.js] +function fn(x, y) { + var _this = this; + if (x === void 0) { x = function () { return _this; }; } + if (y === void 0) { y = x(); } + return y; +} +fn.call(4); diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.js b/tests/baselines/reference/fatarrowfunctionsInFunctions.js new file mode 100644 index 0000000000000..348a4b765ad0c --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.js @@ -0,0 +1,26 @@ +//// [fatarrowfunctionsInFunctions.ts] +declare function setTimeout(expression: any, msec?: number, language?: any): number; + +var messenger = { + message: "Hello World", + start: function() { + var _self = this; + setTimeout(function() { + _self.message.toString(); + }, 3000); + } +}; +messenger.start(); + + +//// [fatarrowfunctionsInFunctions.js] +var messenger = { + message: "Hello World", + start: function () { + var _self = this; + setTimeout(function () { + _self.message.toString(); + }, 3000); + } +}; +messenger.start(); diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt new file mode 100644 index 0000000000000..a73ec1dd734d9 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt @@ -0,0 +1,150 @@ +==== tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts (9 errors) ==== + // valid + + // no params + () => 1; + + // one param, no type + (arg) => 2; + + // one param, no type + arg => 2; + + // one param, no type with default value + (arg = 1) => 3; + + // one param, no type, optional + (arg?) => 4; + + // typed param + (arg: number) => 5; + + // typed param with default value + (arg: number = 0) => 6; + + // optional param + (arg?: number) => 7; + + // var arg param + (...arg: number[]) => 8; + + // multiple arguments + (arg1, arg2) => 12; + (arg1 = 1, arg2 =3) => 13; + (arg1?, arg2?) => 14; + (arg1: number, arg2: number) => 15; + (arg1: number = 0, arg2: number = 1) => 16; + (arg1?: number, arg2?: number) => 17; + (arg1, ...arg2: number[]) => 18; + (arg1, arg2?: number) => 19; + + // in paren + (() => 21); + ((arg) => 22); + ((arg = 1) => 23); + ((arg?) => 24); + ((arg: number) => 25); + ((arg: number = 0) => 26); + ((arg?: number) => 27); + ((...arg: number[]) => 28); + + // in multiple paren + (((((arg) => { return 32; })))); + + // in ternary exression + false ? () => 41 : null; + false ? (arg) => 42 : null; + false ? (arg = 1) => 43 : null; + false ? (arg?) => 44 : null; + false ? (arg: number) => 45 : null; + false ? (arg?: number) => 46 : null; + false ? (arg?: number = 0) => 47 : null; + ~~~ +!!! Parameter cannot have question mark and initializer. + false ? (...arg: number[]) => 48 : null; + + // in ternary exression within paren + false ? (() => 51) : null; + false ? ((arg) => 52) : null; + false ? ((arg = 1) => 53) : null; + false ? ((arg?) => 54) : null; + false ? ((arg: number) => 55) : null; + false ? ((arg?: number) => 56) : null; + false ? ((arg?: number = 0) => 57) : null; + ~~~ +!!! Parameter cannot have question mark and initializer. + false ? ((...arg: number[]) => 58) : null; + + // ternary exression's else clause + false ? null : () => 61; + false ? null : (arg) => 62; + false ? null : (arg = 1) => 63; + false ? null : (arg?) => 64; + false ? null : (arg: number) => 65; + false ? null : (arg?: number) => 66; + false ? null : (arg?: number = 0) => 67; + ~~~ +!!! Parameter cannot have question mark and initializer. + false ? null : (...arg: number[]) => 68; + + + // nested ternary expressions + ((a?) => { return a; }) ? (b? ) => { return b; } : (c? ) => { return c; }; + + //multiple levels + (a?) => { return a; } ? (b)=>(c)=>81 : (c)=>(d)=>82; + ~ +!!! ';' expected. + ~ +!!! ';' expected. + + + // In Expressions + ((arg) => 90) instanceof Function; + ((arg = 1) => 91) instanceof Function; + ((arg? ) => 92) instanceof Function; + ((arg: number) => 93) instanceof Function; + ((arg: number = 1) => 94) instanceof Function; + ((arg?: number) => 95) instanceof Function; + ((...arg: number[]) => 96) instanceof Function; + + '' + ((arg) => 100); + ((arg) => 0) + '' + ((arg) => 101); + ((arg = 1) => 0) + '' + ((arg = 2) => 102); + ((arg?) => 0) + '' + ((arg?) => 103); + ((arg:number) => 0) + '' + ((arg:number) => 104); + ((arg:number = 1) => 0) + '' + ((arg:number = 2) => 105); + ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); + ~~~ +!!! Parameter cannot have question mark and initializer. + ~~~ +!!! Parameter cannot have question mark and initializer. + ((...arg:number[]) => 0) + '' + ((...arg:number[]) => 107); + ((arg1, arg2?) => 0) + '' + ((arg1,arg2?) => 108); + ((arg1, ...arg2:number[]) => 0) + '' + ((arg1, ...arg2:number[]) => 108); + + + // Function Parameters + function foo(...arg: any[]) { } + + foo( + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a? ) => 113, + (a, b? ) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + ~ +!!! Parameter cannot have question mark and initializer. + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + ~ +!!! Parameter cannot have question mark and initializer. + (a) => (b) => (c) => 121, + false? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt new file mode 100644 index 0000000000000..fd103a3dea296 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (5 errors) ==== + (arg1?, arg2) => 101; + ~~~~ +!!! A required parameter cannot follow an optional parameter. + (...arg?) => 102; + ~~~ +!!! A rest parameter cannot be optional. + (...arg) => 103; + (...arg:number [] = []) => 104; + ~~~ +!!! A rest parameter cannot have an initializer. + (...) => 105; + ~ +!!! Identifier expected. + + // Non optional parameter following an optional one + (arg1 = 1, arg2) => 1; + ~~~~ +!!! A required parameter cannot follow an optional parameter. \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt new file mode 100644 index 0000000000000..daaa90c3ca43e --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (17 errors) ==== + var tt1 = (a, (b, c)) => a+b+c; + ~~ +!!! ';' expected. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'b'. + ~ +!!! Cannot find name 'c'. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'b'. + ~ +!!! Cannot find name 'c'. + var tt2 = ((a), b, c) => a+b+c; + ~~ +!!! ';' expected. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'b'. + ~ +!!! Cannot find name 'c'. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'b'. + ~ +!!! Cannot find name 'c'. + + var tt3 = ((a)) => a; + ~~ +!!! ';' expected. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt new file mode 100644 index 0000000000000..40d00c1cff7e1 --- /dev/null +++ b/tests/baselines/reference/fieldAndGetterWithSameName.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/fieldAndGetterWithSameName.ts (2 errors) ==== + export class C { + x: number; + get x(): number { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js new file mode 100644 index 0000000000000..ce91d4616f4d3 --- /dev/null +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.js @@ -0,0 +1,14 @@ +//// [fillInMissingTypeArgsOnConstructCalls.ts] +class A{ + list: T ; +} +var a = new A(); + + +//// [fillInMissingTypeArgsOnConstructCalls.js] +var A = (function () { + function A() { + } + return A; +})(); +var a = new A(); diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js new file mode 100644 index 0000000000000..acb30a88ffa2b --- /dev/null +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.js @@ -0,0 +1,8 @@ +//// [fixTypeParameterInSignatureWithRestParameters.ts] +function bar(item1: T, item2: T) { } +bar(1, ""); // Should be ok + +//// [fixTypeParameterInSignatureWithRestParameters.js] +function bar(item1, item2) { +} +bar(1, ""); diff --git a/tests/baselines/reference/for-inStatements.errors.txt b/tests/baselines/reference/for-inStatements.errors.txt new file mode 100644 index 0000000000000..e90e3dea3d2a2 --- /dev/null +++ b/tests/baselines/reference/for-inStatements.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/conformance/statements/for-inStatements/for-inStatements.ts (1 errors) ==== + var aString: string; + for (aString in {}) { } + + var anAny: any; + for (anAny in {}) { } + + for (var x in {}) { } + for (var x in []) { } + for (var x in [1, 2, 3, 4, 5]) { } + + function fn(): any { } + for (var x in fn()) { } + + for (var x in /[a-z]/) { } + for (var x in new Date()) { } + + var c, d, e; + + for (var x in c || d) { } + for (var x in e ? c : d) { } + for (var x in 42 ? c : d) { } + for (var x in '' ? c : d) { } + for (var x in 42 ? d[x] : c[x]) { } + for (var x in c[d]) { } + + for (var x in ((x: T) => x)) { } + for (var x in function (x: string, y: number) { return x + y }) { } + + class A { + biz() { + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + return null; + } + + static baz() { + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } + + return null; + } + } + + class B extends A { + boz() { + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + + for (var x in super.biz) { } + for (var x in super.biz()) { } + return null; + } + } + + interface I { + id: number; + [idx: number]: I; + } + var i: I; + + for (var x in i[42]) { } + + + module M { + export class X { + name:string + } + } + + for (var x in M) { } + for (var x in M.X) { } + + enum Color { Red, Blue } + + for (var x in Color) { } + for (var x in Color.Blue) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js new file mode 100644 index 0000000000000..ca0a7a2e4c5c3 --- /dev/null +++ b/tests/baselines/reference/for-inStatements.js @@ -0,0 +1,196 @@ +//// [for-inStatements.ts] +var aString: string; +for (aString in {}) { } + +var anAny: any; +for (anAny in {}) { } + +for (var x in {}) { } +for (var x in []) { } +for (var x in [1, 2, 3, 4, 5]) { } + +function fn(): any { } +for (var x in fn()) { } + +for (var x in /[a-z]/) { } +for (var x in new Date()) { } + +var c, d, e; + +for (var x in c || d) { } +for (var x in e ? c : d) { } +for (var x in 42 ? c : d) { } +for (var x in '' ? c : d) { } +for (var x in 42 ? d[x] : c[x]) { } +for (var x in c[d]) { } + +for (var x in ((x: T) => x)) { } +for (var x in function (x: string, y: number) { return x + y }) { } + +class A { + biz() { + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + return null; + } + + static baz() { + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } + + return null; + } +} + +class B extends A { + boz() { + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + + for (var x in super.biz) { } + for (var x in super.biz()) { } + return null; + } +} + +interface I { + id: number; + [idx: number]: I; +} +var i: I; + +for (var x in i[42]) { } + + +module M { + export class X { + name:string + } +} + +for (var x in M) { } +for (var x in M.X) { } + +enum Color { Red, Blue } + +for (var x in Color) { } +for (var x in Color.Blue) { } + + +//// [for-inStatements.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var aString; +for (aString in {}) { +} +var anAny; +for (anAny in {}) { +} +for (var x in {}) { +} +for (var x in []) { +} +for (var x in [1, 2, 3, 4, 5]) { +} +function fn() { +} +for (var x in fn()) { +} +for (var x in /[a-z]/) { +} +for (var x in new Date()) { +} +var c, d, e; +for (var x in c || d) { +} +for (var x in e ? c : d) { +} +for (var x in 42 ? c : d) { +} +for (var x in '' ? c : d) { +} +for (var x in 42 ? d[x] : c[x]) { +} +for (var x in c[d]) { +} +for (var x in (function (x) { return x; })) { +} +for (var x in function (x, y) { + return x + y; +}) { +} +var A = (function () { + function A() { + } + A.prototype.biz = function () { + for (var x in this.biz()) { + } + for (var x in this.biz) { + } + for (var x in this) { + } + return null; + }; + A.baz = function () { + for (var x in this) { + } + for (var x in this.baz) { + } + for (var x in this.baz()) { + } + return null; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.boz = function () { + for (var x in this.biz()) { + } + for (var x in this.biz) { + } + for (var x in this) { + } + for (var x in _super.prototype.biz) { + } + for (var x in _super.prototype.biz.call(this)) { + } + return null; + }; + return B; +})(A); +var i; +for (var x in i[42]) { +} +var M; +(function (M) { + var X = (function () { + function X() { + } + return X; + })(); + M.X = X; +})(M || (M = {})); +for (var x in M) { +} +for (var x in M.X) { +} +var Color; +(function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Blue"] = 1] = "Blue"; +})(Color || (Color = {})); +for (var x in Color) { +} +for (var x in 1 /* Blue */) { +} diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt new file mode 100644 index 0000000000000..28d51a6fa1176 --- /dev/null +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -0,0 +1,96 @@ +==== tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts (16 errors) ==== + var aNumber: number; + for (aNumber in {}) { } + ~~~~~~~ +!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. + + var aBoolean: boolean; + for (aBoolean in {}) { } + ~~~~~~~~ +!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. + + var aRegExp: RegExp; + for (aRegExp in {}) { } + ~~~~~~~ +!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. + + for (var idx : number in {}) { } + ~~~~~~~~~~~~ +!!! Variable declarations of a 'for' statement cannot use a type annotation. + + function fn(): void { } + for (var x in fn()) { } + ~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + var c : string, d:string, e; + + for (var x in c || d) { } + ~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in e ? c : d) { } + ~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in 42 ? c : d) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in '' ? c : d) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in 42 ? d[x] : c[x]) { } + ~~~~~~~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in c[23]) { } + ~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + for (var x in ((x: T) => x)) { } + for (var x in function (x: string, y: number) { return x + y }) { } + + class A { + biz() : number{ + for (var x in this.biz()) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in this.biz) { } + for (var x in this) { } + return null; + } + + static baz() : number { + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + + return null; + } + } + + class B extends A { + boz() { + for (var x in this.biz()) { } + ~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + for (var x in this.biz) { } + for (var x in this) { } + + for (var x in super.biz) { } + for (var x in super.biz()) { } + ~~~~~~~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + return null; + } + } + + interface I { + id: number; + [idx: number]: number; + } + var i: I; + + for (var x in i[42]) { } + ~~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js new file mode 100644 index 0000000000000..ce6350ab67c43 --- /dev/null +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -0,0 +1,152 @@ +//// [for-inStatementsInvalid.ts] +var aNumber: number; +for (aNumber in {}) { } + +var aBoolean: boolean; +for (aBoolean in {}) { } + +var aRegExp: RegExp; +for (aRegExp in {}) { } + +for (var idx : number in {}) { } + +function fn(): void { } +for (var x in fn()) { } + +var c : string, d:string, e; + +for (var x in c || d) { } +for (var x in e ? c : d) { } +for (var x in 42 ? c : d) { } +for (var x in '' ? c : d) { } +for (var x in 42 ? d[x] : c[x]) { } +for (var x in c[23]) { } + +for (var x in ((x: T) => x)) { } +for (var x in function (x: string, y: number) { return x + y }) { } + +class A { + biz() : number{ + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + return null; + } + + static baz() : number { + for (var x in this) { } + for (var x in this.baz) { } + for (var x in this.baz()) { } + + return null; + } +} + +class B extends A { + boz() { + for (var x in this.biz()) { } + for (var x in this.biz) { } + for (var x in this) { } + + for (var x in super.biz) { } + for (var x in super.biz()) { } + return null; + } +} + +interface I { + id: number; + [idx: number]: number; +} +var i: I; + +for (var x in i[42]) { } + + +//// [for-inStatementsInvalid.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var aNumber; +for (aNumber in {}) { +} +var aBoolean; +for (aBoolean in {}) { +} +var aRegExp; +for (aRegExp in {}) { +} +for (var idx in {}) { +} +function fn() { +} +for (var x in fn()) { +} +var c, d, e; +for (var x in c || d) { +} +for (var x in e ? c : d) { +} +for (var x in 42 ? c : d) { +} +for (var x in '' ? c : d) { +} +for (var x in 42 ? d[x] : c[x]) { +} +for (var x in c[23]) { +} +for (var x in (function (x) { return x; })) { +} +for (var x in function (x, y) { + return x + y; +}) { +} +var A = (function () { + function A() { + } + A.prototype.biz = function () { + for (var x in this.biz()) { + } + for (var x in this.biz) { + } + for (var x in this) { + } + return null; + }; + A.baz = function () { + for (var x in this) { + } + for (var x in this.baz) { + } + for (var x in this.baz()) { + } + return null; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.boz = function () { + for (var x in this.biz()) { + } + for (var x in this.biz) { + } + for (var x in this) { + } + for (var x in _super.prototype.biz) { + } + for (var x in _super.prototype.biz.call(this)) { + } + return null; + }; + return B; +})(A); +var i; +for (var x in i[42]) { +} diff --git a/tests/baselines/reference/for.errors.txt b/tests/baselines/reference/for.errors.txt new file mode 100644 index 0000000000000..8df068271a246 --- /dev/null +++ b/tests/baselines/reference/for.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/for.ts (1 errors) ==== + for (var i = 0; i < 10; i++) { // ok + var x1 = i; + } + + for (var j: number = 0; j < 10; j++) { // ok + var x2 = j; + } + + for (var k = 0; k < 10;) { // ok + k++; + } + + for (; i < 10;) { // ok + i++; + } + + for (; i > 1; i--) { // ok + } + + for (var l = 0; ; l++) { // ok + if (l > 10) { + break; + } + } + + for (; ;) { // ok + } + + for () { // error + ~ +!!! Expression expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/forBreakStatements.js b/tests/baselines/reference/forBreakStatements.js new file mode 100644 index 0000000000000..017837cded45d --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.js @@ -0,0 +1,67 @@ +//// [forBreakStatements.ts] +for (; ;) { + break; +} + +ONE: +for (; ;) { + break ONE; +} + +TWO: +THREE: +for (; ;) { + break THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + break FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) break SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) break SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } + break EIGHT; +} + + +//// [forBreakStatements.js] +for (;;) { + break; +} +ONE: for (;;) { + break ONE; +} +TWO: THREE: for (;;) { + break THREE; +} +FOUR: for (;;) { + FIVE: for (;;) { + break FOUR; + } +} +for (;;) { + SIX: for (;;) + break SIX; +} +SEVEN: for (;;) + for (;;) + for (;;) + break SEVEN; +EIGHT: for (;;) { + var fn = function () { + }; + break EIGHT; +} diff --git a/tests/baselines/reference/forContinueStatements.js b/tests/baselines/reference/forContinueStatements.js new file mode 100644 index 0000000000000..b1ace24f4b16e --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.js @@ -0,0 +1,67 @@ +//// [forContinueStatements.ts] +for (; ;) { + continue; +} + +ONE: +for (; ;) { + continue ONE; +} + +TWO: +THREE: +for (; ;) { + continue THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + continue FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) continue SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) continue SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } + continue EIGHT; +} + + +//// [forContinueStatements.js] +for (;;) { + continue; +} +ONE: for (;;) { + continue ONE; +} +TWO: THREE: for (;;) { + continue THREE; +} +FOUR: for (;;) { + FIVE: for (;;) { + continue FOUR; + } +} +for (;;) { + SIX: for (;;) + continue SIX; +} +SEVEN: for (;;) + for (;;) + for (;;) + continue SEVEN; +EIGHT: for (;;) { + var fn = function () { + }; + continue EIGHT; +} diff --git a/tests/baselines/reference/forIn.errors.txt b/tests/baselines/reference/forIn.errors.txt new file mode 100644 index 0000000000000..b7f61f6cea58a --- /dev/null +++ b/tests/baselines/reference/forIn.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/forIn.ts (2 errors) ==== + var arr = null; + for (var i:number in arr) { // error + ~~~~~~~~ +!!! Variable declarations of a 'for' statement cannot use a type annotation. + var x1 = arr[i]; + var y1 = arr[i]; + } + + for (var j in arr) { // ok + var x2 = arr[j]; + var y2 = arr[j]; + } + + var arr2 = []; + for (j in arr2) { // ok + var x3 = arr2[j]; + var y3 = arr2[j]; + } + + for (var l in arr) { + // error in the body + k[l] = 1; + ~ +!!! Cannot find name 'k'. + } \ No newline at end of file diff --git a/tests/baselines/reference/forIn.js b/tests/baselines/reference/forIn.js new file mode 100644 index 0000000000000..e287792ac01fe --- /dev/null +++ b/tests/baselines/reference/forIn.js @@ -0,0 +1,41 @@ +//// [forIn.ts] +var arr = null; +for (var i:number in arr) { // error + var x1 = arr[i]; + var y1 = arr[i]; +} + +for (var j in arr) { // ok + var x2 = arr[j]; + var y2 = arr[j]; +} + +var arr2 = []; +for (j in arr2) { // ok + var x3 = arr2[j]; + var y3 = arr2[j]; +} + +for (var l in arr) { + // error in the body + k[l] = 1; +} + +//// [forIn.js] +var arr = null; +for (var i in arr) { + var x1 = arr[i]; + var y1 = arr[i]; +} +for (var j in arr) { + var x2 = arr[j]; + var y2 = arr[j]; +} +var arr2 = []; +for (j in arr2) { + var x3 = arr2[j]; + var y3 = arr2[j]; +} +for (var l in arr) { + k[l] = 1; +} diff --git a/tests/baselines/reference/forIn2.errors.txt b/tests/baselines/reference/forIn2.errors.txt new file mode 100644 index 0000000000000..c1dbfa2da9b59 --- /dev/null +++ b/tests/baselines/reference/forIn2.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/forIn2.ts (1 errors) ==== + for (var i in 1) { + ~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/forIn2.js b/tests/baselines/reference/forIn2.js new file mode 100644 index 0000000000000..0e43036e2585e --- /dev/null +++ b/tests/baselines/reference/forIn2.js @@ -0,0 +1,7 @@ +//// [forIn2.ts] +for (var i in 1) { +} + +//// [forIn2.js] +for (var i in 1) { +} diff --git a/tests/baselines/reference/forInBreakStatements.js b/tests/baselines/reference/forInBreakStatements.js new file mode 100644 index 0000000000000..09f0071d4bf87 --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.js @@ -0,0 +1,67 @@ +//// [forInBreakStatements.ts] +for(var x in {}) { + break; +} + +ONE: +for(var x in {}) { + break ONE; +} + +TWO: +THREE: +for(var x in {}) { + break THREE; +} + +FOUR: +for(var x in {}) { + FIVE: + for(var x in {}) { + break FOUR; + } +} + +for(var x in {}) { + SIX: + for(var x in {}) break SIX; +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; + +EIGHT: +for (var x in {}){ + var fn = function () { } + break EIGHT; +} + + +//// [forInBreakStatements.js] +for (var x in {}) { + break; +} +ONE: for (var x in {}) { + break ONE; +} +TWO: THREE: for (var x in {}) { + break THREE; +} +FOUR: for (var x in {}) { + FIVE: for (var x in {}) { + break FOUR; + } +} +for (var x in {}) { + SIX: for (var x in {}) + break SIX; +} +SEVEN: for (var x in {}) + for (var x in {}) + for (var x in {}) + break SEVEN; +EIGHT: for (var x in {}) { + var fn = function () { + }; + break EIGHT; +} diff --git a/tests/baselines/reference/forInContinueStatements.js b/tests/baselines/reference/forInContinueStatements.js new file mode 100644 index 0000000000000..68cac5221aead --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.js @@ -0,0 +1,67 @@ +//// [forInContinueStatements.ts] +for(var x in {}) { + continue; +} + +ONE: +for(var x in {}) { + continue ONE; +} + +TWO: +THREE: +for(var x in {}) { + continue THREE; +} + +FOUR: +for(var x in {}) { + FIVE: + for(var x in {}) { + continue FOUR; + } +} + +for(var x in {}) { + SIX: + for(var x in {}) continue SIX; +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; + +EIGHT: +for (var x in {}){ + var fn = function () { } + continue EIGHT; +} + + +//// [forInContinueStatements.js] +for (var x in {}) { + continue; +} +ONE: for (var x in {}) { + continue ONE; +} +TWO: THREE: for (var x in {}) { + continue THREE; +} +FOUR: for (var x in {}) { + FIVE: for (var x in {}) { + continue FOUR; + } +} +for (var x in {}) { + SIX: for (var x in {}) + continue SIX; +} +SEVEN: for (var x in {}) + for (var x in {}) + for (var x in {}) + continue SEVEN; +EIGHT: for (var x in {}) { + var fn = function () { + }; + continue EIGHT; +} diff --git a/tests/baselines/reference/forInModule.js b/tests/baselines/reference/forInModule.js new file mode 100644 index 0000000000000..24d2ede55fdd0 --- /dev/null +++ b/tests/baselines/reference/forInModule.js @@ -0,0 +1,14 @@ +//// [forInModule.ts] +module Foo { + for (var i = 0; i < 1; i++) { + i+i; + } +} + +//// [forInModule.js] +var Foo; +(function (Foo) { + for (var i = 0; i < 1; i++) { + i + i; + } +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/forInStatement1.js b/tests/baselines/reference/forInStatement1.js new file mode 100644 index 0000000000000..1704fb49acb68 --- /dev/null +++ b/tests/baselines/reference/forInStatement1.js @@ -0,0 +1,9 @@ +//// [forInStatement1.ts] +var expr: any; +for (var a in expr) { +} + +//// [forInStatement1.js] +var expr; +for (var a in expr) { +} diff --git a/tests/baselines/reference/forInStatement2.errors.txt b/tests/baselines/reference/forInStatement2.errors.txt new file mode 100644 index 0000000000000..ef064280a7e7a --- /dev/null +++ b/tests/baselines/reference/forInStatement2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/forInStatement2.ts (1 errors) ==== + var expr: number; + for (var a in expr) { + ~~~~ +!!! The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement2.js b/tests/baselines/reference/forInStatement2.js new file mode 100644 index 0000000000000..138ec8957cab7 --- /dev/null +++ b/tests/baselines/reference/forInStatement2.js @@ -0,0 +1,9 @@ +//// [forInStatement2.ts] +var expr: number; +for (var a in expr) { +} + +//// [forInStatement2.js] +var expr; +for (var a in expr) { +} diff --git a/tests/baselines/reference/forInStatement3.js b/tests/baselines/reference/forInStatement3.js new file mode 100644 index 0000000000000..85a2ca84ae8ff --- /dev/null +++ b/tests/baselines/reference/forInStatement3.js @@ -0,0 +1,13 @@ +//// [forInStatement3.ts] +function F() { + var expr: T; + for (var a in expr) { + } +} + +//// [forInStatement3.js] +function F() { + var expr; + for (var a in expr) { + } +} diff --git a/tests/baselines/reference/forInStatement4.errors.txt b/tests/baselines/reference/forInStatement4.errors.txt new file mode 100644 index 0000000000000..87143619b49cc --- /dev/null +++ b/tests/baselines/reference/forInStatement4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/forInStatement4.ts (1 errors) ==== + var expr: any; + for (var a: number in expr) { + ~~~~~~~~~ +!!! Variable declarations of a 'for' statement cannot use a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement4.js b/tests/baselines/reference/forInStatement4.js new file mode 100644 index 0000000000000..7c82fd461df62 --- /dev/null +++ b/tests/baselines/reference/forInStatement4.js @@ -0,0 +1,9 @@ +//// [forInStatement4.ts] +var expr: any; +for (var a: number in expr) { +} + +//// [forInStatement4.js] +var expr; +for (var a in expr) { +} diff --git a/tests/baselines/reference/forInStatement5.js b/tests/baselines/reference/forInStatement5.js new file mode 100644 index 0000000000000..49a1b8858f2c2 --- /dev/null +++ b/tests/baselines/reference/forInStatement5.js @@ -0,0 +1,11 @@ +//// [forInStatement5.ts] +var a: string; +var expr: any; +for (a in expr) { +} + +//// [forInStatement5.js] +var a; +var expr; +for (a in expr) { +} diff --git a/tests/baselines/reference/forInStatement6.js b/tests/baselines/reference/forInStatement6.js new file mode 100644 index 0000000000000..0fc22179d2c6f --- /dev/null +++ b/tests/baselines/reference/forInStatement6.js @@ -0,0 +1,11 @@ +//// [forInStatement6.ts] +var a: any; +var expr: any; +for (a in expr) { +} + +//// [forInStatement6.js] +var a; +var expr; +for (a in expr) { +} diff --git a/tests/baselines/reference/forInStatement7.errors.txt b/tests/baselines/reference/forInStatement7.errors.txt new file mode 100644 index 0000000000000..8e75078d9e81b --- /dev/null +++ b/tests/baselines/reference/forInStatement7.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/forInStatement7.ts (1 errors) ==== + var a: number; + var expr: any; + for (a in expr) { + ~ +!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. + } \ No newline at end of file diff --git a/tests/baselines/reference/forInStatement7.js b/tests/baselines/reference/forInStatement7.js new file mode 100644 index 0000000000000..6d170fac22ad3 --- /dev/null +++ b/tests/baselines/reference/forInStatement7.js @@ -0,0 +1,11 @@ +//// [forInStatement7.ts] +var a: number; +var expr: any; +for (a in expr) { +} + +//// [forInStatement7.js] +var a; +var expr; +for (a in expr) { +} diff --git a/tests/baselines/reference/forStatements.js b/tests/baselines/reference/forStatements.js new file mode 100644 index 0000000000000..0988e9613a9d5 --- /dev/null +++ b/tests/baselines/reference/forStatements.js @@ -0,0 +1,111 @@ +//// [forStatements.ts] +interface I { + id: number; +} + +class C implements I { + id: number; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +for(var aNumber: number = 9.9;;){} +for(var aString: string = 'this is a string';;){} +for(var aDate: Date = new Date(12);;){} +for(var anObject: Object = new Object();;){} + +for(var anAny: any = null;;){} +for(var aSecondAny: any = undefined;;){} +for(var aVoid: void = undefined;;){} + +for(var anInterface: I = new C();;){} +for(var aClass: C = new C();;){} +for(var aGenericClass: D = new D();;){} +for(var anObjectLiteral: I = { id: 12 };;){} +for(var anOtherObjectLiteral: { id: number } = new C();;){} + +for(var aFunction: typeof F = F;;){} +for(var anOtherFunction: (x: string) => number = F;;){} +for(var aLambda: typeof F = (x) => 2;;){} + +for(var aModule: typeof M = M;;){} +for(var aClassInModule: M.A = new M.A();;){} +for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} + +//// [forStatements.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +for (var aNumber = 9.9;;) { +} +for (var aString = 'this is a string';;) { +} +for (var aDate = new Date(12);;) { +} +for (var anObject = new Object();;) { +} +for (var anAny = null;;) { +} +for (var aSecondAny = undefined;;) { +} +for (var aVoid = undefined;;) { +} +for (var anInterface = new C();;) { +} +for (var aClass = new C();;) { +} +for (var aGenericClass = new D();;) { +} +for (var anObjectLiteral = { id: 12 };;) { +} +for (var anOtherObjectLiteral = new C();;) { +} +for (var aFunction = F;;) { +} +for (var anOtherFunction = F;;) { +} +for (var aLambda = function (x) { return 2; };;) { +} +for (var aModule = M;;) { +} +for (var aClassInModule = new M.A();;) { +} +for (var aFunctionInModule = function (x) { return 'this is a string'; };;) { +} diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt new file mode 100644 index 0000000000000..17f50e3ff106b --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -0,0 +1,78 @@ +==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + valid: boolean; + } + + class C2 extends C { + name: string; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + // all of these are errors + for( var a: any;;){} + for( var a = 1;;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. + for( var a = 'a string';;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. + for( var a = new C();;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. + for( var a = new D();;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. + for( var a = M;;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. + + for( var b: I;;){} + for( var b = new C();;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. + for( var b = new C2();;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. + + for(var f = F;;){} + for( var f = (x: number) => '';;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. + + for(var arr: string[];;){} + for( var arr = [1, 2, 3, 4];;){} + ~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. + for( var arr = [new C(), new C2(), new D()];;){} + ~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '{}[]'. + + for(var arr2 = [new D()];;){} + for( var arr2 = new Array>();;){} + ~~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. + + for(var m: typeof M;;){} + for( var m = M.A;;){} + ~ +!!! Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js new file mode 100644 index 0000000000000..73db1ff3c7d26 --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -0,0 +1,131 @@ +//// [forStatementsMultipleInvalidDecl.ts] +interface I { + id: number; +} + +class C implements I { + id: number; + valid: boolean; +} + +class C2 extends C { + name: string; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +// all of these are errors +for( var a: any;;){} +for( var a = 1;;){} +for( var a = 'a string';;){} +for( var a = new C();;){} +for( var a = new D();;){} +for( var a = M;;){} + +for( var b: I;;){} +for( var b = new C();;){} +for( var b = new C2();;){} + +for(var f = F;;){} +for( var f = (x: number) => '';;){} + +for(var arr: string[];;){} +for( var arr = [1, 2, 3, 4];;){} +for( var arr = [new C(), new C2(), new D()];;){} + +for(var arr2 = [new D()];;){} +for( var arr2 = new Array>();;){} + +for(var m: typeof M;;){} +for( var m = M.A;;){} + +//// [forStatementsMultipleInvalidDecl.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +for (var a;;) { +} +for (var a = 1;;) { +} +for (var a = 'a string';;) { +} +for (var a = new C();;) { +} +for (var a = new D();;) { +} +for (var a = M;;) { +} +for (var b;;) { +} +for (var b = new C();;) { +} +for (var b = new C2();;) { +} +for (var f = F;;) { +} +for (var f = function (x) { return ''; };;) { +} +for (var arr;;) { +} +for (var arr = [1, 2, 3, 4];;) { +} +for (var arr = [new C(), new C2(), new D()];;) { +} +for (var arr2 = [new D()];;) { +} +for (var arr2 = new Array();;) { +} +for (var m;;) { +} +for (var m = M.A;;) { +} diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.js b/tests/baselines/reference/forStatementsMultipleValidDecl.js new file mode 100644 index 0000000000000..c7edbd93778c6 --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.js @@ -0,0 +1,86 @@ +//// [forStatementsMultipleValidDecl.ts] +// all expected to be valid + +for (var x: number; ;) { } +for (var x = 2; ;) { } + +for (var x = undefined; ;) { } +// new declaration space, making redeclaring x as a string valid +function declSpace() { + for (var x = 'this is a string'; ;) { } +} +interface Point { x: number; y: number; } + +for (var p: Point; ;) { } +for (var p = { x: 1, y: 2 }; ;) { } +for (var p: Point = { x: 0, y: undefined }; ;) { } +for (var p = { x: 1, y: undefined }; ;) { } +for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } +for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } +for (var p: typeof p; ;) { } + +for (var fn = function (s: string) { return 42; }; ;) { } +for (var fn = (s: string) => 3; ;) { } +for (var fn: (s: string) => number; ;) { } +for (var fn: { (s: string): number }; ;) { } +for (var fn = <(s: string) => number> null; ;) { } +for (var fn: typeof fn; ;) { } + +for (var a: string[]; ;) { } +for (var a = ['a', 'b']; ;) { } +for (var a = []; ;) { } +for (var a: string[] = []; ;) { } +for (var a = new Array(); ;) { } +for (var a: typeof a; ;) { } + +//// [forStatementsMultipleValidDecl.js] +for (var x;;) { +} +for (var x = 2;;) { +} +for (var x = undefined;;) { +} +function declSpace() { + for (var x = 'this is a string';;) { + } +} +for (var p;;) { +} +for (var p = { x: 1, y: 2 };;) { +} +for (var p = { x: 0, y: undefined };;) { +} +for (var p = { x: 1, y: undefined };;) { +} +for (var p = { x: 1, y: 2 };;) { +} +for (var p = { x: 0, y: undefined };;) { +} +for (var p;;) { +} +for (var fn = function (s) { + return 42; +};;) { +} +for (var fn = function (s) { return 3; };;) { +} +for (var fn;;) { +} +for (var fn;;) { +} +for (var fn = null;;) { +} +for (var fn;;) { +} +for (var a;;) { +} +for (var a = ['a', 'b'];;) { +} +for (var a = [];;) { +} +for (var a = [];;) { +} +for (var a = new Array();;) { +} +for (var a;;) { +} diff --git a/tests/baselines/reference/forgottenNew.errors.txt b/tests/baselines/reference/forgottenNew.errors.txt new file mode 100644 index 0000000000000..3a6d490a0e9cb --- /dev/null +++ b/tests/baselines/reference/forgottenNew.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/forgottenNew.ts (1 errors) ==== + module Tools { + export class NullLogger { } + } + + var logger = Tools.NullLogger(); + ~~~~~~~~~~~~~~~~~~ +!!! Value of type 'typeof NullLogger' is not callable. Did you mean to include 'new'? \ No newline at end of file diff --git a/tests/baselines/reference/forgottenNew.js b/tests/baselines/reference/forgottenNew.js new file mode 100644 index 0000000000000..72b0537882ea6 --- /dev/null +++ b/tests/baselines/reference/forgottenNew.js @@ -0,0 +1,18 @@ +//// [forgottenNew.ts] +module Tools { + export class NullLogger { } +} + +var logger = Tools.NullLogger(); + +//// [forgottenNew.js] +var Tools; +(function (Tools) { + var NullLogger = (function () { + function NullLogger() { + } + return NullLogger; + })(); + Tools.NullLogger = NullLogger; +})(Tools || (Tools = {})); +var logger = Tools.NullLogger(); diff --git a/tests/baselines/reference/funClodule.errors.txt b/tests/baselines/reference/funClodule.errors.txt new file mode 100644 index 0000000000000..e4d72d3fc0ddd --- /dev/null +++ b/tests/baselines/reference/funClodule.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/funClodule.ts (3 errors) ==== + declare function foo(); + declare module foo { + export function x(): any; + } + declare class foo { } // Should error + ~~~ +!!! Duplicate identifier 'foo'. + + + declare class foo2 { } + declare module foo2 { + export function x(): any; + } + declare function foo2(); // Should error + ~~~~ +!!! Duplicate identifier 'foo2'. + + + function foo3() { } + module foo3 { + export function x(): any { } + } + class foo3 { } // Should error + ~~~~ +!!! Duplicate identifier 'foo3'. \ No newline at end of file diff --git a/tests/baselines/reference/funClodule.js b/tests/baselines/reference/funClodule.js new file mode 100644 index 0000000000000..c4b7d6e7a26b6 --- /dev/null +++ b/tests/baselines/reference/funClodule.js @@ -0,0 +1,35 @@ +//// [funClodule.ts] +declare function foo(); +declare module foo { + export function x(): any; +} +declare class foo { } // Should error + + +declare class foo2 { } +declare module foo2 { + export function x(): any; +} +declare function foo2(); // Should error + + +function foo3() { } +module foo3 { + export function x(): any { } +} +class foo3 { } // Should error + +//// [funClodule.js] +function foo3() { +} +var foo3; +(function (foo3) { + function x() { + } + foo3.x = x; +})(foo3 || (foo3 = {})); +var foo3 = (function () { + function foo3() { + } + return foo3; +})(); diff --git a/tests/baselines/reference/funcdecl.js b/tests/baselines/reference/funcdecl.js new file mode 100644 index 0000000000000..2f38ce131730b --- /dev/null +++ b/tests/baselines/reference/funcdecl.js @@ -0,0 +1,135 @@ +//// [funcdecl.ts] +function simpleFunc() { + return "this is my simple func"; +} +var simpleFuncVar = simpleFunc; + +function anotherFuncNoReturn() { +} +var anotherFuncNoReturnVar = anotherFuncNoReturn; + +function withReturn() : string{ + return "Hello"; +} +var withReturnVar = withReturn; + +function withParams(a : string) : string{ + return a; +} +var withparamsVar = withParams; + +function withMultiParams(a : number, b, c: Object) { + return a; +} +var withMultiParamsVar = withMultiParams; + +function withOptionalParams(a?: string) { +} +var withOptionalParamsVar = withOptionalParams; + +function withInitializedParams(a: string, b0, b = 30, c = "string value") { +} +var withInitializedParamsVar = withInitializedParams; + +function withOptionalInitializedParams(a: string, c: string = "hello string") { +} +var withOptionalInitializedParamsVar = withOptionalInitializedParams; + +function withRestParams(a: string, ... myRestParameter : number[]) { + return myRestParameter; +} +var withRestParamsVar = withRestParams; + +function overload1(n: number) : string; +function overload1(s: string) : string; +function overload1(ns: any) { + return ns.toString(); +} +var withOverloadSignature = overload1; + +function f(n: () => void) { } + +module m2 { + export function foo(n: () => void ) { + } + +} + +m2.foo(() => { + + var b = 30; + return b; +}); + + +declare function fooAmbient(n: number): string; + +declare function overloadAmbient(n: number): string; +declare function overloadAmbient(s: string): string; + +var f2 = () => { + return "string"; +} + +//// [funcdecl.js] +function simpleFunc() { + return "this is my simple func"; +} +var simpleFuncVar = simpleFunc; +function anotherFuncNoReturn() { +} +var anotherFuncNoReturnVar = anotherFuncNoReturn; +function withReturn() { + return "Hello"; +} +var withReturnVar = withReturn; +function withParams(a) { + return a; +} +var withparamsVar = withParams; +function withMultiParams(a, b, c) { + return a; +} +var withMultiParamsVar = withMultiParams; +function withOptionalParams(a) { +} +var withOptionalParamsVar = withOptionalParams; +function withInitializedParams(a, b0, b, c) { + if (b === void 0) { b = 30; } + if (c === void 0) { c = "string value"; } +} +var withInitializedParamsVar = withInitializedParams; +function withOptionalInitializedParams(a, c) { + if (c === void 0) { c = "hello string"; } +} +var withOptionalInitializedParamsVar = withOptionalInitializedParams; +function withRestParams(a) { + var myRestParameter = []; + for (var _i = 1; _i < arguments.length; _i++) { + myRestParameter[_i - 1] = arguments[_i]; + } + return myRestParameter; +} +var withRestParamsVar = withRestParams; +function overload1(ns) { + return ns.toString(); +} +var withOverloadSignature = overload1; +function f(n) { +} +var m2; +(function (m2) { + function foo(n) { + } + m2.foo = foo; +})(m2 || (m2 = {})); +m2.foo(function () { + var b = 30; + return b; +}); +var f2 = function () { + return "string"; +}; + + +//// [funcdecl.d.ts] diff --git a/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt new file mode 100644 index 0000000000000..4eda4b8136c75 --- /dev/null +++ b/tests/baselines/reference/functionAndPropertyNameConflict.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/functionAndPropertyNameConflict.ts (2 errors) ==== + class C65 { + public aaaaa() { } + public get aaaaa() { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~ +!!! Duplicate identifier 'aaaaa'. + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/functionArgShadowing.errors.txt b/tests/baselines/reference/functionArgShadowing.errors.txt new file mode 100644 index 0000000000000..f1583f4185e0c --- /dev/null +++ b/tests/baselines/reference/functionArgShadowing.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/functionArgShadowing.ts (3 errors) ==== + class A { foo() { } } + class B { bar() { } } + function foo(x: A) { + var x: B = new B(); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'. + x.bar(); // the property bar does not exist on a value of type A + ~~~ +!!! Property 'bar' does not exist on type 'A'. + } + + class C { + constructor(public p: number) { + var p: string; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'. + + var n: number = p; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/functionArgShadowing.js b/tests/baselines/reference/functionArgShadowing.js new file mode 100644 index 0000000000000..8a49841de43ca --- /dev/null +++ b/tests/baselines/reference/functionArgShadowing.js @@ -0,0 +1,43 @@ +//// [functionArgShadowing.ts] +class A { foo() { } } +class B { bar() { } } +function foo(x: A) { + var x: B = new B(); + x.bar(); // the property bar does not exist on a value of type A +} + +class C { + constructor(public p: number) { + var p: string; + + var n: number = p; + } +} + +//// [functionArgShadowing.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +function foo(x) { + var x = new B(); + x.bar(); +} +var C = (function () { + function C(p) { + this.p = p; + var p; + var n = p; + } + return C; +})(); diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt new file mode 100644 index 0000000000000..76981e9888512 --- /dev/null +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -0,0 +1,42 @@ +==== tests/cases/compiler/functionAssignment.ts (2 errors) ==== + function f(n: Function) { } + f(function () { }); + + interface foo { + get(handler: (bar: number)=>void): void; + } + + interface baz { + get(callback: Function): number; + } + + var barbaz: baz; + var test: foo; + + test.get(function (param) { + var x = barbaz.get(function () { }); + }); + + function f2(n: () => void) { } + f2(() => { + var n = ''; + n = 4; + ~ +!!! Type 'number' is not assignable to type 'string'. + }); + + function f3(a: { a: number; b: number; }) { } + + f3({ a: 0, b: 0 }); + + + function callb(lam:(l: number) => void ); + function callb(lam:(n: string)=>void); + function callb(a) { } + + callb((a) =>{ a.length; }); + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/functionAssignment.js b/tests/baselines/reference/functionAssignment.js new file mode 100644 index 0000000000000..ce47f0a04b8b3 --- /dev/null +++ b/tests/baselines/reference/functionAssignment.js @@ -0,0 +1,64 @@ +//// [functionAssignment.ts] +function f(n: Function) { } +f(function () { }); + +interface foo { + get(handler: (bar: number)=>void): void; +} + +interface baz { + get(callback: Function): number; +} + +var barbaz: baz; +var test: foo; + +test.get(function (param) { + var x = barbaz.get(function () { }); +}); + +function f2(n: () => void) { } +f2(() => { + var n = ''; + n = 4; +}); + +function f3(a: { a: number; b: number; }) { } + +f3({ a: 0, b: 0 }); + + +function callb(lam:(l: number) => void ); +function callb(lam:(n: string)=>void); +function callb(a) { } + +callb((a) =>{ a.length; }); + + + + +//// [functionAssignment.js] +function f(n) { +} +f(function () { +}); +var barbaz; +var test; +test.get(function (param) { + var x = barbaz.get(function () { + }); +}); +function f2(n) { +} +f2(function () { + var n = ''; + n = 4; +}); +function f3(a) { +} +f3({ a: 0, b: 0 }); +function callb(a) { +} +callb(function (a) { + a.length; +}); diff --git a/tests/baselines/reference/functionAssignmentError.js b/tests/baselines/reference/functionAssignmentError.js new file mode 100644 index 0000000000000..e19547096b833 --- /dev/null +++ b/tests/baselines/reference/functionAssignmentError.js @@ -0,0 +1,11 @@ +//// [functionAssignmentError.ts] +var func = function (){return "ONE";}; +func = function (){return "ONE";}; + +//// [functionAssignmentError.js] +var func = function () { + return "ONE"; +}; +func = function () { + return "ONE"; +}; diff --git a/tests/baselines/reference/functionCall1.js b/tests/baselines/reference/functionCall1.js new file mode 100644 index 0000000000000..8025ad5a6f51f --- /dev/null +++ b/tests/baselines/reference/functionCall1.js @@ -0,0 +1,10 @@ +//// [functionCall1.ts] +function foo():any{return ""}; +var x = foo(); + +//// [functionCall1.js] +function foo() { + return ""; +} +; +var x = foo(); diff --git a/tests/baselines/reference/functionCall10.errors.txt b/tests/baselines/reference/functionCall10.errors.txt new file mode 100644 index 0000000000000..b2a1d2987c9a2 --- /dev/null +++ b/tests/baselines/reference/functionCall10.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/functionCall10.ts (2 errors) ==== + function foo(...a:number[]){}; + foo(0, 1); + foo('foo'); + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(); + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall10.js b/tests/baselines/reference/functionCall10.js new file mode 100644 index 0000000000000..9d5cb33a56a3b --- /dev/null +++ b/tests/baselines/reference/functionCall10.js @@ -0,0 +1,20 @@ +//// [functionCall10.ts] +function foo(...a:number[]){}; +foo(0, 1); +foo('foo'); +foo(); +foo(1, 'bar'); + + +//// [functionCall10.js] +function foo() { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i - 0] = arguments[_i]; + } +} +; +foo(0, 1); +foo('foo'); +foo(); +foo(1, 'bar'); diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt new file mode 100644 index 0000000000000..2d0d183a98e8d --- /dev/null +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/functionCall11.ts (3 errors) ==== + function foo(a:string, b?:number){} + foo('foo', 1); + foo('foo'); + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 'bar'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall11.js b/tests/baselines/reference/functionCall11.js new file mode 100644 index 0000000000000..9c36dedba360a --- /dev/null +++ b/tests/baselines/reference/functionCall11.js @@ -0,0 +1,17 @@ +//// [functionCall11.ts] +function foo(a:string, b?:number){} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 'bar'); + + +//// [functionCall11.js] +function foo(a, b) { +} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 'bar'); diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt new file mode 100644 index 0000000000000..d204fe0274a4e --- /dev/null +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/functionCall12.ts (3 errors) ==== + function foo(a:string, b?:number, c?:string){} + foo('foo', 1); + foo('foo'); + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 'bar'); + foo('foo', 1, 3); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall12.js b/tests/baselines/reference/functionCall12.js new file mode 100644 index 0000000000000..ca71c25a172e5 --- /dev/null +++ b/tests/baselines/reference/functionCall12.js @@ -0,0 +1,19 @@ +//// [functionCall12.ts] +function foo(a:string, b?:number, c?:string){} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 'bar'); +foo('foo', 1, 3); + + +//// [functionCall12.js] +function foo(a, b, c) { +} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 'bar'); +foo('foo', 1, 3); diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt new file mode 100644 index 0000000000000..16277b304fd75 --- /dev/null +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/functionCall13.ts (2 errors) ==== + function foo(a:string, ...b:number[]){} + foo('foo', 1); + foo('foo'); + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 3); + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall13.js b/tests/baselines/reference/functionCall13.js new file mode 100644 index 0000000000000..ce57f43215e4d --- /dev/null +++ b/tests/baselines/reference/functionCall13.js @@ -0,0 +1,21 @@ +//// [functionCall13.ts] +function foo(a:string, ...b:number[]){} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); + + +//// [functionCall13.js] +function foo(a) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } +} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); diff --git a/tests/baselines/reference/functionCall14.errors.txt b/tests/baselines/reference/functionCall14.errors.txt new file mode 100644 index 0000000000000..c68c5d582e4ba --- /dev/null +++ b/tests/baselines/reference/functionCall14.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/functionCall14.ts (1 errors) ==== + function foo(a?:string, ...b:number[]){} + foo('foo', 1); + foo('foo'); + foo(); + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 3); + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall14.js b/tests/baselines/reference/functionCall14.js new file mode 100644 index 0000000000000..47447f46db5ca --- /dev/null +++ b/tests/baselines/reference/functionCall14.js @@ -0,0 +1,21 @@ +//// [functionCall14.ts] +function foo(a?:string, ...b:number[]){} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); + + +//// [functionCall14.js] +function foo(a) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } +} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); diff --git a/tests/baselines/reference/functionCall15.errors.txt b/tests/baselines/reference/functionCall15.errors.txt new file mode 100644 index 0000000000000..cb009fc63ab5b --- /dev/null +++ b/tests/baselines/reference/functionCall15.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/functionCall15.ts (1 errors) ==== + function foo(a?:string, b?:number, ...b:number[]){} + ~ +!!! Duplicate identifier 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall15.js b/tests/baselines/reference/functionCall15.js new file mode 100644 index 0000000000000..28fa4c917c867 --- /dev/null +++ b/tests/baselines/reference/functionCall15.js @@ -0,0 +1,10 @@ +//// [functionCall15.ts] +function foo(a?:string, b?:number, ...b:number[]){} + +//// [functionCall15.js] +function foo(a, b) { + var b = []; + for (var _i = 2; _i < arguments.length; _i++) { + b[_i - 2] = arguments[_i]; + } +} diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt new file mode 100644 index 0000000000000..8649a4f6f2aac --- /dev/null +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/functionCall16.ts (3 errors) ==== + function foo(a:string, b?:string, ...c:number[]){} + foo('foo', 1); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo'); + foo('foo', 'bar'); + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 'bar', 3); + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall16.js b/tests/baselines/reference/functionCall16.js new file mode 100644 index 0000000000000..187572a9a7e84 --- /dev/null +++ b/tests/baselines/reference/functionCall16.js @@ -0,0 +1,23 @@ +//// [functionCall16.ts] +function foo(a:string, b?:string, ...c:number[]){} +foo('foo', 1); +foo('foo'); +foo('foo', 'bar'); +foo(); +foo(1, 'bar'); +foo('foo', 'bar', 3); + + +//// [functionCall16.js] +function foo(a, b) { + var c = []; + for (var _i = 2; _i < arguments.length; _i++) { + c[_i - 2] = arguments[_i]; + } +} +foo('foo', 1); +foo('foo'); +foo('foo', 'bar'); +foo(); +foo(1, 'bar'); +foo('foo', 'bar', 3); diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt new file mode 100644 index 0000000000000..a1b27913479b6 --- /dev/null +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/functionCall17.ts (4 errors) ==== + function foo(a:string, b?:string, c?:number, ...d:number[]){} + foo('foo', 1); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo'); + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, 'bar'); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 3); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 'bar', 3, 4); + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall17.js b/tests/baselines/reference/functionCall17.js new file mode 100644 index 0000000000000..73f7fd6070b22 --- /dev/null +++ b/tests/baselines/reference/functionCall17.js @@ -0,0 +1,23 @@ +//// [functionCall17.ts] +function foo(a:string, b?:string, c?:number, ...d:number[]){} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); +foo('foo', 'bar', 3, 4); + + +//// [functionCall17.js] +function foo(a, b, c) { + var d = []; + for (var _i = 3; _i < arguments.length; _i++) { + d[_i - 3] = arguments[_i]; + } +} +foo('foo', 1); +foo('foo'); +foo(); +foo(1, 'bar'); +foo('foo', 1, 3); +foo('foo', 'bar', 3, 4); diff --git a/tests/baselines/reference/functionCall2.js b/tests/baselines/reference/functionCall2.js new file mode 100644 index 0000000000000..5b6da378103b7 --- /dev/null +++ b/tests/baselines/reference/functionCall2.js @@ -0,0 +1,10 @@ +//// [functionCall2.ts] +function foo():number{return 1}; +var x = foo(); + +//// [functionCall2.js] +function foo() { + return 1; +} +; +var x = foo(); diff --git a/tests/baselines/reference/functionCall3.js b/tests/baselines/reference/functionCall3.js new file mode 100644 index 0000000000000..db29b44db7a3b --- /dev/null +++ b/tests/baselines/reference/functionCall3.js @@ -0,0 +1,9 @@ +//// [functionCall3.ts] +function foo():any[]{return [1];} +var x = foo(); + +//// [functionCall3.js] +function foo() { + return [1]; +} +var x = foo(); diff --git a/tests/baselines/reference/functionCall4.js b/tests/baselines/reference/functionCall4.js new file mode 100644 index 0000000000000..05021c33563ab --- /dev/null +++ b/tests/baselines/reference/functionCall4.js @@ -0,0 +1,15 @@ +//// [functionCall4.ts] +function foo():any{return ""}; +function bar():()=>any{return foo}; +var x = bar(); + +//// [functionCall4.js] +function foo() { + return ""; +} +; +function bar() { + return foo; +} +; +var x = bar(); diff --git a/tests/baselines/reference/functionCall5.js b/tests/baselines/reference/functionCall5.js new file mode 100644 index 0000000000000..e6b0e049ef688 --- /dev/null +++ b/tests/baselines/reference/functionCall5.js @@ -0,0 +1,20 @@ +//// [functionCall5.ts] +module m1 { export class c1 { public a; }} +function foo():m1.c1{return new m1.c1();}; +var x = foo(); + +//// [functionCall5.js] +var m1; +(function (m1) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m1.c1 = c1; +})(m1 || (m1 = {})); +function foo() { + return new m1.c1(); +} +; +var x = foo(); diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt new file mode 100644 index 0000000000000..b43134f65aacb --- /dev/null +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/functionCall6.ts (3 errors) ==== + function foo(a:string){}; + foo('bar'); + foo(2); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 'bar'); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall6.js b/tests/baselines/reference/functionCall6.js new file mode 100644 index 0000000000000..21582666b945e --- /dev/null +++ b/tests/baselines/reference/functionCall6.js @@ -0,0 +1,16 @@ +//// [functionCall6.ts] +function foo(a:string){}; +foo('bar'); +foo(2); +foo('foo', 'bar'); +foo(); + + +//// [functionCall6.js] +function foo(a) { +} +; +foo('bar'); +foo(2); +foo('foo', 'bar'); +foo(); diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt new file mode 100644 index 0000000000000..6c70d7b6a43ff --- /dev/null +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/functionCall7.ts (3 errors) ==== + module m1 { export class c1 { public a; }} + function foo(a:m1.c1){ a.a = 1; }; + var myC = new m1.c1(); + foo(myC); + foo(myC, myC); + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(4); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall7.js b/tests/baselines/reference/functionCall7.js new file mode 100644 index 0000000000000..b32c21b5892dd --- /dev/null +++ b/tests/baselines/reference/functionCall7.js @@ -0,0 +1,29 @@ +//// [functionCall7.ts] +module m1 { export class c1 { public a; }} +function foo(a:m1.c1){ a.a = 1; }; +var myC = new m1.c1(); +foo(myC); +foo(myC, myC); +foo(4); +foo(); + + +//// [functionCall7.js] +var m1; +(function (m1) { + var c1 = (function () { + function c1() { + } + return c1; + })(); + m1.c1 = c1; +})(m1 || (m1 = {})); +function foo(a) { + a.a = 1; +} +; +var myC = new m1.c1(); +foo(myC); +foo(myC, myC); +foo(4); +foo(); diff --git a/tests/baselines/reference/functionCall8.errors.txt b/tests/baselines/reference/functionCall8.errors.txt new file mode 100644 index 0000000000000..08ed51c11536d --- /dev/null +++ b/tests/baselines/reference/functionCall8.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/functionCall8.ts (2 errors) ==== + function foo(a?:string){} + foo('foo'); + foo('foo', 'bar'); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(4); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(); + \ No newline at end of file diff --git a/tests/baselines/reference/functionCall8.js b/tests/baselines/reference/functionCall8.js new file mode 100644 index 0000000000000..7eb5a9f60d91e --- /dev/null +++ b/tests/baselines/reference/functionCall8.js @@ -0,0 +1,15 @@ +//// [functionCall8.ts] +function foo(a?:string){} +foo('foo'); +foo('foo', 'bar'); +foo(4); +foo(); + + +//// [functionCall8.js] +function foo(a) { +} +foo('foo'); +foo('foo', 'bar'); +foo(4); +foo(); diff --git a/tests/baselines/reference/functionCall9.errors.txt b/tests/baselines/reference/functionCall9.errors.txt new file mode 100644 index 0000000000000..94745d8bb37cd --- /dev/null +++ b/tests/baselines/reference/functionCall9.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/functionCall9.ts (2 errors) ==== + function foo(a?:string, b?:number){}; + foo('foo', 1); + foo('foo'); + foo('foo','bar'); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo('foo', 1, 'bar'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall9.js b/tests/baselines/reference/functionCall9.js new file mode 100644 index 0000000000000..d2d81a3ca04f2 --- /dev/null +++ b/tests/baselines/reference/functionCall9.js @@ -0,0 +1,17 @@ +//// [functionCall9.ts] +function foo(a?:string, b?:number){}; +foo('foo', 1); +foo('foo'); +foo('foo','bar'); +foo('foo', 1, 'bar'); +foo(); + +//// [functionCall9.js] +function foo(a, b) { +} +; +foo('foo', 1); +foo('foo'); +foo('foo', 'bar'); +foo('foo', 1, 'bar'); +foo(); diff --git a/tests/baselines/reference/functionCalls.errors.txt b/tests/baselines/reference/functionCalls.errors.txt new file mode 100644 index 0000000000000..3aa587c70a37e --- /dev/null +++ b/tests/baselines/reference/functionCalls.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/expressions/functionCalls/functionCalls.ts (9 errors) ==== + + // Invoke function call on value of type 'any' with no type arguments + var anyVar: any; + anyVar(0); + anyVar(''); + + // Invoke function call on value of type 'any' with type arguments + // These should be errors + anyVar('hello'); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + anyVar(); + ~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + anyVar(undefined); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + + + // Invoke function call on value of a subtype of Function with no call signatures with no type arguments + interface SubFunc extends Function { + prop: number; + } + var subFunc: SubFunc; + subFunc(0); + subFunc(''); + subFunc(); + + + // Invoke function call on value of a subtype of Function with no call signatures with type arguments + // These should be errors + subFunc(0); + ~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + subFunc(''); + ~~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + subFunc(); + ~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + + // Invoke function call on value of type Function with no call signatures with type arguments + // These should be errors + var func: Function; + func(0); + ~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + func(''); + ~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + func(); + ~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + \ No newline at end of file diff --git a/tests/baselines/reference/functionCalls.js b/tests/baselines/reference/functionCalls.js new file mode 100644 index 0000000000000..66ec8938c811c --- /dev/null +++ b/tests/baselines/reference/functionCalls.js @@ -0,0 +1,56 @@ +//// [functionCalls.ts] + +// Invoke function call on value of type 'any' with no type arguments +var anyVar: any; +anyVar(0); +anyVar(''); + +// Invoke function call on value of type 'any' with type arguments +// These should be errors +anyVar('hello'); +anyVar(); +anyVar(undefined); + + +// Invoke function call on value of a subtype of Function with no call signatures with no type arguments +interface SubFunc extends Function { + prop: number; +} +var subFunc: SubFunc; +subFunc(0); +subFunc(''); +subFunc(); + + +// Invoke function call on value of a subtype of Function with no call signatures with type arguments +// These should be errors +subFunc(0); +subFunc(''); +subFunc(); + +// Invoke function call on value of type Function with no call signatures with type arguments +// These should be errors +var func: Function; +func(0); +func(''); +func(); + + +//// [functionCalls.js] +var anyVar; +anyVar(0); +anyVar(''); +anyVar('hello'); +anyVar(); +anyVar(undefined); +var subFunc; +subFunc(0); +subFunc(''); +subFunc(); +subFunc(0); +subFunc(''); +subFunc(); +var func; +func(0); +func(''); +func(); diff --git a/tests/baselines/reference/functionConstraintSatisfaction.js b/tests/baselines/reference/functionConstraintSatisfaction.js new file mode 100644 index 0000000000000..3665c81f7c29e --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction.js @@ -0,0 +1,114 @@ +//// [functionConstraintSatisfaction.ts] +// satisfaction of a constraint to Function, no errors expected + +function foo(x: T): T { return x; } + +interface I { + (): string; +} +var i: I; + +class C { + foo: string; +} + +var a: { (): string }; +var b: { new (): string }; +var c: { (): string; (x): string }; + +var r = foo(new Function()); +var r1 = foo((x) => x); +var r2 = foo((x: string[]) => x); +var r3 = foo(function (x) { return x }); +var r4 = foo(function (x: string[]) { return x }); +var r5 = foo(i); +var r6 = foo(C); +var r7 = foo(b); +var r8 = foo(c); + +interface I2 { + (x: T): T; +} +var i2: I2; + +class C2 { + foo: T; +} + +var a2: { (x: T): T }; +var b2: { new (x: T): T }; +var c2: { (x: T): T; (x: T, y: T): T }; + +var r9 = foo((x: U) => x); +var r10 = foo(function (x: U) { return x; }); +var r11 = foo((x: U) => x); +var r12 = foo((x: U, y: V) => x); +var r13 = foo(i2); +var r14 = foo(C2); +var r15 = foo(b2); +var r16 = foo(c2); + +interface F2 extends Function { foo: string; } +var f2: F2; +var r17 = foo(f2); + +function foo2(x: T, y: U) { + foo(x); + foo(y); +} +//function foo2(x: T, y: U) { +// foo(x); +// foo(y); +//} + +//// [functionConstraintSatisfaction.js] +function foo(x) { + return x; +} +var i; +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b; +var c; +var r = foo(new Function()); +var r1 = foo(function (x) { return x; }); +var r2 = foo(function (x) { return x; }); +var r3 = foo(function (x) { + return x; +}); +var r4 = foo(function (x) { + return x; +}); +var r5 = foo(i); +var r6 = foo(C); +var r7 = foo(b); +var r8 = foo(c); +var i2; +var C2 = (function () { + function C2() { + } + return C2; +})(); +var a2; +var b2; +var c2; +var r9 = foo(function (x) { return x; }); +var r10 = foo(function (x) { + return x; +}); +var r11 = foo(function (x) { return x; }); +var r12 = foo(function (x, y) { return x; }); +var r13 = foo(i2); +var r14 = foo(C2); +var r15 = foo(b2); +var r16 = foo(c2); +var f2; +var r17 = foo(f2); +function foo2(x, y) { + foo(x); + foo(y); +} diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt new file mode 100644 index 0000000000000..14e4593997b8e --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -0,0 +1,69 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (14 errors) ==== + // satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted + + function foo(x: T): T { return x; } + + foo(1); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(() => { }, 1); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo(1, () => { }); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo2 string>(x: T): T { return x; } + + class C { + foo: string; + } + + var b: { new (x: string): string }; + + class C2 { + foo: T; + } + + var b2: { new (x: T): T }; + + var r = foo2(new Function()); + ~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2 = foo2((x: string[]) => x); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6 = foo2(C); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7 = foo2(b); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r8 = foo2((x: U) => x); // no error expected + var r11 = foo2((x: U, y: V) => x); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r13 = foo2(C2); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r14 = foo2(b2); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface F2 extends Function { foo: string; } + var f2: F2; + var r16 = foo2(f2); + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function fff(x: T, y: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo2(x); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + foo2(y); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.js b/tests/baselines/reference/functionConstraintSatisfaction2.js new file mode 100644 index 0000000000000..5def623bcb8b3 --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction2.js @@ -0,0 +1,80 @@ +//// [functionConstraintSatisfaction2.ts] +// satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted + +function foo(x: T): T { return x; } + +foo(1); +foo(() => { }, 1); +foo(1, () => { }); + +function foo2 string>(x: T): T { return x; } + +class C { + foo: string; +} + +var b: { new (x: string): string }; + +class C2 { + foo: T; +} + +var b2: { new (x: T): T }; + +var r = foo2(new Function()); +var r2 = foo2((x: string[]) => x); +var r6 = foo2(C); +var r7 = foo2(b); +var r8 = foo2((x: U) => x); // no error expected +var r11 = foo2((x: U, y: V) => x); +var r13 = foo2(C2); +var r14 = foo2(b2); + +interface F2 extends Function { foo: string; } +var f2: F2; +var r16 = foo2(f2); + +function fff(x: T, y: U) { + foo2(x); + foo2(y); +} + + +//// [functionConstraintSatisfaction2.js] +function foo(x) { + return x; +} +foo(1); +foo(function () { +}, 1); +foo(1, function () { +}); +function foo2(x) { + return x; +} +var C = (function () { + function C() { + } + return C; +})(); +var b; +var C2 = (function () { + function C2() { + } + return C2; +})(); +var b2; +var r = foo2(new Function()); +var r2 = foo2(function (x) { return x; }); +var r6 = foo2(C); +var r7 = foo2(b); +var r8 = foo2(function (x) { return x; }); +var r11 = foo2(function (x, y) { return x; }); +var r13 = foo2(C2); +var r14 = foo2(b2); +var f2; +var r16 = foo2(f2); +function fff(x, y) { + foo2(x); + foo2(y); +} diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.js b/tests/baselines/reference/functionConstraintSatisfaction3.js new file mode 100644 index 0000000000000..d1d764f28fef6 --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction3.js @@ -0,0 +1,81 @@ +//// [functionConstraintSatisfaction3.ts] +// satisfaction of a constraint to Function, no errors expected + +function foo string>(x: T): T { return x; } + +interface I { + (): string; +} +var i: I; + +class C { + foo: string; +} + +var a: { (): string }; +var b: { new (): string }; +var c: { (): string; (x): string }; + +var r1 = foo((x) => x); +var r2 = foo((x: string) => x); +var r3 = foo(function (x) { return x }); +var r4 = foo(function (x: string) { return x }); +var r5 = foo(i); +var r8 = foo(c); + +interface I2 { + (x: T): T; +} +var i2: I2; + +class C2 { + foo: T; +} + +var a2: { (x: T): T }; +var b2: { new (x: T): T }; +var c2: { (x: T): T; (x: T, y: T): T }; + +var r9 = foo(function (x: U) { return x; }); +var r10 = foo((x: U) => x); +var r12 = foo(i2); +var r15 = foo(c2); + +//// [functionConstraintSatisfaction3.js] +function foo(x) { + return x; +} +var i; +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b; +var c; +var r1 = foo(function (x) { return x; }); +var r2 = foo(function (x) { return x; }); +var r3 = foo(function (x) { + return x; +}); +var r4 = foo(function (x) { + return x; +}); +var r5 = foo(i); +var r8 = foo(c); +var i2; +var C2 = (function () { + function C2() { + } + return C2; +})(); +var a2; +var b2; +var c2; +var r9 = foo(function (x) { + return x; +}); +var r10 = foo(function (x) { return x; }); +var r12 = foo(i2); +var r15 = foo(c2); diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js new file mode 100644 index 0000000000000..9a377177bc4b5 --- /dev/null +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js @@ -0,0 +1,13 @@ +//// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts] +function foo(args: { (x): number }[]) { + return args.length; +} + + +//// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.js] +function foo(args) { + return args.length; +} + + +//// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.d.ts] diff --git a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js new file mode 100644 index 0000000000000..358b8509cebb8 --- /dev/null +++ b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.js @@ -0,0 +1,22 @@ +//// [functionExpressionAndLambdaMatchesFunction.ts] +class CDoc { + constructor() { + function doSomething(a: Function) { + } + doSomething(() => undefined); + doSomething(function () { }); + } +} + + +//// [functionExpressionAndLambdaMatchesFunction.js] +var CDoc = (function () { + function CDoc() { + function doSomething(a) { + } + doSomething(function () { return undefined; }); + doSomething(function () { + }); + } + return CDoc; +})(); diff --git a/tests/baselines/reference/functionExpressionInWithBlock.js b/tests/baselines/reference/functionExpressionInWithBlock.js new file mode 100644 index 0000000000000..2fae2384313e6 --- /dev/null +++ b/tests/baselines/reference/functionExpressionInWithBlock.js @@ -0,0 +1,18 @@ +//// [functionExpressionInWithBlock.ts] +function x() { + with({}) { + function f() { + () => this; + } + } +} + +//// [functionExpressionInWithBlock.js] +function x() { + with ({}) { + function f() { + var _this = this; + (function () { return _this; }); + } + } +} diff --git a/tests/baselines/reference/functionExpressionReturningItself.js b/tests/baselines/reference/functionExpressionReturningItself.js new file mode 100644 index 0000000000000..a7a0fb0832bf4 --- /dev/null +++ b/tests/baselines/reference/functionExpressionReturningItself.js @@ -0,0 +1,10 @@ +//// [functionExpressionReturningItself.ts] +var x = function somefn() { return somefn; }; + +//// [functionExpressionReturningItself.js] +var x = function somefn() { + return somefn; +}; + + +//// [functionExpressionReturningItself.d.ts] diff --git a/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt new file mode 100644 index 0000000000000..e8f34d5d556e4 --- /dev/null +++ b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/functionExpressionShadowedByParams.ts (2 errors) ==== + function b1(b1: number) { + b1.toPrecision(2); // should not error + b1(12); // should error + ~~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + } + + + var x = { + b: function b(b: number) { + b.toPrecision(2); // should not error + b.apply(null, null); // should error + ~~~~~ +!!! Property 'apply' does not exist on type 'number'. + } + }; + \ No newline at end of file diff --git a/tests/baselines/reference/functionExpressionShadowedByParams.js b/tests/baselines/reference/functionExpressionShadowedByParams.js new file mode 100644 index 0000000000000..be3f6aef6ca74 --- /dev/null +++ b/tests/baselines/reference/functionExpressionShadowedByParams.js @@ -0,0 +1,26 @@ +//// [functionExpressionShadowedByParams.ts] +function b1(b1: number) { + b1.toPrecision(2); // should not error + b1(12); // should error +} + + +var x = { + b: function b(b: number) { + b.toPrecision(2); // should not error + b.apply(null, null); // should error + } +}; + + +//// [functionExpressionShadowedByParams.js] +function b1(b1) { + b1.toPrecision(2); + b1(12); +} +var x = { + b: function b(b) { + b.toPrecision(2); + b.apply(null, null); + } +}; diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt new file mode 100644 index 0000000000000..d9d35c555ad9b --- /dev/null +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -0,0 +1,72 @@ +==== tests/cases/conformance/functions/functionImplementationErrors.ts (6 errors) ==== + // FunctionExpression with no return type annotation with multiple return statements with unrelated types + var f1 = function () { + ~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~ + return 3; + ~~~~~~~~~~~~~ + }; + ~ +!!! No best common type exists among return expressions. + var f2 = function x() { + ~~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~ + return 3; + ~~~~~~~~~~~~~ + }; + ~ +!!! No best common type exists among return expressions. + var f3 = () => { + ~~~~~~~ + return ''; + ~~~~~~~~~~~~~~ + return 3; + ~~~~~~~~~~~~~ + }; + ~ +!!! No best common type exists among return expressions. + + // FunctionExpression with no return type annotation with return branch of number[] and other of string[] + var f4 = function () { + ~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return ['']; + ~~~~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return [1]; + ~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + // Function implemetnation with non -void return type annotation with no return + function f5(): number { + } + + var m; + // Function signature with parameter initializer referencing in scope local variable + function f6(n = m) { + ~ +!!! Initializer of parameter 'n' cannot reference identifier 'm' declared after it. + var m = 4; + } + + // Function signature with initializer referencing other parameter to the right + function f7(n = m, m?) { + ~ +!!! Initializer of parameter 'n' cannot reference identifier 'm' declared after it. + } + + // FunctionExpression with non -void return type annotation with a throw, no return, and other code + // Should be error but isn't + undefined === function (): number { + throw undefined; + var x = 4; + }; + \ No newline at end of file diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js new file mode 100644 index 0000000000000..3d1f750bb4c90 --- /dev/null +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -0,0 +1,81 @@ +//// [functionImplementationErrors.ts] +// FunctionExpression with no return type annotation with multiple return statements with unrelated types +var f1 = function () { + return ''; + return 3; +}; +var f2 = function x() { + return ''; + return 3; +}; +var f3 = () => { + return ''; + return 3; +}; + +// FunctionExpression with no return type annotation with return branch of number[] and other of string[] +var f4 = function () { + if (true) { + return ['']; + } else { + return [1]; + } +} + +// Function implemetnation with non -void return type annotation with no return +function f5(): number { +} + +var m; +// Function signature with parameter initializer referencing in scope local variable +function f6(n = m) { + var m = 4; +} + +// Function signature with initializer referencing other parameter to the right +function f7(n = m, m?) { +} + +// FunctionExpression with non -void return type annotation with a throw, no return, and other code +// Should be error but isn't +undefined === function (): number { + throw undefined; + var x = 4; +}; + + +//// [functionImplementationErrors.js] +var f1 = function () { + return ''; + return 3; +}; +var f2 = function x() { + return ''; + return 3; +}; +var f3 = function () { + return ''; + return 3; +}; +var f4 = function () { + if (true) { + return ['']; + } + else { + return [1]; + } +}; +function f5() { +} +var m; +function f6(n) { + if (n === void 0) { n = m; } + var m = 4; +} +function f7(n, m) { + if (n === void 0) { n = m; } +} +undefined === function () { + throw undefined; + var x = 4; +}; diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js new file mode 100644 index 0000000000000..9693def8c54a9 --- /dev/null +++ b/tests/baselines/reference/functionImplementations.js @@ -0,0 +1,230 @@ +//// [functionImplementations.ts] +// FunctionExpression with no return type annotation and no return statement returns void +var v: void = function () { } (); + +// FunctionExpression f with no return type annotation and directly references f in its body returns any +var a: any = function f() { + return f; +}; +var a: any = function f() { + return f(); +}; + +// FunctionExpression f with no return type annotation and indirectly references f in its body returns any +var a: any = function f() { + var x = f; + return x; +}; + +// Two mutually recursive function implementations with no return type annotations +function rec1() { + return rec2(); +} +function rec2() { + return rec1(); +} +var a = rec1(); +var a = rec2(); + +// Two mutually recursive function implementations with return type annotation in one +function rec3(): number { + return rec4(); +} +function rec4() { + return rec3(); +} +var n: number; +var n = rec3(); +var n = rec4(); + +// FunctionExpression with no return type annotation and returns a number +var n = function () { + return 3; +} (); + +// FunctionExpression with no return type annotation and returns null +var nu = null; +var nu = function () { + return null; +} (); + +// FunctionExpression with no return type annotation and returns undefined +var un = undefined; +var un = function () { + return undefined; +} (); + +// FunctionExpression with no return type annotation and returns a type parameter type +var n = function (x: T) { + return x; +} (4); + +// FunctionExpression with no return type annotation and returns a constrained type parameter type +var n = function (x: T) { + return x; +} (4); + +// FunctionExpression with no return type annotation with multiple return statements with identical types +var n = function () { + return 3; + return 5; +}(); + +// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns +class Base { private m; } +class Derived extends Base { private q; } +var b: Base; +var b = function () { + return new Base(); return new Derived(); +} (); + +// FunctionExpression with no return type annotation with multiple return statements with one a recursive call +var a = function f() { + return new Base(); return new Derived(); return f(); // ? +} (); + +// FunctionExpression with non -void return type annotation with a single throw statement +undefined === function (): number { + throw undefined; +}; + +// Type of 'this' in function implementation is 'any' +function thisFunc() { + var x = this; + var x: any; +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's type +function opt1(n = 4) { + var m = n; + var m: number; +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's widened type +function opt2(n = { x: null, y: undefined }) { + var m = n; + var m: { x: any; y: any }; +} + +// Function signature with initializer referencing other parameter to the left +function opt3(n: number, m = n) { + var y = m; + var y: number; +} + +// Function signature with optional parameter has correct codegen +// (tested above) + +// FunctionExpression with non -void return type annotation return with no expression +function f6(): number { + return; +} + + + + + +//// [functionImplementations.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var v = function () { +}(); +var a = function f() { + return f; +}; +var a = function f() { + return f(); +}; +var a = function f() { + var x = f; + return x; +}; +function rec1() { + return rec2(); +} +function rec2() { + return rec1(); +} +var a = rec1(); +var a = rec2(); +function rec3() { + return rec4(); +} +function rec4() { + return rec3(); +} +var n; +var n = rec3(); +var n = rec4(); +var n = function () { + return 3; +}(); +var nu = null; +var nu = function () { + return null; +}(); +var un = undefined; +var un = function () { + return undefined; +}(); +var n = function (x) { + return x; +}(4); +var n = function (x) { + return x; +}(4); +var n = function () { + return 3; + return 5; +}(); +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var b; +var b = function () { + return new Base(); + return new Derived(); +}(); +var a = function f() { + return new Base(); + return new Derived(); + return f(); +}(); +undefined === function () { + throw undefined; +}; +function thisFunc() { + var x = this; + var x; +} +function opt1(n) { + if (n === void 0) { n = 4; } + var m = n; + var m; +} +function opt2(n) { + if (n === void 0) { n = { x: null, y: undefined }; } + var m = n; + var m; +} +function opt3(n, m) { + if (m === void 0) { m = n; } + var y = m; + var y; +} +function f6() { + return; +} diff --git a/tests/baselines/reference/functionInIfStatementInModule.js b/tests/baselines/reference/functionInIfStatementInModule.js new file mode 100644 index 0000000000000..13cbc6532ef17 --- /dev/null +++ b/tests/baselines/reference/functionInIfStatementInModule.js @@ -0,0 +1,20 @@ +//// [functionInIfStatementInModule.ts] + +module Midori +{ + if (false) { + function Foo(src) + { + } + } +} + + +//// [functionInIfStatementInModule.js] +var Midori; +(function (Midori) { + if (false) { + function Foo(src) { + } + } +})(Midori || (Midori = {})); diff --git a/tests/baselines/reference/functionLiteral.js b/tests/baselines/reference/functionLiteral.js new file mode 100644 index 0000000000000..8e5e382b4a6f9 --- /dev/null +++ b/tests/baselines/reference/functionLiteral.js @@ -0,0 +1,23 @@ +//// [functionLiteral.ts] +// basic valid forms of function literals + +var x = () => 1; +var x: { + (): number; +} + +var y: { (x: string): string; }; +var y: (x: string) => string; +var y2: { (x: T): T; } = (x: T) => x + +var z: { new (x: number): number; }; +var z: new (x: number) => number; + +//// [functionLiteral.js] +var x = function () { return 1; }; +var x; +var y; +var y; +var y2 = function (x) { return x; }; +var z; +var z; diff --git a/tests/baselines/reference/functionLiteralForOverloads.js b/tests/baselines/reference/functionLiteralForOverloads.js new file mode 100644 index 0000000000000..2db12d4fb978a --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads.js @@ -0,0 +1,28 @@ +//// [functionLiteralForOverloads.ts] +// basic uses of function literals with overloads + +var f: { + (x: string): string; + (x: number): number; +} = (x) => x; + +var f2: { + (x: string): string; + (x: number): number; +} = (x) => x; + +var f3: { + (x: T): string; + (x: T): number; +} = (x) => x; + +var f4: { + (x: string): T; + (x: number): T; +} = (x) => x; + +//// [functionLiteralForOverloads.js] +var f = function (x) { return x; }; +var f2 = function (x) { return x; }; +var f3 = function (x) { return x; }; +var f4 = function (x) { return x; }; diff --git a/tests/baselines/reference/functionLiteralForOverloads2.js b/tests/baselines/reference/functionLiteralForOverloads2.js new file mode 100644 index 0000000000000..93e14e8c006f0 --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads2.js @@ -0,0 +1,44 @@ +//// [functionLiteralForOverloads2.ts] +// basic uses of function literals with constructor overloads + +class C { + constructor(x: string); + constructor(x: number); + constructor(x) { } +} + +class D { + constructor(x: string); + constructor(x: number); + constructor(x) { } +} + +var f: { + new(x: string): C; + new(x: number): C; +} = C; + +var f2: { + new(x: string): C; + new(x: number): C; +} = C; + +var f3: { + new(x: string): D; + new(x: number): D; +} = D; + +//// [functionLiteralForOverloads2.js] +var C = (function () { + function C(x) { + } + return C; +})(); +var D = (function () { + function D(x) { + } + return D; +})(); +var f = C; +var f2 = C; +var f3 = D; diff --git a/tests/baselines/reference/functionLiterals.js b/tests/baselines/reference/functionLiterals.js new file mode 100644 index 0000000000000..75b210613ee4f --- /dev/null +++ b/tests/baselines/reference/functionLiterals.js @@ -0,0 +1,80 @@ +//// [functionLiterals.ts] +// PropName(ParamList):ReturnType is equivalent to PropName: { (ParamList): ReturnType } + +var b: { + func1(x: number): number; // Method signature + func2: (x: number) => number; // Function type literal + func3: { (x: number): number }; // Object type literal +} + +// no errors +b.func1 = b.func2; +b.func1 = b.func3; +b.func2 = b.func1; +b.func2 = b.func3; +b.func3 = b.func1; +b.func3 = b.func2; + +var c: { + func4(x: number): number; + func4(s: string): string; + func5: { + (x: number): number; + (s: string): string; + }; +}; + +// no errors +c.func4 = c.func5; +c.func5 = c.func4; + +// generic versions +var b2: { + func1(x: T): number; // Method signature + func2: (x: T) => number; // Function type literal + func3: { (x: T): number }; // Object type literal +} + +// no errors +b2.func1 = b2.func2; +b2.func1 = b2.func3; +b2.func2 = b2.func1; +b2.func2 = b2.func3; +b2.func3 = b2.func1; +b2.func3 = b2.func2; + +var c2: { + func4(x: T): number; + func4(s: T): string; + func5: { + (x: T): number; + (s: T): string; + }; +}; + +// no errors +c2.func4 = c2.func5; +c2.func5 = c2.func4; + + +//// [functionLiterals.js] +var b; +b.func1 = b.func2; +b.func1 = b.func3; +b.func2 = b.func1; +b.func2 = b.func3; +b.func3 = b.func1; +b.func3 = b.func2; +var c; +c.func4 = c.func5; +c.func5 = c.func4; +var b2; +b2.func1 = b2.func2; +b2.func1 = b2.func3; +b2.func2 = b2.func1; +b2.func2 = b2.func3; +b2.func3 = b2.func1; +b2.func3 = b2.func2; +var c2; +c2.func4 = c2.func5; +c2.func5 = c2.func4; diff --git a/tests/baselines/reference/functionMergedWithModule.js b/tests/baselines/reference/functionMergedWithModule.js new file mode 100644 index 0000000000000..21a1e5af5c7c0 --- /dev/null +++ b/tests/baselines/reference/functionMergedWithModule.js @@ -0,0 +1,39 @@ +//// [functionMergedWithModule.ts] +function foo(title: string) { + var x = 10; +} + +module foo.Bar { + export function f() { + } +} + +module foo.Baz { + export function g() { + Bar.f(); + } +} + +//// [functionMergedWithModule.js] +function foo(title) { + var x = 10; +} +var foo; +(function (foo) { + (function (Bar) { + function f() { + } + Bar.f = f; + })(foo.Bar || (foo.Bar = {})); + var Bar = foo.Bar; +})(foo || (foo = {})); +var foo; +(function (foo) { + (function (Baz) { + function g() { + foo.Bar.f(); + } + Baz.g = g; + })(foo.Baz || (foo.Baz = {})); + var Baz = foo.Baz; +})(foo || (foo = {})); diff --git a/tests/baselines/reference/functionNameConflicts.errors.txt b/tests/baselines/reference/functionNameConflicts.errors.txt new file mode 100644 index 0000000000000..d71b6dc2e6921 --- /dev/null +++ b/tests/baselines/reference/functionNameConflicts.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/functions/functionNameConflicts.ts (6 errors) ==== + //Function and variable of the same name in same declaration space + //Function overload with different name from implementation signature + + module M { + function fn1() { } + var fn1; + ~~~ +!!! Duplicate identifier 'fn1'. + + var fn2; + function fn2() { } + ~~~ +!!! Duplicate identifier 'fn2'. + } + + function fn3() { } + var fn3; + ~~~ +!!! Duplicate identifier 'fn3'. + + function func() { + var fn4; + function fn4() { } + ~~~ +!!! Duplicate identifier 'fn4'. + + function fn5() { } + var fn5; + ~~~ +!!! Duplicate identifier 'fn5'. + } + + function over(); + ~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + function overrr() { + + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionNameConflicts.js b/tests/baselines/reference/functionNameConflicts.js new file mode 100644 index 0000000000000..aadd4c017e4e3 --- /dev/null +++ b/tests/baselines/reference/functionNameConflicts.js @@ -0,0 +1,52 @@ +//// [functionNameConflicts.ts] +//Function and variable of the same name in same declaration space +//Function overload with different name from implementation signature + +module M { + function fn1() { } + var fn1; + + var fn2; + function fn2() { } +} + +function fn3() { } +var fn3; + +function func() { + var fn4; + function fn4() { } + + function fn5() { } + var fn5; +} + +function over(); +function overrr() { + +} + + +//// [functionNameConflicts.js] +var M; +(function (M) { + function fn1() { + } + var fn1; + var fn2; + function fn2() { + } +})(M || (M = {})); +function fn3() { +} +var fn3; +function func() { + var fn4; + function fn4() { + } + function fn5() { + } + var fn5; +} +function overrr() { +} diff --git a/tests/baselines/reference/functionOnlyHasThrow.js b/tests/baselines/reference/functionOnlyHasThrow.js new file mode 100644 index 0000000000000..4719744526856 --- /dev/null +++ b/tests/baselines/reference/functionOnlyHasThrow.js @@ -0,0 +1,9 @@ +//// [functionOnlyHasThrow.ts] +function clone():number { + throw new Error("To be implemented"); +} + +//// [functionOnlyHasThrow.js] +function clone() { + throw new Error("To be implemented"); +} diff --git a/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt b/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt new file mode 100644 index 0000000000000..7c9eb9482df99 --- /dev/null +++ b/tests/baselines/reference/functionOverloadAmbiguity1.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/functionOverloadAmbiguity1.ts (1 errors) ==== + function callb(lam: (l: number) => void ); + function callb(lam: (n: string) => void ); + function callb(a) { } + callb((a) => { a.length; } ); // error, chose first overload + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. + + function callb2(lam: (n: string) => void ); + function callb2(lam: (l: number) => void ); + function callb2(a) { } + callb2((a) => { a.length; } ); // ok, chose first overload + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadAmbiguity1.js b/tests/baselines/reference/functionOverloadAmbiguity1.js new file mode 100644 index 0000000000000..23f81f4ecddf6 --- /dev/null +++ b/tests/baselines/reference/functionOverloadAmbiguity1.js @@ -0,0 +1,23 @@ +//// [functionOverloadAmbiguity1.ts] +function callb(lam: (l: number) => void ); +function callb(lam: (n: string) => void ); +function callb(a) { } +callb((a) => { a.length; } ); // error, chose first overload + +function callb2(lam: (n: string) => void ); +function callb2(lam: (l: number) => void ); +function callb2(a) { } +callb2((a) => { a.length; } ); // ok, chose first overload + + +//// [functionOverloadAmbiguity1.js] +function callb(a) { +} +callb(function (a) { + a.length; +}); +function callb2(a) { +} +callb2(function (a) { + a.length; +}); diff --git a/tests/baselines/reference/functionOverloadErrors.errors.txt b/tests/baselines/reference/functionOverloadErrors.errors.txt new file mode 100644 index 0000000000000..a839c286f811a --- /dev/null +++ b/tests/baselines/reference/functionOverloadErrors.errors.txt @@ -0,0 +1,157 @@ +==== tests/cases/conformance/functions/functionOverloadErrors.ts (19 errors) ==== + //Function overload signature with initializer + function fn1(x = 3); + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + function fn1() { } + + //Multiple function overload signatures that are identical + function fn2a(); + function fn2a(); + function fn2a() { + + } + function fn2b(n: number[]); + function fn2b(n: Array); + function fn2b() { + } + + //Multiple function overload signatures that differ only by return type + function fn3(x: string): string; + function fn3(y: string): number; + function fn3(): any { + return null; + } + + //Function overload with rest param and another with only an optional parameter + function fn6(...t: any[]); + function fn6(x?: any); + function fn6() { } + + //Function overload with rest param and another with only optional parameters + function fn7(...t: any[]); + function fn7(x?: any, y?: any, z?: any); + function fn7() { } + + //Function overloads that differ only by type parameter name + function fn8(n: string); + function fn8(n: string); + function fn8() { } + + //Function overloads that differ only by type parameter name when used in parameter type annotations + function fn9(n: T); + function fn9(n: S); + function fn9() { } + + //Function overloads that differ only by type parameter constraints + function fn10(); + ~~~~~~ +!!! Cannot find name 'Window'. + function fn10(); + function fn10() { } + // (actually OK) + + //Function overloads that differ only by type parameter constraints where constraints are structually identical + function fn11(); + ~~~~~~ +!!! Cannot find name 'Window'. + function fn11(); + ~~~~~~ +!!! Cannot find name 'window'. + function fn11() { } + + //Function overloads that differ only by type parameter constraints where constraints include infinitely recursive type reference + interface List { + parents: List>; + } + function fn12>>(); + function fn12>(); + function fn12() { } + + //Function overloads that differ by accessibility + class cls { + public f(); + private f(s: string); + ~ +!!! Overload signatures must all be public or private. + f() { } + + private g(s: string); + ~ +!!! Overload signatures must all be public or private. + public g(); + g() { } + } + + //Function overloads with differing export + module M { + export function fn1(); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + function fn1(n: string); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Duplicate identifier 'fn1'. + function fn1() { } + ~~~ +!!! Duplicate identifier 'fn1'. + + function fn2(n: string); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + export function fn2(); + ~~~ +!!! Duplicate identifier 'fn2'. + export function fn2() { } + ~~~ +!!! Duplicate identifier 'fn2'. + } + + //Function overloads with differing ambience + declare function dfn1(); + ~~~~ +!!! Overload signatures must all be ambient or non-ambient. + function dfn1(s: string); + function dfn1() { } + + function dfn2(); + declare function dfn2(s: string); + ~~~~ +!!! Overload signatures must all be ambient or non-ambient. + function dfn2() { } + + //Function overloads with fewer params than implementation signature + function fewerParams(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function fewerParams(n: string) { + } + + //Function implementation whose parameter types are not assignable to all corresponding overload signature parameters + function fn13(n: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function fn13(n: number) { } + + //Function overloads where return types are not all subtype of implementation return type + function fn14(n: string): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function fn14() { + return 3; + } + + //Function overloads where return types are different infinitely recursive type reference + function fn15>>(): T; + function fn15>(): T; + function fn15() { + return undefined; + } + + //Function overloads which use initializer expressions + function initExpr(n = 13); + ~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + function initExpr() { } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadErrors.js b/tests/baselines/reference/functionOverloadErrors.js new file mode 100644 index 0000000000000..cac3674df2929 --- /dev/null +++ b/tests/baselines/reference/functionOverloadErrors.js @@ -0,0 +1,177 @@ +//// [functionOverloadErrors.ts] +//Function overload signature with initializer +function fn1(x = 3); +function fn1() { } + +//Multiple function overload signatures that are identical +function fn2a(); +function fn2a(); +function fn2a() { + +} +function fn2b(n: number[]); +function fn2b(n: Array); +function fn2b() { +} + +//Multiple function overload signatures that differ only by return type +function fn3(x: string): string; +function fn3(y: string): number; +function fn3(): any { + return null; +} + +//Function overload with rest param and another with only an optional parameter +function fn6(...t: any[]); +function fn6(x?: any); +function fn6() { } + +//Function overload with rest param and another with only optional parameters +function fn7(...t: any[]); +function fn7(x?: any, y?: any, z?: any); +function fn7() { } + +//Function overloads that differ only by type parameter name +function fn8(n: string); +function fn8(n: string); +function fn8() { } + +//Function overloads that differ only by type parameter name when used in parameter type annotations +function fn9(n: T); +function fn9(n: S); +function fn9() { } + +//Function overloads that differ only by type parameter constraints +function fn10(); +function fn10(); +function fn10() { } +// (actually OK) + +//Function overloads that differ only by type parameter constraints where constraints are structually identical +function fn11(); +function fn11(); +function fn11() { } + +//Function overloads that differ only by type parameter constraints where constraints include infinitely recursive type reference +interface List { + parents: List>; +} +function fn12>>(); +function fn12>(); +function fn12() { } + +//Function overloads that differ by accessibility +class cls { + public f(); + private f(s: string); + f() { } + + private g(s: string); + public g(); + g() { } +} + +//Function overloads with differing export +module M { + export function fn1(); + function fn1(n: string); + function fn1() { } + + function fn2(n: string); + export function fn2(); + export function fn2() { } +} + +//Function overloads with differing ambience +declare function dfn1(); +function dfn1(s: string); +function dfn1() { } + +function dfn2(); +declare function dfn2(s: string); +function dfn2() { } + +//Function overloads with fewer params than implementation signature +function fewerParams(); +function fewerParams(n: string) { +} + +//Function implementation whose parameter types are not assignable to all corresponding overload signature parameters +function fn13(n: string); +function fn13(n: number) { } + +//Function overloads where return types are not all subtype of implementation return type +function fn14(n: string): string; +function fn14() { + return 3; +} + +//Function overloads where return types are different infinitely recursive type reference +function fn15>>(): T; +function fn15>(): T; +function fn15() { + return undefined; +} + +//Function overloads which use initializer expressions +function initExpr(n = 13); +function initExpr() { } + + +//// [functionOverloadErrors.js] +function fn1() { +} +function fn2a() { +} +function fn2b() { +} +function fn3() { + return null; +} +function fn6() { +} +function fn7() { +} +function fn8() { +} +function fn9() { +} +function fn10() { +} +function fn11() { +} +function fn12() { +} +var cls = (function () { + function cls() { + } + cls.prototype.f = function () { + }; + cls.prototype.g = function () { + }; + return cls; +})(); +var M; +(function (M) { + function fn1() { + } + function fn2() { + } + M.fn2 = fn2; +})(M || (M = {})); +function dfn1() { +} +function dfn2() { +} +function fewerParams(n) { +} +function fn13(n) { +} +function fn14() { + return 3; +} +function fn15() { + return undefined; +} +function initExpr() { +} diff --git a/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt b/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt new file mode 100644 index 0000000000000..81f7a63b9674f --- /dev/null +++ b/tests/baselines/reference/functionOverloadErrorsSyntax.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/functions/functionOverloadErrorsSyntax.ts (3 errors) ==== + //Function overload signature with optional parameter followed by non-optional parameter + function fn4a(x?: number, y: string); + ~ +!!! A required parameter cannot follow an optional parameter. + function fn4a() { } + + function fn4b(n: string, x?: number, y: string); + ~ +!!! A required parameter cannot follow an optional parameter. + function fn4b() { } + + //Function overload signature with rest param followed by non-optional parameter + function fn5(x: string, ...y: any[], z: string); + ~ +!!! A rest parameter must be last in a parameter list. + function fn5() { } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt new file mode 100644 index 0000000000000..a948858122fd7 --- /dev/null +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloadImplementationOfWrongName.ts (1 errors) ==== + function foo(x); + function foo(x, y); + ~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + function bar() { } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName.js b/tests/baselines/reference/functionOverloadImplementationOfWrongName.js new file mode 100644 index 0000000000000..6b66bc89ffa61 --- /dev/null +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName.js @@ -0,0 +1,8 @@ +//// [functionOverloadImplementationOfWrongName.ts] +function foo(x); +function foo(x, y); +function bar() { } + +//// [functionOverloadImplementationOfWrongName.js] +function bar() { +} diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt new file mode 100644 index 0000000000000..371d06e6a6c23 --- /dev/null +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts (1 errors) ==== + function foo(x); + function bar() { } + function foo(x, y); + ~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js new file mode 100644 index 0000000000000..c3008e7a6c25b --- /dev/null +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.js @@ -0,0 +1,8 @@ +//// [functionOverloadImplementationOfWrongName2.ts] +function foo(x); +function bar() { } +function foo(x, y); + +//// [functionOverloadImplementationOfWrongName2.js] +function bar() { +} diff --git a/tests/baselines/reference/functionOverloads.errors.txt b/tests/baselines/reference/functionOverloads.errors.txt new file mode 100644 index 0000000000000..97c771a8d06f8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/functionOverloads.ts (1 errors) ==== + function foo(): string; + function foo(bar: string): number; + function foo(bar?: string): any { return "" }; + var x = foo(5); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads.js b/tests/baselines/reference/functionOverloads.js new file mode 100644 index 0000000000000..5504b286628f5 --- /dev/null +++ b/tests/baselines/reference/functionOverloads.js @@ -0,0 +1,12 @@ +//// [functionOverloads.ts] +function foo(): string; +function foo(bar: string): number; +function foo(bar?: string): any { return "" }; +var x = foo(5); + +//// [functionOverloads.js] +function foo(bar) { + return ""; +} +; +var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads1.js b/tests/baselines/reference/functionOverloads1.js new file mode 100644 index 0000000000000..695a9c37808e4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads1.js @@ -0,0 +1,10 @@ +//// [functionOverloads1.ts] +function foo(); +1+1; +function foo():string { return "a" } + +//// [functionOverloads1.js] +1 + 1; +function foo() { + return "a"; +} diff --git a/tests/baselines/reference/functionOverloads10.js b/tests/baselines/reference/functionOverloads10.js new file mode 100644 index 0000000000000..2cd24bcd1cb9f --- /dev/null +++ b/tests/baselines/reference/functionOverloads10.js @@ -0,0 +1,9 @@ +//// [functionOverloads10.ts] +function foo(foo:string, bar:number); +function foo(foo:string); +function foo(foo:any){ } + + +//// [functionOverloads10.js] +function foo(foo) { +} diff --git a/tests/baselines/reference/functionOverloads11.errors.txt b/tests/baselines/reference/functionOverloads11.errors.txt new file mode 100644 index 0000000000000..a3a8393ec78b4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads11.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloads11.ts (1 errors) ==== + function foo():number; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo():string { return "" } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads11.js b/tests/baselines/reference/functionOverloads11.js new file mode 100644 index 0000000000000..efc9c793125ba --- /dev/null +++ b/tests/baselines/reference/functionOverloads11.js @@ -0,0 +1,9 @@ +//// [functionOverloads11.ts] +function foo():number; +function foo():string { return "" } + + +//// [functionOverloads11.js] +function foo() { + return ""; +} diff --git a/tests/baselines/reference/functionOverloads12.js b/tests/baselines/reference/functionOverloads12.js new file mode 100644 index 0000000000000..ff789083eeba8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.js @@ -0,0 +1,13 @@ +//// [functionOverloads12.ts] +function foo():string; +function foo():number; +function foo():any { if (true) return ""; else return 0;} + + +//// [functionOverloads12.js] +function foo() { + if (true) + return ""; + else + return 0; +} diff --git a/tests/baselines/reference/functionOverloads13.js b/tests/baselines/reference/functionOverloads13.js new file mode 100644 index 0000000000000..f9eb4d59e47f0 --- /dev/null +++ b/tests/baselines/reference/functionOverloads13.js @@ -0,0 +1,10 @@ +//// [functionOverloads13.ts] +function foo(bar:number):string; +function foo(bar:number):number; +function foo(bar?:number):any { return "" } + + +//// [functionOverloads13.js] +function foo(bar) { + return ""; +} diff --git a/tests/baselines/reference/functionOverloads14.js b/tests/baselines/reference/functionOverloads14.js new file mode 100644 index 0000000000000..f9a08ecf95275 --- /dev/null +++ b/tests/baselines/reference/functionOverloads14.js @@ -0,0 +1,10 @@ +//// [functionOverloads14.ts] +function foo():{a:number;} +function foo():{a:string;} +function foo():{a:any;} { return {a:1} } + + +//// [functionOverloads14.js] +function foo() { + return { a: 1 }; +} diff --git a/tests/baselines/reference/functionOverloads15.js b/tests/baselines/reference/functionOverloads15.js new file mode 100644 index 0000000000000..2b80df6630cde --- /dev/null +++ b/tests/baselines/reference/functionOverloads15.js @@ -0,0 +1,10 @@ +//// [functionOverloads15.ts] +function foo(foo:{a:string; b:number;}):string; +function foo(foo:{a:string; b:number;}):number; +function foo(foo:{a:string; b?:number;}):any { return "" } + + +//// [functionOverloads15.js] +function foo(foo) { + return ""; +} diff --git a/tests/baselines/reference/functionOverloads16.js b/tests/baselines/reference/functionOverloads16.js new file mode 100644 index 0000000000000..ebf82febd1606 --- /dev/null +++ b/tests/baselines/reference/functionOverloads16.js @@ -0,0 +1,10 @@ +//// [functionOverloads16.ts] +function foo(foo:{a:string;}):string; +function foo(foo:{a:string;}):number; +function foo(foo:{a:string; b?:number;}):any { return "" } + + +//// [functionOverloads16.js] +function foo(foo) { + return ""; +} diff --git a/tests/baselines/reference/functionOverloads17.errors.txt b/tests/baselines/reference/functionOverloads17.errors.txt new file mode 100644 index 0000000000000..434cacaeac1c9 --- /dev/null +++ b/tests/baselines/reference/functionOverloads17.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloads17.ts (1 errors) ==== + function foo():{a:number;} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo():{a:string;} { return {a:""} } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads17.js b/tests/baselines/reference/functionOverloads17.js new file mode 100644 index 0000000000000..d9fa54b744b40 --- /dev/null +++ b/tests/baselines/reference/functionOverloads17.js @@ -0,0 +1,9 @@ +//// [functionOverloads17.ts] +function foo():{a:number;} +function foo():{a:string;} { return {a:""} } + + +//// [functionOverloads17.js] +function foo() { + return { a: "" }; +} diff --git a/tests/baselines/reference/functionOverloads18.errors.txt b/tests/baselines/reference/functionOverloads18.errors.txt new file mode 100644 index 0000000000000..9db680de2e241 --- /dev/null +++ b/tests/baselines/reference/functionOverloads18.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloads18.ts (1 errors) ==== + function foo(bar:{a:number;}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(bar:{a:string;}) { return {a:""} } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads18.js b/tests/baselines/reference/functionOverloads18.js new file mode 100644 index 0000000000000..e1061a32c09d7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads18.js @@ -0,0 +1,9 @@ +//// [functionOverloads18.ts] +function foo(bar:{a:number;}); +function foo(bar:{a:string;}) { return {a:""} } + + +//// [functionOverloads18.js] +function foo(bar) { + return { a: "" }; +} diff --git a/tests/baselines/reference/functionOverloads19.errors.txt b/tests/baselines/reference/functionOverloads19.errors.txt new file mode 100644 index 0000000000000..807a3383c863b --- /dev/null +++ b/tests/baselines/reference/functionOverloads19.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/functionOverloads19.ts (1 errors) ==== + function foo(bar:{b:string;}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(bar:{a:string;}); + function foo(bar:{a:any;}) { return {a:""} } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads19.js b/tests/baselines/reference/functionOverloads19.js new file mode 100644 index 0000000000000..6b383225dd05f --- /dev/null +++ b/tests/baselines/reference/functionOverloads19.js @@ -0,0 +1,10 @@ +//// [functionOverloads19.ts] +function foo(bar:{b:string;}); +function foo(bar:{a:string;}); +function foo(bar:{a:any;}) { return {a:""} } + + +//// [functionOverloads19.js] +function foo(bar) { + return { a: "" }; +} diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt new file mode 100644 index 0000000000000..0f37235a5f08d --- /dev/null +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== + function foo(bar: string): string; + function foo(bar: number): number; + function foo(bar: any): any { return bar }; + var x = foo(true); + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads2.js b/tests/baselines/reference/functionOverloads2.js new file mode 100644 index 0000000000000..7e9eb45d236f0 --- /dev/null +++ b/tests/baselines/reference/functionOverloads2.js @@ -0,0 +1,12 @@ +//// [functionOverloads2.ts] +function foo(bar: string): string; +function foo(bar: number): number; +function foo(bar: any): any { return bar }; +var x = foo(true); + +//// [functionOverloads2.js] +function foo(bar) { + return bar; +} +; +var x = foo(true); diff --git a/tests/baselines/reference/functionOverloads20.errors.txt b/tests/baselines/reference/functionOverloads20.errors.txt new file mode 100644 index 0000000000000..106dde569a8d0 --- /dev/null +++ b/tests/baselines/reference/functionOverloads20.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/functionOverloads20.ts (1 errors) ==== + function foo(bar:{a:number;}): number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(bar:{a:string;}): string; + function foo(bar:{a:any;}): string {return ""} + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads20.js b/tests/baselines/reference/functionOverloads20.js new file mode 100644 index 0000000000000..012f2ce09cd3d --- /dev/null +++ b/tests/baselines/reference/functionOverloads20.js @@ -0,0 +1,10 @@ +//// [functionOverloads20.ts] +function foo(bar:{a:number;}): number; +function foo(bar:{a:string;}): string; +function foo(bar:{a:any;}): string {return ""} + + +//// [functionOverloads20.js] +function foo(bar) { + return ""; +} diff --git a/tests/baselines/reference/functionOverloads21.js b/tests/baselines/reference/functionOverloads21.js new file mode 100644 index 0000000000000..78fb1fe011f3a --- /dev/null +++ b/tests/baselines/reference/functionOverloads21.js @@ -0,0 +1,10 @@ +//// [functionOverloads21.ts] +function foo(bar:{a:number;}[]); +function foo(bar:{a:number; b:string;}[]); +function foo(bar:{a:any; b?:string;}[]) { return 0 } + + +//// [functionOverloads21.js] +function foo(bar) { + return 0; +} diff --git a/tests/baselines/reference/functionOverloads22.errors.txt b/tests/baselines/reference/functionOverloads22.errors.txt new file mode 100644 index 0000000000000..e091094f01e48 --- /dev/null +++ b/tests/baselines/reference/functionOverloads22.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/functionOverloads22.ts (1 errors) ==== + function foo(bar:number):{a:number;}[]; + function foo(bar:string):{a:number; b:string;}[]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads22.js b/tests/baselines/reference/functionOverloads22.js new file mode 100644 index 0000000000000..531c37770b18e --- /dev/null +++ b/tests/baselines/reference/functionOverloads22.js @@ -0,0 +1,10 @@ +//// [functionOverloads22.ts] +function foo(bar:number):{a:number;}[]; +function foo(bar:string):{a:number; b:string;}[]; +function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } + + +//// [functionOverloads22.js] +function foo(bar) { + return [{ a: "" }]; +} diff --git a/tests/baselines/reference/functionOverloads23.js b/tests/baselines/reference/functionOverloads23.js new file mode 100644 index 0000000000000..d8cac7eb8ee73 --- /dev/null +++ b/tests/baselines/reference/functionOverloads23.js @@ -0,0 +1,10 @@ +//// [functionOverloads23.ts] +function foo(bar:(b:string)=>void); +function foo(bar:(a:number)=>void); +function foo(bar:(a?)=>void) { return 0 } + + +//// [functionOverloads23.js] +function foo(bar) { + return 0; +} diff --git a/tests/baselines/reference/functionOverloads24.js b/tests/baselines/reference/functionOverloads24.js new file mode 100644 index 0000000000000..5ff4e248c0ab0 --- /dev/null +++ b/tests/baselines/reference/functionOverloads24.js @@ -0,0 +1,11 @@ +//// [functionOverloads24.ts] +function foo(bar:number):(b:string)=>void; +function foo(bar:string):(a:number)=>void; +function foo(bar:any):(a)=>void { return function(){} } + + +//// [functionOverloads24.js] +function foo(bar) { + return function () { + }; +} diff --git a/tests/baselines/reference/functionOverloads25.js b/tests/baselines/reference/functionOverloads25.js new file mode 100644 index 0000000000000..bbaef498926ad --- /dev/null +++ b/tests/baselines/reference/functionOverloads25.js @@ -0,0 +1,13 @@ +//// [functionOverloads25.ts] +function foo():string; +function foo(bar:string):number; +function foo(bar?:any):any{ return '' }; +var x = foo(); + + +//// [functionOverloads25.js] +function foo(bar) { + return ''; +} +; +var x = foo(); diff --git a/tests/baselines/reference/functionOverloads26.js b/tests/baselines/reference/functionOverloads26.js new file mode 100644 index 0000000000000..088c06147bafe --- /dev/null +++ b/tests/baselines/reference/functionOverloads26.js @@ -0,0 +1,12 @@ +//// [functionOverloads26.ts] +function foo():string; +function foo(bar:string):number; +function foo(bar?:any):any{ return '' } +var x = foo('baz'); + + +//// [functionOverloads26.js] +function foo(bar) { + return ''; +} +var x = foo('baz'); diff --git a/tests/baselines/reference/functionOverloads27.errors.txt b/tests/baselines/reference/functionOverloads27.errors.txt new file mode 100644 index 0000000000000..56963cb5a9e08 --- /dev/null +++ b/tests/baselines/reference/functionOverloads27.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads27.ts (1 errors) ==== + function foo():string; + function foo(bar:string):number; + function foo(bar?:any):any{ return '' } + var x = foo(5); + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads27.js b/tests/baselines/reference/functionOverloads27.js new file mode 100644 index 0000000000000..2b11b1f6c4e17 --- /dev/null +++ b/tests/baselines/reference/functionOverloads27.js @@ -0,0 +1,12 @@ +//// [functionOverloads27.ts] +function foo():string; +function foo(bar:string):number; +function foo(bar?:any):any{ return '' } +var x = foo(5); + + +//// [functionOverloads27.js] +function foo(bar) { + return ''; +} +var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads28.js b/tests/baselines/reference/functionOverloads28.js new file mode 100644 index 0000000000000..566972ee25da8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads28.js @@ -0,0 +1,13 @@ +//// [functionOverloads28.ts] +function foo():string; +function foo(bar:string):number; +function foo(bar?:any):any{ return '' } +var t:any; var x = foo(t); + + +//// [functionOverloads28.js] +function foo(bar) { + return ''; +} +var t; +var x = foo(t); diff --git a/tests/baselines/reference/functionOverloads29.errors.txt b/tests/baselines/reference/functionOverloads29.errors.txt new file mode 100644 index 0000000000000..510d9c4575f3e --- /dev/null +++ b/tests/baselines/reference/functionOverloads29.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads29.ts (1 errors) ==== + function foo(bar:string):string; + function foo(bar:number):number; + function foo(bar:any):any{ return bar } + var x = foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads29.js b/tests/baselines/reference/functionOverloads29.js new file mode 100644 index 0000000000000..c828bb95917fb --- /dev/null +++ b/tests/baselines/reference/functionOverloads29.js @@ -0,0 +1,12 @@ +//// [functionOverloads29.ts] +function foo(bar:string):string; +function foo(bar:number):number; +function foo(bar:any):any{ return bar } +var x = foo(); + + +//// [functionOverloads29.js] +function foo(bar) { + return bar; +} +var x = foo(); diff --git a/tests/baselines/reference/functionOverloads3.errors.txt b/tests/baselines/reference/functionOverloads3.errors.txt new file mode 100644 index 0000000000000..791553cf9540b --- /dev/null +++ b/tests/baselines/reference/functionOverloads3.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/functionOverloads3.ts (1 errors) ==== + function foo():string; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads3.js b/tests/baselines/reference/functionOverloads3.js new file mode 100644 index 0000000000000..4e25cb28ce7d2 --- /dev/null +++ b/tests/baselines/reference/functionOverloads3.js @@ -0,0 +1,4 @@ +//// [functionOverloads3.ts] +function foo():string; + +//// [functionOverloads3.js] diff --git a/tests/baselines/reference/functionOverloads30.js b/tests/baselines/reference/functionOverloads30.js new file mode 100644 index 0000000000000..27b1436b6fb69 --- /dev/null +++ b/tests/baselines/reference/functionOverloads30.js @@ -0,0 +1,12 @@ +//// [functionOverloads30.ts] +function foo(bar:string):string; +function foo(bar:number):number; +function foo(bar:any):any{ return bar } +var x = foo('bar'); + + +//// [functionOverloads30.js] +function foo(bar) { + return bar; +} +var x = foo('bar'); diff --git a/tests/baselines/reference/functionOverloads31.js b/tests/baselines/reference/functionOverloads31.js new file mode 100644 index 0000000000000..01cee2c342bee --- /dev/null +++ b/tests/baselines/reference/functionOverloads31.js @@ -0,0 +1,12 @@ +//// [functionOverloads31.ts] +function foo(bar:string):string; +function foo(bar:number):number; +function foo(bar:any):any{ return bar } +var x = foo(5); + + +//// [functionOverloads31.js] +function foo(bar) { + return bar; +} +var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads32.js b/tests/baselines/reference/functionOverloads32.js new file mode 100644 index 0000000000000..4e0efa98b092f --- /dev/null +++ b/tests/baselines/reference/functionOverloads32.js @@ -0,0 +1,13 @@ +//// [functionOverloads32.ts] +function foo(bar:string):string; +function foo(bar:number):number; +function foo(bar:any):any{ return bar } +var baz:number; var x = foo(baz); + + +//// [functionOverloads32.js] +function foo(bar) { + return bar; +} +var baz; +var x = foo(baz); diff --git a/tests/baselines/reference/functionOverloads33.js b/tests/baselines/reference/functionOverloads33.js new file mode 100644 index 0000000000000..0c01cd54d1ef8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads33.js @@ -0,0 +1,12 @@ +//// [functionOverloads33.ts] +function foo(bar:string):string; +function foo(bar:any):number; +function foo(bar:any):any{ return bar } +var x = foo(5); + + +//// [functionOverloads33.js] +function foo(bar) { + return bar; +} +var x = foo(5); diff --git a/tests/baselines/reference/functionOverloads34.errors.txt b/tests/baselines/reference/functionOverloads34.errors.txt new file mode 100644 index 0000000000000..6dc7b45c3d2e7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads34.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads34.ts (1 errors) ==== + function foo(bar:{a:number;}):string; + function foo(bar:{a:boolean;}):number; + function foo(bar:{a:any;}):any{ return bar } + var x = foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads34.js b/tests/baselines/reference/functionOverloads34.js new file mode 100644 index 0000000000000..48ac2b5fc59c4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads34.js @@ -0,0 +1,12 @@ +//// [functionOverloads34.ts] +function foo(bar:{a:number;}):string; +function foo(bar:{a:boolean;}):number; +function foo(bar:{a:any;}):any{ return bar } +var x = foo(); + + +//// [functionOverloads34.js] +function foo(bar) { + return bar; +} +var x = foo(); diff --git a/tests/baselines/reference/functionOverloads35.js b/tests/baselines/reference/functionOverloads35.js new file mode 100644 index 0000000000000..fa373a9ee5243 --- /dev/null +++ b/tests/baselines/reference/functionOverloads35.js @@ -0,0 +1,12 @@ +//// [functionOverloads35.ts] +function foo(bar:{a:number;}):number; +function foo(bar:{a:string;}):string; +function foo(bar:{a:any;}):any{ return bar } +var x = foo({a:1}); + + +//// [functionOverloads35.js] +function foo(bar) { + return bar; +} +var x = foo({ a: 1 }); diff --git a/tests/baselines/reference/functionOverloads36.js b/tests/baselines/reference/functionOverloads36.js new file mode 100644 index 0000000000000..33f6156c66b53 --- /dev/null +++ b/tests/baselines/reference/functionOverloads36.js @@ -0,0 +1,12 @@ +//// [functionOverloads36.ts] +function foo(bar:{a:number;}):number; +function foo(bar:{a:string;}):string; +function foo(bar:{a:any;}):any{ return bar } +var x = foo({a:'foo'}); + + +//// [functionOverloads36.js] +function foo(bar) { + return bar; +} +var x = foo({ a: 'foo' }); diff --git a/tests/baselines/reference/functionOverloads37.errors.txt b/tests/baselines/reference/functionOverloads37.errors.txt new file mode 100644 index 0000000000000..0e93e7a459b75 --- /dev/null +++ b/tests/baselines/reference/functionOverloads37.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads37.ts (1 errors) ==== + function foo(bar:{a:number;}[]):string; + function foo(bar:{a:boolean;}[]):number; + function foo(bar:{a:any;}[]):any{ return bar } + var x = foo(); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads37.js b/tests/baselines/reference/functionOverloads37.js new file mode 100644 index 0000000000000..f9e6130dbd9df --- /dev/null +++ b/tests/baselines/reference/functionOverloads37.js @@ -0,0 +1,12 @@ +//// [functionOverloads37.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo(); + + +//// [functionOverloads37.js] +function foo(bar) { + return bar; +} +var x = foo(); diff --git a/tests/baselines/reference/functionOverloads38.js b/tests/baselines/reference/functionOverloads38.js new file mode 100644 index 0000000000000..410b4358edebf --- /dev/null +++ b/tests/baselines/reference/functionOverloads38.js @@ -0,0 +1,12 @@ +//// [functionOverloads38.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo([{a:1}]); + + +//// [functionOverloads38.js] +function foo(bar) { + return bar; +} +var x = foo([{ a: 1 }]); diff --git a/tests/baselines/reference/functionOverloads39.js b/tests/baselines/reference/functionOverloads39.js new file mode 100644 index 0000000000000..771a31480368a --- /dev/null +++ b/tests/baselines/reference/functionOverloads39.js @@ -0,0 +1,12 @@ +//// [functionOverloads39.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo([{a:true}]); + + +//// [functionOverloads39.js] +function foo(bar) { + return bar; +} +var x = foo([{ a: true }]); diff --git a/tests/baselines/reference/functionOverloads4.errors.txt b/tests/baselines/reference/functionOverloads4.errors.txt new file mode 100644 index 0000000000000..3ec1a19dd35dd --- /dev/null +++ b/tests/baselines/reference/functionOverloads4.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/functionOverloads4.ts (1 errors) ==== + function foo():number; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo():string { return "a" } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads4.js b/tests/baselines/reference/functionOverloads4.js new file mode 100644 index 0000000000000..b428f6938b47b --- /dev/null +++ b/tests/baselines/reference/functionOverloads4.js @@ -0,0 +1,8 @@ +//// [functionOverloads4.ts] +function foo():number; +function foo():string { return "a" } + +//// [functionOverloads4.js] +function foo() { + return "a"; +} diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt new file mode 100644 index 0000000000000..e277e038a1ba7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== + function foo(bar:{a:number;}[]):string; + function foo(bar:{a:boolean;}[]):number; + function foo(bar:{a:any;}[]):any{ return bar } + var x = foo([{a:'bar'}]); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads40.js b/tests/baselines/reference/functionOverloads40.js new file mode 100644 index 0000000000000..f718f0a8847f9 --- /dev/null +++ b/tests/baselines/reference/functionOverloads40.js @@ -0,0 +1,12 @@ +//// [functionOverloads40.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo([{a:'bar'}]); + + +//// [functionOverloads40.js] +function foo(bar) { + return bar; +} +var x = foo([{ a: 'bar' }]); diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt new file mode 100644 index 0000000000000..47f268c2931eb --- /dev/null +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads41.ts (1 errors) ==== + function foo(bar:{a:number;}[]):string; + function foo(bar:{a:boolean;}[]):number; + function foo(bar:{a:any;}[]):any{ return bar } + var x = foo([{}]); + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.js b/tests/baselines/reference/functionOverloads41.js new file mode 100644 index 0000000000000..566ef21424fa4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads41.js @@ -0,0 +1,12 @@ +//// [functionOverloads41.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo([{}]); + + +//// [functionOverloads41.js] +function foo(bar) { + return bar; +} +var x = foo([{}]); diff --git a/tests/baselines/reference/functionOverloads42.js b/tests/baselines/reference/functionOverloads42.js new file mode 100644 index 0000000000000..fcca395581cfe --- /dev/null +++ b/tests/baselines/reference/functionOverloads42.js @@ -0,0 +1,12 @@ +//// [functionOverloads42.ts] +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:any;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar } +var x = foo([{a:'s'}]); + + +//// [functionOverloads42.js] +function foo(bar) { + return bar; +} +var x = foo([{ a: 's' }]); diff --git a/tests/baselines/reference/functionOverloads5.errors.txt b/tests/baselines/reference/functionOverloads5.errors.txt new file mode 100644 index 0000000000000..a73fb152a0ebe --- /dev/null +++ b/tests/baselines/reference/functionOverloads5.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/functionOverloads5.ts (1 errors) ==== + class baz { + public foo(); + ~~~ +!!! Overload signatures must all be public or private. + private foo(bar?:any){ } + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads5.js b/tests/baselines/reference/functionOverloads5.js new file mode 100644 index 0000000000000..15507a9fb6108 --- /dev/null +++ b/tests/baselines/reference/functionOverloads5.js @@ -0,0 +1,15 @@ +//// [functionOverloads5.ts] +class baz { + public foo(); + private foo(bar?:any){ } +} + + +//// [functionOverloads5.js] +var baz = (function () { + function baz() { + } + baz.prototype.foo = function (bar) { + }; + return baz; +})(); diff --git a/tests/baselines/reference/functionOverloads6.js b/tests/baselines/reference/functionOverloads6.js new file mode 100644 index 0000000000000..b7f9fd8c1f292 --- /dev/null +++ b/tests/baselines/reference/functionOverloads6.js @@ -0,0 +1,16 @@ +//// [functionOverloads6.ts] +class foo { + static fnOverload(); + static fnOverload(foo:string); + static fnOverload(foo?: any){ } +} + + +//// [functionOverloads6.js] +var foo = (function () { + function foo() { + } + foo.fnOverload = function (foo) { + }; + return foo; +})(); diff --git a/tests/baselines/reference/functionOverloads7.js b/tests/baselines/reference/functionOverloads7.js new file mode 100644 index 0000000000000..52cac83af7233 --- /dev/null +++ b/tests/baselines/reference/functionOverloads7.js @@ -0,0 +1,25 @@ +//// [functionOverloads7.ts] +class foo { + private bar(); + private bar(foo: string); + private bar(foo?: any){ return "foo" } + public n() { + var foo = this.bar(); + foo = this.bar("test"); + } +} + + +//// [functionOverloads7.js] +var foo = (function () { + function foo() { + } + foo.prototype.bar = function (foo) { + return "foo"; + }; + foo.prototype.n = function () { + var foo = this.bar(); + foo = this.bar("test"); + }; + return foo; +})(); diff --git a/tests/baselines/reference/functionOverloads8.js b/tests/baselines/reference/functionOverloads8.js new file mode 100644 index 0000000000000..08c2c0b65a1b1 --- /dev/null +++ b/tests/baselines/reference/functionOverloads8.js @@ -0,0 +1,10 @@ +//// [functionOverloads8.ts] +function foo(); +function foo(foo:string); +function foo(foo?:any){ return '' } + + +//// [functionOverloads8.js] +function foo(foo) { + return ''; +} diff --git a/tests/baselines/reference/functionOverloads9.js b/tests/baselines/reference/functionOverloads9.js new file mode 100644 index 0000000000000..53cc0385a5980 --- /dev/null +++ b/tests/baselines/reference/functionOverloads9.js @@ -0,0 +1,12 @@ +//// [functionOverloads9.ts] +function foo(foo:string); +function foo(foo?:string){ return '' }; +var x = foo('foo'); + + +//// [functionOverloads9.js] +function foo(foo) { + return ''; +} +; +var x = foo('foo'); diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity1.js b/tests/baselines/reference/functionOverloadsOnGenericArity1.js new file mode 100644 index 0000000000000..d91d81122c3d2 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity1.js @@ -0,0 +1,15 @@ +//// [functionOverloadsOnGenericArity1.ts] +// overloading on arity not allowed +interface C { + f(): string; + f(): string; + + (): string; + (): string; + + new (): string; + new (): string; +} + + +//// [functionOverloadsOnGenericArity1.js] diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity2.js b/tests/baselines/reference/functionOverloadsOnGenericArity2.js new file mode 100644 index 0000000000000..b94d1f5738597 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity2.js @@ -0,0 +1,8 @@ +//// [functionOverloadsOnGenericArity2.ts] +interface I { + then(p: string): string; + then(p: string): string; + then(p: string): Date; +} + +//// [functionOverloadsOnGenericArity2.js] diff --git a/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt new file mode 100644 index 0000000000000..64249e33c23fd --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/functionOverloadsOutOfOrder.ts (2 errors) ==== + class d { + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } + + class e { + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + private foo(n: number): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadsOutOfOrder.js b/tests/baselines/reference/functionOverloadsOutOfOrder.js new file mode 100644 index 0000000000000..32d69fb72ffc2 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOutOfOrder.js @@ -0,0 +1,34 @@ +//// [functionOverloadsOutOfOrder.ts] +class d { + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; +} + +class e { + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + private foo(n: number): string; +} + +//// [functionOverloadsOutOfOrder.js] +var d = (function () { + function d() { + } + d.prototype.foo = function (ns) { + return ns.toString(); + }; + return d; +})(); +var e = (function () { + function e() { + } + e.prototype.foo = function (ns) { + return ns.toString(); + }; + return e; +})(); diff --git a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js new file mode 100644 index 0000000000000..ab0baf2059296 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.js @@ -0,0 +1,34 @@ +//// [functionOverloadsRecursiveGenericReturnType.ts] +class B{ + private id: V; +} + +class A{ + GetEnumerator: () => B; +} + +function Choice(args: T[]): A; +function Choice(...v_args: T[]): A; +function Choice(...v_args: any[]): A{ + return new A(); +} + + +//// [functionOverloadsRecursiveGenericReturnType.js] +var B = (function () { + function B() { + } + return B; +})(); +var A = (function () { + function A() { + } + return A; +})(); +function Choice() { + var v_args = []; + for (var _i = 0; _i < arguments.length; _i++) { + v_args[_i - 0] = arguments[_i]; + } + return new A(); +} diff --git a/tests/baselines/reference/functionReturn.js b/tests/baselines/reference/functionReturn.js new file mode 100644 index 0000000000000..bfcd12e2b95b2 --- /dev/null +++ b/tests/baselines/reference/functionReturn.js @@ -0,0 +1,35 @@ +//// [functionReturn.ts] +function f0(): void { } +function f1() { + var n: any = f0(); +} +function f2(): any { } +function f3(): string { return; } +function f4(): string { + return ''; + return; +} +function f5(): string { + return ''; + return undefined; +} + +//// [functionReturn.js] +function f0() { +} +function f1() { + var n = f0(); +} +function f2() { +} +function f3() { + return; +} +function f4() { + return ''; + return; +} +function f5() { + return ''; + return undefined; +} diff --git a/tests/baselines/reference/functionReturningItself.js b/tests/baselines/reference/functionReturningItself.js new file mode 100644 index 0000000000000..e90398d633e3c --- /dev/null +++ b/tests/baselines/reference/functionReturningItself.js @@ -0,0 +1,12 @@ +//// [functionReturningItself.ts] +function somefn() { + return somefn; +} + +//// [functionReturningItself.js] +function somefn() { + return somefn; +} + + +//// [functionReturningItself.d.ts] diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt new file mode 100644 index 0000000000000..5e23463b0d864 --- /dev/null +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ==== + interface ParserFunc { + (eventEmitter: number, buffer: string): void; + } + interface Parsers { + raw: ParserFunc; + readline(delimiter?: string): ParserFunc; + } + var parsers: Parsers; + var c: ParserFunc = parsers.raw; // ok! + var d: ParserFunc = parsers.readline; // not ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': +!!! Types of parameters 'delimiter' and 'eventEmitter' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.js b/tests/baselines/reference/functionSignatureAssignmentCompat1.js new file mode 100644 index 0000000000000..413f78ca9faad --- /dev/null +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.js @@ -0,0 +1,18 @@ +//// [functionSignatureAssignmentCompat1.ts] +interface ParserFunc { + (eventEmitter: number, buffer: string): void; +} +interface Parsers { + raw: ParserFunc; + readline(delimiter?: string): ParserFunc; +} +var parsers: Parsers; +var c: ParserFunc = parsers.raw; // ok! +var d: ParserFunc = parsers.readline; // not ok +var e: ParserFunc = parsers.readline(); // ok + +//// [functionSignatureAssignmentCompat1.js] +var parsers; +var c = parsers.raw; +var d = parsers.readline; +var e = parsers.readline(); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js new file mode 100644 index 0000000000000..c527ca9696a56 --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -0,0 +1,42 @@ +//// [functionSubtypingOfVarArgs.ts] +class EventBase { + private _listeners = []; + + add(listener: (...args: any[]) => void): void { + this._listeners.push(listener); + } +} + +class StringEvent extends EventBase { // should work + add(listener: (items: string) => void ) { // valid, items is subtype of args + super.add(listener); + } +} + + +//// [functionSubtypingOfVarArgs.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EventBase = (function () { + function EventBase() { + this._listeners = []; + } + EventBase.prototype.add = function (listener) { + this._listeners.push(listener); + }; + return EventBase; +})(); +var StringEvent = (function (_super) { + __extends(StringEvent, _super); + function StringEvent() { + _super.apply(this, arguments); + } + StringEvent.prototype.add = function (listener) { + _super.prototype.add.call(this, listener); + }; + return StringEvent; +})(EventBase); diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js new file mode 100644 index 0000000000000..e11c03404a924 --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -0,0 +1,42 @@ +//// [functionSubtypingOfVarArgs2.ts] +class EventBase { + private _listeners: { (...args: any[]): void; }[] = []; + + add(listener: (...args: any[]) => void): void { + this._listeners.push(listener); + } +} + +class StringEvent extends EventBase { + add(listener: (items: string, moreitems: number) => void ) { + super.add(listener); + } +} + + +//// [functionSubtypingOfVarArgs2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EventBase = (function () { + function EventBase() { + this._listeners = []; + } + EventBase.prototype.add = function (listener) { + this._listeners.push(listener); + }; + return EventBase; +})(); +var StringEvent = (function (_super) { + __extends(StringEvent, _super); + function StringEvent() { + _super.apply(this, arguments); + } + StringEvent.prototype.add = function (listener) { + _super.prototype.add.call(this, listener); + }; + return StringEvent; +})(EventBase); diff --git a/tests/baselines/reference/functionType.js b/tests/baselines/reference/functionType.js new file mode 100644 index 0000000000000..c2d6eea784ca4 --- /dev/null +++ b/tests/baselines/reference/functionType.js @@ -0,0 +1,13 @@ +//// [functionType.ts] +function salt() {} +salt.apply("hello", []); +(new Function("return 5"))(); + + + + +//// [functionType.js] +function salt() { +} +salt.apply("hello", []); +(new Function("return 5"))(); diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt b/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt new file mode 100644 index 0000000000000..d6c226266044e --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/functionTypeArgumentArrayAssignment.ts (1 errors) ==== + interface Array { + foo: T; + length: number; + ~~~~~~ +!!! Duplicate identifier 'length'. + } + + function map() { + var ys: U[] = []; + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.js b/tests/baselines/reference/functionTypeArgumentArrayAssignment.js new file mode 100644 index 0000000000000..9569c4566d818 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.js @@ -0,0 +1,15 @@ +//// [functionTypeArgumentArrayAssignment.ts] +interface Array { + foo: T; + length: number; +} + +function map() { +var ys: U[] = []; +} + + +//// [functionTypeArgumentArrayAssignment.js] +function map() { + var ys = []; +} diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..a7c07b9de7770 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (1 errors) ==== + var f : { + (x:T): T; + } + + var g : { + () : S[]; + } = () => []; + + f = g; + var s = f("str").toUpperCase(); + + console.log(s); + ~~~~~~~ +!!! Cannot find name 'console'. + \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js new file mode 100644 index 0000000000000..15080e99d7303 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.js @@ -0,0 +1,21 @@ +//// [functionTypeArgumentAssignmentCompat.ts] +var f : { + (x:T): T; +} + +var g : { + () : S[]; +} = () => []; + +f = g; +var s = f("str").toUpperCase(); + +console.log(s); + + +//// [functionTypeArgumentAssignmentCompat.js] +var f; +var g = function () { return []; }; +f = g; +var s = f("str").toUpperCase(); +console.log(s); diff --git a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js new file mode 100644 index 0000000000000..f3da3c8197335 --- /dev/null +++ b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.js @@ -0,0 +1,13 @@ +//// [functionWithAnyReturnTypeAndNoReturnExpression.ts] +// All should be allowed +function f(): any { } +var f2: () => any = () => { }; +var f3 = (): any => { }; + +//// [functionWithAnyReturnTypeAndNoReturnExpression.js] +function f() { +} +var f2 = function () { +}; +var f3 = function () { +}; diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt new file mode 100644 index 0000000000000..d599e2da4454e --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt @@ -0,0 +1,128 @@ +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (9 errors) ==== + // return type of a function with multiple returns is the BCT of each return statement + // it is an error if there is no single BCT, these are error cases + + function f1() { + ~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f2() { + ~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~~~~~ + } else if (false) { + ~~~~~~~~~~~~~~~~~~~~~~~ + return 2; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f3() { + ~~~~~~~~~~~~~~~ + try { + ~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + catch (e) { + ~~~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f4() { + ~~~~~~~~~~~~~~~ + try { + ~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + catch (e) { + ~~~~~~~~~~~~~~~ + + + } + ~~~~~ + finally { + ~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f5() { + ~~~~~~~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f6(x: T, y:U) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return x; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return y; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + + function f8(x: T, y: U) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + if (true) { + ~~~~~~~~~~~~~~~ + return x; + ~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + return y; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! No best common type exists among return expressions. + \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.js b/tests/baselines/reference/functionWithMultipleReturnStatements.js new file mode 100644 index 0000000000000..5ce14263a88a6 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.js @@ -0,0 +1,123 @@ +//// [functionWithMultipleReturnStatements.ts] +// return type of a function with multiple returns is the BCT of each return statement +// it is an error if there is no single BCT, these are error cases + +function f1() { + if (true) { + return 1; + } else { + return ''; + } +} + +function f2() { + if (true) { + return 1; + } else if (false) { + return 2; + } else { + return ''; + } +} + +function f3() { + try { + return 1; + } + catch (e) { + return ''; + } +} + +function f4() { + try { + return 1; + } + catch (e) { + + } + finally { + return ''; + } +} + +function f5() { + return 1; + return ''; +} + +function f6(x: T, y:U) { + if (true) { + return x; + } else { + return y; + } +} + +function f8(x: T, y: U) { + if (true) { + return x; + } else { + return y; + } +} + + +//// [functionWithMultipleReturnStatements.js] +function f1() { + if (true) { + return 1; + } + else { + return ''; + } +} +function f2() { + if (true) { + return 1; + } + else if (false) { + return 2; + } + else { + return ''; + } +} +function f3() { + try { + return 1; + } + catch (e) { + return ''; + } +} +function f4() { + try { + return 1; + } + catch (e) { + } + finally { + return ''; + } +} +function f5() { + return 1; + return ''; +} +function f6(x, y) { + if (true) { + return x; + } + else { + return y; + } +} +function f8(x, y) { + if (true) { + return x; + } + else { + return y; + } +} diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.js b/tests/baselines/reference/functionWithMultipleReturnStatements2.js new file mode 100644 index 0000000000000..aacd83b1513fc --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.js @@ -0,0 +1,174 @@ +//// [functionWithMultipleReturnStatements2.ts] +// return type of a function with multiple returns is the BCT of each return statement +// no errors expected here + +function f1() { + if (true) { + return 1; + } else { + return null; + } +} + +function f2() { + if (true) { + return 1; + } else if (false) { + return null; + } else { + return 2; + } +} + +function f4() { + try { + return 1; + } + catch (e) { + return undefined; + } + finally { + return 1; + } +} + +function f5() { + return 1; + return new Object(); +} + +function f6(x: T) { + if (true) { + return x; + } else { + return null; + } +} + +//function f7(x: T, y: U) { +// if (true) { +// return x; +// } else { +// return y; +// } +//} + +var a: { x: number; y?: number }; +var b: { x: number; z?: number }; +// returns typeof a +function f9() { + if (true) { + return a; + } else { + return b; + } +} + +// returns typeof b +function f10() { + if (true) { + return b; + } else { + return a; + } +} + +// returns number => void +function f11() { + if (true) { + return (x: number) => { } + } else { + return (x: Object) => { } + } +} + +// returns Object => void +function f12() { + if (true) { + return (x: Object) => { } + } else { + return (x: number) => { } + } +} + +//// [functionWithMultipleReturnStatements2.js] +function f1() { + if (true) { + return 1; + } + else { + return null; + } +} +function f2() { + if (true) { + return 1; + } + else if (false) { + return null; + } + else { + return 2; + } +} +function f4() { + try { + return 1; + } + catch (e) { + return undefined; + } + finally { + return 1; + } +} +function f5() { + return 1; + return new Object(); +} +function f6(x) { + if (true) { + return x; + } + else { + return null; + } +} +var a; +var b; +function f9() { + if (true) { + return a; + } + else { + return b; + } +} +function f10() { + if (true) { + return b; + } + else { + return a; + } +} +function f11() { + if (true) { + return function (x) { + }; + } + else { + return function (x) { + }; + } +} +function f12() { + if (true) { + return function (x) { + }; + } + else { + return function (x) { + }; + } +} diff --git a/tests/baselines/reference/functionWithSameNameAsField.errors.txt b/tests/baselines/reference/functionWithSameNameAsField.errors.txt new file mode 100644 index 0000000000000..ce69b7feb564a --- /dev/null +++ b/tests/baselines/reference/functionWithSameNameAsField.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/functionWithSameNameAsField.ts (1 errors) ==== + class TestProgressBar { + public total: number; + public total(total: number) { + ~~~~~ +!!! Duplicate identifier 'total'. + this.total = total; + return this; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionWithSameNameAsField.js b/tests/baselines/reference/functionWithSameNameAsField.js new file mode 100644 index 0000000000000..cc9b6b12d44c9 --- /dev/null +++ b/tests/baselines/reference/functionWithSameNameAsField.js @@ -0,0 +1,20 @@ +//// [functionWithSameNameAsField.ts] +class TestProgressBar { + public total: number; + public total(total: number) { + this.total = total; + return this; + } +} + + +//// [functionWithSameNameAsField.js] +var TestProgressBar = (function () { + function TestProgressBar() { + } + TestProgressBar.prototype.total = function (total) { + this.total = total; + return this; + }; + return TestProgressBar; +})(); diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.js b/tests/baselines/reference/functionWithThrowButNoReturn1.js new file mode 100644 index 0000000000000..1fbf14688ed14 --- /dev/null +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.js @@ -0,0 +1,12 @@ +//// [functionWithThrowButNoReturn1.ts] +function fn(): number { + throw new Error('NYI'); + var t; +} + + +//// [functionWithThrowButNoReturn1.js] +function fn() { + throw new Error('NYI'); + var t; +} diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.js b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.js new file mode 100644 index 0000000000000..a647b26648334 --- /dev/null +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.js @@ -0,0 +1,13 @@ +//// [funduleExportedClassIsUsedBeforeDeclaration.ts] +interface A { // interface before module declaration + (): B.C; // uses defined below class in module +} +declare function B(): B.C; // function merged with module +declare module B { + export class C { // class defined in module + } +} +new B.C(); + +//// [funduleExportedClassIsUsedBeforeDeclaration.js] +new B.C(); diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js new file mode 100644 index 0000000000000..36356b1f6ed5f --- /dev/null +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.js @@ -0,0 +1,17 @@ +//// [funduleOfFunctionWithoutReturnTypeAnnotation.ts] +function fn() { + return fn.n; +} +module fn { + export var n = 1; +} + + +//// [funduleOfFunctionWithoutReturnTypeAnnotation.js] +function fn() { + return fn.n; +} +var fn; +(function (fn) { + fn.n = 1; +})(fn || (fn = {})); diff --git a/tests/baselines/reference/funduleSplitAcrossFiles.js b/tests/baselines/reference/funduleSplitAcrossFiles.js new file mode 100644 index 0000000000000..330fbcdec74b8 --- /dev/null +++ b/tests/baselines/reference/funduleSplitAcrossFiles.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/funduleSplitAcrossFiles.ts] //// + +//// [funduleSplitAcrossFiles_function.ts] +function D() { } + +//// [funduleSplitAcrossFiles_module.ts] +module D { + export var y = "hi"; +} +D.y; + +//// [funduleSplitAcrossFiles_function.js] +function D() { +} +//// [funduleSplitAcrossFiles_module.js] +var D; +(function (D) { + D.y = "hi"; +})(D || (D = {})); +D.y; diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.js b/tests/baselines/reference/funduleUsedAcrossFileBoundary.js new file mode 100644 index 0000000000000..e2fe34248d879 --- /dev/null +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.js @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/funduleUsedAcrossFileBoundary.ts] //// + +//// [funduleUsedAcrossFileBoundary_file1.ts] +declare function Q(value: T): string; +declare module Q { + interface Promise { + foo: string; + } + export function defer(): string; +} + +//// [funduleUsedAcrossFileBoundary_file2.ts] +function promiseWithCancellation(promise: Q.Promise) { + var deferred = Q.defer(); // used to be an error +} + +//// [funduleUsedAcrossFileBoundary_file1.js] +//// [funduleUsedAcrossFileBoundary_file2.js] +function promiseWithCancellation(promise) { + var deferred = Q.defer(); +} diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt new file mode 100644 index 0000000000000..dfe667b5be906 --- /dev/null +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/fuzzy.ts (3 errors) ==== + module M { + export interface I { + works:()=>R; + alsoWorks:()=>R; + doesntWork:()=>R; + } + + export interface R { + anything:number; + oneI:I; + } + + export class C implements I { + ~ +!!! Class 'C' incorrectly implements interface 'I': +!!! Property 'alsoWorks' is missing in type 'C'. + constructor(public x:number) { + } + works():R { + return ({ anything: 1 }); + } + + doesntWork():R { + return { anything:1, oneI:this }; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ anything: number; oneI: C; }' is not assignable to type 'R': +!!! Types of property 'oneI' are incompatible: +!!! Type 'C' is not assignable to type 'I'. + } + + worksToo():R { + return ({ oneI: this }); + ~~~~~~~~~~~~~~~~~~~ +!!! Neither type 'R' nor type '{ oneI: C; }' is assignable to the other. + } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.js b/tests/baselines/reference/fuzzy.js new file mode 100644 index 0000000000000..b98a9ced1074d --- /dev/null +++ b/tests/baselines/reference/fuzzy.js @@ -0,0 +1,52 @@ +//// [fuzzy.ts] +module M { + export interface I { + works:()=>R; + alsoWorks:()=>R; + doesntWork:()=>R; + } + + export interface R { + anything:number; + oneI:I; + } + + export class C implements I { + constructor(public x:number) { + } + works():R { + return ({ anything: 1 }); + } + + doesntWork():R { + return { anything:1, oneI:this }; + } + + worksToo():R { + return ({ oneI: this }); + } + } +} + + + +//// [fuzzy.js] +var M; +(function (M) { + var C = (function () { + function C(x) { + this.x = x; + } + C.prototype.works = function () { + return ({ anything: 1 }); + }; + C.prototype.doesntWork = function () { + return { anything: 1, oneI: this }; + }; + C.prototype.worksToo = function () { + return ({ oneI: this }); + }; + return C; + })(); + M.C = C; +})(M || (M = {})); diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js new file mode 100644 index 0000000000000..ddba62543b5a6 --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -0,0 +1,1991 @@ +//// [generatedContextualTyping.ts] +class Base { private p; } +class Derived1 extends Base { private m; } +class Derived2 extends Base { private n; } +interface Genric { func(n: T[]); } +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +var x1: () => Base[] = () => [d1, d2]; +var x2: () => Base[] = function() { return [d1, d2] }; +var x3: () => Base[] = function named() { return [d1, d2] }; +var x4: { (): Base[]; } = () => [d1, d2]; +var x5: { (): Base[]; } = function() { return [d1, d2] }; +var x6: { (): Base[]; } = function named() { return [d1, d2] }; +var x7: Base[] = [d1, d2]; +var x8: Array = [d1, d2]; +var x9: { [n: number]: Base; } = [d1, d2]; +var x10: {n: Base[]; } = { n: [d1, d2] }; +var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; +var x12: Genric = { func: n => { return [d1, d2]; } }; +class x13 { member: () => Base[] = () => [d1, d2] } +class x14 { member: () => Base[] = function() { return [d1, d2] } } +class x15 { member: () => Base[] = function named() { return [d1, d2] } } +class x16 { member: { (): Base[]; } = () => [d1, d2] } +class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } +class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } +class x19 { member: Base[] = [d1, d2] } +class x20 { member: Array = [d1, d2] } +class x21 { member: { [n: number]: Base; } = [d1, d2] } +class x22 { member: {n: Base[]; } = { n: [d1, d2] } } +class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x24 { member: Genric = { func: n => { return [d1, d2]; } } } +class x25 { private member: () => Base[] = () => [d1, d2] } +class x26 { private member: () => Base[] = function() { return [d1, d2] } } +class x27 { private member: () => Base[] = function named() { return [d1, d2] } } +class x28 { private member: { (): Base[]; } = () => [d1, d2] } +class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } +class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } +class x31 { private member: Base[] = [d1, d2] } +class x32 { private member: Array = [d1, d2] } +class x33 { private member: { [n: number]: Base; } = [d1, d2] } +class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } +class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } +class x37 { public member: () => Base[] = () => [d1, d2] } +class x38 { public member: () => Base[] = function() { return [d1, d2] } } +class x39 { public member: () => Base[] = function named() { return [d1, d2] } } +class x40 { public member: { (): Base[]; } = () => [d1, d2] } +class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } +class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } +class x43 { public member: Base[] = [d1, d2] } +class x44 { public member: Array = [d1, d2] } +class x45 { public member: { [n: number]: Base; } = [d1, d2] } +class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } +class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } +class x49 { static member: () => Base[] = () => [d1, d2] } +class x50 { static member: () => Base[] = function() { return [d1, d2] } } +class x51 { static member: () => Base[] = function named() { return [d1, d2] } } +class x52 { static member: { (): Base[]; } = () => [d1, d2] } +class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } +class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } +class x55 { static member: Base[] = [d1, d2] } +class x56 { static member: Array = [d1, d2] } +class x57 { static member: { [n: number]: Base; } = [d1, d2] } +class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } +class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } +class x61 { private static member: () => Base[] = () => [d1, d2] } +class x62 { private static member: () => Base[] = function() { return [d1, d2] } } +class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } +class x64 { private static member: { (): Base[]; } = () => [d1, d2] } +class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } +class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } +class x67 { private static member: Base[] = [d1, d2] } +class x68 { private static member: Array = [d1, d2] } +class x69 { private static member: { [n: number]: Base; } = [d1, d2] } +class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } +class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } +class x73 { public static member: () => Base[] = () => [d1, d2] } +class x74 { public static member: () => Base[] = function() { return [d1, d2] } } +class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } +class x76 { public static member: { (): Base[]; } = () => [d1, d2] } +class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } +class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } +class x79 { public static member: Base[] = [d1, d2] } +class x80 { public static member: Array = [d1, d2] } +class x81 { public static member: { [n: number]: Base; } = [d1, d2] } +class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } +class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } +class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } +class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } +class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } +class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } +class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +class x91 { constructor(parm: Base[] = [d1, d2]) { } } +class x92 { constructor(parm: Array = [d1, d2]) { } } +class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } +class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } +class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } +class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } +class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } +class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } +class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } +class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +class x103 { constructor(public parm: Base[] = [d1, d2]) { } } +class x104 { constructor(public parm: Array = [d1, d2]) { } } +class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } +class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } +class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } +class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } +class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } +class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } +class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } +class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +class x115 { constructor(private parm: Base[] = [d1, d2]) { } } +class x116 { constructor(private parm: Array = [d1, d2]) { } } +class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } +class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } +class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } +function x121(parm: () => Base[] = () => [d1, d2]) { } +function x122(parm: () => Base[] = function() { return [d1, d2] }) { } +function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } +function x124(parm: { (): Base[]; } = () => [d1, d2]) { } +function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } +function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } +function x127(parm: Base[] = [d1, d2]) { } +function x128(parm: Array = [d1, d2]) { } +function x129(parm: { [n: number]: Base; } = [d1, d2]) { } +function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } +function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } +function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } +function x133(): () => Base[] { return () => [d1, d2]; } +function x134(): () => Base[] { return function() { return [d1, d2] }; } +function x135(): () => Base[] { return function named() { return [d1, d2] }; } +function x136(): { (): Base[]; } { return () => [d1, d2]; } +function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } +function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } +function x139(): Base[] { return [d1, d2]; } +function x140(): Array { return [d1, d2]; } +function x141(): { [n: number]: Base; } { return [d1, d2]; } +function x142(): {n: Base[]; } { return { n: [d1, d2] }; } +function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } +function x144(): Genric { return { func: n => { return [d1, d2]; } }; } +function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } +function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } +function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +function x151(): Base[] { return [d1, d2]; return [d1, d2]; } +function x152(): Array { return [d1, d2]; return [d1, d2]; } +function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } +function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } +function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } +function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } +var x157: () => () => Base[] = () => { return () => [d1, d2]; }; +var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; +var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; +var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; +var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; +var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; +var x163: () => Base[] = () => { return [d1, d2]; }; +var x164: () => Array = () => { return [d1, d2]; }; +var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; +var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; +var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; +var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; +var x169: () => () => Base[] = function() { return () => [d1, d2]; }; +var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; +var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; +var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; +var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; +var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; +var x175: () => Base[] = function() { return [d1, d2]; }; +var x176: () => Array = function() { return [d1, d2]; }; +var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; +var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; +var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; +var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; +module x181 { var t: () => Base[] = () => [d1, d2]; } +module x182 { var t: () => Base[] = function() { return [d1, d2] }; } +module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } +module x184 { var t: { (): Base[]; } = () => [d1, d2]; } +module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } +module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } +module x187 { var t: Base[] = [d1, d2]; } +module x188 { var t: Array = [d1, d2]; } +module x189 { var t: { [n: number]: Base; } = [d1, d2]; } +module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } +module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } +module x193 { export var t: () => Base[] = () => [d1, d2]; } +module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } +module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } +module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } +module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } +module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } +module x199 { export var t: Base[] = [d1, d2]; } +module x200 { export var t: Array = [d1, d2]; } +module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } +module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } +module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } +var x206 = <() => Base[]>function() { return [d1, d2] }; +var x207 = <() => Base[]>function named() { return [d1, d2] }; +var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; +var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; +var x211 = [d1, d2]; +var x212 = >[d1, d2]; +var x213 = <{ [n: number]: Base; }>[d1, d2]; +var x214 = <{n: Base[]; } >{ n: [d1, d2] }; +var x216 = >{ func: n => { return [d1, d2]; } }; +var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; +var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; +var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; +var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; +var x221 = (undefined) || [d1, d2]; +var x222 = (>undefined) || [d1, d2]; +var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; +var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; +var x225: () => Base[]; x225 = () => [d1, d2]; +var x226: () => Base[]; x226 = function() { return [d1, d2] }; +var x227: () => Base[]; x227 = function named() { return [d1, d2] }; +var x228: { (): Base[]; }; x228 = () => [d1, d2]; +var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; +var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; +var x231: Base[]; x231 = [d1, d2]; +var x232: Array; x232 = [d1, d2]; +var x233: { [n: number]: Base; }; x233 = [d1, d2]; +var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; +var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; +var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; +var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; +var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; +var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; +var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; +var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; +var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; +var x243: { n: Base[]; } = { n: [d1, d2] }; +var x244: { n: Array; } = { n: [d1, d2] }; +var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; +var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; +var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; +var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; +var x252: { (): Base[]; }[] = [() => [d1, d2]]; +var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; +var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; +var x255: Base[][] = [[d1, d2]]; +var x256: Array[] = [[d1, d2]]; +var x257: { [n: number]: Base; }[] = [[d1, d2]]; +var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; +var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; +var x261: () => Base[] = function() { return [d1, d2] } || undefined; +var x262: () => Base[] = function named() { return [d1, d2] } || undefined; +var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; +var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; +var x265: Base[] = [d1, d2] || undefined; +var x266: Array = [d1, d2] || undefined; +var x267: { [n: number]: Base; } = [d1, d2] || undefined; +var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; +var x269: () => Base[] = undefined || function() { return [d1, d2] }; +var x270: () => Base[] = undefined || function named() { return [d1, d2] }; +var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; +var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; +var x273: Base[] = undefined || [d1, d2]; +var x274: Array = undefined || [d1, d2]; +var x275: { [n: number]: Base; } = undefined || [d1, d2]; +var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; +var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; +var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; +var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +var x281: Base[] = [d1, d2] || [d1, d2]; +var x282: Array = [d1, d2] || [d1, d2]; +var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; +var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; +var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; +var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; +var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +var x291: Base[] = true ? [d1, d2] : [d1, d2]; +var x292: Array = true ? [d1, d2] : [d1, d2]; +var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; +var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; +var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; +var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; +var x297: () => Base[] = true ? undefined : () => [d1, d2]; +var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; +var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; +var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; +var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; +var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; +var x303: Base[] = true ? undefined : [d1, d2]; +var x304: Array = true ? undefined : [d1, d2]; +var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; +var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; +var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; +var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; +var x309: () => Base[] = true ? () => [d1, d2] : undefined; +var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; +var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; +var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; +var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; +var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; +var x315: Base[] = true ? [d1, d2] : undefined; +var x316: Array = true ? [d1, d2] : undefined; +var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; +var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; +var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; +var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; +function x321(n: () => Base[]) { }; x321(() => [d1, d2]); +function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); +function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); +function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); +function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); +function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); +function x327(n: Base[]) { }; x327([d1, d2]); +function x328(n: Array) { }; x328([d1, d2]); +function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); +function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); +function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); +function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); +var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); +var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); +var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); +var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); +var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); +var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); +var x339 = (n: Base[]) => n; x339([d1, d2]); +var x340 = (n: Array) => n; x340([d1, d2]); +var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); +var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); +var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); +var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); +var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); +var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); +var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); +var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); +var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); +var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); +var x351 = function(n: Base[]) { }; x351([d1, d2]); +var x352 = function(n: Array) { }; x352([d1, d2]); +var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); +var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); +var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); +var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); + +//// [generatedContextualTyping.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +var x1 = function () { return [d1, d2]; }; +var x2 = function () { + return [d1, d2]; +}; +var x3 = function named() { + return [d1, d2]; +}; +var x4 = function () { return [d1, d2]; }; +var x5 = function () { + return [d1, d2]; +}; +var x6 = function named() { + return [d1, d2]; +}; +var x7 = [d1, d2]; +var x8 = [d1, d2]; +var x9 = [d1, d2]; +var x10 = { n: [d1, d2] }; +var x11 = function (n) { + var n; + return null; +}; +var x12 = { func: function (n) { + return [d1, d2]; +} }; +var x13 = (function () { + function x13() { + this.member = function () { return [d1, d2]; }; + } + return x13; +})(); +var x14 = (function () { + function x14() { + this.member = function () { + return [d1, d2]; + }; + } + return x14; +})(); +var x15 = (function () { + function x15() { + this.member = function named() { + return [d1, d2]; + }; + } + return x15; +})(); +var x16 = (function () { + function x16() { + this.member = function () { return [d1, d2]; }; + } + return x16; +})(); +var x17 = (function () { + function x17() { + this.member = function () { + return [d1, d2]; + }; + } + return x17; +})(); +var x18 = (function () { + function x18() { + this.member = function named() { + return [d1, d2]; + }; + } + return x18; +})(); +var x19 = (function () { + function x19() { + this.member = [d1, d2]; + } + return x19; +})(); +var x20 = (function () { + function x20() { + this.member = [d1, d2]; + } + return x20; +})(); +var x21 = (function () { + function x21() { + this.member = [d1, d2]; + } + return x21; +})(); +var x22 = (function () { + function x22() { + this.member = { n: [d1, d2] }; + } + return x22; +})(); +var x23 = (function () { + function x23() { + this.member = function (n) { + var n; + return null; + }; + } + return x23; +})(); +var x24 = (function () { + function x24() { + this.member = { func: function (n) { + return [d1, d2]; + } }; + } + return x24; +})(); +var x25 = (function () { + function x25() { + this.member = function () { return [d1, d2]; }; + } + return x25; +})(); +var x26 = (function () { + function x26() { + this.member = function () { + return [d1, d2]; + }; + } + return x26; +})(); +var x27 = (function () { + function x27() { + this.member = function named() { + return [d1, d2]; + }; + } + return x27; +})(); +var x28 = (function () { + function x28() { + this.member = function () { return [d1, d2]; }; + } + return x28; +})(); +var x29 = (function () { + function x29() { + this.member = function () { + return [d1, d2]; + }; + } + return x29; +})(); +var x30 = (function () { + function x30() { + this.member = function named() { + return [d1, d2]; + }; + } + return x30; +})(); +var x31 = (function () { + function x31() { + this.member = [d1, d2]; + } + return x31; +})(); +var x32 = (function () { + function x32() { + this.member = [d1, d2]; + } + return x32; +})(); +var x33 = (function () { + function x33() { + this.member = [d1, d2]; + } + return x33; +})(); +var x34 = (function () { + function x34() { + this.member = { n: [d1, d2] }; + } + return x34; +})(); +var x35 = (function () { + function x35() { + this.member = function (n) { + var n; + return null; + }; + } + return x35; +})(); +var x36 = (function () { + function x36() { + this.member = { func: function (n) { + return [d1, d2]; + } }; + } + return x36; +})(); +var x37 = (function () { + function x37() { + this.member = function () { return [d1, d2]; }; + } + return x37; +})(); +var x38 = (function () { + function x38() { + this.member = function () { + return [d1, d2]; + }; + } + return x38; +})(); +var x39 = (function () { + function x39() { + this.member = function named() { + return [d1, d2]; + }; + } + return x39; +})(); +var x40 = (function () { + function x40() { + this.member = function () { return [d1, d2]; }; + } + return x40; +})(); +var x41 = (function () { + function x41() { + this.member = function () { + return [d1, d2]; + }; + } + return x41; +})(); +var x42 = (function () { + function x42() { + this.member = function named() { + return [d1, d2]; + }; + } + return x42; +})(); +var x43 = (function () { + function x43() { + this.member = [d1, d2]; + } + return x43; +})(); +var x44 = (function () { + function x44() { + this.member = [d1, d2]; + } + return x44; +})(); +var x45 = (function () { + function x45() { + this.member = [d1, d2]; + } + return x45; +})(); +var x46 = (function () { + function x46() { + this.member = { n: [d1, d2] }; + } + return x46; +})(); +var x47 = (function () { + function x47() { + this.member = function (n) { + var n; + return null; + }; + } + return x47; +})(); +var x48 = (function () { + function x48() { + this.member = { func: function (n) { + return [d1, d2]; + } }; + } + return x48; +})(); +var x49 = (function () { + function x49() { + } + x49.member = function () { return [d1, d2]; }; + return x49; +})(); +var x50 = (function () { + function x50() { + } + x50.member = function () { + return [d1, d2]; + }; + return x50; +})(); +var x51 = (function () { + function x51() { + } + x51.member = function named() { + return [d1, d2]; + }; + return x51; +})(); +var x52 = (function () { + function x52() { + } + x52.member = function () { return [d1, d2]; }; + return x52; +})(); +var x53 = (function () { + function x53() { + } + x53.member = function () { + return [d1, d2]; + }; + return x53; +})(); +var x54 = (function () { + function x54() { + } + x54.member = function named() { + return [d1, d2]; + }; + return x54; +})(); +var x55 = (function () { + function x55() { + } + x55.member = [d1, d2]; + return x55; +})(); +var x56 = (function () { + function x56() { + } + x56.member = [d1, d2]; + return x56; +})(); +var x57 = (function () { + function x57() { + } + x57.member = [d1, d2]; + return x57; +})(); +var x58 = (function () { + function x58() { + } + x58.member = { n: [d1, d2] }; + return x58; +})(); +var x59 = (function () { + function x59() { + } + x59.member = function (n) { + var n; + return null; + }; + return x59; +})(); +var x60 = (function () { + function x60() { + } + x60.member = { func: function (n) { + return [d1, d2]; + } }; + return x60; +})(); +var x61 = (function () { + function x61() { + } + x61.member = function () { return [d1, d2]; }; + return x61; +})(); +var x62 = (function () { + function x62() { + } + x62.member = function () { + return [d1, d2]; + }; + return x62; +})(); +var x63 = (function () { + function x63() { + } + x63.member = function named() { + return [d1, d2]; + }; + return x63; +})(); +var x64 = (function () { + function x64() { + } + x64.member = function () { return [d1, d2]; }; + return x64; +})(); +var x65 = (function () { + function x65() { + } + x65.member = function () { + return [d1, d2]; + }; + return x65; +})(); +var x66 = (function () { + function x66() { + } + x66.member = function named() { + return [d1, d2]; + }; + return x66; +})(); +var x67 = (function () { + function x67() { + } + x67.member = [d1, d2]; + return x67; +})(); +var x68 = (function () { + function x68() { + } + x68.member = [d1, d2]; + return x68; +})(); +var x69 = (function () { + function x69() { + } + x69.member = [d1, d2]; + return x69; +})(); +var x70 = (function () { + function x70() { + } + x70.member = { n: [d1, d2] }; + return x70; +})(); +var x71 = (function () { + function x71() { + } + x71.member = function (n) { + var n; + return null; + }; + return x71; +})(); +var x72 = (function () { + function x72() { + } + x72.member = { func: function (n) { + return [d1, d2]; + } }; + return x72; +})(); +var x73 = (function () { + function x73() { + } + x73.member = function () { return [d1, d2]; }; + return x73; +})(); +var x74 = (function () { + function x74() { + } + x74.member = function () { + return [d1, d2]; + }; + return x74; +})(); +var x75 = (function () { + function x75() { + } + x75.member = function named() { + return [d1, d2]; + }; + return x75; +})(); +var x76 = (function () { + function x76() { + } + x76.member = function () { return [d1, d2]; }; + return x76; +})(); +var x77 = (function () { + function x77() { + } + x77.member = function () { + return [d1, d2]; + }; + return x77; +})(); +var x78 = (function () { + function x78() { + } + x78.member = function named() { + return [d1, d2]; + }; + return x78; +})(); +var x79 = (function () { + function x79() { + } + x79.member = [d1, d2]; + return x79; +})(); +var x80 = (function () { + function x80() { + } + x80.member = [d1, d2]; + return x80; +})(); +var x81 = (function () { + function x81() { + } + x81.member = [d1, d2]; + return x81; +})(); +var x82 = (function () { + function x82() { + } + x82.member = { n: [d1, d2] }; + return x82; +})(); +var x83 = (function () { + function x83() { + } + x83.member = function (n) { + var n; + return null; + }; + return x83; +})(); +var x84 = (function () { + function x84() { + } + x84.member = { func: function (n) { + return [d1, d2]; + } }; + return x84; +})(); +var x85 = (function () { + function x85(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + } + return x85; +})(); +var x86 = (function () { + function x86(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + } + return x86; +})(); +var x87 = (function () { + function x87(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + } + return x87; +})(); +var x88 = (function () { + function x88(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + } + return x88; +})(); +var x89 = (function () { + function x89(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + } + return x89; +})(); +var x90 = (function () { + function x90(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + } + return x90; +})(); +var x91 = (function () { + function x91(parm) { + if (parm === void 0) { parm = [d1, d2]; } + } + return x91; +})(); +var x92 = (function () { + function x92(parm) { + if (parm === void 0) { parm = [d1, d2]; } + } + return x92; +})(); +var x93 = (function () { + function x93(parm) { + if (parm === void 0) { parm = [d1, d2]; } + } + return x93; +})(); +var x94 = (function () { + function x94(parm) { + if (parm === void 0) { parm = { n: [d1, d2] }; } + } + return x94; +})(); +var x95 = (function () { + function x95(parm) { + if (parm === void 0) { parm = function (n) { + var n; + return null; + }; } + } + return x95; +})(); +var x96 = (function () { + function x96(parm) { + if (parm === void 0) { parm = { func: function (n) { + return [d1, d2]; + } }; } + } + return x96; +})(); +var x97 = (function () { + function x97(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + this.parm = parm; + } + return x97; +})(); +var x98 = (function () { + function x98(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + this.parm = parm; + } + return x98; +})(); +var x99 = (function () { + function x99(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + this.parm = parm; + } + return x99; +})(); +var x100 = (function () { + function x100(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + this.parm = parm; + } + return x100; +})(); +var x101 = (function () { + function x101(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + this.parm = parm; + } + return x101; +})(); +var x102 = (function () { + function x102(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + this.parm = parm; + } + return x102; +})(); +var x103 = (function () { + function x103(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x103; +})(); +var x104 = (function () { + function x104(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x104; +})(); +var x105 = (function () { + function x105(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x105; +})(); +var x106 = (function () { + function x106(parm) { + if (parm === void 0) { parm = { n: [d1, d2] }; } + this.parm = parm; + } + return x106; +})(); +var x107 = (function () { + function x107(parm) { + if (parm === void 0) { parm = function (n) { + var n; + return null; + }; } + this.parm = parm; + } + return x107; +})(); +var x108 = (function () { + function x108(parm) { + if (parm === void 0) { parm = { func: function (n) { + return [d1, d2]; + } }; } + this.parm = parm; + } + return x108; +})(); +var x109 = (function () { + function x109(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + this.parm = parm; + } + return x109; +})(); +var x110 = (function () { + function x110(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + this.parm = parm; + } + return x110; +})(); +var x111 = (function () { + function x111(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + this.parm = parm; + } + return x111; +})(); +var x112 = (function () { + function x112(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } + this.parm = parm; + } + return x112; +})(); +var x113 = (function () { + function x113(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } + this.parm = parm; + } + return x113; +})(); +var x114 = (function () { + function x114(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } + this.parm = parm; + } + return x114; +})(); +var x115 = (function () { + function x115(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x115; +})(); +var x116 = (function () { + function x116(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x116; +})(); +var x117 = (function () { + function x117(parm) { + if (parm === void 0) { parm = [d1, d2]; } + this.parm = parm; + } + return x117; +})(); +var x118 = (function () { + function x118(parm) { + if (parm === void 0) { parm = { n: [d1, d2] }; } + this.parm = parm; + } + return x118; +})(); +var x119 = (function () { + function x119(parm) { + if (parm === void 0) { parm = function (n) { + var n; + return null; + }; } + this.parm = parm; + } + return x119; +})(); +var x120 = (function () { + function x120(parm) { + if (parm === void 0) { parm = { func: function (n) { + return [d1, d2]; + } }; } + this.parm = parm; + } + return x120; +})(); +function x121(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } +} +function x122(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } +} +function x123(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } +} +function x124(parm) { + if (parm === void 0) { parm = function () { return [d1, d2]; }; } +} +function x125(parm) { + if (parm === void 0) { parm = function () { + return [d1, d2]; + }; } +} +function x126(parm) { + if (parm === void 0) { parm = function named() { + return [d1, d2]; + }; } +} +function x127(parm) { + if (parm === void 0) { parm = [d1, d2]; } +} +function x128(parm) { + if (parm === void 0) { parm = [d1, d2]; } +} +function x129(parm) { + if (parm === void 0) { parm = [d1, d2]; } +} +function x130(parm) { + if (parm === void 0) { parm = { n: [d1, d2] }; } +} +function x131(parm) { + if (parm === void 0) { parm = function (n) { + var n; + return null; + }; } +} +function x132(parm) { + if (parm === void 0) { parm = { func: function (n) { + return [d1, d2]; + } }; } +} +function x133() { + return function () { return [d1, d2]; }; +} +function x134() { + return function () { + return [d1, d2]; + }; +} +function x135() { + return function named() { + return [d1, d2]; + }; +} +function x136() { + return function () { return [d1, d2]; }; +} +function x137() { + return function () { + return [d1, d2]; + }; +} +function x138() { + return function named() { + return [d1, d2]; + }; +} +function x139() { + return [d1, d2]; +} +function x140() { + return [d1, d2]; +} +function x141() { + return [d1, d2]; +} +function x142() { + return { n: [d1, d2] }; +} +function x143() { + return function (n) { + var n; + return null; + }; +} +function x144() { + return { func: function (n) { + return [d1, d2]; + } }; +} +function x145() { + return function () { return [d1, d2]; }; + return function () { return [d1, d2]; }; +} +function x146() { + return function () { + return [d1, d2]; + }; + return function () { + return [d1, d2]; + }; +} +function x147() { + return function named() { + return [d1, d2]; + }; + return function named() { + return [d1, d2]; + }; +} +function x148() { + return function () { return [d1, d2]; }; + return function () { return [d1, d2]; }; +} +function x149() { + return function () { + return [d1, d2]; + }; + return function () { + return [d1, d2]; + }; +} +function x150() { + return function named() { + return [d1, d2]; + }; + return function named() { + return [d1, d2]; + }; +} +function x151() { + return [d1, d2]; + return [d1, d2]; +} +function x152() { + return [d1, d2]; + return [d1, d2]; +} +function x153() { + return [d1, d2]; + return [d1, d2]; +} +function x154() { + return { n: [d1, d2] }; + return { n: [d1, d2] }; +} +function x155() { + return function (n) { + var n; + return null; + }; + return function (n) { + var n; + return null; + }; +} +function x156() { + return { func: function (n) { + return [d1, d2]; + } }; + return { func: function (n) { + return [d1, d2]; + } }; +} +var x157 = function () { + return function () { return [d1, d2]; }; +}; +var x158 = function () { + return function () { + return [d1, d2]; + }; +}; +var x159 = function () { + return function named() { + return [d1, d2]; + }; +}; +var x160 = function () { + return function () { return [d1, d2]; }; +}; +var x161 = function () { + return function () { + return [d1, d2]; + }; +}; +var x162 = function () { + return function named() { + return [d1, d2]; + }; +}; +var x163 = function () { + return [d1, d2]; +}; +var x164 = function () { + return [d1, d2]; +}; +var x165 = function () { + return [d1, d2]; +}; +var x166 = function () { + return { n: [d1, d2] }; +}; +var x167 = function () { + return function (n) { + var n; + return null; + }; +}; +var x168 = function () { + return { func: function (n) { + return [d1, d2]; + } }; +}; +var x169 = function () { + return function () { return [d1, d2]; }; +}; +var x170 = function () { + return function () { + return [d1, d2]; + }; +}; +var x171 = function () { + return function named() { + return [d1, d2]; + }; +}; +var x172 = function () { + return function () { return [d1, d2]; }; +}; +var x173 = function () { + return function () { + return [d1, d2]; + }; +}; +var x174 = function () { + return function named() { + return [d1, d2]; + }; +}; +var x175 = function () { + return [d1, d2]; +}; +var x176 = function () { + return [d1, d2]; +}; +var x177 = function () { + return [d1, d2]; +}; +var x178 = function () { + return { n: [d1, d2] }; +}; +var x179 = function () { + return function (n) { + var n; + return null; + }; +}; +var x180 = function () { + return { func: function (n) { + return [d1, d2]; + } }; +}; +var x181; +(function (x181) { + var t = function () { return [d1, d2]; }; +})(x181 || (x181 = {})); +var x182; +(function (x182) { + var t = function () { + return [d1, d2]; + }; +})(x182 || (x182 = {})); +var x183; +(function (x183) { + var t = function named() { + return [d1, d2]; + }; +})(x183 || (x183 = {})); +var x184; +(function (x184) { + var t = function () { return [d1, d2]; }; +})(x184 || (x184 = {})); +var x185; +(function (x185) { + var t = function () { + return [d1, d2]; + }; +})(x185 || (x185 = {})); +var x186; +(function (x186) { + var t = function named() { + return [d1, d2]; + }; +})(x186 || (x186 = {})); +var x187; +(function (x187) { + var t = [d1, d2]; +})(x187 || (x187 = {})); +var x188; +(function (x188) { + var t = [d1, d2]; +})(x188 || (x188 = {})); +var x189; +(function (x189) { + var t = [d1, d2]; +})(x189 || (x189 = {})); +var x190; +(function (x190) { + var t = { n: [d1, d2] }; +})(x190 || (x190 = {})); +var x191; +(function (x191) { + var t = function (n) { + var n; + return null; + }; +})(x191 || (x191 = {})); +var x192; +(function (x192) { + var t = { func: function (n) { + return [d1, d2]; + } }; +})(x192 || (x192 = {})); +var x193; +(function (x193) { + x193.t = function () { return [d1, d2]; }; +})(x193 || (x193 = {})); +var x194; +(function (x194) { + x194.t = function () { + return [d1, d2]; + }; +})(x194 || (x194 = {})); +var x195; +(function (x195) { + x195.t = function named() { + return [d1, d2]; + }; +})(x195 || (x195 = {})); +var x196; +(function (x196) { + x196.t = function () { return [d1, d2]; }; +})(x196 || (x196 = {})); +var x197; +(function (x197) { + x197.t = function () { + return [d1, d2]; + }; +})(x197 || (x197 = {})); +var x198; +(function (x198) { + x198.t = function named() { + return [d1, d2]; + }; +})(x198 || (x198 = {})); +var x199; +(function (x199) { + x199.t = [d1, d2]; +})(x199 || (x199 = {})); +var x200; +(function (x200) { + x200.t = [d1, d2]; +})(x200 || (x200 = {})); +var x201; +(function (x201) { + x201.t = [d1, d2]; +})(x201 || (x201 = {})); +var x202; +(function (x202) { + x202.t = { n: [d1, d2] }; +})(x202 || (x202 = {})); +var x203; +(function (x203) { + x203.t = function (n) { + var n; + return null; + }; +})(x203 || (x203 = {})); +var x204; +(function (x204) { + x204.t = { func: function (n) { + return [d1, d2]; + } }; +})(x204 || (x204 = {})); +var x206 = function () { + return [d1, d2]; +}; +var x207 = function named() { + return [d1, d2]; +}; +var x209 = function () { + return [d1, d2]; +}; +var x210 = function named() { + return [d1, d2]; +}; +var x211 = [d1, d2]; +var x212 = [d1, d2]; +var x213 = [d1, d2]; +var x214 = { n: [d1, d2] }; +var x216 = { func: function (n) { + return [d1, d2]; +} }; +var x217 = undefined || function () { + return [d1, d2]; +}; +var x218 = undefined || function named() { + return [d1, d2]; +}; +var x219 = undefined || function () { + return [d1, d2]; +}; +var x220 = undefined || function named() { + return [d1, d2]; +}; +var x221 = undefined || [d1, d2]; +var x222 = undefined || [d1, d2]; +var x223 = undefined || [d1, d2]; +var x224 = undefined || { n: [d1, d2] }; +var x225; +x225 = function () { return [d1, d2]; }; +var x226; +x226 = function () { + return [d1, d2]; +}; +var x227; +x227 = function named() { + return [d1, d2]; +}; +var x228; +x228 = function () { return [d1, d2]; }; +var x229; +x229 = function () { + return [d1, d2]; +}; +var x230; +x230 = function named() { + return [d1, d2]; +}; +var x231; +x231 = [d1, d2]; +var x232; +x232 = [d1, d2]; +var x233; +x233 = [d1, d2]; +var x234; +x234 = { n: [d1, d2] }; +var x235; +x235 = function (n) { + var n; + return null; +}; +var x236; +x236 = { func: function (n) { + return [d1, d2]; +} }; +var x237 = { n: function () { return [d1, d2]; } }; +var x238 = { n: function () { + return [d1, d2]; +} }; +var x239 = { n: function named() { + return [d1, d2]; +} }; +var x240 = { n: function () { return [d1, d2]; } }; +var x241 = { n: function () { + return [d1, d2]; +} }; +var x242 = { n: function named() { + return [d1, d2]; +} }; +var x243 = { n: [d1, d2] }; +var x244 = { n: [d1, d2] }; +var x245 = { n: [d1, d2] }; +var x246 = { n: { n: [d1, d2] } }; +var x247 = { n: function (n) { + var n; + return null; +} }; +var x248 = { n: { func: function (n) { + return [d1, d2]; +} } }; +var x252 = [function () { return [d1, d2]; }]; +var x253 = [function () { + return [d1, d2]; +}]; +var x254 = [function named() { + return [d1, d2]; +}]; +var x255 = [[d1, d2]]; +var x256 = [[d1, d2]]; +var x257 = [[d1, d2]]; +var x258 = [{ n: [d1, d2] }]; +var x260 = [{ func: function (n) { + return [d1, d2]; +} }]; +var x261 = function () { + return [d1, d2]; +} || undefined; +var x262 = function named() { + return [d1, d2]; +} || undefined; +var x263 = function () { + return [d1, d2]; +} || undefined; +var x264 = function named() { + return [d1, d2]; +} || undefined; +var x265 = [d1, d2] || undefined; +var x266 = [d1, d2] || undefined; +var x267 = [d1, d2] || undefined; +var x268 = { n: [d1, d2] } || undefined; +var x269 = undefined || function () { + return [d1, d2]; +}; +var x270 = undefined || function named() { + return [d1, d2]; +}; +var x271 = undefined || function () { + return [d1, d2]; +}; +var x272 = undefined || function named() { + return [d1, d2]; +}; +var x273 = undefined || [d1, d2]; +var x274 = undefined || [d1, d2]; +var x275 = undefined || [d1, d2]; +var x276 = undefined || { n: [d1, d2] }; +var x277 = function () { + return [d1, d2]; +} || function () { + return [d1, d2]; +}; +var x278 = function named() { + return [d1, d2]; +} || function named() { + return [d1, d2]; +}; +var x279 = function () { + return [d1, d2]; +} || function () { + return [d1, d2]; +}; +var x280 = function named() { + return [d1, d2]; +} || function named() { + return [d1, d2]; +}; +var x281 = [d1, d2] || [d1, d2]; +var x282 = [d1, d2] || [d1, d2]; +var x283 = [d1, d2] || [d1, d2]; +var x284 = { n: [d1, d2] } || { n: [d1, d2] }; +var x285 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x286 = true ? function () { + return [d1, d2]; +} : function () { + return [d1, d2]; +}; +var x287 = true ? function named() { + return [d1, d2]; +} : function named() { + return [d1, d2]; +}; +var x288 = true ? function () { return [d1, d2]; } : function () { return [d1, d2]; }; +var x289 = true ? function () { + return [d1, d2]; +} : function () { + return [d1, d2]; +}; +var x290 = true ? function named() { + return [d1, d2]; +} : function named() { + return [d1, d2]; +}; +var x291 = true ? [d1, d2] : [d1, d2]; +var x292 = true ? [d1, d2] : [d1, d2]; +var x293 = true ? [d1, d2] : [d1, d2]; +var x294 = true ? { n: [d1, d2] } : { n: [d1, d2] }; +var x295 = true ? function (n) { + var n; + return null; +} : function (n) { + var n; + return null; +}; +var x296 = true ? { func: function (n) { + return [d1, d2]; +} } : { func: function (n) { + return [d1, d2]; +} }; +var x297 = true ? undefined : function () { return [d1, d2]; }; +var x298 = true ? undefined : function () { + return [d1, d2]; +}; +var x299 = true ? undefined : function named() { + return [d1, d2]; +}; +var x300 = true ? undefined : function () { return [d1, d2]; }; +var x301 = true ? undefined : function () { + return [d1, d2]; +}; +var x302 = true ? undefined : function named() { + return [d1, d2]; +}; +var x303 = true ? undefined : [d1, d2]; +var x304 = true ? undefined : [d1, d2]; +var x305 = true ? undefined : [d1, d2]; +var x306 = true ? undefined : { n: [d1, d2] }; +var x307 = true ? undefined : function (n) { + var n; + return null; +}; +var x308 = true ? undefined : { func: function (n) { + return [d1, d2]; +} }; +var x309 = true ? function () { return [d1, d2]; } : undefined; +var x310 = true ? function () { + return [d1, d2]; +} : undefined; +var x311 = true ? function named() { + return [d1, d2]; +} : undefined; +var x312 = true ? function () { return [d1, d2]; } : undefined; +var x313 = true ? function () { + return [d1, d2]; +} : undefined; +var x314 = true ? function named() { + return [d1, d2]; +} : undefined; +var x315 = true ? [d1, d2] : undefined; +var x316 = true ? [d1, d2] : undefined; +var x317 = true ? [d1, d2] : undefined; +var x318 = true ? { n: [d1, d2] } : undefined; +var x319 = true ? function (n) { + var n; + return null; +} : undefined; +var x320 = true ? { func: function (n) { + return [d1, d2]; +} } : undefined; +function x321(n) { +} +; +x321(function () { return [d1, d2]; }); +function x322(n) { +} +; +x322(function () { + return [d1, d2]; +}); +function x323(n) { +} +; +x323(function named() { + return [d1, d2]; +}); +function x324(n) { +} +; +x324(function () { return [d1, d2]; }); +function x325(n) { +} +; +x325(function () { + return [d1, d2]; +}); +function x326(n) { +} +; +x326(function named() { + return [d1, d2]; +}); +function x327(n) { +} +; +x327([d1, d2]); +function x328(n) { +} +; +x328([d1, d2]); +function x329(n) { +} +; +x329([d1, d2]); +function x330(n) { +} +; +x330({ n: [d1, d2] }); +function x331(n) { +} +; +x331(function (n) { + var n; + return null; +}); +function x332(n) { +} +; +x332({ func: function (n) { + return [d1, d2]; +} }); +var x333 = function (n) { return n; }; +x333(function () { return [d1, d2]; }); +var x334 = function (n) { return n; }; +x334(function () { + return [d1, d2]; +}); +var x335 = function (n) { return n; }; +x335(function named() { + return [d1, d2]; +}); +var x336 = function (n) { return n; }; +x336(function () { return [d1, d2]; }); +var x337 = function (n) { return n; }; +x337(function () { + return [d1, d2]; +}); +var x338 = function (n) { return n; }; +x338(function named() { + return [d1, d2]; +}); +var x339 = function (n) { return n; }; +x339([d1, d2]); +var x340 = function (n) { return n; }; +x340([d1, d2]); +var x341 = function (n) { return n; }; +x341([d1, d2]); +var x342 = function (n) { return n; }; +x342({ n: [d1, d2] }); +var x343 = function (n) { return n; }; +x343(function (n) { + var n; + return null; +}); +var x344 = function (n) { return n; }; +x344({ func: function (n) { + return [d1, d2]; +} }); +var x345 = function (n) { +}; +x345(function () { return [d1, d2]; }); +var x346 = function (n) { +}; +x346(function () { + return [d1, d2]; +}); +var x347 = function (n) { +}; +x347(function named() { + return [d1, d2]; +}); +var x348 = function (n) { +}; +x348(function () { return [d1, d2]; }); +var x349 = function (n) { +}; +x349(function () { + return [d1, d2]; +}); +var x350 = function (n) { +}; +x350(function named() { + return [d1, d2]; +}); +var x351 = function (n) { +}; +x351([d1, d2]); +var x352 = function (n) { +}; +x352([d1, d2]); +var x353 = function (n) { +}; +x353([d1, d2]); +var x354 = function (n) { +}; +x354({ n: [d1, d2] }); +var x355 = function (n) { +}; +x355(function (n) { + var n; + return null; +}); +var x356 = function (n) { +}; +x356({ func: function (n) { + return [d1, d2]; +} }); diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.js b/tests/baselines/reference/generativeRecursionWithTypeOf.js new file mode 100644 index 0000000000000..599751ebde7a3 --- /dev/null +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.js @@ -0,0 +1,27 @@ +//// [generativeRecursionWithTypeOf.ts] +class C { + static foo(x: number) { } + type: T; +} + +module M { + export function f(x: typeof C) { + return new x(); + } +} + +//// [generativeRecursionWithTypeOf.js] +var C = (function () { + function C() { + } + C.foo = function (x) { + }; + return C; +})(); +var M; +(function (M) { + function f(x) { + return new x(); + } + M.f = f; +})(M || (M = {})); diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt new file mode 100644 index 0000000000000..d07bbe81e1eb1 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName.ts (3 errors) ==== + // generic and non-generic interfaces with the same name do not merge + + interface A { + foo: string; + } + + interface A { // error + ~ +!!! All declarations of an interface must have identical type parameters. + bar: T; + } + + module M { + interface A { + bar: T; + } + + interface A { // error + ~ +!!! All declarations of an interface must have identical type parameters. + foo: string; + } + } + + module M2 { + interface A { + foo: string; + } + } + + module M2 { + interface A { // ok, different declaration space than other M2 + bar: T; + } + } + + module M3 { + export interface A { + foo: string; + } + } + + module M3 { + export interface A { // error + ~ +!!! All declarations of an interface must have identical type parameters. + bar: T; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.js b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.js new file mode 100644 index 0000000000000..14be1f5907b41 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.js @@ -0,0 +1,46 @@ +//// [genericAndNonGenericInterfaceWithTheSameName.ts] +// generic and non-generic interfaces with the same name do not merge + +interface A { + foo: string; +} + +interface A { // error + bar: T; +} + +module M { + interface A { + bar: T; + } + + interface A { // error + foo: string; + } +} + +module M2 { + interface A { + foo: string; + } +} + +module M2 { + interface A { // ok, different declaration space than other M2 + bar: T; + } +} + +module M3 { + export interface A { + foo: string; + } +} + +module M3 { + export interface A { // error + bar: T; + } +} + +//// [genericAndNonGenericInterfaceWithTheSameName.js] diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.js b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.js new file mode 100644 index 0000000000000..eed044a8ab9a7 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.js @@ -0,0 +1,30 @@ +//// [genericAndNonGenericInterfaceWithTheSameName2.ts] +// generic and non-generic interfaces with the same name do not merge + +module M { + interface A { + bar: T; + } +} + +module M2 { + interface A { // ok + foo: string; + } +} + +module N { + module M { + interface A { + bar: T; + } + } + + module M2 { + interface A { // ok + foo: string; + } + } +} + +//// [genericAndNonGenericInterfaceWithTheSameName2.js] diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.js b/tests/baselines/reference/genericAndNonGenericOverload1.js new file mode 100644 index 0000000000000..de459fbcf5f12 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericOverload1.js @@ -0,0 +1,11 @@ +//// [genericAndNonGenericOverload1.ts] +interface callable2 { + (a: T): T; + (a: T): Z; +} +var c2: callable2; +c2(1); + +//// [genericAndNonGenericOverload1.js] +var c2; +c2(1); diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js new file mode 100644 index 0000000000000..c08994e20dc5f --- /dev/null +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.js @@ -0,0 +1,25 @@ +//// [genericArgumentCallSigAssignmentCompat.ts] +module Underscore { + export interface Iterator { + (value: T, index: any, list: any): U; + } + + export interface Static { + all(list: T[], iterator?: Iterator, context?: any): boolean; + identity(value: T): T; + } +} + +declare var _: Underscore.Static; + +// No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. +// Ideally, we would not have a generic signature here, because it should be instantiated with {} during inferential typing +_.all([true, 1, null, 'yes'], _.identity); + +// Ok, because fixing makes us infer boolean for T +_.all([true], _.identity); + + +//// [genericArgumentCallSigAssignmentCompat.js] +_.all([true, 1, null, 'yes'], _.identity); +_.all([true], _.identity); diff --git a/tests/baselines/reference/genericArray0.js b/tests/baselines/reference/genericArray0.js new file mode 100644 index 0000000000000..8e073a5e010ac --- /dev/null +++ b/tests/baselines/reference/genericArray0.js @@ -0,0 +1,22 @@ +//// [genericArray0.ts] + + +var x:number[]; + + +var y = x; + +function map() { + var ys: U[] = []; +} + + +//// [genericArray0.js] +var x; +var y = x; +function map() { + var ys = []; +} + + +//// [genericArray0.d.ts] diff --git a/tests/baselines/reference/genericArray1.js b/tests/baselines/reference/genericArray1.js new file mode 100644 index 0000000000000..ca3f60285be75 --- /dev/null +++ b/tests/baselines/reference/genericArray1.js @@ -0,0 +1,21 @@ +//// [genericArray1.ts] +/* +var n: number[]; + +interface Array { +map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +} + +interface String{ + length: number; +} +*/ + +var lengths = ["a", "b", "c"].map(x => x.length); + + +//// [genericArray1.js] +var lengths = ["a", "b", "c"].map(function (x) { return x.length; }); + + +//// [genericArray1.d.ts] diff --git a/tests/baselines/reference/genericArrayAssignment1.errors.txt b/tests/baselines/reference/genericArrayAssignment1.errors.txt new file mode 100644 index 0000000000000..1b8d6cb2aab08 --- /dev/null +++ b/tests/baselines/reference/genericArrayAssignment1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/genericArrayAssignment1.ts (1 errors) ==== + var s: string[]; + var n: number[]; + + s = n; + ~ +!!! Type 'number[]' is not assignable to type 'string[]': +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayAssignment1.js b/tests/baselines/reference/genericArrayAssignment1.js new file mode 100644 index 0000000000000..1541967e1e0e4 --- /dev/null +++ b/tests/baselines/reference/genericArrayAssignment1.js @@ -0,0 +1,10 @@ +//// [genericArrayAssignment1.ts] +var s: string[]; +var n: number[]; + +s = n; + +//// [genericArrayAssignment1.js] +var s; +var n; +s = n; diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt new file mode 100644 index 0000000000000..e57112cf0fa04 --- /dev/null +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/genericArrayAssignmentCompatErrors.ts (2 errors) ==== + var myCars=new Array(); + var myCars2 = new []; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var myCars3 = new Array({}); + var myCars4: Array; // error + ~~~~~ +!!! Generic type 'Array' requires 1 type argument(s). + var myCars5: Array[]; + + myCars = myCars2; + myCars = myCars3; + myCars = myCars4; + myCars = myCars5; + + myCars2 = myCars; + myCars2 = myCars3; + myCars2 = myCars4; + myCars2 = myCars5; + + myCars3 = myCars; + myCars3 = myCars2; + myCars3 = myCars4; + myCars3 = myCars5; + \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.js b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js new file mode 100644 index 0000000000000..57dac3cd6f2d9 --- /dev/null +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js @@ -0,0 +1,41 @@ +//// [genericArrayAssignmentCompatErrors.ts] +var myCars=new Array(); +var myCars2 = new []; +var myCars3 = new Array({}); +var myCars4: Array; // error +var myCars5: Array[]; + +myCars = myCars2; +myCars = myCars3; +myCars = myCars4; +myCars = myCars5; + +myCars2 = myCars; +myCars2 = myCars3; +myCars2 = myCars4; +myCars2 = myCars5; + +myCars3 = myCars; +myCars3 = myCars2; +myCars3 = myCars4; +myCars3 = myCars5; + + +//// [genericArrayAssignmentCompatErrors.js] +var myCars = new Array(); +var myCars2 = new []; +var myCars3 = new Array({}); +var myCars4; +var myCars5; +myCars = myCars2; +myCars = myCars3; +myCars = myCars4; +myCars = myCars5; +myCars2 = myCars; +myCars2 = myCars3; +myCars2 = myCars4; +myCars2 = myCars5; +myCars3 = myCars; +myCars3 = myCars2; +myCars3 = myCars4; +myCars3 = myCars5; diff --git a/tests/baselines/reference/genericArrayExtenstions.errors.txt b/tests/baselines/reference/genericArrayExtenstions.errors.txt new file mode 100644 index 0000000000000..ea5961439ec24 --- /dev/null +++ b/tests/baselines/reference/genericArrayExtenstions.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericArrayExtenstions.ts (2 errors) ==== + export declare class ObservableArray implements Array { // MS.Entertainment.ObservableArray + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! Class 'ObservableArray' incorrectly implements interface 'T[]': +!!! Property 'join' is missing in type 'ObservableArray'. + concat(...items: U[]): T[]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + concat(...items: T[]): T[]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayExtenstions.js b/tests/baselines/reference/genericArrayExtenstions.js new file mode 100644 index 0000000000000..774e512d48fe3 --- /dev/null +++ b/tests/baselines/reference/genericArrayExtenstions.js @@ -0,0 +1,8 @@ +//// [genericArrayExtenstions.ts] +export declare class ObservableArray implements Array { // MS.Entertainment.ObservableArray +concat(...items: U[]): T[]; +concat(...items: T[]): T[]; +} + + +//// [genericArrayExtenstions.js] diff --git a/tests/baselines/reference/genericArrayMethods1.errors.txt b/tests/baselines/reference/genericArrayMethods1.errors.txt new file mode 100644 index 0000000000000..fb2434cedfb1b --- /dev/null +++ b/tests/baselines/reference/genericArrayMethods1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/genericArrayMethods1.ts (1 errors) ==== + var x:string[] = [0,1].slice(0); // this should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number[]' is not assignable to type 'string[]': +!!! Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayMethods1.js b/tests/baselines/reference/genericArrayMethods1.js new file mode 100644 index 0000000000000..c8f3e3a46c6e6 --- /dev/null +++ b/tests/baselines/reference/genericArrayMethods1.js @@ -0,0 +1,6 @@ +//// [genericArrayMethods1.ts] +var x:string[] = [0,1].slice(0); // this should be an error + + +//// [genericArrayMethods1.js] +var x = [0, 1].slice(0); diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.js b/tests/baselines/reference/genericArrayPropertyAssignment.js new file mode 100644 index 0000000000000..6aaeb26d23380 --- /dev/null +++ b/tests/baselines/reference/genericArrayPropertyAssignment.js @@ -0,0 +1,15 @@ +//// [genericArrayPropertyAssignment.ts] +function isEmpty(list: {length:number;}) +{ +return list.length ===0; +} + +isEmpty([]); // error + + + +//// [genericArrayPropertyAssignment.js] +function isEmpty(list) { + return list.length === 0; +} +isEmpty([]); diff --git a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..7cec6a532a475 --- /dev/null +++ b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts (1 errors) ==== + interface IFoo{ + } + class Bar { + public getBar(foo: IFoo[]) { + ~~~~ +!!! Generic type 'IFoo' requires 1 type argument(s). + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js new file mode 100644 index 0000000000000..88f9713c3fe81 --- /dev/null +++ b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.js @@ -0,0 +1,17 @@ +//// [genericArrayWithoutTypeAnnotation.ts] +interface IFoo{ +} +class Bar { + public getBar(foo: IFoo[]) { + } +} + + +//// [genericArrayWithoutTypeAnnotation.js] +var Bar = (function () { + function Bar() { + } + Bar.prototype.getBar = function (foo) { + }; + return Bar; +})(); diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt new file mode 100644 index 0000000000000..ad664c5c5b86c --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts (2 errors) ==== + var x1 = function foo3(x: T, z: U) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var x2 = function foo3(x: T, z: U) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + x1 = x2; + x2 = x1; \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js new file mode 100644 index 0000000000000..6f1928a2601e8 --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.js @@ -0,0 +1,14 @@ +//// [genericAssignmentCompatOfFunctionSignatures1.ts] +var x1 = function foo3(x: T, z: U) { } +var x2 = function foo3(x: T, z: U) { } + +x1 = x2; +x2 = x1; + +//// [genericAssignmentCompatOfFunctionSignatures1.js] +var x1 = function foo3(x, z) { +}; +var x2 = function foo3(x, z) { +}; +x1 = x2; +x2 = x1; diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt new file mode 100644 index 0000000000000..99715d03b64ea --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts (4 errors) ==== + interface Comparable { + compareTo(other: T): number; + } + interface I { + x: Comparable; + } + interface K { + x: A; + } + class A implements Comparable { compareTo(other: T) { return 1; } } + var z = { x: new A() }; + var a1: I = { x: new A() }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ x: A; }' is not assignable to type 'I': +!!! Types of property 'x' are incompatible: +!!! Type 'A' is not assignable to type 'Comparable': +!!! Types of property 'compareTo' are incompatible: +!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': +!!! Types of parameters 'other' and 'other' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var a2: I = function (): { x: A } { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var z = { x: new A() }; return z; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } (); + ~~~~ +!!! Type '{ x: A; }' is not assignable to type 'I': +!!! Types of property 'x' are incompatible: +!!! Type 'A' is not assignable to type 'Comparable': +!!! Types of property 'compareTo' are incompatible: +!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': +!!! Types of parameters 'other' and 'other' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var a3: I = z; + ~~~~~~~~~~~~~~~~~ +!!! Type '{ x: A; }' is not assignable to type 'I': +!!! Types of property 'x' are incompatible: +!!! Type 'A' is not assignable to type 'Comparable': +!!! Types of property 'compareTo' are incompatible: +!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': +!!! Types of parameters 'other' and 'other' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + var a4: I = >z; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'K' is not assignable to type 'I': +!!! Types of property 'x' are incompatible: +!!! Type 'A' is not assignable to type 'Comparable': +!!! Types of property 'compareTo' are incompatible: +!!! Type '(other: number) => number' is not assignable to type '(other: string) => number': +!!! Types of parameters 'other' and 'other' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js new file mode 100644 index 0000000000000..7abeeda445a9c --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.js @@ -0,0 +1,38 @@ +//// [genericAssignmentCompatWithInterfaces1.ts] +interface Comparable { + compareTo(other: T): number; +} +interface I { + x: Comparable; +} +interface K { + x: A; +} +class A implements Comparable { compareTo(other: T) { return 1; } } +var z = { x: new A() }; +var a1: I = { x: new A() }; +var a2: I = function (): { x: A } { + var z = { x: new A() }; return z; +} (); +var a3: I = z; +var a4: I = >z; + + + +//// [genericAssignmentCompatWithInterfaces1.js] +var A = (function () { + function A() { + } + A.prototype.compareTo = function (other) { + return 1; + }; + return A; +})(); +var z = { x: new A() }; +var a1 = { x: new A() }; +var a2 = function () { + var z = { x: new A() }; + return z; +}(); +var a3 = z; +var a4 = z; diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js new file mode 100644 index 0000000000000..bde7fa693026e --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -0,0 +1,37 @@ +//// [genericBaseClassLiteralProperty.ts] +class BaseClass { + public _getValue1: { (): T; }; + public _getValue2: () => T; +} + +class SubClass extends BaseClass { + public Error(): void { + + var x : number = this._getValue1(); + var y : number = this._getValue2(); + } +} + +//// [genericBaseClassLiteralProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var BaseClass = (function () { + function BaseClass() { + } + return BaseClass; +})(); +var SubClass = (function (_super) { + __extends(SubClass, _super); + function SubClass() { + _super.apply(this, arguments); + } + SubClass.prototype.Error = function () { + var x = this._getValue1(); + var y = this._getValue2(); + }; + return SubClass; +})(BaseClass); diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js new file mode 100644 index 0000000000000..f558f4243024c --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -0,0 +1,45 @@ +//// [genericBaseClassLiteralProperty2.ts] +class CollectionItem2 { } + +class BaseCollection2 { + _itemsByKey: { [key: string]: TItem; }; + constructor() { + this._itemsByKey = {}; + } +} + +class DataView2 extends BaseCollection2 { + fillItems(item: CollectionItem2) { + this._itemsByKey['dummy'] = item; + } +} + + +//// [genericBaseClassLiteralProperty2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var CollectionItem2 = (function () { + function CollectionItem2() { + } + return CollectionItem2; +})(); +var BaseCollection2 = (function () { + function BaseCollection2() { + this._itemsByKey = {}; + } + return BaseCollection2; +})(); +var DataView2 = (function (_super) { + __extends(DataView2, _super); + function DataView2() { + _super.apply(this, arguments); + } + DataView2.prototype.fillItems = function (item) { + this._itemsByKey['dummy'] = item; + }; + return DataView2; +})(BaseCollection2); diff --git a/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt b/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt new file mode 100644 index 0000000000000..40d523e01e17c --- /dev/null +++ b/tests/baselines/reference/genericCallSpecializedToTypeArg.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/genericCallSpecializedToTypeArg.ts (1 errors) ==== + function dupe(x: T): T { + return x; + } + function dupeAndGetDist(x: U): U { + var y = dupe(x); //<-- dupe has incorrect type here + y.getDist(); //<-- this requires a missing constraint, but it's not caught + ~~~~~~~ +!!! Property 'getDist' does not exist on type 'U'. + return y; + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallSpecializedToTypeArg.js b/tests/baselines/reference/genericCallSpecializedToTypeArg.js new file mode 100644 index 0000000000000..c42e5e820fd61 --- /dev/null +++ b/tests/baselines/reference/genericCallSpecializedToTypeArg.js @@ -0,0 +1,20 @@ +//// [genericCallSpecializedToTypeArg.ts] +function dupe(x: T): T { + return x; +} +function dupeAndGetDist(x: U): U { + var y = dupe(x); //<-- dupe has incorrect type here + y.getDist(); //<-- this requires a missing constraint, but it's not caught + return y; +} + + +//// [genericCallSpecializedToTypeArg.js] +function dupe(x) { + return x; +} +function dupeAndGetDist(x) { + var y = dupe(x); + y.getDist(); + return y; +} diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.js b/tests/baselines/reference/genericCallTypeArgumentInference.js new file mode 100644 index 0000000000000..68a2d29ab70af --- /dev/null +++ b/tests/baselines/reference/genericCallTypeArgumentInference.js @@ -0,0 +1,159 @@ +//// [genericCallTypeArgumentInference.ts] +// Basic type inference with generic calls, no errors expected + +function foo(t: T) { + return t; +} + +var r = foo(''); // string + +function foo2(t: T, u: U) { + return u; +} + +function foo2b(u: U) { + var x: T; + return x; +} + +var r2 = foo2('', 1); // number +var r3 = foo2b(1); // {} + +class C { + constructor(public t: T, public u: U) { + } + + foo(t: T, u: U) { + return t; + } + + foo2(t: T, u: U) { + return u; + } + + foo3(t: T, u: U) { + return t; + } + + foo4(t: T, u: U) { + return t; + } + + foo5(t: T, u: U) { + return t; + } + + foo6() { + var x: T; + return x; + } + + foo7(u: U) { + var x: T; + return x; + } + + foo8() { + var x: T; + return x; + } +} + +var c = new C('', 1); +var r4 = c.foo('', 1); // string +var r5 = c.foo2('', 1); // number +var r6 = c.foo3(true, 1); // boolean +var r7 = c.foo4('', true); // string +var r8 = c.foo5(true, 1); // boolean +var r9 = c.foo6(); // {} +var r10 = c.foo7(''); // {} +var r11 = c.foo8(); // {} + +interface I { + new (t: T, u: U); + foo(t: T, u: U): T; + foo2(t: T, u: U): U; + foo3(t: T, u: U): T; + foo4(t: T, u: U): T; + foo5(t: T, u: U): T; + foo6(): T; + foo7(u: U): T; + foo8(): T; +} + +var i: I; +var r4 = i.foo('', 1); // string +var r5 = i.foo2('', 1); // number +var r6 = i.foo3(true, 1); // boolean +var r7 = i.foo4('', true); // string +var r8 = i.foo5(true, 1); // boolean +var r9 = i.foo6(); // {} +var r10 = i.foo7(''); // {} +var r11 = i.foo8(); // {} + +//// [genericCallTypeArgumentInference.js] +function foo(t) { + return t; +} +var r = foo(''); +function foo2(t, u) { + return u; +} +function foo2b(u) { + var x; + return x; +} +var r2 = foo2('', 1); +var r3 = foo2b(1); +var C = (function () { + function C(t, u) { + this.t = t; + this.u = u; + } + C.prototype.foo = function (t, u) { + return t; + }; + C.prototype.foo2 = function (t, u) { + return u; + }; + C.prototype.foo3 = function (t, u) { + return t; + }; + C.prototype.foo4 = function (t, u) { + return t; + }; + C.prototype.foo5 = function (t, u) { + return t; + }; + C.prototype.foo6 = function () { + var x; + return x; + }; + C.prototype.foo7 = function (u) { + var x; + return x; + }; + C.prototype.foo8 = function () { + var x; + return x; + }; + return C; +})(); +var c = new C('', 1); +var r4 = c.foo('', 1); +var r5 = c.foo2('', 1); +var r6 = c.foo3(true, 1); +var r7 = c.foo4('', true); +var r8 = c.foo5(true, 1); +var r9 = c.foo6(); +var r10 = c.foo7(''); +var r11 = c.foo8(); +var i; +var r4 = i.foo('', 1); +var r5 = i.foo2('', 1); +var r6 = i.foo3(true, 1); +var r7 = i.foo4('', true); +var r8 = i.foo5(true, 1); +var r9 = i.foo6(); +var r10 = i.foo7(''); +var r11 = i.foo8(); diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.js b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js new file mode 100644 index 0000000000000..9f3619a66ba57 --- /dev/null +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js @@ -0,0 +1,27 @@ +//// [genericCallWithArrayLiteralArgs.ts] +function foo(t: T) { + return t; +} + +var r = foo([1, 2]); // number[] +var r = foo([1, 2]); // number[] +var ra = foo([1, 2]); // any[] +var r2 = foo([]); // any[] +var r3 = foo([]); // number[] +var r4 = foo([1, '']); // {}[] +var r5 = foo([1, '']); // any[] +var r6 = foo([1, '']); // Object[] + + +//// [genericCallWithArrayLiteralArgs.js] +function foo(t) { + return t; +} +var r = foo([1, 2]); +var r = foo([1, 2]); +var ra = foo([1, 2]); +var r2 = foo([]); +var r3 = foo([]); +var r4 = foo([1, '']); +var r5 = foo([1, '']); +var r6 = foo([1, '']); diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js new file mode 100644 index 0000000000000..90889faf9f1d8 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -0,0 +1,210 @@ +//// [genericCallWithConstraintsTypeArgumentInference.ts] +// Basic type inference with generic calls and constraints, no errors expected + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Derived { baz: string; } +var b: Base; +var d1: Derived; +var d2: Derived2; + +function foo(t: T) { + return t; +} + +var r = foo(b); // Base +var r2 = foo(d1); // Derived + +function foo2(t: T, u: U) { + return u; +} + +function foo2b(u: U) { + var x: T; + return x; +} + +function foo2c() { + var x: T; + return x; +} + +var r3 = foo2b(d1); // Base +var r3b = foo2c(); // Base + +class C { + constructor(public t: T, public u: U) { + } + + foo(t: T, u: U) { + return t; + } + + foo2(t: T, u: U) { + return u; + } + + foo3(t: T, u: U) { + return t; + } + + foo4(t: T, u: U) { + return t; + } + + foo5(t: T, u: U) { + return t; + } + + foo6() { + var x: T; + return x; + } + + foo7(u: U) { + var x: T; + return x; + } + + foo8() { + var x: T; + return x; + } +} + +var c = new C(b, d1); +var r4 = c.foo(d1, d2); // Base +var r5 = c.foo2(b, d2); // Derived +var r6 = c.foo3(d1, d1); // Derived +var r7 = c.foo4(d1, d2); // Base +var r8 = c.foo5(d1, d2); // Derived +var r8b = c.foo5(d2, d2); // Derived2 +var r9 = c.foo6(); // Derived +var r10 = c.foo7(d1); // Base +var r11 = c.foo8(); // Base + +interface I { + new (t: T, u: U); + foo(t: T, u: U): T; + foo2(t: T, u: U): U; + foo3(t: T, u: U): T; + foo4(t: T, u: U): T; + foo5(t: T, u: U): T; + foo6(): T; + foo7(u: U): T; + foo8(): T; +} + +var i: I; +var r4 = i.foo(d1, d2); // Base +var r5 = i.foo2(b, d2); // Derived +var r6 = i.foo3(d1, d1); // Derived +var r7 = i.foo4(d1, d2); // Base +var r8 = i.foo5(d1, d2); // Derived +var r8b = i.foo5(d2, d2); // Derived2 +var r9 = i.foo6(); // Derived +var r10 = i.foo7(d1); // Base +var r11 = i.foo8(); // Base + + +//// [genericCallWithConstraintsTypeArgumentInference.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Derived); +var b; +var d1; +var d2; +function foo(t) { + return t; +} +var r = foo(b); +var r2 = foo(d1); +function foo2(t, u) { + return u; +} +function foo2b(u) { + var x; + return x; +} +function foo2c() { + var x; + return x; +} +var r3 = foo2b(d1); +var r3b = foo2c(); +var C = (function () { + function C(t, u) { + this.t = t; + this.u = u; + } + C.prototype.foo = function (t, u) { + return t; + }; + C.prototype.foo2 = function (t, u) { + return u; + }; + C.prototype.foo3 = function (t, u) { + return t; + }; + C.prototype.foo4 = function (t, u) { + return t; + }; + C.prototype.foo5 = function (t, u) { + return t; + }; + C.prototype.foo6 = function () { + var x; + return x; + }; + C.prototype.foo7 = function (u) { + var x; + return x; + }; + C.prototype.foo8 = function () { + var x; + return x; + }; + return C; +})(); +var c = new C(b, d1); +var r4 = c.foo(d1, d2); +var r5 = c.foo2(b, d2); +var r6 = c.foo3(d1, d1); +var r7 = c.foo4(d1, d2); +var r8 = c.foo5(d1, d2); +var r8b = c.foo5(d2, d2); +var r9 = c.foo6(); +var r10 = c.foo7(d1); +var r11 = c.foo8(); +var i; +var r4 = i.foo(d1, d2); +var r5 = i.foo2(b, d2); +var r6 = i.foo3(d1, d1); +var r7 = i.foo4(d1, d2); +var r8 = i.foo5(d1, d2); +var r8b = i.foo5(d2, d2); +var r9 = i.foo6(); +var r10 = i.foo7(d1); +var r11 = i.foo8(); diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt new file mode 100644 index 0000000000000..4f1fac11b4d21 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (2 errors) ==== + // Generic call with parameters of T and U, U extends T, no parameter of type U + + function foo(t: T) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var u: U; + return u; + } + + var r = foo(1); // ok + var r2 = foo(null); // {} + var r3 = foo(new Object()); // {} + var r4 = foo(1); // error + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js new file mode 100644 index 0000000000000..c64fb2eabe6c8 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js @@ -0,0 +1,24 @@ +//// [genericCallWithConstraintsTypeArgumentInference2.ts] +// Generic call with parameters of T and U, U extends T, no parameter of type U + +function foo(t: T) { + var u: U; + return u; +} + +var r = foo(1); // ok +var r2 = foo(null); // {} +var r3 = foo(new Object()); // {} +var r4 = foo(1); // error +var r5 = foo(new Date()); // no error + +//// [genericCallWithConstraintsTypeArgumentInference2.js] +function foo(t) { + var u; + return u; +} +var r = foo(1); +var r2 = foo(null); +var r3 = foo(new Object()); +var r4 = foo(1); +var r5 = foo(new Date()); diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt new file mode 100644 index 0000000000000..4ccaf1d75d65f --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts (2 errors) ==== + // Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args + + function foo(arg: { cb: new(t: T) => U }) { + return new arg.cb(null); + } + + var arg: { cb: new(x: T) => string }; + var r = foo(arg); // {} + // more args not allowed + var arg2: { cb: new (x: T, y: T) => string }; + var r2 = foo(arg2); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var arg3: { cb: new (x: string, y: number) => string }; + var r3 = foo(arg3); // error + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo2(arg: { cb: new(t: T, t2: T) => U }) { + return new arg.cb(null, null); + } + + // fewer args ok + var r4 = foo(arg); // {} + var arg4: { cb: new (x: string) => string }; + var r6 = foo(arg4); // string + var arg5: { cb: new () => string }; + var r7 = foo(arg5); // string + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js new file mode 100644 index 0000000000000..eed8b43a60811 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js @@ -0,0 +1,45 @@ +//// [genericCallWithConstructorTypedArguments5.ts] +// Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args + +function foo(arg: { cb: new(t: T) => U }) { + return new arg.cb(null); +} + +var arg: { cb: new(x: T) => string }; +var r = foo(arg); // {} +// more args not allowed +var arg2: { cb: new (x: T, y: T) => string }; +var r2 = foo(arg2); // error +var arg3: { cb: new (x: string, y: number) => string }; +var r3 = foo(arg3); // error + +function foo2(arg: { cb: new(t: T, t2: T) => U }) { + return new arg.cb(null, null); +} + +// fewer args ok +var r4 = foo(arg); // {} +var arg4: { cb: new (x: string) => string }; +var r6 = foo(arg4); // string +var arg5: { cb: new () => string }; +var r7 = foo(arg5); // string + + +//// [genericCallWithConstructorTypedArguments5.js] +function foo(arg) { + return new arg.cb(null); +} +var arg; +var r = foo(arg); +var arg2; +var r2 = foo(arg2); +var arg3; +var r3 = foo(arg3); +function foo2(arg) { + return new arg.cb(null, null); +} +var r4 = foo(arg); +var arg4; +var r6 = foo(arg4); +var arg5; +var r7 = foo(arg5); diff --git a/tests/baselines/reference/genericCallWithFixedArguments.js b/tests/baselines/reference/genericCallWithFixedArguments.js new file mode 100644 index 0000000000000..53d33635720a5 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFixedArguments.js @@ -0,0 +1,27 @@ +//// [genericCallWithFixedArguments.ts] +class A { foo() { } } +class B { bar() { }} + +function g(x) { } +g(7) // the parameter list is fixed, so this should not error + + + +//// [genericCallWithFixedArguments.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +function g(x) { +} +g(7); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js new file mode 100644 index 0000000000000..7f0e69b2f1ab3 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js @@ -0,0 +1,70 @@ +//// [genericCallWithFunctionTypedArguments.ts] +// Generic functions used as arguments for function typed parameters are not used to make inferences from +// Using function arguments, no errors expected + +function foo(x: (a: T) => T) { + return x(null); +} + +var r = foo((x: U) => ''); // {} +var r2 = foo((x: U) => ''); // string +var r3 = foo(x => ''); // {} + +function foo2(x: T, cb: (a: T) => U) { + return cb(x); +} + +var r4 = foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions +var r5 = foo2(1, (a) => ''); // string +var r6 = foo2('', (a: Z) => 1); + +function foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); +} + +var r7 = foo3(1, (a: Z) => '', ''); // string + +var r8 = foo3(1, function (a) { return '' }, 1); // {} +var r9 = foo3(1, (a) => '', ''); // string + +function other(t: T, u: U) { + var r10 = foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made + var r10 = foo2(1, (x) => ''); // string + + var r11 = foo3(1, (x: T) => '', ''); // string + var r11b = foo3(1, (x: T) => '', 1); // {} + var r12 = foo3(1, function (a) { return '' }, 1); // {} +} + +//// [genericCallWithFunctionTypedArguments.js] +function foo(x) { + return x(null); +} +var r = foo(function (x) { return ''; }); +var r2 = foo(function (x) { return ''; }); +var r3 = foo(function (x) { return ''; }); +function foo2(x, cb) { + return cb(x); +} +var r4 = foo2(1, function (a) { + return ''; +}); +var r5 = foo2(1, function (a) { return ''; }); +var r6 = foo2('', function (a) { return 1; }); +function foo3(x, cb, y) { + return cb(x); +} +var r7 = foo3(1, function (a) { return ''; }, ''); +var r8 = foo3(1, function (a) { + return ''; +}, 1); +var r9 = foo3(1, function (a) { return ''; }, ''); +function other(t, u) { + var r10 = foo2(1, function (x) { return ''; }); + var r10 = foo2(1, function (x) { return ''; }); + var r11 = foo3(1, function (x) { return ''; }, ''); + var r11b = foo3(1, function (x) { return ''; }, 1); + var r12 = foo3(1, function (a) { + return ''; + }, 1); +} diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js new file mode 100644 index 0000000000000..6e8af57f3f7ce --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js @@ -0,0 +1,68 @@ +//// [genericCallWithFunctionTypedArguments2.ts] +// Generic functions used as arguments for function typed parameters are not used to make inferences from +// Using construct signature arguments, no errors expected + +function foo(x: new(a: T) => T) { + return new x(null); +} + +interface I { + new (x: T): T; +} +interface I2 { + new (x: T): T; +} +var i: I; +var i2: I2; +var a: { + new (x: T): T; +} + +var r = foo(i); // any +var r2 = foo(i); // string +var r3 = foo(i2); // string +var r3b = foo(a); // any + +function foo2(x: T, cb: new(a: T) => U) { + return new cb(x); +} + +var r4 = foo2(1, i2); // string, instantiated generic +var r4b = foo2(1, a); // any +var r5 = foo2(1, i); // any +var r6 = foo2('', i2); // string + +function foo3(x: T, cb: new(a: T) => U, y: U) { + return new cb(x); +} + +var r7 = foo3(null, i, ''); // any +var r7b = foo3(null, a, ''); // any +var r8 = foo3(1, i2, 1); // {} +var r9 = foo3('', i2, ''); // string + +//// [genericCallWithFunctionTypedArguments2.js] +function foo(x) { + return new x(null); +} +var i; +var i2; +var a; +var r = foo(i); +var r2 = foo(i); +var r3 = foo(i2); +var r3b = foo(a); +function foo2(x, cb) { + return new cb(x); +} +var r4 = foo2(1, i2); +var r4b = foo2(1, a); +var r5 = foo2(1, i); +var r6 = foo2('', i2); +function foo3(x, cb, y) { + return new cb(x); +} +var r7 = foo3(null, i, ''); +var r7b = foo3(null, a, ''); +var r8 = foo3(1, i2, 1); +var r9 = foo3('', i2, ''); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js new file mode 100644 index 0000000000000..74e5d301b77b4 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js @@ -0,0 +1,31 @@ +//// [genericCallWithFunctionTypedArguments3.ts] +// No inference is made from function typed arguments which have multiple call signatures + +var a: { + (x: boolean): boolean; + (x: string): any; +} + +function foo4(cb: (x: T) => U) { + var u: U; + return u; +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is any (candidates any and boolean) + +var b: { + (x: boolean): T; + (x: T): any; +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) + +//// [genericCallWithFunctionTypedArguments3.js] +var a; +function foo4(cb) { + var u; + return u; +} +var r = foo4(a); +var b; +var r2 = foo4(b); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js new file mode 100644 index 0000000000000..ad6cd256590a2 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js @@ -0,0 +1,43 @@ +//// [genericCallWithFunctionTypedArguments4.ts] +// No inference is made from function typed arguments which have multiple call signatures + +class C { foo: string } +class D { bar: string } +var a: { + new(x: boolean): C; + new(x: string): D; +} + +function foo4(cb: new(x: T) => U) { + var u: U; + return u; +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D) + +var b: { + new(x: boolean): T; + new(x: T): any; +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) + +//// [genericCallWithFunctionTypedArguments4.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var a; +function foo4(cb) { + var u; + return u; +} +var r = foo4(a); +var b; +var r2 = foo4(b); diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt new file mode 100644 index 0000000000000..0a74a683d29f2 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts (2 errors) ==== + // Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args + + function foo(arg: { cb: (t: T) => U }) { + return arg.cb(null); + } + + var arg = { cb: (x: T) => '' }; + var r = foo(arg); // {} + // more args not allowed + var r2 = foo({ cb: (x: T, y: T) => '' }); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r3 = foo({ cb: (x: string, y: number) => '' }); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo2(arg: { cb: (t: T, t2: T) => U }) { + return arg.cb(null, null); + } + + // fewer args ok + var r4 = foo(arg); // {} + var r5 = foo({ cb: (x: T) => '' }); // {} + var r6 = foo({ cb: (x: string) => '' }); // string + var r7 = foo({ cb: () => '' }); // string + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js new file mode 100644 index 0000000000000..4e4703615bb07 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js @@ -0,0 +1,39 @@ +//// [genericCallWithFunctionTypedArguments5.ts] +// Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args + +function foo(arg: { cb: (t: T) => U }) { + return arg.cb(null); +} + +var arg = { cb: (x: T) => '' }; +var r = foo(arg); // {} +// more args not allowed +var r2 = foo({ cb: (x: T, y: T) => '' }); // error +var r3 = foo({ cb: (x: string, y: number) => '' }); // error + +function foo2(arg: { cb: (t: T, t2: T) => U }) { + return arg.cb(null, null); +} + +// fewer args ok +var r4 = foo(arg); // {} +var r5 = foo({ cb: (x: T) => '' }); // {} +var r6 = foo({ cb: (x: string) => '' }); // string +var r7 = foo({ cb: () => '' }); // string + + +//// [genericCallWithFunctionTypedArguments5.js] +function foo(arg) { + return arg.cb(null); +} +var arg = { cb: function (x) { return ''; } }; +var r = foo(arg); +var r2 = foo({ cb: function (x, y) { return ''; } }); +var r3 = foo({ cb: function (x, y) { return ''; } }); +function foo2(arg) { + return arg.cb(null, null); +} +var r4 = foo(arg); +var r5 = foo({ cb: function (x) { return ''; } }); +var r6 = foo({ cb: function (x) { return ''; } }); +var r7 = foo({ cb: function () { return ''; } }); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js new file mode 100644 index 0000000000000..5084f94f66d28 --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js @@ -0,0 +1,73 @@ +//// [genericCallWithGenericSignatureArguments.ts] +// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, +// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + +function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +//var r1 = foo((x: number) => 1, (x: string) => ''); // error +var r1b = foo((x) => 1, (x) => ''); // {} => {} +var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object +var r3 = foo((x: number) => 1, (x: Object) => null); // number => number +var r3ii = foo((x: number) => 1, (x: number) => 1); // number => number + +var a: { x: number; y?: number; }; +var b: { x: number; z?: number; }; + +var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a +var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b + +function other(x: T) { + var r6 = foo((a: T) => a, (b: T) => b); // T => T + var r6b = foo((a) => a, (b) => b); // {} => {} +} + +function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + var r7b = foo((a) => a, (b) => b); // {} => {} + var r8 = r7(null); + // BUG 835518 + //var r9 = r7(new Date()); +} + + +function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +function other3(x: T) { + var r8 = foo2((a: Date) => a, (b: Date) => b); // Date => Date +} + +//// [genericCallWithGenericSignatureArguments.js] +function foo(a, b) { + var r; + return r; +} +var r1b = foo(function (x) { return 1; }, function (x) { return ''; }); +var r2 = foo(function (x) { return null; }, function (x) { return ''; }); +var r3 = foo(function (x) { return 1; }, function (x) { return null; }); +var r3ii = foo(function (x) { return 1; }, function (x) { return 1; }); +var a; +var b; +var r4 = foo(function (x) { return a; }, function (x) { return b; }); +var r5 = foo(function (x) { return b; }, function (x) { return a; }); +function other(x) { + var r6 = foo(function (a) { return a; }, function (b) { return b; }); + var r6b = foo(function (a) { return a; }, function (b) { return b; }); +} +function other2(x) { + var r7 = foo(function (a) { return a; }, function (b) { return b; }); + var r7b = foo(function (a) { return a; }, function (b) { return b; }); + var r8 = r7(null); +} +function foo2(a, b) { + var r; + return r; +} +function other3(x) { + var r8 = foo2(function (a) { return a; }, function (b) { return b; }); +} diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt new file mode 100644 index 0000000000000..bf249b29d8e72 --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts (4 errors) ==== + // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, + // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + + function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); + + function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + // BUG 835518 + var r9 = r7(new Date()); // should be ok + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r10 = r7(1); // error + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date + } + + enum E { A } + enum F { A } + + function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; + } + + var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js new file mode 100644 index 0000000000000..e266159d289be --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js @@ -0,0 +1,70 @@ +//// [genericCallWithGenericSignatureArguments2.ts] +// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, +// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + +function foo(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); + +function other2(x: T) { + var r7 = foo((a: T) => a, (b: T) => b); // T => T + // BUG 835518 + var r9 = r7(new Date()); // should be ok + var r10 = r7(1); // error +} + +function foo2(a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +function other3(x: T) { + var r7 = foo2((a: T) => a, (b: T) => b); // error + var r7b = foo2((a) => a, (b) => b); // valid, T is inferred to be Date +} + +enum E { A } +enum F { A } + +function foo3(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error + +//// [genericCallWithGenericSignatureArguments2.js] +function foo(a, b) { + var r; + return r; +} +var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); +function other2(x) { + var r7 = foo(function (a) { return a; }, function (b) { return b; }); + var r9 = r7(new Date()); + var r10 = r7(1); +} +function foo2(a, b) { + var r; + return r; +} +function other3(x) { + var r7 = foo2(function (a) { return a; }, function (b) { return b; }); + var r7b = foo2(function (a) { return a; }, function (b) { return b; }); +} +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var F; +(function (F) { + F[F["A"] = 0] = "A"; +})(F || (F = {})); +function foo3(x, a, b) { + var r; + return r; +} +var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js new file mode 100644 index 0000000000000..4a47646b1842c --- /dev/null +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js @@ -0,0 +1,65 @@ +//// [genericCallWithGenericSignatureArguments3.ts] +// When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, +// the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. + +function foo(x: T, a: (x: T) => T, b: (x: T) => T) { + var r: (x: T) => T; + return r; +} + +var r1 = foo('', (x: string) => '', (x: Object) => null); // any => any +var r1ii = foo('', (x) => '', (x) => null); // string => string +var r2 = foo('', (x: string) => '', (x: Object) => ''); // string => string +var r3 = foo(null, (x: Object) => '', (x: string) => ''); // Object => Object +var r4 = foo(null, (x) => '', (x) => ''); // any => any +var r5 = foo(new Object(), (x) => '', (x) => ''); // Object => Object + +enum E { A } +enum F { A } + +var r6 = foo(E.A, (x: number) => E.A, (x: F) => F.A); // number => number + + +function foo2(x: T, a: (x: T) => U, b: (x: T) => U) { + var r: (x: T) => U; + return r; +} + +var r8 = foo2('', (x) => '', (x) => null); // string => string +var r9 = foo2(null, (x) => '', (x) => ''); // any => any +var r10 = foo2(null, (x: Object) => '', (x: string) => ''); // Object => Object + +var x: (a: string) => boolean; +var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // {} => {} +var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // (string => boolean) => {} + +//// [genericCallWithGenericSignatureArguments3.js] +function foo(x, a, b) { + var r; + return r; +} +var r1 = foo('', function (x) { return ''; }, function (x) { return null; }); +var r1ii = foo('', function (x) { return ''; }, function (x) { return null; }); +var r2 = foo('', function (x) { return ''; }, function (x) { return ''; }); +var r3 = foo(null, function (x) { return ''; }, function (x) { return ''; }); +var r4 = foo(null, function (x) { return ''; }, function (x) { return ''; }); +var r5 = foo(new Object(), function (x) { return ''; }, function (x) { return ''; }); +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var F; +(function (F) { + F[F["A"] = 0] = "A"; +})(F || (F = {})); +var r6 = foo(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); +function foo2(x, a, b) { + var r; + return r; +} +var r8 = foo2('', function (x) { return ''; }, function (x) { return null; }); +var r9 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); +var r10 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); +var x; +var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); +var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.js b/tests/baselines/reference/genericCallWithNonGenericArgs1.js new file mode 100644 index 0000000000000..2282c64e8518f --- /dev/null +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.js @@ -0,0 +1,9 @@ +//// [genericCallWithNonGenericArgs1.ts] +function f(x: any) { } +f(null) + + +//// [genericCallWithNonGenericArgs1.js] +function f(x) { +} +f(null); diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js new file mode 100644 index 0000000000000..d78e6627cdd2d --- /dev/null +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js @@ -0,0 +1,54 @@ +//// [genericCallWithNonSymmetricSubtypes.ts] +// generic type argument inference where inference leads to two candidates that are both supertypes of all candidates +// we choose the first candidate so the result is dependent on the order of the arguments provided + +function foo(x: T, y: T) { + var r: T; + return r; +} + +var a: { x: number; y?: number; }; +var b: { x: number; z?: number; }; + +var r = foo(a, b); // { x: number; y?: number; }; +var r2 = foo(b, a); // { x: number; z?: number; }; + +var x: { x: number; }; +var y: { x?: number; }; + +var r3 = foo(a, x); // { x: number; y?: number; }; +var r4 = foo(x, a); // { x: number; }; + +var r5 = foo(a, y); // { x?: number; }; +var r5 = foo(y, a); // { x?: number; }; + +var r6 = foo(x, y); // { x?: number; }; +var r6 = foo(y, x); // { x?: number; }; + +var s1: (x: Object) => string; +var s2: (x: string) => string; + +var r7 = foo(s1, s2); // (x: Object) => string; +var r8 = foo(s2, s1); // (x: string) => string; + +//// [genericCallWithNonSymmetricSubtypes.js] +function foo(x, y) { + var r; + return r; +} +var a; +var b; +var r = foo(a, b); +var r2 = foo(b, a); +var x; +var y; +var r3 = foo(a, x); +var r4 = foo(x, a); +var r5 = foo(a, y); +var r5 = foo(y, a); +var r6 = foo(x, y); +var r6 = foo(y, x); +var s1; +var s2; +var r7 = foo(s1, s2); +var r8 = foo(s2, s1); diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js new file mode 100644 index 0000000000000..f942b1ff25625 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js @@ -0,0 +1,19 @@ +//// [genericCallWithObjectLiteralArgs.ts] +function foo(x: { bar: T; baz: T }) { + return x; +} + +var r = foo({ bar: 1, baz: '' }); // T = {} +var r2 = foo({ bar: 1, baz: 1 }); // T = number +// BUG 835724 +var r3 = foo({ bar: foo, baz: foo }); // T = any +var r4 = foo({ bar: 1, baz: '' }); // T = Object + +//// [genericCallWithObjectLiteralArgs.js] +function foo(x) { + return x; +} +var r = foo({ bar: 1, baz: '' }); +var r2 = foo({ bar: 1, baz: 1 }); +var r3 = foo({ bar: foo, baz: foo }); +var r4 = foo({ bar: 1, baz: '' }); diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt new file mode 100644 index 0000000000000..95db2884cf08c --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts (4 errors) ==== + function foo(n: { x: T; y: T }, m: T) { return m; } + var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type + // these are all errors + var x2 = foo({ x: 3, y: "" }, 4); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var x3 = foo({ x: 3, y: "" }, 4); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var x4 = foo({ x: "", y: 4 }, ""); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var x5 = foo({ x: "", y: 4 }, ""); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js new file mode 100644 index 0000000000000..4bf498f814621 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js @@ -0,0 +1,18 @@ +//// [genericCallWithObjectLiteralArguments1.ts] +function foo(n: { x: T; y: T }, m: T) { return m; } +var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type +// these are all errors +var x2 = foo({ x: 3, y: "" }, 4); +var x3 = foo({ x: 3, y: "" }, 4); +var x4 = foo({ x: "", y: 4 }, ""); +var x5 = foo({ x: "", y: 4 }, ""); + +//// [genericCallWithObjectLiteralArguments1.js] +function foo(n, m) { + return m; +} +var x = foo({ x: 3, y: "" }, 4); +var x2 = foo({ x: 3, y: "" }, 4); +var x3 = foo({ x: 3, y: "" }, 4); +var x4 = foo({ x: "", y: 4 }, ""); +var x5 = foo({ x: "", y: 4 }, ""); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.js b/tests/baselines/reference/genericCallWithObjectTypeArgs.js new file mode 100644 index 0000000000000..69658c839914c --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.js @@ -0,0 +1,47 @@ +//// [genericCallWithObjectTypeArgs.ts] +class C { + private x: string; +} + +class D { + private x: string; +} + +class X { + x: T; +} + +function foo(t: X, t2: X) { + var x: T; + return x; +} + +var c1 = new X(); +var d1 = new X(); +var r = foo(c1, d1); // error +var r2 = foo(c1, c1); // ok + +//// [genericCallWithObjectTypeArgs.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var X = (function () { + function X() { + } + return X; +})(); +function foo(t, t2) { + var x; + return x; +} +var c1 = new X(); +var d1 = new X(); +var r = foo(c1, d1); +var r2 = foo(c1, c1); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js new file mode 100644 index 0000000000000..be64dfcf510f6 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -0,0 +1,71 @@ +//// [genericCallWithObjectTypeArgs2.ts] +class Base { + x: string; +} +class Derived extends Base { + y: string; +} +class Derived2 extends Base { + z: string; +} + +// returns {}[] +function f(a: { x: T; y: U }) { + return [a.x, a.y]; +} + +var r = f({ x: new Derived(), y: new Derived2() }); // {}[] +var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] + + +function f2(a: { x: T; y: U }) { + return (x: T) => a.y; +} + +var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 + +interface I { + x: T; + y: U; +} + +var i: I; +var r4 = f2(i); // Base => Derived + +//// [genericCallWithObjectTypeArgs2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +function f(a) { + return [a.x, a.y]; +} +var r = f({ x: new Derived(), y: new Derived2() }); +var r2 = f({ x: new Base(), y: new Derived2() }); +function f2(a) { + return function (x) { return a.y; }; +} +var r3 = f2({ x: new Derived(), y: new Derived2() }); +var i; +var r4 = f2(i); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js new file mode 100644 index 0000000000000..24741b7b8ddf7 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.js @@ -0,0 +1,65 @@ +//// [genericCallWithObjectTypeArgsAndConstraints.ts] +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { + x: string; +} + +class D { + x: string; + y: string; +} + +class X { + x: T; +} + +function foo(t: X, t2: X) { + var x: T; + return x; +} + +var c1 = new X(); +var d1 = new X(); +var r = foo(c1, d1); +var r2 = foo(c1, c1); + +function foo2(t: X, t2: X) { + var x: T; + return x; +} + +var r = foo2(c1, d1); +var r2 = foo2(c1, c1); + +//// [genericCallWithObjectTypeArgsAndConstraints.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var X = (function () { + function X() { + } + return X; +})(); +function foo(t, t2) { + var x; + return x; +} +var c1 = new X(); +var d1 = new X(); +var r = foo(c1, d1); +var r2 = foo(c1, c1); +function foo2(t, t2) { + var x; + return x; +} +var r = foo2(c1, d1); +var r2 = foo2(c1, c1); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js new file mode 100644 index 0000000000000..e86234e960e18 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -0,0 +1,78 @@ +//// [genericCallWithObjectTypeArgsAndConstraints2.ts] +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class Base { + x: string; +} +class Derived extends Base { + y: string; +} + +function f(x: { foo: T; bar: T }) { + var r: T; + return r; +} +var r = f({ foo: new Base(), bar: new Derived() }); +var r2 = f({ foo: new Derived(), bar: new Derived() }); + + +interface I { + a: T; +} +function f2(x: I) { + var r: T; + return r; +} +var i: I; +var r3 = f2(i); + + +function f3(x: T, y: (a: T) => T) { + return y(null); +} +var r4 = f3(new Base(), x => x); +var r5 = f3(new Derived(), x => x); + +var r6 = f3(null, null); // any +var r7 = f3(null, x => x); // any + + +//// [genericCallWithObjectTypeArgsAndConstraints2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +function f(x) { + var r; + return r; +} +var r = f({ foo: new Base(), bar: new Derived() }); +var r2 = f({ foo: new Derived(), bar: new Derived() }); +function f2(x) { + var r; + return r; +} +var i; +var r3 = f2(i); +function f3(x, y) { + return y(null); +} +var r4 = f3(new Base(), function (x) { return x; }); +var r5 = f3(new Derived(), function (x) { return x; }); +var r6 = f3(null, null); +var r7 = f3(null, function (x) { return x; }); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt new file mode 100644 index 0000000000000..6ac5e2234ef24 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (1 errors) ==== + // Generic call with constraints infering type parameter from object member properties + + class Base { + x: string; + } + class Derived extends Base { + y: string; + } + class Derived2 extends Base { + z: string; + } + + function f(a: { x: T; y: T }) { + var r: T; + return r; + } + + var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base + + function f2(a: U) { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var r: T; + return r; + } + + var r2 = f2({ x: new Derived(), y: new Derived2() }); // ok + var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok + + + function f3(y: (a: T) => T, x: T) { + return y(null); + } + + // all ok - T gets fixed too early, but then defaults to Base and everything works out + var r4 = f3(x => x, new Base()); + var r5 = f3(x => x, new Derived()); + var r6 = f3(x => x, null); + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js new file mode 100644 index 0000000000000..66ecc4326e1de --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -0,0 +1,82 @@ +//// [genericCallWithObjectTypeArgsAndConstraints3.ts] +// Generic call with constraints infering type parameter from object member properties + +class Base { + x: string; +} +class Derived extends Base { + y: string; +} +class Derived2 extends Base { + z: string; +} + +function f(a: { x: T; y: T }) { + var r: T; + return r; +} + +var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base + +function f2(a: U) { + var r: T; + return r; +} + +var r2 = f2({ x: new Derived(), y: new Derived2() }); // ok +var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok + + +function f3(y: (a: T) => T, x: T) { + return y(null); +} + +// all ok - T gets fixed too early, but then defaults to Base and everything works out +var r4 = f3(x => x, new Base()); +var r5 = f3(x => x, new Derived()); +var r6 = f3(x => x, null); + + +//// [genericCallWithObjectTypeArgsAndConstraints3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +function f(a) { + var r; + return r; +} +var r1 = f({ x: new Derived(), y: new Derived2() }); +function f2(a) { + var r; + return r; +} +var r2 = f2({ x: new Derived(), y: new Derived2() }); +var r3 = f2({ x: new Derived(), y: new Derived2() }); +function f3(y, x) { + return y(null); +} +var r4 = f3(function (x) { return x; }, new Base()); +var r5 = f3(function (x) { return x; }, new Derived()); +var r6 = f3(function (x) { return x; }, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt new file mode 100644 index 0000000000000..2e66abd825688 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts (3 errors) ==== + // Generic call with constraints infering type parameter from object member properties + + class C { + x: string; + } + + class D { + x: string; + y: string; + } + + function foo(t: T, t2: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return (x: T) => t2; + } + + var c: C; + var d: D; + var r = foo(c, d); + var r2 = foo(d, c); // error because C does not extend D + var r3 = foo(c, { x: '', foo: c }); + var r4 = foo(null, null); + var r5 = foo({}, null); + var r6 = foo(null, {}); + var r7 = foo({}, {}); + var r8 = foo(() => { }, () => { }); + var r9 = foo(() => { }, () => 1); + + function other() { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var r4 = foo(c, d); + var r5 = foo(c, d); // error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js new file mode 100644 index 0000000000000..e0f93863e1b8a --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js @@ -0,0 +1,67 @@ +//// [genericCallWithObjectTypeArgsAndConstraints4.ts] +// Generic call with constraints infering type parameter from object member properties + +class C { + x: string; +} + +class D { + x: string; + y: string; +} + +function foo(t: T, t2: U) { + return (x: T) => t2; +} + +var c: C; +var d: D; +var r = foo(c, d); +var r2 = foo(d, c); // error because C does not extend D +var r3 = foo(c, { x: '', foo: c }); +var r4 = foo(null, null); +var r5 = foo({}, null); +var r6 = foo(null, {}); +var r7 = foo({}, {}); +var r8 = foo(() => { }, () => { }); +var r9 = foo(() => { }, () => 1); + +function other() { + var r4 = foo(c, d); + var r5 = foo(c, d); // error +} + + + +//// [genericCallWithObjectTypeArgsAndConstraints4.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function foo(t, t2) { + return function (x) { return t2; }; +} +var c; +var d; +var r = foo(c, d); +var r2 = foo(d, c); +var r3 = foo(c, { x: '', foo: c }); +var r4 = foo(null, null); +var r5 = foo({}, null); +var r6 = foo(null, {}); +var r7 = foo({}, {}); +var r8 = foo(function () { +}, function () { +}); +var r9 = foo(function () { +}, function () { return 1; }); +function other() { + var r4 = foo(c, d); + var r5 = foo(c, d); +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt new file mode 100644 index 0000000000000..9905903370a98 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts (3 errors) ==== + // Generic call with constraints infering type parameter from object member properties + + class C { + x: string; + } + + class D { + x: string; + y: string; + } + + function foo(t: T, t2: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return (x: T) => t2; + } + + var c: C; + var d: D; + var r2 = foo(d, c); // the constraints are self-referencing, no downstream error + var r9 = foo(() => 1, () => { }); // the constraints are self-referencing, no downstream error + + function other() { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var r5 = foo(c, d); // error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js new file mode 100644 index 0000000000000..7e35ab01ca3bc --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js @@ -0,0 +1,48 @@ +//// [genericCallWithObjectTypeArgsAndConstraints5.ts] +// Generic call with constraints infering type parameter from object member properties + +class C { + x: string; +} + +class D { + x: string; + y: string; +} + +function foo(t: T, t2: U) { + return (x: T) => t2; +} + +var c: C; +var d: D; +var r2 = foo(d, c); // the constraints are self-referencing, no downstream error +var r9 = foo(() => 1, () => { }); // the constraints are self-referencing, no downstream error + +function other() { + var r5 = foo(c, d); // error +} + + +//// [genericCallWithObjectTypeArgsAndConstraints5.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +function foo(t, t2) { + return function (x) { return t2; }; +} +var c; +var d; +var r2 = foo(d, c); +var r9 = foo(function () { return 1; }, function () { +}); +function other() { + var r5 = foo(c, d); +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.js new file mode 100644 index 0000000000000..4c302e8a1a27e --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.js @@ -0,0 +1,35 @@ +//// [genericCallWithObjectTypeArgsAndIndexers.ts] +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { + return x; +} + +var a: { + [x: string]: Object; + [x: number]: Date; +}; +var r = foo(a); + +function other(arg: T) { + var b: { + [x: string]: Object; + [x: number]: T + }; + var r2 = foo(b); + var d = r2[1]; + var e = r2['1']; +} + +//// [genericCallWithObjectTypeArgsAndIndexers.js] +function foo(x) { + return x; +} +var a; +var r = foo(a); +function other(arg) { + var b; + var r2 = foo(b); + var d = r2[1]; + var e = r2['1']; +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt new file mode 100644 index 0000000000000..b52fb5afbc76b --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts (3 errors) ==== + // Type inference infers from indexers in target type, error cases + + function foo(x: T) { + return x; + } + + function other(arg: T) { + var b: { + [x: string]: Object; + [x: number]: T; // ok, T is a subtype of Object because its apparent type is {} + }; + var r2 = foo(b); // T + } + + function other3(arg: T) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b: { + [x: string]: Object; + [x: number]: T; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'T' is not assignable to string index type 'Object'. + }; + var r2 = foo(b); + var d = r2[1]; + var e = r2['1']; + var u: U = r2[1]; // ok + ~~~~~~~~~~~~ +!!! Type 'T' is not assignable to type 'U'. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js new file mode 100644 index 0000000000000..acc7b64402d5d --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js @@ -0,0 +1,41 @@ +//// [genericCallWithObjectTypeArgsAndIndexersErrors.ts] +// Type inference infers from indexers in target type, error cases + +function foo(x: T) { + return x; +} + +function other(arg: T) { + var b: { + [x: string]: Object; + [x: number]: T; // ok, T is a subtype of Object because its apparent type is {} + }; + var r2 = foo(b); // T +} + +function other3(arg: T) { + var b: { + [x: string]: Object; + [x: number]: T; + }; + var r2 = foo(b); + var d = r2[1]; + var e = r2['1']; + var u: U = r2[1]; // ok +} + +//// [genericCallWithObjectTypeArgsAndIndexersErrors.js] +function foo(x) { + return x; +} +function other(arg) { + var b; + var r2 = foo(b); +} +function other3(arg) { + var b; + var r2 = foo(b); + var d = r2[1]; + var e = r2['1']; + var u = r2[1]; +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt new file mode 100644 index 0000000000000..880e0895c3226 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (11 errors) ==== + // Generic typed parameters with initializers + + function foo(x: T = null) { return x; } // ok + function foo2(x: T = undefined) { return x; } // ok + function foo3(x: T = 1) { } // error + ~~~~~~~~ +!!! Type 'number' is not assignable to type 'T'. + function foo4(x: T, y: U = x) { } // error + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~ +!!! Type 'T' is not assignable to type 'U'. + function foo5(x: U, y: T = x) { } // ok + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~ +!!! Type 'U' is not assignable to type 'T'. + function foo6(x: T, y: U, z: V = y) { } // error + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~ +!!! Type 'U' is not assignable to type 'V'. + function foo7(x: V, y: U = x) { } // should be ok + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~ +!!! Type 'V' is not assignable to type 'U'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js new file mode 100644 index 0000000000000..1795b32ca2336 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js @@ -0,0 +1,35 @@ +//// [genericCallWithObjectTypeArgsAndInitializers.ts] +// Generic typed parameters with initializers + +function foo(x: T = null) { return x; } // ok +function foo2(x: T = undefined) { return x; } // ok +function foo3(x: T = 1) { } // error +function foo4(x: T, y: U = x) { } // error +function foo5(x: U, y: T = x) { } // ok +function foo6(x: T, y: U, z: V = y) { } // error +function foo7(x: V, y: U = x) { } // should be ok + +//// [genericCallWithObjectTypeArgsAndInitializers.js] +function foo(x) { + if (x === void 0) { x = null; } + return x; +} +function foo2(x) { + if (x === void 0) { x = undefined; } + return x; +} +function foo3(x) { + if (x === void 0) { x = 1; } +} +function foo4(x, y) { + if (y === void 0) { y = x; } +} +function foo5(x, y) { + if (y === void 0) { y = x; } +} +function foo6(x, y, z) { + if (z === void 0) { z = y; } +} +function foo7(x, y) { + if (y === void 0) { y = x; } +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js new file mode 100644 index 0000000000000..c994288461889 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js @@ -0,0 +1,56 @@ +//// [genericCallWithObjectTypeArgsAndNumericIndexer.ts] +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { + return x; +} + +var a: { [x: number]: Date }; +var r = foo(a); + +function other(arg: T) { + var b: { [x: number]: T }; + var r2 = foo(b); // T +} + +function other2(arg: T) { + var b: { [x: number]: T }; + var r2 = foo(b); + var d = r2[1]; +} + +function other3(arg: T) { + var b: { [x: number]: T }; + var r2 = foo(b); + var d = r2[1]; + // BUG 821629 + //var u: U = r2[1]; // ok +} +//function other3(arg: T) { +// var b: { [x: number]: T }; +// var r2 = foo(b); +// var d = r2[1]; +// // BUG 821629 +// //var u: U = r2[1]; // ok +//} + +//// [genericCallWithObjectTypeArgsAndNumericIndexer.js] +function foo(x) { + return x; +} +var a; +var r = foo(a); +function other(arg) { + var b; + var r2 = foo(b); +} +function other2(arg) { + var b; + var r2 = foo(b); + var d = r2[1]; +} +function other3(arg) { + var b; + var r2 = foo(b); + var d = r2[1]; +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js new file mode 100644 index 0000000000000..cd1deb76760cf --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js @@ -0,0 +1,57 @@ +//// [genericCallWithObjectTypeArgsAndStringIndexer.ts] +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { + return x; +} + +var a: { [x: string]: Date }; +var r = foo(a); + +function other(arg: T) { + var b: { [x: string]: T }; + var r2 = foo(b); // T +} + +function other2(arg: T) { + var b: { [x: string]: T }; + var r2 = foo(b); + var d: Date = r2['hm']; // ok +} + +function other3(arg: T) { + var b: { [x: string]: T }; + var r2 = foo(b); + var d: Date = r2['hm']; // ok + // BUG 821629 + //var u: U = r2['hm']; // ok +} + +//function other3(arg: T) { +// var b: { [x: string]: T }; +// var r2 = foo(b); +// var d: Date = r2['hm']; // ok +// // BUG 821629 +// //var u: U = r2['hm']; // ok +//} + +//// [genericCallWithObjectTypeArgsAndStringIndexer.js] +function foo(x) { + return x; +} +var a; +var r = foo(a); +function other(arg) { + var b; + var r2 = foo(b); +} +function other2(arg) { + var b; + var r2 = foo(b); + var d = r2['hm']; +} +function other3(arg) { + var b; + var r2 = foo(b); + var d = r2['hm']; +} diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js new file mode 100644 index 0000000000000..3057287d91416 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js @@ -0,0 +1,84 @@ +//// [genericCallWithOverloadedConstructorTypedArguments.ts] +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { + var a: { + new(x: boolean): boolean; + new(x: string): string; + } + + function foo4(cb: typeof a) { + return new cb(null); + } + + var r = foo4(a); + var b: { new (x: T): T }; + var r2 = foo4(b); +} + +module GenericParameter { + function foo5(cb: { new(x: T): string; new(x: number): T }) { + return cb; + } + + var a: { + new (x: boolean): string; + new (x: number): boolean; + } + var r5 = foo5(a); // new{} => string; new(x:number) => {} + var b: { new(x: T): string; new(x: number): T; } + var r7 = foo5(b); // new any => string; new(x:number) => any + + function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r8 = foo6(a); // new{} => string; new(x:{}, y?:{}) => string + var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string + + function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string + var c: { new (x: T): string; (x: number): T; } + var c2: { new (x: T): string; new(x: number): T; } + var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string + var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string +} + +//// [genericCallWithOverloadedConstructorTypedArguments.js] +var NonGenericParameter; +(function (NonGenericParameter) { + var a; + function foo4(cb) { + return new cb(null); + } + var r = foo4(a); + var b; + var r2 = foo4(b); +})(NonGenericParameter || (NonGenericParameter = {})); +var GenericParameter; +(function (GenericParameter) { + function foo5(cb) { + return cb; + } + var a; + var r5 = foo5(a); + var b; + var r7 = foo5(b); + function foo6(cb) { + return cb; + } + var r8 = foo6(a); + var r9 = foo6(b); + function foo7(x, cb) { + return cb; + } + var r13 = foo7(1, b); + var c; + var c2; + var r14 = foo7(1, c); + var r15 = foo7(1, c2); +})(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt new file mode 100644 index 0000000000000..5218e61a2c9b5 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== + // Function typed arguments with multiple signatures must be passed an implementation that matches all of them + // Inferences are made quadratic-pairwise to and from these overload sets + + module NonGenericParameter { + var a: { + new(x: boolean): boolean; + new(x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var b: { new (x: T): U } + var r3 = foo4(b); // ok + } + + module GenericParameter { + function foo5(cb: { new(x: T): string; new(x: number): T }) { + return cb; + } + + var a: { new (x: T): T }; + var r6 = foo5(a); // ok + + function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var b: { new (x: T, y: T): string }; + var r10 = foo6(b); // error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, a); // ok + var c: { new(x: T): number; new(x: number): T; } + var r14 = foo7(1, c); // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js new file mode 100644 index 0000000000000..097059f2cb1b3 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js @@ -0,0 +1,71 @@ +//// [genericCallWithOverloadedConstructorTypedArguments2.ts] +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { + var a: { + new(x: boolean): boolean; + new(x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var b: { new (x: T): U } + var r3 = foo4(b); // ok +} + +module GenericParameter { + function foo5(cb: { new(x: T): string; new(x: number): T }) { + return cb; + } + + var a: { new (x: T): T }; + var r6 = foo5(a); // ok + + function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var b: { new (x: T, y: T): string }; + var r10 = foo6(b); // error + + function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, a); // ok + var c: { new(x: T): number; new(x: number): T; } + var r14 = foo7(1, c); // ok +} + +//// [genericCallWithOverloadedConstructorTypedArguments2.js] +var NonGenericParameter; +(function (NonGenericParameter) { + var a; + function foo4(cb) { + return cb; + } + var b; + var r3 = foo4(b); +})(NonGenericParameter || (NonGenericParameter = {})); +var GenericParameter; +(function (GenericParameter) { + function foo5(cb) { + return cb; + } + var a; + var r6 = foo5(a); + function foo6(cb) { + return cb; + } + var b; + var r10 = foo6(b); + function foo7(x, cb) { + return cb; + } + var r13 = foo7(1, a); + var c; + var r14 = foo7(1, c); +})(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js new file mode 100644 index 0000000000000..aea863d8b64e2 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js @@ -0,0 +1,79 @@ +//// [genericCallWithOverloadedFunctionTypedArguments.ts] +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { + var a: { + (x: boolean): boolean; + (x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var r = foo4(a); + var r2 = foo4((x: T) => x); + var r4 = foo4(x => x); +} + +module GenericParameter { + function foo5(cb: { (x: T): string; (x: number): T }) { + return cb; + } + + var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var a: { (x: T): string; (x: number): T; } + var r7 = foo5(a); // any => string (+1 overload) + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var r9 = foo6((x: T) => ''); // any => string (+1 overload) + var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var a: { (x: T): string; (x: number): T; } + var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +} + +//// [genericCallWithOverloadedFunctionTypedArguments.js] +var NonGenericParameter; +(function (NonGenericParameter) { + var a; + function foo4(cb) { + return cb; + } + var r = foo4(a); + var r2 = foo4(function (x) { return x; }); + var r4 = foo4(function (x) { return x; }); +})(NonGenericParameter || (NonGenericParameter = {})); +var GenericParameter; +(function (GenericParameter) { + function foo5(cb) { + return cb; + } + var r5 = foo5(function (x) { return x; }); + var a; + var r7 = foo5(a); + function foo6(cb) { + return cb; + } + var r8 = foo6(function (x) { return x; }); + var r9 = foo6(function (x) { return ''; }); + var r11 = foo6(function (x, y) { return ''; }); + function foo7(x, cb) { + return cb; + } + var r12 = foo7(1, function (x) { return x; }); + var r13 = foo7(1, function (x) { return ''; }); + var a; + var r14 = foo7(1, a); +})(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt new file mode 100644 index 0000000000000..20a7c6f2f8c3d --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== + // Function typed arguments with multiple signatures must be passed an implementation that matches all of them + // Inferences are made quadratic-pairwise to and from these overload sets + + module NonGenericParameter { + var a: { + (x: boolean): boolean; + (x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var r3 = foo4((x: T) => { var r: U; return r }); // ok + } + + module GenericParameter { + function foo5(cb: { (x: T): string; (x: number): T }) { + return cb; + } + + var r6 = foo5((x: T) => x); // ok + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r10 = foo6((x: T, y: T) => ''); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, (x: T) => x); // ok + var a: { (x: T): number; (x: number): T; } + var r14 = foo7(1, a); // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js new file mode 100644 index 0000000000000..dfe62bbc11a25 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js @@ -0,0 +1,68 @@ +//// [genericCallWithOverloadedFunctionTypedArguments2.ts] +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { + var a: { + (x: boolean): boolean; + (x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var r3 = foo4((x: T) => { var r: U; return r }); // ok +} + +module GenericParameter { + function foo5(cb: { (x: T): string; (x: number): T }) { + return cb; + } + + var r6 = foo5((x: T) => x); // ok + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r10 = foo6((x: T, y: T) => ''); // error + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, (x: T) => x); // ok + var a: { (x: T): number; (x: number): T; } + var r14 = foo7(1, a); // ok +} + +//// [genericCallWithOverloadedFunctionTypedArguments2.js] +var NonGenericParameter; +(function (NonGenericParameter) { + var a; + function foo4(cb) { + return cb; + } + var r3 = foo4(function (x) { + var r; + return r; + }); +})(NonGenericParameter || (NonGenericParameter = {})); +var GenericParameter; +(function (GenericParameter) { + function foo5(cb) { + return cb; + } + var r6 = foo5(function (x) { return x; }); + function foo6(cb) { + return cb; + } + var r10 = foo6(function (x, y) { return ''; }); + function foo7(x, cb) { + return cb; + } + var r13 = foo7(1, function (x) { return x; }); + var a; + var r14 = foo7(1, a); +})(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithoutArgs.errors.txt b/tests/baselines/reference/genericCallWithoutArgs.errors.txt new file mode 100644 index 0000000000000..5756cc000d2bd --- /dev/null +++ b/tests/baselines/reference/genericCallWithoutArgs.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/genericCallWithoutArgs.ts (4 errors) ==== + function f(x: X, y: Y) { + } + + f. + ~ +!!! Expression expected. + +!!! Identifier expected. + ~~~~~~ +!!! Cannot find name 'number'. + ~~~~~~ +!!! Cannot find name 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt new file mode 100644 index 0000000000000..a29f1ddc42c2f --- /dev/null +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts (8 errors) ==== + function foo(x:T, y:U, f: (v: T) => U) { + var r1 = f(1); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r2 = f(1); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + var r3 = f(null); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r4 = f(null); + + var r11 = f(x); + var r21 = f(x); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r31 = f(null); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r41 = f(null); + + var r12 = f(y); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + var r22 = f(y); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r32 = f(null); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r42 = f(null); + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.js b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.js new file mode 100644 index 0000000000000..b2d16fa030bd4 --- /dev/null +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.js @@ -0,0 +1,33 @@ +//// [genericCallbackInvokedInsideItsContainingFunction1.ts] +function foo(x:T, y:U, f: (v: T) => U) { + var r1 = f(1); + var r2 = f(1); + var r3 = f(null); + var r4 = f(null); + + var r11 = f(x); + var r21 = f(x); + var r31 = f(null); + var r41 = f(null); + + var r12 = f(y); + var r22 = f(y); + var r32 = f(null); + var r42 = f(null); +} + +//// [genericCallbackInvokedInsideItsContainingFunction1.js] +function foo(x, y, f) { + var r1 = f(1); + var r2 = f(1); + var r3 = f(null); + var r4 = f(null); + var r11 = f(x); + var r21 = f(x); + var r31 = f(null); + var r41 = f(null); + var r12 = f(y); + var r22 = f(y); + var r32 = f(null); + var r42 = f(null); +} diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js new file mode 100644 index 0000000000000..7cf2cc22fbe81 --- /dev/null +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -0,0 +1,69 @@ +//// [genericCallbacksAndClassHierarchy.ts] +module M { + export interface I { + subscribe(callback: (newValue: T) => void ): any; + } + export class C1 { + public value: I; + } + export class A { + public dummy: any; + } + export class B extends C1> { } + export class D { + _subscribe(viewModel: B): void { + var f = (newValue: A) => { }; + + var v: I> = viewModel.value; + + // both of these should work + v.subscribe(f); + v.subscribe((newValue: A) => { }); + } + } +} + +//// [genericCallbacksAndClassHierarchy.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + M.C1 = C1; + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(C1); + M.B = B; + var D = (function () { + function D() { + } + D.prototype._subscribe = function (viewModel) { + var f = function (newValue) { + }; + var v = viewModel.value; + v.subscribe(f); + v.subscribe(function (newValue) { + }); + }; + return D; + })(); + M.D = D; +})(M || (M = {})); diff --git a/tests/baselines/reference/genericCallsWithoutParens.errors.txt b/tests/baselines/reference/genericCallsWithoutParens.errors.txt new file mode 100644 index 0000000000000..bfce0d2bf222b --- /dev/null +++ b/tests/baselines/reference/genericCallsWithoutParens.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/genericCallsWithoutParens.ts (4 errors) ==== + function f() { } + var r = f; // parse error + ~ +!!! Expression expected. + ~~~~~~ +!!! Cannot find name 'number'. + + class C { + foo: T; + } + var c = new C; // parse error + ~ +!!! Expression expected. + ~~~~~~ +!!! Cannot find name 'number'. + + \ No newline at end of file diff --git a/tests/baselines/reference/genericChainedCalls.errors.txt b/tests/baselines/reference/genericChainedCalls.errors.txt new file mode 100644 index 0000000000000..96ef5a3340f22 --- /dev/null +++ b/tests/baselines/reference/genericChainedCalls.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/genericChainedCalls.ts (2 errors) ==== + interface I1 { + func(callback: (value: T) => U): I1; + } + + declare var v1: I1; + + var r1 = v1.func(num => num.toString()) + .func(str => str.length) // error, number doesn't have a length + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. + .func(num => num.toString()) + + var s1 = v1.func(num => num.toString()) + var s2 = s1.func(str => str.length) // should also error + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. + var s3 = s2.func(num => num.toString()) + \ No newline at end of file diff --git a/tests/baselines/reference/genericChainedCalls.js b/tests/baselines/reference/genericChainedCalls.js new file mode 100644 index 0000000000000..536d156196e1a --- /dev/null +++ b/tests/baselines/reference/genericChainedCalls.js @@ -0,0 +1,21 @@ +//// [genericChainedCalls.ts] +interface I1 { + func(callback: (value: T) => U): I1; +} + +declare var v1: I1; + +var r1 = v1.func(num => num.toString()) + .func(str => str.length) // error, number doesn't have a length + .func(num => num.toString()) + +var s1 = v1.func(num => num.toString()) +var s2 = s1.func(str => str.length) // should also error +var s3 = s2.func(num => num.toString()) + + +//// [genericChainedCalls.js] +var r1 = v1.func(function (num) { return num.toString(); }).func(function (str) { return str.length; }).func(function (num) { return num.toString(); }); +var s1 = v1.func(function (num) { return num.toString(); }); +var s2 = s1.func(function (str) { return str.length; }); +var s3 = s2.func(function (num) { return num.toString(); }); diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js new file mode 100644 index 0000000000000..fa8097fdecce1 --- /dev/null +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.js @@ -0,0 +1,22 @@ +//// [genericClassImplementingGenericInterfaceFromAnotherModule.ts] +module foo { + export interface IFoo { } +} +module bar { + export class Foo implements foo.IFoo { } +} + + +//// [genericClassImplementingGenericInterfaceFromAnotherModule.js] +var bar; +(function (bar) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + bar.Foo = Foo; +})(bar || (bar = {})); + + +//// [genericClassImplementingGenericInterfaceFromAnotherModule.d.ts] diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js new file mode 100644 index 0000000000000..489ecd0f05975 --- /dev/null +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -0,0 +1,33 @@ +//// [genericClassInheritsConstructorFromNonGenericClass.ts] +class A extends B { } +class B extends C { } +class C { + constructor(p: string) { } +} + +//// [genericClassInheritsConstructorFromNonGenericClass.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(B); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(C); +var C = (function () { + function C(p) { + } + return C; +})(); diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js new file mode 100644 index 0000000000000..52e66dafb7b16 --- /dev/null +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -0,0 +1,130 @@ +//// [genericClassPropertyInheritanceSpecialization.ts] +interface KnockoutObservableBase { + peek(): T; + (): T; + (value: T): void; +} + +interface KnockoutObservable extends KnockoutObservableBase { + equalityComparer(a: T, b: T): boolean; + valueHasMutated(): void; + valueWillMutate(): void; +} + +interface KnockoutObservableArray extends KnockoutObservable { + indexOf(searchElement: T, fromIndex?: number): number; + slice(start: number, end?: number): T[]; + splice(start: number, deleteCount?: number, ...items: T[]): T[]; + pop(): T; + push(...items: T[]): void; + shift(): T; + unshift(...items: T[]): number; + reverse(): T[]; + sort(compareFunction?: (a: T, b: T) => number): void; + replace(oldItem: T, newItem: T): void; + remove(item: T): T[]; + removeAll(items?: T[]): T[]; + destroy(item: T): void; + destroyAll(items?: T[]): void; +} + +interface KnockoutObservableArrayStatic { + fn: KnockoutObservableArray; + + (value?: T[]): KnockoutObservableArray; +} + +declare module ko { + export var observableArray: KnockoutObservableArrayStatic; +} + +module Portal.Controls.Validators { + + export class Validator { + private _subscription; + public message: KnockoutObservable; + public validationState: KnockoutObservable; + public validate: KnockoutObservable; + constructor(message?: string) { } + public destroy(): void { } + public _validate(value: TValue): number {return 0 } + } +} + +module PortalFx.ViewModels.Controls.Validators { + + export class Validator extends Portal.Controls.Validators.Validator { + + constructor(message?: string) { + super(message); + } + } + +} + +interface Contract { + + validators: KnockoutObservableArray>; +} + + +class ViewModel implements Contract { + + public validators: KnockoutObservableArray> = ko.observableArray>(); +} + + + +//// [genericClassPropertyInheritanceSpecialization.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Portal; +(function (Portal) { + (function (Controls) { + (function (Validators) { + var Validator = (function () { + function Validator(message) { + } + Validator.prototype.destroy = function () { + }; + Validator.prototype._validate = function (value) { + return 0; + }; + return Validator; + })(); + Validators.Validator = Validator; + })(Controls.Validators || (Controls.Validators = {})); + var Validators = Controls.Validators; + })(Portal.Controls || (Portal.Controls = {})); + var Controls = Portal.Controls; +})(Portal || (Portal = {})); +var PortalFx; +(function (PortalFx) { + (function (ViewModels) { + (function (Controls) { + (function (Validators) { + var Validator = (function (_super) { + __extends(Validator, _super); + function Validator(message) { + _super.call(this, message); + } + return Validator; + })(Portal.Controls.Validators.Validator); + Validators.Validator = Validator; + })(Controls.Validators || (Controls.Validators = {})); + var Validators = Controls.Validators; + })(ViewModels.Controls || (ViewModels.Controls = {})); + var Controls = ViewModels.Controls; + })(PortalFx.ViewModels || (PortalFx.ViewModels = {})); + var ViewModels = PortalFx.ViewModels; +})(PortalFx || (PortalFx = {})); +var ViewModel = (function () { + function ViewModel() { + this.validators = ko.observableArray(); + } + return ViewModel; +})(); diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js new file mode 100644 index 0000000000000..71dafd8ee8bc7 --- /dev/null +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -0,0 +1,35 @@ +//// [genericClassStaticMethod.ts] +class Foo { + static getFoo() { + } +} + +class Bar extends Foo { + static getFoo() { + } +} + + +//// [genericClassStaticMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function () { + function Foo() { + } + Foo.getFoo = function () { + }; + return Foo; +})(); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + Bar.getFoo = function () { + }; + return Bar; +})(Foo); diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js new file mode 100644 index 0000000000000..e12e5a19e8cee --- /dev/null +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js @@ -0,0 +1,141 @@ +//// [genericClassWithFunctionTypedMemberArguments.ts] +// Generic functions used as arguments for function typed parameters are not used to make inferences from +// Using function arguments, no errors expected + +module ImmediatelyFix { + class C { + foo(x: (a: T) => T) { + return x(null); + } + } + + var c = new C(); + var r = c.foo((x: U) => ''); // {} + var r2 = c.foo((x: U) => ''); // string + var r3 = c.foo(x => ''); // {} + + class C2 { + foo(x: (a: T) => T) { + return x(null); + } + } + + var c2 = new C2(); + var ra = c2.foo((x: U) => 1); // number + var r3a = c2.foo(x => 1); // number +} + +module WithCandidates { + class C { + foo2(x: T, cb: (a: T) => U) { + return cb(x); + } + } + + var c: C; + var r4 = c.foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions + var r5 = c.foo2(1, (a) => ''); // string + var r6 = c.foo2('', (a: Z) => 1); // number + + class C2 { + foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); + } + } + + var c2: C2; + var r7 = c2.foo3(1, (a: Z) => '', ''); // string + var r8 = c2.foo3(1, function (a) { return '' }, ''); // string + + class C3 { + foo3(x: T, cb: (a: T) => U, y: U) { + return cb(x); + } + } + var c3: C3; + + function other(t: T, u: U) { + var r10 = c.foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made + var r10 = c.foo2(1, (x) => ''); // string + + var r11 = c3.foo3(1, (x: T) => '', ''); // string + var r11b = c3.foo3(1, (x: T) => '', 1); // {} + var r12 = c3.foo3(1, function (a) { return '' }, 1); // {} + } +} + +//// [genericClassWithFunctionTypedMemberArguments.js] +var ImmediatelyFix; +(function (ImmediatelyFix) { + var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return x(null); + }; + return C; + })(); + var c = new C(); + var r = c.foo(function (x) { return ''; }); + var r2 = c.foo(function (x) { return ''; }); + var r3 = c.foo(function (x) { return ''; }); + var C2 = (function () { + function C2() { + } + C2.prototype.foo = function (x) { + return x(null); + }; + return C2; + })(); + var c2 = new C2(); + var ra = c2.foo(function (x) { return 1; }); + var r3a = c2.foo(function (x) { return 1; }); +})(ImmediatelyFix || (ImmediatelyFix = {})); +var WithCandidates; +(function (WithCandidates) { + var C = (function () { + function C() { + } + C.prototype.foo2 = function (x, cb) { + return cb(x); + }; + return C; + })(); + var c; + var r4 = c.foo2(1, function (a) { + return ''; + }); + var r5 = c.foo2(1, function (a) { return ''; }); + var r6 = c.foo2('', function (a) { return 1; }); + var C2 = (function () { + function C2() { + } + C2.prototype.foo3 = function (x, cb, y) { + return cb(x); + }; + return C2; + })(); + var c2; + var r7 = c2.foo3(1, function (a) { return ''; }, ''); + var r8 = c2.foo3(1, function (a) { + return ''; + }, ''); + var C3 = (function () { + function C3() { + } + C3.prototype.foo3 = function (x, cb, y) { + return cb(x); + }; + return C3; + })(); + var c3; + function other(t, u) { + var r10 = c.foo2(1, function (x) { return ''; }); + var r10 = c.foo2(1, function (x) { return ''; }); + var r11 = c3.foo3(1, function (x) { return ''; }, ''); + var r11b = c3.foo3(1, function (x) { return ''; }, 1); + var r12 = c3.foo3(1, function (a) { + return ''; + }, 1); + } +})(WithCandidates || (WithCandidates = {})); diff --git a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js new file mode 100644 index 0000000000000..b1f306d485fd2 --- /dev/null +++ b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.js @@ -0,0 +1,118 @@ +//// [genericClassWithObjectTypeArgsAndConstraints.ts] +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { + x: string; +} + +class D { + x: string; + y: string; +} + +class X { + x: T; +} + +module Class { + class G { + foo(t: X, t2: X) { + var x: T; + return x; + } + } + + var c1 = new X(); + var d1 = new X(); + var g: G<{ x: string; y: string }>; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + + class G2 { + foo2(t: X, t2: X) { + var x: T; + return x; + } + } + var g2: G2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); +} + +module Interface { + interface G { + foo(t: X, t2: X): T; + } + + var c1 = new X(); + var d1 = new X(); + var g: G<{ x: string; y: string }>; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + + interface G2 { + foo2(t: X, t2: X): T; + } + + var g2: G2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); +} + +//// [genericClassWithObjectTypeArgsAndConstraints.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var X = (function () { + function X() { + } + return X; +})(); +var Class; +(function (Class) { + var G = (function () { + function G() { + } + G.prototype.foo = function (t, t2) { + var x; + return x; + }; + return G; + })(); + var c1 = new X(); + var d1 = new X(); + var g; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + var G2 = (function () { + function G2() { + } + G2.prototype.foo2 = function (t, t2) { + var x; + return x; + }; + return G2; + })(); + var g2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); +})(Class || (Class = {})); +var Interface; +(function (Interface) { + var c1 = new X(); + var d1 = new X(); + var g; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + var g2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); +})(Interface || (Interface = {})); diff --git a/tests/baselines/reference/genericClassWithStaticFactory.js b/tests/baselines/reference/genericClassWithStaticFactory.js new file mode 100644 index 0000000000000..72cb53fefad77 --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticFactory.js @@ -0,0 +1,266 @@ +//// [genericClassWithStaticFactory.ts] +module Editor { + + export class List { + public next: List; + public prev: List; + private listFactory: ListFactory; + + constructor(public isHead: boolean, public data: T) { + this.listFactory = new ListFactory(); + + } + + public add(data: T): List { + var entry = this.listFactory.MakeEntry(data); + + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public count(): number { + var entry: List; + var i: number; + + entry = this.next; + for (i = 0; !(entry.isHead); i++) { + entry = entry.next; + } + + return (i); + } + + public isEmpty(): boolean { + return (this.next == this); + } + + public first(): T { + if (this.isEmpty()) + { + return this.next.data; + } + else { + return null; + } + } + + public pushEntry(entry: List): void { + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does + } + + public push(data: T): void { + var entry = this.listFactory.MakeEntry(data); + entry.data = data; + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does + } + + public popEntry(head: List): List { + if (this.next.isHead) { + return null; + } + else { + return this.listFactory.RemoveEntry(this.next); + } + } + + public insertEntry(entry: List): List { + entry.isHead = false; + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public insertAfter(data: T): List { + var entry: List = this.listFactory.MakeEntry(data); + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry;// entry.next.prev does not show intellisense, but entry.prev.prev does + return entry; + } + + public insertEntryBefore(entry: List): List { + this.prev.next = entry; + + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public insertBefore(data: T): List { + var entry = this.listFactory.MakeEntry(data); + return this.insertEntryBefore(entry); + } + } + + export class ListFactory { + + public MakeHead(): List { + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public MakeEntry(data: T): List { + var entry: List = new List(false, data); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public RemoveEntry(entry: List): List { + if (entry == null) { + return null; + } + else if (entry.isHead) { + // Can't remove the head of a list! + return null; + } + else { + entry.next.prev = entry.prev; + entry.prev.next = entry.next; + + return entry; + } + } + } +} + +//// [genericClassWithStaticFactory.js] +var Editor; +(function (Editor) { + var List = (function () { + function List(isHead, data) { + this.isHead = isHead; + this.data = data; + this.listFactory = new ListFactory(); + } + List.prototype.add = function (data) { + var entry = this.listFactory.MakeEntry(data); + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + }; + List.prototype.count = function () { + var entry; + var i; + entry = this.next; + for (i = 0; !(entry.isHead); i++) { + entry = entry.next; + } + return (i); + }; + List.prototype.isEmpty = function () { + return (this.next == this); + }; + List.prototype.first = function () { + if (this.isEmpty()) { + return this.next.data; + } + else { + return null; + } + }; + List.prototype.pushEntry = function (entry) { + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; + }; + List.prototype.push = function (data) { + var entry = this.listFactory.MakeEntry(data); + entry.data = data; + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; + }; + List.prototype.popEntry = function (head) { + if (this.next.isHead) { + return null; + } + else { + return this.listFactory.RemoveEntry(this.next); + } + }; + List.prototype.insertEntry = function (entry) { + entry.isHead = false; + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + }; + List.prototype.insertAfter = function (data) { + var entry = this.listFactory.MakeEntry(data); + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; + return entry; + }; + List.prototype.insertEntryBefore = function (entry) { + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + }; + List.prototype.insertBefore = function (data) { + var entry = this.listFactory.MakeEntry(data); + return this.insertEntryBefore(entry); + }; + return List; + })(); + Editor.List = List; + var ListFactory = (function () { + function ListFactory() { + } + ListFactory.prototype.MakeHead = function () { + var entry = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + }; + ListFactory.prototype.MakeEntry = function (data) { + var entry = new List(false, data); + entry.prev = entry; + entry.next = entry; + return entry; + }; + ListFactory.prototype.RemoveEntry = function (entry) { + if (entry == null) { + return null; + } + else if (entry.isHead) { + return null; + } + else { + entry.next.prev = entry.prev; + entry.prev.next = entry.next; + return entry; + } + }; + return ListFactory; + })(); + Editor.ListFactory = ListFactory; +})(Editor || (Editor = {})); diff --git a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt new file mode 100644 index 0000000000000..588e70eb39ed4 --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts (7 errors) ==== + // Should be error to use 'T' in all declarations within Foo. + class Foo { + static a = (n: T) => { }; + ~ +!!! Static members cannot reference class type parameters. + + static b: T; + ~ +!!! Static members cannot reference class type parameters. + + static c: T[] = []; + ~ +!!! Static members cannot reference class type parameters. + + static d = false || ((x: T) => x || undefined)(null) + ~ +!!! Static members cannot reference class type parameters. + + static e = function (x: T) { return null; } + ~ +!!! Static members cannot reference class type parameters. + + static f(xs: T[]): T[] { + ~ +!!! Static members cannot reference class type parameters. + ~ +!!! Static members cannot reference class type parameters. + return xs.reverse(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js new file mode 100644 index 0000000000000..24890476cabba --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.js @@ -0,0 +1,35 @@ +//// [genericClassWithStaticsUsingTypeArguments.ts] +// Should be error to use 'T' in all declarations within Foo. +class Foo { + static a = (n: T) => { }; + + static b: T; + + static c: T[] = []; + + static d = false || ((x: T) => x || undefined)(null) + + static e = function (x: T) { return null; } + + static f(xs: T[]): T[] { + return xs.reverse(); + } +} + + +//// [genericClassWithStaticsUsingTypeArguments.js] +var Foo = (function () { + function Foo() { + } + Foo.f = function (xs) { + return xs.reverse(); + }; + Foo.a = function (n) { + }; + Foo.c = []; + Foo.d = false || (function (x) { return x || undefined; })(null); + Foo.e = function (x) { + return null; + }; + return Foo; +})(); diff --git a/tests/baselines/reference/genericClasses0.js b/tests/baselines/reference/genericClasses0.js new file mode 100644 index 0000000000000..9765a3a1c2d8e --- /dev/null +++ b/tests/baselines/reference/genericClasses0.js @@ -0,0 +1,20 @@ +//// [genericClasses0.ts] +class C { + public x: T; +} + +var v1 : C; + +var y = v1.x; // should be 'string' + +//// [genericClasses0.js] +var C = (function () { + function C() { + } + return C; +})(); +var v1; +var y = v1.x; + + +//// [genericClasses0.d.ts] diff --git a/tests/baselines/reference/genericClasses1.js b/tests/baselines/reference/genericClasses1.js new file mode 100644 index 0000000000000..9a08642ecdaac --- /dev/null +++ b/tests/baselines/reference/genericClasses1.js @@ -0,0 +1,20 @@ +//// [genericClasses1.ts] +class C { + public x: T; +} + +var v1 = new C(); + +var y = v1.x; // should be 'string' + +//// [genericClasses1.js] +var C = (function () { + function C() { + } + return C; +})(); +var v1 = new C(); +var y = v1.x; + + +//// [genericClasses1.d.ts] diff --git a/tests/baselines/reference/genericClasses2.js b/tests/baselines/reference/genericClasses2.js new file mode 100644 index 0000000000000..e81864dae6d41 --- /dev/null +++ b/tests/baselines/reference/genericClasses2.js @@ -0,0 +1,30 @@ +//// [genericClasses2.ts] +interface Foo { + a: T; +} + +class C { + public x: T; + public y: Foo; + public z: Foo; +} + +var v1 : C; + +var y = v1.x; // should be 'string' +var w = v1.y.a; // should be 'string' +var z = v1.z.a; // should be 'number' + +//// [genericClasses2.js] +var C = (function () { + function C() { + } + return C; +})(); +var v1; +var y = v1.x; +var w = v1.y.a; +var z = v1.z.a; + + +//// [genericClasses2.d.ts] diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js new file mode 100644 index 0000000000000..61c047d664ba6 --- /dev/null +++ b/tests/baselines/reference/genericClasses3.js @@ -0,0 +1,45 @@ +//// [genericClasses3.ts] +class B { + a: T; + b: T; +} + +class C extends B { + public x: T; +} + +var v2: C ; + +var y = v2.x; // should be 'string' +var u = v2.a; // should be 'string' + +var z = v2.b; + + + +//// [genericClasses3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B = (function () { + function B() { + } + return B; +})(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(B); +var v2; +var y = v2.x; +var u = v2.a; +var z = v2.b; + + +//// [genericClasses3.d.ts] diff --git a/tests/baselines/reference/genericClasses4.js b/tests/baselines/reference/genericClasses4.js new file mode 100644 index 0000000000000..4d00470f08a27 --- /dev/null +++ b/tests/baselines/reference/genericClasses4.js @@ -0,0 +1,39 @@ +//// [genericClasses4.ts] +// once caused stack overflow +class Vec2_T +{ + constructor(public x: A, public y: A) { } + fmap(f: (a: A) => B): Vec2_T { + var x:B = f(this.x); + var y:B = f(this.y); + var retval: Vec2_T = new Vec2_T(x, y); + return retval; + } + apply(f: Vec2_T<(a: A) => B>): Vec2_T { + var x:B = f.x(this.x); + var y:B = f.y(this.y); + var retval: Vec2_T = new Vec2_T(x, y); + return retval; + } +} + +//// [genericClasses4.js] +var Vec2_T = (function () { + function Vec2_T(x, y) { + this.x = x; + this.y = y; + } + Vec2_T.prototype.fmap = function (f) { + var x = f(this.x); + var y = f(this.y); + var retval = new Vec2_T(x, y); + return retval; + }; + Vec2_T.prototype.apply = function (f) { + var x = f.x(this.x); + var y = f.y(this.y); + var retval = new Vec2_T(x, y); + return retval; + }; + return Vec2_T; +})(); diff --git a/tests/baselines/reference/genericClassesInModule.js b/tests/baselines/reference/genericClassesInModule.js new file mode 100644 index 0000000000000..462abc9ebb7cc --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule.js @@ -0,0 +1,31 @@ +//// [genericClassesInModule.ts] + +module Foo { + + export class B{ } + + export class A { } +} + +var a = new Foo.B(); + +//// [genericClassesInModule.js] +var Foo; +(function (Foo) { + var B = (function () { + function B() { + } + return B; + })(); + Foo.B = B; + var A = (function () { + function A() { + } + return A; + })(); + Foo.A = A; +})(Foo || (Foo = {})); +var a = new Foo.B(); + + +//// [genericClassesInModule.d.ts] diff --git a/tests/baselines/reference/genericClassesInModule2.js b/tests/baselines/reference/genericClassesInModule2.js new file mode 100644 index 0000000000000..bd4c5a5e33adf --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule2.js @@ -0,0 +1,43 @@ +//// [genericClassesInModule2.ts] +export class A{ + constructor( public callback: (self: A) => void) { + var child = new B(this); + } + AAA( callback: (self: A) => void) { + var child = new B(this); + } +} + +export interface C{ + child: B; + (self: C): void; + new(callback: (self: C) => void) +} + +export class B { + constructor(public parent: T2) { } +} + + + +//// [genericClassesInModule2.js] +define(["require", "exports"], function (require, exports) { + var A = (function () { + function A(callback) { + this.callback = callback; + var child = new B(this); + } + A.prototype.AAA = function (callback) { + var child = new B(this); + }; + return A; + })(); + exports.A = A; + var B = (function () { + function B(parent) { + this.parent = parent; + } + return B; + })(); + exports.B = B; +}); diff --git a/tests/baselines/reference/genericClassesRedeclaration.errors.txt b/tests/baselines/reference/genericClassesRedeclaration.errors.txt new file mode 100644 index 0000000000000..63263f3d6a26f --- /dev/null +++ b/tests/baselines/reference/genericClassesRedeclaration.errors.txt @@ -0,0 +1,84 @@ +==== tests/cases/compiler/genericClassesRedeclaration.ts (3 errors) ==== + declare module TypeScript { + interface IIndexable { + [s: string]: T; + } + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } + } + + declare module TypeScript { + interface IIndexable { + [s: string]: T; + ~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + ~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'StringHashTable'. + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate identifier 'IdentiferNameHashTable'. + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassesRedeclaration.js b/tests/baselines/reference/genericClassesRedeclaration.js new file mode 100644 index 0000000000000..0d1b2661836ff --- /dev/null +++ b/tests/baselines/reference/genericClassesRedeclaration.js @@ -0,0 +1,80 @@ +//// [genericClassesRedeclaration.ts] +declare module TypeScript { + interface IIndexable { + [s: string]: T; + } + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } +} + +declare module TypeScript { + interface IIndexable { + [s: string]: T; + } + function createIntrinsicsObject(): IIndexable; + interface IHashTable { + getAllKeys(): string[]; + add(key: string, data: T): boolean; + addOrUpdate(key: string, data: T): boolean; + map(fn: (k: string, value: T, context: any) => void, context: any): void; + every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + count(): number; + lookup(key: string): T; + } + class StringHashTable implements IHashTable { + private itemCount; + private table; + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public count(): number; + public lookup(key: string): T; + public remove(key: string): void; + } + class IdentiferNameHashTable extends StringHashTable { + public getAllKeys(): string[]; + public add(key: string, data: T): boolean; + public addOrUpdate(key: string, data: T): boolean; + public map(fn: (k: string, value: T, context: any) => void, context: any): void; + public every(fn: (k: string, value: T, context: any) => void, context: any): boolean; + public some(fn: (k: string, value: any, context: any) => void, context: any): boolean; + public lookup(key: string): T; + } +} + +//// [genericClassesRedeclaration.js] diff --git a/tests/baselines/reference/genericCloduleInModule.js b/tests/baselines/reference/genericCloduleInModule.js new file mode 100644 index 0000000000000..9e39b518a03bd --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule.js @@ -0,0 +1,34 @@ +//// [genericCloduleInModule.ts] +module A { + export class B { + foo() { } + static bar() { } + } + export module B { + export var x = 1; + } +} + +var b: A.B; +b.foo(); + +//// [genericCloduleInModule.js] +var A; +(function (A) { + var B = (function () { + function B() { + } + B.prototype.foo = function () { + }; + B.bar = function () { + }; + return B; + })(); + A.B = B; + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var b; +b.foo(); diff --git a/tests/baselines/reference/genericCloduleInModule2.errors.txt b/tests/baselines/reference/genericCloduleInModule2.errors.txt new file mode 100644 index 0000000000000..38202cd40e7d7 --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule2.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/genericCloduleInModule2.ts (1 errors) ==== + module A { + export class B { + foo() { } + static bar() { } + } + } + + module A { + export module B { + export var x = 1; + } + } + + var b: A.B; + ~~~ +!!! Generic type 'B' requires 1 type argument(s). + b.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/genericCloduleInModule2.js b/tests/baselines/reference/genericCloduleInModule2.js new file mode 100644 index 0000000000000..689f6d7da7b6a --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule2.js @@ -0,0 +1,40 @@ +//// [genericCloduleInModule2.ts] +module A { + export class B { + foo() { } + static bar() { } + } +} + +module A { + export module B { + export var x = 1; + } +} + +var b: A.B; +b.foo(); + +//// [genericCloduleInModule2.js] +var A; +(function (A) { + var B = (function () { + function B() { + } + B.prototype.foo = function () { + }; + B.bar = function () { + }; + return B; + })(); + A.B = B; +})(A || (A = {})); +var A; +(function (A) { + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var b; +b.foo(); diff --git a/tests/baselines/reference/genericCloneReturnTypes.errors.txt b/tests/baselines/reference/genericCloneReturnTypes.errors.txt new file mode 100644 index 0000000000000..f2ba42e016832 --- /dev/null +++ b/tests/baselines/reference/genericCloneReturnTypes.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/genericCloneReturnTypes.ts (1 errors) ==== + class Bar { + + public size: number; + public t: T; + + constructor(x: number) { + + this.size = x; + + } + + public clone() { + + return new Bar(this.size); + + } + + } + + var b: Bar; + + var b2 = b.clone(); + var b3: Bar; + b = b2; + b = b3; + ~ +!!! Type 'Bar' is not assignable to type 'Bar': +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes.js b/tests/baselines/reference/genericCloneReturnTypes.js new file mode 100644 index 0000000000000..d7a279fb0bc2d --- /dev/null +++ b/tests/baselines/reference/genericCloneReturnTypes.js @@ -0,0 +1,42 @@ +//// [genericCloneReturnTypes.ts] +class Bar { + + public size: number; + public t: T; + + constructor(x: number) { + + this.size = x; + + } + + public clone() { + + return new Bar(this.size); + + } + +} + +var b: Bar; + +var b2 = b.clone(); +var b3: Bar; +b = b2; +b = b3; + +//// [genericCloneReturnTypes.js] +var Bar = (function () { + function Bar(x) { + this.size = x; + } + Bar.prototype.clone = function () { + return new Bar(this.size); + }; + return Bar; +})(); +var b; +var b2 = b.clone(); +var b3; +b = b2; +b = b3; diff --git a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt new file mode 100644 index 0000000000000..78565dca335c8 --- /dev/null +++ b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/genericCloneReturnTypes2.ts (1 errors) ==== + class MyList { + public size: number; + public data: T[]; + constructor(n: number) { + this.size = n; + this.data = new Array(this.size); + } + public clone() { + return new MyList(this.size); + } + } + var a: MyList; + var b: MyList = a.clone(); // ok + var c: MyList = a.clone(); // bug was there was an error on this line + var d: MyList = a.clone(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'MyList' is not assignable to type 'MyList': +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes2.js b/tests/baselines/reference/genericCloneReturnTypes2.js new file mode 100644 index 0000000000000..5784e3bbec37a --- /dev/null +++ b/tests/baselines/reference/genericCloneReturnTypes2.js @@ -0,0 +1,32 @@ +//// [genericCloneReturnTypes2.ts] +class MyList { + public size: number; + public data: T[]; + constructor(n: number) { + this.size = n; + this.data = new Array(this.size); + } + public clone() { + return new MyList(this.size); + } +} +var a: MyList; +var b: MyList = a.clone(); // ok +var c: MyList = a.clone(); // bug was there was an error on this line +var d: MyList = a.clone(); // error + +//// [genericCloneReturnTypes2.js] +var MyList = (function () { + function MyList(n) { + this.size = n; + this.data = new Array(this.size); + } + MyList.prototype.clone = function () { + return new MyList(this.size); + }; + return MyList; +})(); +var a; +var b = a.clone(); +var c = a.clone(); +var d = a.clone(); diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt new file mode 100644 index 0000000000000..6de8cc66c30b5 --- /dev/null +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/genericCombinators2.ts (2 errors) ==== + interface Collection { + length: number; + add(x: T, y: U): void; + remove(x: T, y: U): boolean; + } + + interface Combinators { + map(c: Collection, f: (x: T, y: U) => any): Collection; + map(c: Collection, f: (x: T, y: U) => V): Collection; + } + + var _: Combinators; + var c2: Collection; + var rf1 = (x: number, y: string) => { return x.toFixed() }; + var r5a = _.map(c2, (x, y) => { return x.toFixed() }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5b = _.map(c2, rf1); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/genericCombinators2.js b/tests/baselines/reference/genericCombinators2.js new file mode 100644 index 0000000000000..af11f05619739 --- /dev/null +++ b/tests/baselines/reference/genericCombinators2.js @@ -0,0 +1,28 @@ +//// [genericCombinators2.ts] +interface Collection { + length: number; + add(x: T, y: U): void; + remove(x: T, y: U): boolean; +} + +interface Combinators { + map(c: Collection, f: (x: T, y: U) => any): Collection; + map(c: Collection, f: (x: T, y: U) => V): Collection; +} + +var _: Combinators; +var c2: Collection; +var rf1 = (x: number, y: string) => { return x.toFixed() }; +var r5a = _.map(c2, (x, y) => { return x.toFixed() }); +var r5b = _.map(c2, rf1); + +//// [genericCombinators2.js] +var _; +var c2; +var rf1 = function (x, y) { + return x.toFixed(); +}; +var r5a = _.map(c2, function (x, y) { + return x.toFixed(); +}); +var r5b = _.map(c2, rf1); diff --git a/tests/baselines/reference/genericConstraint1.errors.txt b/tests/baselines/reference/genericConstraint1.errors.txt new file mode 100644 index 0000000000000..fb61d930f8a78 --- /dev/null +++ b/tests/baselines/reference/genericConstraint1.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/genericConstraint1.ts (1 errors) ==== + class C { + public bar2(x: T, y: U): T { + return null; + } + } + + var x = new C(); + x.bar2(2, ""); + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint1.js b/tests/baselines/reference/genericConstraint1.js new file mode 100644 index 0000000000000..38de98b121a29 --- /dev/null +++ b/tests/baselines/reference/genericConstraint1.js @@ -0,0 +1,21 @@ +//// [genericConstraint1.ts] +class C { + public bar2(x: T, y: U): T { + return null; + } +} + +var x = new C(); +x.bar2(2, ""); + +//// [genericConstraint1.js] +var C = (function () { + function C() { + } + C.prototype.bar2 = function (x, y) { + return null; + }; + return C; +})(); +var x = new C(); +x.bar2(2, ""); diff --git a/tests/baselines/reference/genericConstraint2.errors.txt b/tests/baselines/reference/genericConstraint2.errors.txt new file mode 100644 index 0000000000000..cce6068827de2 --- /dev/null +++ b/tests/baselines/reference/genericConstraint2.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/genericConstraint2.ts (3 errors) ==== + interface Comparable { + comparer(other: T): number; + } + + function compare>(x: T, y: T): number { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + if (x == null) return y == null ? 0 : -1; + if (y == null) return 1; + return x.comparer(y); + } + + class ComparableString implements Comparable{ + ~~~~~~~~~~~~~~~~ +!!! Class 'ComparableString' incorrectly implements interface 'Comparable': +!!! Property 'comparer' is missing in type 'ComparableString'. + constructor(public currentValue: string) { } + + localeCompare(other) { + return 0; + } + } + + var a = new ComparableString("a"); + var b = new ComparableString("b"); + var c = compare(a, b); + ~~~~~~~~~~~~~~~~ +!!! Type 'ComparableString' does not satisfy the constraint 'Comparable': +!!! Property 'comparer' is missing in type 'ComparableString'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint2.js b/tests/baselines/reference/genericConstraint2.js new file mode 100644 index 0000000000000..9548ae485b4fe --- /dev/null +++ b/tests/baselines/reference/genericConstraint2.js @@ -0,0 +1,43 @@ +//// [genericConstraint2.ts] +interface Comparable { + comparer(other: T): number; +} + +function compare>(x: T, y: T): number { + if (x == null) return y == null ? 0 : -1; + if (y == null) return 1; + return x.comparer(y); +} + +class ComparableString implements Comparable{ + constructor(public currentValue: string) { } + + localeCompare(other) { + return 0; + } +} + +var a = new ComparableString("a"); +var b = new ComparableString("b"); +var c = compare(a, b); + +//// [genericConstraint2.js] +function compare(x, y) { + if (x == null) + return y == null ? 0 : -1; + if (y == null) + return 1; + return x.comparer(y); +} +var ComparableString = (function () { + function ComparableString(currentValue) { + this.currentValue = currentValue; + } + ComparableString.prototype.localeCompare = function (other) { + return 0; + }; + return ComparableString; +})(); +var a = new ComparableString("a"); +var b = new ComparableString("b"); +var c = compare(a, b); diff --git a/tests/baselines/reference/genericConstraint3.errors.txt b/tests/baselines/reference/genericConstraint3.errors.txt new file mode 100644 index 0000000000000..d7d76b7de6f04 --- /dev/null +++ b/tests/baselines/reference/genericConstraint3.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/genericConstraint3.ts (1 errors) ==== + interface C

{ x: P; } + interface A> { x: U; } + ~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + interface B extends A<{}, { x: {} }> { } // Should not produce an error \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint3.js b/tests/baselines/reference/genericConstraint3.js new file mode 100644 index 0000000000000..59548c4f4d70e --- /dev/null +++ b/tests/baselines/reference/genericConstraint3.js @@ -0,0 +1,6 @@ +//// [genericConstraint3.ts] +interface C

{ x: P; } +interface A> { x: U; } +interface B extends A<{}, { x: {} }> { } // Should not produce an error + +//// [genericConstraint3.js] diff --git a/tests/baselines/reference/genericConstraintDeclaration.js b/tests/baselines/reference/genericConstraintDeclaration.js new file mode 100644 index 0000000000000..87a37adb6fe66 --- /dev/null +++ b/tests/baselines/reference/genericConstraintDeclaration.js @@ -0,0 +1,22 @@ +//// [genericConstraintDeclaration.ts] +class List{ + static empty(): List{return null;} +} + + + + + + +//// [genericConstraintDeclaration.js] +var List = (function () { + function List() { + } + List.empty = function () { + return null; + }; + return List; +})(); + + +//// [genericConstraintDeclaration.d.ts] diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js new file mode 100644 index 0000000000000..fbb4131d90096 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -0,0 +1,62 @@ +//// [genericConstraintOnExtendedBuiltinTypes.ts] +declare module EndGate { + export interface ICloneable { + Clone(): any; + } +} + +interface Number extends EndGate.ICloneable { } + +module EndGate.Tweening { + export class Tween{ + private _from: T; + + + constructor(from: T) { + this._from = from.Clone(); + } + } +} + +module EndGate.Tweening { + export class NumberTween extends Tween{ + constructor(from: number) { + super(from); + } + } +} + +//// [genericConstraintOnExtendedBuiltinTypes.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EndGate; +(function (EndGate) { + (function (Tweening) { + var Tween = (function () { + function Tween(from) { + this._from = from.Clone(); + } + return Tween; + })(); + Tweening.Tween = Tween; + })(EndGate.Tweening || (EndGate.Tweening = {})); + var Tweening = EndGate.Tweening; +})(EndGate || (EndGate = {})); +var EndGate; +(function (EndGate) { + (function (Tweening) { + var NumberTween = (function (_super) { + __extends(NumberTween, _super); + function NumberTween(from) { + _super.call(this, from); + } + return NumberTween; + })(Tweening.Tween); + Tweening.NumberTween = NumberTween; + })(EndGate.Tweening || (EndGate.Tweening = {})); + var Tweening = EndGate.Tweening; +})(EndGate || (EndGate = {})); diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js new file mode 100644 index 0000000000000..0ffb1927f8d08 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -0,0 +1,61 @@ +//// [genericConstraintOnExtendedBuiltinTypes2.ts] +module EndGate { + export interface ICloneable { + Clone(): any; + } +} + +interface Number extends EndGate.ICloneable { } + +module EndGate.Tweening { + export class Tween{ + private _from: T; + + constructor(from: T) { + this._from = from.Clone(); + } + } +} + +module EndGate.Tweening { + export class NumberTween extends Tween{ + constructor(from: number) { + super(from); + } + } +} + +//// [genericConstraintOnExtendedBuiltinTypes2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EndGate; +(function (EndGate) { + (function (Tweening) { + var Tween = (function () { + function Tween(from) { + this._from = from.Clone(); + } + return Tween; + })(); + Tweening.Tween = Tween; + })(EndGate.Tweening || (EndGate.Tweening = {})); + var Tweening = EndGate.Tweening; +})(EndGate || (EndGate = {})); +var EndGate; +(function (EndGate) { + (function (Tweening) { + var NumberTween = (function (_super) { + __extends(NumberTween, _super); + function NumberTween(from) { + _super.call(this, from); + } + return NumberTween; + })(Tweening.Tween); + Tweening.NumberTween = NumberTween; + })(EndGate.Tweening || (EndGate.Tweening = {})); + var Tweening = EndGate.Tweening; +})(EndGate || (EndGate = {})); diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt new file mode 100644 index 0000000000000..0ed85b01e620a --- /dev/null +++ b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/genericConstraintSatisfaction1.ts (1 errors) ==== + interface I { + f: (x: T) => void + } + + var x: I<{s: string}> + x.f({s: 1}) + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.js b/tests/baselines/reference/genericConstraintSatisfaction1.js new file mode 100644 index 0000000000000..9436e62b3bab7 --- /dev/null +++ b/tests/baselines/reference/genericConstraintSatisfaction1.js @@ -0,0 +1,12 @@ +//// [genericConstraintSatisfaction1.ts] +interface I { + f: (x: T) => void +} + +var x: I<{s: string}> +x.f({s: 1}) + + +//// [genericConstraintSatisfaction1.js] +var x; +x.f({ s: 1 }); diff --git a/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt b/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt new file mode 100644 index 0000000000000..e1ff11eee929c --- /dev/null +++ b/tests/baselines/reference/genericConstructExpressionWithoutArgs.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/genericConstructExpressionWithoutArgs.ts (2 errors) ==== + class B { } + var b = new B; // no error + + class C { + x: T; + } + + var c = new C // C + var c2 = new C // error, type params are actually part of the arg list so you need both + ~~~~~~ +!!! Cannot find name 'number'. + + +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt new file mode 100644 index 0000000000000..cee2b8583ed7c --- /dev/null +++ b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts (1 errors) ==== + interface Foo { + new (x: number): Foo; + } + var f2: Foo = new Foo(3); + ~~~ +!!! Cannot find name 'Foo'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.js b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.js new file mode 100644 index 0000000000000..70e9c10be6335 --- /dev/null +++ b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.js @@ -0,0 +1,9 @@ +//// [genericConstructInvocationWithNoTypeArg.ts] +interface Foo { + new (x: number): Foo; +} +var f2: Foo = new Foo(3); + + +//// [genericConstructInvocationWithNoTypeArg.js] +var f2 = new Foo(3); diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.js b/tests/baselines/reference/genericConstructSignatureInInterface.js new file mode 100644 index 0000000000000..ef3b52f195b44 --- /dev/null +++ b/tests/baselines/reference/genericConstructSignatureInInterface.js @@ -0,0 +1,11 @@ +//// [genericConstructSignatureInInterface.ts] +interface C { + new (x: T); +} + +var v: C; +var r = new v(1); + +//// [genericConstructSignatureInInterface.js] +var v; +var r = new v(1); diff --git a/tests/baselines/reference/genericConstructorFunction1.errors.txt b/tests/baselines/reference/genericConstructorFunction1.errors.txt new file mode 100644 index 0000000000000..14ac7d99b311a --- /dev/null +++ b/tests/baselines/reference/genericConstructorFunction1.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/genericConstructorFunction1.ts (2 errors) ==== + function f1(args: T) { + var v1: { [index: string]: new (arg: T) => Date }; + var v2 = v1['test']; + v2(args); + ~~~~~~~~ +!!! Value of type 'new (arg: T) => Date' is not callable. Did you mean to include 'new'? + return new v2(args); // used to give error + } + + + interface I1 { new (arg: T): Date }; + function f2(args: T) { + var v1: { [index: string]: I1 }; + var v2 = v1['test']; + var y = v2(args); + ~~~~~~~~ +!!! Value of type 'I1' is not callable. Did you mean to include 'new'? + return new v2(args); // used to give error + } \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructorFunction1.js b/tests/baselines/reference/genericConstructorFunction1.js new file mode 100644 index 0000000000000..16dbac009ba47 --- /dev/null +++ b/tests/baselines/reference/genericConstructorFunction1.js @@ -0,0 +1,31 @@ +//// [genericConstructorFunction1.ts] +function f1(args: T) { + var v1: { [index: string]: new (arg: T) => Date }; + var v2 = v1['test']; + v2(args); + return new v2(args); // used to give error +} + + +interface I1 { new (arg: T): Date }; +function f2(args: T) { + var v1: { [index: string]: I1 }; + var v2 = v1['test']; + var y = v2(args); + return new v2(args); // used to give error +} + +//// [genericConstructorFunction1.js] +function f1(args) { + var v1; + var v2 = v1['test']; + v2(args); + return new v2(args); +} +; +function f2(args) { + var v1; + var v2 = v1['test']; + var y = v2(args); + return new v2(args); +} diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.js b/tests/baselines/reference/genericContextualTypingSpecialization.js new file mode 100644 index 0000000000000..900189bab888b --- /dev/null +++ b/tests/baselines/reference/genericContextualTypingSpecialization.js @@ -0,0 +1,7 @@ +//// [genericContextualTypingSpecialization.ts] +var b: number[]; +b.reduce((c, d) => c + d, 0); // should not error on '+' + +//// [genericContextualTypingSpecialization.js] +var b; +b.reduce(function (c, d) { return c + d; }, 0); diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt new file mode 100644 index 0000000000000..97da05bd69b81 --- /dev/null +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts (1 errors) ==== + class A { + x: T; + } + + class B extends A { + y: U; + } + + var x: A; + var y: B; + x = y; // error + ~ +!!! Type 'B' is not assignable to type 'A': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js new file mode 100644 index 0000000000000..913484d4b5556 --- /dev/null +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -0,0 +1,36 @@ +//// [genericDerivedTypeWithSpecializedBase.ts] +class A { + x: T; +} + +class B extends A { + y: U; +} + +var x: A; +var y: B; +x = y; // error + + +//// [genericDerivedTypeWithSpecializedBase.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var x; +var y; +x = y; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt new file mode 100644 index 0000000000000..74cb9d29c1143 --- /dev/null +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts (1 errors) ==== + class A { + x: T; + } + + class B extends A { + y: U; + } + + var x: A<{ length: number; foo: number }>; + var y: B; + x = y; // error + ~ +!!! Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type '{ length: number; foo: number; }': +!!! Property 'foo' is missing in type 'String'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js new file mode 100644 index 0000000000000..9739721c04ff8 --- /dev/null +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -0,0 +1,36 @@ +//// [genericDerivedTypeWithSpecializedBase2.ts] +class A { + x: T; +} + +class B extends A { + y: U; +} + +var x: A<{ length: number; foo: number }>; +var y: B; +x = y; // error + + +//// [genericDerivedTypeWithSpecializedBase2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var x; +var y; +x = y; diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt new file mode 100644 index 0000000000000..19c27783c17ff --- /dev/null +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (1 errors) ==== + interface Array {} + + var f : { (x:T): T; } + + var g : { () : S[]; }; + f = g; + + var s = f("str").toUpperCase(); + + console.log(s); + ~~~~~~~ +!!! Cannot find name 'console'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.js b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.js new file mode 100644 index 0000000000000..3a3e615f3f5c7 --- /dev/null +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.js @@ -0,0 +1,19 @@ +//// [genericFunctionCallSignatureReturnTypeMismatch.ts] +interface Array {} + +var f : { (x:T): T; } + +var g : { () : S[]; }; +f = g; + +var s = f("str").toUpperCase(); + +console.log(s); + + +//// [genericFunctionCallSignatureReturnTypeMismatch.js] +var f; +var g; +f = g; +var s = f("str").toUpperCase(); +console.log(s); diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js new file mode 100644 index 0000000000000..b8b52179c7177 --- /dev/null +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.js @@ -0,0 +1,9 @@ +//// [genericFunctionHasFreshTypeArgs.ts] +function f(p: (x: T) => void) { }; +f(x => f(y => x = y)); + +//// [genericFunctionHasFreshTypeArgs.js] +function f(p) { +} +; +f(function (x) { return f(function (y) { return x = y; }); }); diff --git a/tests/baselines/reference/genericFunctionSpecializations1.js b/tests/baselines/reference/genericFunctionSpecializations1.js new file mode 100644 index 0000000000000..2935959b69eac --- /dev/null +++ b/tests/baselines/reference/genericFunctionSpecializations1.js @@ -0,0 +1,12 @@ +//// [genericFunctionSpecializations1.ts] +function foo3(test: string); // error +function foo3(test: T) { } + +function foo4(test: string); // valid +function foo4(test: T) { } + +//// [genericFunctionSpecializations1.js] +function foo3(test) { +} +function foo4(test) { +} diff --git a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt new file mode 100644 index 0000000000000..0948a26e76bba --- /dev/null +++ b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/genericFunctionTypedArgumentsAreFixed.ts (1 errors) ==== + declare function map(f: (x: T) => U, xs: T[]): U[]; + map((a) => a.length, [1]); + ~~~~~~ +!!! Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js new file mode 100644 index 0000000000000..e9db28578f7ed --- /dev/null +++ b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.js @@ -0,0 +1,6 @@ +//// [genericFunctionTypedArgumentsAreFixed.ts] +declare function map(f: (x: T) => U, xs: T[]): U[]; +map((a) => a.length, [1]); + +//// [genericFunctionTypedArgumentsAreFixed.js] +map(function (a) { return a.length; }, [1]); diff --git a/tests/baselines/reference/genericFunctions0.js b/tests/baselines/reference/genericFunctions0.js new file mode 100644 index 0000000000000..8baa7b64f5e5e --- /dev/null +++ b/tests/baselines/reference/genericFunctions0.js @@ -0,0 +1,13 @@ +//// [genericFunctions0.ts] +function foo (x: T) { return x; } + +var x = foo(5); // 'x' should be number + +//// [genericFunctions0.js] +function foo(x) { + return x; +} +var x = foo(5); + + +//// [genericFunctions0.d.ts] diff --git a/tests/baselines/reference/genericFunctions1.js b/tests/baselines/reference/genericFunctions1.js new file mode 100644 index 0000000000000..ba9ac262cbfc8 --- /dev/null +++ b/tests/baselines/reference/genericFunctions1.js @@ -0,0 +1,13 @@ +//// [genericFunctions1.ts] +function foo (x: T) { return x; } + +var x = foo(5); // 'x' should be number + +//// [genericFunctions1.js] +function foo(x) { + return x; +} +var x = foo(5); + + +//// [genericFunctions1.d.ts] diff --git a/tests/baselines/reference/genericFunctions2.js b/tests/baselines/reference/genericFunctions2.js new file mode 100644 index 0000000000000..b9c92e022ee30 --- /dev/null +++ b/tests/baselines/reference/genericFunctions2.js @@ -0,0 +1,14 @@ +//// [genericFunctions2.ts] +declare function map (items: T[], f: (x: T) => U): U[]; + +var myItems: string[]; +var lengths = map(myItems, x => x.length); + + + +//// [genericFunctions2.js] +var myItems; +var lengths = map(myItems, function (x) { return x.length; }); + + +//// [genericFunctions2.d.ts] diff --git a/tests/baselines/reference/genericFunctions3.js b/tests/baselines/reference/genericFunctions3.js new file mode 100644 index 0000000000000..36d454cc8c34a --- /dev/null +++ b/tests/baselines/reference/genericFunctions3.js @@ -0,0 +1,15 @@ +//// [genericFunctions3.ts] +interface Query { + foo(x: string): Query; +} + +function from(arg: boolean): Query; // was Error: Overload signature is not compatible with function definition. +function from(arg: any): Query { + return undefined; +} + + +//// [genericFunctions3.js] +function from(arg) { + return undefined; +} diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.js b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.js new file mode 100644 index 0000000000000..eee2658183947 --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.js @@ -0,0 +1,19 @@ +//// [genericFunctionsWithOptionalParameters1.ts] +interface Utils { + fold(c?: Array, folder?: (s: S, t: T) => T, init?: S): T; +} + +var utils: Utils; + +utils.fold(); // no error +utils.fold(null); // no error +utils.fold(null, null); // no error +utils.fold(null, null, null); // no error + + +//// [genericFunctionsWithOptionalParameters1.js] +var utils; +utils.fold(); +utils.fold(null); +utils.fold(null, null); +utils.fold(null, null, null); diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt new file mode 100644 index 0000000000000..8cc016566d98d --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericFunctionsWithOptionalParameters2.ts (1 errors) ==== + interface Utils { + fold(c: Array, folder?: (s: S, t: T) => T, init?: S): T; + } + + var utils: Utils; + + utils.fold(); // error + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + utils.fold(null); // no error + utils.fold(null, null); // no error + utils.fold(null, null, null); // error: Unable to invoke type with no call signatures + \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.js b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.js new file mode 100644 index 0000000000000..bd785e13bf876 --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.js @@ -0,0 +1,19 @@ +//// [genericFunctionsWithOptionalParameters2.ts] +interface Utils { + fold(c: Array, folder?: (s: S, t: T) => T, init?: S): T; +} + +var utils: Utils; + +utils.fold(); // error +utils.fold(null); // no error +utils.fold(null, null); // no error +utils.fold(null, null, null); // error: Unable to invoke type with no call signatures + + +//// [genericFunctionsWithOptionalParameters2.js] +var utils; +utils.fold(); +utils.fold(null); +utils.fold(null, null); +utils.fold(null, null, null); diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js new file mode 100644 index 0000000000000..2a5ce0a333c89 --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.js @@ -0,0 +1,44 @@ +//// [genericFunctionsWithOptionalParameters3.ts] +class Collection { + public add(x: T) { } +} +interface Utils { + fold(c?: Collection, folder?: (s: S, t: T) => T, init?: S): T; + mapReduce(c: Collection, mapper: (x: T) => U, reducer: (y: U) => V): Collection; +} +var utils: Utils; +var c = new Collection(); +var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); +var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return new Date() }); +var f1 = (x: string) => { return 1 }; +var f2 = (y: number) => { return new Date() }; +var r5 = utils.mapReduce(c, f1, f2); + + +//// [genericFunctionsWithOptionalParameters3.js] +var Collection = (function () { + function Collection() { + } + Collection.prototype.add = function (x) { + }; + return Collection; +})(); +var utils; +var c = new Collection(); +var r3 = utils.mapReduce(c, function (x) { + return 1; +}, function (y) { + return new Date(); +}); +var r4 = utils.mapReduce(c, function (x) { + return 1; +}, function (y) { + return new Date(); +}); +var f1 = function (x) { + return 1; +}; +var f2 = function (y) { + return new Date(); +}; +var r5 = utils.mapReduce(c, f1, f2); diff --git a/tests/baselines/reference/genericFunduleInModule.errors.txt b/tests/baselines/reference/genericFunduleInModule.errors.txt new file mode 100644 index 0000000000000..1bc72726712b5 --- /dev/null +++ b/tests/baselines/reference/genericFunduleInModule.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/genericFunduleInModule.ts (1 errors) ==== + module A { + export function B(x: T) { return x; } + export module B { + export var x = 1; + } + } + + var b: A.B; + ~~~ +!!! Module 'A' has no exported member 'B'. + A.B(1); \ No newline at end of file diff --git a/tests/baselines/reference/genericFunduleInModule.js b/tests/baselines/reference/genericFunduleInModule.js new file mode 100644 index 0000000000000..f689770286cc3 --- /dev/null +++ b/tests/baselines/reference/genericFunduleInModule.js @@ -0,0 +1,25 @@ +//// [genericFunduleInModule.ts] +module A { + export function B(x: T) { return x; } + export module B { + export var x = 1; + } +} + +var b: A.B; +A.B(1); + +//// [genericFunduleInModule.js] +var A; +(function (A) { + function B(x) { + return x; + } + A.B = B; + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var b; +A.B(1); diff --git a/tests/baselines/reference/genericFunduleInModule2.errors.txt b/tests/baselines/reference/genericFunduleInModule2.errors.txt new file mode 100644 index 0000000000000..306dd66d5191a --- /dev/null +++ b/tests/baselines/reference/genericFunduleInModule2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/genericFunduleInModule2.ts (1 errors) ==== + module A { + export function B(x: T) { return x; } + } + + module A { + export module B { + export var x = 1; + } + } + + var b: A.B; + ~~~ +!!! Module 'A' has no exported member 'B'. + A.B(1); \ No newline at end of file diff --git a/tests/baselines/reference/genericFunduleInModule2.js b/tests/baselines/reference/genericFunduleInModule2.js new file mode 100644 index 0000000000000..0d26023d3f0c7 --- /dev/null +++ b/tests/baselines/reference/genericFunduleInModule2.js @@ -0,0 +1,31 @@ +//// [genericFunduleInModule2.ts] +module A { + export function B(x: T) { return x; } +} + +module A { + export module B { + export var x = 1; + } +} + +var b: A.B; +A.B(1); + +//// [genericFunduleInModule2.js] +var A; +(function (A) { + function B(x) { + return x; + } + A.B = B; +})(A || (A = {})); +var A; +(function (A) { + (function (B) { + B.x = 1; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var b; +A.B(1); diff --git a/tests/baselines/reference/genericGetter.errors.txt b/tests/baselines/reference/genericGetter.errors.txt new file mode 100644 index 0000000000000..d3bd79de97e44 --- /dev/null +++ b/tests/baselines/reference/genericGetter.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericGetter.ts (2 errors) ==== + class C { + data: T; + get x(): T { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.data; + } + } + + var c = new C(); + var r: string = c.x; + ~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter2.errors.txt b/tests/baselines/reference/genericGetter2.errors.txt new file mode 100644 index 0000000000000..5c30fe0da97c7 --- /dev/null +++ b/tests/baselines/reference/genericGetter2.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/genericGetter2.ts (2 errors) ==== + class A { } + + class C { + data: A; + get x(): A { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Generic type 'A' requires 1 type argument(s). + return this.data; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter3.errors.txt b/tests/baselines/reference/genericGetter3.errors.txt new file mode 100644 index 0000000000000..2afa78268fcca --- /dev/null +++ b/tests/baselines/reference/genericGetter3.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/genericGetter3.ts (2 errors) ==== + class A { } + + class C { + data: A; + get x(): A { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.data; + } + } + + var c = new C(); + var r: string = c.x; + ~~~~~~~~~~~~~~~ +!!! Type 'A' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericImplements.js b/tests/baselines/reference/genericImplements.js new file mode 100644 index 0000000000000..559b45ec72005 --- /dev/null +++ b/tests/baselines/reference/genericImplements.js @@ -0,0 +1,59 @@ +//// [genericImplements.ts] +class A { a; }; +class B { b; }; +interface I { + f(): T; +} // { f: () => { a; } } + +// OK +class X implements I { + f(): T { return undefined; } +} // { f: () => { b; } } + +// OK +class Y implements I { + f(): T { return undefined; } +} // { f: () => { a; } } + +// OK +class Z implements I { + f(): T { return undefined; } +} // { f: () => T } + +//// [genericImplements.js] +var A = (function () { + function A() { + } + return A; +})(); +; +var B = (function () { + function B() { + } + return B; +})(); +; +var X = (function () { + function X() { + } + X.prototype.f = function () { + return undefined; + }; + return X; +})(); +var Y = (function () { + function Y() { + } + Y.prototype.f = function () { + return undefined; + }; + return Y; +})(); +var Z = (function () { + function Z() { + } + Z.prototype.f = function () { + return undefined; + }; + return Z; +})(); diff --git a/tests/baselines/reference/genericInference1.js b/tests/baselines/reference/genericInference1.js new file mode 100644 index 0000000000000..dc81b9a9556af --- /dev/null +++ b/tests/baselines/reference/genericInference1.js @@ -0,0 +1,5 @@ +//// [genericInference1.ts] +['a', 'b', 'c'].map(x => x.length); + +//// [genericInference1.js] +['a', 'b', 'c'].map(function (x) { return x.length; }); diff --git a/tests/baselines/reference/genericInference2.js b/tests/baselines/reference/genericInference2.js new file mode 100644 index 0000000000000..99be1a38eb749 --- /dev/null +++ b/tests/baselines/reference/genericInference2.js @@ -0,0 +1,33 @@ +//// [genericInference2.ts] + declare module ko { + export interface Observable { + (): T; + (value: T): any; + N: number; + g: boolean; + r: T; + } + export function observable(value: T): Observable; + } + var o = { + name: ko.observable("Bob"), + age: ko.observable(37) + }; + var x_v = o.name().length; // should be 'number' + var age_v = o.age(); // should be 'number' + var name_v = o.name("Robert"); // should be 'any' + var zz_v = o.name.N; // should be 'number' + var yy_v = o.name.g; // should be 'boolean' + var rr_v = o.name.r; // should be 'string' + +//// [genericInference2.js] +var o = { + name: ko.observable("Bob"), + age: ko.observable(37) +}; +var x_v = o.name().length; +var age_v = o.age(); +var name_v = o.name("Robert"); +var zz_v = o.name.N; +var yy_v = o.name.g; +var rr_v = o.name.r; diff --git a/tests/baselines/reference/genericInstanceOf.js b/tests/baselines/reference/genericInstanceOf.js new file mode 100644 index 0000000000000..9017cfe050a88 --- /dev/null +++ b/tests/baselines/reference/genericInstanceOf.js @@ -0,0 +1,25 @@ +//// [genericInstanceOf.ts] +interface F { + (): number; +} + +class C { + constructor(public a: T, public b: F) {} + foo() { + if (this.a instanceof this.b) { + } + } +} + +//// [genericInstanceOf.js] +var C = (function () { + function C(a, b) { + this.a = a; + this.b = b; + } + C.prototype.foo = function () { + if (this.a instanceof this.b) { + } + }; + return C; +})(); diff --git a/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.js b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.js new file mode 100644 index 0000000000000..396ae1c3329d3 --- /dev/null +++ b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.js @@ -0,0 +1,25 @@ +//// [genericInstantiationEquivalentToObjectLiteral.ts] +interface Pair { first: T1; second: T2; } +var x: Pair +var y: { first: string; second: number; } + +x = y; +y = x; + +declare function f(x: Pair); +declare function f2(x: { first: T; second: U; }); + +f(x); +f(y); +f2(x); +f2(y); + +//// [genericInstantiationEquivalentToObjectLiteral.js] +var x; +var y; +x = y; +y = x; +f(x); +f(y); +f2(x); +f2(y); diff --git a/tests/baselines/reference/genericInterfaceFunctionTypeParameter.js b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.js new file mode 100644 index 0000000000000..080f3853dd4e1 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.js @@ -0,0 +1,16 @@ +//// [genericInterfaceFunctionTypeParameter.ts] +export interface IFoo { } +export function foo(fn: (ifoo: IFoo) => void) { + foo(fn); // Invocation is necessary to repro (!) +} + + + + +//// [genericInterfaceFunctionTypeParameter.js] +define(["require", "exports"], function (require, exports) { + function foo(fn) { + foo(fn); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/genericInterfaceImplementation.js b/tests/baselines/reference/genericInterfaceImplementation.js new file mode 100644 index 0000000000000..8dc442b495975 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceImplementation.js @@ -0,0 +1,30 @@ +//// [genericInterfaceImplementation.ts] +interface IOption { + get(): A; + + flatten(): IOption; +} + +class None implements IOption{ + get(): T { + throw null; + } + + flatten() : IOption { + return new None(); + } +} + + +//// [genericInterfaceImplementation.js] +var None = (function () { + function None() { + } + None.prototype.get = function () { + throw null; + }; + None.prototype.flatten = function () { + return new None(); + }; + return None; +})(); diff --git a/tests/baselines/reference/genericInterfaceTypeCall.js b/tests/baselines/reference/genericInterfaceTypeCall.js new file mode 100644 index 0000000000000..6b69dc383d5a8 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceTypeCall.js @@ -0,0 +1,21 @@ +//// [genericInterfaceTypeCall.ts] +interface Foo { + reject(arg: T): void; +} +var foo: Foo + +interface bar { + fail(func: (arg: T) => void ): void; + fail2(func2: { (arg: T): void; }): void; +} +var test: bar; + +test.fail(arg => foo.reject(arg)); +test.fail2(arg => foo.reject(arg)); // Error: Supplied parameters do not match any signature of call target + + +//// [genericInterfaceTypeCall.js] +var foo; +var test; +test.fail(function (arg) { return foo.reject(arg); }); +test.fail2(function (arg) { return foo.reject(arg); }); diff --git a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt new file mode 100644 index 0000000000000..59b4d33a38e18 --- /dev/null +++ b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts (2 errors) ==== + interface I { } + class C { } + var i: I; + ~ +!!! Generic type 'I' requires 1 type argument(s). + var c: C; + ~ +!!! Generic type 'I' requires 1 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js new file mode 100644 index 0000000000000..4db7f2d0b1dbb --- /dev/null +++ b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.js @@ -0,0 +1,15 @@ +//// [genericInterfacesWithoutTypeArguments.ts] +interface I { } +class C { } +var i: I; +var c: C; + + +//// [genericInterfacesWithoutTypeArguments.js] +var C = (function () { + function C() { + } + return C; +})(); +var i; +var c; diff --git a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt new file mode 100644 index 0000000000000..27623b6ebab70 --- /dev/null +++ b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts (1 errors) ==== + interface Foo { + x: T; + } + function foo(a) { + return null; + } + foo((arg: Foo) => { return arg.x; }); + ~~~ +!!! Generic type 'Foo' requires 1 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js new file mode 100644 index 0000000000000..f57f6713c9ff6 --- /dev/null +++ b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.js @@ -0,0 +1,17 @@ +//// [genericLambaArgWithoutTypeArguments.ts] +interface Foo { + x: T; +} +function foo(a) { + return null; +} +foo((arg: Foo) => { return arg.x; }); + + +//// [genericLambaArgWithoutTypeArguments.js] +function foo(a) { + return null; +} +foo(function (arg) { + return arg.x; +}); diff --git a/tests/baselines/reference/genericMemberFunction.errors.txt b/tests/baselines/reference/genericMemberFunction.errors.txt new file mode 100644 index 0000000000000..4e9e6a0b0d2ac --- /dev/null +++ b/tests/baselines/reference/genericMemberFunction.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/genericMemberFunction.ts (8 errors) ==== + export class BuildError{ + public parent(): FileWithErrors { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return undefined; + } + } + export class FileWithErrors{ + public errors(): BuildError[] { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return undefined; + } + public parent(): BuildResult { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return undefined; + } + } + export class BuildResult{ + public merge(other: BuildResult): void { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + a.b.c.d.e.f.g = 0; + ~ +!!! Cannot find name 'a'. + removedFiles.forEach((each: FileWithErrors) => { + ~~~~~~~~~~~~ +!!! Cannot find name 'removedFiles'. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + this.removeFile(each); + ~~~~~~~~~~ +!!! Property 'removeFile' does not exist on type 'BuildResult'. + }); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericMemberFunction.js b/tests/baselines/reference/genericMemberFunction.js new file mode 100644 index 0000000000000..06c33c1585220 --- /dev/null +++ b/tests/baselines/reference/genericMemberFunction.js @@ -0,0 +1,61 @@ +//// [genericMemberFunction.ts] +export class BuildError{ + public parent(): FileWithErrors { + return undefined; + } +} +export class FileWithErrors{ + public errors(): BuildError[] { + return undefined; + } + public parent(): BuildResult { + return undefined; + } +} +export class BuildResult{ + public merge(other: BuildResult): void { + a.b.c.d.e.f.g = 0; + removedFiles.forEach((each: FileWithErrors) => { + this.removeFile(each); + }); + } +} + + +//// [genericMemberFunction.js] +define(["require", "exports"], function (require, exports) { + var BuildError = (function () { + function BuildError() { + } + BuildError.prototype.parent = function () { + return undefined; + }; + return BuildError; + })(); + exports.BuildError = BuildError; + var FileWithErrors = (function () { + function FileWithErrors() { + } + FileWithErrors.prototype.errors = function () { + return undefined; + }; + FileWithErrors.prototype.parent = function () { + return undefined; + }; + return FileWithErrors; + })(); + exports.FileWithErrors = FileWithErrors; + var BuildResult = (function () { + function BuildResult() { + } + BuildResult.prototype.merge = function (other) { + var _this = this; + a.b.c.d.e.f.g = 0; + removedFiles.forEach(function (each) { + _this.removeFile(each); + }); + }; + return BuildResult; + })(); + exports.BuildResult = BuildResult; +}); diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt new file mode 100644 index 0000000000000..5368c5b832a85 --- /dev/null +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts (3 errors) ==== + function foo(y: T, z: U) { return y; } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + module foo { + export var x: T; + ~ +!!! Cannot find name 'T'. + var y = 1; + ~ +!!! Cannot find name 'T'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js new file mode 100644 index 0000000000000..5d4ecdc0838af --- /dev/null +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.js @@ -0,0 +1,17 @@ +//// [genericMergedDeclarationUsingTypeParameter.ts] +function foo(y: T, z: U) { return y; } +module foo { + export var x: T; + var y = 1; +} + + +//// [genericMergedDeclarationUsingTypeParameter.js] +function foo(y, z) { + return y; +} +var foo; +(function (foo) { + foo.x; + var y = 1; +})(foo || (foo = {})); diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt new file mode 100644 index 0000000000000..d6d1f1ae44d48 --- /dev/null +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter2.ts (2 errors) ==== + class foo { constructor(x: T) { } } + module foo { + export var x: T; + ~ +!!! Cannot find name 'T'. + var y = 1; + ~ +!!! Cannot find name 'T'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js new file mode 100644 index 0000000000000..76b6159f4871d --- /dev/null +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.js @@ -0,0 +1,19 @@ +//// [genericMergedDeclarationUsingTypeParameter2.ts] +class foo { constructor(x: T) { } } +module foo { + export var x: T; + var y = 1; +} + + +//// [genericMergedDeclarationUsingTypeParameter2.js] +var foo = (function () { + function foo(x) { + } + return foo; +})(); +var foo; +(function (foo) { + foo.x; + var y = 1; +})(foo || (foo = {})); diff --git a/tests/baselines/reference/genericMethodOverspecialization.js b/tests/baselines/reference/genericMethodOverspecialization.js new file mode 100644 index 0000000000000..6ec28922af09a --- /dev/null +++ b/tests/baselines/reference/genericMethodOverspecialization.js @@ -0,0 +1,39 @@ +//// [genericMethodOverspecialization.ts] +var names = ["list", "table1", "table2", "table3", "summary"]; + +interface HTMLElement { + clientWidth: number; + isDisabled: boolean; +} + +declare var document: Document; +interface Document { + getElementById(elementId: string): HTMLElement; +} + +var elements = names.map(function (name) { + return document.getElementById(name); +}); + + +var xxx = elements.filter(function (e) { + return !e.isDisabled; +}); + +var widths:number[] = elements.map(function (e) { // should not error + return e.clientWidth; +}); + + + +//// [genericMethodOverspecialization.js] +var names = ["list", "table1", "table2", "table3", "summary"]; +var elements = names.map(function (name) { + return document.getElementById(name); +}); +var xxx = elements.filter(function (e) { + return !e.isDisabled; +}); +var widths = elements.map(function (e) { + return e.clientWidth; +}); diff --git a/tests/baselines/reference/genericNewInterface.errors.txt b/tests/baselines/reference/genericNewInterface.errors.txt new file mode 100644 index 0000000000000..d421e15005908 --- /dev/null +++ b/tests/baselines/reference/genericNewInterface.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/genericNewInterface.ts (2 errors) ==== + function createInstance(ctor: new (s: string) => T): T { + return new ctor(42); //should be an error + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + interface INewable { + new (param: string): T; + } + + function createInstance2(ctor: INewable): T { + return new ctor(1024); //should be an error + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericNewInterface.js b/tests/baselines/reference/genericNewInterface.js new file mode 100644 index 0000000000000..1e0132fe8f310 --- /dev/null +++ b/tests/baselines/reference/genericNewInterface.js @@ -0,0 +1,20 @@ +//// [genericNewInterface.ts] +function createInstance(ctor: new (s: string) => T): T { + return new ctor(42); //should be an error +} + +interface INewable { + new (param: string): T; +} + +function createInstance2(ctor: INewable): T { + return new ctor(1024); //should be an error +} + +//// [genericNewInterface.js] +function createInstance(ctor) { + return new ctor(42); +} +function createInstance2(ctor) { + return new ctor(1024); +} diff --git a/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt new file mode 100644 index 0000000000000..2d6230b4563fb --- /dev/null +++ b/tests/baselines/reference/genericObjectCreationWithoutTypeArgs.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericObjectCreationWithoutTypeArgs.ts (2 errors) ==== + class SS{ + + } + + var x1 = new SS(); // OK + var x2 = new SS < number>; // Correctly give error + ~ +!!! Expression expected. + ~~~~~~ +!!! Cannot find name 'number'. + var x3 = new SS(); // OK + var x4 = new SS; // Should be allowed, but currently give error ('supplied parameters do not match any signature of the call target') + \ No newline at end of file diff --git a/tests/baselines/reference/genericObjectLitReturnType.js b/tests/baselines/reference/genericObjectLitReturnType.js new file mode 100644 index 0000000000000..730364ddb3798 --- /dev/null +++ b/tests/baselines/reference/genericObjectLitReturnType.js @@ -0,0 +1,25 @@ +//// [genericObjectLitReturnType.ts] +class X +{ + f(t: T) { return { a: t }; } +} + + +var x: X; +var t1 = x.f(5); +t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} + + + +//// [genericObjectLitReturnType.js] +var X = (function () { + function X() { + } + X.prototype.f = function (t) { + return { a: t }; + }; + return X; +})(); +var x; +var t1 = x.f(5); +t1.a = 5; diff --git a/tests/baselines/reference/genericOfACloduleType1.js b/tests/baselines/reference/genericOfACloduleType1.js new file mode 100644 index 0000000000000..d0ffd8f365746 --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType1.js @@ -0,0 +1,46 @@ +//// [genericOfACloduleType1.ts] +class G{ bar(x: T) { return x; } } +module M { + export class C { foo() { } } + export module C { + export class X { + } + } + + var g1 = new G(); + g1.bar(null).foo(); +} +var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. + +//// [genericOfACloduleType1.js] +var G = (function () { + function G() { + } + G.prototype.bar = function (x) { + return x; + }; + return G; +})(); +var M; +(function (M) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + M.C = C; + (function (C) { + var X = (function () { + function X() { + } + return X; + })(); + C.X = X; + })(M.C || (M.C = {})); + var C = M.C; + var g1 = new G(); + g1.bar(null).foo(); +})(M || (M = {})); +var g2 = new G(); diff --git a/tests/baselines/reference/genericOfACloduleType2.js b/tests/baselines/reference/genericOfACloduleType2.js new file mode 100644 index 0000000000000..4a277b606c53f --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType2.js @@ -0,0 +1,52 @@ +//// [genericOfACloduleType2.ts] +class G{ bar(x: T) { return x; } } +module M { + export class C { foo() { } } + export module C { + export class X { + } + } + + var g1 = new G(); + g1.bar(null).foo(); // no error +} + +module N { + var g2 = new G() +} + +//// [genericOfACloduleType2.js] +var G = (function () { + function G() { + } + G.prototype.bar = function (x) { + return x; + }; + return G; +})(); +var M; +(function (M) { + var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; + })(); + M.C = C; + (function (C) { + var X = (function () { + function X() { + } + return X; + })(); + C.X = X; + })(M.C || (M.C = {})); + var C = M.C; + var g1 = new G(); + g1.bar(null).foo(); +})(M || (M = {})); +var N; +(function (N) { + var g2 = new G(); +})(N || (N = {})); diff --git a/tests/baselines/reference/genericOverloadSignatures.js b/tests/baselines/reference/genericOverloadSignatures.js new file mode 100644 index 0000000000000..ec4c9ba74dcc6 --- /dev/null +++ b/tests/baselines/reference/genericOverloadSignatures.js @@ -0,0 +1,41 @@ +//// [genericOverloadSignatures.ts] +interface A { + (x: T): void; + (x: T): void; +} + +function f(a: T); +function f(a: T); +function f(a) { } + +interface I2 { + f(x: T): number; + f(x: T): string; +} + +interface I3 { + f(x: T): number; + f(x: T): string; +} + +class C2 { +} +var b: { + new (x: T, y: string): C2; + new (x: T, y: string): C2; +} + +interface D { + (x: T): T; + (x: T): T; +} + +//// [genericOverloadSignatures.js] +function f(a) { +} +var C2 = (function () { + function C2() { + } + return C2; +})(); +var b; diff --git a/tests/baselines/reference/genericParameterAssignability1.js b/tests/baselines/reference/genericParameterAssignability1.js new file mode 100644 index 0000000000000..042a5c3ca3626 --- /dev/null +++ b/tests/baselines/reference/genericParameterAssignability1.js @@ -0,0 +1,11 @@ +//// [genericParameterAssignability1.ts] +function f(x: T): T { return null; } +var r = (x: T) => x; +r = f; // should be allowed + +//// [genericParameterAssignability1.js] +function f(x) { + return null; +} +var r = function (x) { return x; }; +r = f; diff --git a/tests/baselines/reference/genericPrototypeProperty.js b/tests/baselines/reference/genericPrototypeProperty.js new file mode 100644 index 0000000000000..64e03a8c2d7b4 --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty.js @@ -0,0 +1,23 @@ +//// [genericPrototypeProperty.ts] +class C { + x: T; + foo(x: T): T { return null; } +} + +var r = C.prototype; +// should be any +var r2 = r.x +var r3 = r.foo(null); + +//// [genericPrototypeProperty.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var r = C.prototype; +var r2 = r.x; +var r3 = r.foo(null); diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js new file mode 100644 index 0000000000000..9a48ef679dc01 --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -0,0 +1,48 @@ +//// [genericPrototypeProperty2.ts] +interface EventTarget { x } +class BaseEvent { + target: EventTarget; +} + +class MyEvent extends BaseEvent { + target: T; +} +class BaseEventWrapper { + t: BaseEvent; +} + +class MyEventWrapper extends BaseEventWrapper { + t: MyEvent; // any satisfies constraint and passes assignability check between 'target' properties +} + +//// [genericPrototypeProperty2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var BaseEvent = (function () { + function BaseEvent() { + } + return BaseEvent; +})(); +var MyEvent = (function (_super) { + __extends(MyEvent, _super); + function MyEvent() { + _super.apply(this, arguments); + } + return MyEvent; +})(BaseEvent); +var BaseEventWrapper = (function () { + function BaseEventWrapper() { + } + return BaseEventWrapper; +})(); +var MyEventWrapper = (function (_super) { + __extends(MyEventWrapper, _super); + function MyEventWrapper() { + _super.apply(this, arguments); + } + return MyEventWrapper; +})(BaseEventWrapper); diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js new file mode 100644 index 0000000000000..522b3a11e1bca --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -0,0 +1,47 @@ +//// [genericPrototypeProperty3.ts] +class BaseEvent { + target: {}; +} + +class MyEvent extends BaseEvent { // T is instantiated to any in the prototype, which is assignable to {} + target: T; +} +class BaseEventWrapper { + t: BaseEvent; +} + +class MyEventWrapper extends BaseEventWrapper { + t: MyEvent; +} + +//// [genericPrototypeProperty3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var BaseEvent = (function () { + function BaseEvent() { + } + return BaseEvent; +})(); +var MyEvent = (function (_super) { + __extends(MyEvent, _super); + function MyEvent() { + _super.apply(this, arguments); + } + return MyEvent; +})(BaseEvent); +var BaseEventWrapper = (function () { + function BaseEventWrapper() { + } + return BaseEventWrapper; +})(); +var MyEventWrapper = (function (_super) { + __extends(MyEventWrapper, _super); + function MyEventWrapper() { + _super.apply(this, arguments); + } + return MyEventWrapper; +})(BaseEventWrapper); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt new file mode 100644 index 0000000000000..bce0417d81bbe --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts (1 errors) ==== + export declare module TypeScript { + class PullSymbol { } + class PullSignatureSymbol extends PullSymbol { + public addSpecialization(signature: PullSignatureSymbol, typeArguments: PullTypeSymbol[]): void; + } + class PullTypeSymbol extends PullSymbol { + public findTypeParameter(name: string): PullTypeParameterSymbol; + } + class PullTypeParameterSymbol extends PullTypeSymbol { + ~~~~~~~~~~~~~~ +!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js new file mode 100644 index 0000000000000..d6c0e686ce054 --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js @@ -0,0 +1,18 @@ +//// [genericRecursiveImplicitConstructorErrors1.ts] +export declare module TypeScript { + class PullSymbol { } + class PullSignatureSymbol extends PullSymbol { + public addSpecialization(signature: PullSignatureSymbol, typeArguments: PullTypeSymbol[]): void; + } + class PullTypeSymbol extends PullSymbol { + public findTypeParameter(name: string): PullTypeParameterSymbol; + } + class PullTypeParameterSymbol extends PullTypeSymbol { + } +} + + + +//// [genericRecursiveImplicitConstructorErrors1.js] +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js new file mode 100644 index 0000000000000..1b34b2d21e813 --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -0,0 +1,65 @@ +//// [genericRecursiveImplicitConstructorErrors2.ts] +module TypeScript2 { + export interface DeclKind { }; + export interface PullTypesymbol { }; + export interface SymbolLinkKind { }; + export enum PullSymbolVisibility { + Private, + Public + } +  + export class PullSymbol { + constructor (name: string, declKind: DeclKind) { + + } + // link methods + public addOutgoingLink(linkTo: PullSymbol, kind: SymbolLinkKind) { + + } + + public getType(): PullTypeSymbol { + return undefined; + } + } + export class PullTypeSymbol extends PullSymbol { + } +} + + +//// [genericRecursiveImplicitConstructorErrors2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TypeScript2; +(function (TypeScript2) { + ; + ; + ; + (function (PullSymbolVisibility) { + PullSymbolVisibility[PullSymbolVisibility["Private"] = 0] = "Private"; + PullSymbolVisibility[PullSymbolVisibility["Public"] = 1] = "Public"; + })(TypeScript2.PullSymbolVisibility || (TypeScript2.PullSymbolVisibility = {})); + var PullSymbolVisibility = TypeScript2.PullSymbolVisibility; + var PullSymbol = (function () { + function PullSymbol(name, declKind) { + } + PullSymbol.prototype.addOutgoingLink = function (linkTo, kind) { + }; + PullSymbol.prototype.getType = function () { + return undefined; + }; + return PullSymbol; + })(); + TypeScript2.PullSymbol = PullSymbol; + var PullTypeSymbol = (function (_super) { + __extends(PullTypeSymbol, _super); + function PullTypeSymbol() { + _super.apply(this, arguments); + } + return PullTypeSymbol; + })(PullSymbol); + TypeScript2.PullTypeSymbol = PullTypeSymbol; +})(TypeScript2 || (TypeScript2 = {})); diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt new file mode 100644 index 0000000000000..71545ae7503c7 --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (7 errors) ==== + module TypeScript { + export class MemberName { + static create(arg1: any, arg2?: any, arg3?: any): MemberName { + ~~~~~~~~~~ +!!! Generic type 'MemberName' requires 3 type argument(s). + } + } + } + + module TypeScript { + export class PullSymbol { + public type: PullTypeSymbol = null; + ~~~~~~~~~~~~~~ +!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). + } + export class PullTypeSymbol extends PullSymbol { + ~~~~~~~~~~ +!!! Generic type 'PullSymbol' requires 3 type argument(s). + private _elementType: PullTypeSymbol = null; + ~~~~~~~~~~~~~~ +!!! Generic type 'PullTypeSymbol' requires 3 type argument(s). + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean) { + ~~~~~~~~~~ +!!! Generic type 'PullSymbol' requires 3 type argument(s). + var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); + return s; + } + public getScopedNameEx(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean) { + ~~~~~~~~~~ +!!! Generic type 'PullSymbol' requires 3 type argument(s). + if (this.isArray()) { + ~~~~~~~ +!!! Property 'isArray' does not exist on type 'PullTypeSymbol'. + var elementMemberName = this._elementType ? + (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? + this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : + this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1 + return MemberName.create(elementMemberName, "", "[]"); + } + } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js new file mode 100644 index 0000000000000..11113b778d3dd --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -0,0 +1,79 @@ +//// [genericRecursiveImplicitConstructorErrors3.ts] +module TypeScript { + export class MemberName { + static create(arg1: any, arg2?: any, arg3?: any): MemberName { + } + } +} + +module TypeScript { + export class PullSymbol { + public type: PullTypeSymbol = null; + } + export class PullTypeSymbol extends PullSymbol { + private _elementType: PullTypeSymbol = null; + public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean) { + var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); + return s; + } + public getScopedNameEx(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean) { + if (this.isArray()) { + var elementMemberName = this._elementType ? + (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? + this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : + this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1 + return MemberName.create(elementMemberName, "", "[]"); + } + } + } +} + + + +//// [genericRecursiveImplicitConstructorErrors3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TypeScript; +(function (TypeScript) { + var MemberName = (function () { + function MemberName() { + } + MemberName.create = function (arg1, arg2, arg3) { + }; + return MemberName; + })(); + TypeScript.MemberName = MemberName; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var PullSymbol = (function () { + function PullSymbol() { + this.type = null; + } + return PullSymbol; + })(); + TypeScript.PullSymbol = PullSymbol; + var PullTypeSymbol = (function (_super) { + __extends(PullTypeSymbol, _super); + function PullTypeSymbol() { + _super.apply(this, arguments); + this._elementType = null; + } + PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { + var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); + return s; + }; + PullTypeSymbol.prototype.getScopedNameEx = function (scopeSymbol, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo) { + if (this.isArray()) { + var elementMemberName = this._elementType ? (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1; + return TypeScript.MemberName.create(elementMemberName, "", "[]"); + } + }; + return PullTypeSymbol; + })(PullSymbol); + TypeScript.PullTypeSymbol = PullTypeSymbol; +})(TypeScript || (TypeScript = {})); diff --git a/tests/baselines/reference/genericReduce.errors.txt b/tests/baselines/reference/genericReduce.errors.txt new file mode 100644 index 0000000000000..4008fddb9197f --- /dev/null +++ b/tests/baselines/reference/genericReduce.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/genericReduce.ts (3 errors) ==== + var a = ["An", "array", "of", "strings"]; + var b = a.map(s => s.length); + var n1 = b.reduce((x, y) => x + y); + var n2 = b.reduceRight((x, y) => x + y); + + n1.x = "fail"; // should error, as 'n1' should be type 'number', not 'any'. + ~ +!!! Property 'x' does not exist on type 'number'. + n1.toExponential(2); // should not error if 'n1' is correctly number. + n2.x = "fail"; // should error, as 'n2' should be type 'number', not 'any'. + ~ +!!! Property 'x' does not exist on type 'number'. + n2.toExponential(2); // should not error if 'n2' is correctly number. + + var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string + n3.toExponential(2); // should error if 'n3' is correctly type 'string' + ~~~~~~~~~~~~~ +!!! Property 'toExponential' does not exist on type 'string'. + n3.charAt(0); // should not error if 'n3' is correctly type 'string' \ No newline at end of file diff --git a/tests/baselines/reference/genericReduce.js b/tests/baselines/reference/genericReduce.js new file mode 100644 index 0000000000000..a4955d52fb9b6 --- /dev/null +++ b/tests/baselines/reference/genericReduce.js @@ -0,0 +1,27 @@ +//// [genericReduce.ts] +var a = ["An", "array", "of", "strings"]; +var b = a.map(s => s.length); +var n1 = b.reduce((x, y) => x + y); +var n2 = b.reduceRight((x, y) => x + y); + +n1.x = "fail"; // should error, as 'n1' should be type 'number', not 'any'. +n1.toExponential(2); // should not error if 'n1' is correctly number. +n2.x = "fail"; // should error, as 'n2' should be type 'number', not 'any'. +n2.toExponential(2); // should not error if 'n2' is correctly number. + +var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string +n3.toExponential(2); // should error if 'n3' is correctly type 'string' +n3.charAt(0); // should not error if 'n3' is correctly type 'string' + +//// [genericReduce.js] +var a = ["An", "array", "of", "strings"]; +var b = a.map(function (s) { return s.length; }); +var n1 = b.reduce(function (x, y) { return x + y; }); +var n2 = b.reduceRight(function (x, y) { return x + y; }); +n1.x = "fail"; +n1.toExponential(2); +n2.x = "fail"; +n2.toExponential(2); +var n3 = b.reduce(function (x, y) { return x + y; }, ""); +n3.toExponential(2); +n3.charAt(0); diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt new file mode 100644 index 0000000000000..3da6d88715a1b --- /dev/null +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/genericRestArgs.ts (2 errors) ==== + function makeArrayG(...items: T[]): T[] { return items; } + var a1Ga = makeArrayG(1, ""); // no error + var a1Gb = makeArrayG(1, ""); + var a1Gc = makeArrayG(1, ""); + var a1Gd = makeArrayG(1, ""); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { + return [item1, item2, item3]; + } + var a2Ga = makeArrayGOpt(1, ""); + var a2Gb = makeArrayG(1, ""); + var a2Gc = makeArrayG(1, ""); // error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.js b/tests/baselines/reference/genericRestArgs.js new file mode 100644 index 0000000000000..5e28ddf2a1fbb --- /dev/null +++ b/tests/baselines/reference/genericRestArgs.js @@ -0,0 +1,32 @@ +//// [genericRestArgs.ts] +function makeArrayG(...items: T[]): T[] { return items; } +var a1Ga = makeArrayG(1, ""); // no error +var a1Gb = makeArrayG(1, ""); +var a1Gc = makeArrayG(1, ""); +var a1Gd = makeArrayG(1, ""); // error + +function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { + return [item1, item2, item3]; +} +var a2Ga = makeArrayGOpt(1, ""); +var a2Gb = makeArrayG(1, ""); +var a2Gc = makeArrayG(1, ""); // error + +//// [genericRestArgs.js] +function makeArrayG() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i - 0] = arguments[_i]; + } + return items; +} +var a1Ga = makeArrayG(1, ""); +var a1Gb = makeArrayG(1, ""); +var a1Gc = makeArrayG(1, ""); +var a1Gd = makeArrayG(1, ""); +function makeArrayGOpt(item1, item2, item3) { + return [item1, item2, item3]; +} +var a2Ga = makeArrayGOpt(1, ""); +var a2Gb = makeArrayG(1, ""); +var a2Gc = makeArrayG(1, ""); diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt new file mode 100644 index 0000000000000..939cf38cb03d9 --- /dev/null +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/genericReturnTypeFromGetter1.ts (2 errors) ==== + export interface A { + new (dbSet: DbSet): T; + } + export class DbSet { + _entityType: A; + ~ +!!! Generic type 'A' requires 1 type argument(s). + get entityType() { return this._entityType; } // used to ICE without return type annotation + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericReversingTypeParameters.js b/tests/baselines/reference/genericReversingTypeParameters.js new file mode 100644 index 0000000000000..eede7e23d627a --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters.js @@ -0,0 +1,28 @@ +//// [genericReversingTypeParameters.ts] +class BiMap { + private inverseBiMap: BiMap; + public get(key: K): V { return null; } + public inverse(): BiMap { return null; } +} + +var b = new BiMap(); +var r1 = b.get(''); +var i = b.inverse(); // used to get the type wrong here. +var r2b = i.get(1); + +//// [genericReversingTypeParameters.js] +var BiMap = (function () { + function BiMap() { + } + BiMap.prototype.get = function (key) { + return null; + }; + BiMap.prototype.inverse = function () { + return null; + }; + return BiMap; +})(); +var b = new BiMap(); +var r1 = b.get(''); +var i = b.inverse(); +var r2b = i.get(1); diff --git a/tests/baselines/reference/genericReversingTypeParameters2.js b/tests/baselines/reference/genericReversingTypeParameters2.js new file mode 100644 index 0000000000000..4dd874017758b --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters2.js @@ -0,0 +1,26 @@ +//// [genericReversingTypeParameters2.ts] +class BiMap { + private inverseBiMap: BiMap; + public get(key: K): V { return null; } + public inverse(): BiMap { return null; } +} + +var b = new BiMap(); +var i = b.inverse(); // used to get the type wrong here. +var r2b = i.get(1); + +//// [genericReversingTypeParameters2.js] +var BiMap = (function () { + function BiMap() { + } + BiMap.prototype.get = function (key) { + return null; + }; + BiMap.prototype.inverse = function () { + return null; + }; + return BiMap; +})(); +var b = new BiMap(); +var i = b.inverse(); +var r2b = i.get(1); diff --git a/tests/baselines/reference/genericSignatureInheritance.js b/tests/baselines/reference/genericSignatureInheritance.js new file mode 100644 index 0000000000000..adaeacb74123f --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance.js @@ -0,0 +1,9 @@ +//// [genericSignatureInheritance.ts] +interface I { + (x: T): string; +} + +interface I2 extends I { } + + +//// [genericSignatureInheritance.js] diff --git a/tests/baselines/reference/genericSignatureInheritance2.js b/tests/baselines/reference/genericSignatureInheritance2.js new file mode 100644 index 0000000000000..624eb63b844ea --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance2.js @@ -0,0 +1,11 @@ +//// [genericSignatureInheritance2.ts] +interface I { + (x: T): string; +} + +interface I2 extends I { + (x: T): void; +} + + +//// [genericSignatureInheritance2.js] diff --git a/tests/baselines/reference/genericSpecializationToTypeLiteral1.js b/tests/baselines/reference/genericSpecializationToTypeLiteral1.js new file mode 100644 index 0000000000000..f3495a87ed125 --- /dev/null +++ b/tests/baselines/reference/genericSpecializationToTypeLiteral1.js @@ -0,0 +1,31 @@ +//// [genericSpecializationToTypeLiteral1.ts] +interface IEnumerable { + + zip(second: IEnumerable, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; + zip(second: T[], resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; + zip(...params: any[]): IEnumerable; // last one is selector + + merge(...params: IEnumerable[]): IEnumerable; + merge(...params: T[][]): IEnumerable; + + + concat(...sequences: IEnumerable[]): IEnumerable; + concat(...sequences: T[]): IEnumerable; + + insert(index: number, second: IEnumerable): IEnumerable; + + sequenceEqual(second: IEnumerable): boolean; + sequenceEqual(second: IEnumerable, compareSelector: (element: T) => TCompare): boolean; + sequenceEqual(second: T[]): boolean; + sequenceEqual(second: T[], compareSelector: (element: T) => TCompare): boolean; + + toDictionary(keySelector: (element: T) => TKey): IDictionary; + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue): IDictionary; + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue, compareSelector: (key: TKey) => TCompare): IDictionary; +} + +interface IDictionary { + toEnumerable(): IEnumerable<{ key: TKey; value: TValue }>; +} + +//// [genericSpecializationToTypeLiteral1.js] diff --git a/tests/baselines/reference/genericSpecializations1.js b/tests/baselines/reference/genericSpecializations1.js new file mode 100644 index 0000000000000..3df2c5581b9ae --- /dev/null +++ b/tests/baselines/reference/genericSpecializations1.js @@ -0,0 +1,42 @@ +//// [genericSpecializations1.ts] +interface IFoo { + foo(x: T): T; // no error on implementors because IFoo's T is different from foo's T +} + +class IntFooBad implements IFoo { + foo(x: string): string { return null; } +} + +class StringFoo2 implements IFoo { + foo(x: string): string { return null; } +} + +class StringFoo3 implements IFoo { + foo(x: T): T { return null; } +} + +//// [genericSpecializations1.js] +var IntFooBad = (function () { + function IntFooBad() { + } + IntFooBad.prototype.foo = function (x) { + return null; + }; + return IntFooBad; +})(); +var StringFoo2 = (function () { + function StringFoo2() { + } + StringFoo2.prototype.foo = function (x) { + return null; + }; + return StringFoo2; +})(); +var StringFoo3 = (function () { + function StringFoo3() { + } + StringFoo3.prototype.foo = function (x) { + return null; + }; + return StringFoo3; +})(); diff --git a/tests/baselines/reference/genericSpecializations2.errors.txt b/tests/baselines/reference/genericSpecializations2.errors.txt new file mode 100644 index 0000000000000..038c65e0e478d --- /dev/null +++ b/tests/baselines/reference/genericSpecializations2.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/genericSpecializations2.ts (2 errors) ==== + class IFoo { + foo(x: T): T { // no error on implementors because IFoo's T is different from foo's T + return null; + } + } + + class IntFooBad implements IFoo { + foo(x: string): string { return null; } + ~~~~~~ +!!! Type parameter name cannot be 'string' + } + + class StringFoo2 implements IFoo { + foo(x: string): string { return null; } + ~~~~~~ +!!! Type parameter name cannot be 'string' + } + + class StringFoo3 implements IFoo { + foo(x: T): T { return null; } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/genericSpecializations2.js b/tests/baselines/reference/genericSpecializations2.js new file mode 100644 index 0000000000000..666ea43eeba94 --- /dev/null +++ b/tests/baselines/reference/genericSpecializations2.js @@ -0,0 +1,54 @@ +//// [genericSpecializations2.ts] +class IFoo { + foo(x: T): T { // no error on implementors because IFoo's T is different from foo's T + return null; + } +} + +class IntFooBad implements IFoo { + foo(x: string): string { return null; } +} + +class StringFoo2 implements IFoo { + foo(x: string): string { return null; } +} + +class StringFoo3 implements IFoo { + foo(x: T): T { return null; } +} + + + +//// [genericSpecializations2.js] +var IFoo = (function () { + function IFoo() { + } + IFoo.prototype.foo = function (x) { + return null; + }; + return IFoo; +})(); +var IntFooBad = (function () { + function IntFooBad() { + } + IntFooBad.prototype.foo = function (x) { + return null; + }; + return IntFooBad; +})(); +var StringFoo2 = (function () { + function StringFoo2() { + } + StringFoo2.prototype.foo = function (x) { + return null; + }; + return StringFoo2; +})(); +var StringFoo3 = (function () { + function StringFoo3() { + } + StringFoo3.prototype.foo = function (x) { + return null; + }; + return StringFoo3; +})(); diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt new file mode 100644 index 0000000000000..b4bf9f64bfb83 --- /dev/null +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/compiler/genericSpecializations3.ts (3 errors) ==== + interface IFoo { + foo(x: T): T; + } + + var iFoo: IFoo; + iFoo.foo(1); + + class IntFooBad implements IFoo { // error + ~~~~~~~~~ +!!! Class 'IntFooBad' incorrectly implements interface 'IFoo': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: string) => string' is not assignable to type '(x: number) => number': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + foo(x: string): string { return null; } + } + + var intFooBad: IntFooBad; + + class IntFoo implements IFoo { + foo(x: number): number { return null; } + } + + var intFoo: IntFoo; + + class StringFoo2 implements IFoo { + foo(x: string): string { return null; } + } + + var stringFoo2: StringFoo2; + stringFoo2.foo("hm"); + + + intFoo = stringFoo2; // error + ~~~~~~ +!!! Type 'StringFoo2' is not assignable to type 'IntFoo': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: string) => string' is not assignable to type '(x: number) => number': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + stringFoo2 = intFoo; // error + ~~~~~~~~~~ +!!! Type 'IntFoo' is not assignable to type 'StringFoo2': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: number) => number' is not assignable to type '(x: string) => string': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + + class StringFoo3 implements IFoo { // error + foo(x: T): T { return null; } + } + var stringFoo3: StringFoo3; \ No newline at end of file diff --git a/tests/baselines/reference/genericSpecializations3.js b/tests/baselines/reference/genericSpecializations3.js new file mode 100644 index 0000000000000..5b9c49e173b0f --- /dev/null +++ b/tests/baselines/reference/genericSpecializations3.js @@ -0,0 +1,79 @@ +//// [genericSpecializations3.ts] +interface IFoo { + foo(x: T): T; +} + +var iFoo: IFoo; +iFoo.foo(1); + +class IntFooBad implements IFoo { // error + foo(x: string): string { return null; } +} + +var intFooBad: IntFooBad; + +class IntFoo implements IFoo { + foo(x: number): number { return null; } +} + +var intFoo: IntFoo; + +class StringFoo2 implements IFoo { + foo(x: string): string { return null; } +} + +var stringFoo2: StringFoo2; +stringFoo2.foo("hm"); + + +intFoo = stringFoo2; // error +stringFoo2 = intFoo; // error + + +class StringFoo3 implements IFoo { // error + foo(x: T): T { return null; } +} +var stringFoo3: StringFoo3; + +//// [genericSpecializations3.js] +var iFoo; +iFoo.foo(1); +var IntFooBad = (function () { + function IntFooBad() { + } + IntFooBad.prototype.foo = function (x) { + return null; + }; + return IntFooBad; +})(); +var intFooBad; +var IntFoo = (function () { + function IntFoo() { + } + IntFoo.prototype.foo = function (x) { + return null; + }; + return IntFoo; +})(); +var intFoo; +var StringFoo2 = (function () { + function StringFoo2() { + } + StringFoo2.prototype.foo = function (x) { + return null; + }; + return StringFoo2; +})(); +var stringFoo2; +stringFoo2.foo("hm"); +intFoo = stringFoo2; +stringFoo2 = intFoo; +var StringFoo3 = (function () { + function StringFoo3() { + } + StringFoo3.prototype.foo = function (x) { + return null; + }; + return StringFoo3; +})(); +var stringFoo3; diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.js b/tests/baselines/reference/genericStaticAnyTypeFunction.js new file mode 100644 index 0000000000000..9557964c3bd27 --- /dev/null +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.js @@ -0,0 +1,35 @@ +//// [genericStaticAnyTypeFunction.ts] +class A { + + static one(source: T, value: number): T { + + return source; + + } + static goo() { return 0; } + + static two(source: T): T { + return this.one(source, 42); // should not error + + } + +} + + + + +//// [genericStaticAnyTypeFunction.js] +var A = (function () { + function A() { + } + A.one = function (source, value) { + return source; + }; + A.goo = function () { + return 0; + }; + A.two = function (source) { + return this.one(source, 42); + }; + return A; +})(); diff --git a/tests/baselines/reference/genericTypeArgumentInference1.js b/tests/baselines/reference/genericTypeArgumentInference1.js new file mode 100644 index 0000000000000..48c279f52c346 --- /dev/null +++ b/tests/baselines/reference/genericTypeArgumentInference1.js @@ -0,0 +1,23 @@ +//// [genericTypeArgumentInference1.ts] +module Underscore { + export interface Iterator { + (value: T, index: any, list: any): U; + } + export interface Static { + all(list: T[], iterator?: Iterator, context?: any): T; + identity(value: T): T; + } +} +declare var _: Underscore.Static; + +var r = _.all([true, 1, null, 'yes'], _.identity); +var r2 = _.all([true], _.identity); +var r3 = _.all([], _.identity); +var r4 = _.all([true], _.identity); + + +//// [genericTypeArgumentInference1.js] +var r = _.all([true, 1, null, 'yes'], _.identity); +var r2 = _.all([true], _.identity); +var r3 = _.all([], _.identity); +var r4 = _.all([true], _.identity); diff --git a/tests/baselines/reference/genericTypeAssertions1.errors.txt b/tests/baselines/reference/genericTypeAssertions1.errors.txt new file mode 100644 index 0000000000000..6e00d1aeb9480 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions1.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/genericTypeAssertions1.ts (3 errors) ==== + class A { foo(x: T) { }} + var foo = new A(); + var r: A = >new A(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A' is not assignable to type 'A': +!!! Type 'number' is not assignable to type 'string'. + var r2: A = >>foo; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A>' is not assignable to type 'A': +!!! Type 'A' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~~~ +!!! Neither type 'A>' nor type 'A' is assignable to the other: +!!! Type 'A' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions1.js b/tests/baselines/reference/genericTypeAssertions1.js new file mode 100644 index 0000000000000..091455a7a45f1 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions1.js @@ -0,0 +1,17 @@ +//// [genericTypeAssertions1.ts] +class A { foo(x: T) { }} +var foo = new A(); +var r: A = >new A(); // error +var r2: A = >>foo; // error + +//// [genericTypeAssertions1.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + }; + return A; +})(); +var foo = new A(); +var r = new A(); +var r2 = foo; diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt new file mode 100644 index 0000000000000..37182ae260699 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/genericTypeAssertions2.ts (3 errors) ==== + class A { foo(x: T) { } } + class B extends A { + bar(): T { + return null; + } + } + + var foo = new A(); + var r: A = >new B(); + var r2: A = >new B(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'B' is not assignable to type 'A': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: string) => void' is not assignable to type '(x: number) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + var r3: B = >new B(); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A' is not assignable to type 'B': +!!! Property 'bar' is missing in type 'A'. + var r4: A = >new A(); + var r5: A = >[]; // error + ~~~~~~~~~~~~~ +!!! Neither type 'A' nor type 'any[]' is assignable to the other. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js new file mode 100644 index 0000000000000..333417379c6ad --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -0,0 +1,45 @@ +//// [genericTypeAssertions2.ts] +class A { foo(x: T) { } } +class B extends A { + bar(): T { + return null; + } +} + +var foo = new A(); +var r: A = >new B(); +var r2: A = >new B(); // error +var r3: B = >new B(); // error +var r4: A = >new A(); +var r5: A = >[]; // error + +//// [genericTypeAssertions2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return null; + }; + return B; +})(A); +var foo = new A(); +var r = new B(); +var r2 = new B(); +var r3 = new B(); +var r4 = new A(); +var r5 = []; diff --git a/tests/baselines/reference/genericTypeAssertions3.js b/tests/baselines/reference/genericTypeAssertions3.js new file mode 100644 index 0000000000000..d59dd31e8684d --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions3.js @@ -0,0 +1,12 @@ +//// [genericTypeAssertions3.ts] +var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error +var s = < (x: T) => T > ((x: any) => { return null; }); // no error + + +//// [genericTypeAssertions3.js] +var r = (function (x) { + return null; +}); +var s = (function (x) { + return null; +}); diff --git a/tests/baselines/reference/genericTypeAssertions4.errors.txt b/tests/baselines/reference/genericTypeAssertions4.errors.txt new file mode 100644 index 0000000000000..13a4e2929b3c0 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions4.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/genericTypeAssertions4.ts (5 errors) ==== + class A { + foo() { return ""; } + } + + class B extends A { + bar() { return 1; } + } + + class C extends A { + baz() { return 1; } + } + + var a: A; + var b: B; + var c: C; + + function foo2(x: T) { + var y = x; + y = a; // error: cannot convert A to T + ~ +!!! Type 'A' is not assignable to type 'T'. + y = b; // error: cannot convert B to T + ~ +!!! Type 'B' is not assignable to type 'T'. + y = c; // error: cannot convert C to T + ~ +!!! Type 'C' is not assignable to type 'T'. + y = a; + y = b; // error: cannot convert B to T + ~~~~ +!!! Neither type 'T' nor type 'B' is assignable to the other. + y = c; // error: cannot convert C to T + ~~~~ +!!! Neither type 'T' nor type 'C' is assignable to the other. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js new file mode 100644 index 0000000000000..2357f882399af --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -0,0 +1,74 @@ +//// [genericTypeAssertions4.ts] +class A { + foo() { return ""; } +} + +class B extends A { + bar() { return 1; } +} + +class C extends A { + baz() { return 1; } +} + +var a: A; +var b: B; +var c: C; + +function foo2(x: T) { + var y = x; + y = a; // error: cannot convert A to T + y = b; // error: cannot convert B to T + y = c; // error: cannot convert C to T + y = a; + y = b; // error: cannot convert B to T + y = c; // error: cannot convert C to T +} + +//// [genericTypeAssertions4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ""; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return 1; + }; + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.baz = function () { + return 1; + }; + return C; +})(A); +var a; +var b; +var c; +function foo2(x) { + var y = x; + y = a; + y = b; + y = c; + y = a; + y = b; + y = c; +} diff --git a/tests/baselines/reference/genericTypeAssertions5.errors.txt b/tests/baselines/reference/genericTypeAssertions5.errors.txt new file mode 100644 index 0000000000000..7b25b89821312 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions5.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/genericTypeAssertions5.ts (5 errors) ==== + interface A { + foo(): string; + } + + interface B extends A { + bar(): number; + } + + interface C extends A { + baz(): number; + } + + var a: A; + var b: B; + var c: C; + + function foo2(x: T) { + var y = x; + y = a; // error: cannot convert A to T + ~ +!!! Type 'A' is not assignable to type 'T'. + y = b; // error: cannot convert B to T + ~ +!!! Type 'B' is not assignable to type 'T'. + y = c; // error: cannot convert C to T + ~ +!!! Type 'C' is not assignable to type 'T'. + y = a; + y = b; // error: cannot convert B to T + ~~~~ +!!! Neither type 'T' nor type 'B' is assignable to the other. + y = c; // error: cannot convert C to T + ~~~~ +!!! Neither type 'T' nor type 'C' is assignable to the other. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions5.js b/tests/baselines/reference/genericTypeAssertions5.js new file mode 100644 index 0000000000000..dc83c3ed74312 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions5.js @@ -0,0 +1,40 @@ +//// [genericTypeAssertions5.ts] +interface A { + foo(): string; +} + +interface B extends A { + bar(): number; +} + +interface C extends A { + baz(): number; +} + +var a: A; +var b: B; +var c: C; + +function foo2(x: T) { + var y = x; + y = a; // error: cannot convert A to T + y = b; // error: cannot convert B to T + y = c; // error: cannot convert C to T + y = a; + y = b; // error: cannot convert B to T + y = c; // error: cannot convert C to T +} + +//// [genericTypeAssertions5.js] +var a; +var b; +var c; +function foo2(x) { + var y = x; + y = a; + y = b; + y = c; + y = a; + y = b; + y = c; +} diff --git a/tests/baselines/reference/genericTypeAssertions6.errors.txt b/tests/baselines/reference/genericTypeAssertions6.errors.txt new file mode 100644 index 0000000000000..abc7883307168 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions6.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/genericTypeAssertions6.ts (3 errors) ==== + class A { + constructor(x) { + var y = x; + var z = x; + } + + f(x: T, y: U) { + x = y; + ~~~~ +!!! Neither type 'T' nor type 'U' is assignable to the other. + y = x; + ~~~~ +!!! Neither type 'U' nor type 'T' is assignable to the other. + } + } + + class B extends A { + g(x: T) { + var a: Date = x; + var b = x; + var c = new Date(); + var d = new Date(); + var e = new Date(); + ~~~~~~~~~~~~~~~~ +!!! Neither type 'T' nor type 'U' is assignable to the other. + } + } + + var b: B; + var c: A = >b; \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js new file mode 100644 index 0000000000000..d6061d8cf0a42 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -0,0 +1,60 @@ +//// [genericTypeAssertions6.ts] +class A { + constructor(x) { + var y = x; + var z = x; + } + + f(x: T, y: U) { + x = y; + y = x; + } +} + +class B extends A { + g(x: T) { + var a: Date = x; + var b = x; + var c = new Date(); + var d = new Date(); + var e = new Date(); + } +} + +var b: B; +var c: A = >b; + +//// [genericTypeAssertions6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A(x) { + var y = x; + var z = x; + } + A.prototype.f = function (x, y) { + x = y; + y = x; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.g = function (x) { + var a = x; + var b = x; + var c = new Date(); + var d = new Date(); + var e = new Date(); + }; + return B; +})(A); +var b; +var c = b; diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.js b/tests/baselines/reference/genericTypeParameterEquivalence2.js new file mode 100644 index 0000000000000..acd110af5b78b --- /dev/null +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.js @@ -0,0 +1,98 @@ +//// [genericTypeParameterEquivalence2.ts] +// compose :: (b->c) -> (a->b) -> (a->c) +function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { + return function (a:A) : C { + return f(g.apply(null, a)); + }; +} + +// forEach :: [a] -> (a -> ()) -> () +function forEach(list: A[], f: (a: A, n?: number) => void ): void { + for (var i = 0; i < list.length; ++i) { + f(list[i], i); + } +} + +// filter :: (a->bool) -> [a] -> [a] +function filter(f: (a: A) => boolean, ar: A[]): A[] { + var ret = []; + forEach(ar, (el) => { + if (f(el)) { + ret.push(el); + } + } ); + + return ret; +} + +// length :: [a] -> Num +function length2(ar: A[]): number { + return ar.length; +} + +// curry1 :: ((a,b)->c) -> (a->(b->c)) +function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { + return function (ay: A) { + return function (by: B) { + return f(ay, by); + }; + }; +} + +var cfilter = curry1(filter); + +// compose :: (b->c) -> (a->b) -> (a->c) +// length :: [a] -> Num +// cfilter :: {} -> {} -> [{}] +// pred :: a -> Bool +// cfilter(pred) :: {} -> [{}] +// length2 :: [a] -> Num +// countWhere :: (a -> Bool) -> [a] -> Num + +function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { + return compose(length2, cfilter(pred)); +} + +function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { + var where = cfilter(pred); + return compose(length2, where); +} + +//// [genericTypeParameterEquivalence2.js] +function compose(f, g) { + return function (a) { + return f(g.apply(null, a)); + }; +} +function forEach(list, f) { + for (var i = 0; i < list.length; ++i) { + f(list[i], i); + } +} +function filter(f, ar) { + var ret = []; + forEach(ar, function (el) { + if (f(el)) { + ret.push(el); + } + }); + return ret; +} +function length2(ar) { + return ar.length; +} +function curry1(f) { + return function (ay) { + return function (by) { + return f(ay, by); + }; + }; +} +var cfilter = curry1(filter); +function countWhere_1(pred) { + return compose(length2, cfilter(pred)); +} +function countWhere_2(pred) { + var where = cfilter(pred); + return compose(length2, where); +} diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt new file mode 100644 index 0000000000000..b3fdd2a93af74 --- /dev/null +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts (14 errors) ==== + // it is an error to use a generic type without type arguments + // all of these are errors + + declare class C { + foo: T; + } + + declare var c: C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare var a: { x: C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare var b: { (x: C): C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare var d: { [x: C]: C }; + ~ +!!! An index signature parameter type must be 'string' or 'number'. + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare function f(x: C): C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare class D extends C {} + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare module M { + export class E { foo: T } + } + + declare class D2 extends M.C { } + ~~~ +!!! Module 'M' has no exported member 'C'. + declare class D3 { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + + declare function h(x: T); + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare function i(x: T); + ~~~ +!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt new file mode 100644 index 0000000000000..e8fee6f002b2f --- /dev/null +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt @@ -0,0 +1,86 @@ +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts (24 errors) ==== + // it is an error to use a generic type without type arguments + // all of these are errors + + class C { + foo: T; + } + + var c: C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + + var a: { x: C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + var b: { (x: C): C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + var d: { [x: C]: C }; + ~ +!!! An index signature parameter type must be 'string' or 'number'. + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + var e = (x: C) => { var y: C; return y; } + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + function f(x: C): C { var y: C; return y; } + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + var g = function f(x: C): C { var y: C; return y; } + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + class D extends C { + ~ +!!! Generic type 'C' requires 1 type argument(s). + } + + interface I extends C {} + ~ +!!! Generic type 'C' requires 1 type argument(s). + + module M { + export class E { foo: T } + } + + class D2 extends M.E { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + class D3 { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + interface I2 extends M.E { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + + function h(x: T) { } + ~ +!!! Generic type 'C' requires 1 type argument(s). + function i(x: T) { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + + var j = null; + ~ +!!! Generic type 'C' requires 1 type argument(s). + var k = null; + ~~~ +!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt new file mode 100644 index 0000000000000..0513aaff05c98 --- /dev/null +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -0,0 +1,86 @@ +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts (24 errors) ==== + // it is an error to use a generic type without type arguments + // all of these are errors + + interface I { + foo: T; + } + + var c: I; + ~ +!!! Generic type 'I' requires 1 type argument(s). + + var a: { x: I }; + ~ +!!! Generic type 'I' requires 1 type argument(s). + var b: { (x: I): I }; + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + var d: { [x: I]: I }; + ~ +!!! An index signature parameter type must be 'string' or 'number'. + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + + var e = (x: I) => { var y: I; return y; } + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + + function f(x: I): I { var y: I; return y; } + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + + var g = function f(x: I): I { var y: I; return y; } + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + + class D extends I { + ~ +!!! Generic type 'I' requires 1 type argument(s). + } + + interface U extends I {} + ~ +!!! Generic type 'I' requires 1 type argument(s). + + module M { + export interface E { foo: T } + } + + class D2 extends M.C { } + ~~~ +!!! Module 'M' has no exported member 'C'. + interface D3 { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + interface I2 extends M.C { } + ~~~ +!!! Module 'M' has no exported member 'C'. + + function h(x: T) { } + ~ +!!! Generic type 'I' requires 1 type argument(s). + function i(x: T) { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + + var j = null; + ~ +!!! Cannot find name 'C'. + var k = null; + ~~~ +!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt new file mode 100644 index 0000000000000..7b0e4ba6fbe55 --- /dev/null +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts (14 errors) ==== + // it is an error to use a generic type without type arguments + // all of these are errors + + declare class C { + foo: T; + } + + declare var c: C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare var a: { x: C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare var b: { (x: C): C }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare var d: { [x: C]: C }; + ~ +!!! An index signature parameter type must be 'string' or 'number'. + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare function f(x: C): C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare class D extends C {} + ~ +!!! Generic type 'C' requires 1 type argument(s). + + declare module M { + export class E { foo: T } + } + + declare class D2 extends M.C { } + ~~~ +!!! Module 'M' has no exported member 'C'. + declare class D3 { } + ~~~ +!!! Generic type 'E' requires 1 type argument(s). + + declare function h(x: T); + ~ +!!! Generic type 'C' requires 1 type argument(s). + declare function i(x: T); + ~~~ +!!! Generic type 'E' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt new file mode 100644 index 0000000000000..6f464ab0eabb7 --- /dev/null +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (4 errors) ==== + class C { + foo(): T { return null } + } + interface I { + bar(): T; + } + var c1: C; // error + ~ +!!! Generic type 'C' requires 1 type argument(s). + var i1: I; // error + ~ +!!! Generic type 'I' requires 1 type argument(s). + var c2: C; // should be an error + ~ +!!! Generic type 'I' requires 1 type argument(s). + var i2: I; // should be an error + ~ +!!! Generic type 'C' requires 1 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js new file mode 100644 index 0000000000000..9c4dd761ad8a6 --- /dev/null +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js @@ -0,0 +1,26 @@ +//// [genericTypeReferencesRequireTypeArgs.ts] +class C { + foo(): T { return null } +} +interface I { + bar(): T; +} +var c1: C; // error +var i1: I; // error +var c2: C; // should be an error +var i2: I; // should be an error + + +//// [genericTypeReferencesRequireTypeArgs.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + return null; + }; + return C; +})(); +var c1; +var i1; +var c2; +var i2; diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt new file mode 100644 index 0000000000000..8f923d6bdb712 --- /dev/null +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts (1 errors) ==== + interface Foo { } + class Bar implements Foo { } + ~~~ +!!! Generic type 'Foo' requires 1 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js new file mode 100644 index 0000000000000..d651c5bea61c8 --- /dev/null +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.js @@ -0,0 +1,11 @@ +//// [genericTypeUsedWithoutTypeArguments1.ts] +interface Foo { } +class Bar implements Foo { } + + +//// [genericTypeUsedWithoutTypeArguments1.js] +var Bar = (function () { + function Bar() { + } + return Bar; +})(); diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt new file mode 100644 index 0000000000000..b6f9510b525ed --- /dev/null +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts (1 errors) ==== + interface Foo { } + interface Bar extends Foo { } + ~~~ +!!! Generic type 'Foo' requires 1 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.js b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.js new file mode 100644 index 0000000000000..53d8fb296f40e --- /dev/null +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.js @@ -0,0 +1,6 @@ +//// [genericTypeUsedWithoutTypeArguments3.ts] +interface Foo { } +interface Bar extends Foo { } + + +//// [genericTypeUsedWithoutTypeArguments3.js] diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.js b/tests/baselines/reference/genericTypeWithCallableMembers.js new file mode 100644 index 0000000000000..c885859dcfd40 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers.js @@ -0,0 +1,26 @@ +//// [genericTypeWithCallableMembers.ts] +interface Constructable { + new (): Constructable; +} + +class C { + constructor(public data: T, public data2: Constructable) { } + create() { + var x = new this.data(); // no error + var x2 = new this.data2(); // was error, shouldn't be + } +} + + +//// [genericTypeWithCallableMembers.js] +var C = (function () { + function C(data, data2) { + this.data = data; + this.data2 = data2; + } + C.prototype.create = function () { + var x = new this.data(); + var x2 = new this.data2(); + }; + return C; +})(); diff --git a/tests/baselines/reference/genericTypeWithCallableMembers2.js b/tests/baselines/reference/genericTypeWithCallableMembers2.js new file mode 100644 index 0000000000000..5ff105f026e98 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers2.js @@ -0,0 +1,16 @@ +//// [genericTypeWithCallableMembers2.ts] +function foo1(f: T) { + return f(); // should return 'string', once returned 'any' +} + +function foo2(f: T) { + return new f(); // should be legal, once was an error +} + +//// [genericTypeWithCallableMembers2.js] +function foo1(f) { + return f(); +} +function foo2(f) { + return new f(); +} diff --git a/tests/baselines/reference/genericTypeWithMultipleBases1.js b/tests/baselines/reference/genericTypeWithMultipleBases1.js new file mode 100644 index 0000000000000..8f136e58efdac --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases1.js @@ -0,0 +1,26 @@ +//// [genericTypeWithMultipleBases1.ts] +export interface I1 { + m1: () => void; +} + +export interface I2 { + m2: () => void; +} + +export interface I3 extends I1, I2 { +//export interface I3 extends I2, I1 { + p1: T; +} + +var x: I3; +x.p1; +x.m1(); +x.m2(); + + + +//// [genericTypeWithMultipleBases1.js] +var x; +x.p1; +x.m1(); +x.m2(); diff --git a/tests/baselines/reference/genericTypeWithMultipleBases2.js b/tests/baselines/reference/genericTypeWithMultipleBases2.js new file mode 100644 index 0000000000000..8101b7a479156 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases2.js @@ -0,0 +1,27 @@ +//// [genericTypeWithMultipleBases2.ts] +export interface I1 { + m1: () => void; +} + +export interface I2 { + m2: () => void; +} + +export interface I3 extends I2, I1 { + p1: T; +} + +var x: I3; +x.p1; +x.m1(); +x.m2(); + + + +//// [genericTypeWithMultipleBases2.js] +define(["require", "exports"], function (require, exports) { + var x; + x.p1; + x.m1(); + x.m2(); +}); diff --git a/tests/baselines/reference/genericTypeWithMultipleBases3.js b/tests/baselines/reference/genericTypeWithMultipleBases3.js new file mode 100644 index 0000000000000..d19a04905a994 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases3.js @@ -0,0 +1,26 @@ +//// [genericTypeWithMultipleBases3.ts] +interface IA { + +foo(x: T): T; + +} + +interface IB { + +bar(x: T): T; + +} + +interface IC extends IA, IB { } + +var c: IC; + +var x = c.foo; + +var y = c.bar; + + +//// [genericTypeWithMultipleBases3.js] +var c; +var x = c.foo; +var y = c.bar; diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt new file mode 100644 index 0000000000000..834a303620821 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts (2 errors) ==== + interface I { + f: (a: { a: number }) => void + } + class X implements I { + ~ +!!! Class 'X' incorrectly implements interface 'I': +!!! Types of property 'f' are incompatible: +!!! Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': +!!! Types of parameters 'a' and 'a' are incompatible: +!!! Type 'T' is not assignable to type '{ a: number; }': +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + f(a: T): void { } + } + var x = new X<{ a: string }>(); + var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' + ~~~~~~~~ +!!! Type 'X<{ a: string; }>' is not assignable to type 'I': +!!! Types of property 'f' are incompatible: +!!! Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': +!!! Types of parameters 'a' and 'a' are incompatible: +!!! Type '{ a: string; }' is not assignable to type '{ a: number; }': +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js new file mode 100644 index 0000000000000..6fda8db13f550 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js @@ -0,0 +1,21 @@ +//// [genericTypeWithNonGenericBaseMisMatch.ts] +interface I { + f: (a: { a: number }) => void +} +class X implements I { + f(a: T): void { } +} +var x = new X<{ a: string }>(); +var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' + + +//// [genericTypeWithNonGenericBaseMisMatch.js] +var X = (function () { + function X() { + } + X.prototype.f = function (a) { + }; + return X; +})(); +var x = new X(); +var i = x; diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.js b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.js new file mode 100644 index 0000000000000..ba9e3d63d671e --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.js @@ -0,0 +1,12 @@ +//// [genericWithCallSignatureReturningSpecialization.ts] +interface B { + f(): B; + (value: T): void; +} +var x: B; +x(true); // was error + + +//// [genericWithCallSignatureReturningSpecialization.js] +var x; +x(true); diff --git a/tests/baselines/reference/genericWithCallSignatures1.js b/tests/baselines/reference/genericWithCallSignatures1.js new file mode 100644 index 0000000000000..5bbd36e2e7fc7 --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatures1.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/genericWithCallSignatures1.ts] //// + +//// [genericWithCallSignatures_0.ts] +interface Callable { + (): T; + (value: T): void; +} + +interface CallableExtention extends Callable { } + +//// [genericWithCallSignatures_1.ts] +/// +class MyClass { + public callableThing: CallableExtention; + + public myMethod() { + var x = this.callableThing(); + } +} + +//// [genericWithCallSignatures_0.js] +//// [genericWithCallSignatures_1.js] +var MyClass = (function () { + function MyClass() { + } + MyClass.prototype.myMethod = function () { + var x = this.callableThing(); + }; + return MyClass; +})(); diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js new file mode 100644 index 0000000000000..b80b1268f35eb --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js @@ -0,0 +1,22 @@ +//// [genericWithIndexerOfTypeParameterType1.ts] +class LazyArray { + private objects = <{ [objectId: string]: T; }>{}; + array() { + return this.objects; + } +} +var lazyArray = new LazyArray(); +var value: string = lazyArray.array()["test"]; // used to be an error + +//// [genericWithIndexerOfTypeParameterType1.js] +var LazyArray = (function () { + function LazyArray() { + this.objects = {}; + } + LazyArray.prototype.array = function () { + return this.objects; + }; + return LazyArray; +})(); +var lazyArray = new LazyArray(); +var value = lazyArray.array()["test"]; diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js new file mode 100644 index 0000000000000..f0a57430546db --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -0,0 +1,55 @@ +//// [genericWithIndexerOfTypeParameterType2.ts] +export class Collection { + _itemsByKey: { [key: string]: TItem; }; +} + +export class List extends Collection{ + Bar() {} +} + +export class CollectionItem {} + +export class ListItem extends CollectionItem { + __isNew: boolean; +} + + +//// [genericWithIndexerOfTypeParameterType2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +define(["require", "exports"], function (require, exports) { + var Collection = (function () { + function Collection() { + } + return Collection; + })(); + exports.Collection = Collection; + var List = (function (_super) { + __extends(List, _super); + function List() { + _super.apply(this, arguments); + } + List.prototype.Bar = function () { + }; + return List; + })(Collection); + exports.List = List; + var CollectionItem = (function () { + function CollectionItem() { + } + return CollectionItem; + })(); + exports.CollectionItem = CollectionItem; + var ListItem = (function (_super) { + __extends(ListItem, _super); + function ListItem() { + _super.apply(this, arguments); + } + return ListItem; + })(CollectionItem); + exports.ListItem = ListItem; +}); diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt new file mode 100644 index 0000000000000..30f6c80e0b9cf --- /dev/null +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/genericWithOpenTypeParameters1.ts (3 errors) ==== + class B { + foo(x: T): T { return null; } + } + + var x: B; + x.foo(1); // no error + var f = (x: B) => { return x.foo(1); } // error + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var f2 = (x: B) => { return x.foo(1); } // error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var f3 = (x: B) => { return x.foo(1); } // error + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var f4 = (x: B) => { return x.foo(1); } // no error + \ No newline at end of file diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.js b/tests/baselines/reference/genericWithOpenTypeParameters1.js new file mode 100644 index 0000000000000..f007f182106d7 --- /dev/null +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.js @@ -0,0 +1,36 @@ +//// [genericWithOpenTypeParameters1.ts] +class B { + foo(x: T): T { return null; } +} + +var x: B; +x.foo(1); // no error +var f = (x: B) => { return x.foo(1); } // error +var f2 = (x: B) => { return x.foo(1); } // error +var f3 = (x: B) => { return x.foo(1); } // error +var f4 = (x: B) => { return x.foo(1); } // no error + + +//// [genericWithOpenTypeParameters1.js] +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var x; +x.foo(1); +var f = function (x) { + return x.foo(1); +}; +var f2 = function (x) { + return x.foo(1); +}; +var f3 = function (x) { + return x.foo(1); +}; +var f4 = function (x) { + return x.foo(1); +}; diff --git a/tests/baselines/reference/generics0.js b/tests/baselines/reference/generics0.js new file mode 100644 index 0000000000000..03612d8d24f79 --- /dev/null +++ b/tests/baselines/reference/generics0.js @@ -0,0 +1,15 @@ +//// [generics0.ts] +interface G { + x: T; +} + +var v2: G; + +var z = v2.x; // 'y' should be of type 'string' + +//// [generics0.js] +var v2; +var z = v2.x; + + +//// [generics0.d.ts] diff --git a/tests/baselines/reference/generics1.errors.txt b/tests/baselines/reference/generics1.errors.txt new file mode 100644 index 0000000000000..030a820e6c92a --- /dev/null +++ b/tests/baselines/reference/generics1.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/generics1.ts (3 errors) ==== + interface A { a: string; } + interface B extends A { b: string; } + interface C extends B { c: string; } + interface G { + x: T; + y: U; + } + var v1: G; // Ok + var v2: G<{ a: string }, C>; // Ok, equivalent to G + var v3: G; // Error, A not valid argument for U + ~~~~~~~ +!!! Type 'A' does not satisfy the constraint 'B': +!!! Property 'b' is missing in type 'A'. + var v4: G, C>; // Ok + var v5: G; // Error, any does not satisfy constraint B + var v6: G; // Error, wrong number of arguments + ~~~~~~ +!!! Generic type 'G' requires 2 type argument(s). + var v7: G; // Error, no type arguments + ~ +!!! Generic type 'G' requires 2 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/generics1.js b/tests/baselines/reference/generics1.js new file mode 100644 index 0000000000000..2e8571cba2d80 --- /dev/null +++ b/tests/baselines/reference/generics1.js @@ -0,0 +1,25 @@ +//// [generics1.ts] +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} +var v1: G; // Ok +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v3: G; // Error, A not valid argument for U +var v4: G, C>; // Ok +var v5: G; // Error, any does not satisfy constraint B +var v6: G; // Error, wrong number of arguments +var v7: G; // Error, no type arguments + + +//// [generics1.js] +var v1; +var v2; +var v3; +var v4; +var v5; +var v6; +var v7; diff --git a/tests/baselines/reference/generics1NoError.js b/tests/baselines/reference/generics1NoError.js new file mode 100644 index 0000000000000..547f9d252aeb6 --- /dev/null +++ b/tests/baselines/reference/generics1NoError.js @@ -0,0 +1,19 @@ +//// [generics1NoError.ts] +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} +var v1: G; // Ok +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v4: G, C>; // Ok + +//// [generics1NoError.js] +var v1; +var v2; +var v4; + + +//// [generics1NoError.d.ts] diff --git a/tests/baselines/reference/generics2.errors.txt b/tests/baselines/reference/generics2.errors.txt new file mode 100644 index 0000000000000..0d4742bc0e88c --- /dev/null +++ b/tests/baselines/reference/generics2.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/generics2.ts (3 errors) ==== + interface A { a: string; } + interface B extends A { b: string; } + interface C extends B { c: string; } + interface G { + x: T; + y: U; + } + + + var v1: { + x: { a: string; } + y: { a: string; b: string; c: string }; + }; // Ok + + + var v2: G<{ a: string }, C>; // Ok, equivalent to G + var v3: G; // Error, A not valid argument for U + ~~~~~~~ +!!! Type 'A' does not satisfy the constraint 'B': +!!! Property 'b' is missing in type 'A'. + var v4: G, C>; // Ok + var v5: G; // Error, any does not satisfy constraint B + var v6: G; // Error, wrong number of arguments + ~~~~~~ +!!! Generic type 'G' requires 2 type argument(s). + var v7: G; // Error, no type arguments + ~ +!!! Generic type 'G' requires 2 type argument(s). + \ No newline at end of file diff --git a/tests/baselines/reference/generics2.js b/tests/baselines/reference/generics2.js new file mode 100644 index 0000000000000..cf8984fe3bdf4 --- /dev/null +++ b/tests/baselines/reference/generics2.js @@ -0,0 +1,32 @@ +//// [generics2.ts] +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} + + +var v1: { + x: { a: string; } + y: { a: string; b: string; c: string }; +}; // Ok + + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v3: G; // Error, A not valid argument for U +var v4: G, C>; // Ok +var v5: G; // Error, any does not satisfy constraint B +var v6: G; // Error, wrong number of arguments +var v7: G; // Error, no type arguments + + +//// [generics2.js] +var v1; +var v2; +var v3; +var v4; +var v5; +var v6; +var v7; diff --git a/tests/baselines/reference/generics2NoError.js b/tests/baselines/reference/generics2NoError.js new file mode 100644 index 0000000000000..2c5cd02c0b9b5 --- /dev/null +++ b/tests/baselines/reference/generics2NoError.js @@ -0,0 +1,26 @@ +//// [generics2NoError.ts] +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} + + +var v1: { + x: { a: string; } + y: { a: string; b: string; c: string }; +}; // Ok + + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v4: G, C>; // Ok + +//// [generics2NoError.js] +var v1; +var v2; +var v4; + + +//// [generics2NoError.d.ts] diff --git a/tests/baselines/reference/generics3.js b/tests/baselines/reference/generics3.js new file mode 100644 index 0000000000000..104b2284e5a71 --- /dev/null +++ b/tests/baselines/reference/generics3.js @@ -0,0 +1,21 @@ +//// [generics3.ts] +class C { private x: T; } +interface X { f(): string; } +interface Y { f(): string; } +var a: C; +var b: C; + +a = b; // Ok - should be identical + +//// [generics3.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b; +a = b; + + +//// [generics3.d.ts] diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt new file mode 100644 index 0000000000000..9e2f1a5ccda60 --- /dev/null +++ b/tests/baselines/reference/generics4.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/generics4.ts (1 errors) ==== + class C { private x: T; } + interface X { f(): string; } + interface Y { f(): boolean; } + var a: C; + var b: C; + + a = b; // Not ok - return types of "f" are different + ~ +!!! Type 'C' is not assignable to type 'C': +!!! Type 'Y' is not assignable to type 'X': +!!! Types of property 'f' are incompatible: +!!! Type '() => boolean' is not assignable to type '() => string': +!!! Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/generics4.js b/tests/baselines/reference/generics4.js new file mode 100644 index 0000000000000..8a74afe9e52ca --- /dev/null +++ b/tests/baselines/reference/generics4.js @@ -0,0 +1,18 @@ +//// [generics4.ts] +class C { private x: T; } +interface X { f(): string; } +interface Y { f(): boolean; } +var a: C; +var b: C; + +a = b; // Not ok - return types of "f" are different + +//// [generics4.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b; +a = b; diff --git a/tests/baselines/reference/generics4NoError.js b/tests/baselines/reference/generics4NoError.js new file mode 100644 index 0000000000000..fa269796b8e22 --- /dev/null +++ b/tests/baselines/reference/generics4NoError.js @@ -0,0 +1,19 @@ +//// [generics4NoError.ts] +class C { private x: T; } +interface X { f(): string; } +interface Y { f(): boolean; } +var a: C; +var b: C; + + +//// [generics4NoError.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b; + + +//// [generics4NoError.d.ts] diff --git a/tests/baselines/reference/generics5.errors.txt b/tests/baselines/reference/generics5.errors.txt new file mode 100644 index 0000000000000..74f5d0e6e2c1b --- /dev/null +++ b/tests/baselines/reference/generics5.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/generics5.ts (1 errors) ==== + interface A { a: string; } + interface B extends A { b: string; } + + interface C extends B { c: string; } + interface G { + + + } + + var v3: G; // Error, A not valid argument for U + ~~~~~~~ +!!! Type 'A' does not satisfy the constraint 'B': +!!! Property 'b' is missing in type 'A'. + + \ No newline at end of file diff --git a/tests/baselines/reference/generics5.js b/tests/baselines/reference/generics5.js new file mode 100644 index 0000000000000..3020a9941e021 --- /dev/null +++ b/tests/baselines/reference/generics5.js @@ -0,0 +1,16 @@ +//// [generics5.ts] +interface A { a: string; } +interface B extends A { b: string; } + +interface C extends B { c: string; } +interface G { + + +} + +var v3: G; // Error, A not valid argument for U + + + +//// [generics5.js] +var v3; diff --git a/tests/baselines/reference/genericsAndHigherOrderFunctions.js b/tests/baselines/reference/genericsAndHigherOrderFunctions.js new file mode 100644 index 0000000000000..d99164bd5f60c --- /dev/null +++ b/tests/baselines/reference/genericsAndHigherOrderFunctions.js @@ -0,0 +1,22 @@ +//// [genericsAndHigherOrderFunctions.ts] +// no errors expected + +var combine: (f: (_: T) => S) => + (g: (_: U) => T) => + (x: U) => S + + = (f: (_: T) => S) => + (g: (_: U) => T) => + (x: U) => f(g(x)) + +var foo: (g: (x: K) => N) => + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => + (f: (_: N) => (_: R) => R) => (_: R) => R + + = (g: (x: K) => N) => + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => + (f: (_: N) => (_: R) => R) => h(combine(f)(g)) + +//// [genericsAndHigherOrderFunctions.js] +var combine = function (f) { return function (g) { return function (x) { return f(g(x)); }; }; }; +var foo = function (g) { return function (h) { return function (f) { return h(combine(f)(g)); }; }; }; diff --git a/tests/baselines/reference/genericsManyTypeParameters.js b/tests/baselines/reference/genericsManyTypeParameters.js new file mode 100644 index 0000000000000..19a5117cb6baf --- /dev/null +++ b/tests/baselines/reference/genericsManyTypeParameters.js @@ -0,0 +1,65 @@ +//// [genericsManyTypeParameters.ts] +function Foo< + a1, a21, a31, a41, a51, a61, + a119, a22, a32, a42, a52, a62, + a219, a23, a33, a43, a53, a63, + a319, a24, a34, a44, a54, a64, + a419, a25, a35, a45, a55, a65, + a519, a26, a36, a46, a56, a66, + a619, a27, a37, a47, a57, a67, + a71, a28, a38, a48, a58, a68, + a81, a29, a39, a49, a59, a69, + a91, a210, a310, a410, a510, a610, + a111, a211, a311, a411, a511, a611, + a112, a212, a312, a412, a512, a612, + a113, a213, a313, a413, a513, a613, + a114, a214, a314, a414, a514, a614, + a115, a215, a315, a415, a515, a615, + a116, a216, a316, a416, a516, a616, + a117, a217, a317, a417, a517, a617, + a118, a218, a318, a418, a518, a618> + ( + x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, + x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, + x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, + x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, + x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, + x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, + x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, + x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, + x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, + x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, + x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, + x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, + x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, + x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, + x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, + x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, + x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, + x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618 + ) + { + return [x1 , y1 , z1 , a1 , b1 , c1, + x2 , y2 , z2 , a2 , b2 , c2, + x3 , y3 , z3 , a3 , b3 , c3, + x4 , y4 , z4 , a4 , b4 , c4, + x5 , y5 , z5 , a5 , b5 , c5, + x6 , y6 , z6 , a6 , b6 , c6, + x7 , y7 , z7 , a7 , b7 , c7, + x8 , y8 , z8 , a8 , b8 , c8, + x9 , y9 , z9 , a9 , b9 , c9, + x10 , y12 , z10 , a10 , b10 , c10, + x11 , y13 , z11 , a11 , b11 , c11, + x12 , y14 , z12 , a12 , b12 , c12, + x13 , y15 , z13 , a13 , b13 , c13, + x14 , y16 , z14 , a14 , b14 , c14, + x15 , y17 , z15 , a15 , b15 , c15, + x16 , y18 , z16 , a16 , b16 , c16, + x17 , y19 , z17 , a17 , b17 , c17, + x18 , y10 , z18 , a18 , b18 , c18]; + } + +//// [genericsManyTypeParameters.js] +function Foo(x1, y1, z1, a1, b1, c1, x2, y2, z2, a2, b2, c2, x3, y3, z3, a3, b3, c3, x4, y4, z4, a4, b4, c4, x5, y5, z5, a5, b5, c5, x6, y6, z6, a6, b6, c6, x7, y7, z7, a7, b7, c7, x8, y8, z8, a8, b8, c8, x9, y9, z9, a9, b9, c9, x10, y12, z10, a10, b10, c10, x11, y13, z11, a11, b11, c11, x12, y14, z12, a12, b12, c12, x13, y15, z13, a13, b13, c13, x14, y16, z14, a14, b14, c14, x15, y17, z15, a15, b15, c15, x16, y18, z16, a16, b16, c16, x17, y19, z17, a17, b17, c17, x18, y10, z18, a18, b18, c18) { + return [x1, y1, z1, a1, b1, c1, x2, y2, z2, a2, b2, c2, x3, y3, z3, a3, b3, c3, x4, y4, z4, a4, b4, c4, x5, y5, z5, a5, b5, c5, x6, y6, z6, a6, b6, c6, x7, y7, z7, a7, b7, c7, x8, y8, z8, a8, b8, c8, x9, y9, z9, a9, b9, c9, x10, y12, z10, a10, b10, c10, x11, y13, z11, a11, b11, c11, x12, y14, z12, a12, b12, c12, x13, y15, z13, a13, b13, c13, x14, y16, z14, a14, b14, c14, x15, y17, z15, a15, b15, c15, x16, y18, z16, a16, b16, c16, x17, y19, z17, a17, b17, c17, x18, y10, z18, a18, b18, c18]; +} diff --git a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt new file mode 100644 index 0000000000000..052822f1bad48 --- /dev/null +++ b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts (10 errors) ==== + function f() { } + ~ +!!! Duplicate identifier 'x'. + function f2(a: X, b: X): X { return null; } + ~ +!!! Duplicate identifier 'X'. + class C { + ~ +!!! Duplicate identifier 'X'. + public f() {} + ~ +!!! Duplicate identifier 'x'. + public f2(a: X, b: X): X { return null; } + ~ +!!! Duplicate identifier 'X'. + } + + interface I { + ~ +!!! Duplicate identifier 'X'. + f(); + ~ +!!! Duplicate identifier 'X'. + f2(a: X, b: X): X; + ~ +!!! Duplicate identifier 'X'. + } + + var m = { + a: function f() {}, + ~ +!!! Duplicate identifier 'X'. + b: function f2(a: X, b: X): X { return null; } + ~ +!!! Duplicate identifier 'X'. + } \ No newline at end of file diff --git a/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js new file mode 100644 index 0000000000000..f7f638f10e007 --- /dev/null +++ b/tests/baselines/reference/genericsWithDuplicateTypeParameters1.js @@ -0,0 +1,41 @@ +//// [genericsWithDuplicateTypeParameters1.ts] +function f() { } +function f2(a: X, b: X): X { return null; } +class C { + public f() {} + public f2(a: X, b: X): X { return null; } +} + +interface I { + f(); + f2(a: X, b: X): X; +} + +var m = { + a: function f() {}, + b: function f2(a: X, b: X): X { return null; } +} + +//// [genericsWithDuplicateTypeParameters1.js] +function f() { +} +function f2(a, b) { + return null; +} +var C = (function () { + function C() { + } + C.prototype.f = function () { + }; + C.prototype.f2 = function (a, b) { + return null; + }; + return C; +})(); +var m = { + a: function f() { + }, + b: function f2(a, b) { + return null; + } +}; diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt new file mode 100644 index 0000000000000..eb0aac2035fd5 --- /dev/null +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/compiler/genericsWithoutTypeParameters1.ts (15 errors) ==== + class C { + foo(): T { return null } + } + + interface I { + bar(): T; + } + + var c1: C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + var i1: I; + ~ +!!! Generic type 'I' requires 1 type argument(s). + var c2: C; + ~ +!!! Generic type 'I' requires 1 type argument(s). + var i2: I; + ~ +!!! Generic type 'C' requires 1 type argument(s). + + function foo(x: C, y: I) { } + ~ +!!! Generic type 'C' requires 1 type argument(s). + ~ +!!! Generic type 'I' requires 1 type argument(s). + function foo2(x: C, y: I) { } + ~ +!!! Generic type 'I' requires 1 type argument(s). + ~ +!!! Generic type 'C' requires 1 type argument(s). + + var x: { a: C } = { a: new C() }; + ~ +!!! Generic type 'C' requires 1 type argument(s). + var x2: { a: I } = { a: { bar() { return 1 } } }; + ~ +!!! Generic type 'I' requires 1 type argument(s). + + class D { + x: C; + ~ +!!! Generic type 'C' requires 1 type argument(s). + y: D; + ~ +!!! Generic type 'D' requires 1 type argument(s). + } + + interface J { + x: I; + ~ +!!! Generic type 'I' requires 1 type argument(s). + y: J; + ~ +!!! Generic type 'J' requires 1 type argument(s). + } + + class A { } + function f(x: T): A { + ~ +!!! Generic type 'A' requires 1 type argument(s). + return null; + } \ No newline at end of file diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.js b/tests/baselines/reference/genericsWithoutTypeParameters1.js new file mode 100644 index 0000000000000..293bad11b0a74 --- /dev/null +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.js @@ -0,0 +1,69 @@ +//// [genericsWithoutTypeParameters1.ts] +class C { + foo(): T { return null } +} + +interface I { + bar(): T; +} + +var c1: C; +var i1: I; +var c2: C; +var i2: I; + +function foo(x: C, y: I) { } +function foo2(x: C, y: I) { } + +var x: { a: C } = { a: new C() }; +var x2: { a: I } = { a: { bar() { return 1 } } }; + +class D { + x: C; + y: D; +} + +interface J { + x: I; + y: J; +} + +class A { } +function f(x: T): A { + return null; +} + +//// [genericsWithoutTypeParameters1.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + return null; + }; + return C; +})(); +var c1; +var i1; +var c2; +var i2; +function foo(x, y) { +} +function foo2(x, y) { +} +var x = { a: new C() }; +var x2 = { a: { bar: function bar() { + return 1; +} } }; +var D = (function () { + function D() { + } + return D; +})(); +var A = (function () { + function A() { + } + return A; +})(); +function f(x) { + return null; +} diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt new file mode 100644 index 0000000000000..2a3e67203c950 --- /dev/null +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts (4 errors) ==== + declare function _(value: Array): _; + ~~~~ +!!! Cannot find name '_'. + declare function _(value: T): _; + ~~~~ +!!! Cannot find name '_'. + + declare module _ { + export function each( + //list: List, + //iterator: ListIterator, + context?: any): void; + + interface ListIterator { + (value: T, index: number, list: T[]): TResult; + } + } + + declare class _ { + ~ +!!! Duplicate identifier '_'. + each(iterator: _.ListIterator, context?: any): void; + } + + module MyModule { + export class MyClass { + public get myGetter() { + ~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var obj:any = {}; + + return obj; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetAsMemberNames.errors.txt b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt new file mode 100644 index 0000000000000..ca92470e0115c --- /dev/null +++ b/tests/baselines/reference/getAndSetAsMemberNames.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/getAndSetAsMemberNames.ts (1 errors) ==== + class C1 { + set: boolean; + get = 1; + } + class C2 { + set; + } + class C3 { + set (x) { + return x + 1; + } + } + class C4 { + get: boolean = true; + } + class C5 { + public set: () => boolean = function () { return true; }; + get (): boolean { return true; } + set t(x) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt new file mode 100644 index 0000000000000..dbb4e935f2b27 --- /dev/null +++ b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/getAndSetNotIdenticalType.ts (4 errors) ==== + class C { + get x(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~ + return 1; + ~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'get' and 'set' accessor must have the same type. + set x(v: string) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~ +!!! 'get' and 'set' accessor must have the same type. + } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt new file mode 100644 index 0000000000000..4589f5296037e --- /dev/null +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/getAndSetNotIdenticalType2.ts (5 errors) ==== + class A { foo: T; } + + class C { + data: A; + get x(): A { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~ + return this.data; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'get' and 'set' accessor must have the same type. + set x(v: A) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~ + this.data = v; + ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! Type 'A' is not assignable to type 'A': +!!! Type 'string' is not assignable to type 'T'. + } + ~~~~~ +!!! 'get' and 'set' accessor must have the same type. + } + + var x = new C(); + var r = x.x; + x.x = r; \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt new file mode 100644 index 0000000000000..193f7613202d7 --- /dev/null +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/getAndSetNotIdenticalType3.ts (5 errors) ==== + class A { foo: T; } + + class C { + data: A; + get x(): A { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~ + return this.data; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'get' and 'set' accessor must have the same type. + set x(v: A) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~ + this.data = v; + ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! Type 'A' is not assignable to type 'A': +!!! Type 'string' is not assignable to type 'number'. + } + ~~~~~ +!!! 'get' and 'set' accessor must have the same type. + } + + var x = new C(); + var r = x.x; + x.x = r; \ No newline at end of file diff --git a/tests/baselines/reference/getsetReturnTypes.errors.txt b/tests/baselines/reference/getsetReturnTypes.errors.txt new file mode 100644 index 0000000000000..8b9b68e87cc69 --- /dev/null +++ b/tests/baselines/reference/getsetReturnTypes.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/getsetReturnTypes.ts (1 errors) ==== + function makePoint(x: number) { + return { + get x() { return x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + }; + var x = makePoint(2).x; + var y: number = makePoint(2).x; \ No newline at end of file diff --git a/tests/baselines/reference/getterMissingReturnError.errors.txt b/tests/baselines/reference/getterMissingReturnError.errors.txt new file mode 100644 index 0000000000000..cf4f9b6b1a7a7 --- /dev/null +++ b/tests/baselines/reference/getterMissingReturnError.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/getterMissingReturnError.ts (2 errors) ==== + class test { + public get p2(){ + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! Getters must return a value. + + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/getterSetterNonAccessor.js b/tests/baselines/reference/getterSetterNonAccessor.js new file mode 100644 index 0000000000000..e234574d7349c --- /dev/null +++ b/tests/baselines/reference/getterSetterNonAccessor.js @@ -0,0 +1,22 @@ +//// [getterSetterNonAccessor.ts] +function getFunc():any{return 0;} +function setFunc(v){} + +Object.defineProperty({}, "0", ({ + get: getFunc, + set: setFunc, + configurable: true + })); + + +//// [getterSetterNonAccessor.js] +function getFunc() { + return 0; +} +function setFunc(v) { +} +Object.defineProperty({}, "0", ({ + get: getFunc, + set: setFunc, + configurable: true +})); diff --git a/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt new file mode 100644 index 0000000000000..8b1a7a10a3a10 --- /dev/null +++ b/tests/baselines/reference/getterThatThrowsShouldNotNeedReturn.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/getterThatThrowsShouldNotNeedReturn.ts (1 errors) ==== + class Greeter { + public get greet(): string { + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + throw ''; // should not raise an error + } + public greeting(): string { + throw ''; // should not raise an error + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/gettersAndSetters.errors.txt b/tests/baselines/reference/gettersAndSetters.errors.txt new file mode 100644 index 0000000000000..c17653545fa84 --- /dev/null +++ b/tests/baselines/reference/gettersAndSetters.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/gettersAndSetters.ts (8 errors) ==== + // classes + class C { + public fooBack = ""; + static barBack:string = ""; + public bazBack = ""; + + public get Foo() { return this.fooBack;} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set Foo(foo:string) {this.fooBack = foo;} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + static get Bar() {return C.barBack;} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set Bar(bar:string) {C.barBack = bar;} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public get = function() {} // ok + public set = function() {} // ok + } + + var c = new C(); + + var foo = c.Foo; + c.Foo = "foov"; + + var bar = C.Bar; + C.Bar = "barv"; + + var baz = c.Baz; + ~~~ +!!! Property 'Baz' does not exist on type 'C'. + c.Baz = "bazv"; + ~~~ +!!! Property 'Baz' does not exist on type 'C'. + + // The Foo accessors' return and param types should be contextually typed to the Foo field + var o : {Foo:number;} = {get Foo() {return 0;}, set Foo(val:number){val}}; // o + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + var ofg = o.Foo; + o.Foo = 0; + + + interface I1 { + (n:number):number; + } + + var i:I1 = function (n) {return n;} + \ No newline at end of file diff --git a/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt new file mode 100644 index 0000000000000..df23e0da36204 --- /dev/null +++ b/tests/baselines/reference/gettersAndSettersAccessibility.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/gettersAndSettersAccessibility.ts (4 errors) ==== + class C99 { + private get Baz():number { return 0; } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Getter and setter accessors do not agree in visibility. + public set Baz(n:number) {} // error - accessors do not agree in visibility + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Getter and setter accessors do not agree in visibility. + } + \ No newline at end of file diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt new file mode 100644 index 0000000000000..1cfefea5202ed --- /dev/null +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/gettersAndSettersErrors.ts (9 errors) ==== + class C { + public get Foo() { return "foo";} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set Foo(foo:string) {} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public Foo = 0; // error - duplicate identifier Foo - confirmed + ~~~ +!!! Duplicate identifier 'Foo'. + public get Goo(v:string):string {return null;} // error - getters must not have a parameter + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set Goo(v:string):string {} // error - setters must not specify a return type + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class E { + private get Baz():number { return 0; } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Getter and setter accessors do not agree in visibility. + public set Baz(n:number) {} // error - accessors do not agree in visibility + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Getter and setter accessors do not agree in visibility. + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt b/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt new file mode 100644 index 0000000000000..5b869132a70da --- /dev/null +++ b/tests/baselines/reference/gettersAndSettersTypesAgree.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/gettersAndSettersTypesAgree.ts (8 errors) ==== + class C { + public get Foo() { return "foo";} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set Foo(foo) {} // ok - type inferred from getter return statement + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + public get Bar() { return "foo";} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set Bar(bar:string) {} // ok - type must be declared + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + var o1 = {get Foo(){return 0;}, set Foo(val){}}; // ok - types agree (inference) + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var o2 = {get Foo(){return 0;}, set Foo(val:number){}}; // ok - types agree + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt new file mode 100644 index 0000000000000..35dddbb324e6d --- /dev/null +++ b/tests/baselines/reference/giant.errors.txt @@ -0,0 +1,1136 @@ +==== tests/cases/compiler/giant.ts (227 errors) ==== + + /* + Prefixes + p -> public + r -> private + i -> import + e -> export + a -> ambient + t -> static + s -> set + g -> get + + MAX DEPTH 3 LEVELS + */ + var V; + function F() { }; + class C { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + interface I { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + module M { + var V; + function F() { }; + class C { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + interface I { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + module M { + var V; + function F() { }; + class C { }; + interface I { }; + module M { }; + export var eV; + export function eF() { }; + export class eC { }; + export interface eI { }; + export module eM { }; + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { }; + export declare module eaM { }; + } + export var eV; + export function eF() { }; + export class eC { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + export interface eI { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + export module eM { + var V; + function F() { }; + class C { }; + interface I { }; + module M { }; + export var eV; + export function eF() { }; + export class eC { }; + export interface eI { }; + export module eM { }; + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { }; + export declare module eaM { }; + } + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { + constructor () { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + public pV; + private rV; + public pF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + private rF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public pgF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static tsF(param:any) { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + } + ~ +!!! '{' expected. + export declare module eaM { + var V; + function F() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + class C { } + interface I { } + module M { } + export var eV; + export function eF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export class eC { } + export interface eI { } + export module eM { } + } + } + export var eV; + export function eF() { }; + export class eC { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + export interface eI { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + export module eM { + var V; + function F() { }; + class C { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + interface I { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + module M { + var V; + function F() { }; + class C { }; + interface I { }; + module M { }; + export var eV; + export function eF() { }; + export class eC { }; + export interface eI { }; + export module eM { }; + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { }; + export declare module eaM { }; + } + export var eV; + export function eF() { }; + export class eC { + constructor () { } + public pV; + private rV; + public pF() { } + private rF() { } + public pgF() { } + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + ~~~ +!!! Getters must return a value. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + ~~~ +!!! Getters must return a value. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + static tsF(param:any) { } + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + ~~~ +!!! Getters must return a value. + } + ~ +!!! '{' expected. + export interface eI { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + export module eM { + var V; + function F() { }; + class C { }; + interface I { }; + module M { }; + export var eV; + export function eF() { }; + export class eC { }; + export interface eI { }; + export module eM { }; + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { }; + export declare module eaM { }; + } + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { + constructor () { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + public pV; + private rV; + public pF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + private rF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public pgF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static tsF(param:any) { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + } + ~ +!!! '{' expected. + export declare module eaM { + var V; + function F() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + class C { } + interface I { } + module M { } + export var eV; + export function eF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export class eC { } + export interface eI { } + export module eM { } + } + } + export declare var eaV; + export declare function eaF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + export declare class eaC { + constructor () { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + public pV; + private rV; + public pF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + private rF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public pgF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + public get pgF() + ~~~ +!!! Duplicate identifier 'pgF'. + public psF(param:any) { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + public set psF(param:any) + ~~~ +!!! Duplicate identifier 'psF'. + private rgF() { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private get rgF() + ~~~ +!!! Duplicate identifier 'rgF'. + private rsF(param:any) { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + private set rsF(param:any) + ~~~ +!!! Duplicate identifier 'rsF'. + static tV; + ~~~~~~ +!!! '{' expected. + static tF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static tsF(param:any) { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static set tsF(param:any) + ~~~ +!!! Duplicate identifier 'tsF'. + static tgF() { } + ~~~~~~ +!!! '{' expected. + ~ +!!! A function implementation cannot be declared in an ambient context. + static get tgF() + ~~~ +!!! Duplicate identifier 'tgF'. + } + ~ +!!! '{' expected. + export declare module eaM { + var V; + function F() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + class C { + constructor () { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + public pV; + private rV; + public pF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static tV; + static tF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + } + interface I { + //Call Signature + (); + (): number; + (p: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + module M { + var V; + function F() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + class C { } + interface I { } + module M { } + export var eV; + export function eF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export class eC { } + export interface eI { } + export module eM { } + export declare var eaV + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + export declare function eaF() { }; + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export declare class eaC { } + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + export declare module eaM { } + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + } + export var eV; + export function eF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export class eC { + constructor () { } + ~ +!!! A constructor implementation cannot be declared in an ambient context. + public pV; + private rV; + public pF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + static tV + static tF() { } + ~ +!!! A function implementation cannot be declared in an ambient context. + } + export interface eI { + //Call Signature + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signature + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signature + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signature + p; + p1?; + p2?: string; + + //Function Signature + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + export module eM { + var V; + function F() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + class C { } + module M { } + export var eV; + export function eF() { }; + ~ +!!! A function implementation cannot be declared in an ambient context. + ~ +!!! Statements are not allowed in ambient contexts. + export class eC { } + export interface eI { } + export module eM { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/global.js b/tests/baselines/reference/global.js new file mode 100644 index 0000000000000..a187e026710ed --- /dev/null +++ b/tests/baselines/reference/global.js @@ -0,0 +1,22 @@ +//// [global.ts] +module M { + export function f(y:number) { + return x+y; + } +} + +var x=10; +M.f(3); + + + +//// [global.js] +var M; +(function (M) { + function f(y) { + return x + y; + } + M.f = f; +})(M || (M = {})); +var x = 10; +M.f(3); diff --git a/tests/baselines/reference/globalThis.js b/tests/baselines/reference/globalThis.js new file mode 100644 index 0000000000000..1479658fdd53a --- /dev/null +++ b/tests/baselines/reference/globalThis.js @@ -0,0 +1,5 @@ +//// [globalThis.ts] +var __e = Math.E; // should not generate 'this.Math.E' + +//// [globalThis.js] +var __e = Math.E; diff --git a/tests/baselines/reference/globalThisCapture.js b/tests/baselines/reference/globalThisCapture.js new file mode 100644 index 0000000000000..f3186389f2232 --- /dev/null +++ b/tests/baselines/reference/globalThisCapture.js @@ -0,0 +1,15 @@ +//// [globalThisCapture.ts] +// Add a lambda to ensure global 'this' capture is triggered +(()=>this.window); + +var parts = []; + +// Ensure that the generated code is correct +parts[0]; + + +//// [globalThisCapture.js] +var _this = this; +(function () { return _this.window; }); +var parts = []; +parts[0]; diff --git a/tests/baselines/reference/grammarAmbiguities.errors.txt b/tests/baselines/reference/grammarAmbiguities.errors.txt new file mode 100644 index 0000000000000..ac6cadc92e417 --- /dev/null +++ b/tests/baselines/reference/grammarAmbiguities.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts (2 errors) ==== + function f(n: any) { return null; } + function g(x: any) { return null; } + interface A { } + interface B { } + var A, B; + + f(g(7)); + f(g < A, B > 7); // Should error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f(g < A, B > +(7)); // Should error + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + \ No newline at end of file diff --git a/tests/baselines/reference/grammarAmbiguities.js b/tests/baselines/reference/grammarAmbiguities.js new file mode 100644 index 0000000000000..1b58e69e51425 --- /dev/null +++ b/tests/baselines/reference/grammarAmbiguities.js @@ -0,0 +1,24 @@ +//// [grammarAmbiguities.ts] +function f(n: any) { return null; } +function g(x: any) { return null; } +interface A { } +interface B { } +var A, B; + +f(g(7)); +f(g < A, B > 7); // Should error +f(g < A, B > +(7)); // Should error + + + +//// [grammarAmbiguities.js] +function f(n) { + return null; +} +function g(x) { + return null; +} +var A, B; +f(g(7)); +f(g < A, B > 7); +f(g < A, B > +(7)); diff --git a/tests/baselines/reference/grammarAmbiguities1.errors.txt b/tests/baselines/reference/grammarAmbiguities1.errors.txt new file mode 100644 index 0000000000000..0c52ec2c98ac4 --- /dev/null +++ b/tests/baselines/reference/grammarAmbiguities1.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/grammarAmbiguities1.ts (6 errors) ==== + class A { foo() { } } + class B { bar() { }} + function f(x) { return x; } + function g(x) { return f(x); } + g(7) + + f(g(7)); + f(g < A, B > 7); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~ +!!! Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. + ~~~~~ +!!! Operator '>' cannot be applied to types 'typeof B' and 'number'. + f(g < A, B > +(7)); + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~ +!!! Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. + ~~~~~~~~ +!!! Operator '>' cannot be applied to types 'typeof B' and 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/grammarAmbiguities1.js b/tests/baselines/reference/grammarAmbiguities1.js new file mode 100644 index 0000000000000..cb6e4b75473d5 --- /dev/null +++ b/tests/baselines/reference/grammarAmbiguities1.js @@ -0,0 +1,37 @@ +//// [grammarAmbiguities1.ts] +class A { foo() { } } +class B { bar() { }} +function f(x) { return x; } +function g(x) { return f(x); } +g(7) + +f(g(7)); +f(g < A, B > 7); +f(g < A, B > +(7)); + + +//// [grammarAmbiguities1.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.bar = function () { + }; + return B; +})(); +function f(x) { + return x; +} +function g(x) { + return f(x); +} +g(7); +f(g(7)); +f(g < A, B > 7); +f(g < A, B > +(7)); diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt new file mode 100644 index 0000000000000..7ce7326d13a6e --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ==== + class arrTest { + test(arg1: number[]); + test(arg1: string[]); + test(arg1: any[]) { } + callTest() { + this.test([1, 2, 3, 5]); + this.test(["hi"]); + this.test([]); + this.test([1, 2, "hi", 5]); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.js b/tests/baselines/reference/heterogeneousArrayAndOverloads.js new file mode 100644 index 0000000000000..1e166879621fa --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.js @@ -0,0 +1,27 @@ +//// [heterogeneousArrayAndOverloads.ts] +class arrTest { + test(arg1: number[]); + test(arg1: string[]); + test(arg1: any[]) { } + callTest() { + this.test([1, 2, 3, 5]); + this.test(["hi"]); + this.test([]); + this.test([1, 2, "hi", 5]); // Error + } +} + +//// [heterogeneousArrayAndOverloads.js] +var arrTest = (function () { + function arrTest() { + } + arrTest.prototype.test = function (arg1) { + }; + arrTest.prototype.callTest = function () { + this.test([1, 2, 3, 5]); + this.test(["hi"]); + this.test([]); + this.test([1, 2, "hi", 5]); + }; + return arrTest; +})(); diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js new file mode 100644 index 0000000000000..f16c398e398bd --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -0,0 +1,241 @@ +//// [heterogeneousArrayLiterals.ts] +// type of an array is the best common type of its elements (plus its contextual type if it exists) + +var a = [1, '']; // {}[] +var b = [1, null]; // number[] +var c = [1, '', null]; // {}[] +var d = [{}, 1]; // {}[] +var e = [{}, Object]; // {}[] + +var f = [[], [1]]; // number[][] +var g = [[1], ['']]; // {}[] + +var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] +var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] + +var j = [() => 1, () => '']; // {}[] +var k = [() => 1, () => 1]; // { (): number }[] +var l = [() => 1, () => null]; // { (): any }[] +var m = [() => 1, () => '', () => null]; // { (): any }[] +var n = [[() => 1], [() => '']]; // {}[] + +class Base { foo: string; } +class Derived extends Base { bar: string; } +class Derived2 extends Base { baz: string; } +var base: Base; +var derived: Derived; +var derived2: Derived2; + +module Derived { + var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] + var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] + + var j = [() => base, () => derived]; // { {}: Base } + var k = [() => base, () => 1]; // {}[]~ + var l = [() => base, () => null]; // { (): any }[] + var m = [() => base, () => derived, () => null]; // { (): any }[] + var n = [[() => base], [() => derived]]; // { (): Base }[] + var o = [derived, derived2]; // {}[] + var p = [derived, derived2, base]; // Base[] + var q = [[() => derived2], [() => derived]]; // {}[] +} + +module WithContextualType { + // no errors + var a: Base[] = [derived, derived2]; + var b: Derived[] = [null]; + var c: Derived[] = []; + var d: { (): Base }[] = [() => derived, () => derived2]; +} + +function foo(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] +} + +function foo2(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] +} + +function foo3(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] +} + +function foo4(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // BUG 821629 + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] + + var k: Base[] = [t, u]; +} + +//function foo3(t: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // {}[] +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => null]; // { (): any }[] + +// var g = [t, base]; // Base[] +// var h = [t, derived]; // Derived[] +// var i = [u, base]; // Base[] +// var j = [u, derived]; // Derived[] +//} + +//function foo4(t: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // BUG 821629 +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => null]; // { (): any }[] + +// var g = [t, base]; // Base[] +// var h = [t, derived]; // Derived[] +// var i = [u, base]; // Base[] +// var j = [u, derived]; // Derived[] + +// var k: Base[] = [t, u]; +//} + +//// [heterogeneousArrayLiterals.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = [1, '']; +var b = [1, null]; +var c = [1, '', null]; +var d = [{}, 1]; +var e = [{}, Object]; +var f = [[], [1]]; +var g = [[1], ['']]; +var h = [{ foo: 1, bar: '' }, { foo: 2 }]; +var i = [{ foo: 1, bar: '' }, { foo: '' }]; +var j = [function () { return 1; }, function () { return ''; }]; +var k = [function () { return 1; }, function () { return 1; }]; +var l = [function () { return 1; }, function () { return null; }]; +var m = [function () { return 1; }, function () { return ''; }, function () { return null; }]; +var n = [[function () { return 1; }], [function () { return ''; }]]; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base); +var base; +var derived; +var derived2; +var Derived; +(function (Derived) { + var h = [{ foo: base, basear: derived }, { foo: base }]; + var i = [{ foo: base, basear: derived }, { foo: derived }]; + var j = [function () { return base; }, function () { return derived; }]; + var k = [function () { return base; }, function () { return 1; }]; + var l = [function () { return base; }, function () { return null; }]; + var m = [function () { return base; }, function () { return derived; }, function () { return null; }]; + var n = [[function () { return base; }], [function () { return derived; }]]; + var o = [derived, derived2]; + var p = [derived, derived2, base]; + var q = [[function () { return derived2; }], [function () { return derived; }]]; +})(Derived || (Derived = {})); +var WithContextualType; +(function (WithContextualType) { + var a = [derived, derived2]; + var b = [null]; + var c = []; + var d = [function () { return derived; }, function () { return derived2; }]; +})(WithContextualType || (WithContextualType = {})); +function foo(t, u) { + var a = [t, t]; + var b = [t, null]; + var c = [t, u]; + var d = [t, 1]; + var e = [function () { return t; }, function () { return u; }]; + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; +} +function foo2(t, u) { + var a = [t, t]; + var b = [t, null]; + var c = [t, u]; + var d = [t, 1]; + var e = [function () { return t; }, function () { return u; }]; + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; + var g = [t, base]; + var h = [t, derived]; + var i = [u, base]; + var j = [u, derived]; +} +function foo3(t, u) { + var a = [t, t]; + var b = [t, null]; + var c = [t, u]; + var d = [t, 1]; + var e = [function () { return t; }, function () { return u; }]; + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; + var g = [t, base]; + var h = [t, derived]; + var i = [u, base]; + var j = [u, derived]; +} +function foo4(t, u) { + var a = [t, t]; + var b = [t, null]; + var c = [t, u]; + var d = [t, 1]; + var e = [function () { return t; }, function () { return u; }]; + var f = [function () { return t; }, function () { return u; }, function () { return null; }]; + var g = [t, base]; + var h = [t, derived]; + var i = [u, base]; + var j = [u, derived]; + var k = [t, u]; +} diff --git a/tests/baselines/reference/hidingCallSignatures.js b/tests/baselines/reference/hidingCallSignatures.js new file mode 100644 index 0000000000000..b5f074da23607 --- /dev/null +++ b/tests/baselines/reference/hidingCallSignatures.js @@ -0,0 +1,35 @@ +//// [hidingCallSignatures.ts] +interface C { + new (a: string): string; +} + +interface D extends C { + (a: string): number; // Should be ok +} + +interface E { + (a: string): {}; +} + +interface F extends E { + (a: string): string; +} + +var d: D; +d(""); // number +new d(""); // should be string + +var f: F; +f(""); // string + +var e: E; +e(""); // {} + +//// [hidingCallSignatures.js] +var d; +d(""); +new d(""); +var f; +f(""); +var e; +e(""); diff --git a/tests/baselines/reference/hidingConstructSignatures.js b/tests/baselines/reference/hidingConstructSignatures.js new file mode 100644 index 0000000000000..089e2e89f2b5b --- /dev/null +++ b/tests/baselines/reference/hidingConstructSignatures.js @@ -0,0 +1,35 @@ +//// [hidingConstructSignatures.ts] +interface C { + (a: string): string; +} + +interface D extends C { + new (a: string): number; // Should be ok +} + +interface E { + new (a: string): {}; +} + +interface F extends E { + new (a: string): string; +} + +var d: D; +d(""); // string +new d(""); // should be number + +var f: F; +new f(""); // string + +var e: E; +new e(""); // {} + +//// [hidingConstructSignatures.js] +var d; +d(""); +new d(""); +var f; +new f(""); +var e; +new e(""); diff --git a/tests/baselines/reference/hidingIndexSignatures.js b/tests/baselines/reference/hidingIndexSignatures.js new file mode 100644 index 0000000000000..9c6df13b8a804 --- /dev/null +++ b/tests/baselines/reference/hidingIndexSignatures.js @@ -0,0 +1,19 @@ +//// [hidingIndexSignatures.ts] +interface A { + [a: string]: {}; +} + +interface B extends A { + [a: string]: number; // Number is not a subtype of string. Should error. +} + +var b: B; +b[""]; // Should be number +var a: A; +a[""]; // Should be {} + +//// [hidingIndexSignatures.js] +var b; +b[""]; +var a; +a[""]; diff --git a/tests/baselines/reference/i3.errors.txt b/tests/baselines/reference/i3.errors.txt new file mode 100644 index 0000000000000..ebdf371ab367f --- /dev/null +++ b/tests/baselines/reference/i3.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/i3.ts (1 errors) ==== + interface I3 { one?: number; }; + var x: {one: number}; + var i: I3; + + i = x; + x = i; + ~ +!!! Type 'I3' is not assignable to type '{ one: number; }': +!!! Required property 'one' cannot be reimplemented with optional property in 'I3'. \ No newline at end of file diff --git a/tests/baselines/reference/i3.js b/tests/baselines/reference/i3.js new file mode 100644 index 0000000000000..f840c6c6d0b64 --- /dev/null +++ b/tests/baselines/reference/i3.js @@ -0,0 +1,14 @@ +//// [i3.ts] +interface I3 { one?: number; }; +var x: {one: number}; +var i: I3; + +i = x; +x = i; + +//// [i3.js] +; +var x; +var i; +i = x; +x = i; diff --git a/tests/baselines/reference/icomparable.js b/tests/baselines/reference/icomparable.js new file mode 100644 index 0000000000000..6c3d9d227753d --- /dev/null +++ b/tests/baselines/reference/icomparable.js @@ -0,0 +1,17 @@ +//// [icomparable.ts] + interface IComparable { + compareTo(other: T); + } + + declare function sort>(items: U[]): U[]; + + interface StringComparable extends IComparable { + } + + var sc: StringComparable[]; + + var x = sort(sc); + +//// [icomparable.js] +var sc; +var x = sort(sc); diff --git a/tests/baselines/reference/idInProp.js b/tests/baselines/reference/idInProp.js new file mode 100644 index 0000000000000..a325fe9e3fafb --- /dev/null +++ b/tests/baselines/reference/idInProp.js @@ -0,0 +1,12 @@ +//// [idInProp.ts] +function f() { + +var t: { (f: any) : any; }; + +} + + +//// [idInProp.js] +function f() { + var t; +} diff --git a/tests/baselines/reference/identicalCallSignatures.js b/tests/baselines/reference/identicalCallSignatures.js new file mode 100644 index 0000000000000..6405e847e93fb --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures.js @@ -0,0 +1,24 @@ +//// [identicalCallSignatures.ts] +// Each pair of call signatures in these types have a duplicate signature error. +// Identical call signatures should generate an error. +interface I { + (x): number; + (x: any): number; + (x: T): T; + (x: U): U; // error +} + +interface I2 { + (x: T): T; + (x: T): T; // error +} + +var a: { + (x): number; + (x: any): number; + (x: T): T; + (x: T): T; // error +} + +//// [identicalCallSignatures.js] +var a; diff --git a/tests/baselines/reference/identicalCallSignatures2.js b/tests/baselines/reference/identicalCallSignatures2.js new file mode 100644 index 0000000000000..78692ac4031ef --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures2.js @@ -0,0 +1,13 @@ +//// [identicalCallSignatures2.ts] +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple bases. + +interface Base { + (x: number): string; +} + +interface I extends Base, Base { } + +interface I2 extends Base, Base { } + +//// [identicalCallSignatures2.js] diff --git a/tests/baselines/reference/identicalCallSignatures3.js b/tests/baselines/reference/identicalCallSignatures3.js new file mode 100644 index 0000000000000..346e16061a66f --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures3.js @@ -0,0 +1,21 @@ +//// [identicalCallSignatures3.ts] +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations, so we do not report errors. + +interface I { + (x: number): string; +} + +interface I { + (x: number): string; +} + +interface I2 { + (x: number): string; +} + +interface I2 { + (x: number): string; +} + +//// [identicalCallSignatures3.js] diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt new file mode 100644 index 0000000000000..034bfe3026d2a --- /dev/null +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts (4 errors) ==== + var f: (x: T, y: U) => T; + var f: (x: any, y: any) => any; + + var g: (x: T, y: U) => T; + var g: (x: any, y: any) => any; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. + + var h: (x: T, y: U) => T; + var h: (x: any, y: any) => any; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'h' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. + + var i: (x: T, y: U) => T; + var i: (x: any, y: string) => any; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. + + var j: (x: T, y: U) => T; + var j: (x: any, y: any) => string; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.js b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.js new file mode 100644 index 0000000000000..6236facc2aa96 --- /dev/null +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.js @@ -0,0 +1,27 @@ +//// [identityForSignaturesWithTypeParametersAndAny.ts] +var f: (x: T, y: U) => T; +var f: (x: any, y: any) => any; + +var g: (x: T, y: U) => T; +var g: (x: any, y: any) => any; + +var h: (x: T, y: U) => T; +var h: (x: any, y: any) => any; + +var i: (x: T, y: U) => T; +var i: (x: any, y: string) => any; + +var j: (x: T, y: U) => T; +var j: (x: any, y: any) => string; + +//// [identityForSignaturesWithTypeParametersAndAny.js] +var f; +var f; +var g; +var g; +var h; +var h; +var i; +var i; +var j; +var j; diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.js b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.js new file mode 100644 index 0000000000000..4f0788ca20930 --- /dev/null +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.js @@ -0,0 +1,7 @@ +//// [identityForSignaturesWithTypeParametersSwitched.ts] +var f: (x: T, y: U) => T; +var f: (x: U, y: T) => U; + +//// [identityForSignaturesWithTypeParametersSwitched.js] +var f; +var f; diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js new file mode 100644 index 0000000000000..3597a21498d64 --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -0,0 +1,396 @@ +//// [ifDoWhileStatements.ts] +interface I { + id: number; +} + +class C implements I { + id: number; + name: string; +} + +class C2 extends C { + valid: boolean; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } +function F2(x: number): boolean { return x < 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +module N { + export class A { + id: number; + } + + export function F2(x: number): string { return x.toString(); } +} + +// literals +if (true) { } +while (true) { } +do { }while(true) + +if (null) { } +while (null) { } +do { }while(null) + +if (undefined) { } +while (undefined) { } +do { }while(undefined) + +if (0.0) { } +while (0.0) { } +do { }while(0.0) + +if ('a string') { } +while ('a string') { } +do { }while('a string') + +if ('') { } +while ('') { } +do { }while('') + +if (/[a-z]/) { } +while (/[a-z]/) { } +do { }while(/[a-z]/) + +if ([]) { } +while ([]) { } +do { }while([]) + +if ([1, 2]) { } +while ([1, 2]) { } +do { }while([1, 2]) + +if ({}) { } +while ({}) { } +do { }while({}) + +if ({ x: 1, y: 'a' }) { } +while ({ x: 1, y: 'a' }) { } +do { }while({ x: 1, y: 'a' }) + +if (() => 43) { } +while (() => 43) { } +do { }while(() => 43) + +if (new C()) { } +while (new C()) { } +do { }while(new C()) + +if (new D()) { } +while (new D()) { } +do { }while(new D()) + +// references +var a = true; +if (a) { } +while (a) { } +do { }while(a) + +var b = null; +if (b) { } +while (b) { } +do { }while(b) + +var c = undefined; +if (c) { } +while (c) { } +do { }while(c) + +var d = 0.0; +if (d) { } +while (d) { } +do { }while(d) + +var e = 'a string'; +if (e) { } +while (e) { } +do { }while(e) + +var f = ''; +if (f) { } +while (f) { } +do { }while(f) + +var g = /[a-z]/ +if (g) { } +while (g) { } +do { }while(g) + +var h = []; +if (h) { } +while (h) { } +do { }while(h) + +var i = [1, 2]; +if (i) { } +while (i) { } +do { }while(i) + +var j = {}; +if (j) { } +while (j) { } +do { }while(j) + +var k = { x: 1, y: 'a' }; +if (k) { } +while (k) { } +do { }while(k) + +function fn(x?: string): I { return null; } +if (fn()) { } +while (fn()) { } +do { }while(fn()) + +if (fn) { } +while (fn) { } +do { }while(fn) + + + + +//// [ifDoWhileStatements.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +function F2(x) { + return x < 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +var N; +(function (N) { + var A = (function () { + function A() { + } + return A; + })(); + N.A = A; + function F2(x) { + return x.toString(); + } + N.F2 = F2; +})(N || (N = {})); +if (true) { +} +while (true) { +} +do { +} while (true); +if (null) { +} +while (null) { +} +do { +} while (null); +if (undefined) { +} +while (undefined) { +} +do { +} while (undefined); +if (0.0) { +} +while (0.0) { +} +do { +} while (0.0); +if ('a string') { +} +while ('a string') { +} +do { +} while ('a string'); +if ('') { +} +while ('') { +} +do { +} while (''); +if (/[a-z]/) { +} +while (/[a-z]/) { +} +do { +} while (/[a-z]/); +if ([]) { +} +while ([]) { +} +do { +} while ([]); +if ([1, 2]) { +} +while ([1, 2]) { +} +do { +} while ([1, 2]); +if ({}) { +} +while ({}) { +} +do { +} while ({}); +if ({ x: 1, y: 'a' }) { +} +while ({ x: 1, y: 'a' }) { +} +do { +} while ({ x: 1, y: 'a' }); +if (function () { return 43; }) { +} +while (function () { return 43; }) { +} +do { +} while (function () { return 43; }); +if (new C()) { +} +while (new C()) { +} +do { +} while (new C()); +if (new D()) { +} +while (new D()) { +} +do { +} while (new D()); +var a = true; +if (a) { +} +while (a) { +} +do { +} while (a); +var b = null; +if (b) { +} +while (b) { +} +do { +} while (b); +var c = undefined; +if (c) { +} +while (c) { +} +do { +} while (c); +var d = 0.0; +if (d) { +} +while (d) { +} +do { +} while (d); +var e = 'a string'; +if (e) { +} +while (e) { +} +do { +} while (e); +var f = ''; +if (f) { +} +while (f) { +} +do { +} while (f); +var g = /[a-z]/; +if (g) { +} +while (g) { +} +do { +} while (g); +var h = []; +if (h) { +} +while (h) { +} +do { +} while (h); +var i = [1, 2]; +if (i) { +} +while (i) { +} +do { +} while (i); +var j = {}; +if (j) { +} +while (j) { +} +do { +} while (j); +var k = { x: 1, y: 'a' }; +if (k) { +} +while (k) { +} +do { +} while (k); +function fn(x) { + return null; +} +if (fn()) { +} +while (fn()) { +} +do { +} while (fn()); +if (fn) { +} +while (fn) { +} +do { +} while (fn); diff --git a/tests/baselines/reference/ifElseWithStatements1.errors.txt b/tests/baselines/reference/ifElseWithStatements1.errors.txt new file mode 100644 index 0000000000000..ccadfd14ce7ef --- /dev/null +++ b/tests/baselines/reference/ifElseWithStatements1.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/ifElseWithStatements1.ts (2 errors) ==== + if (true) + f(); + ~ +!!! Cannot find name 'f'. + else + f(); + ~ +!!! Cannot find name 'f'. + + function foo(): boolean { + if (true) + return true; + else + return false; + } + \ No newline at end of file diff --git a/tests/baselines/reference/ifElseWithStatements1.js b/tests/baselines/reference/ifElseWithStatements1.js new file mode 100644 index 0000000000000..506e7e6a33071 --- /dev/null +++ b/tests/baselines/reference/ifElseWithStatements1.js @@ -0,0 +1,25 @@ +//// [ifElseWithStatements1.ts] +if (true) + f(); +else + f(); + +function foo(): boolean { + if (true) + return true; + else + return false; +} + + +//// [ifElseWithStatements1.js] +if (true) + f(); +else + f(); +function foo() { + if (true) + return true; + else + return false; +} diff --git a/tests/baselines/reference/illegalGenericWrapping1.js b/tests/baselines/reference/illegalGenericWrapping1.js new file mode 100644 index 0000000000000..6e6e2ddc4dc67 --- /dev/null +++ b/tests/baselines/reference/illegalGenericWrapping1.js @@ -0,0 +1,10 @@ +//// [illegalGenericWrapping1.ts] +interface Sequence { + each(iterator: (value: T) => void ): void; + map(iterator: (value: T) => U): Sequence; + filter(iterator: (value: T) => boolean): Sequence; + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: Sequence; }>; +} + + +//// [illegalGenericWrapping1.js] diff --git a/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt b/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt new file mode 100644 index 0000000000000..038d2ad7da519 --- /dev/null +++ b/tests/baselines/reference/illegalModifiersOnClassElements.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/illegalModifiersOnClassElements.ts (2 errors) ==== + class C { + declare foo = 1; + ~~~~~~~ +!!! 'declare' modifier cannot appear on a class element. + export bar = 1; + ~~~~~~ +!!! 'export' modifier cannot appear on a class element. + } \ No newline at end of file diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt new file mode 100644 index 0000000000000..41e124d7f145c --- /dev/null +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/compiler/illegalSuperCallsInConstructor.ts (8 errors) ==== + class Base { + x: string; + } + + class Derived extends Base { + constructor() { + ~~~~~~~~~~~~~~~ + var r2 = () => super(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + var r3 = () => { super(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + var r4 = function () { super(); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + var r5 = { + ~~~~~~~~~~~~~~~~~~ + get foo() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~ + super(); + ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + return 1; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~~~~~ + set foo(v: number) { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + super(); + ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Super calls are not permitted outside constructors or in nested functions inside constructors + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } \ No newline at end of file diff --git a/tests/baselines/reference/implementArrayInterface.js b/tests/baselines/reference/implementArrayInterface.js new file mode 100644 index 0000000000000..18ababcc5c60b --- /dev/null +++ b/tests/baselines/reference/implementArrayInterface.js @@ -0,0 +1,36 @@ +//// [implementArrayInterface.ts] +declare class ArrayConstructor implements Array { + toString(): string; + toLocaleString(): string; + concat(...items: U[]): T[]; + concat(...items: T[]): T[]; + join(separator?: string): string; + pop(): T; + push(...items: T[]): number; + reverse(): T[]; + shift(): T; + slice(start?: number, end?: number): T[]; + sort(compareFn?: (a: T, b: T) => number): T[]; + splice(start: number): T[]; + splice(start: number, deleteCount: number, ...items: T[]): T[]; + unshift(...items: T[]): number; + + indexOf(searchElement: T, fromIndex?: number): number; + lastIndexOf(searchElement: T, fromIndex?: number): number; + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + length: number; + + [n: number]: T; +} + + +//// [implementArrayInterface.js] diff --git a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt new file mode 100644 index 0000000000000..997f49a9478f4 --- /dev/null +++ b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/implementClausePrecedingExtends.ts (3 errors) ==== + class C { foo: number } + class D implements C extends C { } + ~~~~~~~ +!!! '{' expected. + ~ +!!! ';' expected. + ~ +!!! Class 'D' incorrectly implements interface 'C': +!!! Property 'foo' is missing in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt new file mode 100644 index 0000000000000..209749db465f2 --- /dev/null +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ==== + // no errors because in the derived types the best common type for T's value is Object + // and that matches the original signature for assignability since we treat its T's as Object + + interface IFoo { + foo(x: T): T; + } + class C implements IFoo { // error + ~ +!!! Class 'C' incorrectly implements interface 'IFoo': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: string) => number' is not assignable to type '(x: T) => T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'T'. + foo(x: string): number { + return null; + } + } + + interface IFoo2 { + foo(x: T): T; + } + class C2 implements IFoo2 { // error + ~~ +!!! Class 'C2' incorrectly implements interface 'IFoo2': +!!! Types of property 'foo' are incompatible: +!!! Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': +!!! Type 'number' is not assignable to type 'T'. + foo(x: Tstring): number { + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.js b/tests/baselines/reference/implementGenericWithMismatchedTypes.js new file mode 100644 index 0000000000000..af576424a1ef4 --- /dev/null +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.js @@ -0,0 +1,39 @@ +//// [implementGenericWithMismatchedTypes.ts] +// no errors because in the derived types the best common type for T's value is Object +// and that matches the original signature for assignability since we treat its T's as Object + +interface IFoo { + foo(x: T): T; +} +class C implements IFoo { // error + foo(x: string): number { + return null; + } +} + +interface IFoo2 { + foo(x: T): T; +} +class C2 implements IFoo2 { // error + foo(x: Tstring): number { + return null; + } +} + +//// [implementGenericWithMismatchedTypes.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function (x) { + return null; + }; + return C2; +})(); diff --git a/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js new file mode 100644 index 0000000000000..16e904c3497bc --- /dev/null +++ b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.js @@ -0,0 +1,19 @@ +//// [implementInterfaceAnyMemberWithVoid.ts] +interface I { + foo(value: number); +} + +class Bug implements I { + public foo(value: number) { + } +} + + +//// [implementInterfaceAnyMemberWithVoid.js] +var Bug = (function () { + function Bug() { + } + Bug.prototype.foo = function (value) { + }; + return Bug; +})(); diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt new file mode 100644 index 0000000000000..25ffa123d77d1 --- /dev/null +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/implementPublicPropertyAsPrivate.ts (1 errors) ==== + interface I { + x: number; + } + class C implements I { + ~ +!!! Class 'C' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + private x = 0; // should raise error at class decl + } \ No newline at end of file diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.js b/tests/baselines/reference/implementPublicPropertyAsPrivate.js new file mode 100644 index 0000000000000..0a57704553faa --- /dev/null +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.js @@ -0,0 +1,15 @@ +//// [implementPublicPropertyAsPrivate.ts] +interface I { + x: number; +} +class C implements I { + private x = 0; // should raise error at class decl +} + +//// [implementPublicPropertyAsPrivate.js] +var C = (function () { + function C() { + this.x = 0; + } + return C; +})(); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt new file mode 100644 index 0000000000000..22cbf1aacac73 --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts (4 errors) ==== + class Foo { + private x: string; + } + + interface I extends Foo { + y: number; + } + + class Bar implements I { // error + ~~~ +!!! Class 'Bar' incorrectly implements interface 'I': +!!! Property 'y' is missing in type 'Bar'. + } + + class Bar2 implements I { // error + ~~~~ +!!! Class 'Bar2' incorrectly implements interface 'I': +!!! Property 'x' is missing in type 'Bar2'. + y: number; + } + + class Bar3 implements I { // error + ~~~~ +!!! Class 'Bar3' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + x: string; + y: number; + } + + class Bar4 implements I { // error + ~~~~ +!!! Class 'Bar4' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + private x: string; + y: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js new file mode 100644 index 0000000000000..adb0271e7a58e --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.js @@ -0,0 +1,52 @@ +//// [implementingAnInterfaceExtendingClassWithPrivates.ts] +class Foo { + private x: string; +} + +interface I extends Foo { + y: number; +} + +class Bar implements I { // error +} + +class Bar2 implements I { // error + y: number; +} + +class Bar3 implements I { // error + x: string; + y: number; +} + +class Bar4 implements I { // error + private x: string; + y: number; +} + +//// [implementingAnInterfaceExtendingClassWithPrivates.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var Bar2 = (function () { + function Bar2() { + } + return Bar2; +})(); +var Bar3 = (function () { + function Bar3() { + } + return Bar3; +})(); +var Bar4 = (function () { + function Bar4() { + } + return Bar4; +})(); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt new file mode 100644 index 0000000000000..7598e2b613203 --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt @@ -0,0 +1,129 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts (15 errors) ==== + class Foo { + private x: string; + } + + interface I extends Foo { + y: number; + } + + class Bar extends Foo implements I { // ok + y: number; + } + + class Bar2 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar2' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar2' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + x: string; + y: number; + } + + class Bar3 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar3' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar3' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + private x: string; + y: number; + } + + // another level of indirection + module M { + class Foo { + private x: string; + } + + class Baz extends Foo { + z: number; + } + + interface I extends Baz { + y: number; + } + + class Bar extends Foo implements I { // ok + y: number; + z: number; + } + + class Bar2 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar2' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar2' incorrectly implements interface 'I': +!!! Property 'z' is missing in type 'Bar2'. + x: string; + y: number; + } + + class Bar3 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar3' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar3' incorrectly implements interface 'I': +!!! Property 'z' is missing in type 'Bar3'. + private x: string; + y: number; + } + } + + // two levels of privates + module M2 { + class Foo { + private x: string; + } + + class Baz extends Foo { + private y: number; + } + + interface I extends Baz { + z: number; + } + + class Bar extends Foo implements I { // error + ~~~ +!!! Class 'Bar' incorrectly implements interface 'I': +!!! Property 'y' is missing in type 'Bar'. + z: number; + } + + var b: Bar; + var r1 = b.z; + var r2 = b.x; // error + ~~~ +!!! Property 'Foo.x' is inaccessible. + var r3 = b.y; // error + ~ +!!! Property 'y' does not exist on type 'Bar'. + + class Bar2 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar2' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar2' incorrectly implements interface 'I': +!!! Property 'y' is missing in type 'Bar2'. + x: string; + z: number; + } + + class Bar3 extends Foo implements I { // error + ~~~~ +!!! Class 'Bar3' incorrectly extends base class 'Foo': +!!! Private property 'x' cannot be reimplemented. + ~~~~ +!!! Class 'Bar3' incorrectly implements interface 'I': +!!! Property 'y' is missing in type 'Bar3'. + private x: string; + z: number; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js new file mode 100644 index 0000000000000..79524b9ecb9b7 --- /dev/null +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -0,0 +1,196 @@ +//// [implementingAnInterfaceExtendingClassWithPrivates2.ts] +class Foo { + private x: string; +} + +interface I extends Foo { + y: number; +} + +class Bar extends Foo implements I { // ok + y: number; +} + +class Bar2 extends Foo implements I { // error + x: string; + y: number; +} + +class Bar3 extends Foo implements I { // error + private x: string; + y: number; +} + +// another level of indirection +module M { + class Foo { + private x: string; + } + + class Baz extends Foo { + z: number; + } + + interface I extends Baz { + y: number; + } + + class Bar extends Foo implements I { // ok + y: number; + z: number; + } + + class Bar2 extends Foo implements I { // error + x: string; + y: number; + } + + class Bar3 extends Foo implements I { // error + private x: string; + y: number; + } +} + +// two levels of privates +module M2 { + class Foo { + private x: string; + } + + class Baz extends Foo { + private y: number; + } + + interface I extends Baz { + z: number; + } + + class Bar extends Foo implements I { // error + z: number; + } + + var b: Bar; + var r1 = b.z; + var r2 = b.x; // error + var r3 = b.y; // error + + class Bar2 extends Foo implements I { // error + x: string; + z: number; + } + + class Bar3 extends Foo implements I { // error + private x: string; + z: number; + } +} + +//// [implementingAnInterfaceExtendingClassWithPrivates2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; +})(Foo); +var Bar2 = (function (_super) { + __extends(Bar2, _super); + function Bar2() { + _super.apply(this, arguments); + } + return Bar2; +})(Foo); +var Bar3 = (function (_super) { + __extends(Bar3, _super); + function Bar3() { + _super.apply(this, arguments); + } + return Bar3; +})(Foo); +var M; +(function (M) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + var Baz = (function (_super) { + __extends(Baz, _super); + function Baz() { + _super.apply(this, arguments); + } + return Baz; + })(Foo); + var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; + })(Foo); + var Bar2 = (function (_super) { + __extends(Bar2, _super); + function Bar2() { + _super.apply(this, arguments); + } + return Bar2; + })(Foo); + var Bar3 = (function (_super) { + __extends(Bar3, _super); + function Bar3() { + _super.apply(this, arguments); + } + return Bar3; + })(Foo); +})(M || (M = {})); +var M2; +(function (M2) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + var Baz = (function (_super) { + __extends(Baz, _super); + function Baz() { + _super.apply(this, arguments); + } + return Baz; + })(Foo); + var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; + })(Foo); + var b; + var r1 = b.z; + var r2 = b.x; + var r3 = b.y; + var Bar2 = (function (_super) { + __extends(Bar2, _super); + function Bar2() { + _super.apply(this, arguments); + } + return Bar2; + })(Foo); + var Bar3 = (function (_super) { + __extends(Bar3, _super); + function Bar3() { + _super.apply(this, arguments); + } + return Bar3; + })(Foo); +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt b/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt new file mode 100644 index 0000000000000..020a061fa669e --- /dev/null +++ b/tests/baselines/reference/implementsClauseAlreadySeen.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/implementsClauseAlreadySeen.ts (6 errors) ==== + class C { + + } + class D implements C implements C { + ~~~~~~~~~~ +!!! '{' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~~~~~~~~~~ +!!! Cannot find name 'implements'. + baz() { } + ~ +!!! ';' expected. + ~~~ +!!! Cannot find name 'baz'. + } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyAmbients.errors.txt b/tests/baselines/reference/implicitAnyAmbients.errors.txt new file mode 100644 index 0000000000000..99cd350286ddf --- /dev/null +++ b/tests/baselines/reference/implicitAnyAmbients.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/compiler/implicitAnyAmbients.ts (9 errors) ==== + + declare module m { + var x; // error + ~ +!!! Variable 'x' implicitly has an 'any' type. + var y: any; + + function f(x); // error + ~~~~~~~~~~~~~~ +!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! Parameter 'x' implicitly has an 'any' type. + function f2(x: any); // error + ~~~~~~~~~~~~~~~~~~~~ +!!! 'f2', which lacks return-type annotation, implicitly has an 'any' return type. + function f3(x: any): any; + + interface I { + foo(); // error + ~~~~~~ +!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + foo2(x: any); // error + ~~~~~~~~~~~~~ +!!! 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. + foo3(x: any): any; + } + + class C { + foo(); // error + ~~~~~~ +!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + foo2(x: any); // error + ~~~~~~~~~~~~~ +!!! 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. + foo3(x: any): any; + } + + module n { + var y; // error + ~ +!!! Variable 'y' implicitly has an 'any' type. + } + + import m2 = n; + } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyAmbients.js b/tests/baselines/reference/implicitAnyAmbients.js new file mode 100644 index 0000000000000..6b63bf8b819be --- /dev/null +++ b/tests/baselines/reference/implicitAnyAmbients.js @@ -0,0 +1,30 @@ +//// [implicitAnyAmbients.ts] + +declare module m { + var x; // error + var y: any; + + function f(x); // error + function f2(x: any); // error + function f3(x: any): any; + + interface I { + foo(); // error + foo2(x: any); // error + foo3(x: any): any; + } + + class C { + foo(); // error + foo2(x: any); // error + foo3(x: any): any; + } + + module n { + var y; // error + } + + import m2 = n; +} + +//// [implicitAnyAmbients.js] diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.js b/tests/baselines/reference/implicitAnyAnyReturningFunction.js new file mode 100644 index 0000000000000..d57859c9171f0 --- /dev/null +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.js @@ -0,0 +1,45 @@ +//// [implicitAnyAnyReturningFunction.ts] +function A() { + return ""; +} + +function B() { + var someLocal: any = {}; + return someLocal; +} + +class C { + public A() { + return ""; + } + + public B() { + var someLocal: any = {}; + return someLocal; + } +} + + +//// [implicitAnyAnyReturningFunction.js] +function A() { + return ""; +} +function B() { + var someLocal = {}; + return someLocal; +} +var C = (function () { + function C() { + } + C.prototype.A = function () { + return ""; + }; + C.prototype.B = function () { + var someLocal = {}; + return someLocal; + }; + return C; +})(); + + +//// [implicitAnyAnyReturningFunction.d.ts] diff --git a/tests/baselines/reference/implicitAnyCastedValue.errors.txt b/tests/baselines/reference/implicitAnyCastedValue.errors.txt new file mode 100644 index 0000000000000..c0f887b04d867 --- /dev/null +++ b/tests/baselines/reference/implicitAnyCastedValue.errors.txt @@ -0,0 +1,99 @@ +==== tests/cases/compiler/implicitAnyCastedValue.ts (9 errors) ==== + var x = function () { + return 0; // this should not be an error + } + + function foo() { + return "hello world"; // this should not be an error + } + + class C { + bar = null; // this should be an error + ~~~~~~~~~~~ +!!! Member 'bar' implicitly has an 'any' type. + foo = undefined; // this should be an error + ~~~~~~~~~~~~~~~~ +!!! Member 'foo' implicitly has an 'any' type. + public get tempVar() { + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 0; // this should not be an error + } + + public returnBarWithCase() { // this should not be an error + return this.bar; + } + + public returnFooWithCase() { + return this.foo; // this should not be an error + } + } + + class C1 { + getValue = null; // this should be an error + ~~~~~~~~~~~~~~~~ +!!! Member 'getValue' implicitly has an 'any' type. + + public get castedGet() { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.getValue; // this should not be an error + } + + public get notCastedGet() { + ~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.getValue; // this should not be an error + } + } + + function castedNull() { + return null; // this should not be an error + } + + function notCastedNull() { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + return null; // this should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! 'notCastedNull', which lacks return-type annotation, implicitly has an 'any' return type. + + function returnTypeBar(): any { + return null; // this should not be an error + } + + function undefinedBar() { + return undefined; // this should not be an error + } + + function multipleRets1(x) { // this should not be an error + ~ +!!! Parameter 'x' implicitly has an 'any' type. + if (x) { + return 0; + } + else { + return null; + } + } + + function multipleRets2(x) { // this should not be an error + ~ +!!! Parameter 'x' implicitly has an 'any' type. + if (x) { + return null; + } + else if (x == 1) { + return 0; + } + else { + return undefined; + } + } + + // this should not be an error + var bar1 = null; + var bar2 = undefined; + var bar3 = 0; + var array = [null, undefined]; \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt new file mode 100644 index 0000000000000..db1e773c17c6b --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/implicitAnyDeclareFunctionExprWithoutFormalType.ts (8 errors) ==== + // these should be errors for implicit any parameter + var lambda = (l1) => { }; // Error at "l1" + ~~ +!!! Parameter 'l1' implicitly has an 'any' type. + var lambd2 = (ll1, ll2: string) => { } // Error at "ll1" + ~~~ +!!! Parameter 'll1' implicitly has an 'any' type. + var lamda3 = function myLambda3(myParam) { } + ~~~~~~~ +!!! Parameter 'myParam' implicitly has an 'any' type. + var lamda4 = () => { return null }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. + + // these should be error for implicit any return type + var lambda5 = function temp() { return null; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'temp', which lacks return-type annotation, implicitly has an 'any' return type. + var lambda6 = () => { return null; } + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. + var lambda7 = function temp() { return undefined; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'temp', which lacks return-type annotation, implicitly has an 'any' return type. + var lambda8 = () => { return undefined; } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. + + // this shouldn't be an error + var lambda9 = () => { return 5; } + var lambda10 = function temp1() { return 5; } + + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js new file mode 100644 index 0000000000000..23184bcd69c0b --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js @@ -0,0 +1,47 @@ +//// [implicitAnyDeclareFunctionExprWithoutFormalType.ts] +// these should be errors for implicit any parameter +var lambda = (l1) => { }; // Error at "l1" +var lambd2 = (ll1, ll2: string) => { } // Error at "ll1" +var lamda3 = function myLambda3(myParam) { } +var lamda4 = () => { return null }; + +// these should be error for implicit any return type +var lambda5 = function temp() { return null; } +var lambda6 = () => { return null; } +var lambda7 = function temp() { return undefined; } +var lambda8 = () => { return undefined; } + +// this shouldn't be an error +var lambda9 = () => { return 5; } +var lambda10 = function temp1() { return 5; } + + + +//// [implicitAnyDeclareFunctionExprWithoutFormalType.js] +var lambda = function (l1) { +}; +var lambd2 = function (ll1, ll2) { +}; +var lamda3 = function myLambda3(myParam) { +}; +var lamda4 = function () { + return null; +}; +var lambda5 = function temp() { + return null; +}; +var lambda6 = function () { + return null; +}; +var lambda7 = function temp() { + return undefined; +}; +var lambda8 = function () { + return undefined; +}; +var lambda9 = function () { + return 5; +}; +var lambda10 = function temp1() { + return 5; +}; diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt new file mode 100644 index 0000000000000..dffd6dac81c39 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType.ts (8 errors) ==== + // these should be errors + function foo(x) { }; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + function bar(x: number, y) { }; // error at "y"; no error at "x" + ~ +!!! Parameter 'y' implicitly has an 'any' type. + function func2(a, b, c) { }; // error at "a,b,c" + ~ +!!! Parameter 'a' implicitly has an 'any' type. + ~ +!!! Parameter 'b' implicitly has an 'any' type. + ~ +!!! Parameter 'c' implicitly has an 'any' type. + function func3(...args) { }; // error at "args" + ~~~~~~~ +!!! Rest parameter 'args' implicitly has an 'any[]' type. + function func4(z= null, w= undefined) { }; // error at "z,w" + ~~~~~~~ +!!! Parameter 'z' implicitly has an 'any' type. + ~~~~~~~~~~~~ +!!! Parameter 'w' implicitly has an 'any' type. + + // these shouldn't be errors + function noError1(x= 3, y= 2) { }; + function noError2(x: number, y: string) { }; + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js new file mode 100644 index 0000000000000..629a2c4e33b37 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType.js @@ -0,0 +1,43 @@ +//// [implicitAnyDeclareFunctionWithoutFormalType.ts] +// these should be errors +function foo(x) { }; +function bar(x: number, y) { }; // error at "y"; no error at "x" +function func2(a, b, c) { }; // error at "a,b,c" +function func3(...args) { }; // error at "args" +function func4(z= null, w= undefined) { }; // error at "z,w" + +// these shouldn't be errors +function noError1(x= 3, y= 2) { }; +function noError2(x: number, y: string) { }; + + +//// [implicitAnyDeclareFunctionWithoutFormalType.js] +function foo(x) { +} +; +function bar(x, y) { +} +; +function func2(a, b, c) { +} +; +function func3() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } +} +; +function func4(z, w) { + if (z === void 0) { z = null; } + if (w === void 0) { w = undefined; } +} +; +function noError1(x, y) { + if (x === void 0) { x = 3; } + if (y === void 0) { y = 2; } +} +; +function noError2(x, y) { +} +; diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.js b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.js new file mode 100644 index 0000000000000..ded9d79f16b69 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.js @@ -0,0 +1,34 @@ +//// [implicitAnyDeclareFunctionWithoutFormalType2.ts] +// generates function fn1(): number; +function fn1() { + var x: number; + return x; +} +// generates function fn2(): any; +function fn2(): any { + var x: any; + return x; +} +// generates function fn3(); +function fn3() { + var x: any; + return x; +} + + +//// [implicitAnyDeclareFunctionWithoutFormalType2.js] +function fn1() { + var x; + return x; +} +function fn2() { + var x; + return x; +} +function fn3() { + var x; + return x; +} + + +//// [implicitAnyDeclareFunctionWithoutFormalType2.d.ts] diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt new file mode 100644 index 0000000000000..a6ed50b77f488 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/implicitAnyDeclareMemberWithoutType.ts (8 errors) ==== + // this should be an error + interface IFace { + member1; // error at "member1" + ~~~~~~~~ +!!! Member 'member1' implicitly has an 'any' type. + member2: string; + constructor(c1, c2: string, c3); // error at "c1, c3, "constructor" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'constructor', which lacks return-type annotation, implicitly has an 'any' return type. + ~~ +!!! Parameter 'c1' implicitly has an 'any' type. + ~~ +!!! Parameter 'c3' implicitly has an 'any' type. + funcOfIFace(f1, f2, f3: number); // error at "f1, f2, funcOfIFace" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. + ~~ +!!! Parameter 'f1' implicitly has an 'any' type. + ~~ +!!! Parameter 'f2' implicitly has an 'any' type. + new (); + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + } + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.js b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.js new file mode 100644 index 0000000000000..e97b2be043d9e --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType.js @@ -0,0 +1,12 @@ +//// [implicitAnyDeclareMemberWithoutType.ts] +// this should be an error +interface IFace { + member1; // error at "member1" + member2: string; + constructor(c1, c2: string, c3); // error at "c1, c3, "constructor" + funcOfIFace(f1, f2, f3: number); // error at "f1, f2, funcOfIFace" + new (); +} + + +//// [implicitAnyDeclareMemberWithoutType.js] diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt new file mode 100644 index 0000000000000..c98f3d3c31107 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/implicitAnyDeclareMemberWithoutType2.ts (5 errors) ==== + // this should be an error + class C { + public x = null;// error at "x" + ~~~~~~~~~~~~~~~~ +!!! Member 'x' implicitly has an 'any' type. + public x1: string // no error + + constructor(c1, c2, c3: string) { } // error at "c1, c2" + ~~ +!!! Parameter 'c1' implicitly has an 'any' type. + ~~ +!!! Parameter 'c2' implicitly has an 'any' type. + funcOfC(f1, f2, f3: number) { } // error at "f1,f2" + ~~ +!!! Parameter 'f1' implicitly has an 'any' type. + ~~ +!!! Parameter 'f2' implicitly has an 'any' type. + } + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js new file mode 100644 index 0000000000000..442a690208137 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js @@ -0,0 +1,20 @@ +//// [implicitAnyDeclareMemberWithoutType2.ts] +// this should be an error +class C { + public x = null;// error at "x" + public x1: string // no error + + constructor(c1, c2, c3: string) { } // error at "c1, c2" + funcOfC(f1, f2, f3: number) { } // error at "f1,f2" +} + + +//// [implicitAnyDeclareMemberWithoutType2.js] +var C = (function () { + function C(c1, c2, c3) { + this.x = null; + } + C.prototype.funcOfC = function (f1, f2, f3) { + }; + return C; +})(); diff --git a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt new file mode 100644 index 0000000000000..9d1fa68e502c0 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/implicitAnyDeclareTypePropertyWithoutType.ts (6 errors) ==== + class C { + constructor() { } + } + + // this should be an error + var x: { y; z; } // error at "y,z" + ~~ +!!! Member 'y' implicitly has an 'any' type. + ~~ +!!! Member 'z' implicitly has an 'any' type. + var x1: { y1: C; z1; }; // error at "z1" + ~~~ +!!! Member 'z1' implicitly has an 'any' type. + var x11: { new (); }; // error at "new" + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + var x2: (y2) => number; // error at "y2" + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + var x3: (x3: string, y3) => void ; // error at "y3" + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // this should not be an error + var bar: { a: number; b: number }; + var foo: { littleC: C; c: string }; + var x4: new () => any; + var x5: () => any; + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js new file mode 100644 index 0000000000000..274c263d4f20b --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js @@ -0,0 +1,34 @@ +//// [implicitAnyDeclareTypePropertyWithoutType.ts] +class C { + constructor() { } +} + +// this should be an error +var x: { y; z; } // error at "y,z" +var x1: { y1: C; z1; }; // error at "z1" +var x11: { new (); }; // error at "new" +var x2: (y2) => number; // error at "y2" +var x3: (x3: string, y3) => void ; // error at "y3" + +// this should not be an error +var bar: { a: number; b: number }; +var foo: { littleC: C; c: string }; +var x4: new () => any; +var x5: () => any; + + +//// [implicitAnyDeclareTypePropertyWithoutType.js] +var C = (function () { + function C() { + } + return C; +})(); +var x; +var x1; +var x11; +var x2; +var x3; +var bar; +var foo; +var x4; +var x5; diff --git a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt new file mode 100644 index 0000000000000..57e74c34a34ff --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/implicitAnyDeclareVariablesWithoutTypeAndInit.ts (3 errors) ==== + // this should be an error + var x; // error at "x" + ~ +!!! Variable 'x' implicitly has an 'any' type. + declare var foo; // error at "foo" + ~~~ +!!! Variable 'foo' implicitly has an 'any' type. + function func(k) { }; //error at "k" + ~ +!!! Parameter 'k' implicitly has an 'any' type. + func(x); + + // this shouldn't be an error + var bar = 3; + var bar1: any; + declare var bar2: any; + var x1: any; var y1 = new x1; \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js new file mode 100644 index 0000000000000..514d9c1dd769c --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js @@ -0,0 +1,23 @@ +//// [implicitAnyDeclareVariablesWithoutTypeAndInit.ts] +// this should be an error +var x; // error at "x" +declare var foo; // error at "foo" +function func(k) { }; //error at "k" +func(x); + +// this shouldn't be an error +var bar = 3; +var bar1: any; +declare var bar2: any; +var x1: any; var y1 = new x1; + +//// [implicitAnyDeclareVariablesWithoutTypeAndInit.js] +var x; +function func(k) { +} +; +func(x); +var bar = 3; +var bar1; +var x1; +var y1 = new x1; diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt new file mode 100644 index 0000000000000..4fa75726c8f0c --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/compiler/implicitAnyFunctionInvocationWithAnyArguements.ts (7 errors) ==== + // this should be errors + var arg0 = null; // error at "arg0" + ~~~~~~~~~~~ +!!! Variable 'arg0' implicitly has an 'any' type. + var anyArray = [null, undefined]; // error at array literal + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Variable 'anyArray' implicitly has an 'any[]' type. + var objL: { v; w; } // error at "y,z" + ~~ +!!! Member 'v' implicitly has an 'any' type. + ~~ +!!! Member 'w' implicitly has an 'any' type. + var funcL: (y2) => number; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + function temp1(arg1) { } // error at "temp1" + ~~~~ +!!! Parameter 'arg1' implicitly has an 'any' type. + function testFunctionExprC(subReplace: (s: string, ...arg: any[]) => string) { } + function testFunctionExprC2(eq: (v1: any, v2: any) => number) { }; + function testObjLiteral(objLit: { v: any; w: any }) { }; + function testFuncLiteral(funcLit: (y2) => number) { }; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + + // this should not be an error + testFunctionExprC2((v1, v2) => 1); + testObjLiteral(objL); + testFuncLiteral(funcL); + + var k = temp1(null); + var result = temp1(arg0); + var result1 = temp1(anyArray); + + function noError(variable: any, array?: any) { } + noError(null, []); + noError(undefined, []); + noError(null, [null, undefined]); + noError(undefined, anyArray); + + class C { + constructor(emtpyArray: any, variable: any) { + } + } + + var newC = new C([], undefined); + var newC1 = new C([], arg0); + var newC2 = new C([], null) + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js new file mode 100644 index 0000000000000..f5dbea07b9375 --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js @@ -0,0 +1,75 @@ +//// [implicitAnyFunctionInvocationWithAnyArguements.ts] +// this should be errors +var arg0 = null; // error at "arg0" +var anyArray = [null, undefined]; // error at array literal +var objL: { v; w; } // error at "y,z" +var funcL: (y2) => number; +function temp1(arg1) { } // error at "temp1" +function testFunctionExprC(subReplace: (s: string, ...arg: any[]) => string) { } +function testFunctionExprC2(eq: (v1: any, v2: any) => number) { }; +function testObjLiteral(objLit: { v: any; w: any }) { }; +function testFuncLiteral(funcLit: (y2) => number) { }; + +// this should not be an error +testFunctionExprC2((v1, v2) => 1); +testObjLiteral(objL); +testFuncLiteral(funcL); + +var k = temp1(null); +var result = temp1(arg0); +var result1 = temp1(anyArray); + +function noError(variable: any, array?: any) { } +noError(null, []); +noError(undefined, []); +noError(null, [null, undefined]); +noError(undefined, anyArray); + +class C { + constructor(emtpyArray: any, variable: any) { + } +} + +var newC = new C([], undefined); +var newC1 = new C([], arg0); +var newC2 = new C([], null) + + +//// [implicitAnyFunctionInvocationWithAnyArguements.js] +var arg0 = null; +var anyArray = [null, undefined]; +var objL; +var funcL; +function temp1(arg1) { +} +function testFunctionExprC(subReplace) { +} +function testFunctionExprC2(eq) { +} +; +function testObjLiteral(objLit) { +} +; +function testFuncLiteral(funcLit) { +} +; +testFunctionExprC2(function (v1, v2) { return 1; }); +testObjLiteral(objL); +testFuncLiteral(funcL); +var k = temp1(null); +var result = temp1(arg0); +var result1 = temp1(anyArray); +function noError(variable, array) { +} +noError(null, []); +noError(undefined, []); +noError(null, [null, undefined]); +noError(undefined, anyArray); +var C = (function () { + function C(emtpyArray, variable) { + } + return C; +})(); +var newC = new C([], undefined); +var newC1 = new C([], arg0); +var newC2 = new C([], null); diff --git a/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt new file mode 100644 index 0000000000000..6ef65b09ed991 --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/implicitAnyFunctionOverloadWithImplicitAnyReturnType.ts (1 errors) ==== + // this should be an error + interface IFace { + funcOfIFace(); // error at "f" + ~~~~~~~~~~~~~~ +!!! 'funcOfIFace', which lacks return-type annotation, implicitly has an 'any' return type. + } + + // this should not be an error + interface IFace1{ + f1(): any; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.js b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.js new file mode 100644 index 0000000000000..33f21f81d8b6d --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionOverloadWithImplicitAnyReturnType.js @@ -0,0 +1,14 @@ +//// [implicitAnyFunctionOverloadWithImplicitAnyReturnType.ts] +// this should be an error +interface IFace { + funcOfIFace(); // error at "f" +} + +// this should not be an error +interface IFace1{ + f1(): any; +} + + + +//// [implicitAnyFunctionOverloadWithImplicitAnyReturnType.js] diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt new file mode 100644 index 0000000000000..5c8ab6e19a3c2 --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/implicitAnyFunctionReturnNullOrUndefined.ts (4 errors) ==== + // this should be an error + function nullWidenFunction() { return null;} // error at "nullWidenFunction" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'nullWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. + function undefinedWidenFunction() { return undefined; } // error at "undefinedWidenFunction" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'undefinedWidenFunction', which lacks return-type annotation, implicitly has an 'any' return type. + + class C { + nullWidenFuncOfC() { // error at "nullWidenFuncOfC" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'nullWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. + + underfinedWidenFuncOfC() { // error at "underfinedWidenFuncOfC" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return undefined; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'underfinedWidenFuncOfC', which lacks return-type annotation, implicitly has an 'any' return type. + } + + // this should not be an error + function foo1(): any { return null; } + function bar1(): any { return undefined; } + function fooBar(): number { return 1; } + function fooFoo() { return 5; } + + // this should not be an error as the error is raised by expr above + nullWidenFunction(); + undefinedWidenFunction(); + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js new file mode 100644 index 0000000000000..9c5e94515a818 --- /dev/null +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js @@ -0,0 +1,58 @@ +//// [implicitAnyFunctionReturnNullOrUndefined.ts] +// this should be an error +function nullWidenFunction() { return null;} // error at "nullWidenFunction" +function undefinedWidenFunction() { return undefined; } // error at "undefinedWidenFunction" + +class C { + nullWidenFuncOfC() { // error at "nullWidenFuncOfC" + return null; + } + + underfinedWidenFuncOfC() { // error at "underfinedWidenFuncOfC" + return undefined; + } +} + +// this should not be an error +function foo1(): any { return null; } +function bar1(): any { return undefined; } +function fooBar(): number { return 1; } +function fooFoo() { return 5; } + +// this should not be an error as the error is raised by expr above +nullWidenFunction(); +undefinedWidenFunction(); + + +//// [implicitAnyFunctionReturnNullOrUndefined.js] +function nullWidenFunction() { + return null; +} +function undefinedWidenFunction() { + return undefined; +} +var C = (function () { + function C() { + } + C.prototype.nullWidenFuncOfC = function () { + return null; + }; + C.prototype.underfinedWidenFuncOfC = function () { + return undefined; + }; + return C; +})(); +function foo1() { + return null; +} +function bar1() { + return undefined; +} +function fooBar() { + return 1; +} +function fooFoo() { + return 5; +} +nullWidenFunction(); +undefinedWidenFunction(); diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt b/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt new file mode 100644 index 0000000000000..3f95e27ab0ae4 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/implicitAnyGenericTypeInference.ts (2 errors) ==== + + interface Comparer { + compareTo(x: T, y: U): U; + } + + var c: Comparer; + c = { compareTo: (x, y) => { return y; } }; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + var r = c.compareTo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyGenericTypeInference.js b/tests/baselines/reference/implicitAnyGenericTypeInference.js new file mode 100644 index 0000000000000..2679ae8285c56 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenericTypeInference.js @@ -0,0 +1,16 @@ +//// [implicitAnyGenericTypeInference.ts] + +interface Comparer { + compareTo(x: T, y: U): U; +} + +var c: Comparer; +c = { compareTo: (x, y) => { return y; } }; +var r = c.compareTo(1, ''); + +//// [implicitAnyGenericTypeInference.js] +var c; +c = { compareTo: function (x, y) { + return y; +} }; +var r = c.compareTo(1, ''); diff --git a/tests/baselines/reference/implicitAnyGenerics.js b/tests/baselines/reference/implicitAnyGenerics.js new file mode 100644 index 0000000000000..a5c98590a8f8f --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenerics.js @@ -0,0 +1,54 @@ +//// [implicitAnyGenerics.ts] + +class C { + x: T; +} + +var c = new C(); +var c2 = new C(); +var c3 = new C(); +var c4: C = new C(); + +class D { + constructor(x: T) { } +} + +var d = new D(null); +var d2 = new D(1); +var d3 = new D(1); +var d4 = new D(1); +var d5: D = new D(null); + +function foo(): T { return null; }; +foo() +foo(); + + + + +//// [implicitAnyGenerics.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = new C(); +var c2 = new C(); +var c3 = new C(); +var c4 = new C(); +var D = (function () { + function D(x) { + } + return D; +})(); +var d = new D(null); +var d2 = new D(1); +var d3 = new D(1); +var d4 = new D(1); +var d5 = new D(null); +function foo() { + return null; +} +; +foo(); +foo(); diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt new file mode 100644 index 0000000000000..d6439688597b8 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (9 errors) ==== + // these should be errors + class GetAndSet { + getAndSet = null; // error at "getAndSet" + ~~~~~~~~~~~~~~~~~ +!!! Member 'getAndSet' implicitly has an 'any' type. + public get haveGetAndSet() { // this should not be an error + ~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.getAndSet; + } + + // this shouldn't be an error + public set haveGetAndSet(value) { // error at "value" + ~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~ +!!! Parameter 'value' implicitly has an 'any' type. + this.getAndSet = value; + } + } + + class SetterOnly { + public set haveOnlySet(newXValue) { // error at "haveOnlySet, newXValue" + ~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! Parameter 'newXValue' implicitly has an 'any' type. + } + ~~~~~ +!!! Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. + } + + class GetterOnly { + public get haveOnlyGet() { // error at "haveOnlyGet" + ~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. + } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt new file mode 100644 index 0000000000000..16ee2425d41c9 --- /dev/null +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/implicitAnyInAmbientDeclaration.ts (4 errors) ==== + module Test { + declare class C { + public publicMember; // this should be an error + ~~~~~~~~~~~~~~~~~~~~ +!!! Member 'publicMember' implicitly has an 'any' type. + private privateMember; // this should not be an error + + public publicFunction(x); // this should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! Parameter 'x' implicitly has an 'any' type. + private privateFunction(privateParam); // this should not be an error + private constructor(privateParam); + ~~~~~~~ +!!! 'private' modifier cannot appear on a constructor declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt new file mode 100644 index 0000000000000..c65b2e49340ec --- /dev/null +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration2.d.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/implicitAnyInAmbientDeclaration2.d.ts (8 errors) ==== + declare function foo(x); // this should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! Parameter 'x' implicitly has an 'any' type. + declare var bar; // this should be be an erro + ~~~ +!!! Variable 'bar' implicitly has an 'any' type. + declare class C { + public publicMember; // this should be an error + ~~~~~~~~~~~~~~~~~~~~ +!!! Member 'publicMember' implicitly has an 'any' type. + private privateMember; // this should not be an error + + public publicFunction(x); // this should be an error + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! Parameter 'x' implicitly has an 'any' type. + private privateFunction(privateParam); // this should not be an error + private constructor(privateParam); // this should not be an error + ~~~~~~~ +!!! 'private' modifier cannot appear on a constructor declaration. + } + + declare class D { + public constructor(publicConsParam, int: number); // this should be an error + ~~~~~~~~~~~~~~~ +!!! Parameter 'publicConsParam' implicitly has an 'any' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyInCatch.js b/tests/baselines/reference/implicitAnyInCatch.js new file mode 100644 index 0000000000000..9952c7ca327a3 --- /dev/null +++ b/tests/baselines/reference/implicitAnyInCatch.js @@ -0,0 +1,34 @@ +//// [implicitAnyInCatch.ts] +// this should not be an error +try { } catch (error) { + if (error.number === -2147024809) { } +} +for (var key in this) { } + +class C { + public temp() { + for (var x in this) { + } + } +} + + + +//// [implicitAnyInCatch.js] +try { +} +catch (error) { + if (error.number === -2147024809) { + } +} +for (var key in this) { +} +var C = (function () { + function C() { + } + C.prototype.temp = function () { + for (var x in this) { + } + }; + return C; +})(); diff --git a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt new file mode 100644 index 0000000000000..d78cf0d5b4bbc --- /dev/null +++ b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/implicitAnyNewExprLackConstructorSignature.ts (1 errors) ==== + function Point() { this.x = 3; } + var x: any = new Point(); // error at "new" + ~~~~~~~~~~~ +!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js new file mode 100644 index 0000000000000..c48d967dc9b9a --- /dev/null +++ b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js @@ -0,0 +1,9 @@ +//// [implicitAnyNewExprLackConstructorSignature.ts] +function Point() { this.x = 3; } +var x: any = new Point(); // error at "new" + +//// [implicitAnyNewExprLackConstructorSignature.js] +function Point() { + this.x = 3; +} +var x = new Point(); diff --git a/tests/baselines/reference/implicitAnyWidenToAny.errors.txt b/tests/baselines/reference/implicitAnyWidenToAny.errors.txt new file mode 100644 index 0000000000000..841dfecc1e366 --- /dev/null +++ b/tests/baselines/reference/implicitAnyWidenToAny.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/implicitAnyWidenToAny.ts (4 errors) ==== + // these should be errors + var x = null; // error at "x" + ~~~~~~~~ +!!! Variable 'x' implicitly has an 'any' type. + var x1 = undefined; // error at "x1" + ~~~~~~~~~~~~~~ +!!! Variable 'x1' implicitly has an 'any' type. + var widenArray = [null, undefined]; // error at "widenArray" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Variable 'widenArray' implicitly has an 'any[]' type. + var emptyArray = []; // error at "emptyArray" + ~~~~~~~~~~~~~~~ +!!! Variable 'emptyArray' implicitly has an 'any[]' type. + + // these should not be error + class AnimalObj { + x:any; + } + var foo = 5; + var bar = "Hello World"; + var foo1: any = null; + var foo2: any = undefined; + var temp: number = 5; + var c: AnimalObj = { x: null }; + var array1 = ["Bob",2]; + var array2: any[] = []; + var array3: any[] = [null, undefined]; + var array4: number[] = [null, undefined]; + var array5 = [null, undefined]; + + var objLit: { new (n: number): any; }; + function anyReturnFunc(): any { } + var obj0 = new objLit(1); + var obj1 = anyReturnFunc(); + \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyWidenToAny.js b/tests/baselines/reference/implicitAnyWidenToAny.js new file mode 100644 index 0000000000000..cad9ade340e9c --- /dev/null +++ b/tests/baselines/reference/implicitAnyWidenToAny.js @@ -0,0 +1,55 @@ +//// [implicitAnyWidenToAny.ts] +// these should be errors +var x = null; // error at "x" +var x1 = undefined; // error at "x1" +var widenArray = [null, undefined]; // error at "widenArray" +var emptyArray = []; // error at "emptyArray" + +// these should not be error +class AnimalObj { + x:any; +} +var foo = 5; +var bar = "Hello World"; +var foo1: any = null; +var foo2: any = undefined; +var temp: number = 5; +var c: AnimalObj = { x: null }; +var array1 = ["Bob",2]; +var array2: any[] = []; +var array3: any[] = [null, undefined]; +var array4: number[] = [null, undefined]; +var array5 = [null, undefined]; + +var objLit: { new (n: number): any; }; +function anyReturnFunc(): any { } +var obj0 = new objLit(1); +var obj1 = anyReturnFunc(); + + +//// [implicitAnyWidenToAny.js] +var x = null; +var x1 = undefined; +var widenArray = [null, undefined]; +var emptyArray = []; +var AnimalObj = (function () { + function AnimalObj() { + } + return AnimalObj; +})(); +var foo = 5; +var bar = "Hello World"; +var foo1 = null; +var foo2 = undefined; +var temp = 5; +var c = { x: null }; +var array1 = ["Bob", 2]; +var array2 = []; +var array3 = [null, undefined]; +var array4 = [null, undefined]; +var array5 = [null, undefined]; +var objLit; +function anyReturnFunc() { +} +var obj0 = new objLit(1); +var obj1 = anyReturnFunc(); diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt new file mode 100644 index 0000000000000..a9763847f59fd --- /dev/null +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts (0 errors) ==== + import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); + module m_private { + //import r2 = require('m'); // would be error + export import C = r; // no error + C.m.foo(); + } + +==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts (1 errors) ==== + export module m { + ~~~~~~~~~~~~~~~~~ + export function foo() { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js new file mode 100644 index 0000000000000..2544a90ffbfc4 --- /dev/null +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts] //// + +//// [importAliasAnExternalModuleInsideAnInternalModule_file0.ts] +export module m { + export function foo() { } +} + +//// [importAliasAnExternalModuleInsideAnInternalModule_file1.ts] +import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +module m_private { + //import r2 = require('m'); // would be error + export import C = r; // no error + C.m.foo(); +} + + +//// [importAliasAnExternalModuleInsideAnInternalModule_file0.js] +(function (m) { + function foo() { + } + m.foo = foo; +})(exports.m || (exports.m = {})); +var m = exports.m; +//// [importAliasAnExternalModuleInsideAnInternalModule_file1.js] +var r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +var m_private; +(function (m_private) { + m_private.C = r; + m_private.C.m.foo(); +})(m_private || (m_private = {})); diff --git a/tests/baselines/reference/importAliasIdentifiers.js b/tests/baselines/reference/importAliasIdentifiers.js new file mode 100644 index 0000000000000..7bd15b28c66f5 --- /dev/null +++ b/tests/baselines/reference/importAliasIdentifiers.js @@ -0,0 +1,88 @@ +//// [importAliasIdentifiers.ts] +module moduleA { + export class Point { + constructor(public x: number, public y: number) { } + } +} + +import alias = moduleA; + +var p: alias.Point; +var p: moduleA.Point; +var p: { x: number; y: number; }; + +class clodule { + name: string; +} + +module clodule { + export interface Point { + x: number; y: number; + } + var Point: Point = { x: 0, y: 0 }; +} + +import clolias = clodule; + +var p: clolias.Point; +var p: clodule.Point; +var p: { x: number; y: number; }; + + +function fundule() { + return { x: 0, y: 0 }; +} + +module fundule { + export interface Point { + x: number; y: number; + } + var Point: Point = { x: 0, y: 0 }; +} + +import funlias = fundule; + +var p: funlias.Point; +var p: fundule.Point; +var p: { x: number; y: number; }; + +//// [importAliasIdentifiers.js] +var moduleA; +(function (moduleA) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + moduleA.Point = Point; +})(moduleA || (moduleA = {})); +var alias = moduleA; +var p; +var p; +var p; +var clodule = (function () { + function clodule() { + } + return clodule; +})(); +var clodule; +(function (clodule) { + var Point = { x: 0, y: 0 }; +})(clodule || (clodule = {})); +var clolias = clodule; +var p; +var p; +var p; +function fundule() { + return { x: 0, y: 0 }; +} +var fundule; +(function (fundule) { + var Point = { x: 0, y: 0 }; +})(fundule || (fundule = {})); +var funlias = fundule; +var p; +var p; +var p; diff --git a/tests/baselines/reference/importAliasWithDottedName.js b/tests/baselines/reference/importAliasWithDottedName.js new file mode 100644 index 0000000000000..0d6769e735467 --- /dev/null +++ b/tests/baselines/reference/importAliasWithDottedName.js @@ -0,0 +1,29 @@ +//// [importAliasWithDottedName.ts] +module M { + export var x = 1; + export module N { + export var y = 2; + } +} + +module A { + import N = M.N; + var r = N.y; + var r2 = M.N.y; +} + +//// [importAliasWithDottedName.js] +var M; +(function (M) { + M.x = 1; + (function (N) { + N.y = 2; + })(M.N || (M.N = {})); + var N = M.N; +})(M || (M = {})); +var A; +(function (A) { + var N = M.N; + var r = N.y; + var r2 = M.N.y; +})(A || (A = {})); diff --git a/tests/baselines/reference/importAnImport.errors.txt b/tests/baselines/reference/importAnImport.errors.txt new file mode 100644 index 0000000000000..147b856685e14 --- /dev/null +++ b/tests/baselines/reference/importAnImport.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/importAnImport.ts (1 errors) ==== + module c.a.b { + import ma = a; + } + + module m0 { + import m8 = c.a.b.ma; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'c.a.b' has no exported member 'ma'. + } \ No newline at end of file diff --git a/tests/baselines/reference/importAnImport.js b/tests/baselines/reference/importAnImport.js new file mode 100644 index 0000000000000..d450254640327 --- /dev/null +++ b/tests/baselines/reference/importAnImport.js @@ -0,0 +1,10 @@ +//// [importAnImport.ts] +module c.a.b { + import ma = a; +} + +module m0 { + import m8 = c.a.b.ma; +} + +//// [importAnImport.js] diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt new file mode 100644 index 0000000000000..faf8a4bfe7374 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/importAndVariableDeclarationConflict1.ts (1 errors) ==== + module m { + export var m = ''; + } + + import x = m.m; + ~~~~~~~~~~~~~~~ +!!! Import declaration conflicts with local declaration of 'x' + var x = ''; + \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict1.js b/tests/baselines/reference/importAndVariableDeclarationConflict1.js new file mode 100644 index 0000000000000..d906812ce1cc0 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict1.js @@ -0,0 +1,16 @@ +//// [importAndVariableDeclarationConflict1.ts] +module m { + export var m = ''; +} + +import x = m.m; +var x = ''; + + +//// [importAndVariableDeclarationConflict1.js] +var m; +(function (m) { + m.m = ''; +})(m || (m = {})); +var x = m.m; +var x = ''; diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.js b/tests/baselines/reference/importAndVariableDeclarationConflict2.js new file mode 100644 index 0000000000000..fa053220633fd --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.js @@ -0,0 +1,27 @@ +//// [importAndVariableDeclarationConflict2.ts] +module m { + export var m = ''; +} + +import x = m.m; + +class C { + public foo() { + var x = ''; + } +} + +//// [importAndVariableDeclarationConflict2.js] +var m; +(function (m) { + m.m = ''; +})(m || (m = {})); +var x = m.m; +var C = (function () { + function C() { + } + C.prototype.foo = function () { + var x = ''; + }; + return C; +})(); diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt new file mode 100644 index 0000000000000..53ec5b64fac5d --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/importAndVariableDeclarationConflict3.ts (1 errors) ==== + module m { + export var m = ''; + } + + import x = m.m; + import x = m.m; + ~ +!!! Duplicate identifier 'x'. + \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict3.js b/tests/baselines/reference/importAndVariableDeclarationConflict3.js new file mode 100644 index 0000000000000..cf9370240e411 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict3.js @@ -0,0 +1,16 @@ +//// [importAndVariableDeclarationConflict3.ts] +module m { + export var m = ''; +} + +import x = m.m; +import x = m.m; + + +//// [importAndVariableDeclarationConflict3.js] +var m; +(function (m) { + m.m = ''; +})(m || (m = {})); +var x = m.m; +var x = m.m; diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt new file mode 100644 index 0000000000000..edef13b1a2690 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/importAndVariableDeclarationConflict4.ts (1 errors) ==== + module m { + export var m = ''; + } + + var x = ''; + import x = m.m; + ~~~~~~~~~~~~~~~ +!!! Import declaration conflicts with local declaration of 'x' + \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict4.js b/tests/baselines/reference/importAndVariableDeclarationConflict4.js new file mode 100644 index 0000000000000..b17e79ea41795 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict4.js @@ -0,0 +1,16 @@ +//// [importAndVariableDeclarationConflict4.ts] +module m { + export var m = ''; +} + +var x = ''; +import x = m.m; + + +//// [importAndVariableDeclarationConflict4.js] +var m; +(function (m) { + m.m = ''; +})(m || (m = {})); +var x = ''; +var x = m.m; diff --git a/tests/baselines/reference/importAsBaseClass.errors.txt b/tests/baselines/reference/importAsBaseClass.errors.txt new file mode 100644 index 0000000000000..e9cd8590cbc58 --- /dev/null +++ b/tests/baselines/reference/importAsBaseClass.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/importAsBaseClass_1.ts (1 errors) ==== + import Greeter = require("importAsBaseClass_0"); + class Hello extends Greeter { } + ~~~~~~~ +!!! Cannot find name 'Greeter'. + +==== tests/cases/compiler/importAsBaseClass_0.ts (0 errors) ==== + export class Greeter { + greet() { return 'greet' } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js new file mode 100644 index 0000000000000..9e52c4dd0673e --- /dev/null +++ b/tests/baselines/reference/importAsBaseClass.js @@ -0,0 +1,36 @@ +//// [tests/cases/compiler/importAsBaseClass.ts] //// + +//// [importAsBaseClass_0.ts] +export class Greeter { + greet() { return 'greet' } +} + +//// [importAsBaseClass_1.ts] +import Greeter = require("importAsBaseClass_0"); +class Hello extends Greeter { } + + +//// [importAsBaseClass_0.js] +var Greeter = (function () { + function Greeter() { + } + Greeter.prototype.greet = function () { + return 'greet'; + }; + return Greeter; +})(); +exports.Greeter = Greeter; +//// [importAsBaseClass_1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Hello = (function (_super) { + __extends(Hello, _super); + function Hello() { + _super.apply(this, arguments); + } + return Hello; +})(Greeter); diff --git a/tests/baselines/reference/importDecl.errors.txt b/tests/baselines/reference/importDecl.errors.txt new file mode 100644 index 0000000000000..2a43a4362c5a3 --- /dev/null +++ b/tests/baselines/reference/importDecl.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/compiler/importDecl_1.ts (1 errors) ==== + /// + /// + /// + /// + /// + import m4 = require("importDecl_require"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + //Emit global only usage + import glo_m4 = require("importDecl_require1"); + export var useGlo_m4_x4 = glo_m4.x; + ~ +!!! Property 'x' does not exist on type 'typeof "tests/cases/compiler/importDecl_require1"'. + export var useGlo_m4_d4 = glo_m4.d; + export var useGlo_m4_f4 = glo_m4.foo(); + + //Emit even when used just in function type + import fncOnly_m4 = require("importDecl_require2"); + export var useFncOnly_m4_f4 = fncOnly_m4.foo(); + + // only used privately no need to emit + import private_m4 = require("importDecl_require3"); + export module usePrivate_m4_m1 { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + } + + // Do not emit unused import + import m5 = require("importDecl_require4"); + export var d = m5.foo2(); + + // Do not emit multiple used import statements + import multiImport_m4 = require("importDecl_require"); // Emit used + export var useMultiImport_m4_x4 = multiImport_m4.x; + export var useMultiImport_m4_d4 = multiImport_m4.d; + export var useMultiImport_m4_f4 = multiImport_m4.foo(); + +==== tests/cases/compiler/importDecl_require.ts (0 errors) ==== + export class d { + foo: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require1.ts (0 errors) ==== + export class d { + bar: string; + } + var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require2.ts (0 errors) ==== + export class d { + baz: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require3.ts (0 errors) ==== + export class d { + bing: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require4.ts (0 errors) ==== + import m4 = require("importDecl_require"); + export function foo2(): m4.d { return null; } + \ No newline at end of file diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js new file mode 100644 index 0000000000000..b8ded72490942 --- /dev/null +++ b/tests/baselines/reference/importDecl.js @@ -0,0 +1,170 @@ +//// [tests/cases/compiler/importDecl.ts] //// + +//// [importDecl_require.ts] +export class d { + foo: string; +} +export var x: d; +export function foo(): d { return null; } + +//// [importDecl_require1.ts] +export class d { + bar: string; +} +var x: d; +export function foo(): d { return null; } + +//// [importDecl_require2.ts] +export class d { + baz: string; +} +export var x: d; +export function foo(): d { return null; } + +//// [importDecl_require3.ts] +export class d { + bing: string; +} +export var x: d; +export function foo(): d { return null; } + +//// [importDecl_require4.ts] +import m4 = require("importDecl_require"); +export function foo2(): m4.d { return null; } + +//// [importDecl_1.ts] +/// +/// +/// +/// +/// +import m4 = require("importDecl_require"); // Emit used +export var x4 = m4.x; +export var d4 = m4.d; +export var f4 = m4.foo(); + +export module m1 { + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); +} + +//Emit global only usage +import glo_m4 = require("importDecl_require1"); +export var useGlo_m4_x4 = glo_m4.x; +export var useGlo_m4_d4 = glo_m4.d; +export var useGlo_m4_f4 = glo_m4.foo(); + +//Emit even when used just in function type +import fncOnly_m4 = require("importDecl_require2"); +export var useFncOnly_m4_f4 = fncOnly_m4.foo(); + +// only used privately no need to emit +import private_m4 = require("importDecl_require3"); +export module usePrivate_m4_m1 { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); +} + +// Do not emit unused import +import m5 = require("importDecl_require4"); +export var d = m5.foo2(); + +// Do not emit multiple used import statements +import multiImport_m4 = require("importDecl_require"); // Emit used +export var useMultiImport_m4_x4 = multiImport_m4.x; +export var useMultiImport_m4_d4 = multiImport_m4.d; +export var useMultiImport_m4_f4 = multiImport_m4.foo(); + + +//// [importDecl_require.js] +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +exports.x; +function foo() { + return null; +} +exports.foo = foo; +//// [importDecl_require1.js] +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +var x; +function foo() { + return null; +} +exports.foo = foo; +//// [importDecl_require2.js] +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +exports.x; +function foo() { + return null; +} +exports.foo = foo; +//// [importDecl_require3.js] +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +exports.x; +function foo() { + return null; +} +exports.foo = foo; +//// [importDecl_require4.js] +function foo2() { + return null; +} +exports.foo2 = foo2; +//// [importDecl_1.js] +var m4 = require("importDecl_require"); +exports.x4 = m4.x; +exports.d4 = m4.d; +exports.f4 = m4.foo(); +(function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var glo_m4 = require("importDecl_require1"); +exports.useGlo_m4_x4 = glo_m4.x; +exports.useGlo_m4_d4 = glo_m4.d; +exports.useGlo_m4_f4 = glo_m4.foo(); +var fncOnly_m4 = require("importDecl_require2"); +exports.useFncOnly_m4_f4 = fncOnly_m4.foo(); +var private_m4 = require("importDecl_require3"); +(function (usePrivate_m4_m1) { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); +})(exports.usePrivate_m4_m1 || (exports.usePrivate_m4_m1 = {})); +var usePrivate_m4_m1 = exports.usePrivate_m4_m1; +var m5 = require("importDecl_require4"); +exports.d = m5.foo2(); +var multiImport_m4 = require("importDecl_require"); +exports.useMultiImport_m4_x4 = multiImport_m4.x; +exports.useMultiImport_m4_d4 = multiImport_m4.d; +exports.useMultiImport_m4_f4 = multiImport_m4.foo(); diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt new file mode 100644 index 0000000000000..a6a8842442991 --- /dev/null +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts (4 errors) ==== + import b = require("externalModule"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'externalModule'. + declare module "m1" { + ~~~~~~~~~~~~~~~~~~~~~ + import im2 = require("externalModule"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'externalModule'. + } + ~ +!!! Ambient external modules cannot be nested in other modules. + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js new file mode 100644 index 0000000000000..34a662d6451fa --- /dev/null +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.js @@ -0,0 +1,8 @@ +//// [importDeclRefereingExternalModuleWithNoResolve.ts] +import b = require("externalModule"); +declare module "m1" { + import im2 = require("externalModule"); +} + + +//// [importDeclRefereingExternalModuleWithNoResolve.js] diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt new file mode 100644 index 0000000000000..081bebda446b4 --- /dev/null +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/importDeclWithClassModifiers.ts (6 errors) ==== + module x { + interface c { + } + } + export public import a = x.c; + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + export private import b = x.c; + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + export static import c = x.c; + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + var b: a; + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt new file mode 100644 index 0000000000000..da3a783c99c6c --- /dev/null +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/importDeclWithDeclareModifier.ts (4 errors) ==== + module x { + interface c { + } + } + declare export import a = x.c; + ~~~~~~~ +!!! A 'declare' modifier cannot be used with an import declaration. + ~~~~~~ +!!! 'export' modifier must precede 'declare' modifier. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + var b: a; + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt new file mode 100644 index 0000000000000..38c3d97185cb5 --- /dev/null +++ b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts (3 errors) ==== + declare module "m" { + module x { + interface c { + } + } + declare export import a = x.c; + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + ~~~~~~~ +!!! A 'declare' modifier cannot be used with an import declaration. + ~~~~~~ +!!! 'export' modifier must precede 'declare' modifier. + var b: a; + } + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifier.errors.txt b/tests/baselines/reference/importDeclWithExportModifier.errors.txt new file mode 100644 index 0000000000000..ffa48b8a52376 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifier.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/importDeclWithExportModifier.ts (1 errors) ==== + module x { + interface c { + } + } + export import a = x.c; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + var b: a; + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifier.js b/tests/baselines/reference/importDeclWithExportModifier.js new file mode 100644 index 0000000000000..dd2e1e11111f6 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifier.js @@ -0,0 +1,13 @@ +//// [importDeclWithExportModifier.ts] +module x { + interface c { + } +} +export import a = x.c; +var b: a; + + +//// [importDeclWithExportModifier.js] +define(["require", "exports"], function (require, exports) { + var b; +}); diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt new file mode 100644 index 0000000000000..9c66bc3ca4216 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts (2 errors) ==== + module x { + interface c { + } + } + export import a = x.c; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Module 'x' has no exported member 'c'. + export = x; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.js b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.js new file mode 100644 index 0000000000000..a8d2e94980587 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.js @@ -0,0 +1,9 @@ +//// [importDeclWithExportModifierAndExportAssignment.ts] +module x { + interface c { + } +} +export import a = x.c; +export = x; + +//// [importDeclWithExportModifierAndExportAssignment.js] diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt new file mode 100644 index 0000000000000..5dc48436ad765 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts (1 errors) ==== + declare module "m" { + module x { + interface c { + } + } + export import a = x.c; + export = x; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + } \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.js b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.js new file mode 100644 index 0000000000000..6e7ea5b864f31 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.js @@ -0,0 +1,11 @@ +//// [importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts] +declare module "m" { + module x { + interface c { + } + } + export import a = x.c; + export = x; +} + +//// [importDeclWithExportModifierAndExportAssignmentInAmbientContext.js] diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.js b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.js new file mode 100644 index 0000000000000..5fa599b187df8 --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.js @@ -0,0 +1,12 @@ +//// [importDeclWithExportModifierInAmbientContext.ts] +declare module "m" { + module x { + interface c { + } + } + export import a = x.c; + var b: a; +} + + +//// [importDeclWithExportModifierInAmbientContext.js] diff --git a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js new file mode 100644 index 0000000000000..98d6d8558dd0d --- /dev/null +++ b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/importDeclarationUsedAsTypeQuery.ts] //// + +//// [importDeclarationUsedAsTypeQuery_require.ts] +export class B { + id: number; +} + +//// [importDeclarationUsedAsTypeQuery_1.ts] +/// +import a = require('importDeclarationUsedAsTypeQuery_require'); +export var x: typeof a; + + +//// [importDeclarationUsedAsTypeQuery_require.js] +var B = (function () { + function B() { + } + return B; +})(); +exports.B = B; +//// [importDeclarationUsedAsTypeQuery_1.js] +exports.x; + + +//// [importDeclarationUsedAsTypeQuery_require.d.ts] +export declare class B { + id; +} +//// [importDeclarationUsedAsTypeQuery_1.d.ts] +/// +export declare var x; diff --git a/tests/baselines/reference/importImportOnlyModule.js b/tests/baselines/reference/importImportOnlyModule.js new file mode 100644 index 0000000000000..31efc6698f81b --- /dev/null +++ b/tests/baselines/reference/importImportOnlyModule.js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/externalModules/importImportOnlyModule.ts] //// + +//// [foo_0.ts] +export class C1 { + m1 = 42; + static s1 = true; +} + +//// [foo_1.ts] +import c1 = require('./foo_0'); // Makes this an external module +var answer = 42; // No exports + +//// [foo_2.ts] +import foo = require("./foo_1"); +var x = foo; // Cause a runtime dependency + + +//// [foo_0.js] +define(["require", "exports"], function (require, exports) { + var C1 = (function () { + function C1() { + this.m1 = 42; + } + C1.s1 = true; + return C1; + })(); + exports.C1 = C1; +}); +//// [foo_1.js] +define(["require", "exports"], function (require, exports) { + var answer = 42; +}); +//// [foo_2.js] +define(["require", "exports", "./foo_1"], function (require, exports, foo) { + var x = foo; +}); diff --git a/tests/baselines/reference/importInTypePosition.js b/tests/baselines/reference/importInTypePosition.js new file mode 100644 index 0000000000000..087a341eef070 --- /dev/null +++ b/tests/baselines/reference/importInTypePosition.js @@ -0,0 +1,42 @@ +//// [importInTypePosition.ts] +module A { + export class Point { + constructor(public x: number, public y: number) { } + } + export var Origin = new Point(0, 0); +} + +// no code gen expected +module B { + + import a = A; //Error generates 'var = ;' +} +// no code gen expected +module C { + + import a = A; //Error generates 'var = ;' + var m: typeof a; + var p: a.Point; + var p = { x: 0, y: 0 }; +} + + +//// [importInTypePosition.js] +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Point = Point; + A.Origin = new Point(0, 0); +})(A || (A = {})); +var C; +(function (C) { + var m; + var p; + var p = { x: 0, y: 0 }; +})(C || (C = {})); diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt new file mode 100644 index 0000000000000..38f09c07cf21f --- /dev/null +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/importInsideModule_file2.ts (2 errors) ==== + export module myModule { + import foo = require("importInsideModule_file1"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'importInsideModule_file1'. + var a = foo.x; + } +==== tests/cases/compiler/importInsideModule_file1.ts (0 errors) ==== + export var x = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/importNonExternalModule.errors.txt b/tests/baselines/reference/importNonExternalModule.errors.txt new file mode 100644 index 0000000000000..6abcf7ac44be7 --- /dev/null +++ b/tests/baselines/reference/importNonExternalModule.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== + import foo = require("./foo_0"); + ~~~~~~~~~ +!!! File 'foo_0.ts' is not an external module. + // Import should fail. foo_0 not an external module + if(foo.answer === 42){ + + } + +==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== + module foo { + export var answer = 42; + } + \ No newline at end of file diff --git a/tests/baselines/reference/importNonExternalModule.js b/tests/baselines/reference/importNonExternalModule.js new file mode 100644 index 0000000000000..9cdf1a6b94c0d --- /dev/null +++ b/tests/baselines/reference/importNonExternalModule.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/importNonExternalModule.ts] //// + +//// [foo_0.ts] +module foo { + export var answer = 42; +} + +//// [foo_1.ts] +import foo = require("./foo_0"); +// Import should fail. foo_0 not an external module +if(foo.answer === 42){ + +} + + +//// [foo_0.js] +var foo; +(function (foo) { + foo.answer = 42; +})(foo || (foo = {})); +//// [foo_1.js] +define(["require", "exports", "./foo_0"], function (require, exports, foo) { + if (foo.answer === 42) { + } +}); diff --git a/tests/baselines/reference/importNonStringLiteral.errors.txt b/tests/baselines/reference/importNonStringLiteral.errors.txt new file mode 100644 index 0000000000000..0c1c2fde04660 --- /dev/null +++ b/tests/baselines/reference/importNonStringLiteral.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/conformance/externalModules/importNonStringLiteral.ts (2 errors) ==== + var x = "filename"; + import foo = require(x); // invalid + ~ +!!! String literal expected. + ~ +!!! ';' expected. + \ No newline at end of file diff --git a/tests/baselines/reference/importOnAliasedIdentifiers.js b/tests/baselines/reference/importOnAliasedIdentifiers.js new file mode 100644 index 0000000000000..8f92bed33507f --- /dev/null +++ b/tests/baselines/reference/importOnAliasedIdentifiers.js @@ -0,0 +1,22 @@ +//// [importOnAliasedIdentifiers.ts] +module A { + export interface X { s: string } + export var X: X; +} +module B { + interface A { n: number } + import Y = A; // Alias only for module A + import Z = A.X; // Alias for both type and member A.X + var v: Z = Z; +} + +//// [importOnAliasedIdentifiers.js] +var A; +(function (A) { + A.X; +})(A || (A = {})); +var B; +(function (B) { + var Z = A.X; + var v = Z; +})(B || (B = {})); diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js new file mode 100644 index 0000000000000..0f673097dc260 --- /dev/null +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -0,0 +1,38 @@ +//// [tests/cases/compiler/importShadowsGlobalName.ts] //// + +//// [Foo.ts] + +class Foo {} +export = Foo; + +//// [Bar.ts] +import Error = require('Foo'); +class Bar extends Error {} +export = Bar; + +//// [Foo.js] +define(["require", "exports"], function (require, exports) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + return Foo; +}); +//// [Bar.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +define(["require", "exports", 'Foo'], function (require, exports, Error) { + var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; + })(Error); + return Bar; +}); diff --git a/tests/baselines/reference/importStatements.js b/tests/baselines/reference/importStatements.js new file mode 100644 index 0000000000000..2aeb665e0ec0d --- /dev/null +++ b/tests/baselines/reference/importStatements.js @@ -0,0 +1,68 @@ +//// [importStatements.ts] +module A { + export class Point { + constructor(public x: number, public y: number) { } + } + + export var Origin = new Point(0, 0); +} + +// no code gen expected +module B { + import a = A; //Error generates 'var = ;' +} + +// no code gen expected +module C { + import a = A; //Error generates 'var = ;' + var m: typeof a; + var p: a.Point; + var p = {x:0, y:0 }; +} + +// code gen expected +module D { + import a = A; + + var p = new a.Point(1, 1); +} + +module E { + import a = A; + export function xDist(x: a.Point) { + return (a.Origin.x - x.x); + } +} + +//// [importStatements.js] +var A; +(function (A) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + return Point; + })(); + A.Point = Point; + A.Origin = new Point(0, 0); +})(A || (A = {})); +var C; +(function (C) { + var m; + var p; + var p = { x: 0, y: 0 }; +})(C || (C = {})); +var D; +(function (D) { + var a = A; + var p = new a.Point(1, 1); +})(D || (D = {})); +var E; +(function (E) { + var a = A; + function xDist(x) { + return (a.Origin.x - x.x); + } + E.xDist = xDist; +})(E || (E = {})); diff --git a/tests/baselines/reference/importStatementsInterfaces.errors.txt b/tests/baselines/reference/importStatementsInterfaces.errors.txt new file mode 100644 index 0000000000000..95a733dc2c4b1 --- /dev/null +++ b/tests/baselines/reference/importStatementsInterfaces.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/conformance/internalModules/codeGeneration/importStatementsInterfaces.ts (1 errors) ==== + module A { + export interface Point { + x: number; + y: number; + } + + export module inA { + export interface Point3D extends Point { + z: number; + } + } + } + + // no code gen expected + module B { + import a = A; + } + + // no code gen expected + module C { + import a = A; + import b = a.inA; + var m: typeof a; + ~ +!!! Cannot find name 'a'. + var p: b.Point3D; + var p = {x:0, y:0, z: 0 }; + } + + // no code gen expected + module D { + import a = A; + + var p : a.Point; + } + + // no code gen expected + module E { + import a = A.inA; + export function xDist(x: a.Point3D) { + return 0 - x.x; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/importStatementsInterfaces.js b/tests/baselines/reference/importStatementsInterfaces.js new file mode 100644 index 0000000000000..99cbaeaff3719 --- /dev/null +++ b/tests/baselines/reference/importStatementsInterfaces.js @@ -0,0 +1,61 @@ +//// [importStatementsInterfaces.ts] +module A { + export interface Point { + x: number; + y: number; + } + + export module inA { + export interface Point3D extends Point { + z: number; + } + } +} + +// no code gen expected +module B { + import a = A; +} + +// no code gen expected +module C { + import a = A; + import b = a.inA; + var m: typeof a; + var p: b.Point3D; + var p = {x:0, y:0, z: 0 }; +} + +// no code gen expected +module D { + import a = A; + + var p : a.Point; +} + +// no code gen expected +module E { + import a = A.inA; + export function xDist(x: a.Point3D) { + return 0 - x.x; + } +} + +//// [importStatementsInterfaces.js] +var C; +(function (C) { + var m; + var p; + var p = { x: 0, y: 0, z: 0 }; +})(C || (C = {})); +var D; +(function (D) { + var p; +})(D || (D = {})); +var E; +(function (E) { + function xDist(x) { + return 0 - x.x; + } + E.xDist = xDist; +})(E || (E = {})); diff --git a/tests/baselines/reference/importTsBeforeDTs.errors.txt b/tests/baselines/reference/importTsBeforeDTs.errors.txt new file mode 100644 index 0000000000000..58e72634573c3 --- /dev/null +++ b/tests/baselines/reference/importTsBeforeDTs.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== + import foo = require("./foo_0"); + var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts + ~ +!!! Property 'x' does not exist on type 'typeof "tests/cases/conformance/externalModules/foo_0"'. + var z2 = foo.y + 10; // Should resolve + +==== tests/cases/conformance/externalModules/foo_0.d.ts (0 errors) ==== + export var x: number = 42; + +==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== + export var y: number = 42; + + \ No newline at end of file diff --git a/tests/baselines/reference/importTsBeforeDTs.js b/tests/baselines/reference/importTsBeforeDTs.js new file mode 100644 index 0000000000000..44908ac8d8fbc --- /dev/null +++ b/tests/baselines/reference/importTsBeforeDTs.js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/externalModules/importTsBeforeDTs.ts] //// + +//// [foo_0.d.ts] +export var x: number = 42; + +//// [foo_0.ts] +export var y: number = 42; + + +//// [foo_1.ts] +import foo = require("./foo_0"); +var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts +var z2 = foo.y + 10; // Should resolve + + +//// [foo_0.js] +exports.y = 42; +//// [foo_1.js] +var foo = require("./foo_0"); +var z1 = foo.x + 10; +var z2 = foo.y + 10; diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js new file mode 100644 index 0000000000000..e9b7b142e16a1 --- /dev/null +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/importUsedInExtendsList1.ts] //// + +//// [importUsedInExtendsList1_require.ts] +export class Super { foo: string; } + +//// [importUsedInExtendsList1_1.ts] +/// +import foo = require('importUsedInExtendsList1_require'); +class Sub extends foo.Super { } +var s: Sub; +var r: string = s.foo; + + +//// [importUsedInExtendsList1_require.js] +var Super = (function () { + function Super() { + } + return Super; +})(); +exports.Super = Super; +//// [importUsedInExtendsList1_1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var foo = require('importUsedInExtendsList1_require'); +var Sub = (function (_super) { + __extends(Sub, _super); + function Sub() { + _super.apply(this, arguments); + } + return Sub; +})(foo.Super); +var s; +var r = s.foo; diff --git a/tests/baselines/reference/import_reference-exported-alias.js b/tests/baselines/reference/import_reference-exported-alias.js new file mode 100644 index 0000000000000..e331583f14e2d --- /dev/null +++ b/tests/baselines/reference/import_reference-exported-alias.js @@ -0,0 +1,49 @@ +//// [tests/cases/compiler/import_reference-exported-alias.ts] //// + +//// [file1.ts] +module App { + export module Services { + export class UserServices { + public getUserName(): string { + return "Bill Gates"; + } + } + } +} + +import Mod = App; +export = Mod; + +//// [file2.ts] +import appJs = require("file1"); +import Services = appJs.Services; +import UserServices = Services.UserServices; +var x = new UserServices().getUserName(); + + +//// [file1.js] +define(["require", "exports"], function (require, exports) { + var App; + (function (App) { + (function (Services) { + var UserServices = (function () { + function UserServices() { + } + UserServices.prototype.getUserName = function () { + return "Bill Gates"; + }; + return UserServices; + })(); + Services.UserServices = UserServices; + })(App.Services || (App.Services = {})); + var Services = App.Services; + })(App || (App = {})); + var Mod = App; + return Mod; +}); +//// [file2.js] +define(["require", "exports", "file1"], function (require, exports, appJs) { + var Services = appJs.Services; + var UserServices = Services.UserServices; + var x = new UserServices().getUserName(); +}); diff --git a/tests/baselines/reference/import_reference-to-type-alias.js b/tests/baselines/reference/import_reference-to-type-alias.js new file mode 100644 index 0000000000000..1c13b12d412a5 --- /dev/null +++ b/tests/baselines/reference/import_reference-to-type-alias.js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/import_reference-to-type-alias.ts] //// + +//// [file1.ts] +export module App { + export module Services { + export class UserServices { + public getUserName(): string { + return "Bill Gates"; + } + } + } +} + +//// [file2.ts] +import appJs = require("file1"); +import Services = appJs.App.Services; +var x = new Services.UserServices().getUserName(); + + +//// [file1.js] +define(["require", "exports"], function (require, exports) { + (function (App) { + (function (Services) { + var UserServices = (function () { + function UserServices() { + } + UserServices.prototype.getUserName = function () { + return "Bill Gates"; + }; + return UserServices; + })(); + Services.UserServices = UserServices; + })(App.Services || (App.Services = {})); + var Services = App.Services; + })(exports.App || (exports.App = {})); + var App = exports.App; +}); +//// [file2.js] +define(["require", "exports", "file1"], function (require, exports, appJs) { + var Services = appJs.App.Services; + var x = new Services.UserServices().getUserName(); +}); diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.js b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.js new file mode 100644 index 0000000000000..a438daec3f22d --- /dev/null +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/import_unneeded-require-when-referenecing-aliased-type-throug-array.ts] //// + +//// [b.ts] +declare module "ITest" { + interface Name { + name: string; + } + export = Name; +} + +//// [a.ts] +/// +import ITest = require('ITest'); +var testData: ITest[]; +var p = testData[0].name; + + +//// [b.js] +//// [a.js] +define(["require", "exports"], function (require, exports) { + var testData; + var p = testData[0].name; +}); diff --git a/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js new file mode 100644 index 0000000000000..6b37f631efc92 --- /dev/null +++ b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/import_var-referencing-an-imported-module-alias.ts] //// + +//// [host.ts] +export class Host { } + +//// [consumer.ts] + +import host = require("host"); +var hostVar = host; +var v = new hostVar.Host(); + + +//// [host.js] +define(["require", "exports"], function (require, exports) { + var Host = (function () { + function Host() { + } + return Host; + })(); + exports.Host = Host; +}); +//// [consumer.js] +define(["require", "exports", "host"], function (require, exports, host) { + var hostVar = host; + var v = new hostVar.Host(); +}); diff --git a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt new file mode 100644 index 0000000000000..d6989e5b3b9c6 --- /dev/null +++ b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/importedModuleAddToGlobal.ts (1 errors) ==== + // Binding for an import statement in a typeref position is being added to the global scope + // Shouldn't compile b.B is not defined in C + module A { + import b = B; + import c = C; + } + + module B { + import a = A; + export class B { } + } + + module C { + import a = A; + function hello(): b.B { return null; } + ~~~ +!!! Cannot find name 'b'. + } \ No newline at end of file diff --git a/tests/baselines/reference/importedModuleAddToGlobal.js b/tests/baselines/reference/importedModuleAddToGlobal.js new file mode 100644 index 0000000000000..075621e92c207 --- /dev/null +++ b/tests/baselines/reference/importedModuleAddToGlobal.js @@ -0,0 +1,34 @@ +//// [importedModuleAddToGlobal.ts] +// Binding for an import statement in a typeref position is being added to the global scope +// Shouldn't compile b.B is not defined in C +module A { + import b = B; + import c = C; +} + +module B { + import a = A; + export class B { } +} + +module C { + import a = A; + function hello(): b.B { return null; } +} + +//// [importedModuleAddToGlobal.js] +var B; +(function (B) { + var B = (function () { + function B() { + } + return B; + })(); + B.B = B; +})(B || (B = {})); +var C; +(function (C) { + function hello() { + return null; + } +})(C || (C = {})); diff --git a/tests/baselines/reference/importedModuleClassNameClash.js b/tests/baselines/reference/importedModuleClassNameClash.js new file mode 100644 index 0000000000000..c67af2089faf9 --- /dev/null +++ b/tests/baselines/reference/importedModuleClassNameClash.js @@ -0,0 +1,16 @@ +//// [importedModuleClassNameClash.ts] +import foo = m1; + +export module m1 { } + +class foo { } + + +//// [importedModuleClassNameClash.js] +define(["require", "exports"], function (require, exports) { + var foo = (function () { + function foo() { + } + return foo; + })(); +}); diff --git a/tests/baselines/reference/inOperator.errors.txt b/tests/baselines/reference/inOperator.errors.txt new file mode 100644 index 0000000000000..83f11b759e56c --- /dev/null +++ b/tests/baselines/reference/inOperator.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/inOperator.ts (1 errors) ==== + var a=[]; + + for (var x in a) {} + + if (3 in a) {} + + var b = '' in 0; + ~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + + var c: any; + var y: number; + if (y in c) { } + \ No newline at end of file diff --git a/tests/baselines/reference/inOperator.js b/tests/baselines/reference/inOperator.js new file mode 100644 index 0000000000000..1407ef9d59cd2 --- /dev/null +++ b/tests/baselines/reference/inOperator.js @@ -0,0 +1,25 @@ +//// [inOperator.ts] +var a=[]; + +for (var x in a) {} + +if (3 in a) {} + +var b = '' in 0; + +var c: any; +var y: number; +if (y in c) { } + + +//// [inOperator.js] +var a = []; +for (var x in a) { +} +if (3 in a) { +} +var b = '' in 0; +var c; +var y; +if (y in c) { +} diff --git a/tests/baselines/reference/inOperatorWithFunction.js b/tests/baselines/reference/inOperatorWithFunction.js new file mode 100644 index 0000000000000..8daeb5a30fb97 --- /dev/null +++ b/tests/baselines/reference/inOperatorWithFunction.js @@ -0,0 +1,10 @@ +//// [inOperatorWithFunction.ts] +var fn = function (val: boolean) { return val; } +fn("a" in { "a": true }); + + +//// [inOperatorWithFunction.js] +var fn = function (val) { + return val; +}; +fn("a" in { "a": true }); diff --git a/tests/baselines/reference/inOperatorWithGeneric.js b/tests/baselines/reference/inOperatorWithGeneric.js new file mode 100644 index 0000000000000..b34d510f5a32d --- /dev/null +++ b/tests/baselines/reference/inOperatorWithGeneric.js @@ -0,0 +1,18 @@ +//// [inOperatorWithGeneric.ts] +class C { + foo(x:T) { + for (var p in x) { + } + } +} + +//// [inOperatorWithGeneric.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + for (var p in x) { + } + }; + return C; +})(); diff --git a/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..cb65a4120064b --- /dev/null +++ b/tests/baselines/reference/inOperatorWithInvalidOperands.errors.txt @@ -0,0 +1,81 @@ +==== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithInvalidOperands.ts (20 errors) ==== + enum E { a } + + var x: any; + + // invalid left operands + // the left operand is required to be of type Any, the String primitive type, or the Number primitive type + var a1: boolean; + var a2: void; + var a3: {}; + var a4: E + + var ra1 = a1 in x; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra2 = a2 in x; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra3 = a3 in x; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra4 = a4 in x; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra5 = null in x; + ~~~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra6 = undefined in x; + ~~~~~~~~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra7 = E.a in x; + ~~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra8 = false in x; + ~~~~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + var ra9 = {} in x; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + + // invalid right operands + // the right operand is required to be of type Any, an object type, or a type parameter type + var b1: number; + var b2: boolean; + var b3: string; + var b4: void; + + var rb1 = x in b1; + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb2 = x in b2; + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb3 = x in b3; + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb4 = x in b4; + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb5 = x in 0; + ~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb6 = x in false; + ~~~~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb7 = x in ''; + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb8 = x in null; + ~~~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + var rb9 = x in undefined; + ~~~~~~~~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter + + // both operands are invalid + var rc1 = {} in ''; + ~~ +!!! The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. + ~~ +!!! The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter \ No newline at end of file diff --git a/tests/baselines/reference/inOperatorWithInvalidOperands.js b/tests/baselines/reference/inOperatorWithInvalidOperands.js new file mode 100644 index 0000000000000..d8c99c072f84b --- /dev/null +++ b/tests/baselines/reference/inOperatorWithInvalidOperands.js @@ -0,0 +1,75 @@ +//// [inOperatorWithInvalidOperands.ts] +enum E { a } + +var x: any; + +// invalid left operands +// the left operand is required to be of type Any, the String primitive type, or the Number primitive type +var a1: boolean; +var a2: void; +var a3: {}; +var a4: E + +var ra1 = a1 in x; +var ra2 = a2 in x; +var ra3 = a3 in x; +var ra4 = a4 in x; +var ra5 = null in x; +var ra6 = undefined in x; +var ra7 = E.a in x; +var ra8 = false in x; +var ra9 = {} in x; + +// invalid right operands +// the right operand is required to be of type Any, an object type, or a type parameter type +var b1: number; +var b2: boolean; +var b3: string; +var b4: void; + +var rb1 = x in b1; +var rb2 = x in b2; +var rb3 = x in b3; +var rb4 = x in b4; +var rb5 = x in 0; +var rb6 = x in false; +var rb7 = x in ''; +var rb8 = x in null; +var rb9 = x in undefined; + +// both operands are invalid +var rc1 = {} in ''; + +//// [inOperatorWithInvalidOperands.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; +})(E || (E = {})); +var x; +var a1; +var a2; +var a3; +var a4; +var ra1 = a1 in x; +var ra2 = a2 in x; +var ra3 = a3 in x; +var ra4 = a4 in x; +var ra5 = null in x; +var ra6 = undefined in x; +var ra7 = 0 /* a */ in x; +var ra8 = false in x; +var ra9 = {} in x; +var b1; +var b2; +var b3; +var b4; +var rb1 = x in b1; +var rb2 = x in b2; +var rb3 = x in b3; +var rb4 = x in b4; +var rb5 = x in 0; +var rb6 = x in false; +var rb7 = x in ''; +var rb8 = x in null; +var rb9 = x in undefined; +var rc1 = {} in ''; diff --git a/tests/baselines/reference/inOperatorWithValidOperands.js b/tests/baselines/reference/inOperatorWithValidOperands.js new file mode 100644 index 0000000000000..b9b40d75f55be --- /dev/null +++ b/tests/baselines/reference/inOperatorWithValidOperands.js @@ -0,0 +1,40 @@ +//// [inOperatorWithValidOperands.ts] +var x: any; + +// valid left operands +// the left operand is required to be of type Any, the String primitive type, or the Number primitive type +var a1: string; +var a2: number; + +var ra1 = x in x; +var ra2 = a1 in x; +var ra3 = a2 in x; +var ra4 = '' in x; +var ra5 = 0 in x; + +// valid right operands +// the right operand is required to be of type Any, an object type, or a type parameter type +var b1: {}; + +var rb1 = x in b1; +var rb2 = x in {}; + +function foo(t: T) { + var rb3 = x in t; +} + +//// [inOperatorWithValidOperands.js] +var x; +var a1; +var a2; +var ra1 = x in x; +var ra2 = a1 in x; +var ra3 = a2 in x; +var ra4 = '' in x; +var ra5 = 0 in x; +var b1; +var rb1 = x in b1; +var rb2 = x in {}; +function foo(t) { + var rb3 = x in t; +} diff --git a/tests/baselines/reference/incompatibleExports1.errors.txt b/tests/baselines/reference/incompatibleExports1.errors.txt new file mode 100644 index 0000000000000..99a35e122bb74 --- /dev/null +++ b/tests/baselines/reference/incompatibleExports1.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/incompatibleExports1.ts (2 errors) ==== + declare module "foo" { + export interface x { a: string } + interface y { a: Date } + export = y; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + } + + declare module "baz" { + export module a { + export var b: number; + } + + module c { + export var c: string; + } + + export = c; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + } + \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleExports1.js b/tests/baselines/reference/incompatibleExports1.js new file mode 100644 index 0000000000000..0398ed8858d60 --- /dev/null +++ b/tests/baselines/reference/incompatibleExports1.js @@ -0,0 +1,21 @@ +//// [incompatibleExports1.ts] +declare module "foo" { + export interface x { a: string } + interface y { a: Date } + export = y; +} + +declare module "baz" { + export module a { + export var b: number; + } + + module c { + export var c: string; + } + + export = c; +} + + +//// [incompatibleExports1.js] diff --git a/tests/baselines/reference/incompatibleExports2.errors.txt b/tests/baselines/reference/incompatibleExports2.errors.txt new file mode 100644 index 0000000000000..a809d70feb784 --- /dev/null +++ b/tests/baselines/reference/incompatibleExports2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/incompatibleExports2.ts (1 errors) ==== + declare module "foo" { + export interface x { a: string } + interface y { a: Date } + export = y; + ~~~~~~~~~~~ +!!! An export assignment cannot be used in a module with other exported elements. + } \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleExports2.js b/tests/baselines/reference/incompatibleExports2.js new file mode 100644 index 0000000000000..f306ebe00eb17 --- /dev/null +++ b/tests/baselines/reference/incompatibleExports2.js @@ -0,0 +1,8 @@ +//// [incompatibleExports2.ts] +declare module "foo" { + export interface x { a: string } + interface y { a: Date } + export = y; +} + +//// [incompatibleExports2.js] diff --git a/tests/baselines/reference/incompatibleGenericTypes.errors.txt b/tests/baselines/reference/incompatibleGenericTypes.errors.txt new file mode 100644 index 0000000000000..d102fcebbd5cc --- /dev/null +++ b/tests/baselines/reference/incompatibleGenericTypes.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/incompatibleGenericTypes.ts (1 errors) ==== + + interface I1 { + + m1(callback: (p: T) => U): I1; + + } + + var v1: I1; + + var v2: I1 = v1; + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'I1' is not assignable to type 'I1': +!!! Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleGenericTypes.js b/tests/baselines/reference/incompatibleGenericTypes.js new file mode 100644 index 0000000000000..21a2dbc5e4143 --- /dev/null +++ b/tests/baselines/reference/incompatibleGenericTypes.js @@ -0,0 +1,15 @@ +//// [incompatibleGenericTypes.ts] + +interface I1 { + + m1(callback: (p: T) => U): I1; + +} + +var v1: I1; + +var v2: I1 = v1; + +//// [incompatibleGenericTypes.js] +var v1; +var v2 = v1; diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt new file mode 100644 index 0000000000000..b3150f81f927e --- /dev/null +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -0,0 +1,107 @@ +==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== + interface IFoo1 { + p1(): number; + } + + class C1 implements IFoo1 { // incompatible on the return type + ~~ +!!! Class 'C1' incorrectly implements interface 'IFoo1': +!!! Types of property 'p1' are incompatible: +!!! Type '() => string' is not assignable to type '() => number': +!!! Type 'string' is not assignable to type 'number'. + public p1() { + return "s"; + } + } + + interface IFoo2 { + p1(s:string): number; + } + + class C2 implements IFoo2 { // incompatible on the param type + ~~ +!!! Class 'C2' incorrectly implements interface 'IFoo2': +!!! Types of property 'p1' are incompatible: +!!! Type '(n: number) => number' is not assignable to type '(s: string) => number': +!!! Types of parameters 'n' and 's' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + public p1(n:number) { + return 0; + } + } + + interface IFoo3 { + p1: string; + } + + class C3 implements IFoo3 { // incompatible on the property type + ~~ +!!! Class 'C3' incorrectly implements interface 'IFoo3': +!!! Types of property 'p1' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + public p1: number; + } + + interface IFoo4 { + p1: { a: { a: string; }; b: string; }; + } + + class C4 implements IFoo4 { // incompatible on the property type + ~~ +!!! Class 'C4' incorrectly implements interface 'IFoo4': +!!! Types of property 'p1' are incompatible: +!!! Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': +!!! Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. + public p1: { c: { b: string; }; d: string; }; + } + + function if1(i: IFoo1): void; + function if1(i: IFoo2): void; + function if1(a: any) { } + var c1: C1; + var c2: C2; + if1(c1); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + + function of1(n: { a: { a: string; }; b: string; }): number; + function of1(s: { c: { b: string; }; d: string; }): string; + function of1(a: any) { return null; } + + of1({ e: 0, f: 0 }); + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + interface IMap { + [key:string]:string; + } + + function foo(fn:() => void) { + + } + + function bar() { + var map:IMap; + foo(() => { + map = {}; + }); + } + + var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': +!!! Property 'a' is missing in type '{ e: number; f: number; }'. + + var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; + + + + var i1c1: { (): string; } = 5; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '() => string'. + + var fp1: () =>any = a => 0; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '(a: any) => number' is not assignable to type '() => any'. + \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.js b/tests/baselines/reference/incompatibleTypes.js new file mode 100644 index 0000000000000..38664e514c767 --- /dev/null +++ b/tests/baselines/reference/incompatibleTypes.js @@ -0,0 +1,125 @@ +//// [incompatibleTypes.ts] +interface IFoo1 { + p1(): number; +} + +class C1 implements IFoo1 { // incompatible on the return type + public p1() { + return "s"; + } +} + +interface IFoo2 { + p1(s:string): number; +} + +class C2 implements IFoo2 { // incompatible on the param type + public p1(n:number) { + return 0; + } +} + +interface IFoo3 { + p1: string; +} + +class C3 implements IFoo3 { // incompatible on the property type + public p1: number; +} + +interface IFoo4 { + p1: { a: { a: string; }; b: string; }; +} + +class C4 implements IFoo4 { // incompatible on the property type + public p1: { c: { b: string; }; d: string; }; +} + +function if1(i: IFoo1): void; +function if1(i: IFoo2): void; +function if1(a: any) { } +var c1: C1; +var c2: C2; +if1(c1); + + +function of1(n: { a: { a: string; }; b: string; }): number; +function of1(s: { c: { b: string; }; d: string; }): string; +function of1(a: any) { return null; } + +of1({ e: 0, f: 0 }); + +interface IMap { + [key:string]:string; +} + +function foo(fn:() => void) { + +} + +function bar() { + var map:IMap; + foo(() => { + map = {}; + }); +} + +var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; + +var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; + + + +var i1c1: { (): string; } = 5; + +var fp1: () =>any = a => 0; + + +//// [incompatibleTypes.js] +var C1 = (function () { + function C1() { + } + C1.prototype.p1 = function () { + return "s"; + }; + return C1; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.p1 = function (n) { + return 0; + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function () { + function C4() { + } + return C4; +})(); +function if1(a) { +} +var c1; +var c2; +if1(c1); +function of1(a) { + return null; +} +of1({ e: 0, f: 0 }); +function foo(fn) { +} +function bar() { + var map; + foo(function () { + map = {}; + }); +} +var o1 = { e: 0, f: 0 }; +var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; +var i1c1 = 5; +var fp1 = function (a) { return 0; }; diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt new file mode 100644 index 0000000000000..f54412d13d454 --- /dev/null +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/incompleteDottedExpressionAtEOF.ts (2 errors) ==== + // used to leak __missing into error message + var p2 = window. + +!!! Identifier expected. + ~~~~~~ +!!! Cannot find name 'window'. \ No newline at end of file diff --git a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt new file mode 100644 index 0000000000000..60bebb7036717 --- /dev/null +++ b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/incompleteObjectLiteral1.ts (2 errors) ==== + var tt = { aa; } + ~ +!!! ':' expected. + ~ +!!! Declaration or statement expected. + var x = tt; \ No newline at end of file diff --git a/tests/baselines/reference/incorrectClassOverloadChain.errors.txt b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt new file mode 100644 index 0000000000000..6521936b4d898 --- /dev/null +++ b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/incorrectClassOverloadChain.ts (1 errors) ==== + class C { + foo(): string; + foo(x): number; + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + x = 1; + } \ No newline at end of file diff --git a/tests/baselines/reference/incorrectClassOverloadChain.js b/tests/baselines/reference/incorrectClassOverloadChain.js new file mode 100644 index 0000000000000..bf02a09014ce9 --- /dev/null +++ b/tests/baselines/reference/incorrectClassOverloadChain.js @@ -0,0 +1,14 @@ +//// [incorrectClassOverloadChain.ts] +class C { + foo(): string; + foo(x): number; + x = 1; +} + +//// [incorrectClassOverloadChain.js] +var C = (function () { + function C() { + this.x = 1; + } + return C; +})(); diff --git a/tests/baselines/reference/incrementAndDecrement.errors.txt b/tests/baselines/reference/incrementAndDecrement.errors.txt new file mode 100644 index 0000000000000..b8dc8c5b4e08f --- /dev/null +++ b/tests/baselines/reference/incrementAndDecrement.errors.txt @@ -0,0 +1,104 @@ +==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (21 errors) ==== + enum E { A, B, C }; + var x = 4; + var e = E.B; + var a: any; + var w = window; + ~~~~~~ +!!! Cannot find name 'window'. + + // Assign to expression++ + x++ = 4; // Error + ~ +!!! ';' expected. + + // Assign to expression-- + x-- = 5; // Error + ~ +!!! ';' expected. + + // Assign to++expression + ++x = 4; // Error + ~ +!!! ';' expected. + + // Assign to--expression + --x = 5; // Error + ~ +!!! ';' expected. + + // Pre and postfix++ on number + x++; + x--; + ++x; + --x; + ++x++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --x--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++x--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --x++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + // Pre and postfix++ on enum + e++; + e--; + ++e; + --e; + ++e++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --e--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++e--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --e++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + // Pre and postfix++ on value of type 'any' + a++; + a--; + ++a; + --a; + ++a++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --a--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++a--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --a++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + + // Pre and postfix++ on other types + w++; // Error + w--; // Error + ++w; // Error + --w; // Error + ++w++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --w--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++w--; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + --w++; // Error + ~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + + \ No newline at end of file diff --git a/tests/baselines/reference/incrementOnTypeParameter.errors.txt b/tests/baselines/reference/incrementOnTypeParameter.errors.txt new file mode 100644 index 0000000000000..b9461c690e23f --- /dev/null +++ b/tests/baselines/reference/incrementOnTypeParameter.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/incrementOnTypeParameter.ts (2 errors) ==== + class C { + a: T; + foo() { + this.a++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + for (var i: T, j = 0; j < 10; i++) { + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/incrementOnTypeParameter.js b/tests/baselines/reference/incrementOnTypeParameter.js new file mode 100644 index 0000000000000..bec2bcd9d0598 --- /dev/null +++ b/tests/baselines/reference/incrementOnTypeParameter.js @@ -0,0 +1,22 @@ +//// [incrementOnTypeParameter.ts] +class C { + a: T; + foo() { + this.a++; + for (var i: T, j = 0; j < 10; i++) { + } + } +} + + +//// [incrementOnTypeParameter.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + this.a++; + for (var i, j = 0; j < 10; i++) { + } + }; + return C; +})(); diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.js b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..f7b9fb4effc1b --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.js @@ -0,0 +1,91 @@ +//// [incrementOperatorWithAnyOtherType.ts] +// ++ operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj = {x:1,y:null}; +class A { + public a: any; +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsNumber1 = ++ANY; +var ResultIsNumber2 = ++ANY1; + +var ResultIsNumber3 = ANY1++; +var ResultIsNumber4 = ANY1++; + +// expressions +var ResultIsNumber5 = ++ANY2[0]; +var ResultIsNumber6 = ++obj.x; +var ResultIsNumber7 = ++obj.y; +var ResultIsNumber8 = ++objA.a; +var ResultIsNumber = ++M.n; + +var ResultIsNumber9 = ANY2[0]++; +var ResultIsNumber10 = obj.x++; +var ResultIsNumber11 = obj.y++; +var ResultIsNumber12 = objA.a++; +var ResultIsNumber13 = M.n++; + +// miss assignment opertors +++ANY; +++ANY1; +++ANY2[0]; +++ANY, ++ANY1; +++objA.a; +++M.n; + +ANY++; +ANY1++; +ANY2[0]++; +ANY++, ANY1++; +objA.a++; +M.n++; + +//// [incrementOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj = { x: 1, y: null }; +var A = (function () { + function A() { + } + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++ANY; +var ResultIsNumber2 = ++ANY1; +var ResultIsNumber3 = ANY1++; +var ResultIsNumber4 = ANY1++; +var ResultIsNumber5 = ++ANY2[0]; +var ResultIsNumber6 = ++obj.x; +var ResultIsNumber7 = ++obj.y; +var ResultIsNumber8 = ++objA.a; +var ResultIsNumber = ++M.n; +var ResultIsNumber9 = ANY2[0]++; +var ResultIsNumber10 = obj.x++; +var ResultIsNumber11 = obj.y++; +var ResultIsNumber12 = objA.a++; +var ResultIsNumber13 = M.n++; +++ANY; +++ANY1; +++ANY2[0]; +++ANY, ++ANY1; +++objA.a; +++M.n; +ANY++; +ANY1++; +ANY2[0]++; +ANY++, ANY1++; +objA.a++; +M.n++; diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..6ebcb4490ebe4 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -0,0 +1,154 @@ +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts (42 errors) ==== + // ++ operator on any type + var ANY1; + var ANY2: any[] = [1, 2]; + + var obj: () => {} + var obj1 = { x: "", y: () => { } }; + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = ++ANY2; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = ++A; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber3 = ++M; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = ++obj; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = ++obj1; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = ANY2++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = A++; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = M++; + ~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber9 = obj++; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = obj1++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // any type literal + var ResultIsNumber11 = ++{}; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = ++null; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber13 = ++undefined; + ~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber14 = null++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = {}++; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = undefined++; + ~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // any type expressions + var ResultIsNumber17 = ++foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber18 = ++A.foo(); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber19 = ++(null + undefined); + ~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber20 = ++(null + null); + ~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber21 = ++(undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber22 = ++obj1.x; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber23 = ++obj1.y; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber24 = foo()++; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber25 = A.foo()++; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber26 = (null + undefined)++; + ~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber27 = (null + null)++; + ~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber28 = (undefined + undefined)++; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber29 = obj1.x++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber30 = obj1.y++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + ++ANY2; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ANY2++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ++ANY1++; + ~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++ANY2++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++ANY2[0]++; + ~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js new file mode 100644 index 0000000000000..928f0a59e4df1 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.js @@ -0,0 +1,130 @@ +//// [incrementOperatorWithAnyOtherTypeInvalidOperations.ts] +// ++ operator on any type +var ANY1; +var ANY2: any[] = [1, 2]; + +var obj: () => {} +var obj1 = { x: "", y: () => { } }; +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsNumber1 = ++ANY2; +var ResultIsNumber2 = ++A; +var ResultIsNumber3 = ++M; +var ResultIsNumber4 = ++obj; +var ResultIsNumber5 = ++obj1; + +var ResultIsNumber6 = ANY2++; +var ResultIsNumber7 = A++; +var ResultIsNumber8 = M++; +var ResultIsNumber9 = obj++; +var ResultIsNumber10 = obj1++; + +// any type literal +var ResultIsNumber11 = ++{}; +var ResultIsNumber12 = ++null; +var ResultIsNumber13 = ++undefined; + +var ResultIsNumber14 = null++; +var ResultIsNumber15 = {}++; +var ResultIsNumber16 = undefined++; + +// any type expressions +var ResultIsNumber17 = ++foo(); +var ResultIsNumber18 = ++A.foo(); +var ResultIsNumber19 = ++(null + undefined); +var ResultIsNumber20 = ++(null + null); +var ResultIsNumber21 = ++(undefined + undefined); +var ResultIsNumber22 = ++obj1.x; +var ResultIsNumber23 = ++obj1.y; + +var ResultIsNumber24 = foo()++; +var ResultIsNumber25 = A.foo()++; +var ResultIsNumber26 = (null + undefined)++; +var ResultIsNumber27 = (null + null)++; +var ResultIsNumber28 = (undefined + undefined)++; +var ResultIsNumber29 = obj1.x++; +var ResultIsNumber30 = obj1.y++; + +// miss assignment operators +++ANY2; + +ANY2++; + +++ANY1++; +++ANY2++; +++ANY2[0]++; + +//// [incrementOperatorWithAnyOtherTypeInvalidOperations.js] +var ANY1; +var ANY2 = [1, 2]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++ANY2; +var ResultIsNumber2 = ++A; +var ResultIsNumber3 = ++M; +var ResultIsNumber4 = ++obj; +var ResultIsNumber5 = ++obj1; +var ResultIsNumber6 = ANY2++; +var ResultIsNumber7 = A++; +var ResultIsNumber8 = M++; +var ResultIsNumber9 = obj++; +var ResultIsNumber10 = obj1++; +var ResultIsNumber11 = ++{}; +var ResultIsNumber12 = ++null; +var ResultIsNumber13 = ++undefined; +var ResultIsNumber14 = null++; +var ResultIsNumber15 = {}++; +var ResultIsNumber16 = undefined++; +var ResultIsNumber17 = ++foo(); +var ResultIsNumber18 = ++A.foo(); +var ResultIsNumber19 = ++(null + undefined); +var ResultIsNumber20 = ++(null + null); +var ResultIsNumber21 = ++(undefined + undefined); +var ResultIsNumber22 = ++obj1.x; +var ResultIsNumber23 = ++obj1.y; +var ResultIsNumber24 = foo()++; +var ResultIsNumber25 = A.foo()++; +var ResultIsNumber26 = (null + undefined)++; +var ResultIsNumber27 = (null + null)++; +var ResultIsNumber28 = (undefined + undefined)++; +var ResultIsNumber29 = obj1.x++; +var ResultIsNumber30 = obj1.y++; +++ANY2; +ANY2++; +++ANY1++; +++ANY2++; +++ANY2[0]++; diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.js b/tests/baselines/reference/incrementOperatorWithEnumType.js new file mode 100644 index 0000000000000..34faaf2201a2d --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithEnumType.js @@ -0,0 +1,26 @@ +//// [incrementOperatorWithEnumType.ts] +// ++ operator on enum type + +enum ENUM1 { 1, 2, "" }; + +// expression +var ResultIsNumber1 = ++ENUM1[1]; +var ResultIsNumber2 = ENUM1[1]++; + +// miss assignment operator +++ENUM1[1]; + +ENUM1[1]++; + +//// [incrementOperatorWithEnumType.js] +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = ++ENUM1[1]; +var ResultIsNumber2 = ENUM1[1]++; +++ENUM1[1]; +ENUM1[1]++; diff --git a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..f226242381073 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ==== + // ++ operator on enum type + + enum ENUM { }; + enum ENUM1 { 1, 2, "" }; + + // enum type var + var ResultIsNumber1 = ++ENUM; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = ++ENUM1; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber3 = ENUM++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = ENUM1++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // enum type expressions + var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]); + ~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber6 = (ENUM[1] + ENUM[2])++; + ~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operator + ++ENUM; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++ENUM1; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ENUM++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ENUM1++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js new file mode 100644 index 0000000000000..fa6e778c23566 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.js @@ -0,0 +1,46 @@ +//// [incrementOperatorWithEnumTypeInvalidOperations.ts] +// ++ operator on enum type + +enum ENUM { }; +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsNumber1 = ++ENUM; +var ResultIsNumber2 = ++ENUM1; + +var ResultIsNumber3 = ENUM++; +var ResultIsNumber4 = ENUM1++; + +// enum type expressions +var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]); +var ResultIsNumber6 = (ENUM[1] + ENUM[2])++; + +// miss assignment operator +++ENUM; +++ENUM1; + +ENUM++; +ENUM1++; + +//// [incrementOperatorWithEnumTypeInvalidOperations.js] +var ENUM; +(function (ENUM) { +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = ++ENUM; +var ResultIsNumber2 = ++ENUM1; +var ResultIsNumber3 = ENUM++; +var ResultIsNumber4 = ENUM1++; +var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]); +var ResultIsNumber6 = (ENUM[1] + ENUM[2])++; +++ENUM; +++ENUM1; +ENUM++; +ENUM1++; diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.js b/tests/baselines/reference/incrementOperatorWithNumberType.js new file mode 100644 index 0000000000000..90c23de9adcbc --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberType.js @@ -0,0 +1,71 @@ +//// [incrementOperatorWithNumberType.ts] +// ++ operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +class A { + public a: number; +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsNumber1 = ++NUMBER; + +var ResultIsNumber2 = NUMBER++; + +// expressions +var ResultIsNumber3 = ++objA.a; +var ResultIsNumber4 = ++M.n; + +var ResultIsNumber5 = objA.a++; +var ResultIsNumber6 = M.n++; +var ResultIsNumber7 = NUMBER1[0]++; + +// miss assignment operators +++NUMBER; + +++NUMBER1[0]; +++objA.a; +++M.n; +++objA.a, M.n; + +NUMBER++; +NUMBER1[0]++; +objA.a++; +M.n++; +objA.a++, M.n++; + +//// [incrementOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +var A = (function () { + function A() { + } + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++NUMBER; +var ResultIsNumber2 = NUMBER++; +var ResultIsNumber3 = ++objA.a; +var ResultIsNumber4 = ++M.n; +var ResultIsNumber5 = objA.a++; +var ResultIsNumber6 = M.n++; +var ResultIsNumber7 = NUMBER1[0]++; +++NUMBER; +++NUMBER1[0]; +++objA.a; +++M.n; +++objA.a, M.n; +NUMBER++; +NUMBER1[0]++; +objA.a++; +M.n++; +objA.a++, M.n++; diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt new file mode 100644 index 0000000000000..be0ea1d14923b --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -0,0 +1,87 @@ +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== + // ++ operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + //number type var + var ResultIsNumber1 = ++NUMBER1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = NUMBER1++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // number type literal + var ResultIsNumber3 = ++1; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber4 = ++{ x: 1, y: 2}; + ~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = 1++; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber7 = { x: 1, y: 2 }++; + ~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // number type expressions + var ResultIsNumber9 = ++foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber10 = ++A.foo(); + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber11 = ++(NUMBER + NUMBER); + ~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + var ResultIsNumber12 = foo()++; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber13 = A.foo()++; + ~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + var ResultIsNumber14 = (NUMBER + NUMBER)++; + ~~~~~~~~~~~~~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + // miss assignment operator + ++1; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + ++NUMBER1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++foo(); + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + + 1++; + ~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. + NUMBER1++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()++; + ~~~~~ +!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js new file mode 100644 index 0000000000000..a328d49cf63c8 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.js @@ -0,0 +1,91 @@ +//// [incrementOperatorWithNumberTypeInvalidOperations.ts] +// ++ operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +//number type var +var ResultIsNumber1 = ++NUMBER1; +var ResultIsNumber2 = NUMBER1++; + +// number type literal +var ResultIsNumber3 = ++1; +var ResultIsNumber4 = ++{ x: 1, y: 2}; +var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } }; + +var ResultIsNumber6 = 1++; +var ResultIsNumber7 = { x: 1, y: 2 }++; +var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++; + +// number type expressions +var ResultIsNumber9 = ++foo(); +var ResultIsNumber10 = ++A.foo(); +var ResultIsNumber11 = ++(NUMBER + NUMBER); + +var ResultIsNumber12 = foo()++; +var ResultIsNumber13 = A.foo()++; +var ResultIsNumber14 = (NUMBER + NUMBER)++; + +// miss assignment operator +++1; +++NUMBER1; +++foo(); + +1++; +NUMBER1++; +foo()++; + +//// [incrementOperatorWithNumberTypeInvalidOperations.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++NUMBER1; +var ResultIsNumber2 = NUMBER1++; +var ResultIsNumber3 = ++1; +var ResultIsNumber4 = ++{ x: 1, y: 2 }; +var ResultIsNumber5 = ++{ x: 1, y: function (n) { + return n; +} }; +var ResultIsNumber6 = 1++; +var ResultIsNumber7 = { x: 1, y: 2 }++; +var ResultIsNumber8 = { x: 1, y: function (n) { + return n; +} }++; +var ResultIsNumber9 = ++foo(); +var ResultIsNumber10 = ++A.foo(); +var ResultIsNumber11 = ++(NUMBER + NUMBER); +var ResultIsNumber12 = foo()++; +var ResultIsNumber13 = A.foo()++; +var ResultIsNumber14 = (NUMBER + NUMBER)++; +++1; +++NUMBER1; +++foo(); +1++; +NUMBER1++; +foo()++; diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt new file mode 100644 index 0000000000000..ff51aac9af028 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt @@ -0,0 +1,113 @@ +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== + // ++ operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return true; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = ++BOOLEAN; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber2 = BOOLEAN++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // boolean type literal + var ResultIsNumber3 = ++true; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = ++{ x: true, y: false }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber6 = true++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = { x: true, y: false }++; + ~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // boolean type expressions + var ResultIsNumber9 = ++objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = ++M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber11 = ++foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = ++A.foo(); + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber13 = foo()++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber14 = A.foo()++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = objA.a++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = M.n++; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + ++true; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++BOOLEAN; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++objA.a, M.n; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + true++; + ~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + BOOLEAN++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + M.n++; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a++, M.n++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js new file mode 100644 index 0000000000000..f321ba1f2387c --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.js @@ -0,0 +1,106 @@ +//// [incrementOperatorWithUnsupportedBooleanType.ts] +// ++ operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return true; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsNumber1 = ++BOOLEAN; + +var ResultIsNumber2 = BOOLEAN++; + +// boolean type literal +var ResultIsNumber3 = ++true; +var ResultIsNumber4 = ++{ x: true, y: false }; +var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } }; + +var ResultIsNumber6 = true++; +var ResultIsNumber7 = { x: true, y: false }++; +var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++; + +// boolean type expressions +var ResultIsNumber9 = ++objA.a; +var ResultIsNumber10 = ++M.n; +var ResultIsNumber11 = ++foo(); +var ResultIsNumber12 = ++A.foo(); + +var ResultIsNumber13 = foo()++; +var ResultIsNumber14 = A.foo()++; +var ResultIsNumber15 = objA.a++; +var ResultIsNumber16 = M.n++; + +// miss assignment operators +++true; +++BOOLEAN; +++foo(); +++objA.a; +++M.n; +++objA.a, M.n; + +true++; +BOOLEAN++; +foo()++; +objA.a++; +M.n++; +objA.a++, M.n++; + +//// [incrementOperatorWithUnsupportedBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return true; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++BOOLEAN; +var ResultIsNumber2 = BOOLEAN++; +var ResultIsNumber3 = ++true; +var ResultIsNumber4 = ++{ x: true, y: false }; +var ResultIsNumber5 = ++{ x: true, y: function (n) { + return n; +} }; +var ResultIsNumber6 = true++; +var ResultIsNumber7 = { x: true, y: false }++; +var ResultIsNumber8 = { x: true, y: function (n) { + return n; +} }++; +var ResultIsNumber9 = ++objA.a; +var ResultIsNumber10 = ++M.n; +var ResultIsNumber11 = ++foo(); +var ResultIsNumber12 = ++A.foo(); +var ResultIsNumber13 = foo()++; +var ResultIsNumber14 = A.foo()++; +var ResultIsNumber15 = objA.a++; +var ResultIsNumber16 = M.n++; +++true; +++BOOLEAN; +++foo(); +++objA.a; +++M.n; +++objA.a, M.n; +true++; +BOOLEAN++; +foo()++; +objA.a++; +M.n++; +objA.a++, M.n++; diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt new file mode 100644 index 0000000000000..3449108faa41e --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt @@ -0,0 +1,144 @@ +==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithUnsupportedStringType.ts (39 errors) ==== + // ++ operator on string type + var STRING: string; + var STRING1: string[] = ["", ""]; + + function foo(): string { return ""; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = ++STRING; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber2 = ++STRING1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber3 = STRING++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber4 = STRING1++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // string type literal + var ResultIsNumber5 = ++""; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber6 = ++{ x: "", y: "" }; + ~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber8 = ""++; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber9 = { x: "", y: "" }++; + ~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // string type expressions + var ResultIsNumber11 = ++objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber12 = ++M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber13 = ++STRING1[0]; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber14 = ++foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber15 = ++A.foo(); + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber16 = ++(STRING + STRING); + ~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + var ResultIsNumber17 = objA.a++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber18 = M.n++; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber19 = STRING1[0]++; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber20 = foo()++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber21 = A.foo()++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + var ResultIsNumber22 = (STRING + STRING)++; + ~~~~~~~~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + // miss assignment operators + ++""; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++STRING; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++STRING1; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++STRING1[0]; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++foo(); + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++objA.a; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++M.n; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ++objA.a, M.n; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + + ""++; + ~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING1++; + ~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + STRING1[0]++; + ~~~~~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + foo()++; + ~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + M.n++; + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + objA.a++, M.n++; + ~~~~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. + ~~~ +!!! An arithmetic operand must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js new file mode 100644 index 0000000000000..1e426c964a124 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.js @@ -0,0 +1,128 @@ +//// [incrementOperatorWithUnsupportedStringType.ts] +// ++ operator on string type +var STRING: string; +var STRING1: string[] = ["", ""]; + +function foo(): string { return ""; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsNumber1 = ++STRING; +var ResultIsNumber2 = ++STRING1; + +var ResultIsNumber3 = STRING++; +var ResultIsNumber4 = STRING1++; + +// string type literal +var ResultIsNumber5 = ++""; +var ResultIsNumber6 = ++{ x: "", y: "" }; +var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } }; + +var ResultIsNumber8 = ""++; +var ResultIsNumber9 = { x: "", y: "" }++; +var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++; + +// string type expressions +var ResultIsNumber11 = ++objA.a; +var ResultIsNumber12 = ++M.n; +var ResultIsNumber13 = ++STRING1[0]; +var ResultIsNumber14 = ++foo(); +var ResultIsNumber15 = ++A.foo(); +var ResultIsNumber16 = ++(STRING + STRING); + +var ResultIsNumber17 = objA.a++; +var ResultIsNumber18 = M.n++; +var ResultIsNumber19 = STRING1[0]++; +var ResultIsNumber20 = foo()++; +var ResultIsNumber21 = A.foo()++; +var ResultIsNumber22 = (STRING + STRING)++; + +// miss assignment operators +++""; +++STRING; +++STRING1; +++STRING1[0]; +++foo(); +++objA.a; +++M.n; +++objA.a, M.n; + +""++; +STRING++; +STRING1++; +STRING1[0]++; +foo()++; +objA.a++; +M.n++; +objA.a++, M.n++; + +//// [incrementOperatorWithUnsupportedStringType.js] +var STRING; +var STRING1 = ["", ""]; +function foo() { + return ""; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = ++STRING; +var ResultIsNumber2 = ++STRING1; +var ResultIsNumber3 = STRING++; +var ResultIsNumber4 = STRING1++; +var ResultIsNumber5 = ++""; +var ResultIsNumber6 = ++{ x: "", y: "" }; +var ResultIsNumber7 = ++{ x: "", y: function (s) { + return s; +} }; +var ResultIsNumber8 = ""++; +var ResultIsNumber9 = { x: "", y: "" }++; +var ResultIsNumber10 = { x: "", y: function (s) { + return s; +} }++; +var ResultIsNumber11 = ++objA.a; +var ResultIsNumber12 = ++M.n; +var ResultIsNumber13 = ++STRING1[0]; +var ResultIsNumber14 = ++foo(); +var ResultIsNumber15 = ++A.foo(); +var ResultIsNumber16 = ++(STRING + STRING); +var ResultIsNumber17 = objA.a++; +var ResultIsNumber18 = M.n++; +var ResultIsNumber19 = STRING1[0]++; +var ResultIsNumber20 = foo()++; +var ResultIsNumber21 = A.foo()++; +var ResultIsNumber22 = (STRING + STRING)++; +++""; +++STRING; +++STRING1; +++STRING1[0]; +++foo(); +++objA.a; +++M.n; +++objA.a, M.n; +""++; +STRING++; +STRING1++; +STRING1[0]++; +foo()++; +objA.a++; +M.n++; +objA.a++, M.n++; diff --git a/tests/baselines/reference/indexClassByNumber.js b/tests/baselines/reference/indexClassByNumber.js new file mode 100644 index 0000000000000..7f4e7ab64d780 --- /dev/null +++ b/tests/baselines/reference/indexClassByNumber.js @@ -0,0 +1,17 @@ +//// [indexClassByNumber.ts] +// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature) + +class foo { } + +var f = new foo(); + +f[0] = 4; // Shouldn't be allowed + +//// [indexClassByNumber.js] +var foo = (function () { + function foo() { + } + return foo; +})(); +var f = new foo(); +f[0] = 4; diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt new file mode 100644 index 0000000000000..83919640f7ac9 --- /dev/null +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== + interface Foo2 extends Array { } + var x2: Foo2; + var r = x2[0]; // string + r = 0; //error + ~ +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexIntoArraySubclass.js b/tests/baselines/reference/indexIntoArraySubclass.js new file mode 100644 index 0000000000000..051ec813465c1 --- /dev/null +++ b/tests/baselines/reference/indexIntoArraySubclass.js @@ -0,0 +1,10 @@ +//// [indexIntoArraySubclass.ts] +interface Foo2 extends Array { } +var x2: Foo2; +var r = x2[0]; // string +r = 0; //error + +//// [indexIntoArraySubclass.js] +var x2; +var r = x2[0]; +r = 0; diff --git a/tests/baselines/reference/indexIntoEnum.js b/tests/baselines/reference/indexIntoEnum.js new file mode 100644 index 0000000000000..bfc771975f39b --- /dev/null +++ b/tests/baselines/reference/indexIntoEnum.js @@ -0,0 +1,16 @@ +//// [indexIntoEnum.ts] +module M { + + enum E { } + + var x = E[0]; +} + +//// [indexIntoEnum.js] +var M; +(function (M) { + var E; + (function (E) { + })(E || (E = {})); + var x = E[0]; +})(M || (M = {})); diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..d0aec71ef1587 --- /dev/null +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (4 errors) ==== + interface I { + [x]: string; + ~ +!!! An index signature parameter must have a type annotation. + [x: string]; + ~~~~~~~~~~~ +!!! An index signature must have a type annotation. + } + + class C { + [x]: string + ~ +!!! An index signature parameter must have a type annotation. + + } + + class C2 { + [x: string] + ~~~~~~~~~~~ +!!! An index signature must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeCheck.errors.txt b/tests/baselines/reference/indexSignatureTypeCheck.errors.txt new file mode 100644 index 0000000000000..0c808feecbf20 --- /dev/null +++ b/tests/baselines/reference/indexSignatureTypeCheck.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/indexSignatureTypeCheck.ts (4 errors) ==== + interface IPropertySet { + + [index: string]: any; + + } + + + var ps: IPropertySet = null; + var index: any = "hello"; + ps[index] = 12; + + + interface indexErrors { + [p2?: string]; + ~~ +!!! An index signature parameter cannot have a question mark. + [...p3: any[]]; + ~~ +!!! An index signature cannot have a rest parameter. + [p4: string, p5?: string]; + ~~ +!!! An index signature must have exactly one parameter. + [p6: string, ...p7: any[]]; + ~~ +!!! An index signature must have exactly one parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt b/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt new file mode 100644 index 0000000000000..88a004e0b37cc --- /dev/null +++ b/tests/baselines/reference/indexSignatureTypeCheck2.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/indexSignatureTypeCheck2.ts (4 errors) ==== + class IPropertySet { + [index: string]: any + } + + var ps: IPropertySet = null; + var index: any = "hello"; + ps[index] = 12; + + interface indexErrors { + [p2?: string]; + ~~ +!!! An index signature parameter cannot have a question mark. + [...p3: any[]]; + ~~ +!!! An index signature cannot have a rest parameter. + [p4: string, p5?: string]; + ~~ +!!! An index signature must have exactly one parameter. + [p6: string, ...p7: any[]]; + ~~ +!!! An index signature must have exactly one parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt new file mode 100644 index 0000000000000..0b857a8df05ca --- /dev/null +++ b/tests/baselines/reference/indexSignatureWithAccessibilityModifier.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/indexSignatureWithAccessibilityModifier.ts (4 errors) ==== + interface I { + [public x: string]: string; + ~ +!!! An index signature parameter cannot have an accessibility modifier. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + + class C { + [public x: string]: string + ~ +!!! An index signature parameter cannot have an accessibility modifier. + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignatureWithInitializer.errors.txt b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt new file mode 100644 index 0000000000000..c82a2103e6671 --- /dev/null +++ b/tests/baselines/reference/indexSignatureWithInitializer.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/indexSignatureWithInitializer.ts (4 errors) ==== + interface I { + [x = '']: string; + ~ +!!! An index signature parameter cannot have an initializer. + ~~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } + + class C { + [x = 0]: string + ~ +!!! An index signature parameter cannot have an initializer. + ~~~~~ +!!! A parameter initializer is only allowed in a function or constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.js b/tests/baselines/reference/indexSignaturesInferentialTyping.js new file mode 100644 index 0000000000000..c9cc7293a1af7 --- /dev/null +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.js @@ -0,0 +1,21 @@ +//// [indexSignaturesInferentialTyping.ts] +function foo(items: { [index: number]: T }): T { return undefined; } +function bar(items: { [index: string]: T }): T { return undefined; } + +var x1 = foo({ 0: 0, 1: 1 }); // type should be number +var x2 = foo({ zero: 0, one: 1 }); +var x3 = bar({ 0: 0, 1: 1 }); +var x4 = bar({ zero: 0, one: 1 }); // type should be number + + +//// [indexSignaturesInferentialTyping.js] +function foo(items) { + return undefined; +} +function bar(items) { + return undefined; +} +var x1 = foo({ 0: 0, 1: 1 }); +var x2 = foo({ zero: 0, one: 1 }); +var x3 = bar({ 0: 0, 1: 1 }); +var x4 = bar({ zero: 0, one: 1 }); diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt new file mode 100644 index 0000000000000..d5a9fab9d6294 --- /dev/null +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -0,0 +1,80 @@ +==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ==== + interface Red { + [n:number]; // ok + ~~~~~~~~~~ +!!! An index signature must have a type annotation. + [s:string]; // ok + ~~~~~~~~~~ +!!! An index signature must have a type annotation. + } + + interface Blue { + [n:number]: any; // ok + [s:string]: any; // ok + } + + interface Yellow { + [n:number]: Red; // ok + [s:string]: Red; // ok + } + + interface Orange { + [n:number]: number; // ok + ~~~~~~~~~~~~~~~~~~~ +!!! Numeric index type 'number' is not assignable to string index type 'string'. + [s:string]: string; // error + } + + interface Green { + [n:number]: Orange; // error + ~~~~~~~~~~~~~~~~~~~ +!!! Numeric index type 'Orange' is not assignable to string index type 'Yellow'. + [s:string]: Yellow; // ok + } + + interface Cyan { + [n:number]: number; // error + ~~~~~~~~~~~~~~~~~~~ +!!! Numeric index type 'number' is not assignable to string index type 'string'. + [s:string]: string; // ok + } + + interface Purple { + [n:number, s:string]; // error + ~ +!!! An index signature must have exactly one parameter. + } + + interface Magenta { + [p:Purple]; // error + ~ +!!! An index signature parameter type must be 'string' or 'number'. + } + + var yellow: Yellow; + var blue: Blue; + var s = "some string"; + + yellow[5]; // ok + yellow["hue"]; // ok + yellow[{}]; // ok + + s[0]; // error + s["s"]; // ok + s[{}]; // ok + + yellow[blue]; // error + ~~~~~~~~~~~~ +!!! An index expression argument must be of type 'string', 'number', or 'any'. + + var x:number[]; + x[0]; + + class Benchmark { + + public results: { [x:string]: any; } = <{ [x:string]: any; }>{}; + + public addTimingFor(name: string, timing: number) { + this.results[name] = this.results[name]; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/indexWithoutParamType.errors.txt b/tests/baselines/reference/indexWithoutParamType.errors.txt new file mode 100644 index 0000000000000..0fc4f4c094f1c --- /dev/null +++ b/tests/baselines/reference/indexWithoutParamType.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/indexWithoutParamType.ts (1 errors) ==== + var y: { []; } // Error + ~~ +!!! An index signature must have exactly one parameter. \ No newline at end of file diff --git a/tests/baselines/reference/indexWithoutParamType2.errors.txt b/tests/baselines/reference/indexWithoutParamType2.errors.txt new file mode 100644 index 0000000000000..50cdb50379e5d --- /dev/null +++ b/tests/baselines/reference/indexWithoutParamType2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/indexWithoutParamType2.ts (1 errors) ==== + class C { + [x]: string + ~ +!!! An index signature parameter must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexer.js b/tests/baselines/reference/indexer.js new file mode 100644 index 0000000000000..97e734a029fab --- /dev/null +++ b/tests/baselines/reference/indexer.js @@ -0,0 +1,15 @@ +//// [indexer.ts] +interface JQueryElement { + id:string; +} + +interface JQuery { + [n:number]:JQueryElement; +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +jq[0].id; + +//// [indexer.js] +var jq = { 0: { id: "a" }, 1: { id: "b" } }; +jq[0].id; diff --git a/tests/baselines/reference/indexer2.js b/tests/baselines/reference/indexer2.js new file mode 100644 index 0000000000000..96c66688a9102 --- /dev/null +++ b/tests/baselines/reference/indexer2.js @@ -0,0 +1,10 @@ +//// [indexer2.ts] +interface IHeapObjectProperty {} +interface IDirectChildrenMap { + hasOwnProperty(objectId: number) : boolean; + [objectId: number] : IHeapObjectProperty[]; +} +var directChildrenMap = {}; + +//// [indexer2.js] +var directChildrenMap = {}; diff --git a/tests/baselines/reference/indexer2A.errors.txt b/tests/baselines/reference/indexer2A.errors.txt new file mode 100644 index 0000000000000..f1b7f6bb23f06 --- /dev/null +++ b/tests/baselines/reference/indexer2A.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/indexer2A.ts (1 errors) ==== + class IHeapObjectProperty { } + class IDirectChildrenMap { + // Decided to enforce a semicolon after declarations + hasOwnProperty(objectId: number): boolean + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + [objectId: number]: IHeapObjectProperty[] + } + var directChildrenMap = {}; \ No newline at end of file diff --git a/tests/baselines/reference/indexer2A.js b/tests/baselines/reference/indexer2A.js new file mode 100644 index 0000000000000..867c30205ae75 --- /dev/null +++ b/tests/baselines/reference/indexer2A.js @@ -0,0 +1,21 @@ +//// [indexer2A.ts] +class IHeapObjectProperty { } +class IDirectChildrenMap { + // Decided to enforce a semicolon after declarations + hasOwnProperty(objectId: number): boolean + [objectId: number]: IHeapObjectProperty[] +} +var directChildrenMap = {}; + +//// [indexer2A.js] +var IHeapObjectProperty = (function () { + function IHeapObjectProperty() { + } + return IHeapObjectProperty; +})(); +var IDirectChildrenMap = (function () { + function IDirectChildrenMap() { + } + return IDirectChildrenMap; +})(); +var directChildrenMap = {}; diff --git a/tests/baselines/reference/indexer3.js b/tests/baselines/reference/indexer3.js new file mode 100644 index 0000000000000..85637e2ef2000 --- /dev/null +++ b/tests/baselines/reference/indexer3.js @@ -0,0 +1,7 @@ +//// [indexer3.ts] +var dateMap: { [x: string]: Date; } = {} +var r: Date = dateMap["hello"] // result type includes indexer using BCT + +//// [indexer3.js] +var dateMap = {}; +var r = dateMap["hello"]; diff --git a/tests/baselines/reference/indexerA.js b/tests/baselines/reference/indexerA.js new file mode 100644 index 0000000000000..5216026f714d0 --- /dev/null +++ b/tests/baselines/reference/indexerA.js @@ -0,0 +1,25 @@ +//// [indexerA.ts] +class JQueryElement { + id:string; +} + +class JQuery { + [n:number]:JQueryElement +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +jq[0].id; + +//// [indexerA.js] +var JQueryElement = (function () { + function JQueryElement() { + } + return JQueryElement; +})(); +var JQuery = (function () { + function JQuery() { + } + return JQuery; +})(); +var jq = { 0: { id: "a" }, 1: { id: "b" } }; +jq[0].id; diff --git a/tests/baselines/reference/indexerAsOptional.errors.txt b/tests/baselines/reference/indexerAsOptional.errors.txt new file mode 100644 index 0000000000000..c76a479193661 --- /dev/null +++ b/tests/baselines/reference/indexerAsOptional.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/indexerAsOptional.ts (2 errors) ==== + interface indexSig { + //Index signatures can't be optional + [idx?: number]: any; //err + ~~~ +!!! An index signature parameter cannot have a question mark. + } + + class indexSig2 { + //Index signatures can't be optional + [idx?: number]: any //err + ~~~ +!!! An index signature parameter cannot have a question mark. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt new file mode 100644 index 0000000000000..b7dca06f20793 --- /dev/null +++ b/tests/baselines/reference/indexerAssignability.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/indexerAssignability.ts (3 errors) ==== + var a: { [s: string]: string; }; + var b: { [n: number]: string; }; + var c: {}; + + a = b; + ~ +!!! Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': +!!! Index signature is missing in type '{ [x: number]: string; }'. + a = c; + ~ +!!! Type '{}' is not assignable to type '{ [x: string]: string; }': +!!! Index signature is missing in type '{}'. + b = a; + b = c; + ~ +!!! Type '{}' is not assignable to type '{ [x: number]: string; }': +!!! Index signature is missing in type '{}'. + c = a; + c = b; \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.js b/tests/baselines/reference/indexerAssignability.js new file mode 100644 index 0000000000000..808ecd4c4a6c3 --- /dev/null +++ b/tests/baselines/reference/indexerAssignability.js @@ -0,0 +1,22 @@ +//// [indexerAssignability.ts] +var a: { [s: string]: string; }; +var b: { [n: number]: string; }; +var c: {}; + +a = b; +a = c; +b = a; +b = c; +c = a; +c = b; + +//// [indexerAssignability.js] +var a; +var b; +var c; +a = b; +a = c; +b = a; +b = c; +c = a; +c = b; diff --git a/tests/baselines/reference/indexerConstraints.errors.txt b/tests/baselines/reference/indexerConstraints.errors.txt new file mode 100644 index 0000000000000..ff0a75e0b7f26 --- /dev/null +++ b/tests/baselines/reference/indexerConstraints.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/indexerConstraints.ts (4 errors) ==== + interface A { a: number; } + interface B extends A { b: number; } + + // Good case + interface D { + [s: string]: A; + } + interface D { + [n: number]: B; + } + + // Bad case + interface E { + [s: string]: B; + } + interface E { + [n: number]: A; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + } + + // Inheritance + interface F { + [s: string]: B; + } + interface G extends F { + [n: number]: A; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + } + + // Other way + interface H { + [n: number]: A; + } + interface I extends H { + [s: string]: B; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + } + + // With hidden indexer + interface J { + [n: number]: {}; + } + interface K extends J { + [n: number]: A; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + [s: string]: B; + } \ No newline at end of file diff --git a/tests/baselines/reference/indexerConstraints.js b/tests/baselines/reference/indexerConstraints.js new file mode 100644 index 0000000000000..d101dcb930533 --- /dev/null +++ b/tests/baselines/reference/indexerConstraints.js @@ -0,0 +1,46 @@ +//// [indexerConstraints.ts] +interface A { a: number; } +interface B extends A { b: number; } + +// Good case +interface D { + [s: string]: A; +} +interface D { + [n: number]: B; +} + +// Bad case +interface E { + [s: string]: B; +} +interface E { + [n: number]: A; +} + +// Inheritance +interface F { + [s: string]: B; +} +interface G extends F { + [n: number]: A; +} + +// Other way +interface H { + [n: number]: A; +} +interface I extends H { + [s: string]: B; +} + +// With hidden indexer +interface J { + [n: number]: {}; +} +interface K extends J { + [n: number]: A; + [s: string]: B; +} + +//// [indexerConstraints.js] diff --git a/tests/baselines/reference/indexerConstraints2.errors.txt b/tests/baselines/reference/indexerConstraints2.errors.txt new file mode 100644 index 0000000000000..39f16a1b2007a --- /dev/null +++ b/tests/baselines/reference/indexerConstraints2.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/indexerConstraints2.ts (3 errors) ==== + class A { a: number; } + class B extends A { b: number; } + + // Inheritance + class F { + [s: string]: B + } + class G extends F { + [n: number]: A + ~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + } + + // Other way + class H { + [n: number]: A + } + class I extends H { + [s: string]: B + ~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + } + + // With hidden indexer + class J { + [n: number]: {} + } + + class K extends J { + [n: number]: A; + ~~~~~~~~~~~~~~~ +!!! Numeric index type 'A' is not assignable to string index type 'B'. + [s: string]: B; + } \ No newline at end of file diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js new file mode 100644 index 0000000000000..33bd7eb96120f --- /dev/null +++ b/tests/baselines/reference/indexerConstraints2.js @@ -0,0 +1,85 @@ +//// [indexerConstraints2.ts] +class A { a: number; } +class B extends A { b: number; } + +// Inheritance +class F { + [s: string]: B +} +class G extends F { + [n: number]: A +} + +// Other way +class H { + [n: number]: A +} +class I extends H { + [s: string]: B +} + +// With hidden indexer +class J { + [n: number]: {} +} + +class K extends J { + [n: number]: A; + [s: string]: B; +} + +//// [indexerConstraints2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var F = (function () { + function F() { + } + return F; +})(); +var G = (function (_super) { + __extends(G, _super); + function G() { + _super.apply(this, arguments); + } + return G; +})(F); +var H = (function () { + function H() { + } + return H; +})(); +var I = (function (_super) { + __extends(I, _super); + function I() { + _super.apply(this, arguments); + } + return I; +})(H); +var J = (function () { + function J() { + } + return J; +})(); +var K = (function (_super) { + __extends(K, _super); + function K() { + _super.apply(this, arguments); + } + return K; +})(J); diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.js b/tests/baselines/reference/indexerReturningTypeParameter1.js new file mode 100644 index 0000000000000..a4a385ff056ca --- /dev/null +++ b/tests/baselines/reference/indexerReturningTypeParameter1.js @@ -0,0 +1,28 @@ +//// [indexerReturningTypeParameter1.ts] +interface f { + groupBy(): { [key: string]: T[]; }; +} +var a: f; +var r = a.groupBy(); + +class c { + groupBy(): { [key: string]: T[]; } { + return null; + } +} +var a2: c; +var r2 = a2.groupBy(); + +//// [indexerReturningTypeParameter1.js] +var a; +var r = a.groupBy(); +var c = (function () { + function c() { + } + c.prototype.groupBy = function () { + return null; + }; + return c; +})(); +var a2; +var r2 = a2.groupBy(); diff --git a/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt b/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt new file mode 100644 index 0000000000000..d97a4d2a19dbd --- /dev/null +++ b/tests/baselines/reference/indexerSignatureWithRestParam.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/indexerSignatureWithRestParam.ts (2 errors) ==== + interface I { + [...x]: string; + ~ +!!! An index signature cannot have a rest parameter. + } + + class C { + [...x]: string + ~ +!!! An index signature cannot have a rest parameter. + } \ No newline at end of file diff --git a/tests/baselines/reference/indexersInClassType.js b/tests/baselines/reference/indexersInClassType.js new file mode 100644 index 0000000000000..d8f336539535b --- /dev/null +++ b/tests/baselines/reference/indexersInClassType.js @@ -0,0 +1,32 @@ +//// [indexersInClassType.ts] +class C { + [x: number]: Date; + [x: string]: Object; + 1: Date; + 'a': {} + + fn() { + return this; + } +} + +var c = new C(); +var r = c.fn(); +var r2 = r[1]; +var r3 = r.a + + + +//// [indexersInClassType.js] +var C = (function () { + function C() { + } + C.prototype.fn = function () { + return this; + }; + return C; +})(); +var c = new C(); +var r = c.fn(); +var r2 = r[1]; +var r3 = r.a; diff --git a/tests/baselines/reference/indirectSelfReference.errors.txt b/tests/baselines/reference/indirectSelfReference.errors.txt new file mode 100644 index 0000000000000..9746e4c0c45d4 --- /dev/null +++ b/tests/baselines/reference/indirectSelfReference.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/indirectSelfReference.ts (1 errors) ==== + class a extends b{ } + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'a' recursively references itself as a base type. + class b extends a{ } \ No newline at end of file diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js new file mode 100644 index 0000000000000..eb5503c4db9e7 --- /dev/null +++ b/tests/baselines/reference/indirectSelfReference.js @@ -0,0 +1,25 @@ +//// [indirectSelfReference.ts] +class a extends b{ } +class b extends a{ } + +//// [indirectSelfReference.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function (_super) { + __extends(a, _super); + function a() { + _super.apply(this, arguments); + } + return a; +})(b); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt new file mode 100644 index 0000000000000..df70ebc22080b --- /dev/null +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/indirectSelfReferenceGeneric.ts (1 errors) ==== + class a extends b { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'a' recursively references itself as a base type. + class b extends a { } \ No newline at end of file diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js new file mode 100644 index 0000000000000..eb861bcf2943f --- /dev/null +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -0,0 +1,25 @@ +//// [indirectSelfReferenceGeneric.ts] +class a extends b { } +class b extends a { } + +//// [indirectSelfReferenceGeneric.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function (_super) { + __extends(a, _super); + function a() { + _super.apply(this, arguments); + } + return a; +})(b); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inferSecondaryParameter.js b/tests/baselines/reference/inferSecondaryParameter.js new file mode 100644 index 0000000000000..a94b83e324498 --- /dev/null +++ b/tests/baselines/reference/inferSecondaryParameter.js @@ -0,0 +1,17 @@ +//// [inferSecondaryParameter.ts] +// type inference on 'bug' should give 'any' + +interface Ib { m(test: string, fn: Function); } + +var b: Ib = { m: function (test: string, fn: Function) { } }; + +b.m("test", function (bug) { + var a: number = bug; +}); + +//// [inferSecondaryParameter.js] +var b = { m: function (test, fn) { +} }; +b.m("test", function (bug) { + var a = bug; +}); diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt new file mode 100644 index 0000000000000..5c8a590e6209d --- /dev/null +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/inferSetterParamType.ts (5 errors) ==== + class Foo { + + get bar() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 0; + } + set bar(n) { // should not be an error - infer number + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class Foo2 { + + get bar() { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 0; // should be an error - can't coerce infered return type to match setter annotated type + ~ +!!! Type 'number' is not assignable to type 'string'. + } + set bar(n:string) { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js new file mode 100644 index 0000000000000..1b7ab4f08435d --- /dev/null +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.js @@ -0,0 +1,39 @@ +//// [inferTypeArgumentsInSignatureWithRestParameters.ts] +function f(array: T[], ...args) { } +function g(array: number[], ...args) { } +function h(nonarray: T, ...args) { } +function i(array: T[], opt?: any[]) { } +var a = [1, 2, 3, 4, 5]; + +f(a); // OK +g(a); // OK +h(a); // OK +i(a); // OK + + +//// [inferTypeArgumentsInSignatureWithRestParameters.js] +function f(array) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } +} +function g(array) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } +} +function h(nonarray) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } +} +function i(array, opt) { +} +var a = [1, 2, 3, 4, 5]; +f(a); +g(a); +h(a); +i(a); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.js b/tests/baselines/reference/inferentialTypingWithFunctionType.js new file mode 100644 index 0000000000000..d0282dc93bc12 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.js @@ -0,0 +1,8 @@ +//// [inferentialTypingWithFunctionType.ts] +declare function map(x: T, f: (s: T) => U): U; +declare function identity(y: V): V; + +var s = map("", identity); + +//// [inferentialTypingWithFunctionType.js] +var s = map("", identity); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.js b/tests/baselines/reference/inferentialTypingWithFunctionType2.js new file mode 100644 index 0000000000000..a3215a19e2517 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.js @@ -0,0 +1,11 @@ +//// [inferentialTypingWithFunctionType2.ts] +function identity(a: A): A { + return a; +} +var x = [1, 2, 3].map(identity)[0]; + +//// [inferentialTypingWithFunctionType2.js] +function identity(a) { + return a; +} +var x = [1, 2, 3].map(identity)[0]; diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js new file mode 100644 index 0000000000000..6b6a47405ad3e --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.js @@ -0,0 +1,10 @@ +//// [inferentialTypingWithFunctionTypeNested.ts] +declare function map(x: T, f: () => { x: (s: T) => U }): U; +declare function identity(y: V): V; + +var s = map("", () => { return { x: identity }; }); + +//// [inferentialTypingWithFunctionTypeNested.js] +var s = map("", function () { + return { x: identity }; +}); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js new file mode 100644 index 0000000000000..1894150ac278d --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js @@ -0,0 +1,48 @@ +//// [inferentialTypingWithFunctionTypeSyntacticScenarios.ts] +declare function map(array: T, func: (x: T) => U): U; +declare function identity(y: V): V; +var s: string; + +// dotted name +var dottedIdentity = { x: identity }; +s = map("", dottedIdentity.x); + +// index expression +s = map("", dottedIdentity['x']); + +// function call +s = map("", (() => identity)()); + +// construct +interface IdentityConstructor { + new (): typeof identity; +} +var ic: IdentityConstructor; +s = map("", new ic()); + +// assignment +var t; +s = map("", t = identity); + +// type assertion +s = map("", identity); + +// parenthesized expression +s = map("", (identity)); + +// comma +s = map("", ("", identity)); + +//// [inferentialTypingWithFunctionTypeSyntacticScenarios.js] +var s; +var dottedIdentity = { x: identity }; +s = map("", dottedIdentity.x); +s = map("", dottedIdentity['x']); +s = map("", (function () { return identity; })()); +var ic; +s = map("", new ic()); +var t; +s = map("", t = identity); +s = map("", identity); +s = map("", (identity)); +s = map("", ("", identity)); diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js new file mode 100644 index 0000000000000..e3150d457c1c1 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js @@ -0,0 +1,11 @@ +//// [inferentialTypingWithFunctionTypeZip.ts] +var pair: (x: T) => (y: S) => { x: T; y: S; } +var zipWith: (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]; +var result = zipWith([1, 2], ['a', 'b'], pair); +var i = result[0].x; // number + +//// [inferentialTypingWithFunctionTypeZip.js] +var pair; +var zipWith; +var result = zipWith([1, 2], ['a', 'b'], pair); +var i = result[0].x; diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt new file mode 100644 index 0000000000000..8644e8b3e0b7c --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts (2 errors) ==== + function f(x: T, y: T): T { + return x; + } + f({ x: [null] }, { x: [1] }).x[0] = "" // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js new file mode 100644 index 0000000000000..970a3f72962b8 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.js @@ -0,0 +1,14 @@ +//// [inferentialTypingWithObjectLiteralProperties.ts] +function f(x: T, y: T): T { +return x; +} +f({ x: [null] }, { x: [1] }).x[0] = "" // ok +f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. + + +//// [inferentialTypingWithObjectLiteralProperties.js] +function f(x, y) { + return x; +} +f({ x: [null] }, { x: [1] }).x[0] = ""; +f({ x: [1] }, { x: [null] }).x[0] = ""; diff --git a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.js b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.js new file mode 100644 index 0000000000000..0db5f7f2fe33e --- /dev/null +++ b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.js @@ -0,0 +1,21 @@ +//// [inferentiallyTypingAnEmptyArray.ts] +// April 2014, Section 4.6: +// In the absence of a contextual type, the type of an array literal is C[], where C is the +// Undefined type(section 3.2.6) if the array literal is empty, or the best common type of +// the element expressions if the array literal is not empty. +// When an array literal is contextually typed(section 4.19) by an object type containing a +// numeric index signature of type T, each element expression is contextually typed by T and +// the type of the array literal is the best common type of T and the types of the element +// expressions. +// +// While the spec does not say it, an inferential type causes an empty array literal to have +// the undefined[] type. In other words, the first clause from the excerpt above applies even +// though there is a "contextual type" present. This is the intention, even though the spec +// seems to imply the contrary. +// Therefore, the following access to bar should not cause an error because we infer +// the undefined[] type. +declare function foo(arr: T[]): T; +foo([]).bar; + +//// [inferentiallyTypingAnEmptyArray.js] +foo([]).bar; diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt new file mode 100644 index 0000000000000..d1afdb17f44fd --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== + function foo() { + ~~~~~~~~~~~~~~~~ + if (true) { + ~~~~~~~~~~~~~~~ + return 42; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + else { + ~~~~~~~~~~ + return "42"; + ~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + }; + ~ +!!! No best common type exists among return expressions. + \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js new file mode 100644 index 0000000000000..ba528d4c133eb --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.js @@ -0,0 +1,21 @@ +//// [inferredFunctionReturnTypeIsEmptyType.ts] +function foo() { + if (true) { + return 42; + } + else { + return "42"; + } +}; + + +//// [inferredFunctionReturnTypeIsEmptyType.js] +function foo() { + if (true) { + return 42; + } + else { + return "42"; + } +} +; diff --git a/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.js b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.js new file mode 100644 index 0000000000000..2736d4ddfc6fc --- /dev/null +++ b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.js @@ -0,0 +1,13 @@ +//// [infiniteExpandingTypeThroughInheritanceInstantiation.ts] +interface A +{ + x: A> +} + +interface B extends A // error +{ + x: B> +} + + +//// [infiniteExpandingTypeThroughInheritanceInstantiation.js] diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt new file mode 100644 index 0000000000000..577913c10e972 --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts (2 errors) ==== + // instantiating a derived type can cause an infinitely expanding type reference to be generated + + interface List { + data: T; + next: List; + owner: OwnerList; + } + + // will have an owner property that is an infinitely expanding type reference + interface OwnerList extends List> { + name: string; + } + + var list: List; + var ownerList: OwnerList; + list = ownerList; + ~~~~ +!!! Type 'OwnerList' is not assignable to type 'List': +!!! Types of property 'data' are incompatible: +!!! Type 'List' is not assignable to type 'string'. + + function other(x: T) { + var list: List; + var ownerList: OwnerList; + list = ownerList; + ~~~~ +!!! Type 'OwnerList' is not assignable to type 'List': +!!! Types of property 'data' are incompatible: +!!! Type 'List' is not assignable to type 'T'. + + } + \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.js b/tests/baselines/reference/infiniteExpansionThroughInstantiation.js new file mode 100644 index 0000000000000..8f6efb4e616e6 --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.js @@ -0,0 +1,35 @@ +//// [infiniteExpansionThroughInstantiation.ts] +// instantiating a derived type can cause an infinitely expanding type reference to be generated + +interface List { + data: T; + next: List; + owner: OwnerList; +} + +// will have an owner property that is an infinitely expanding type reference +interface OwnerList extends List> { + name: string; +} + +var list: List; +var ownerList: OwnerList; +list = ownerList; + +function other(x: T) { + var list: List; + var ownerList: OwnerList; + list = ownerList; + +} + + +//// [infiniteExpansionThroughInstantiation.js] +var list; +var ownerList; +list = ownerList; +function other(x) { + var list; + var ownerList; + list = ownerList; +} diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt new file mode 100644 index 0000000000000..958adf5d31258 --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts (1 errors) ==== + // instantiating a derived type can cause an infinitely expanding type reference to be generated + // which could be used in an assignment check for constraint satisfaction + + interface AA> // now an error due to referencing type parameter in constraint + ~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + { + x: T + } + + interface BB extends AA> + { + } \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.js b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.js new file mode 100644 index 0000000000000..e0615a78a7a0d --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.js @@ -0,0 +1,14 @@ +//// [infiniteExpansionThroughInstantiation2.ts] +// instantiating a derived type can cause an infinitely expanding type reference to be generated +// which could be used in an assignment check for constraint satisfaction + +interface AA> // now an error due to referencing type parameter in constraint +{ + x: T +} + +interface BB extends AA> +{ +} + +//// [infiniteExpansionThroughInstantiation2.js] diff --git a/tests/baselines/reference/infiniteExpansionThroughTypeInference.js b/tests/baselines/reference/infiniteExpansionThroughTypeInference.js new file mode 100644 index 0000000000000..269a4282f53fd --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughTypeInference.js @@ -0,0 +1,16 @@ +//// [infiniteExpansionThroughTypeInference.ts] +interface G { + x: G> // infinitely expanding type reference + y: T +} + +function ff(g: G): void { + ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely +} + + + +//// [infiniteExpansionThroughTypeInference.js] +function ff(g) { + ff(g); +} diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes1.js b/tests/baselines/reference/infinitelyExpandingBaseTypes1.js new file mode 100644 index 0000000000000..3451b9ef786b4 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes1.js @@ -0,0 +1,17 @@ +//// [infinitelyExpandingBaseTypes1.ts] +interface A +{ + x : A> +} + +interface B +{ + x : B +} + +interface C extends A, B { } + + + + +//// [infinitelyExpandingBaseTypes1.js] diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes2.js b/tests/baselines/reference/infinitelyExpandingBaseTypes2.js new file mode 100644 index 0000000000000..0e9921f62abc5 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes2.js @@ -0,0 +1,18 @@ +//// [infinitelyExpandingBaseTypes2.ts] +interface A +{ + x : A<()=>T> +} + +interface B +{ + x : B<()=>T> +} + +var a: A +var b: B = a + + +//// [infinitelyExpandingBaseTypes2.js] +var a; +var b = a; diff --git a/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt b/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt new file mode 100644 index 0000000000000..fb3893d9c2a88 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingOverloads.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/infinitelyExpandingOverloads.ts (1 errors) ==== + interface KnockoutSubscription2 { + target: KnockoutObservableBase2; + } + interface KnockoutObservableBase2 { + subscribe(callback: (newValue: T) => void, target?: any, topic?: string): KnockoutSubscription2; + } + interface ValidationPlacement2 { + initialize(validatable: Validatable2): void; + } + interface Validatable2 { + validators: KnockoutObservableBase2>; + } + class Validator2 { + private _subscription: KnockoutSubscription2; + } + class ViewModel { + public validationPlacements: Array> = new Array>(); + } + class Widget { + constructor(viewModelType: new () => ViewModel); // Shouldnt error on this overload + constructor(viewModelType: new () => ViewModel) { + } + public get options(): ViewModel { + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypeAssignability.js b/tests/baselines/reference/infinitelyExpandingTypeAssignability.js new file mode 100644 index 0000000000000..831f690179dbc --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypeAssignability.js @@ -0,0 +1,16 @@ +//// [infinitelyExpandingTypeAssignability.ts] +interface A { + x : T +} + +interface B extends A>>> { } + +interface C extends A>>> { } + +var x : B +var y : C = x + + +//// [infinitelyExpandingTypeAssignability.js] +var x; +var y = x; diff --git a/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt b/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt new file mode 100644 index 0000000000000..969036a6355f7 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes1.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/infinitelyExpandingTypes1.ts (1 errors) ==== + interface List { + data: T; + next: List; + owner: List>; + } + + + interface MyList { + data: T; + next: MyList; + owner: MyList>; + } + + var l: List; + var m: MyList; + + l == m; // should error + + var l2: List; + + l == l2; // should error; + ~~~~~~~ +!!! Operator '==' cannot be applied to types 'List' and 'List'. + + l == l; // should not error \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypes1.js b/tests/baselines/reference/infinitelyExpandingTypes1.js new file mode 100644 index 0000000000000..d10634d3af0e3 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes1.js @@ -0,0 +1,32 @@ +//// [infinitelyExpandingTypes1.ts] +interface List { + data: T; + next: List; + owner: List>; +} + + +interface MyList { + data: T; + next: MyList; + owner: MyList>; +} + +var l: List; +var m: MyList; + +l == m; // should error + +var l2: List; + +l == l2; // should error; + +l == l; // should not error + +//// [infinitelyExpandingTypes1.js] +var l; +var m; +l == m; +var l2; +l == l2; +l == l; diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt b/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt new file mode 100644 index 0000000000000..c9e46e20b9777 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/infinitelyExpandingTypes2.ts (1 errors) ==== + interface Foo { + x: Foo>; + } + + interface Bar extends Foo { + y: string; + } + + function f(p: Foo) { + console.log(p); + ~~~~~~~ +!!! Cannot find name 'console'. + } + + var v: Bar = null; + + f(v); // should not error + \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.js b/tests/baselines/reference/infinitelyExpandingTypes2.js new file mode 100644 index 0000000000000..73075e8524696 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes2.js @@ -0,0 +1,24 @@ +//// [infinitelyExpandingTypes2.ts] +interface Foo { + x: Foo>; +} + +interface Bar extends Foo { + y: string; +} + +function f(p: Foo) { + console.log(p); +} + +var v: Bar = null; + +f(v); // should not error + + +//// [infinitelyExpandingTypes2.js] +function f(p) { + console.log(p); +} +var v = null; +f(v); diff --git a/tests/baselines/reference/infinitelyExpandingTypes3.js b/tests/baselines/reference/infinitelyExpandingTypes3.js new file mode 100644 index 0000000000000..b425a66c7dcc5 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes3.js @@ -0,0 +1,24 @@ +//// [infinitelyExpandingTypes3.ts] +interface List { + data: T; + next: List; // will be recursive reference when OwnerList is expanded + owner: OwnerList; +} + +interface OwnerList extends List> { + name: string; +} + +interface OwnerList2 extends List> { + name: string; +} + +var o1: OwnerList; +var o2: OwnerList2; + +o1 = o2; // should not error + +//// [infinitelyExpandingTypes3.js] +var o1; +var o2; +o1 = o2; diff --git a/tests/baselines/reference/infinitelyExpandingTypes4.js b/tests/baselines/reference/infinitelyExpandingTypes4.js new file mode 100644 index 0000000000000..f80c52fc23724 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes4.js @@ -0,0 +1,31 @@ +//// [infinitelyExpandingTypes4.ts] +interface Query { + // ... + groupBy(keySelector: (item: T) => K): Query>; + // ... +} + +interface QueryEnumerator { + // ... + groupBy(keySelector: (item: T) => K): QueryEnumerator>; + // ... +} + +interface Grouping extends Query { + key(): K; +} + +var q1: Query; +var q2: QueryEnumerator; +var q3: Query; + +q1 = q2; // should error +q1 = q3; // should not error + + +//// [infinitelyExpandingTypes4.js] +var q1; +var q2; +var q3; +q1 = q2; +q1 = q3; diff --git a/tests/baselines/reference/infinitelyExpandingTypes5.js b/tests/baselines/reference/infinitelyExpandingTypes5.js new file mode 100644 index 0000000000000..8cb331abe68a8 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes5.js @@ -0,0 +1,20 @@ +//// [infinitelyExpandingTypes5.ts] +interface Query { + foo(x: T): Query; +} + +interface Enumerator { + (action: (item: T, index: number) => boolean): boolean; +} + +function from(array: T[]): Query; +function from(enumerator: Enumerator): Query; +function from(arg: any): any { + return undefined; +} + + +//// [infinitelyExpandingTypes5.js] +function from(arg) { + return undefined; +} diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js new file mode 100644 index 0000000000000..cc80c0b43cef6 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -0,0 +1,53 @@ +//// [infinitelyExpandingTypesNonGenericBase.ts] +class Functionality { + property: Options; +} + +class Base { +} + +class A extends Base { + options: Options[]>; +} + +interface OptionsBase { + Options: Options; +} + +interface Options extends OptionsBase { +} + + +function o(type: new () => Base) { +} + +o(A); + + +//// [infinitelyExpandingTypesNonGenericBase.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Functionality = (function () { + function Functionality() { + } + return Functionality; +})(); +var Base = (function () { + function Base() { + } + return Base; +})(); +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(Base); +function o(type) { +} +o(A); diff --git a/tests/baselines/reference/infinitelyGenerativeInheritance1.js b/tests/baselines/reference/infinitelyGenerativeInheritance1.js new file mode 100644 index 0000000000000..9f4c676d0bd31 --- /dev/null +++ b/tests/baselines/reference/infinitelyGenerativeInheritance1.js @@ -0,0 +1,12 @@ +//// [infinitelyGenerativeInheritance1.ts] +interface Stack { + pop(): T + zip(a: Stack): Stack<{ x: T; y: S }> +} + +interface MyStack extends Stack { + zip(a: Stack): Stack<{ x: T; y: S }> +} + + +//// [infinitelyGenerativeInheritance1.js] diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt new file mode 100644 index 0000000000000..f29464393805d --- /dev/null +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/inheritFromGenericTypeParameter.ts (2 errors) ==== + class C extends T { } + ~ +!!! A class may only extend another class. + interface I extends T { } + ~ +!!! An interface may only extend a class or another interface. \ No newline at end of file diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js new file mode 100644 index 0000000000000..8611563af69e5 --- /dev/null +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -0,0 +1,18 @@ +//// [inheritFromGenericTypeParameter.ts] +class C extends T { } +interface I extends T { } + +//// [inheritFromGenericTypeParameter.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(T); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt new file mode 100644 index 0000000000000..c4093032cf8b3 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts (1 errors) ==== + class C { + private x: number; + } + + class C2 { + private x: number; + } + + interface A extends C, C2 { // error + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! Named properties 'x' of types 'C' and 'C2' are not identical. + y: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js new file mode 100644 index 0000000000000..49bf2c8ac9701 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.js @@ -0,0 +1,24 @@ +//// [inheritSameNamePrivatePropertiesFromDifferentOrigins.ts] +class C { + private x: number; +} + +class C2 { + private x: number; +} + +interface A extends C, C2 { // error + y: string; +} + +//// [inheritSameNamePrivatePropertiesFromDifferentOrigins.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js new file mode 100644 index 0000000000000..b201108a7e292 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -0,0 +1,38 @@ +//// [inheritSameNamePrivatePropertiesFromSameOrigin.ts] +class B { + private x: number; +} +class C extends B { } + +class C2 extends B { } + +interface A extends C, C2 { // ok + y: string; +} + +//// [inheritSameNamePrivatePropertiesFromSameOrigin.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B = (function () { + function B() { + } + return B; +})(); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(B); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(B); diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt new file mode 100644 index 0000000000000..3dc0aa2b25bc8 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts (1 errors) ==== + interface C { + x?: number; + } + + interface C2 { + x: number; + } + + interface A extends C, C2 { // error + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! Named properties 'x' of types 'C' and 'C2' are not identical. + y: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.js b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.js new file mode 100644 index 0000000000000..8575e768e9f45 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.js @@ -0,0 +1,14 @@ +//// [inheritSameNamePropertiesWithDifferentOptionality.ts] +interface C { + x?: number; +} + +interface C2 { + x: number; +} + +interface A extends C, C2 { // error + y: string; +} + +//// [inheritSameNamePropertiesWithDifferentOptionality.js] diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt new file mode 100644 index 0000000000000..e8d89b75c090d --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts (1 errors) ==== + class C { + public x: number; + } + + class C2 { + private x: number; + } + + interface A extends C, C2 { // error + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! Named properties 'x' of types 'C' and 'C2' are not identical. + y: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js new file mode 100644 index 0000000000000..3c6181117a35d --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.js @@ -0,0 +1,24 @@ +//// [inheritSameNamePropertiesWithDifferentVisibility.ts] +class C { + public x: number; +} + +class C2 { + private x: number; +} + +interface A extends C, C2 { // error + y: string; +} + +//// [inheritSameNamePropertiesWithDifferentVisibility.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt new file mode 100644 index 0000000000000..dfe00fc6240e2 --- /dev/null +++ b/tests/baselines/reference/inheritance.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/compiler/inheritance.ts (2 errors) ==== + class B1 { + public x; + } + + class B2 { + public x; + } + + + class D1 extends B1 { + } + + class D2 extends B2 { + } + + + class N { + public y:number; + } + + class ND extends N { // any is assignable to number + public y; + } + + class Good { + public f: () => number = function () { return 0; } + public g() { return 0; } + } + + class Baad extends Good { + ~~~~ +!!! Class 'Baad' incorrectly extends base class 'Good': +!!! Types of property 'g' are incompatible: +!!! Type '(n: number) => number' is not assignable to type '() => number'. + public f(): number { return 0; } + ~ +!!! Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. + public g(n: number) { return 0; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js new file mode 100644 index 0000000000000..1fca887a9b1b2 --- /dev/null +++ b/tests/baselines/reference/inheritance.js @@ -0,0 +1,103 @@ +//// [inheritance.ts] +class B1 { + public x; +} + +class B2 { + public x; +} + + +class D1 extends B1 { +} + +class D2 extends B2 { +} + + +class N { + public y:number; +} + +class ND extends N { // any is assignable to number + public y; +} + +class Good { + public f: () => number = function () { return 0; } + public g() { return 0; } +} + +class Baad extends Good { + public f(): number { return 0; } + public g(n: number) { return 0; } +} + + +//// [inheritance.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B1 = (function () { + function B1() { + } + return B1; +})(); +var B2 = (function () { + function B2() { + } + return B2; +})(); +var D1 = (function (_super) { + __extends(D1, _super); + function D1() { + _super.apply(this, arguments); + } + return D1; +})(B1); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; +})(B2); +var N = (function () { + function N() { + } + return N; +})(); +var ND = (function (_super) { + __extends(ND, _super); + function ND() { + _super.apply(this, arguments); + } + return ND; +})(N); +var Good = (function () { + function Good() { + this.f = function () { + return 0; + }; + } + Good.prototype.g = function () { + return 0; + }; + return Good; +})(); +var Baad = (function (_super) { + __extends(Baad, _super); + function Baad() { + _super.apply(this, arguments); + } + Baad.prototype.f = function () { + return 0; + }; + Baad.prototype.g = function (n) { + return 0; + }; + return Baad; +})(Good); diff --git a/tests/baselines/reference/inheritance1.errors.txt b/tests/baselines/reference/inheritance1.errors.txt new file mode 100644 index 0000000000000..537b7b8fa4ed0 --- /dev/null +++ b/tests/baselines/reference/inheritance1.errors.txt @@ -0,0 +1,96 @@ +==== tests/cases/compiler/inheritance1.ts (12 errors) ==== + class Control { + private state: any; + } + interface SelectableControl extends Control { + select(): void; + } + + class Button extends Control implements SelectableControl { + select() { } + } + class TextBox extends Control { + select() { } + } + class ImageBase extends Control implements SelectableControl{ + ~~~~~~~~~ +!!! Class 'ImageBase' incorrectly implements interface 'SelectableControl': +!!! Property 'select' is missing in type 'ImageBase'. + } + class Image1 extends Control { + } + class Locations implements SelectableControl { + ~~~~~~~~~ +!!! Class 'Locations' incorrectly implements interface 'SelectableControl': +!!! Property 'state' is missing in type 'Locations'. + select() { } + } + class Locations1 { + select() { } + } + var sc: SelectableControl; + var c: Control; + + var b: Button; + sc = b; + c = b; + b = sc; + b = c; + ~ +!!! Type 'Control' is not assignable to type 'Button': +!!! Property 'select' is missing in type 'Control'. + + var t: TextBox; + sc = t; + c = t; + t = sc; + t = c; + ~ +!!! Type 'Control' is not assignable to type 'TextBox': +!!! Property 'select' is missing in type 'Control'. + + var i: ImageBase; + sc = i; + ~~ +!!! Type 'ImageBase' is not assignable to type 'SelectableControl'. + c = i; + i = sc; + i = c; + + var i1: Image1; + sc = i1; + ~~ +!!! Type 'Image1' is not assignable to type 'SelectableControl': +!!! Property 'select' is missing in type 'Image1'. + c = i1; + i1 = sc; + i1 = c; + + var l: Locations; + sc = l; + ~~ +!!! Type 'Locations' is not assignable to type 'SelectableControl'. + c = l; + ~ +!!! Type 'Locations' is not assignable to type 'Control': +!!! Property 'state' is missing in type 'Locations'. + l = sc; + l = c; + ~ +!!! Type 'Control' is not assignable to type 'Locations': +!!! Property 'select' is missing in type 'Control'. + + var l1: Locations1; + sc = l1; + ~~ +!!! Type 'Locations1' is not assignable to type 'SelectableControl': +!!! Property 'state' is missing in type 'Locations1'. + c = l1; + ~ +!!! Type 'Locations1' is not assignable to type 'Control': +!!! Property 'state' is missing in type 'Locations1'. + l1 = sc; + l1 = c; + ~~ +!!! Type 'Control' is not assignable to type 'Locations1': +!!! Property 'select' is missing in type 'Control'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js new file mode 100644 index 0000000000000..e6dbd35e0df89 --- /dev/null +++ b/tests/baselines/reference/inheritance1.js @@ -0,0 +1,153 @@ +//// [inheritance1.ts] +class Control { + private state: any; +} +interface SelectableControl extends Control { + select(): void; +} + +class Button extends Control implements SelectableControl { + select() { } +} +class TextBox extends Control { + select() { } +} +class ImageBase extends Control implements SelectableControl{ +} +class Image1 extends Control { +} +class Locations implements SelectableControl { + select() { } +} +class Locations1 { + select() { } +} +var sc: SelectableControl; +var c: Control; + +var b: Button; +sc = b; +c = b; +b = sc; +b = c; + +var t: TextBox; +sc = t; +c = t; +t = sc; +t = c; + +var i: ImageBase; +sc = i; +c = i; +i = sc; +i = c; + +var i1: Image1; +sc = i1; +c = i1; +i1 = sc; +i1 = c; + +var l: Locations; +sc = l; +c = l; +l = sc; +l = c; + +var l1: Locations1; +sc = l1; +c = l1; +l1 = sc; +l1 = c; + +//// [inheritance1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Control = (function () { + function Control() { + } + return Control; +})(); +var Button = (function (_super) { + __extends(Button, _super); + function Button() { + _super.apply(this, arguments); + } + Button.prototype.select = function () { + }; + return Button; +})(Control); +var TextBox = (function (_super) { + __extends(TextBox, _super); + function TextBox() { + _super.apply(this, arguments); + } + TextBox.prototype.select = function () { + }; + return TextBox; +})(Control); +var ImageBase = (function (_super) { + __extends(ImageBase, _super); + function ImageBase() { + _super.apply(this, arguments); + } + return ImageBase; +})(Control); +var Image1 = (function (_super) { + __extends(Image1, _super); + function Image1() { + _super.apply(this, arguments); + } + return Image1; +})(Control); +var Locations = (function () { + function Locations() { + } + Locations.prototype.select = function () { + }; + return Locations; +})(); +var Locations1 = (function () { + function Locations1() { + } + Locations1.prototype.select = function () { + }; + return Locations1; +})(); +var sc; +var c; +var b; +sc = b; +c = b; +b = sc; +b = c; +var t; +sc = t; +c = t; +t = sc; +t = c; +var i; +sc = i; +c = i; +i = sc; +i = c; +var i1; +sc = i1; +c = i1; +i1 = sc; +i1 = c; +var l; +sc = l; +c = l; +l = sc; +l = c; +var l1; +sc = l1; +c = l1; +l1 = sc; +l1 = c; diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt new file mode 100644 index 0000000000000..a59e3da0d0495 --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts (1 errors) ==== + class A { + private myMethod() { } + } + + class B extends A { } + + class C extends B { + ~ +!!! Class 'C' incorrectly extends base class 'B': +!!! Private property 'myMethod' cannot be reimplemented. + private myMethod() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js new file mode 100644 index 0000000000000..45293ec30210f --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -0,0 +1,42 @@ +//// [inheritanceGrandParentPrivateMemberCollision.ts] +class A { + private myMethod() { } +} + +class B extends A { } + +class C extends B { + private myMethod() { } +} + + +//// [inheritanceGrandParentPrivateMemberCollision.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.myMethod = function () { + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.myMethod = function () { + }; + return C; +})(B); diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt new file mode 100644 index 0000000000000..ca7a3b32b8e95 --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts (1 errors) ==== + class A { + private myMethod() { } + } + + class B extends A { } + + class C extends B { + ~ +!!! Class 'C' incorrectly extends base class 'B': +!!! Private property 'myMethod' cannot be reimplemented. + public myMethod() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js new file mode 100644 index 0000000000000..339511df6bae8 --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -0,0 +1,42 @@ +//// [inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts] +class A { + private myMethod() { } +} + +class B extends A { } + +class C extends B { + public myMethod() { } +} + + +//// [inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.myMethod = function () { + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.myMethod = function () { + }; + return C; +})(B); diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt new file mode 100644 index 0000000000000..be63f2e9c1efd --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts (1 errors) ==== + class A { + public myMethod() { } + } + + class B extends A { } + + class C extends B { + ~ +!!! Class 'C' incorrectly extends base class 'B': +!!! Private property 'myMethod' cannot be reimplemented. + private myMethod() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js new file mode 100644 index 0000000000000..f69a4962db697 --- /dev/null +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -0,0 +1,42 @@ +//// [inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts] +class A { + public myMethod() { } +} + +class B extends A { } + +class C extends B { + private myMethod() { } +} + + +//// [inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.myMethod = function () { + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.myMethod = function () { + }; + return C; +})(B); diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..b62b70743cab7 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts (4 errors) ==== + class a { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } + + class b extends a { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt new file mode 100644 index 0000000000000..3d97822ef7d64 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts (4 errors) ==== + class a { + x() { + return "20"; + } + } + + class b extends a { + ~ +!!! Class 'b' incorrectly extends base class 'a': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type '() => string'. + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. + return "20"; + } + set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt new file mode 100644 index 0000000000000..85342038c5473 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts (2 errors) ==== + class a { + x: string; + } + + class b extends a { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..8575f167c0b82 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts (4 errors) ==== + class a { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } + + class b extends a { + ~ +!!! Class 'b' incorrectly extends base class 'a': +!!! Types of property 'x' are incompatible: +!!! Type '() => string' is not assignable to type 'string'. + x() { + ~ +!!! Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. + return "20"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js new file mode 100644 index 0000000000000..747a56b3b3bcb --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -0,0 +1,38 @@ +//// [inheritanceMemberFuncOverridingMethod.ts] +class a { + x() { + return "10"; + } +} + +class b extends a { + x() { + return "20"; + } +} + +//// [inheritanceMemberFuncOverridingMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + a.prototype.x = function () { + return "10"; + }; + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.prototype.x = function () { + return "20"; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt new file mode 100644 index 0000000000000..9c1fc8c565f08 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/inheritanceMemberFuncOverridingProperty.ts (1 errors) ==== + class a { + x: () => string; + } + + class b extends a { + x() { + ~ +!!! Class 'a' defines instance member property 'x', but extended class 'b' defines it as instance member function. + return "20"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js new file mode 100644 index 0000000000000..1f33f0dfb07f4 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -0,0 +1,33 @@ +//// [inheritanceMemberFuncOverridingProperty.ts] +class a { + x: () => string; +} + +class b extends a { + x() { + return "20"; + } +} + +//// [inheritanceMemberFuncOverridingProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.prototype.x = function () { + return "20"; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..45f6ed765dfeb --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/inheritanceMemberPropertyOverridingAccessor.ts (2 errors) ==== + class a { + private __x: () => string; + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.__x; + } + set x(aValue: () => string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + this.__x = aValue; + } + } + + class b extends a { + x: () => string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt new file mode 100644 index 0000000000000..03a0e21de7246 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/inheritanceMemberPropertyOverridingMethod.ts (1 errors) ==== + class a { + x() { + return "20"; + } + } + + class b extends a { + x: () => string; + ~ +!!! Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member property. + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js new file mode 100644 index 0000000000000..cf0f4b0b58cdd --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -0,0 +1,33 @@ +//// [inheritanceMemberPropertyOverridingMethod.ts] +class a { + x() { + return "20"; + } +} + +class b extends a { + x: () => string; +} + +//// [inheritanceMemberPropertyOverridingMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + a.prototype.x = function () { + return "20"; + }; + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js new file mode 100644 index 0000000000000..8cfd68eb30dd3 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -0,0 +1,28 @@ +//// [inheritanceMemberPropertyOverridingProperty.ts] +class a { + x: () => string; +} + +class b extends a { + x: () => string; +} + +//// [inheritanceMemberPropertyOverridingProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js new file mode 100644 index 0000000000000..ca5f5c497b825 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -0,0 +1,32 @@ +//// [inheritanceOfGenericConstructorMethod1.ts] +class A { } +class B extends A {} +var a = new A(); +var b1 = new B(); // no error +var b2: B = new B(); // no error +var b3 = new B(); // error, could not select overload for 'new' expression + + +//// [inheritanceOfGenericConstructorMethod1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var a = new A(); +var b1 = new B(); +var b2 = new B(); +var b3 = new B(); diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js new file mode 100644 index 0000000000000..0e2fc8c732243 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -0,0 +1,61 @@ +//// [inheritanceOfGenericConstructorMethod2.ts] +module M { + export class C1 { } + export class C2 { } +} +module N { + export class D1 extends M.C1 { } + export class D2 extends M.C2 { } +} + +var c = new M.C2(); // no error +var n = new N.D1(); // no error +var n2 = new N.D2(); // error +var n3 = new N.D2(); // no error, D2 + + +//// [inheritanceOfGenericConstructorMethod2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M; +(function (M) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + M.C1 = C1; + var C2 = (function () { + function C2() { + } + return C2; + })(); + M.C2 = C2; +})(M || (M = {})); +var N; +(function (N) { + var D1 = (function (_super) { + __extends(D1, _super); + function D1() { + _super.apply(this, arguments); + } + return D1; + })(M.C1); + N.D1 = D1; + var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + } + return D2; + })(M.C2); + N.D2 = D2; +})(N || (N = {})); +var c = new M.C2(); +var n = new N.D1(); +var n2 = new N.D2(); +var n3 = new N.D2(); diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..74f1f1409e898 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/inheritanceStaticAccessorOverridingAccessor.ts (4 errors) ==== + class a { + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + static set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } + + class b extends a { + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + static set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt new file mode 100644 index 0000000000000..47752c8876589 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts (3 errors) ==== + class a { + static x() { + return "20"; + } + } + + class b extends a { + ~ +!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type '() => string'. + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + static set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt new file mode 100644 index 0000000000000..65d69802e8adc --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts (2 errors) ==== + class a { + static x: string; + } + + class b extends a { + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + static set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..5b015fd54cd74 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts (3 errors) ==== + class a { + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return "20"; + } + static set x(aValue: string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + } + } + + class b extends a { + ~ +!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': +!!! Types of property 'x' are incompatible: +!!! Type '() => string' is not assignable to type 'string'. + static x() { + return "20"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt new file mode 100644 index 0000000000000..2c3804a5eba9f --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceStaticFuncOverridingAccessorOfFuncType.ts (1 errors) ==== + class a { + static get x(): () => string { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + } + + class b extends a { + static x() { + return "20"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js new file mode 100644 index 0000000000000..e05a5b245cd36 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -0,0 +1,38 @@ +//// [inheritanceStaticFuncOverridingMethod.ts] +class a { + static x() { + return "10"; + } +} + +class b extends a { + static x() { + return "20"; + } +} + +//// [inheritanceStaticFuncOverridingMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + a.x = function () { + return "10"; + }; + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.x = function () { + return "20"; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt new file mode 100644 index 0000000000000..346937240e193 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts (1 errors) ==== + class a { + static x: string; + } + + class b extends a { + ~ +!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': +!!! Types of property 'x' are incompatible: +!!! Type '() => string' is not assignable to type 'string'. + static x() { + return "20"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js new file mode 100644 index 0000000000000..cc8f081f1c6b7 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -0,0 +1,33 @@ +//// [inheritanceStaticFuncOverridingProperty.ts] +class a { + static x: string; +} + +class b extends a { + static x() { + return "20"; + } +} + +//// [inheritanceStaticFuncOverridingProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.x = function () { + return "20"; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js new file mode 100644 index 0000000000000..3eb016b1e093f --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -0,0 +1,33 @@ +//// [inheritanceStaticFuncOverridingPropertyOfFuncType.ts] +class a { + static x: () => string; +} + +class b extends a { + static x() { + return "20"; + } +} + +//// [inheritanceStaticFuncOverridingPropertyOfFuncType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.x = function () { + return "20"; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js new file mode 100644 index 0000000000000..3585fbc353288 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -0,0 +1,33 @@ +//// [inheritanceStaticFunctionOverridingInstanceProperty.ts] +class a { + x: string; +} + +class b extends a { + static x() { + return new b().x; + } +} + +//// [inheritanceStaticFunctionOverridingInstanceProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + b.x = function () { + return new b().x; + }; + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js new file mode 100644 index 0000000000000..5fe4a2d002d8d --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -0,0 +1,28 @@ +//// [inheritanceStaticMembersCompatible.ts] +class a { + static x: a; +} + +class b extends a { + static x: b; +} + +//// [inheritanceStaticMembersCompatible.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt new file mode 100644 index 0000000000000..92c0c6a83b121 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/inheritanceStaticMembersIncompatible.ts (1 errors) ==== + class a { + static x: string; + } + + class b extends a { + ~ +!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': +!!! Types of property 'x' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + static x: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js new file mode 100644 index 0000000000000..48b54dd47d333 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -0,0 +1,28 @@ +//// [inheritanceStaticMembersIncompatible.ts] +class a { + static x: string; +} + +class b extends a { + static x: number; +} + +//// [inheritanceStaticMembersIncompatible.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt new file mode 100644 index 0000000000000..3611d019a2afc --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/inheritanceStaticPropertyOverridingAccessor.ts (2 errors) ==== + class a { + static get x(): () => string { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null;; + } + static set x(aValue: () => string) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class b extends a { + static x: () => string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt new file mode 100644 index 0000000000000..5498010bddb1e --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts (1 errors) ==== + class a { + static x() { + return "20"; + } + } + + class b extends a { + ~ +!!! Class static side 'typeof b' incorrectly extends base class static side 'typeof a': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type '() => string'. + static x: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js new file mode 100644 index 0000000000000..db25abeafd933 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -0,0 +1,33 @@ +//// [inheritanceStaticPropertyOverridingMethod.ts] +class a { + static x() { + return "20"; + } +} + +class b extends a { + static x: string; +} + +//// [inheritanceStaticPropertyOverridingMethod.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + a.x = function () { + return "20"; + }; + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js new file mode 100644 index 0000000000000..f75becd518c20 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -0,0 +1,28 @@ +//// [inheritanceStaticPropertyOverridingProperty.ts] +class a { + static x: () => string; +} + +class b extends a { + static x: () => string; +} + +//// [inheritanceStaticPropertyOverridingProperty.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = (function () { + function a() { + } + return a; +})(); +var b = (function (_super) { + __extends(b, _super); + function b() { + _super.apply(this, arguments); + } + return b; +})(a); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt new file mode 100644 index 0000000000000..461bc0db5e740 --- /dev/null +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/inheritedConstructorWithRestParams.ts (2 errors) ==== + class Base { + constructor(...a: string[]) { } + } + + class Derived extends Base { } + + // Ok + new Derived("", ""); + new Derived(""); + new Derived(); + + // Errors + new Derived("", 3); + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new Derived(3); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js new file mode 100644 index 0000000000000..2fbb85737f560 --- /dev/null +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -0,0 +1,44 @@ +//// [inheritedConstructorWithRestParams.ts] +class Base { + constructor(...a: string[]) { } +} + +class Derived extends Base { } + +// Ok +new Derived("", ""); +new Derived(""); +new Derived(); + +// Errors +new Derived("", 3); +new Derived(3); + +//// [inheritedConstructorWithRestParams.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(a) { + var a = []; + for (var _i = 0; _i < arguments.length; _i++) { + a[_i - 0] = arguments[_i]; + } + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +new Derived("", ""); +new Derived(""); +new Derived(); +new Derived("", 3); +new Derived(3); diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt new file mode 100644 index 0000000000000..07cd6086aa491 --- /dev/null +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== + class IBaseBase { + constructor(x: U) { } + } + + interface IBase extends IBaseBase { } + + class BaseBase2 { + constructor(x: number) { } + } + + declare class BaseBase extends BaseBase2 implements IBase { + constructor(x: T, ...y: U[]); + constructor(x1: T, x2: T, ...y: U[]); + constructor(x1: T, x2: U, y: T); + } + + class Base extends BaseBase { + } + + class Derived extends Base { } + + // Ok + new Derived("", ""); + new Derived("", 3); + new Derived("", 3, 3); + new Derived("", 3, 3, 3); + new Derived("", 3, ""); + new Derived("", "", 3); + new Derived("", "", 3, 3); + + // Errors + new Derived(3); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new Derived("", 3, "", 3); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new Derived("", 3, "", ""); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js new file mode 100644 index 0000000000000..2259d10dc15b0 --- /dev/null +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -0,0 +1,77 @@ +//// [inheritedConstructorWithRestParams2.ts] +class IBaseBase { + constructor(x: U) { } +} + +interface IBase extends IBaseBase { } + +class BaseBase2 { + constructor(x: number) { } +} + +declare class BaseBase extends BaseBase2 implements IBase { + constructor(x: T, ...y: U[]); + constructor(x1: T, x2: T, ...y: U[]); + constructor(x1: T, x2: U, y: T); +} + +class Base extends BaseBase { +} + +class Derived extends Base { } + +// Ok +new Derived("", ""); +new Derived("", 3); +new Derived("", 3, 3); +new Derived("", 3, 3, 3); +new Derived("", 3, ""); +new Derived("", "", 3); +new Derived("", "", 3, 3); + +// Errors +new Derived(3); +new Derived("", 3, "", 3); +new Derived("", 3, "", ""); + +//// [inheritedConstructorWithRestParams2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var IBaseBase = (function () { + function IBaseBase(x) { + } + return IBaseBase; +})(); +var BaseBase2 = (function () { + function BaseBase2(x) { + } + return BaseBase2; +})(); +var Base = (function (_super) { + __extends(Base, _super); + function Base() { + _super.apply(this, arguments); + } + return Base; +})(BaseBase); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +new Derived("", ""); +new Derived("", 3); +new Derived("", 3, 3); +new Derived("", 3, 3, 3); +new Derived("", 3, ""); +new Derived("", "", 3); +new Derived("", "", 3, 3); +new Derived(3); +new Derived("", 3, "", 3); +new Derived("", 3, "", ""); diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js new file mode 100644 index 0000000000000..570a07ee7f6b5 --- /dev/null +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.js @@ -0,0 +1,17 @@ +//// [inheritedFunctionAssignmentCompatibility.ts] +interface IResultCallback extends Function { } + +function fn(cb: IResultCallback) { } + +fn((a, b) => true); +fn(function (a, b) { return true; }) + + + +//// [inheritedFunctionAssignmentCompatibility.js] +function fn(cb) { +} +fn(function (a, b) { return true; }); +fn(function (a, b) { + return true; +}); diff --git a/tests/baselines/reference/inheritedGenericCallSignature.js b/tests/baselines/reference/inheritedGenericCallSignature.js new file mode 100644 index 0000000000000..67d653df1ce43 --- /dev/null +++ b/tests/baselines/reference/inheritedGenericCallSignature.js @@ -0,0 +1,34 @@ +//// [inheritedGenericCallSignature.ts] + +interface I1 { + + (a: T): T; + +} + + +interface Object {} + + + +interface I2 extends I1 { + + b: T; + +} + + + +var x: I2; + + + +var y = x(undefined); + +y.length; // should not error + + +//// [inheritedGenericCallSignature.js] +var x; +var y = x(undefined); +y.length; diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt new file mode 100644 index 0000000000000..4665505c6d55c --- /dev/null +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases.ts (6 errors) ==== + // indexer in B is a subtype of indexer in A + interface A { + [s: string]: { + a; + }; + } + interface B { + [s: number]: { + a; + b; + }; + } + interface C { + m: {}; + } + + interface D extends A, B, C { } // error because m is not a subtype of {a;} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. + + interface E { + 0: {}; + } + + interface F extends A, B, E { } // error because 0 is not a subtype of {a; b;} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. + + interface G extends A, B, C, E { } // should only report one error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property '0' of type '{}' is not assignable to numeric index type '{ a: any; b: any; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property '0' of type '{}' is not assignable to string index type '{ a: any; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'm' of type '{}' is not assignable to string index type '{ a: any; }'. + + interface H extends A, F { } // Should report no error at all because error is internal to F \ No newline at end of file diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.js b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.js new file mode 100644 index 0000000000000..f4ea5f07eb9b4 --- /dev/null +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases.js @@ -0,0 +1,30 @@ +//// [inheritedMembersAndIndexSignaturesFromDifferentBases.ts] +// indexer in B is a subtype of indexer in A +interface A { + [s: string]: { + a; + }; +} +interface B { + [s: number]: { + a; + b; + }; +} +interface C { + m: {}; +} + +interface D extends A, B, C { } // error because m is not a subtype of {a;} + +interface E { + 0: {}; +} + +interface F extends A, B, E { } // error because 0 is not a subtype of {a; b;} + +interface G extends A, B, C, E { } // should only report one error + +interface H extends A, F { } // Should report no error at all because error is internal to F + +//// [inheritedMembersAndIndexSignaturesFromDifferentBases.js] diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.js b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.js new file mode 100644 index 0000000000000..8a3b2f8d0328e --- /dev/null +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.js @@ -0,0 +1,12 @@ +//// [inheritedMembersAndIndexSignaturesFromDifferentBases2.ts] +interface A { + [n: number]: T; +} + +interface B { + foo: number; +} + +interface C extends B, A { } // Should succeed + +//// [inheritedMembersAndIndexSignaturesFromDifferentBases2.js] diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt new file mode 100644 index 0000000000000..ed90ca4d415dc --- /dev/null +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/inheritedModuleMembersForClodule.ts (1 errors) ==== + class C { + static foo(): string { + return "123"; + } + } + + class D extends C { + ~ +!!! Class static side 'typeof D' incorrectly extends base class static side 'typeof C': +!!! Types of property 'foo' are incompatible: +!!! Type '() => number' is not assignable to type '() => string': +!!! Type 'number' is not assignable to type 'string'. + } + + module D { + export function foo(): number { + return 0; + }; + } + + class E extends D { + static bar() { + return this.foo(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js new file mode 100644 index 0000000000000..0c9bcd81905e2 --- /dev/null +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -0,0 +1,63 @@ +//// [inheritedModuleMembersForClodule.ts] +class C { + static foo(): string { + return "123"; + } +} + +class D extends C { +} + +module D { + export function foo(): number { + return 0; + }; +} + +class E extends D { + static bar() { + return this.foo(); + } +} + + +//// [inheritedModuleMembersForClodule.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + C.foo = function () { + return "123"; + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var D; +(function (D) { + function foo() { + return 0; + } + D.foo = foo; + ; +})(D || (D = {})); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + E.bar = function () { + return this.foo(); + }; + return E; +})(D); diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt new file mode 100644 index 0000000000000..cd119798286ed --- /dev/null +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts (2 errors) ==== + // string indexer tests + interface A { + [s: string]: number; + } + interface B { + [s: string]: number; + } + interface C extends A, B { } // ok + + interface D { + [s: string]: string; + } + interface E extends A, D { } // error + ~ +!!! Interface 'E' incorrectly extends interface 'D': +!!! Index signatures are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + + // Same tests for number indexer + interface A2 { + [s: number]: number; + } + interface B2 { + [s: number]: number; + } + interface C2 extends A2, B2 { } // ok + + interface D2 { + [s: number]: string; + } + interface E2 extends A2, D2 { } // error + ~~ +!!! Interface 'E2' incorrectly extends interface 'D2': +!!! Index signatures are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.js b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.js new file mode 100644 index 0000000000000..1645dd10a552a --- /dev/null +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.js @@ -0,0 +1,31 @@ +//// [inheritedStringIndexersFromDifferentBaseTypes.ts] +// string indexer tests +interface A { + [s: string]: number; +} +interface B { + [s: string]: number; +} +interface C extends A, B { } // ok + +interface D { + [s: string]: string; +} +interface E extends A, D { } // error + + +// Same tests for number indexer +interface A2 { + [s: number]: number; +} +interface B2 { + [s: number]: number; +} +interface C2 extends A2, B2 { } // ok + +interface D2 { + [s: number]: string; +} +interface E2 extends A2, D2 { } // error + +//// [inheritedStringIndexersFromDifferentBaseTypes.js] diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt new file mode 100644 index 0000000000000..4276bfb2205cd --- /dev/null +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts (1 errors) ==== + // indexer in B is a subtype of indexer in A + interface A { + [s: string]: { + a; + }; + } + interface B { + [s: number]: { + a; + b; + }; + } + interface C extends A, B { } // ok + + interface D { + [s: number]: {}; + } + interface E extends A, D { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Numeric index type '{}' is not assignable to string index type '{ a: any; }'. + + interface F extends A, D { + [s: number]: { + a; + }; + } // ok because we overrode D's number index signature \ No newline at end of file diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.js b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.js new file mode 100644 index 0000000000000..aa837b5cf2e6a --- /dev/null +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes2.js @@ -0,0 +1,27 @@ +//// [inheritedStringIndexersFromDifferentBaseTypes2.ts] +// indexer in B is a subtype of indexer in A +interface A { + [s: string]: { + a; + }; +} +interface B { + [s: number]: { + a; + b; + }; +} +interface C extends A, B { } // ok + +interface D { + [s: number]: {}; +} +interface E extends A, D { } // error + +interface F extends A, D { + [s: number]: { + a; + }; +} // ok because we overrode D's number index signature + +//// [inheritedStringIndexersFromDifferentBaseTypes2.js] diff --git a/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt new file mode 100644 index 0000000000000..56a9455608b29 --- /dev/null +++ b/tests/baselines/reference/initializerReferencingConstructorLocals.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorLocals.ts (12 errors) ==== + // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. + + class C { + a = z; // error + ~ +!!! Cannot find name 'z'. + b: typeof z; // error + ~ +!!! Cannot find name 'z'. + c = this.z; // error + ~ +!!! Property 'z' does not exist on type 'C'. + d: typeof this.z; // error + ~~~~ +!!! Identifier expected. + ~ +!!! Property 'z' does not exist on type 'C'. + constructor(x) { + z = 1; + ~ +!!! Cannot find name 'z'. + } + } + + class D { + a = z; // error + ~ +!!! Cannot find name 'z'. + b: typeof z; // error + ~ +!!! Cannot find name 'z'. + c = this.z; // error + ~ +!!! Property 'z' does not exist on type 'D'. + d: typeof this.z; // error + ~~~~ +!!! Identifier expected. + ~ +!!! Property 'z' does not exist on type 'D'. + constructor(x: T) { + z = 1; + ~ +!!! Cannot find name 'z'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt new file mode 100644 index 0000000000000..6d137e173ce62 --- /dev/null +++ b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts (6 errors) ==== + // Initializer expressions for instance member variables are evaluated in the scope of the class constructor body but are not permitted to reference parameters or local variables of the constructor. + + class C { + a = x; // error + ~ +!!! Cannot find name 'x'. + b: typeof x; // error + ~ +!!! Cannot find name 'x'. + constructor(x) { } + } + + class D { + a = x; // error + ~ +!!! Cannot find name 'x'. + b: typeof x; // error + ~ +!!! Cannot find name 'x'. + constructor(public x) { } + } + + class E { + a = this.x; // ok + b: typeof this.x; // error + ~~~~ +!!! Identifier expected. + constructor(public x) { } + } + + class F { + a = this.x; // ok + b = x; // error + ~ +!!! Cannot find name 'x'. + constructor(public x: T) { } + } \ No newline at end of file diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt new file mode 100644 index 0000000000000..ff2555447cea2 --- /dev/null +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (7 errors) ==== + + // Errors: Initializers & statements in declaration file + + declare class Foo { + name = "test"; + ~ +!!! Initializers are not allowed in ambient contexts. + "some prop" = 42; + ~ +!!! Initializers are not allowed in ambient contexts. + fn(): boolean { + ~ +!!! A function implementation cannot be declared in an ambient context. + return false; + } + } + + declare var x = []; + ~ +!!! Initializers are not allowed in ambient contexts. + declare var y = {}; + ~ +!!! Initializers are not allowed in ambient contexts. + + declare module M1 { + while(true); + ~~~~~ +!!! Statements are not allowed in ambient contexts. + + export var v1 = () => false; + ~ +!!! Initializers are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/initializersWidened.js b/tests/baselines/reference/initializersWidened.js new file mode 100644 index 0000000000000..d16b6ec6889ee --- /dev/null +++ b/tests/baselines/reference/initializersWidened.js @@ -0,0 +1,9 @@ +//// [initializersWidened.ts] +// these are widened to any at the point of assignment + +var x = null; +var y = undefined; + +//// [initializersWidened.js] +var x = null; +var y = undefined; diff --git a/tests/baselines/reference/innerAliases.errors.txt b/tests/baselines/reference/innerAliases.errors.txt new file mode 100644 index 0000000000000..f8010153c582d --- /dev/null +++ b/tests/baselines/reference/innerAliases.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/innerAliases.ts (2 errors) ==== + module A { + export module B { + export module C { + export class Class1 {} + } + } + } + + module D { + import inner = A.B.C; + + var c1 = new inner.Class1(); + + export module E { + export class Class2 {} + } + } + + var c: D.inner.Class1; + ~~~~~~~~~~~~~~ +!!! Module 'D' has no exported member 'inner'. + + c = new D.inner.Class1(); + ~~~~~ +!!! Property 'inner' does not exist on type 'typeof D'. + + \ No newline at end of file diff --git a/tests/baselines/reference/innerAliases.js b/tests/baselines/reference/innerAliases.js new file mode 100644 index 0000000000000..65699636505f4 --- /dev/null +++ b/tests/baselines/reference/innerAliases.js @@ -0,0 +1,57 @@ +//// [innerAliases.ts] +module A { + export module B { + export module C { + export class Class1 {} + } + } +} + +module D { + import inner = A.B.C; + + var c1 = new inner.Class1(); + + export module E { + export class Class2 {} + } +} + +var c: D.inner.Class1; + +c = new D.inner.Class1(); + + + +//// [innerAliases.js] +var A; +(function (A) { + (function (B) { + (function (C) { + var Class1 = (function () { + function Class1() { + } + return Class1; + })(); + C.Class1 = Class1; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var D; +(function (D) { + var inner = A.B.C; + var c1 = new inner.Class1(); + (function (E) { + var Class2 = (function () { + function Class2() { + } + return Class2; + })(); + E.Class2 = Class2; + })(D.E || (D.E = {})); + var E = D.E; +})(D || (D = {})); +var c; +c = new D.inner.Class1(); diff --git a/tests/baselines/reference/innerAliases2.js b/tests/baselines/reference/innerAliases2.js new file mode 100644 index 0000000000000..846e85504f26b --- /dev/null +++ b/tests/baselines/reference/innerAliases2.js @@ -0,0 +1,42 @@ +//// [innerAliases2.ts] +module _provider { + export class UsefulClass { + public foo() { + } + } +} + +module consumer { + import provider = _provider; + + var g:provider.UsefulClass= null; + + function use():provider.UsefulClass { + var p2:provider.UsefulClass= new provider.UsefulClass(); + return p2; + } +} + + + +//// [innerAliases2.js] +var _provider; +(function (_provider) { + var UsefulClass = (function () { + function UsefulClass() { + } + UsefulClass.prototype.foo = function () { + }; + return UsefulClass; + })(); + _provider.UsefulClass = UsefulClass; +})(_provider || (_provider = {})); +var consumer; +(function (consumer) { + var provider = _provider; + var g = null; + function use() { + var p2 = new provider.UsefulClass(); + return p2; + } +})(consumer || (consumer = {})); diff --git a/tests/baselines/reference/innerBoundLambdaEmit.js b/tests/baselines/reference/innerBoundLambdaEmit.js new file mode 100644 index 0000000000000..2921cad55d0b5 --- /dev/null +++ b/tests/baselines/reference/innerBoundLambdaEmit.js @@ -0,0 +1,23 @@ +//// [innerBoundLambdaEmit.ts] +module M { + export class Foo { + } + var bar = () => { }; +} +interface Array { + toFoo(): M.Foo +} + + +//// [innerBoundLambdaEmit.js] +var M; +(function (M) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + M.Foo = Foo; + var bar = function () { + }; +})(M || (M = {})); diff --git a/tests/baselines/reference/innerExtern.js b/tests/baselines/reference/innerExtern.js new file mode 100644 index 0000000000000..2b1eaff0b00a1 --- /dev/null +++ b/tests/baselines/reference/innerExtern.js @@ -0,0 +1,29 @@ +//// [innerExtern.ts] +module A { + export declare module BB { + export var Elephant; + } + export module B { + export class C { + x = BB.Elephant.X; + } + } +} + + + + +//// [innerExtern.js] +var A; +(function (A) { + (function (B) { + var C = (function () { + function C() { + this.x = BB.Elephant.X; + } + return C; + })(); + B.C = C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); diff --git a/tests/baselines/reference/innerFunc.js b/tests/baselines/reference/innerFunc.js new file mode 100644 index 0000000000000..1676d0789d1e4 --- /dev/null +++ b/tests/baselines/reference/innerFunc.js @@ -0,0 +1,32 @@ +//// [innerFunc.ts] +function salt() { + function pepper() { return 5;} + return pepper(); +} + +module M { + export function tungsten() { + function oxygen() { return 6; }; + return oxygen(); + } +} + + +//// [innerFunc.js] +function salt() { + function pepper() { + return 5; + } + return pepper(); +} +var M; +(function (M) { + function tungsten() { + function oxygen() { + return 6; + } + ; + return oxygen(); + } + M.tungsten = tungsten; +})(M || (M = {})); diff --git a/tests/baselines/reference/innerModExport1.errors.txt b/tests/baselines/reference/innerModExport1.errors.txt new file mode 100644 index 0000000000000..1f960cd37f75d --- /dev/null +++ b/tests/baselines/reference/innerModExport1.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/innerModExport1.ts (5 errors) ==== + module Outer { + + // inner mod 1 + var non_export_var: number; + module { + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. + var non_export_var = 0; + export var export_var = 1; + ~~~~~~ +!!! Statement expected. + + function NonExportFunc() { return 0; } + + export function ExportFunc() { return 0; } + } + + export var outer_var_export = 0; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export function outerFuncExport() { return 0; } + + } + ~ +!!! Declaration or statement expected. + + Outer.ExportFunc(); \ No newline at end of file diff --git a/tests/baselines/reference/innerModExport2.errors.txt b/tests/baselines/reference/innerModExport2.errors.txt new file mode 100644 index 0000000000000..59c6c4dde8309 --- /dev/null +++ b/tests/baselines/reference/innerModExport2.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/innerModExport2.ts (6 errors) ==== + module Outer { + + // inner mod 1 + var non_export_var: number; + module { + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. + var non_export_var = 0; + export var export_var = 1; + ~~~~~~ +!!! Statement expected. + + function NonExportFunc() { return 0; } + + export function ExportFunc() { return 0; } + } + var export_var: number; + + export var outer_var_export = 0; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export function outerFuncExport() { return 0; } + + } + ~ +!!! Declaration or statement expected. + + Outer.NonExportFunc(); + ~~~~~~~~~~~~~ +!!! Property 'NonExportFunc' does not exist on type 'typeof Outer'. \ No newline at end of file diff --git a/tests/baselines/reference/innerOverloads.js b/tests/baselines/reference/innerOverloads.js new file mode 100644 index 0000000000000..3249ca0da2693 --- /dev/null +++ b/tests/baselines/reference/innerOverloads.js @@ -0,0 +1,22 @@ +//// [innerOverloads.ts] + +function outer() { + function inner(x:number); // should work + function inner(x:string); + function inner(a:any) { return a; } + + return inner(0); +} + +var x = outer(); // should work + + + +//// [innerOverloads.js] +function outer() { + function inner(a) { + return a; + } + return inner(0); +} +var x = outer(); diff --git a/tests/baselines/reference/innerTypeArgumentInference.js b/tests/baselines/reference/innerTypeArgumentInference.js new file mode 100644 index 0000000000000..ac46e177db829 --- /dev/null +++ b/tests/baselines/reference/innerTypeArgumentInference.js @@ -0,0 +1,10 @@ +//// [innerTypeArgumentInference.ts] +interface Generator { (): T; } +function Generate(func: Generator): U { + return Generate(func); +} + +//// [innerTypeArgumentInference.js] +function Generate(func) { + return Generate(func); +} diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt new file mode 100644 index 0000000000000..fdff2d5e39407 --- /dev/null +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== + function takesCallback(callback: (n) =>any) { + + } + + takesCallback( + + function inner(n) { + // this line should raise an error + // otherwise, there's a bug in overload resolution / partial typechecking + var k: string = 10; + ~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + } + ); + \ No newline at end of file diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.js b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.js new file mode 100644 index 0000000000000..af530635e5eb6 --- /dev/null +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.js @@ -0,0 +1,21 @@ +//// [innerTypeCheckOfLambdaArgument.ts] +function takesCallback(callback: (n) =>any) { + +} + +takesCallback( + + function inner(n) { + // this line should raise an error + // otherwise, there's a bug in overload resolution / partial typechecking + var k: string = 10; + } +); + + +//// [innerTypeCheckOfLambdaArgument.js] +function takesCallback(callback) { +} +takesCallback(function inner(n) { + var k = 10; +}); diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.js b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.js new file mode 100644 index 0000000000000..5561c8f014338 --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.js @@ -0,0 +1,47 @@ +//// [innerTypeParameterShadowingOuterOne.ts] +// inner type parameters shadow outer ones of the same name +// no errors expected + +function f() { + function g() { + var x: T; + x.toFixed(); + } + var x: T; + x.getDate(); +} + +function f2() { + function g() { + var x: U; + x.toFixed(); + } + var x: U; + x.getDate(); +} +//function f2() { +// function g() { +// var x: U; +// x.toFixed(); +// } +// var x: U; +// x.getDate(); +//} + +//// [innerTypeParameterShadowingOuterOne.js] +function f() { + function g() { + var x; + x.toFixed(); + } + var x; + x.getDate(); +} +function f2() { + function g() { + var x; + x.toFixed(); + } + var x; + x.getDate(); +} diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js new file mode 100644 index 0000000000000..25422256d94df --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.js @@ -0,0 +1,66 @@ +//// [innerTypeParameterShadowingOuterOne2.ts] +// inner type parameters shadow outer ones of the same name +// no errors expected + +class C { + g() { + var x: T; + x.toFixed(); + } + + h() { + var x: T; + x.getDate(); + } +} + +class C2 { + g() { + var x: U; + x.toFixed(); + } + + h() { + var x: U; + x.getDate(); + } +} +//class C2 { +// g() { +// var x: U; +// x.toFixed(); +// } + +// h() { +// var x: U; +// x.getDate(); +// } +//} + +//// [innerTypeParameterShadowingOuterOne2.js] +var C = (function () { + function C() { + } + C.prototype.g = function () { + var x; + x.toFixed(); + }; + C.prototype.h = function () { + var x; + x.getDate(); + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.g = function () { + var x; + x.toFixed(); + }; + C2.prototype.h = function () { + var x; + x.getDate(); + }; + return C2; +})(); diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.js b/tests/baselines/reference/instanceAndStaticDeclarations1.js new file mode 100644 index 0000000000000..02a54b1212411 --- /dev/null +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.js @@ -0,0 +1,31 @@ +//// [instanceAndStaticDeclarations1.ts] +// from spec + +class Point { + constructor(public x: number, public y: number) { } + public distance(p: Point) { + var dx = this.x - p.x; + var dy = this.y - p.y; + return Math.sqrt(dx * dx + dy * dy); + } + static origin = new Point(0, 0); + static distance(p1: Point, p2: Point) { return p1.distance(p2); } +} + +//// [instanceAndStaticDeclarations1.js] +var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.distance = function (p) { + var dx = this.x - p.x; + var dy = this.y - p.y; + return Math.sqrt(dx * dx + dy * dy); + }; + Point.distance = function (p1, p2) { + return p1.distance(p2); + }; + Point.origin = new Point(0, 0); + return Point; +})(); diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt new file mode 100644 index 0000000000000..124c3ab81dfcf --- /dev/null +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ==== + class C { + foo() { + C.prototype.foo = () => { } + } + + bar(x: number): number { + C.prototype.bar = () => { } // error + ~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type '(x: number) => number': +!!! Type 'void' is not assignable to type 'number'. + C.prototype.bar = (x) => x; // ok + C.prototype.bar = (x: number) => 1; // ok + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js new file mode 100644 index 0000000000000..8ba9f1ea9831d --- /dev/null +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js @@ -0,0 +1,31 @@ +//// [instanceMemberAssignsToClassPrototype.ts] +class C { + foo() { + C.prototype.foo = () => { } + } + + bar(x: number): number { + C.prototype.bar = () => { } // error + C.prototype.bar = (x) => x; // ok + C.prototype.bar = (x: number) => 1; // ok + return 1; + } +} + +//// [instanceMemberAssignsToClassPrototype.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + C.prototype.foo = function () { + }; + }; + C.prototype.bar = function (x) { + C.prototype.bar = function () { + }; + C.prototype.bar = function (x) { return x; }; + C.prototype.bar = function (x) { return 1; }; + return 1; + }; + return C; +})(); diff --git a/tests/baselines/reference/instanceMemberInitialization.js b/tests/baselines/reference/instanceMemberInitialization.js new file mode 100644 index 0000000000000..b62ac68bf52d3 --- /dev/null +++ b/tests/baselines/reference/instanceMemberInitialization.js @@ -0,0 +1,21 @@ +//// [instanceMemberInitialization.ts] +class C { + x = 1; +} + +var c = new C(); +c.x = 3; +var c2 = new C(); +var r = c.x === c2.x; + +//// [instanceMemberInitialization.js] +var C = (function () { + function C() { + this.x = 1; + } + return C; +})(); +var c = new C(); +c.x = 3; +var c2 = new C(); +var r = c.x === c2.x; diff --git a/tests/baselines/reference/instanceOfInExternalModules.js b/tests/baselines/reference/instanceOfInExternalModules.js new file mode 100644 index 0000000000000..e4ebccc365f88 --- /dev/null +++ b/tests/baselines/reference/instanceOfInExternalModules.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/instanceOfInExternalModules.ts] //// + +//// [instanceOfInExternalModules_require.ts] +export class Foo { foo: string; } + +//// [instanceOfInExternalModules_1.ts] +/// +import Bar = require("instanceOfInExternalModules_require"); +function IsFoo(value: any): boolean { + return value instanceof Bar.Foo; +} + + +//// [instanceOfInExternalModules_require.js] +define(["require", "exports"], function (require, exports) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + exports.Foo = Foo; +}); +//// [instanceOfInExternalModules_1.js] +define(["require", "exports", "instanceOfInExternalModules_require"], function (require, exports, Bar) { + function IsFoo(value) { + return value instanceof Bar.Foo; + } +}); diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt new file mode 100644 index 0000000000000..b6cabdb962fb9 --- /dev/null +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts (6 errors) ==== + module NonGeneric { + class C { + x: string; + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + set y(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + fn() { return this; } + constructor(public a: number, private b: number) { } + } + + class D extends C { e: string; } + + var d = new D(1, 2); + var r = d.fn(); + var r2 = r.x; + var r3 = r.y; + r.y = 4; + var r6 = d.y(); // error + ~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + + } + + module Generic { + class C { + x: T; + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + set y(v: U) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + fn() { return this; } + constructor(public a: T, private b: U) { } + } + + class D extends C { e: T; } + + var d = new D(1, ''); + var r = d.fn(); + var r2 = r.x; + var r3 = r.y; + r.y = ''; + var r6 = d.y(); // error + ~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/instancePropertyInClassType.errors.txt b/tests/baselines/reference/instancePropertyInClassType.errors.txt new file mode 100644 index 0000000000000..79177eb22e912 --- /dev/null +++ b/tests/baselines/reference/instancePropertyInClassType.errors.txt @@ -0,0 +1,51 @@ +==== tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts (6 errors) ==== + module NonGeneric { + class C { + x: string; + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + set y(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + fn() { return this; } + constructor(public a: number, private b: number) { } + } + + var c = new C(1, 2); + var r = c.fn(); + var r2 = r.x; + var r3 = r.y; + r.y = 4; + var r6 = c.y(); // error + ~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + + } + + module Generic { + class C { + x: T; + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; + } + set y(v: U) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + fn() { return this; } + constructor(public a: T, private b: U) { } + } + + var c = new C(1, ''); + var r = c.fn(); + var r2 = r.x; + var r3 = r.y; + r.y = ''; + var r6 = c.y(); // error + ~~~~~ +!!! Cannot invoke an expression whose type lacks a call signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/instanceSubtypeCheck1.js b/tests/baselines/reference/instanceSubtypeCheck1.js new file mode 100644 index 0000000000000..f13741247ec88 --- /dev/null +++ b/tests/baselines/reference/instanceSubtypeCheck1.js @@ -0,0 +1,12 @@ +//// [instanceSubtypeCheck1.ts] +interface A +{ + x: A> +} + +interface B extends A +{ + x: B> +} + +//// [instanceSubtypeCheck1.js] diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt new file mode 100644 index 0000000000000..d123ec33f9f9a --- /dev/null +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/instanceSubtypeCheck2.ts (1 errors) ==== + class C1 { + x: C2; + } + + class C2 extends C1 { + ~~ +!!! Class 'C2' incorrectly extends base class 'C1': +!!! Types of property 'x' are incompatible: +!!! Type 'string' is not assignable to type 'C2': +!!! Property 'x' is missing in type 'String'. + x: string + } \ No newline at end of file diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js new file mode 100644 index 0000000000000..f2b709194b340 --- /dev/null +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -0,0 +1,28 @@ +//// [instanceSubtypeCheck2.ts] +class C1 { + x: C2; +} + +class C2 extends C1 { + x: string +} + +//// [instanceSubtypeCheck2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C1); diff --git a/tests/baselines/reference/instanceofOperator.errors.txt b/tests/baselines/reference/instanceofOperator.errors.txt new file mode 100644 index 0000000000000..df7ed3991cb5e --- /dev/null +++ b/tests/baselines/reference/instanceofOperator.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/instanceofOperator.ts (6 errors) ==== + // Spec: + // The instanceof operator requires the left operand to be of type Any or an object type, and the right + // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the + // Boolean primitive type. + + class Object { } + ~~~~~~ +!!! Duplicate identifier 'Object'. + var obj: Object; + + + + 4 instanceof null; + ~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + // Error and should be error + obj instanceof 4; + ~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + Object instanceof obj; + ~~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + + // Error on left hand side + null instanceof null; + ~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + obj instanceof Object; + undefined instanceof undefined; + ~~~~~~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + \ No newline at end of file diff --git a/tests/baselines/reference/instanceofOperator.js b/tests/baselines/reference/instanceofOperator.js new file mode 100644 index 0000000000000..d973550d6af77 --- /dev/null +++ b/tests/baselines/reference/instanceofOperator.js @@ -0,0 +1,37 @@ +//// [instanceofOperator.ts] +// Spec: +// The instanceof operator requires the left operand to be of type Any or an object type, and the right +// operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the +// Boolean primitive type. + +class Object { } +var obj: Object; + + + +4 instanceof null; + +// Error and should be error +obj instanceof 4; +Object instanceof obj; + +// Error on left hand side +null instanceof null; +obj instanceof Object; +undefined instanceof undefined; + + + +//// [instanceofOperator.js] +var Object = (function () { + function Object() { + } + return Object; +})(); +var obj; +4 instanceof null; +obj instanceof 4; +Object instanceof obj; +null instanceof null; +obj instanceof Object; +undefined instanceof undefined; diff --git a/tests/baselines/reference/instanceofOperatorWithAny.js b/tests/baselines/reference/instanceofOperatorWithAny.js new file mode 100644 index 0000000000000..9b553e713cb06 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithAny.js @@ -0,0 +1,8 @@ +//// [instanceofOperatorWithAny.ts] +var a: any; + +var r: boolean = a instanceof a; + +//// [instanceofOperatorWithAny.js] +var a; +var r = a instanceof a; diff --git a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt new file mode 100644 index 0000000000000..f5698b29c6bcb --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.errors.txt @@ -0,0 +1,89 @@ +==== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithInvalidOperands.ts (21 errors) ==== + class C { + foo() { } + } + + var x: any; + + // invalid left operand + // the left operand is required to be of type Any, an object type, or a type parameter type + var a1: number; + var a2: boolean; + var a3: string; + var a4: void; + + var ra1 = a1 instanceof x; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra2 = a2 instanceof x; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra3 = a3 instanceof x; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra4 = a4 instanceof x; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra5 = 0 instanceof x; + ~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra6 = true instanceof x; + ~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra7 = '' instanceof x; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra8 = null instanceof x; + ~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + var ra9 = undefined instanceof x; + ~~~~~~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + // invalid right operand + // the right operand to be of type Any or a subtype of the 'Function' interface type + var b1: number; + var b2: boolean; + var b3: string; + var b4: void; + var o1: {}; + var o2: Object; + var o3: C; + + var rb1 = x instanceof b1; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb2 = x instanceof b2; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb3 = x instanceof b3; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb4 = x instanceof b4; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb5 = x instanceof 0; + ~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb6 = x instanceof true; + ~~~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb7 = x instanceof ''; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb8 = x instanceof o1; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb9 = x instanceof o2; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + var rb10 = x instanceof o3; + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + + // both operands are invalid + var rc1 = '' instanceof {}; + ~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + ~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. \ No newline at end of file diff --git a/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js new file mode 100644 index 0000000000000..0089ac167bcf9 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithInvalidOperands.js @@ -0,0 +1,88 @@ +//// [instanceofOperatorWithInvalidOperands.ts] +class C { + foo() { } +} + +var x: any; + +// invalid left operand +// the left operand is required to be of type Any, an object type, or a type parameter type +var a1: number; +var a2: boolean; +var a3: string; +var a4: void; + +var ra1 = a1 instanceof x; +var ra2 = a2 instanceof x; +var ra3 = a3 instanceof x; +var ra4 = a4 instanceof x; +var ra5 = 0 instanceof x; +var ra6 = true instanceof x; +var ra7 = '' instanceof x; +var ra8 = null instanceof x; +var ra9 = undefined instanceof x; + +// invalid right operand +// the right operand to be of type Any or a subtype of the 'Function' interface type +var b1: number; +var b2: boolean; +var b3: string; +var b4: void; +var o1: {}; +var o2: Object; +var o3: C; + +var rb1 = x instanceof b1; +var rb2 = x instanceof b2; +var rb3 = x instanceof b3; +var rb4 = x instanceof b4; +var rb5 = x instanceof 0; +var rb6 = x instanceof true; +var rb7 = x instanceof ''; +var rb8 = x instanceof o1; +var rb9 = x instanceof o2; +var rb10 = x instanceof o3; + +// both operands are invalid +var rc1 = '' instanceof {}; + +//// [instanceofOperatorWithInvalidOperands.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); +var x; +var a1; +var a2; +var a3; +var a4; +var ra1 = a1 instanceof x; +var ra2 = a2 instanceof x; +var ra3 = a3 instanceof x; +var ra4 = a4 instanceof x; +var ra5 = 0 instanceof x; +var ra6 = true instanceof x; +var ra7 = '' instanceof x; +var ra8 = null instanceof x; +var ra9 = undefined instanceof x; +var b1; +var b2; +var b3; +var b4; +var o1; +var o2; +var o3; +var rb1 = x instanceof b1; +var rb2 = x instanceof b2; +var rb3 = x instanceof b3; +var rb4 = x instanceof b4; +var rb5 = x instanceof 0; +var rb6 = x instanceof true; +var rb7 = x instanceof ''; +var rb8 = x instanceof o1; +var rb9 = x instanceof o2; +var rb10 = x instanceof o3; +var rc1 = '' instanceof {}; diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js new file mode 100644 index 0000000000000..5ccf195cd88db --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.js @@ -0,0 +1,28 @@ +//// [instanceofOperatorWithLHSIsObject.ts] +class C { } + +var x1: any; +var x2: Function; + +var a: {}; +var b: Object; +var c: C; + +var r1 = a instanceof x1; +var r2 = b instanceof x2; +var r3 = c instanceof x1; + +//// [instanceofOperatorWithLHSIsObject.js] +var C = (function () { + function C() { + } + return C; +})(); +var x1; +var x2; +var a; +var b; +var c; +var r1 = a instanceof x1; +var r2 = b instanceof x2; +var r3 = c instanceof x1; diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.js b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.js new file mode 100644 index 0000000000000..34424c6950887 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.js @@ -0,0 +1,11 @@ +//// [instanceofOperatorWithLHSIsTypeParameter.ts] +function foo(t: T) { + var x: any; + var r = t instanceof x; +} + +//// [instanceofOperatorWithLHSIsTypeParameter.js] +function foo(t) { + var x; + var r = t instanceof x; +} diff --git a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.js b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.js new file mode 100644 index 0000000000000..924c0ba6c21a2 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.js @@ -0,0 +1,28 @@ +//// [instanceofOperatorWithRHSIsSubtypeOfFunction.ts] +interface I extends Function { } + +var x: any; +var f1: Function; +var f2: I; +var f3: { (): void }; +var f4: { new (): number }; + +var r1 = x instanceof f1; +var r2 = x instanceof f2; +var r3 = x instanceof f3; +var r4 = x instanceof f4; +var r5 = x instanceof null; +var r6 = x instanceof undefined; + +//// [instanceofOperatorWithRHSIsSubtypeOfFunction.js] +var x; +var f1; +var f2; +var f3; +var f4; +var r1 = x instanceof f1; +var r2 = x instanceof f2; +var r3 = x instanceof f3; +var r4 = x instanceof f4; +var r5 = x instanceof null; +var r6 = x instanceof undefined; diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt new file mode 100644 index 0000000000000..1f74e2c9e5610 --- /dev/null +++ b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts (4 errors) ==== + interface A, S extends A> { } + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + interface B, S extends B> extends A, B> { } + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.js b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.js new file mode 100644 index 0000000000000..a3e883e688ddd --- /dev/null +++ b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.js @@ -0,0 +1,5 @@ +//// [instantiateConstraintsToTypeArguments2.ts] +interface A, S extends A> { } +interface B, S extends B> extends A, B> { } + +//// [instantiateConstraintsToTypeArguments2.js] diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt new file mode 100644 index 0000000000000..d058f42951ba4 --- /dev/null +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithWrongNumberOfTypeArguments.ts (2 errors) ==== + // it is always an error to provide a type argument list whose count does not match the type parameter list + // both of these attempts to construct a type is an error + + class C { + x: T; + } + + var c = new C(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + class D { + x: T + y: U + } + + // BUG 794238 + var d = new D(); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js new file mode 100644 index 0000000000000..5a83ab54f06ff --- /dev/null +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.js @@ -0,0 +1,31 @@ +//// [instantiateGenericClassWithWrongNumberOfTypeArguments.ts] +// it is always an error to provide a type argument list whose count does not match the type parameter list +// both of these attempts to construct a type is an error + +class C { + x: T; +} + +var c = new C(); + +class D { + x: T + y: U +} + +// BUG 794238 +var d = new D(); + +//// [instantiateGenericClassWithWrongNumberOfTypeArguments.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = new C(); +var D = (function () { + function D() { + } + return D; +})(); +var d = new D(); diff --git a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js new file mode 100644 index 0000000000000..11074248766f8 --- /dev/null +++ b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.js @@ -0,0 +1,30 @@ +//// [instantiateGenericClassWithZeroTypeArguments.ts] +// no errors expected when instantiating a generic type with no type arguments provided + +class C { + x: T; +} + +var c = new C(); + +class D { + x: T + y: U +} + +var d = new D(); + + +//// [instantiateGenericClassWithZeroTypeArguments.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = new C(); +var D = (function () { + function D() { + } + return D; +})(); +var d = new D(); diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt new file mode 100644 index 0000000000000..8129005313e22 --- /dev/null +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateNonGenericTypeWithTypeArguments.ts (6 errors) ==== + // it is an error to provide type arguments to a non-generic call + // all of these are errors + + class C { + x: string; + } + + var c = new C(); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + function Foo(): void { } + var r = new Foo(); + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + var f: { (): void }; + var r2 = new f(); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + + var a: any; + // BUG 790977 + var r2 = new a(); + ~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js new file mode 100644 index 0000000000000..5faaaea027d99 --- /dev/null +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.js @@ -0,0 +1,34 @@ +//// [instantiateNonGenericTypeWithTypeArguments.ts] +// it is an error to provide type arguments to a non-generic call +// all of these are errors + +class C { + x: string; +} + +var c = new C(); + +function Foo(): void { } +var r = new Foo(); + +var f: { (): void }; +var r2 = new f(); + +var a: any; +// BUG 790977 +var r2 = new a(); + +//// [instantiateNonGenericTypeWithTypeArguments.js] +var C = (function () { + function C() { + } + return C; +})(); +var c = new C(); +function Foo() { +} +var r = new Foo(); +var f; +var r2 = new f(); +var a; +var r2 = new a(); diff --git a/tests/baselines/reference/instantiateTypeParameter.errors.txt b/tests/baselines/reference/instantiateTypeParameter.errors.txt new file mode 100644 index 0000000000000..6d5a507f4755f --- /dev/null +++ b/tests/baselines/reference/instantiateTypeParameter.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/instantiateTypeParameter.ts (4 errors) ==== + interface Foo { + var x: T<>; + ~~~ +!!! Property or signature expected. + ~~ +!!! Type argument list cannot be empty. + ~~~ +!!! Cannot find name 'T'. + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt new file mode 100644 index 0000000000000..489103dc682d2 --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/instantiatedBaseTypeConstraints.ts (1 errors) ==== + interface Foo, C> { + ~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(bar: C): void; + } + + class Bar implements Foo { + foo(bar: string): void { + } + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.js b/tests/baselines/reference/instantiatedBaseTypeConstraints.js new file mode 100644 index 0000000000000..24e8e66310c4c --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.js @@ -0,0 +1,21 @@ +//// [instantiatedBaseTypeConstraints.ts] +interface Foo, C> { + foo(bar: C): void; +} + +class Bar implements Foo { + foo(bar: string): void { + } +} + + + + +//// [instantiatedBaseTypeConstraints.js] +var Bar = (function () { + function Bar() { + } + Bar.prototype.foo = function (bar) { + }; + return Bar; +})(); diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt new file mode 100644 index 0000000000000..f80877a9142bc --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/instantiatedBaseTypeConstraints2.ts (2 errors) ==== + interface A, S extends A> { } + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + interface B extends A, B> { } \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.js b/tests/baselines/reference/instantiatedBaseTypeConstraints2.js new file mode 100644 index 0000000000000..82e6f408d9785 --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints2.js @@ -0,0 +1,5 @@ +//// [instantiatedBaseTypeConstraints2.ts] +interface A, S extends A> { } +interface B extends A, B> { } + +//// [instantiatedBaseTypeConstraints2.js] diff --git a/tests/baselines/reference/instantiatedModule.js b/tests/baselines/reference/instantiatedModule.js new file mode 100644 index 0000000000000..ab5081c779759 --- /dev/null +++ b/tests/baselines/reference/instantiatedModule.js @@ -0,0 +1,113 @@ +//// [instantiatedModule.ts] +// adding the var makes this an instantiated module + +module M { + export interface Point { x: number; y: number } + export var Point = 1; +} + +// primary expression +var m: typeof M; +var m = M; + +var a1: number; +var a1 = M.Point; +var a1 = m.Point; + +var p1: { x: number; y: number; } +var p1: M.Point; + +// making the point a class instead of an interface +// makes this an instantiated mmodule +module M2 { + export class Point { + x: number; + y: number; + static Origin(): Point { + return { x: 0, y: 0 }; + } + } +} + +var m2: typeof M2; +var m2 = M2; + +// static side of the class +var a2: typeof M2.Point; +var a2 = m2.Point; +var a2 = M2.Point; +var o: M2.Point = a2.Origin(); + +var p2: { x: number; y: number } +var p2: M2.Point; +var p2 = new m2.Point(); +var p2 = new M2.Point(); + +module M3 { + export enum Color { Blue, Red } +} + +var m3: typeof M3; +var m3 = M3; + +var a3: typeof M3.Color; +var a3 = m3.Color; +var a3 = M3.Color; +var blue: M3.Color = a3.Blue; + +var p3: M3.Color; +var p3 = M3.Color.Red; +var p3 = m3.Color.Blue; + + +//// [instantiatedModule.js] +var M; +(function (M) { + M.Point = 1; +})(M || (M = {})); +var m; +var m = M; +var a1; +var a1 = M.Point; +var a1 = m.Point; +var p1; +var p1; +var M2; +(function (M2) { + var Point = (function () { + function Point() { + } + Point.Origin = function () { + return { x: 0, y: 0 }; + }; + return Point; + })(); + M2.Point = Point; +})(M2 || (M2 = {})); +var m2; +var m2 = M2; +var a2; +var a2 = m2.Point; +var a2 = M2.Point; +var o = a2.Origin(); +var p2; +var p2; +var p2 = new m2.Point(); +var p2 = new M2.Point(); +var M3; +(function (M3) { + (function (Color) { + Color[Color["Blue"] = 0] = "Blue"; + Color[Color["Red"] = 1] = "Red"; + })(M3.Color || (M3.Color = {})); + var Color = M3.Color; +})(M3 || (M3 = {})); +var m3; +var m3 = M3; +var a3; +var a3 = m3.Color; +var a3 = M3.Color; +var blue = 0 /* Blue */; +var p3; +var p3 = 1 /* Red */; +var p3 = 0 /* Blue */; diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js new file mode 100644 index 0000000000000..6b84c40d8fd03 --- /dev/null +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -0,0 +1,57 @@ +//// [instantiatedReturnTypeContravariance.ts] +interface B { + +name: string; + +x(): T; + +} + +class c { + +foo(): B { + +return null; + +} + +} + +class d extends c { + +foo(): B { + +return null; + +} + +} + + + + +//// [instantiatedReturnTypeContravariance.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var c = (function () { + function c() { + } + c.prototype.foo = function () { + return null; + }; + return c; +})(); +var d = (function (_super) { + __extends(d, _super); + function d() { + _super.apply(this, arguments); + } + d.prototype.foo = function () { + return null; + }; + return d; +})(c); diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt new file mode 100644 index 0000000000000..ef41f92111663 --- /dev/null +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -0,0 +1,368 @@ +==== tests/cases/compiler/intTypeCheck.ts (73 errors) ==== + interface i1 { + //Property Signatures + p; + p1?; + p2?: string; + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7? (pa1, pa2): void; + } + interface i2 { + //Call Signatures + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + } + interface i3 { + //Construct Signatures + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + } + interface i4 { + //Index Signatures + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + } + interface i5 extends i1 { } + interface i6 extends i2 { } + interface i7 extends i3 { } + interface i8 extends i4 { } + interface i9 { } + + class Base { foo() { } } + + interface i11 { + //Call Signatures + (); + (): number; + (p); + (p1: string); + (p2?: string); + (...p3: any[]); + (p4: string, p5?: string); + (p6: string, ...p7: any[]); + //(p8?: string, ...p9: any[]); + //(p10:string, p8?: string, ...p9: any[]); + + //Construct Signatures + new (); + new (): number; + new (p: string); + new (p2?: string); + new (...p3: any[]); + new (p4: string, p5?: string); + new (p6: string, ...p7: any[]); + + //Index Signatures + [p]; + ~ +!!! An index signature parameter must have a type annotation. + [p1: string]; + ~~~~~~~~~~~~ +!!! An index signature must have a type annotation. + [p2: string, p3: number]; + ~~ +!!! An index signature must have exactly one parameter. + + //Property Signatures + p; + p1?; + p2?: string; + p3(); + p4? (); + p5? (): void; + p6(pa1): void; + p7(pa1, pa2): void; + p7? (pa1, pa2): void; + ~~ +!!! Overload signatures must all be optional or required. + } + + var anyVar: any; + // + // Property signatures + // + var obj0: i1; + var obj1: i1 = { + p: null, + p3: function ():any { return 0; }, + p6: function (pa1):any { return 0; }, + p7: function (pa1, pa2):any { return 0; } + }; + var obj2: i1 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i1': +!!! Property 'p' is missing in type 'Object'. + var obj3: i1 = new obj0; + ~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var obj4: i1 = new Base; + ~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i1': +!!! Property 'p' is missing in type 'Base'. + var obj5: i1 = null; + var obj6: i1 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i1': +!!! Property 'p' is missing in type '() => void'. + //var obj7: i1 = function foo() { }; + var obj8: i1 = anyVar; + var obj9: i1 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i1': +!!! Property 'p' is missing in type 'Boolean'. + ~~ +!!! Cannot find name 'i1'. + var obj10: i1 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Call signatures + // + var obj11: i2; + var obj12: i2 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i2'. + var obj13: i2 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i2'. + var obj14: i2 = new obj11; + ~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + var obj15: i2 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i2'. + var obj16: i2 = null; + var obj17: i2 = function ():any { return 0; }; + //var obj18: i2 = function foo() { }; + var obj19: i2 = anyVar; + var obj20: i2 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i2'. + ~~ +!!! Cannot find name 'i2'. + var obj21: i2 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Construct Signatures + // + var obj22: i3; + var obj23: i3 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i3'. + var obj24: i3 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i3'. + var obj25: i3 = new obj22; + var obj26: i3 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i3'. + var obj27: i3 = null; + var obj28: i3 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i3'. + //var obj29: i3 = function foo() { }; + var obj30: i3 = anyVar; + var obj31: i3 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i3'. + ~~ +!!! Cannot find name 'i3'. + var obj32: i3 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Index Signatures + // + var obj33: i4; + var obj34: i4 = {}; + var obj35: i4 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i4': +!!! Index signature is missing in type 'Object'. + var obj36: i4 = new obj33; + ~~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var obj37: i4 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i4': +!!! Index signature is missing in type 'Base'. + var obj38: i4 = null; + var obj39: i4 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i4': +!!! Index signature is missing in type '() => void'. + //var obj40: i4 = function foo() { }; + var obj41: i4 = anyVar; + var obj42: i4 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i4': +!!! Index signature is missing in type 'Boolean'. + ~~ +!!! Cannot find name 'i4'. + var obj43: i4 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Interface Derived I1 + // + var obj44: i5; + var obj45: i5 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i5': +!!! Property 'p' is missing in type '{}'. + var obj46: i5 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i5': +!!! Property 'p' is missing in type 'Object'. + var obj47: i5 = new obj44; + ~~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var obj48: i5 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i5': +!!! Property 'p' is missing in type 'Base'. + var obj49: i5 = null; + var obj50: i5 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i5': +!!! Property 'p' is missing in type '() => void'. + //var obj51: i5 = function foo() { }; + var obj52: i5 = anyVar; + var obj53: i5 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i5': +!!! Property 'p' is missing in type 'Boolean'. + ~~ +!!! Cannot find name 'i5'. + var obj54: i5 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Interface Derived I2 + // + var obj55: i6; + var obj56: i6 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i6'. + var obj57: i6 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i6'. + var obj58: i6 = new obj55; + ~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + var obj59: i6 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i6'. + var obj60: i6 = null; + var obj61: i6 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i6': +!!! Type 'void' is not assignable to type 'number'. + //var obj62: i6 = function foo() { }; + var obj63: i6 = anyVar; + var obj64: i6 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i6'. + ~~ +!!! Cannot find name 'i6'. + var obj65: i6 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Interface Derived I3 + // + var obj66: i7; + var obj67: i7 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i7'. + var obj68: i7 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i7'. + var obj69: i7 = new obj66; + var obj70: i7 = new Base; + ~~~~~~~~~~~~ +!!! Neither type 'i7' nor type 'Base' is assignable to the other. + var obj71: i7 = null; + var obj72: i7 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i7'. + //var obj73: i7 = function foo() { }; + var obj74: i7 = anyVar; + var obj75: i7 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i7'. + ~~ +!!! Cannot find name 'i7'. + var obj76: i7 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + // + // Interface Derived I4 + // + var obj77: i8; + var obj78: i8 = {}; + var obj79: i8 = new Object(); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Object' is not assignable to type 'i8': +!!! Index signature is missing in type 'Object'. + var obj80: i8 = new obj77; + ~~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var obj81: i8 = new Base; + ~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'i8': +!!! Index signature is missing in type 'Base'. + var obj82: i8 = null; + var obj83: i8 = function () { }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => void' is not assignable to type 'i8': +!!! Index signature is missing in type '() => void'. + //var obj84: i8 = function foo() { }; + var obj85: i8 = anyVar; + var obj86: i8 = new anyVar; + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'i8': +!!! Index signature is missing in type 'Boolean'. + ~~ +!!! Cannot find name 'i8'. + var obj87: i8 = new {}; + ~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.js b/tests/baselines/reference/interMixingModulesInterfaces0.js new file mode 100644 index 0000000000000..8a35ab32f660a --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces0.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces0.ts] +module A { + + export module B { + export function createB(): B { + return null; + } + } + + export interface B { + name: string; + value: number; + } +} + +var x: A.B = A.B.createB(); + +//// [interMixingModulesInterfaces0.js] +var A; +(function (A) { + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var x = A.B.createB(); diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.js b/tests/baselines/reference/interMixingModulesInterfaces1.js new file mode 100644 index 0000000000000..8ab1d6c0f2a33 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces1.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces1.ts] +module A { + + export interface B { + name: string; + value: number; + } + + export module B { + export function createB(): B { + return null; + } + } +} + +var x: A.B = A.B.createB(); + +//// [interMixingModulesInterfaces1.js] +var A; +(function (A) { + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var x = A.B.createB(); diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.js b/tests/baselines/reference/interMixingModulesInterfaces2.js new file mode 100644 index 0000000000000..3a8babaf0481c --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces2.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces2.ts] +module A { + + export interface B { + name: string; + value: number; + } + + module B { + export function createB(): B { + return null; + } + } +} + +var x: A.B = null; + +//// [interMixingModulesInterfaces2.js] +var A; +(function (A) { + var B; + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(B || (B = {})); +})(A || (A = {})); +var x = null; diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.js b/tests/baselines/reference/interMixingModulesInterfaces3.js new file mode 100644 index 0000000000000..7f8579f9cd98e --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces3.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces3.ts] +module A { + + module B { + export function createB(): B { + return null; + } + } + + export interface B { + name: string; + value: number; + } +} + +var x: A.B = null; + +//// [interMixingModulesInterfaces3.js] +var A; +(function (A) { + var B; + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(B || (B = {})); +})(A || (A = {})); +var x = null; diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.js b/tests/baselines/reference/interMixingModulesInterfaces4.js new file mode 100644 index 0000000000000..5eb2023add07f --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces4.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces4.ts] +module A { + + export module B { + export function createB(): number { + return null; + } + } + + interface B { + name: string; + value: number; + } +} + +var x : number = A.B.createB(); + +//// [interMixingModulesInterfaces4.js] +var A; +(function (A) { + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var x = A.B.createB(); diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.js b/tests/baselines/reference/interMixingModulesInterfaces5.js new file mode 100644 index 0000000000000..6faa5631bc322 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces5.js @@ -0,0 +1,29 @@ +//// [interMixingModulesInterfaces5.ts] +module A { + + interface B { + name: string; + value: number; + } + + export module B { + export function createB(): number { + return null; + } + } +} + +var x: number = A.B.createB(); + +//// [interMixingModulesInterfaces5.js] +var A; +(function (A) { + (function (B) { + function createB() { + return null; + } + B.createB = createB; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var x = A.B.createB(); diff --git a/tests/baselines/reference/interface0.js b/tests/baselines/reference/interface0.js new file mode 100644 index 0000000000000..aecdb91e8a362 --- /dev/null +++ b/tests/baselines/reference/interface0.js @@ -0,0 +1,10 @@ +//// [interface0.ts] +interface Generic { + x: T; +} + +var y: Generic = { x: 3 }; + + +//// [interface0.js] +var y = { x: 3 }; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..20b6b00d4e911 --- /dev/null +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -0,0 +1,63 @@ +==== tests/cases/compiler/interfaceAssignmentCompat.ts (4 errors) ==== + module M { + export enum Color { + Green, + Blue, + Brown, + } + + export interface IEye { + color:number; + } + + export interface IFrenchEye { + coleur:number; + } + + export function CompareEyes(a:IEye,b:IEye):number { + return a.color-b.color; + } + + export function CompareYeux(a:IFrenchEye,b:IFrenchEye):number { + return a.coleur-b.coleur; + } + + export function test() { + var x:IEye[]= []; + var result=""; + + x[0]={ color:Color.Brown }; + x[1]={ color:Color.Blue }; + x[2]={ color:Color.Green }; + + x=x.sort(CompareYeux); // parameter mismatch + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + // type of z inferred from specialized array type + var z=x.sort(CompareEyes); // ok + + for (var i=0,len=z.length;i=0;j--) { + eeks[j]=z[j]; // nope: element assignment + ~~~~~~~ +!!! Type 'IEye' is not assignable to type 'IFrenchEye': +!!! Property 'coleur' is missing in type 'IEye'. + } + eeks=z; // nope: array assignment + ~~~~ +!!! Type 'IEye[]' is not assignable to type 'IFrenchEye[]': +!!! Type 'IEye' is not assignable to type 'IFrenchEye'. + return result; + } + } + + M.test(); + + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceAssignmentCompat.js b/tests/baselines/reference/interfaceAssignmentCompat.js new file mode 100644 index 0000000000000..d6ff097873585 --- /dev/null +++ b/tests/baselines/reference/interfaceAssignmentCompat.js @@ -0,0 +1,92 @@ +//// [interfaceAssignmentCompat.ts] +module M { + export enum Color { + Green, + Blue, + Brown, + } + + export interface IEye { + color:number; + } + + export interface IFrenchEye { + coleur:number; + } + + export function CompareEyes(a:IEye,b:IEye):number { + return a.color-b.color; + } + + export function CompareYeux(a:IFrenchEye,b:IFrenchEye):number { + return a.coleur-b.coleur; + } + + export function test() { + var x:IEye[]= []; + var result=""; + + x[0]={ color:Color.Brown }; + x[1]={ color:Color.Blue }; + x[2]={ color:Color.Green }; + + x=x.sort(CompareYeux); // parameter mismatch + // type of z inferred from specialized array type + var z=x.sort(CompareEyes); // ok + + for (var i=0,len=z.length;i=0;j--) { + eeks[j]=z[j]; // nope: element assignment + } + eeks=z; // nope: array assignment + return result; + } +} + +M.test(); + + + + +//// [interfaceAssignmentCompat.js] +var M; +(function (M) { + (function (Color) { + Color[Color["Green"] = 0] = "Green"; + Color[Color["Blue"] = 1] = "Blue"; + Color[Color["Brown"] = 2] = "Brown"; + })(M.Color || (M.Color = {})); + var Color = M.Color; + function CompareEyes(a, b) { + return a.color - b.color; + } + M.CompareEyes = CompareEyes; + function CompareYeux(a, b) { + return a.coleur - b.coleur; + } + M.CompareYeux = CompareYeux; + function test() { + var x = []; + var result = ""; + x[0] = { color: 2 /* Brown */ }; + x[1] = { color: 1 /* Blue */ }; + x[2] = { color: 0 /* Green */ }; + x = x.sort(CompareYeux); + var z = x.sort(CompareEyes); + for (var i = 0, len = z.length; i < len; i++) { + result += ((Color._map[z[i].color]) + "\r\n"); + } + var eeks = []; + for (var j = z.length = 1; j >= 0; j--) { + eeks[j] = z[j]; + } + eeks = z; + return result; + } + M.test = test; +})(M || (M = {})); +M.test(); diff --git a/tests/baselines/reference/interfaceContextualType.js b/tests/baselines/reference/interfaceContextualType.js new file mode 100644 index 0000000000000..2dbdb958d6b2d --- /dev/null +++ b/tests/baselines/reference/interfaceContextualType.js @@ -0,0 +1,38 @@ +//// [interfaceContextualType.ts] +export interface IOptions { + italic?: boolean; + bold?: boolean; +} +export interface IMap { + [s: string]: IOptions; +} + +class Bug { + public values: IMap; + ok() { + this.values = {}; + this.values['comments'] = { italic: true }; + } + shouldBeOK() { + this.values = { + comments: { italic: true } + }; + } +} + + +//// [interfaceContextualType.js] +var Bug = (function () { + function Bug() { + } + Bug.prototype.ok = function () { + this.values = {}; + this.values['comments'] = { italic: true }; + }; + Bug.prototype.shouldBeOK = function () { + this.values = { + comments: { italic: true } + }; + }; + return Bug; +})(); diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt new file mode 100644 index 0000000000000..6e852591719be --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -0,0 +1,70 @@ +==== tests/cases/compiler/interfaceDeclaration1.ts (6 errors) ==== + interface I1 { + item:number; + item:number; + ~~~~ +!!! Duplicate identifier 'item'. + } + + interface I2 { + item:any; + item:number; + ~~~~ +!!! Duplicate identifier 'item'. + } + + interface I3 { + prototype:number; + } + + interface I4 { + class:number; + number:number; + super:number; + prototype:number; + } + + interface I5 extends I5 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + foo():void; + ~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'I5' recursively references itself as a base type. + + interface I6 { + ():void; + } + + interface I7 extends I6 { } + + var v1:I7; + v1(); + + class C1 implements I3 { + ~~ +!!! Class 'C1' incorrectly implements interface 'I3': +!!! Property 'prototype' is missing in type 'C1'. + constructor() { + var prototype: number = 3; + } + } + + interface i8 extends i9 { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'i8' recursively references itself as a base type. + interface i9 extends i8 { } + + interface i10 { + foo():number; + } + + interface i11{ + foo():string; + } + + interface i12 extends i10, i11 { } + ~~~ +!!! Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': +!!! Named properties 'foo' of types 'i10' and 'i11' are not identical. + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration1.js b/tests/baselines/reference/interfaceDeclaration1.js new file mode 100644 index 0000000000000..a7ec1249a256b --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration1.js @@ -0,0 +1,64 @@ +//// [interfaceDeclaration1.ts] +interface I1 { + item:number; + item:number; +} + +interface I2 { + item:any; + item:number; +} + +interface I3 { + prototype:number; +} + +interface I4 { + class:number; + number:number; + super:number; + prototype:number; +} + +interface I5 extends I5 { + foo():void; +} + +interface I6 { + ():void; +} + +interface I7 extends I6 { } + +var v1:I7; +v1(); + +class C1 implements I3 { + constructor() { + var prototype: number = 3; + } +} + +interface i8 extends i9 { } +interface i9 extends i8 { } + +interface i10 { + foo():number; +} + +interface i11{ + foo():string; +} + +interface i12 extends i10, i11 { } + + +//// [interfaceDeclaration1.js] +var v1; +v1(); +var C1 = (function () { + function C1() { + var prototype = 3; + } + return C1; +})(); diff --git a/tests/baselines/reference/interfaceDeclaration2.errors.txt b/tests/baselines/reference/interfaceDeclaration2.errors.txt new file mode 100644 index 0000000000000..a7ee7796372f6 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration2.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/interfaceDeclaration2.ts (1 errors) ==== + interface I1 { } + module I1 { } + + interface I2 { } + class I2 { } + ~~ +!!! Duplicate identifier 'I2'. + + interface I3 { } + function I3() { } + + interface I4 { } + var I4:number; + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration2.js b/tests/baselines/reference/interfaceDeclaration2.js new file mode 100644 index 0000000000000..0bd59c065e026 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration2.js @@ -0,0 +1,24 @@ +//// [interfaceDeclaration2.ts] +interface I1 { } +module I1 { } + +interface I2 { } +class I2 { } + +interface I3 { } +function I3() { } + +interface I4 { } +var I4:number; + + + +//// [interfaceDeclaration2.js] +var I2 = (function () { + function I2() { + } + return I2; +})(); +function I3() { +} +var I4; diff --git a/tests/baselines/reference/interfaceDeclaration3.errors.txt b/tests/baselines/reference/interfaceDeclaration3.errors.txt new file mode 100644 index 0000000000000..f3a861a849b38 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration3.errors.txt @@ -0,0 +1,68 @@ +==== tests/cases/compiler/interfaceDeclaration3.ts (3 errors) ==== + interface I1 { item:number; } + + module M1 { + interface I1 { item:string; } + interface I2 { item:number; } + class C1 implements I1 { + ~~ +!!! Class 'C1' incorrectly implements interface 'I1': +!!! Types of property 'item' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + public item:number; + } + class C2 implements I1 { + public item:string; + } + class C3 implements I2 { + public item:number; + } + + class C4 implements M2.I1 { + public item:string; + } + + class C5 implements M2.M3.I1 { + public item:string; + } + } + + export module M2 { + export interface I1 { item:string; } + export interface I2 { item:string; } + export module M3 { + export interface I1 { item:string; } + } + class C1 implements I1 { + ~~ +!!! Class 'C1' incorrectly implements interface 'I1': +!!! Types of property 'item' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + public item:number; + } + class C2 implements I1 { + public item:string; + } + class C3 implements I2 { + public item:string; + } + } + + class C1 implements I1 { + public item:number; + } + + class C2 implements M2.I1 { + public item:string; + } + + class C3 implements M2.M3.I1 { + public item:string; + } + + interface I2 extends I1 { item:string; } + ~~ +!!! Interface 'I2' incorrectly extends interface 'I1': +!!! Types of property 'item' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration3.js b/tests/baselines/reference/interfaceDeclaration3.js new file mode 100644 index 0000000000000..95d8409bd4c57 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration3.js @@ -0,0 +1,121 @@ +//// [interfaceDeclaration3.ts] +interface I1 { item:number; } + +module M1 { + interface I1 { item:string; } + interface I2 { item:number; } + class C1 implements I1 { + public item:number; + } + class C2 implements I1 { + public item:string; + } + class C3 implements I2 { + public item:number; + } + + class C4 implements M2.I1 { + public item:string; + } + + class C5 implements M2.M3.I1 { + public item:string; + } +} + +export module M2 { + export interface I1 { item:string; } + export interface I2 { item:string; } + export module M3 { + export interface I1 { item:string; } + } + class C1 implements I1 { + public item:number; + } + class C2 implements I1 { + public item:string; + } + class C3 implements I2 { + public item:string; + } +} + +class C1 implements I1 { + public item:number; +} + +class C2 implements M2.I1 { + public item:string; +} + +class C3 implements M2.M3.I1 { + public item:string; +} + +interface I2 extends I1 { item:string; } + + +//// [interfaceDeclaration3.js] +define(["require", "exports"], function (require, exports) { + var M1; + (function (M1) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var C3 = (function () { + function C3() { + } + return C3; + })(); + var C4 = (function () { + function C4() { + } + return C4; + })(); + var C5 = (function () { + function C5() { + } + return C5; + })(); + })(M1 || (M1 = {})); + (function (M2) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var C3 = (function () { + function C3() { + } + return C3; + })(); + })(exports.M2 || (exports.M2 = {})); + var M2 = exports.M2; + var C1 = (function () { + function C1() { + } + return C1; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var C3 = (function () { + function C3() { + } + return C3; + })(); +}); diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt new file mode 100644 index 0000000000000..3f81ffba644ff --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/interfaceDeclaration4.ts (6 errors) ==== + // Import this module when test harness supports external modules. Also remove the internal module below. + // import Foo = require("interfaceDeclaration5") + module Foo { + export interface I1 { item: string; } + export class C1 { } + } + + class C1 implements Foo.I1 { + public item:string; + } + + // Allowed + interface I2 extends Foo.I1 { + item:string; + } + + // Negative Case + interface I3 extends Foo.I1 { + ~~ +!!! Interface 'I3' incorrectly extends interface 'I1': +!!! Types of property 'item' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + item:number; + } + + interface I4 extends Foo.I1 { + token:string; + } + + // Err - not implemented item + class C2 implements I4 { + ~~ +!!! Class 'C2' incorrectly implements interface 'I4': +!!! Property 'item' is missing in type 'C2'. + public token: string; + } + + interface I5 extends Foo { } + + // Negative case + interface I6 extends Foo.C1 { } + + class C3 implements Foo.I1 { } + ~~ +!!! Class 'C3' incorrectly implements interface 'I1': +!!! Property 'item' is missing in type 'C3'. + + // Negative case + interface Foo.I1 { } + ~ +!!! '{' expected. + ~ +!!! ';' expected. + ~~ +!!! Cannot find name 'I1'. + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration5.js b/tests/baselines/reference/interfaceDeclaration5.js new file mode 100644 index 0000000000000..acb40160d842b --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration5.js @@ -0,0 +1,14 @@ +//// [interfaceDeclaration5.ts] +export interface I1 { item:string; } +export class C1 { } + + +//// [interfaceDeclaration5.js] +define(["require", "exports"], function (require, exports) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + exports.C1 = C1; +}); diff --git a/tests/baselines/reference/interfaceDeclaration6.errors.txt b/tests/baselines/reference/interfaceDeclaration6.errors.txt new file mode 100644 index 0000000000000..a517250e9b906 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration6.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/interfaceDeclaration6.ts (1 errors) ==== + interface i1 { foo: number; }; + interface i2 extends i1 { foo: number; }; + interface i3 extends i1 { foo: string; }; + ~~ +!!! Interface 'i3' incorrectly extends interface 'i1': +!!! Types of property 'foo' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + interface i4 { + bar():any; + bar():any; + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration6.js b/tests/baselines/reference/interfaceDeclaration6.js new file mode 100644 index 0000000000000..e5d1e2e09b753 --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration6.js @@ -0,0 +1,13 @@ +//// [interfaceDeclaration6.ts] +interface i1 { foo: number; }; +interface i2 extends i1 { foo: number; }; +interface i3 extends i1 { foo: string; }; +interface i4 { + bar():any; + bar():any; +} + +//// [interfaceDeclaration6.js] +; +; +; diff --git a/tests/baselines/reference/interfaceExtendingClass.errors.txt b/tests/baselines/reference/interfaceExtendingClass.errors.txt new file mode 100644 index 0000000000000..7600d983fd77e --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClass.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass.ts (1 errors) ==== + class Foo { + x: string; + y() { } + get Z() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + [x: string]: Object; + } + + interface I extends Foo { + } + + var i: I; + var r1 = i.x; + var r2 = i.y(); + var r3 = i.Z; + + var f: Foo = i; + i = f; \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt new file mode 100644 index 0000000000000..bfff1be2b3ca9 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (6 errors) ==== + class Foo { + x: string; + y() { } + get Z() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + [x: string]: Object; + } + + interface I2 extends Foo { // error + a: { + ~~~~ + toString: () => { + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. + return 1; + ~~~~~~ +!!! Property or signature expected. + ~~~~~~~~~ +!!! 'return' statement has no containing function. + }; + ~ +!!! Declaration or statement expected. + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt new file mode 100644 index 0000000000000..525f9e2d517f2 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts (2 errors) ==== + class Foo { + private x: string; + } + + interface I extends Foo { // error + ~ +!!! Interface 'I' incorrectly extends interface 'Foo': +!!! Private property 'x' cannot be reimplemented. + x: string; + } + + interface I2 extends Foo { + y: string; + } + + var i: I2; + var r = i.y; + var r2 = i.x; // error + ~~~ +!!! Property 'Foo.x' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js new file mode 100644 index 0000000000000..5304068fdd843 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js @@ -0,0 +1,26 @@ +//// [interfaceExtendingClassWithPrivates.ts] +class Foo { + private x: string; +} + +interface I extends Foo { // error + x: string; +} + +interface I2 extends Foo { + y: string; +} + +var i: I2; +var r = i.y; +var r2 = i.x; // error + +//// [interfaceExtendingClassWithPrivates.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var i; +var r = i.y; +var r2 = i.x; diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt new file mode 100644 index 0000000000000..9af19f5f67e85 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts (5 errors) ==== + class Foo { + private x: string; + } + + class Bar { + private x: string; + } + + interface I3 extends Foo, Bar { // error + ~~ +!!! Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +!!! Named properties 'x' of types 'Foo' and 'Bar' are not identical. + } + + interface I4 extends Foo, Bar { // error + ~~ +!!! Interface 'I4' incorrectly extends interface 'Bar': +!!! Private property 'x' cannot be reimplemented. + ~~ +!!! Interface 'I4' incorrectly extends interface 'Foo': +!!! Private property 'x' cannot be reimplemented. + x: string; + } + + class Baz { + private y: string; + } + + interface I5 extends Foo, Baz { + z: string; + } + + var i: I5; + var r: string = i.z; + var r2 = i.x; // error + ~~~ +!!! Property 'Foo.x' is inaccessible. + var r3 = i.y; // error + ~~~ +!!! Property 'Baz.y' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js new file mode 100644 index 0000000000000..06c1c040a9648 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js @@ -0,0 +1,49 @@ +//// [interfaceExtendingClassWithPrivates2.ts] +class Foo { + private x: string; +} + +class Bar { + private x: string; +} + +interface I3 extends Foo, Bar { // error +} + +interface I4 extends Foo, Bar { // error + x: string; +} + +class Baz { + private y: string; +} + +interface I5 extends Foo, Baz { + z: string; +} + +var i: I5; +var r: string = i.z; +var r2 = i.x; // error +var r3 = i.y; // error + +//// [interfaceExtendingClassWithPrivates2.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function () { + function Bar() { + } + return Bar; +})(); +var Baz = (function () { + function Baz() { + } + return Baz; +})(); +var i; +var r = i.z; +var r2 = i.x; +var r3 = i.y; diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js new file mode 100644 index 0000000000000..5903726c05d33 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -0,0 +1,64 @@ +//// [interfaceExtendsClass1.ts] +class Control { + private state: any; +} +interface SelectableControl extends Control { + select(): void; +} +class Button extends Control { + select() { } +} +class TextBox extends Control { + select() { } +} +class Image extends Control { +} +class Location { + select() { } +} + + +//// [interfaceExtendsClass1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Control = (function () { + function Control() { + } + return Control; +})(); +var Button = (function (_super) { + __extends(Button, _super); + function Button() { + _super.apply(this, arguments); + } + Button.prototype.select = function () { + }; + return Button; +})(Control); +var TextBox = (function (_super) { + __extends(TextBox, _super); + function TextBox() { + _super.apply(this, arguments); + } + TextBox.prototype.select = function () { + }; + return TextBox; +})(Control); +var Image = (function (_super) { + __extends(Image, _super); + function Image() { + _super.apply(this, arguments); + } + return Image; +})(Control); +var Location = (function () { + function Location() { + } + Location.prototype.select = function () { + }; + return Location; +})(); diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt new file mode 100644 index 0000000000000..e9864c85b6bd1 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts (3 errors) ==== + class C { + public foo(x: any) { return x; } + private x = 1; + } + + interface I extends C { + other(x: any): any; + } + + class D extends C implements I { + public foo(x: any) { return x; } + other(x: any) { return x; } + bar() { } + } + + var c: C; + var i: I; + var d: D; + + c = i; + i = c; // error + ~ +!!! Type 'C' is not assignable to type 'I': +!!! Property 'other' is missing in type 'C'. + + i = d; + d = i; // error + ~ +!!! Type 'I' is not assignable to type 'D': +!!! Property 'bar' is missing in type 'I'. + + c = d; + d = c; // error + ~ +!!! Type 'C' is not assignable to type 'D': +!!! Property 'other' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js new file mode 100644 index 0000000000000..c609b9cf5a85f --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -0,0 +1,69 @@ +//// [interfaceExtendsClassWithPrivate1.ts] +class C { + public foo(x: any) { return x; } + private x = 1; +} + +interface I extends C { + other(x: any): any; +} + +class D extends C implements I { + public foo(x: any) { return x; } + other(x: any) { return x; } + bar() { } +} + +var c: C; +var i: I; +var d: D; + +c = i; +i = c; // error + +i = d; +d = i; // error + +c = d; +d = c; // error + +//// [interfaceExtendsClassWithPrivate1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + this.x = 1; + } + C.prototype.foo = function (x) { + return x; + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.foo = function (x) { + return x; + }; + D.prototype.other = function (x) { + return x; + }; + D.prototype.bar = function () { + }; + return D; +})(C); +var c; +var i; +var d; +c = i; +i = c; +i = d; +d = i; +c = d; +d = c; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt new file mode 100644 index 0000000000000..54d0ebef980ab --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts (4 errors) ==== + class C { + public foo(x: any) { return x; } + private x = 1; + } + + interface I extends C { + other(x: any): any; + } + + class D extends C implements I { // error + ~ +!!! Class 'D' incorrectly extends base class 'C': +!!! Private property 'x' cannot be reimplemented. + ~ +!!! Class 'D' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + public foo(x: any) { return x; } + private x = 2; + private y = 3; + other(x: any) { return x; } + bar() {} + } + + class D2 extends C implements I { // error + ~~ +!!! Class 'D2' incorrectly extends base class 'C': +!!! Private property 'x' cannot be reimplemented. + ~~ +!!! Class 'D2' incorrectly implements interface 'I': +!!! Private property 'x' cannot be reimplemented. + public foo(x: any) { return x; } + private x = ""; + other(x: any) { return x; } + bar() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js new file mode 100644 index 0000000000000..5805302d7d757 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -0,0 +1,74 @@ +//// [interfaceExtendsClassWithPrivate2.ts] +class C { + public foo(x: any) { return x; } + private x = 1; +} + +interface I extends C { + other(x: any): any; +} + +class D extends C implements I { // error + public foo(x: any) { return x; } + private x = 2; + private y = 3; + other(x: any) { return x; } + bar() {} +} + +class D2 extends C implements I { // error + public foo(x: any) { return x; } + private x = ""; + other(x: any) { return x; } + bar() { } +} + +//// [interfaceExtendsClassWithPrivate2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + this.x = 1; + } + C.prototype.foo = function (x) { + return x; + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + this.x = 2; + this.y = 3; + } + D.prototype.foo = function (x) { + return x; + }; + D.prototype.other = function (x) { + return x; + }; + D.prototype.bar = function () { + }; + return D; +})(C); +var D2 = (function (_super) { + __extends(D2, _super); + function D2() { + _super.apply(this, arguments); + this.x = ""; + } + D2.prototype.foo = function (x) { + return x; + }; + D2.prototype.other = function (x) { + return x; + }; + D2.prototype.bar = function () { + }; + return D2; +})(C); diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt new file mode 100644 index 0000000000000..caf890c506e36 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ==== + interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; + } + + interface I2 { + iFn(n:number, s:string):void; + } + + class C1 implements I1,I2 { + ~~ +!!! Class 'C1' incorrectly implements interface 'I1': +!!! Private property 'iObj' cannot be reimplemented. + ~~ +!!! Class 'C1' incorrectly implements interface 'I2': +!!! Private property 'iFn' cannot be reimplemented. + private iFn(); + private iFn(n?:number, s?:string) { } + private iAny:any; + private iNum:number; + private iObj:{ }; + } + + interface I3 { + x: number; + } + + interface I4 { + ():I3; + new ():I3; + [call:number]:string; + } + + class C2 implements I3 { + public x = 1; + } + + var a:I4 = function(){ + ~~~~~~~~~~~~~~~~~~~ + return new C2(); + ~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Type '() => C2' is not assignable to type 'I4'. + new a(); + + /*var b:I4 = C2; + new b(); + */ + + var c:I4; + c[5]; + c["foo"]; + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation1.js b/tests/baselines/reference/interfaceImplementation1.js new file mode 100644 index 0000000000000..6a7687e45f9e3 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation1.js @@ -0,0 +1,69 @@ +//// [interfaceImplementation1.ts] +interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; +} + +interface I2 { + iFn(n:number, s:string):void; +} + +class C1 implements I1,I2 { + private iFn(); + private iFn(n?:number, s?:string) { } + private iAny:any; + private iNum:number; + private iObj:{ }; +} + +interface I3 { + x: number; +} + +interface I4 { + ():I3; + new ():I3; + [call:number]:string; +} + +class C2 implements I3 { + public x = 1; +} + +var a:I4 = function(){ + return new C2(); +} +new a(); + +/*var b:I4 = C2; +new b(); +*/ + +var c:I4; +c[5]; +c["foo"]; + + +//// [interfaceImplementation1.js] +var C1 = (function () { + function C1() { + } + C1.prototype.iFn = function (n, s) { + }; + return C1; +})(); +var C2 = (function () { + function C2() { + this.x = 1; + } + return C2; +})(); +var a = function () { + return new C2(); +}; +new a(); +var c; +c[5]; +c["foo"]; diff --git a/tests/baselines/reference/interfaceImplementation2.errors.txt b/tests/baselines/reference/interfaceImplementation2.errors.txt new file mode 100644 index 0000000000000..3e050e9b05637 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/interfaceImplementation2.ts (1 errors) ==== + interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; + } + + class C3 implements I1 { + ~~ +!!! Class 'C3' incorrectly implements interface 'I1': +!!! Property 'iFn' is missing in type 'C3'. + public iObj:{ }; + public iNum:number; + public iAny:any; + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation2.js b/tests/baselines/reference/interfaceImplementation2.js new file mode 100644 index 0000000000000..ac571a364b573 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation2.js @@ -0,0 +1,21 @@ +//// [interfaceImplementation2.ts] +interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; +} + +class C3 implements I1 { + public iObj:{ }; + public iNum:number; + public iAny:any; +} + + +//// [interfaceImplementation2.js] +var C3 = (function () { + function C3() { + } + return C3; +})(); diff --git a/tests/baselines/reference/interfaceImplementation3.errors.txt b/tests/baselines/reference/interfaceImplementation3.errors.txt new file mode 100644 index 0000000000000..b89b58fc37914 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation3.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/interfaceImplementation3.ts (1 errors) ==== + interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; + } + + class C4 implements I1 { + ~~ +!!! Class 'C4' incorrectly implements interface 'I1': +!!! Property 'iAny' is missing in type 'C4'. + public iObj:{ }; + public iNum:number; + public iFn() { } + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation3.js b/tests/baselines/reference/interfaceImplementation3.js new file mode 100644 index 0000000000000..626c92e83d170 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation3.js @@ -0,0 +1,25 @@ +//// [interfaceImplementation3.ts] +interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; +} + +class C4 implements I1 { + public iObj:{ }; + public iNum:number; + public iFn() { } +} + + + + +//// [interfaceImplementation3.js] +var C4 = (function () { + function C4() { + } + C4.prototype.iFn = function () { + }; + return C4; +})(); diff --git a/tests/baselines/reference/interfaceImplementation4.errors.txt b/tests/baselines/reference/interfaceImplementation4.errors.txt new file mode 100644 index 0000000000000..e2af897853d3b --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation4.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/interfaceImplementation4.ts (1 errors) ==== + interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; + } + + class C5 implements I1 { + ~~ +!!! Class 'C5' incorrectly implements interface 'I1': +!!! Property 'iObj' is missing in type 'C5'. + public iNum:number; + public iAny:any; + public iFn() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation4.js b/tests/baselines/reference/interfaceImplementation4.js new file mode 100644 index 0000000000000..94565d1b22fb5 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation4.js @@ -0,0 +1,23 @@ +//// [interfaceImplementation4.ts] +interface I1 { + iObj:{ }; + iNum:number; + iAny:any; + iFn():void; +} + +class C5 implements I1 { + public iNum:number; + public iAny:any; + public iFn() { } +} + + +//// [interfaceImplementation4.js] +var C5 = (function () { + function C5() { + } + C5.prototype.iFn = function () { + }; + return C5; +})(); diff --git a/tests/baselines/reference/interfaceImplementation5.errors.txt b/tests/baselines/reference/interfaceImplementation5.errors.txt new file mode 100644 index 0000000000000..de49d201e68f8 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation5.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/compiler/interfaceImplementation5.ts (8 errors) ==== + interface I1 { + getset1:number; + } + + class C1 implements I1 { + public get getset1(){return 1;} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class C2 implements I1 { + public set getset1(baz:number){} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class C3 implements I1 { + public get getset1(){return 1;} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set getset1(baz:number){} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class C4 implements I1 { + public get getset1(){var x:any; return x;} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class C5 implements I1 { + public set getset1(baz:any){} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + class C6 implements I1 { + public set getset1(baz:any){} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public get getset1(){var x:any; return x;} + ~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation6.errors.txt b/tests/baselines/reference/interfaceImplementation6.errors.txt new file mode 100644 index 0000000000000..a935fa60c7dcf --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation6.errors.txt @@ -0,0 +1,31 @@ +==== tests/cases/compiler/interfaceImplementation6.ts (2 errors) ==== + interface I1 { + item:number; + } + + class C1 implements I1 { + public item:number; + } + + class C2 implements I1 { + ~~ +!!! Class 'C2' incorrectly implements interface 'I1': +!!! Private property 'item' cannot be reimplemented. + private item:number; + } + + class C3 implements I1 { + ~~ +!!! Class 'C3' incorrectly implements interface 'I1': +!!! Property 'item' is missing in type 'C3'. + constructor() { + var item: number; + } + } + + export class Test { + private pt: I1 = { item: 1 }; + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation6.js b/tests/baselines/reference/interfaceImplementation6.js new file mode 100644 index 0000000000000..4feb6804db35a --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation6.js @@ -0,0 +1,52 @@ +//// [interfaceImplementation6.ts] +interface I1 { + item:number; +} + +class C1 implements I1 { + public item:number; +} + +class C2 implements I1 { + private item:number; +} + +class C3 implements I1 { + constructor() { + var item: number; + } +} + +export class Test { + private pt: I1 = { item: 1 }; +} + + + + +//// [interfaceImplementation6.js] +define(["require", "exports"], function (require, exports) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var C3 = (function () { + function C3() { + var item; + } + return C3; + })(); + var Test = (function () { + function Test() { + this.pt = { item: 1 }; + } + return Test; + })(); + exports.Test = Test; +}); diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt new file mode 100644 index 0000000000000..c39158df66c9b --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ==== + interface i1{ name(): { s: string; }; } + interface i2{ name(): { n: number; }; } + + interface i3 extends i1, i2 { } + ~~ +!!! Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': +!!! Named properties 'name' of types 'i1' and 'i2' are not identical. + interface i4 extends i1, i2 { name(): { s: string; n: number; }; } + + class C1 implements i4 { + ~~ +!!! Class 'C1' incorrectly implements interface 'i4': +!!! Types of property 'name' are incompatible: +!!! Type '() => string' is not assignable to type '() => { s: string; n: number; }': +!!! Type 'string' is not assignable to type '{ s: string; n: number; }': +!!! Property 's' is missing in type 'String'. + public name(): string { return ""; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation7.js b/tests/baselines/reference/interfaceImplementation7.js new file mode 100644 index 0000000000000..6345fe93a3312 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation7.js @@ -0,0 +1,21 @@ +//// [interfaceImplementation7.ts] +interface i1{ name(): { s: string; }; } +interface i2{ name(): { n: number; }; } + +interface i3 extends i1, i2 { } +interface i4 extends i1, i2 { name(): { s: string; n: number; }; } + +class C1 implements i4 { + public name(): string { return ""; } +} + + +//// [interfaceImplementation7.js] +var C1 = (function () { + function C1() { + } + C1.prototype.name = function () { + return ""; + }; + return C1; +})(); diff --git a/tests/baselines/reference/interfaceImplementation8.errors.txt b/tests/baselines/reference/interfaceImplementation8.errors.txt new file mode 100644 index 0000000000000..6218ecd6a5e34 --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation8.errors.txt @@ -0,0 +1,50 @@ +==== tests/cases/compiler/interfaceImplementation8.ts (3 errors) ==== + /* + 1 + */ + interface i1 { + name: string; + } + + class C1 implements i1 { + public name:string; + } + + class C2 implements i1 { + ~~ +!!! Class 'C2' incorrectly implements interface 'i1': +!!! Private property 'name' cannot be reimplemented. + private name:string; + } + + class C3 { + private name:any; + } + + class C4 extends C1 implements i1{ } + class C5 extends C2 implements i1{ } + ~~ +!!! Class 'C5' incorrectly implements interface 'i1': +!!! Private property 'name' cannot be reimplemented. + class C6 extends C3 implements i1{ } + ~~ +!!! Class 'C6' incorrectly implements interface 'i1': +!!! Private property 'name' cannot be reimplemented. + + /* + 2 + */ + + interface i2 { + name: string; + age: number; + } + + class C7 { + public name:string; + } + + class C8 extends C7 implements i2{ + public age:number; + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js new file mode 100644 index 0000000000000..e6848b5baf9ed --- /dev/null +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -0,0 +1,97 @@ +//// [interfaceImplementation8.ts] +/* + 1 +*/ +interface i1 { + name: string; +} + +class C1 implements i1 { + public name:string; +} + +class C2 implements i1 { + private name:string; +} + +class C3 { + private name:any; +} + +class C4 extends C1 implements i1{ } +class C5 extends C2 implements i1{ } +class C6 extends C3 implements i1{ } + +/* + 2 +*/ + +interface i2 { + name: string; + age: number; +} + +class C7 { + public name:string; +} + +class C8 extends C7 implements i2{ + public age:number; +} + + +//// [interfaceImplementation8.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function (_super) { + __extends(C4, _super); + function C4() { + _super.apply(this, arguments); + } + return C4; +})(C1); +var C5 = (function (_super) { + __extends(C5, _super); + function C5() { + _super.apply(this, arguments); + } + return C5; +})(C2); +var C6 = (function (_super) { + __extends(C6, _super); + function C6() { + _super.apply(this, arguments); + } + return C6; +})(C3); +var C7 = (function () { + function C7() { + } + return C7; +})(); +var C8 = (function (_super) { + __extends(C8, _super); + function C8() { + _super.apply(this, arguments); + } + return C8; +})(C7); diff --git a/tests/baselines/reference/interfaceInReopenedModule.js b/tests/baselines/reference/interfaceInReopenedModule.js new file mode 100644 index 0000000000000..fe9f6de3740f3 --- /dev/null +++ b/tests/baselines/reference/interfaceInReopenedModule.js @@ -0,0 +1,23 @@ +//// [interfaceInReopenedModule.ts] +module m { +} + +// In second instance of same module, exported interface is not visible +module m { + interface f {} + export class n { + private n: f; + } +} + + +//// [interfaceInReopenedModule.js] +var m; +(function (m) { + var n = (function () { + function n() { + } + return n; + })(); + m.n = n; +})(m || (m = {})); diff --git a/tests/baselines/reference/interfaceInheritance.errors.txt b/tests/baselines/reference/interfaceInheritance.errors.txt new file mode 100644 index 0000000000000..f8ef8d0861e8b --- /dev/null +++ b/tests/baselines/reference/interfaceInheritance.errors.txt @@ -0,0 +1,55 @@ +==== tests/cases/compiler/interfaceInheritance.ts (4 errors) ==== + interface I1 { + i1P1: number; + i1P2(): void; + } + + interface I2 extends I1 { + i2P1: string; + } + + interface I3 { + i2P1: string; // has a member from i2P1, but not from I1 + } + + interface I4 { + one: number; + } + + interface I5 { + one: string; + } + + class C1 implements I2 { // should be an error - it doesn't implement the members of I1 + ~~ +!!! Class 'C1' incorrectly implements interface 'I2': +!!! Property 'i1P1' is missing in type 'C1'. + public i2P1: string; + } + + var i2: I2; + var i1: I1; + var i3: I3; + i1 = i2; + i2 = i3; // should be an error - i3 does not implement the members of i1 + ~~ +!!! Type 'I3' is not assignable to type 'I2': +!!! Property 'i1P1' is missing in type 'I3'. + + var c1: C1; + + var i4: I4; + var i5: I5; + + i4 = i5; // should be an error + ~~ +!!! Type 'I5' is not assignable to type 'I4': +!!! Types of property 'one' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + i5 = i4; // should be an error + ~~ +!!! Type 'I4' is not assignable to type 'I5': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceInheritance.js b/tests/baselines/reference/interfaceInheritance.js new file mode 100644 index 0000000000000..68c25cebc5df6 --- /dev/null +++ b/tests/baselines/reference/interfaceInheritance.js @@ -0,0 +1,58 @@ +//// [interfaceInheritance.ts] +interface I1 { + i1P1: number; + i1P2(): void; +} + +interface I2 extends I1 { + i2P1: string; +} + +interface I3 { + i2P1: string; // has a member from i2P1, but not from I1 +} + +interface I4 { + one: number; +} + +interface I5 { + one: string; +} + +class C1 implements I2 { // should be an error - it doesn't implement the members of I1 + public i2P1: string; +} + +var i2: I2; +var i1: I1; +var i3: I3; +i1 = i2; +i2 = i3; // should be an error - i3 does not implement the members of i1 + +var c1: C1; + +var i4: I4; +var i5: I5; + +i4 = i5; // should be an error +i5 = i4; // should be an error + + + +//// [interfaceInheritance.js] +var C1 = (function () { + function C1() { + } + return C1; +})(); +var i2; +var i1; +var i3; +i1 = i2; +i2 = i3; +var c1; +var i4; +var i5; +i4 = i5; +i5 = i4; diff --git a/tests/baselines/reference/interfaceInheritance2.js b/tests/baselines/reference/interfaceInheritance2.js new file mode 100644 index 0000000000000..41cb77269591d --- /dev/null +++ b/tests/baselines/reference/interfaceInheritance2.js @@ -0,0 +1,14 @@ +//// [interfaceInheritance2.ts] +interface I6 { + ():void; +} + +interface I7 extends I6 { } + +var v1:I7; +v1(); + + +//// [interfaceInheritance2.js] +var v1; +v1(); diff --git a/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt new file mode 100644 index 0000000000000..a1644c4a282ba --- /dev/null +++ b/tests/baselines/reference/interfaceMayNotBeExtendedWitACall.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/interfaceMayNotBeExtendedWitACall.ts (2 errors) ==== + interface color {} + + interface blue extends color() { // error + ~ +!!! ',' expected. + ~ +!!! '=>' expected. + + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMemberValidation.errors.txt b/tests/baselines/reference/interfaceMemberValidation.errors.txt new file mode 100644 index 0000000000000..c6ce933777c6f --- /dev/null +++ b/tests/baselines/reference/interfaceMemberValidation.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/interfaceMemberValidation.ts (3 errors) ==== + interface i1 { name: string; } + interface i2 extends i1 { name: number; yo: string; } + ~~ +!!! Interface 'i2' incorrectly extends interface 'i1': +!!! Types of property 'name' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + + interface foo { + bar():any; + ~~~~~~~~~~ +!!! Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. + bar():any; + new():void; + new():void; + [s:string]:number; + [s:string]:number; + ~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMemberValidation.js b/tests/baselines/reference/interfaceMemberValidation.js new file mode 100644 index 0000000000000..a6f44d3d9ecc0 --- /dev/null +++ b/tests/baselines/reference/interfaceMemberValidation.js @@ -0,0 +1,14 @@ +//// [interfaceMemberValidation.ts] +interface i1 { name: string; } +interface i2 extends i1 { name: number; yo: string; } + +interface foo { + bar():any; + bar():any; + new():void; + new():void; + [s:string]:number; + [s:string]:number; +} + +//// [interfaceMemberValidation.js] diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt new file mode 100644 index 0000000000000..055940a5e2e3e --- /dev/null +++ b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/interfaceNameAsIdentifier.ts (2 errors) ==== + interface C { + (): void; + } + C(); + ~ +!!! Cannot find name 'C'. + + module m2 { + export interface C { + (): void; + } + } + + m2.C(); + ~~ +!!! Cannot find name 'm2'. + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.js b/tests/baselines/reference/interfaceNameAsIdentifier.js new file mode 100644 index 0000000000000..c66da56f18376 --- /dev/null +++ b/tests/baselines/reference/interfaceNameAsIdentifier.js @@ -0,0 +1,18 @@ +//// [interfaceNameAsIdentifier.ts] +interface C { + (): void; +} +C(); + +module m2 { + export interface C { + (): void; + } +} + +m2.C(); + + +//// [interfaceNameAsIdentifier.js] +C(); +m2.C(); diff --git a/tests/baselines/reference/interfaceNaming1.errors.txt b/tests/baselines/reference/interfaceNaming1.errors.txt new file mode 100644 index 0000000000000..8f341f0e4cede --- /dev/null +++ b/tests/baselines/reference/interfaceNaming1.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/interfaceNaming1.ts (4 errors) ==== + interface { } + ~ +!!! ';' expected. + ~~~~~~~~~ +!!! Cannot find name 'interface'. + interface interface{ } + interface & { } + ~~~~~~~~~ +!!! Cannot find name 'interface'. + ~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceOnly.js b/tests/baselines/reference/interfaceOnly.js new file mode 100644 index 0000000000000..18b7fd4a7dabe --- /dev/null +++ b/tests/baselines/reference/interfaceOnly.js @@ -0,0 +1,10 @@ +//// [interfaceOnly.ts] +interface foo { + foo(); + f2 (f: ()=> void); +} + +//// [interfaceOnly.js] + + +//// [interfaceOnly.d.ts] diff --git a/tests/baselines/reference/interfacePropertiesWithSameName1.js b/tests/baselines/reference/interfacePropertiesWithSameName1.js new file mode 100644 index 0000000000000..6f9b82d32f9ca --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName1.js @@ -0,0 +1,16 @@ +//// [interfacePropertiesWithSameName1.ts] +interface Mover { + move(): void; + getStatus(): { speed: number; }; +} +interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; +} + +interface MoverShaker extends Mover, Shaker { + getStatus(): { speed: number; frequency: number; }; +} + + +//// [interfacePropertiesWithSameName1.js] diff --git a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt new file mode 100644 index 0000000000000..bf5dead7037c4 --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/compiler/interfacePropertiesWithSameName2.ts (2 errors) ==== + interface Mover { + move(): void; + getStatus(): { speed: number; }; + } + interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; + } + + interface MoverShaker extends Mover, Shaker { + ~~~~~~~~~~~ +!!! Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. + + } + + // Inside a module + declare module MoversAndShakers { + export class Mover { + move(): void; + getStatus(): { speed: number; }; + } + export interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; + } + } + + interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error + ~~~~~~~~~~~~ +!!! Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. + + interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { + getStatus(): { speed: number; frequency: number; }; // ok because this getStatus overrides the conflicting ones above + } \ No newline at end of file diff --git a/tests/baselines/reference/interfacePropertiesWithSameName2.js b/tests/baselines/reference/interfacePropertiesWithSameName2.js new file mode 100644 index 0000000000000..325392c06a3a1 --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.js @@ -0,0 +1,33 @@ +//// [interfacePropertiesWithSameName2.ts] +interface Mover { + move(): void; + getStatus(): { speed: number; }; +} +interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; +} + +interface MoverShaker extends Mover, Shaker { + +} + +// Inside a module +declare module MoversAndShakers { + export class Mover { + move(): void; + getStatus(): { speed: number; }; + } + export interface Shaker { + shake(): void; + getStatus(): { frequency: number; }; + } +} + +interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error + +interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { + getStatus(): { speed: number; frequency: number; }; // ok because this getStatus overrides the conflicting ones above +} + +//// [interfacePropertiesWithSameName2.js] diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt new file mode 100644 index 0000000000000..92a1f5782d1cf --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/interfacePropertiesWithSameName3.ts (2 errors) ==== + interface D { a: number; } + interface E { a: string; } + interface F extends E, D { } // error + ~ +!!! Interface 'F' cannot simultaneously extend types 'E' and 'D': +!!! Named properties 'a' of types 'E' and 'D' are not identical. + + class D2 { a: number; } + class E2 { a: string; } + interface F2 extends E2, D2 { } // error + ~~ +!!! Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': +!!! Named properties 'a' of types 'E2' and 'D2' are not identical. + \ No newline at end of file diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.js b/tests/baselines/reference/interfacePropertiesWithSameName3.js new file mode 100644 index 0000000000000..2711eb4684735 --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.js @@ -0,0 +1,21 @@ +//// [interfacePropertiesWithSameName3.ts] +interface D { a: number; } +interface E { a: string; } +interface F extends E, D { } // error + +class D2 { a: number; } +class E2 { a: string; } +interface F2 extends E2, D2 { } // error + + +//// [interfacePropertiesWithSameName3.js] +var D2 = (function () { + function D2() { + } + return D2; +})(); +var E2 = (function () { + function E2() { + } + return E2; +})(); diff --git a/tests/baselines/reference/interfaceSubtyping.js b/tests/baselines/reference/interfaceSubtyping.js new file mode 100644 index 0000000000000..840ce79d869dd --- /dev/null +++ b/tests/baselines/reference/interfaceSubtyping.js @@ -0,0 +1,21 @@ +//// [interfaceSubtyping.ts] +interface iface { + foo(): void; +} +class Camera implements iface{ + constructor (public str: string) { + } + foo() { return "s"; } +} + + +//// [interfaceSubtyping.js] +var Camera = (function () { + function Camera(str) { + this.str = str; + } + Camera.prototype.foo = function () { + return "s"; + }; + return Camera; +})(); diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty.js b/tests/baselines/reference/interfaceThatHidesBaseProperty.js new file mode 100644 index 0000000000000..65421f608662e --- /dev/null +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty.js @@ -0,0 +1,12 @@ +//// [interfaceThatHidesBaseProperty.ts] +interface Base { + x: { a: number }; +} + +interface Derived extends Base { + x: { + a: number; b: number; + }; +} + +//// [interfaceThatHidesBaseProperty.js] diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt new file mode 100644 index 0000000000000..456ed18e00776 --- /dev/null +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts (1 errors) ==== + interface Base { + x: { a: number }; + } + + interface Derived extends Base { // error + ~~~~~~~ +!!! Interface 'Derived' incorrectly extends interface 'Base': +!!! Types of property 'x' are incompatible: +!!! Type '{ a: string; }' is not assignable to type '{ a: number; }': +!!! Types of property 'a' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + x: { + a: string; + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty2.js b/tests/baselines/reference/interfaceThatHidesBaseProperty2.js new file mode 100644 index 0000000000000..a06a30112b015 --- /dev/null +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty2.js @@ -0,0 +1,12 @@ +//// [interfaceThatHidesBaseProperty2.ts] +interface Base { + x: { a: number }; +} + +interface Derived extends Base { // error + x: { + a: string; + }; +} + +//// [interfaceThatHidesBaseProperty2.js] diff --git a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt new file mode 100644 index 0000000000000..ca8b58bcf850e --- /dev/null +++ b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatIndirectlyInheritsFromItself.ts (2 errors) ==== + interface Base extends Derived2 { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + x: string; + ~~~~~~~~~~~~~~ + } + ~ +!!! Type 'Base' recursively references itself as a base type. + + interface Derived extends Base { + y: string; + } + + interface Derived2 extends Derived { + z: string; + } + + module Generic { + interface Base extends Derived2 { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + x: string; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Type 'Base' recursively references itself as a base type. + + interface Derived extends Base { + y: string; + } + + interface Derived2 extends Derived { + z: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.js b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.js new file mode 100644 index 0000000000000..11f0fd72e7c46 --- /dev/null +++ b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.js @@ -0,0 +1,28 @@ +//// [interfaceThatIndirectlyInheritsFromItself.ts] +interface Base extends Derived2 { // error + x: string; +} + +interface Derived extends Base { + y: string; +} + +interface Derived2 extends Derived { + z: string; +} + +module Generic { + interface Base extends Derived2 { // error + x: string; + } + + interface Derived extends Base { + y: string; + } + + interface Derived2 extends Derived { + z: string; + } +} + +//// [interfaceThatIndirectlyInheritsFromItself.js] diff --git a/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt new file mode 100644 index 0000000000000..5219cdf37f308 --- /dev/null +++ b/tests/baselines/reference/interfaceThatInheritsFromItself.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts (8 errors) ==== + interface Foo extends Foo { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'Foo' recursively references itself as a base type. + + interface Foo2 extends Foo2 { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'Foo2' recursively references itself as a base type. + + interface Foo3 extends Foo3 { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'Foo3' recursively references itself as a base type. + + interface Bar implements Bar { // error + ~~~~~~~~~~ +!!! '{' expected. + ~~~ +!!! ';' expected. + ~ +!!! ';' expected. + ~~~~~~~~~~ +!!! Cannot find name 'implements'. + ~~~ +!!! Cannot find name 'Bar'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithCallAndConstructSignature.js b/tests/baselines/reference/interfaceWithCallAndConstructSignature.js new file mode 100644 index 0000000000000..1614c6094ce1d --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallAndConstructSignature.js @@ -0,0 +1,14 @@ +//// [interfaceWithCallAndConstructSignature.ts] +interface Foo { + (): number; + new (): any; +} + +var f: Foo; +var r = f(); +var r2 = new f(); + +//// [interfaceWithCallAndConstructSignature.js] +var f; +var r = f(); +var r2 = new f(); diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.js b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.js new file mode 100644 index 0000000000000..8b68a193257c4 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.js @@ -0,0 +1,15 @@ +//// [interfaceWithCallSignaturesThatHidesBaseSignature.ts] +interface Foo { + (): { a: number }; +} + +interface Derived extends Foo { + (): { a: number; b: number }; +} + +var d: Derived; +var r = d(); + +//// [interfaceWithCallSignaturesThatHidesBaseSignature.js] +var d; +var r = d(); diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.js b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.js new file mode 100644 index 0000000000000..f95a6cd2c8c50 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.js @@ -0,0 +1,15 @@ +//// [interfaceWithCallSignaturesThatHidesBaseSignature2.ts] +interface Foo { + (): { a: number; b: number }; +} + +interface Derived extends Foo { // error + (): { a: number }; +} + +var d: Derived; +var r = d(); + +//// [interfaceWithCallSignaturesThatHidesBaseSignature2.js] +var d; +var r = d(); diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.js b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.js new file mode 100644 index 0000000000000..3b56bbbf3f7a3 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.js @@ -0,0 +1,15 @@ +//// [interfaceWithConstructSignaturesThatHidesBaseSignature.ts] +interface Foo { + new (): { a: number }; +} + +interface Derived extends Foo { + new (): { a: number; b: number }; +} + +var d: Derived; +var r = new d(); + +//// [interfaceWithConstructSignaturesThatHidesBaseSignature.js] +var d; +var r = new d(); diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.js b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.js new file mode 100644 index 0000000000000..6675ad9e40c10 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.js @@ -0,0 +1,15 @@ +//// [interfaceWithConstructSignaturesThatHidesBaseSignature2.ts] +interface Foo { + new (): { a: number; b: number }; +} + +interface Derived extends Foo { + new (): { a: number }; // constructors not checked for conformance like a call signature is +} + +var d: Derived; +var r = new d(); + +//// [interfaceWithConstructSignaturesThatHidesBaseSignature2.js] +var d; +var r = new d(); diff --git a/tests/baselines/reference/interfaceWithImplements1.errors.txt b/tests/baselines/reference/interfaceWithImplements1.errors.txt new file mode 100644 index 0000000000000..b2b1fdc3954ff --- /dev/null +++ b/tests/baselines/reference/interfaceWithImplements1.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/interfaceWithImplements1.ts (5 errors) ==== + interface IFoo { } + + interface IBar implements IFoo { + ~~~~~~~~~~ +!!! '{' expected. + ~~~~ +!!! ';' expected. + ~ +!!! ';' expected. + ~~~~~~~~~~ +!!! Cannot find name 'implements'. + ~~~~ +!!! Cannot find name 'IFoo'. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt new file mode 100644 index 0000000000000..d96a8d33a63d5 --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt @@ -0,0 +1,95 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts (6 errors) ==== + // an interface may have multiple bases with properties of the same name as long as the interface's implementation satisfies all base type versions + + interface Base1 { + x: { + a: string; + } + } + + interface Base2 { + x: { + b: string; + } + } + + interface Derived extends Base1, Base2 { + x: { + a: string; b: string; + } + } + + interface Derived2 extends Base1, Base2 { // error + ~~~~~~~~ +!!! Interface 'Derived2' incorrectly extends interface 'Base2': +!!! Types of property 'x' are incompatible: +!!! Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': +!!! Types of property 'b' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + x: { + a: string; b: number; + } + } + + module Generic { + interface Base1 { + x: { + a: T; + } + } + + interface Base2 { + x: { + b: T; + } + } + + interface Derived extends Base1, Base2 { + x: { + a: string; b: number; + } + } + + interface Derived2 extends Base1, Base2 { + x: { + a: T; b: U; + } + } + + interface Derived3 extends Base1, Base2 { } // error + ~~~~~~~~ +!!! Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': +!!! Named properties 'x' of types 'Base1' and 'Base2' are not identical. + + interface Derived4 extends Base1, Base2 { // error + ~~~~~~~~ +!!! Interface 'Derived4' incorrectly extends interface 'Base1': +!!! Types of property 'x' are incompatible: +!!! Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': +!!! Types of property 'a' are incompatible: +!!! Type 'T' is not assignable to type 'number'. + ~~~~~~~~ +!!! Interface 'Derived4' incorrectly extends interface 'Base2': +!!! Types of property 'x' are incompatible: +!!! Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': +!!! Types of property 'b' are incompatible: +!!! Type 'T' is not assignable to type 'number'. + x: { + a: T; b: T; + } + } + + interface Derived5 extends Base1, Base2 { // error + ~~~~~~~~ +!!! Interface 'Derived5' incorrectly extends interface 'Base1': +!!! Types of property 'x' are incompatible: +!!! Type 'T' is not assignable to type '{ a: T; }': +!!! Property 'a' is missing in type '{}'. + ~~~~~~~~ +!!! Interface 'Derived5' incorrectly extends interface 'Base2': +!!! Types of property 'x' are incompatible: +!!! Type 'T' is not assignable to type '{ b: T; }': +!!! Property 'b' is missing in type '{}'. + x: T; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.js b/tests/baselines/reference/interfaceWithMultipleBaseTypes.js new file mode 100644 index 0000000000000..fa58257fbd8c4 --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.js @@ -0,0 +1,66 @@ +//// [interfaceWithMultipleBaseTypes.ts] +// an interface may have multiple bases with properties of the same name as long as the interface's implementation satisfies all base type versions + +interface Base1 { + x: { + a: string; + } +} + +interface Base2 { + x: { + b: string; + } +} + +interface Derived extends Base1, Base2 { + x: { + a: string; b: string; + } +} + +interface Derived2 extends Base1, Base2 { // error + x: { + a: string; b: number; + } +} + +module Generic { + interface Base1 { + x: { + a: T; + } + } + + interface Base2 { + x: { + b: T; + } + } + + interface Derived extends Base1, Base2 { + x: { + a: string; b: number; + } + } + + interface Derived2 extends Base1, Base2 { + x: { + a: T; b: U; + } + } + + interface Derived3 extends Base1, Base2 { } // error + + interface Derived4 extends Base1, Base2 { // error + x: { + a: T; b: T; + } + } + + interface Derived5 extends Base1, Base2 { // error + x: T; + } +} + +//// [interfaceWithMultipleBaseTypes.js] diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt new file mode 100644 index 0000000000000..1ade49844d0ea --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts (1 errors) ==== + interface Base { + x: { + a?: string; b: string; + } + } + + interface Base2 { + x: { + b: string; c?: number; + } + } + + interface Derived extends Base, Base2 { + x: { b: string } + } + + interface Derived2 extends Base, Base2 { // error + ~~~~~~~~ +!!! Interface 'Derived2' incorrectly extends interface 'Base': +!!! Types of property 'x' are incompatible: +!!! Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': +!!! Types of property 'a' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + x: { a: number; b: string } + } + + interface Derived3 extends Base, Base2 { + x: { a: string; b: string } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.js b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.js new file mode 100644 index 0000000000000..113df2af88bb7 --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.js @@ -0,0 +1,28 @@ +//// [interfaceWithMultipleBaseTypes2.ts] +interface Base { + x: { + a?: string; b: string; + } +} + +interface Base2 { + x: { + b: string; c?: number; + } +} + +interface Derived extends Base, Base2 { + x: { b: string } +} + +interface Derived2 extends Base, Base2 { // error + x: { a: number; b: string } +} + +interface Derived3 extends Base, Base2 { + x: { a: string; b: string } +} + + + +//// [interfaceWithMultipleBaseTypes2.js] diff --git a/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt new file mode 100644 index 0000000000000..0297e7966f57e --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt @@ -0,0 +1,68 @@ +==== tests/cases/compiler/interfaceWithMultipleDeclarations.ts (15 errors) ==== + interface I1 { + } + interface I1 { // Name mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I1 { // Length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + interface I1 { // constraint present + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I1 { // Length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + interface I1 { // Length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + + interface I2 { + } + interface I2 string> { // constraint mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I2 { // constraint absent + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I2 { // name mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I2 { // length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + interface I2 { // length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + + interface I3 { + } + interface I3 { // length mismatch + ~~ +!!! All declarations of an interface must have identical type parameters. + } + + class Foo { + } + interface I4> { + ~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + interface I4> { // Should not be error + ~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleDeclarations.js b/tests/baselines/reference/interfaceWithMultipleDeclarations.js new file mode 100644 index 0000000000000..f4b4e733161ec --- /dev/null +++ b/tests/baselines/reference/interfaceWithMultipleDeclarations.js @@ -0,0 +1,45 @@ +//// [interfaceWithMultipleDeclarations.ts] +interface I1 { +} +interface I1 { // Name mismatch +} +interface I1 { // Length mismatch +} +interface I1 { // constraint present +} +interface I1 { // Length mismatch +} +interface I1 { // Length mismatch +} + +interface I2 { +} +interface I2 string> { // constraint mismatch +} +interface I2 { // constraint absent +} +interface I2 { // name mismatch +} +interface I2 { // length mismatch +} +interface I2 { // length mismatch +} + +interface I3 { +} +interface I3 { // length mismatch +} + +class Foo { +} +interface I4> { +} +interface I4> { // Should not be error +} + +//// [interfaceWithMultipleDeclarations.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); diff --git a/tests/baselines/reference/interfaceWithOptionalProperty.js b/tests/baselines/reference/interfaceWithOptionalProperty.js new file mode 100644 index 0000000000000..3bb49bde85c80 --- /dev/null +++ b/tests/baselines/reference/interfaceWithOptionalProperty.js @@ -0,0 +1,10 @@ +//// [interfaceWithOptionalProperty.ts] + +interface I { + x?: number; +} + +//// [interfaceWithOptionalProperty.js] + + +//// [interfaceWithOptionalProperty.d.ts] diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.js b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.js new file mode 100644 index 0000000000000..de667181f8f09 --- /dev/null +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.js @@ -0,0 +1,21 @@ +//// [interfaceWithOverloadedCallAndConstructSignatures.ts] +interface Foo { + (): number; + (x: string): number; + + new (): any; + new (x: string): Object; +} + +var f: Foo; +var r1 = f(); +var r2 = f(''); +var r3 = new f(); +var r4 = new f(''); + +//// [interfaceWithOverloadedCallAndConstructSignatures.js] +var f; +var r1 = f(); +var r2 = f(''); +var r3 = new f(); +var r4 = new f(''); diff --git a/tests/baselines/reference/interfaceWithPrivateMember.errors.txt b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt new file mode 100644 index 0000000000000..b0c2e9fcfd285 --- /dev/null +++ b/tests/baselines/reference/interfaceWithPrivateMember.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/conformance/types/namedTypes/interfaceWithPrivateMember.ts (5 errors) ==== + // interfaces do not permit private members, these are errors + + interface I { + private x: string; + ~~~~~~~ +!!! Property or signature expected. + } + + interface I2 { + private y: T; + ~~~~~~~ +!!! Property or signature expected. + } + + var x: { + private y: string; + ~~~~~~~ +!!! Property or signature expected. + ~~~~~~ +!!! Cannot find name 'string'. + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.js b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js new file mode 100644 index 0000000000000..10d7c641380cf --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.js @@ -0,0 +1,77 @@ +//// [interfaceWithPropertyOfEveryType.ts] +class C { foo: string; } +function f1() { } +module M { + export var y = 1; +} +enum E { A } + +interface Foo { + a: number; + b: string; + c: boolean; + d: any; + e: void; + f: number[]; + g: Object; + h: (x: number) => number; + i: (x: T) => T; + j: Foo; + k: C; + l: typeof f1; + m: typeof M; + n: {}; + o: E; +} + +var a: Foo = { + a: 1, + b: '', + c: true, + d: {}, + e: null , + f: [1], + g: {}, + h: (x: number) => 1, + i: (x: T) => x, + j: null, + k: new C(), + l: f1, + m: M, + n: {}, + o: E.A +} + +//// [interfaceWithPropertyOfEveryType.js] +var C = (function () { + function C() { + } + return C; +})(); +function f1() { +} +var M; +(function (M) { + M.y = 1; +})(M || (M = {})); +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var a = { + a: 1, + b: '', + c: true, + d: {}, + e: null, + f: [1], + g: {}, + h: function (x) { return 1; }, + i: function (x) { return x; }, + j: null, + k: new C(), + l: f1, + m: M, + n: {}, + o: 0 /* A */ +}; diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt new file mode 100644 index 0000000000000..543e7fc9ce88e --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts (2 errors) ==== + class Base { + private x: number; + } + + interface Foo extends Base { // error + ~~~ +!!! Interface 'Foo' incorrectly extends interface 'Base': +!!! Private property 'x' cannot be reimplemented. + x: number; + } + + class Base2 { + private x: T; + } + + interface Foo2 extends Base2 { // error + ~~~~ +!!! Interface 'Foo2' incorrectly extends interface 'Base2': +!!! Private property 'x' cannot be reimplemented. + x: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js new file mode 100644 index 0000000000000..5209c0e97b9ff --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.js @@ -0,0 +1,28 @@ +//// [interfaceWithPropertyThatIsPrivateInBaseType.ts] +class Base { + private x: number; +} + +interface Foo extends Base { // error + x: number; +} + +class Base2 { + private x: T; +} + +interface Foo2 extends Base2 { // error + x: number; +} + +//// [interfaceWithPropertyThatIsPrivateInBaseType.js] +var Base = (function () { + function Base() { + } + return Base; +})(); +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt new file mode 100644 index 0000000000000..f056d65fe1616 --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts (2 errors) ==== + class Base { + private x() {} + } + + interface Foo extends Base { // error + ~~~ +!!! Interface 'Foo' incorrectly extends interface 'Base': +!!! Private property 'x' cannot be reimplemented. + x(): any; + } + + class Base2 { + private x() { } + } + + interface Foo2 extends Base2 { // error + ~~~~ +!!! Interface 'Foo2' incorrectly extends interface 'Base2': +!!! Private property 'x' cannot be reimplemented. + x(): any; + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js new file mode 100644 index 0000000000000..01907f410e39f --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.js @@ -0,0 +1,32 @@ +//// [interfaceWithPropertyThatIsPrivateInBaseType2.ts] +class Base { + private x() {} +} + +interface Foo extends Base { // error + x(): any; +} + +class Base2 { + private x() { } +} + +interface Foo2 extends Base2 { // error + x(): any; +} + +//// [interfaceWithPropertyThatIsPrivateInBaseType2.js] +var Base = (function () { + function Base() { + } + Base.prototype.x = function () { + }; + return Base; +})(); +var Base2 = (function () { + function Base2() { + } + Base2.prototype.x = function () { + }; + return Base2; +})(); diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.js b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.js new file mode 100644 index 0000000000000..4ee0762ae3c0b --- /dev/null +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.js @@ -0,0 +1,22 @@ +//// [interfaceWithSpecializedCallAndConstructSignatures.ts] +interface Foo { + (x: 'a'): number; + (x: string): any; + + new (x: 'a'): any; + new (x: string): Object; +} + +var f: Foo; +var r = f('a'); +var r2 = f('A'); +var r3 = new f('a'); +var r4 = new f('A'); + + +//// [interfaceWithSpecializedCallAndConstructSignatures.js] +var f; +var r = f('a'); +var r2 = f('A'); +var r3 = new f('a'); +var r4 = new f('A'); diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt new file mode 100644 index 0000000000000..b93e0479e1016 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer.ts (1 errors) ==== + interface Base { + [x: string]: { a: number } + x: { + a: number; b: number; + } + } + + interface Derived extends Base { + [x: string]: { + a: number; b: number + }; + // error + y: { + ~~~~ + a: number; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Property 'y' of type '{ a: number; }' is not assignable to string index type '{ a: number; b: number; }'. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.js b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.js new file mode 100644 index 0000000000000..e6cd0727ca0d2 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer.js @@ -0,0 +1,19 @@ +//// [interfaceWithStringIndexerHidingBaseTypeIndexer.ts] +interface Base { + [x: string]: { a: number } + x: { + a: number; b: number; + } +} + +interface Derived extends Base { + [x: string]: { + a: number; b: number + }; + // error + y: { + a: number; + } +} + +//// [interfaceWithStringIndexerHidingBaseTypeIndexer.js] diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt new file mode 100644 index 0000000000000..965cba84565f8 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer2.ts (1 errors) ==== + interface Base { + [x: number]: { a: number; b: number } + x: { + a: number; b: number; + } + } + + interface Derived extends Base { + [x: string]: { + a: number + }; + + y: { + a: number; + } + // error + 1: { + ~~~~ + a: number; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Property '1' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.js b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.js new file mode 100644 index 0000000000000..9928d7df93b82 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer2.js @@ -0,0 +1,23 @@ +//// [interfaceWithStringIndexerHidingBaseTypeIndexer2.ts] +interface Base { + [x: number]: { a: number; b: number } + x: { + a: number; b: number; + } +} + +interface Derived extends Base { + [x: string]: { + a: number + }; + + y: { + a: number; + } + // error + 1: { + a: number; + } +} + +//// [interfaceWithStringIndexerHidingBaseTypeIndexer2.js] diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt new file mode 100644 index 0000000000000..080ffc7fb7662 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithStringIndexerHidingBaseTypeIndexer3.ts (1 errors) ==== + interface Base { + [x: number]: { a: number } + 1: { + a: number; b: number; + } + } + + interface Derived extends Base { + [x: number]: { + a: number; b: number + }; + // error + 2: { + ~~~~ + a: number; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Property '2' of type '{ a: number; }' is not assignable to numeric index type '{ a: number; b: number; }'. + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.js b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.js new file mode 100644 index 0000000000000..0d7ea470d9682 --- /dev/null +++ b/tests/baselines/reference/interfaceWithStringIndexerHidingBaseTypeIndexer3.js @@ -0,0 +1,19 @@ +//// [interfaceWithStringIndexerHidingBaseTypeIndexer3.ts] +interface Base { + [x: number]: { a: number } + 1: { + a: number; b: number; + } +} + +interface Derived extends Base { + [x: number]: { + a: number; b: number + }; + // error + 2: { + a: number; + } +} + +//// [interfaceWithStringIndexerHidingBaseTypeIndexer3.js] diff --git a/tests/baselines/reference/interfacedecl.js b/tests/baselines/reference/interfacedecl.js new file mode 100644 index 0000000000000..f4180ce7eb486 --- /dev/null +++ b/tests/baselines/reference/interfacedecl.js @@ -0,0 +1,58 @@ +//// [interfacedecl.ts] +interface a0 { + (): string; + (a, b, c?: string): number; + + new (): string; + new (s: string); + + [n: number]: ()=>string; + [s: string]: any; + + p1; + p2: string; + p3?; + p4?: number; + p5: (s: number) =>string; + + f1(); + f2? (); + f3(a: string): number; + f4? (s: number): string; +} + + +interface a1 { + [n: number]: number; +} + +interface a2 { + [s: string]: number; +} + +interface a { +} + +interface b extends a { +} + +interface c extends a, b { +} + +interface d extends a { +} + +class c1 implements a { +} +var instance2 = new c1(); + +//// [interfacedecl.js] +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance2 = new c1(); + + +//// [interfacedecl.d.ts] diff --git a/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt b/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt new file mode 100644 index 0000000000000..118e4c2091133 --- /dev/null +++ b/tests/baselines/reference/interfacedeclWithIndexerErrors.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/interfacedeclWithIndexerErrors.ts (5 errors) ==== + interface a0 { + (): string; + (a, b, c?: string): number; + + new (): string; + new (s: string); + + [n: number]: ()=>string; + [s: string]: ()=>string; + + p1; + p2: string; + ~~~~~~~~~~~ +!!! Property 'p2' of type 'string' is not assignable to string index type '() => string'. + p3?; + p4?: number; + ~~~~~~~~~~~~ +!!! Property 'p4' of type 'number' is not assignable to string index type '() => string'. + p5: (s: number) =>string; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'p5' of type '(s: number) => string' is not assignable to string index type '() => string'. + + f1(); + f2? (); + f3(a: string): number; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'f3' of type '(a: string) => number' is not assignable to string index type '() => string'. + f4? (s: number): string; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Property 'f4' of type '(s: number) => string' is not assignable to string index type '() => string'. + } + + + interface a1 { + [n: number]: number; + } + + interface a2 { + [s: string]: number; + } + + interface a { + } + + interface b extends a { + } + + interface c extends a, b { + } + + interface d extends a { + } + + class c1 implements a { + } + var instance2 = new c1(); \ No newline at end of file diff --git a/tests/baselines/reference/interfacedeclWithIndexerErrors.js b/tests/baselines/reference/interfacedeclWithIndexerErrors.js new file mode 100644 index 0000000000000..177b392fd2d48 --- /dev/null +++ b/tests/baselines/reference/interfacedeclWithIndexerErrors.js @@ -0,0 +1,55 @@ +//// [interfacedeclWithIndexerErrors.ts] +interface a0 { + (): string; + (a, b, c?: string): number; + + new (): string; + new (s: string); + + [n: number]: ()=>string; + [s: string]: ()=>string; + + p1; + p2: string; + p3?; + p4?: number; + p5: (s: number) =>string; + + f1(); + f2? (); + f3(a: string): number; + f4? (s: number): string; +} + + +interface a1 { + [n: number]: number; +} + +interface a2 { + [s: string]: number; +} + +interface a { +} + +interface b extends a { +} + +interface c extends a, b { +} + +interface d extends a { +} + +class c1 implements a { +} +var instance2 = new c1(); + +//// [interfacedeclWithIndexerErrors.js] +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance2 = new c1(); diff --git a/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt new file mode 100644 index 0000000000000..5daed96e71f4b --- /dev/null +++ b/tests/baselines/reference/interfacesWithPredefinedTypesAsNames.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts (5 errors) ==== + interface any { } + ~~~ +!!! Interface name cannot be 'any' + interface number { } + ~~~~~~ +!!! Interface name cannot be 'number' + interface string { } + ~~~~~~ +!!! Interface name cannot be 'string' + interface boolean { } + ~~~~~~~ +!!! Interface name cannot be 'boolean' + interface void {} + ~~~~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClass.js b/tests/baselines/reference/internalAliasClass.js new file mode 100644 index 0000000000000..9730047d73ed6 --- /dev/null +++ b/tests/baselines/reference/internalAliasClass.js @@ -0,0 +1,29 @@ +//// [internalAliasClass.ts] +module a { + export class c { + } +} + +module c { + import b = a.c; + export var x: b = new b(); +} + +//// [internalAliasClass.js] +var a; +(function (a) { + var c = (function () { + function c() { + } + return c; + })(); + a.c = c; +})(a || (a = {})); +var c; +(function (c) { + var b = a.c; + c.x = new b(); +})(c || (c = {})); + + +//// [internalAliasClass.d.ts] diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..4c1d6f33fe48a --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.js @@ -0,0 +1,58 @@ +//// [internalAliasClassInsideLocalModuleWithExport.ts] +export module x { + export class c { + foo(a: number) { + return a; + } + } +} + +export module m2 { + export module m3 { + export import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } +} + +export var d = new m2.m3.c(); + +//// [internalAliasClassInsideLocalModuleWithExport.js] +(function (x) { + var c = (function () { + function c() { + } + c.prototype.foo = function (a) { + return a; + }; + return c; + })(); + x.c = c; +})(exports.x || (exports.x = {})); +var x = exports.x; +(function (m2) { + (function (m3) { + m3.c = x.c; + m3.cProp = new m3.c(); + var cReturnVal = m3.cProp.foo(10); + })(m2.m3 || (m2.m3 = {})); + var m3 = m2.m3; +})(exports.m2 || (exports.m2 = {})); +var m2 = exports.m2; +exports.d = new m2.m3.c(); + + +//// [internalAliasClassInsideLocalModuleWithExport.d.ts] +export declare module x { + class c { + foo(a); + } +} +export declare module m2 { + module m3 { + export import c = x.c; + var cProp; + var cReturnVal; + } +} +export declare var d; diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..e28c236fe8c33 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.js @@ -0,0 +1,53 @@ +//// [internalAliasClassInsideLocalModuleWithoutExport.ts] +export module x { + export class c { + foo(a: number) { + return a; + } + } +} + +export module m2 { + export module m3 { + import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } +} + +//// [internalAliasClassInsideLocalModuleWithoutExport.js] +(function (x) { + var c = (function () { + function c() { + } + c.prototype.foo = function (a) { + return a; + }; + return c; + })(); + x.c = c; +})(exports.x || (exports.x = {})); +var x = exports.x; +(function (m2) { + (function (m3) { + var c = x.c; + m3.cProp = new c(); + var cReturnVal = m3.cProp.foo(10); + })(m2.m3 || (m2.m3 = {})); + var m3 = m2.m3; +})(exports.m2 || (exports.m2 = {})); +var m2 = exports.m2; + + +//// [internalAliasClassInsideLocalModuleWithoutExport.d.ts] +export declare module x { + class c { + foo(a); + } +} +export declare module m2 { + module m3 { + var cProp; + var cReturnVal; + } +} diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..88f24934256ef --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module x { + export class c { + foo(a: number) { + return a; + } + } + } + + export module m2 { + export module m3 { + import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } + } + + export var d = new m2.m3.c(); + ~ +!!! Property 'c' does not exist on type 'typeof m3'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..0c0290ab87b69 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,42 @@ +//// [internalAliasClassInsideLocalModuleWithoutExportAccessError.ts] +export module x { + export class c { + foo(a: number) { + return a; + } + } +} + +export module m2 { + export module m3 { + import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } +} + +export var d = new m2.m3.c(); + +//// [internalAliasClassInsideLocalModuleWithoutExportAccessError.js] +(function (x) { + var c = (function () { + function c() { + } + c.prototype.foo = function (a) { + return a; + }; + return c; + })(); + x.c = c; +})(exports.x || (exports.x = {})); +var x = exports.x; +(function (m2) { + (function (m3) { + var c = x.c; + m3.cProp = new c(); + var cReturnVal = m3.cProp.foo(10); + })(m2.m3 || (m2.m3 = {})); + var m3 = m2.m3; +})(exports.m2 || (exports.m2 = {})); +var m2 = exports.m2; +exports.d = new m2.m3.c(); diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..800b4f6f63d1e --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.js @@ -0,0 +1,39 @@ +//// [internalAliasClassInsideTopLevelModuleWithExport.ts] +export module x { + export class c { + foo(a: number) { + return a; + } + } +} + +export import xc = x.c; +export var cProp = new xc(); +var cReturnVal = cProp.foo(10); + +//// [internalAliasClassInsideTopLevelModuleWithExport.js] +(function (x) { + var c = (function () { + function c() { + } + c.prototype.foo = function (a) { + return a; + }; + return c; + })(); + x.c = c; +})(exports.x || (exports.x = {})); +var x = exports.x; +exports.xc = x.c; +exports.cProp = new exports.xc(); +var cReturnVal = exports.cProp.foo(10); + + +//// [internalAliasClassInsideTopLevelModuleWithExport.d.ts] +export declare module x { + class c { + foo(a); + } +} +export import xc = x.c; +export declare var cProp; diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..da12bcddf52f0 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,38 @@ +//// [internalAliasClassInsideTopLevelModuleWithoutExport.ts] +export module x { + export class c { + foo(a: number) { + return a; + } + } +} + +import xc = x.c; +export var cProp = new xc(); +var cReturnVal = cProp.foo(10); + +//// [internalAliasClassInsideTopLevelModuleWithoutExport.js] +(function (x) { + var c = (function () { + function c() { + } + c.prototype.foo = function (a) { + return a; + }; + return c; + })(); + x.c = c; +})(exports.x || (exports.x = {})); +var x = exports.x; +var xc = x.c; +exports.cProp = new xc(); +var cReturnVal = exports.cProp.foo(10); + + +//// [internalAliasClassInsideTopLevelModuleWithoutExport.d.ts] +export declare module x { + class c { + foo(a); + } +} +export declare var cProp; diff --git a/tests/baselines/reference/internalAliasEnum.js b/tests/baselines/reference/internalAliasEnum.js new file mode 100644 index 0000000000000..dd1c938658741 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnum.js @@ -0,0 +1,33 @@ +//// [internalAliasEnum.ts] +module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +module c { + import b = a.weekend; + export var bVal: b = b.Sunday; +} + + +//// [internalAliasEnum.js] +var a; +(function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; +})(a || (a = {})); +var c; +(function (c) { + var b = a.weekend; + c.bVal = 2 /* Sunday */; +})(c || (c = {})); + + +//// [internalAliasEnum.d.ts] diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..dc5d69cda41a5 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.js @@ -0,0 +1,44 @@ +//// [internalAliasEnumInsideLocalModuleWithExport.ts] +export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +export module c { + export import b = a.weekend; + export var bVal: b = b.Sunday; +} + + +//// [internalAliasEnumInsideLocalModuleWithExport.js] +(function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + c.b = a.weekend; + c.bVal = 2 /* Sunday */; +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasEnumInsideLocalModuleWithExport.d.ts] +export declare module a { + enum weekend { + Friday = 0, + Saturday = 1, + Sunday = 2, + } +} +export declare module c { + export import b = a.weekend; + var bVal; +} diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..ec47d2147f6cb --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.js @@ -0,0 +1,43 @@ +//// [internalAliasEnumInsideLocalModuleWithoutExport.ts] +export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +export module c { + import b = a.weekend; + export var bVal: b = b.Sunday; +} + + +//// [internalAliasEnumInsideLocalModuleWithoutExport.js] +(function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.weekend; + c.bVal = 2 /* Sunday */; +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasEnumInsideLocalModuleWithoutExport.d.ts] +export declare module a { + enum weekend { + Friday = 0, + Saturday = 1, + Sunday = 2, + } +} +export declare module c { + var bVal; +} diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..0c2d7780a14c5 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + export module c { + import b = a.weekend; + export var bVal: b = b.Sunday; + } + + var happyFriday = c.b.Friday; + ~ +!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..266e51bfe35c0 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,32 @@ +//// [internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +export module c { + import b = a.weekend; + export var bVal: b = b.Sunday; +} + +var happyFriday = c.b.Friday; + +//// [internalAliasEnumInsideLocalModuleWithoutExportAccessError.js] +(function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.weekend; + c.bVal = 2 /* Sunday */; +})(exports.c || (exports.c = {})); +var c = exports.c; +var happyFriday = c.b.Friday; diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..ba59111644452 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.js @@ -0,0 +1,39 @@ +//// [internalAliasEnumInsideTopLevelModuleWithExport.ts] +export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +export import b = a.weekend; +export var bVal: b = b.Sunday; + + +//// [internalAliasEnumInsideTopLevelModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; + })(exports.a || (exports.a = {})); + var a = exports.a; + exports.b = a.weekend; + exports.bVal = 2 /* Sunday */; +}); + + +//// [internalAliasEnumInsideTopLevelModuleWithExport.d.ts] +export declare module a { + enum weekend { + Friday = 0, + Saturday = 1, + Sunday = 2, + } +} +export import b = a.weekend; +export declare var bVal; diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..40c6d83a89f22 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,38 @@ +//// [internalAliasEnumInsideTopLevelModuleWithoutExport.ts] +export module a { + export enum weekend { + Friday, + Saturday, + Sunday + } +} + +import b = a.weekend; +export var bVal: b = b.Sunday; + + +//// [internalAliasEnumInsideTopLevelModuleWithoutExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + (function (weekend) { + weekend[weekend["Friday"] = 0] = "Friday"; + weekend[weekend["Saturday"] = 1] = "Saturday"; + weekend[weekend["Sunday"] = 2] = "Sunday"; + })(a.weekend || (a.weekend = {})); + var weekend = a.weekend; + })(exports.a || (exports.a = {})); + var a = exports.a; + var b = a.weekend; + exports.bVal = 2 /* Sunday */; +}); + + +//// [internalAliasEnumInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + enum weekend { + Friday = 0, + Saturday = 1, + Sunday = 2, + } +} +export declare var bVal; diff --git a/tests/baselines/reference/internalAliasFunction.js b/tests/baselines/reference/internalAliasFunction.js new file mode 100644 index 0000000000000..26cd6f21d55cc --- /dev/null +++ b/tests/baselines/reference/internalAliasFunction.js @@ -0,0 +1,31 @@ +//// [internalAliasFunction.ts] +module a { + export function foo(x: number) { + return x; + } +} + +module c { + import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; +} + + +//// [internalAliasFunction.js] +var a; +(function (a) { + function foo(x) { + return x; + } + a.foo = foo; +})(a || (a = {})); +var c; +(function (c) { + var b = a.foo; + c.bVal = b(10); + c.bVal2 = b; +})(c || (c = {})); + + +//// [internalAliasFunction.d.ts] diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..979c037ba616e --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.js @@ -0,0 +1,39 @@ +//// [internalAliasFunctionInsideLocalModuleWithExport.ts] +export module a { + export function foo(x: number) { + return x; + } +} + +export module c { + export import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; +} + + +//// [internalAliasFunctionInsideLocalModuleWithExport.js] +(function (a) { + function foo(x) { + return x; + } + a.foo = foo; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + c.b = a.foo; + c.bVal = c.b(10); + c.bVal2 = c.b; +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasFunctionInsideLocalModuleWithExport.d.ts] +export declare module a { + function foo(x); +} +export declare module c { + export import b = a.foo; + var bVal; + var bVal2; +} diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..abd17e53b2430 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.js @@ -0,0 +1,38 @@ +//// [internalAliasFunctionInsideLocalModuleWithoutExport.ts] +export module a { + export function foo(x: number) { + return x; + } +} + +export module c { + import b = a.foo; + var bVal = b(10); + export var bVal2 = b; +} + + +//// [internalAliasFunctionInsideLocalModuleWithoutExport.js] +(function (a) { + function foo(x) { + return x; + } + a.foo = foo; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.foo; + var bVal = b(10); + c.bVal2 = b; +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasFunctionInsideLocalModuleWithoutExport.d.ts] +export declare module a { + function foo(x); +} +export declare module c { + var bVal; + var bVal2; +} diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..3fd6a4f97cfac --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export function foo(x: number) { + return x; + } + } + + export module c { + import b = a.foo; + var bVal = b(10); + export var bVal2 = b; + } + var d = c.b(11); + ~ +!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..20a7ea282014f --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,29 @@ +//// [internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export function foo(x: number) { + return x; + } +} + +export module c { + import b = a.foo; + var bVal = b(10); + export var bVal2 = b; +} +var d = c.b(11); + +//// [internalAliasFunctionInsideLocalModuleWithoutExportAccessError.js] +(function (a) { + function foo(x) { + return x; + } + a.foo = foo; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.foo; + var bVal = b(10); + c.bVal2 = b; +})(exports.c || (exports.c = {})); +var c = exports.c; +var d = c.b(11); diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..102b63a9c49c4 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.js @@ -0,0 +1,34 @@ +//// [internalAliasFunctionInsideTopLevelModuleWithExport.ts] +export module a { + export function foo(x: number) { + return x; + } +} + +export import b = a.foo; +export var bVal = b(10); +export var bVal2 = b; + + +//// [internalAliasFunctionInsideTopLevelModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + function foo(x) { + return x; + } + a.foo = foo; + })(exports.a || (exports.a = {})); + var a = exports.a; + exports.b = a.foo; + exports.bVal = exports.b(10); + exports.bVal2 = exports.b; +}); + + +//// [internalAliasFunctionInsideTopLevelModuleWithExport.d.ts] +export declare module a { + function foo(x); +} +export import b = a.foo; +export declare var bVal; +export declare var bVal2; diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..b7ab03a480945 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,31 @@ +//// [internalAliasFunctionInsideTopLevelModuleWithoutExport.ts] +export module a { + export function foo(x: number) { + return x; + } +} + +import b = a.foo; +export var bVal = b(10); +export var bVal2 = b; + + +//// [internalAliasFunctionInsideTopLevelModuleWithoutExport.js] +(function (a) { + function foo(x) { + return x; + } + a.foo = foo; +})(exports.a || (exports.a = {})); +var a = exports.a; +var b = a.foo; +exports.bVal = b(10); +exports.bVal2 = b; + + +//// [internalAliasFunctionInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + function foo(x); +} +export declare var bVal; +export declare var bVal2; diff --git a/tests/baselines/reference/internalAliasInitializedModule.js b/tests/baselines/reference/internalAliasInitializedModule.js new file mode 100644 index 0000000000000..5b6fcf5056120 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModule.js @@ -0,0 +1,34 @@ +//// [internalAliasInitializedModule.ts] +module a { + export module b { + export class c { + } + } +} + +module c { + import b = a.b; + export var x: b.c = new b.c(); +} + +//// [internalAliasInitializedModule.js] +var a; +(function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; +})(a || (a = {})); +var c; +(function (c) { + var b = a.b; + c.x = new b.c(); +})(c || (c = {})); + + +//// [internalAliasInitializedModule.d.ts] diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..221a7a9e30866 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.js @@ -0,0 +1,46 @@ +//// [internalAliasInitializedModuleInsideLocalModuleWithExport.ts] +export module a { + export module b { + export class c { + } + } +} + +export module c { + export import b = a.b; + export var x: b.c = new b.c(); +} + +//// [internalAliasInitializedModuleInsideLocalModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; + })(exports.a || (exports.a = {})); + var a = exports.a; + (function (c) { + c.b = a.b; + c.x = new c.b.c(); + })(exports.c || (exports.c = {})); + var c = exports.c; +}); + + +//// [internalAliasInitializedModuleInsideLocalModuleWithExport.d.ts] +export declare module a { + module b { + class c { + } + } +} +export declare module c { + export import b = a.b; + var x; +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..750938104f969 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.js @@ -0,0 +1,43 @@ +//// [internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts] +export module a { + export module b { + export class c { + } + } +} + +export module c { + import b = a.b; + export var x: b.c = new b.c(); +} + +//// [internalAliasInitializedModuleInsideLocalModuleWithoutExport.js] +(function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.b; + c.x = new b.c(); +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasInitializedModuleInsideLocalModuleWithoutExport.d.ts] +export declare module a { + module b { + class c { + } + } +} +export declare module c { + var x; +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..344961894493d --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export module b { + export class c { + } + } + } + + export module c { + import b = a.b; + export var x: b.c = new b.c(); + } + + export var d = new c.b.c(); + ~ +!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..15283a8962d11 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,34 @@ +//// [internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export module b { + export class c { + } + } +} + +export module c { + import b = a.b; + export var x: b.c = new b.c(); +} + +export var d = new c.b.c(); + +//// [internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.js] +(function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.b; + c.x = new b.c(); +})(exports.c || (exports.c = {})); +var c = exports.c; +exports.d = new c.b.c(); diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..1871338d25225 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.js @@ -0,0 +1,37 @@ +//// [internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts] +export module a { + export module b { + export class c { + } + } +} + +export import b = a.b; +export var x: b.c = new b.c(); + +//// [internalAliasInitializedModuleInsideTopLevelModuleWithExport.js] +(function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; +})(exports.a || (exports.a = {})); +var a = exports.a; +exports.b = a.b; +exports.x = new exports.b.c(); + + +//// [internalAliasInitializedModuleInsideTopLevelModuleWithExport.d.ts] +export declare module a { + module b { + class c { + } + } +} +export import b = a.b; +export declare var x; diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..19c755a592622 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,38 @@ +//// [internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts] +export module a { + export module b { + export class c { + } + } +} + +import b = a.b; +export var x: b.c = new b.c(); + +//// [internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + (function (b) { + var c = (function () { + function c() { + } + return c; + })(); + b.c = c; + })(a.b || (a.b = {})); + var b = a.b; + })(exports.a || (exports.a = {})); + var a = exports.a; + var b = a.b; + exports.x = new b.c(); +}); + + +//// [internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + module b { + class c { + } + } +} +export declare var x; diff --git a/tests/baselines/reference/internalAliasInterface.js b/tests/baselines/reference/internalAliasInterface.js new file mode 100644 index 0000000000000..3e60693c4ab1f --- /dev/null +++ b/tests/baselines/reference/internalAliasInterface.js @@ -0,0 +1,20 @@ +//// [internalAliasInterface.ts] +module a { + export interface I { + } +} + +module c { + import b = a.I; + export var x: b; +} + + +//// [internalAliasInterface.js] +var c; +(function (c) { + c.x; +})(c || (c = {})); + + +//// [internalAliasInterface.d.ts] diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..05f61bb7e34e3 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.js @@ -0,0 +1,30 @@ +//// [internalAliasInterfaceInsideLocalModuleWithExport.ts] +export module a { + export interface I { + } +} + +export module c { + export import b = a.I; + export var x: b; +} + + +//// [internalAliasInterfaceInsideLocalModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (c) { + c.x; + })(exports.c || (exports.c = {})); + var c = exports.c; +}); + + +//// [internalAliasInterfaceInsideLocalModuleWithExport.d.ts] +export declare module a { + interface I { + } +} +export declare module c { + export import b = a.I; + var x; +} diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..d69acf501cd99 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.js @@ -0,0 +1,29 @@ +//// [internalAliasInterfaceInsideLocalModuleWithoutExport.ts] +export module a { + export interface I { + } +} + +export module c { + import b = a.I; + export var x: b; +} + + +//// [internalAliasInterfaceInsideLocalModuleWithoutExport.js] +define(["require", "exports"], function (require, exports) { + (function (c) { + c.x; + })(exports.c || (exports.c = {})); + var c = exports.c; +}); + + +//// [internalAliasInterfaceInsideLocalModuleWithoutExport.d.ts] +export declare module a { + interface I { + } +} +export declare module c { + var x; +} diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..eba8ac44484ba --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export interface I { + } + } + + export module c { + import b = a.I; + export var x: b; + } + + var x: c.b; + ~~~ +!!! Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..57c4dfb4cd0f2 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,21 @@ +//// [internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export interface I { + } +} + +export module c { + import b = a.I; + export var x: b; +} + +var x: c.b; + +//// [internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.js] +define(["require", "exports"], function (require, exports) { + (function (c) { + c.x; + })(exports.c || (exports.c = {})); + var c = exports.c; + var x; +}); diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..eb27389c9714d --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.js @@ -0,0 +1,21 @@ +//// [internalAliasInterfaceInsideTopLevelModuleWithExport.ts] +export module a { + export interface I { + } +} + +export import b = a.I; +export var x: b; + + +//// [internalAliasInterfaceInsideTopLevelModuleWithExport.js] +exports.x; + + +//// [internalAliasInterfaceInsideTopLevelModuleWithExport.d.ts] +export declare module a { + interface I { + } +} +export import b = a.I; +export declare var x; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..0edc03865bb7e --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,22 @@ +//// [internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts] +export module a { + export interface I { + } +} + +import b = a.I; +export var x: b; + + +//// [internalAliasInterfaceInsideTopLevelModuleWithoutExport.js] +define(["require", "exports"], function (require, exports) { + exports.x; +}); + + +//// [internalAliasInterfaceInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + interface I { + } +} +export declare var x; diff --git a/tests/baselines/reference/internalAliasUninitializedModule.js b/tests/baselines/reference/internalAliasUninitializedModule.js new file mode 100644 index 0000000000000..a54bd4ec91785 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModule.js @@ -0,0 +1,24 @@ +//// [internalAliasUninitializedModule.ts] +module a { + export module b { + export interface I { + foo(); + } + } +} + +module c { + import b = a.b; + export var x: b.I; + x.foo(); +} + +//// [internalAliasUninitializedModule.js] +var c; +(function (c) { + c.x; + c.x.foo(); +})(c || (c = {})); + + +//// [internalAliasUninitializedModule.d.ts] diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..906953ee00dd0 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.js @@ -0,0 +1,35 @@ +//// [internalAliasUninitializedModuleInsideLocalModuleWithExport.ts] +export module a { + export module b { + export interface I { + foo(); + } + } +} + +export module c { + export import b = a.b; + export var x: b.I; + x.foo(); +} + +//// [internalAliasUninitializedModuleInsideLocalModuleWithExport.js] +(function (c) { + c.x; + c.x.foo(); +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasUninitializedModuleInsideLocalModuleWithExport.d.ts] +export declare module a { + module b { + interface I { + foo(); + } + } +} +export declare module c { + export import b = a.b; + var x; +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..61087a85d1d62 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.js @@ -0,0 +1,34 @@ +//// [internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts] +export module a { + export module b { + export interface I { + foo(); + } + } +} + +export module c { + import b = a.b; + export var x: b.I; + x.foo(); +} + +//// [internalAliasUninitializedModuleInsideLocalModuleWithoutExport.js] +(function (c) { + c.x; + c.x.foo(); +})(exports.c || (exports.c = {})); +var c = exports.c; + + +//// [internalAliasUninitializedModuleInsideLocalModuleWithoutExport.d.ts] +export declare module a { + module b { + interface I { + foo(); + } + } +} +export declare module c { + var x; +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..b8b04cfc22441 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export module b { + export interface I { + foo(); + } + } + } + + export module c { + import b = a.b; + export var x: b.I; + x.foo(); + } + + + export var z: c.b.I; + ~~~~~ +!!! Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..dacc4d6a134bd --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,27 @@ +//// [internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export module b { + export interface I { + foo(); + } + } +} + +export module c { + import b = a.b; + export var x: b.I; + x.foo(); +} + + +export var z: c.b.I; + +//// [internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.js] +define(["require", "exports"], function (require, exports) { + (function (c) { + c.x; + c.x.foo(); + })(exports.c || (exports.c = {})); + var c = exports.c; + exports.z; +}); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..147b9324de40f --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js @@ -0,0 +1,31 @@ +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts] +export module a { + export module b { + export interface I { + foo(); + } + } +} + +export import b = a.b; +export var x: b.I; +x.foo(); + + +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + exports.x; + exports.x.foo(); +}); + + +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithExport.d.ts] +export declare module a { + module b { + interface I { + foo(); + } + } +} +export import b = a.b; +export declare var x; diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..5302c21d4db0b --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,28 @@ +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts] +export module a { + export module b { + export interface I { + foo(); + } + } +} + +import b = a.b; +export var x: b.I; +x.foo(); + + +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.js] +exports.x; +exports.x.foo(); + + +//// [internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + module b { + interface I { + foo(); + } + } +} +export declare var x; diff --git a/tests/baselines/reference/internalAliasVar.js b/tests/baselines/reference/internalAliasVar.js new file mode 100644 index 0000000000000..3d653c4c1e373 --- /dev/null +++ b/tests/baselines/reference/internalAliasVar.js @@ -0,0 +1,24 @@ +//// [internalAliasVar.ts] +module a { + export var x = 10; +} + +module c { + import b = a.x; + export var bVal = b; +} + + +//// [internalAliasVar.js] +var a; +(function (a) { + a.x = 10; +})(a || (a = {})); +var c; +(function (c) { + var b = a.x; + c.bVal = b; +})(c || (c = {})); + + +//// [internalAliasVar.d.ts] diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.js b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.js new file mode 100644 index 0000000000000..21fbab60c9a9a --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.js @@ -0,0 +1,33 @@ +//// [internalAliasVarInsideLocalModuleWithExport.ts] +export module a { + export var x = 10; +} + +export module c { + export import b = a.x; + export var bVal = b; +} + + +//// [internalAliasVarInsideLocalModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + a.x = 10; + })(exports.a || (exports.a = {})); + var a = exports.a; + (function (c) { + c.b = a.x; + c.bVal = c.b; + })(exports.c || (exports.c = {})); + var c = exports.c; +}); + + +//// [internalAliasVarInsideLocalModuleWithExport.d.ts] +export declare module a { + var x; +} +export declare module c { + export import b = a.x; + var bVal; +} diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.js b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.js new file mode 100644 index 0000000000000..5165656bf3099 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.js @@ -0,0 +1,32 @@ +//// [internalAliasVarInsideLocalModuleWithoutExport.ts] +export module a { + export var x = 10; +} + +export module c { + import b = a.x; + export var bVal = b; +} + + +//// [internalAliasVarInsideLocalModuleWithoutExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + a.x = 10; + })(exports.a || (exports.a = {})); + var a = exports.a; + (function (c) { + var b = a.x; + c.bVal = b; + })(exports.c || (exports.c = {})); + var c = exports.c; +}); + + +//// [internalAliasVarInsideLocalModuleWithoutExport.d.ts] +export declare module a { + var x; +} +export declare module c { + var bVal; +} diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt new file mode 100644 index 0000000000000..90723aaa15761 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== + export module a { + export var x = 10; + } + + export module c { + import b = a.x; + export var bVal = b; + } + + export var z = c.b; + ~ +!!! Property 'b' does not exist on type 'typeof c'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.js b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.js new file mode 100644 index 0000000000000..c1a6493066a22 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.js @@ -0,0 +1,23 @@ +//// [internalAliasVarInsideLocalModuleWithoutExportAccessError.ts] +export module a { + export var x = 10; +} + +export module c { + import b = a.x; + export var bVal = b; +} + +export var z = c.b; + +//// [internalAliasVarInsideLocalModuleWithoutExportAccessError.js] +(function (a) { + a.x = 10; +})(exports.a || (exports.a = {})); +var a = exports.a; +(function (c) { + var b = a.x; + c.bVal = b; +})(exports.c || (exports.c = {})); +var c = exports.c; +exports.z = c.b; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.js b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.js new file mode 100644 index 0000000000000..6a5606b1a983f --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.js @@ -0,0 +1,27 @@ +//// [internalAliasVarInsideTopLevelModuleWithExport.ts] +export module a { + export var x = 10; +} + +export import b = a.x; +export var bVal = b; + + + +//// [internalAliasVarInsideTopLevelModuleWithExport.js] +define(["require", "exports"], function (require, exports) { + (function (a) { + a.x = 10; + })(exports.a || (exports.a = {})); + var a = exports.a; + exports.b = a.x; + exports.bVal = exports.b; +}); + + +//// [internalAliasVarInsideTopLevelModuleWithExport.d.ts] +export declare module a { + var x; +} +export import b = a.x; +export declare var bVal; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.js b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.js new file mode 100644 index 0000000000000..d9dadd1ffbc50 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.js @@ -0,0 +1,24 @@ +//// [internalAliasVarInsideTopLevelModuleWithoutExport.ts] +export module a { + export var x = 10; +} + +import b = a.x; +export var bVal = b; + + + +//// [internalAliasVarInsideTopLevelModuleWithoutExport.js] +(function (a) { + a.x = 10; +})(exports.a || (exports.a = {})); +var a = exports.a; +var b = a.x; +exports.bVal = b; + + +//// [internalAliasVarInsideTopLevelModuleWithoutExport.d.ts] +export declare module a { + var x; +} +export declare var bVal; diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.js b/tests/baselines/reference/internalAliasWithDottedNameEmit.js new file mode 100644 index 0000000000000..d70da1ba16c22 --- /dev/null +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.js @@ -0,0 +1,20 @@ +//// [internalAliasWithDottedNameEmit.ts] +module a.b.c { + export var d; +} +module a.e.f { + import g = b.c; +} + + +//// [internalAliasWithDottedNameEmit.js] +var a; +(function (a) { + (function (b) { + (function (c) { + c.d; + })(b.c || (b.c = {})); + var c = b.c; + })(a.b || (a.b = {})); + var b = a.b; +})(a || (a = {})); diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js new file mode 100644 index 0000000000000..28cc2c2b6b404 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js @@ -0,0 +1,29 @@ +//// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts] +class A { + aProp: string; +} +module A { + export interface X { s: string } + export var a = 10; +} + +module B { + var A = 1; + import Y = A; +} + + +//// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.js] +var A = (function () { + function A() { + } + return A; +})(); +var A; +(function (A) { + A.a = 10; +})(A || (A = {})); +var B; +(function (B) { + var A = 1; +})(B || (B = {})); diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js new file mode 100644 index 0000000000000..23c4aed97d1d1 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js @@ -0,0 +1,24 @@ +//// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts] +class A { + aProp: string; +} +module A { + export interface X { s: string } + export var a = 10; +} + +module B { + import Y = A; +} + + +//// [internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js] +var A = (function () { + function A() { + } + return A; +})(); +var A; +(function (A) { + A.a = 10; +})(A || (A = {})); diff --git a/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.js b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.js new file mode 100644 index 0000000000000..be347879f6cd1 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.js @@ -0,0 +1,21 @@ +//// [internalImportInstantiatedModuleNotReferencingInstance.ts] +module A { + export interface X { s: string } + export var a = 10; +} + +module B { + var A = 1; + import Y = A; +} + + +//// [internalImportInstantiatedModuleNotReferencingInstance.js] +var A; +(function (A) { + A.a = 10; +})(A || (A = {})); +var B; +(function (B) { + var A = 1; +})(B || (B = {})); diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js new file mode 100644 index 0000000000000..883819975ef2e --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js @@ -0,0 +1,24 @@ +//// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts] +class A { + aProp: string; +} +module A { + export interface X { s: string } +} + +module B { + var A = 1; + import Y = A; +} + + +//// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.js] +var A = (function () { + function A() { + } + return A; +})(); +var B; +(function (B) { + var A = 1; +})(B || (B = {})); diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js new file mode 100644 index 0000000000000..a5357edc78f9c --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js @@ -0,0 +1,19 @@ +//// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts] +class A { + aProp: string; +} +module A { + export interface X { s: string } +} + +module B { + import Y = A; +} + + +//// [internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.js] +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.js b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.js new file mode 100644 index 0000000000000..8b6ce42014eba --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.js @@ -0,0 +1,16 @@ +//// [internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts] +module A { + export interface X { s: string } +} + +module B { + var A = 1; + import Y = A; +} + + +//// [internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.js] +var B; +(function (B) { + var A = 1; +})(B || (B = {})); diff --git a/tests/baselines/reference/intrinsics.errors.txt b/tests/baselines/reference/intrinsics.errors.txt new file mode 100644 index 0000000000000..c2ffc5a2fc926 --- /dev/null +++ b/tests/baselines/reference/intrinsics.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/intrinsics.ts (2 errors) ==== + + var hasOwnProperty: hasOwnProperty; // Error + ~~~~~~~~~~~~~~ +!!! Cannot find name 'hasOwnProperty'. + + module m1 { + export var __proto__; + interface __proto__ {} + + class C { } + } + + __proto__ = 0; // Error, __proto__ not defined + ~~~~~~~~~ +!!! Cannot find name '__proto__'. + m1.__proto__ = 0; + + class Foo<__proto__> { } + var foo: (__proto__: number) => void; \ No newline at end of file diff --git a/tests/baselines/reference/intrinsics.js b/tests/baselines/reference/intrinsics.js new file mode 100644 index 0000000000000..c1cea70db8660 --- /dev/null +++ b/tests/baselines/reference/intrinsics.js @@ -0,0 +1,36 @@ +//// [intrinsics.ts] + +var hasOwnProperty: hasOwnProperty; // Error + +module m1 { + export var __proto__; + interface __proto__ {} + + class C { } +} + +__proto__ = 0; // Error, __proto__ not defined +m1.__proto__ = 0; + +class Foo<__proto__> { } +var foo: (__proto__: number) => void; + +//// [intrinsics.js] +var hasOwnProperty; +var m1; +(function (m1) { + m1.__proto__; + var C = (function () { + function C() { + } + return C; + })(); +})(m1 || (m1 = {})); +__proto__ = 0; +m1.__proto__ = 0; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var foo; diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt new file mode 100644 index 0000000000000..a89539e5da3d2 --- /dev/null +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -0,0 +1,43 @@ +==== tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts (10 errors) ==== + var x: void; + x = 1; + ~ +!!! Type 'number' is not assignable to type 'void'. + x = true; + ~ +!!! Type 'boolean' is not assignable to type 'void'. + x = ''; + ~ +!!! Type 'string' is not assignable to type 'void'. + x = {} + ~ +!!! Type '{}' is not assignable to type 'void'. + + class C { foo: string; } + var c: C; + x = C; + ~ +!!! Type 'typeof C' is not assignable to type 'void'. + x = c; + ~ +!!! Type 'C' is not assignable to type 'void'. + + interface I { foo: string; } + var i: I; + x = i; + ~ +!!! Type 'I' is not assignable to type 'void'. + + module M { export var x = 1; } + x = M; + ~ +!!! Type 'typeof M' is not assignable to type 'void'. + + function f(a: T) { + x = a; + ~ +!!! Type 'T' is not assignable to type 'void'. + } + x = f; + ~ +!!! Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.js b/tests/baselines/reference/invalidAssignmentsToVoid.js new file mode 100644 index 0000000000000..218126d410826 --- /dev/null +++ b/tests/baselines/reference/invalidAssignmentsToVoid.js @@ -0,0 +1,49 @@ +//// [invalidAssignmentsToVoid.ts] +var x: void; +x = 1; +x = true; +x = ''; +x = {} + +class C { foo: string; } +var c: C; +x = C; +x = c; + +interface I { foo: string; } +var i: I; +x = i; + +module M { export var x = 1; } +x = M; + +function f(a: T) { + x = a; +} +x = f; + +//// [invalidAssignmentsToVoid.js] +var x; +x = 1; +x = true; +x = ''; +x = {}; +var C = (function () { + function C() { + } + return C; +})(); +var c; +x = C; +x = c; +var i; +x = i; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +x = M; +function f(a) { + x = a; +} +x = f; diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt new file mode 100644 index 0000000000000..cb02a3e9449c3 --- /dev/null +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts (10 errors) ==== + var x = true; + + var a: number = x; + ~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'number'. + var b: string = x; + ~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'string'. + var c: void = x; + ~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'void'. + var d: typeof undefined = x; + + enum E { A } + var e: E = x; + ~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'E'. + + class C { foo: string } + var f: C = x; + ~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'C': +!!! Property 'foo' is missing in type 'Boolean'. + + interface I { bar: string } + var g: I = x; + ~~~~~~~~ +!!! Type 'boolean' is not assignable to type 'I': +!!! Property 'bar' is missing in type 'Boolean'. + + var h: { (): string } = x; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'boolean' is not assignable to type '() => string'. + var h2: { toString(): string } = x; // no error + + module M { export var a = 1; } + M = x; + ~ +!!! Invalid left-hand side of assignment expression. + + function i(a: T) { + a = x; + ~ +!!! Type 'boolean' is not assignable to type 'T'. + } + i = x; + ~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.js b/tests/baselines/reference/invalidBooleanAssignments.js new file mode 100644 index 0000000000000..803f553c4d226 --- /dev/null +++ b/tests/baselines/reference/invalidBooleanAssignments.js @@ -0,0 +1,57 @@ +//// [invalidBooleanAssignments.ts] +var x = true; + +var a: number = x; +var b: string = x; +var c: void = x; +var d: typeof undefined = x; + +enum E { A } +var e: E = x; + +class C { foo: string } +var f: C = x; + +interface I { bar: string } +var g: I = x; + +var h: { (): string } = x; +var h2: { toString(): string } = x; // no error + +module M { export var a = 1; } +M = x; + +function i(a: T) { + a = x; +} +i = x; + +//// [invalidBooleanAssignments.js] +var x = true; +var a = x; +var b = x; +var c = x; +var d = x; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var e = x; +var C = (function () { + function C() { + } + return C; +})(); +var f = x; +var g = x; +var h = x; +var h2 = x; +var M; +(function (M) { + M.a = 1; +})(M || (M = {})); +M = x; +function i(a) { + a = x; +} +i = x; diff --git a/tests/baselines/reference/invalidConstraint1.errors.txt b/tests/baselines/reference/invalidConstraint1.errors.txt new file mode 100644 index 0000000000000..c38b126504c06 --- /dev/null +++ b/tests/baselines/reference/invalidConstraint1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/invalidConstraint1.ts (1 errors) ==== + function f() { + ~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + return undefined; + } + f(); // should error + + \ No newline at end of file diff --git a/tests/baselines/reference/invalidConstraint1.js b/tests/baselines/reference/invalidConstraint1.js new file mode 100644 index 0000000000000..f98e5777dc6b4 --- /dev/null +++ b/tests/baselines/reference/invalidConstraint1.js @@ -0,0 +1,13 @@ +//// [invalidConstraint1.ts] +function f() { + return undefined; +} +f(); // should error + + + +//// [invalidConstraint1.js] +function f() { + return undefined; +} +f(); diff --git a/tests/baselines/reference/invalidDoWhileBreakStatements.js b/tests/baselines/reference/invalidDoWhileBreakStatements.js new file mode 100644 index 0000000000000..4eab7f5098cdf --- /dev/null +++ b/tests/baselines/reference/invalidDoWhileBreakStatements.js @@ -0,0 +1,64 @@ +//// [invalidDoWhileBreakStatements.ts] +// All errors + +// naked break not allowed +break; + +// non-existent label +ONE: +do break TWO; while (true) + +// break from inside function +TWO: +do { + var x = () => { + break TWO; + } +}while (true) + +THREE: +do { + var fn = function () { + break THREE; + } +}while (true) + +// break forward +do { + break FIVE; + FIVE: + do { } while (true) +}while (true) + +// label on non-loop statement +NINE: +var y = 12; + +do { + break NINE; +}while (true) + +//// [invalidDoWhileBreakStatements.js] +break; +ONE: do + break TWO; +while (true); +TWO: do { + var x = function () { + break TWO; + }; +} while (true); +THREE: do { + var fn = function () { + break THREE; + }; +} while (true); +do { + break FIVE; + FIVE: do { + } while (true); +} while (true); +NINE: var y = 12; +do { + break NINE; +} while (true); diff --git a/tests/baselines/reference/invalidDoWhileContinueStatements.js b/tests/baselines/reference/invalidDoWhileContinueStatements.js new file mode 100644 index 0000000000000..ebb76c707ad58 --- /dev/null +++ b/tests/baselines/reference/invalidDoWhileContinueStatements.js @@ -0,0 +1,64 @@ +//// [invalidDoWhileContinueStatements.ts] +// All errors + +// naked continue not allowed +continue; + +// non-existent label +ONE: +do continue TWO; while (true) + +// continue from inside function +TWO: +do { + var x = () => { + continue TWO; + } +}while (true) + +THREE: +do { + var fn = function () { + continue THREE; + } +}while (true) + +// continue forward +do { + continue FIVE; + FIVE: + do { } while (true) +}while (true) + +// label on non-loop statement +NINE: +var y = 12; + +do { + continue NINE; +}while (true) + +//// [invalidDoWhileContinueStatements.js] +continue; +ONE: do + continue TWO; +while (true); +TWO: do { + var x = function () { + continue TWO; + }; +} while (true); +THREE: do { + var fn = function () { + continue THREE; + }; +} while (true); +do { + continue FIVE; + FIVE: do { + } while (true); +} while (true); +NINE: var y = 12; +do { + continue NINE; +} while (true); diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt new file mode 100644 index 0000000000000..cfbc67c339088 --- /dev/null +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts (6 errors) ==== + enum E { + A, + B + } + + enum E2 { + A, + B + } + + var e: E; + var e2: E2; + + e = E2.A; + ~ +!!! Type 'E2' is not assignable to type 'E'. + e2 = E.A; + ~~ +!!! Type 'E' is not assignable to type 'E2'. + e = null; + ~ +!!! Type 'void' is not assignable to type 'E'. + e = {}; + ~ +!!! Type '{}' is not assignable to type 'E'. + e = ''; + ~ +!!! Type 'string' is not assignable to type 'E'. + + function f(a: T) { + e = a; + ~ +!!! Type 'T' is not assignable to type 'E'. + } \ No newline at end of file diff --git a/tests/baselines/reference/invalidEnumAssignments.js b/tests/baselines/reference/invalidEnumAssignments.js new file mode 100644 index 0000000000000..b9bb9e12cedd6 --- /dev/null +++ b/tests/baselines/reference/invalidEnumAssignments.js @@ -0,0 +1,45 @@ +//// [invalidEnumAssignments.ts] +enum E { + A, + B +} + +enum E2 { + A, + B +} + +var e: E; +var e2: E2; + +e = E2.A; +e2 = E.A; +e = null; +e = {}; +e = ''; + +function f(a: T) { + e = a; +} + +//// [invalidEnumAssignments.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; +})(E || (E = {})); +var E2; +(function (E2) { + E2[E2["A"] = 0] = "A"; + E2[E2["B"] = 1] = "B"; +})(E2 || (E2 = {})); +var e; +var e2; +e = 0 /* A */; +e2 = 0 /* A */; +e = null; +e = {}; +e = ''; +function f(a) { + e = a; +} diff --git a/tests/baselines/reference/invalidForBreakStatements.js b/tests/baselines/reference/invalidForBreakStatements.js new file mode 100644 index 0000000000000..42a05d9d45105 --- /dev/null +++ b/tests/baselines/reference/invalidForBreakStatements.js @@ -0,0 +1,62 @@ +//// [invalidForBreakStatements.ts] +// All errors + +// naked break not allowed +break; + +// non-existent label +ONE: +for(;;) break TWO; + +// break from inside function +TWO: +for(;;) { + var x = () => { + break TWO; + } +} + +THREE: +for(;;) { + var fn = function () { + break THREE; + } +} + +// break forward +for(;;) { + break FIVE; + FIVE: + for (; ;) { } +} +// label on non-loop statement +NINE: +var y = 12; + +for(;;) { + break NINE; +} + +//// [invalidForBreakStatements.js] +break; +ONE: for (;;) + break TWO; +TWO: for (;;) { + var x = function () { + break TWO; + }; +} +THREE: for (;;) { + var fn = function () { + break THREE; + }; +} +for (;;) { + break FIVE; + FIVE: for (;;) { + } +} +NINE: var y = 12; +for (;;) { + break NINE; +} diff --git a/tests/baselines/reference/invalidForContinueStatements.js b/tests/baselines/reference/invalidForContinueStatements.js new file mode 100644 index 0000000000000..1204fe981c705 --- /dev/null +++ b/tests/baselines/reference/invalidForContinueStatements.js @@ -0,0 +1,62 @@ +//// [invalidForContinueStatements.ts] +// All errors + +// naked continue not allowed +continue; + +// non-existent label +ONE: +for(;;) continue TWO; + +// continue from inside function +TWO: +for(;;) { + var x = () => { + continue TWO; + } +} + +THREE: +for(;;) { + var fn = function () { + continue THREE; + } +} + +// continue forward +for(;;) { + continue FIVE; + FIVE: + for (; ;) { } +} +// label on non-loop statement +NINE: +var y = 12; + +for(;;) { + continue NINE; +} + +//// [invalidForContinueStatements.js] +continue; +ONE: for (;;) + continue TWO; +TWO: for (;;) { + var x = function () { + continue TWO; + }; +} +THREE: for (;;) { + var fn = function () { + continue THREE; + }; +} +for (;;) { + continue FIVE; + FIVE: for (;;) { + } +} +NINE: var y = 12; +for (;;) { + continue NINE; +} diff --git a/tests/baselines/reference/invalidForInBreakStatements.js b/tests/baselines/reference/invalidForInBreakStatements.js new file mode 100644 index 0000000000000..b9f4c0dcb979b --- /dev/null +++ b/tests/baselines/reference/invalidForInBreakStatements.js @@ -0,0 +1,63 @@ +//// [invalidForInBreakStatements.ts] +// All errors + +// naked break not allowed +break; + +// non-existent label +ONE: +for (var x in {}) break TWO; + +// break from inside function +TWO: +for (var x in {}) { + var fn = () => { + break TWO; + } +} + +THREE: +for (var x in {}) { + var fn = function () { + break THREE; + } +} + +// break forward +for (var x in {}) { + break FIVE; + FIVE: + for (var x in {}) { } +} + +// label on non-loop statement +NINE: +var y = 12; + +for (var x in {}) { + break NINE; +} + +//// [invalidForInBreakStatements.js] +break; +ONE: for (var x in {}) + break TWO; +TWO: for (var x in {}) { + var fn = function () { + break TWO; + }; +} +THREE: for (var x in {}) { + var fn = function () { + break THREE; + }; +} +for (var x in {}) { + break FIVE; + FIVE: for (var x in {}) { + } +} +NINE: var y = 12; +for (var x in {}) { + break NINE; +} diff --git a/tests/baselines/reference/invalidForInContinueStatements.js b/tests/baselines/reference/invalidForInContinueStatements.js new file mode 100644 index 0000000000000..8884f35034ab4 --- /dev/null +++ b/tests/baselines/reference/invalidForInContinueStatements.js @@ -0,0 +1,63 @@ +//// [invalidForInContinueStatements.ts] +// All errors + +// naked continue not allowed +continue; + +// non-existent label +ONE: +for (var x in {}) continue TWO; + +// continue from inside function +TWO: +for (var x in {}) { + var fn = () => { + continue TWO; + } +} + +THREE: +for (var x in {}) { + var fn = function () { + continue THREE; + } +} + +// continue forward +for (var x in {}) { + continue FIVE; + FIVE: + for (var x in {}) { } +} + +// label on non-loop statement +NINE: +var y = 12; + +for (var x in {}) { + continue NINE; +} + +//// [invalidForInContinueStatements.js] +continue; +ONE: for (var x in {}) + continue TWO; +TWO: for (var x in {}) { + var fn = function () { + continue TWO; + }; +} +THREE: for (var x in {}) { + var fn = function () { + continue THREE; + }; +} +for (var x in {}) { + continue FIVE; + FIVE: for (var x in {}) { + } +} +NINE: var y = 12; +for (var x in {}) { + continue NINE; +} diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt new file mode 100644 index 0000000000000..0248c590eb87a --- /dev/null +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts (4 errors) ==== + // none of these should work, since non are actually modules + + var V = 12; + + import v = V; + ~~~~~~~~~~~~~ +!!! Cannot find name 'V'. + + class C { + name: string; + } + + import c = C; + ~~~~~~~~~~~~~ +!!! Cannot find name 'C'. + + enum E { + Red, Blue + } + + import e = E; + ~~~~~~~~~~~~~ +!!! Cannot find name 'E'. + + interface I { + id: number; + } + + import i = I; + ~~~~~~~~~~~~~ +!!! Cannot find name 'I'. + \ No newline at end of file diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.js b/tests/baselines/reference/invalidImportAliasIdentifiers.js new file mode 100644 index 0000000000000..c0b6092fd1eba --- /dev/null +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.js @@ -0,0 +1,38 @@ +//// [invalidImportAliasIdentifiers.ts] +// none of these should work, since non are actually modules + +var V = 12; + +import v = V; + +class C { + name: string; +} + +import c = C; + +enum E { + Red, Blue +} + +import e = E; + +interface I { + id: number; +} + +import i = I; + + +//// [invalidImportAliasIdentifiers.js] +var V = 12; +var C = (function () { + function C() { + } + return C; +})(); +var E; +(function (E) { + E[E["Red"] = 0] = "Red"; + E[E["Blue"] = 1] = "Blue"; +})(E || (E = {})); diff --git a/tests/baselines/reference/invalidInstantiatedModule.errors.txt b/tests/baselines/reference/invalidInstantiatedModule.errors.txt new file mode 100644 index 0000000000000..ed5ae70403873 --- /dev/null +++ b/tests/baselines/reference/invalidInstantiatedModule.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/internalModules/moduleDeclarations/invalidInstantiatedModule.ts (2 errors) ==== + module M { + export class Point { x: number; y: number } + export var Point = 1; // Error + ~~~~~ +!!! Duplicate identifier 'Point'. + } + + module M2 { + export interface Point { x: number; y: number } + export var Point = 1; + } + + var m = M2; + var p: m.Point; // Error + ~~~~~~~ +!!! Cannot find name 'm'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/invalidInstantiatedModule.js b/tests/baselines/reference/invalidInstantiatedModule.js new file mode 100644 index 0000000000000..c180d1c7b4a7e --- /dev/null +++ b/tests/baselines/reference/invalidInstantiatedModule.js @@ -0,0 +1,34 @@ +//// [invalidInstantiatedModule.ts] +module M { + export class Point { x: number; y: number } + export var Point = 1; // Error +} + +module M2 { + export interface Point { x: number; y: number } + export var Point = 1; +} + +var m = M2; +var p: m.Point; // Error + + + + +//// [invalidInstantiatedModule.js] +var M; +(function (M) { + var Point = (function () { + function Point() { + } + return Point; + })(); + M.Point = Point; + M.Point = 1; +})(M || (M = {})); +var M2; +(function (M2) { + M2.Point = 1; +})(M2 || (M2 = {})); +var m = M2; +var p; diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt new file mode 100644 index 0000000000000..a9707aedc840c --- /dev/null +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt @@ -0,0 +1,121 @@ +==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts (21 errors) ==== + // All of these should be an error + + module Y { + public class A { s: string } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + + public class BB extends A { + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + id: number; + } + } + + module Y2 { + public class AA { s: T } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + public interface I { id: number } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + + public class B extends AA implements I { id: number } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + } + + module Y3 { + public module Module { + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + class A { s: string } + } + } + + module Y4 { + public enum Color { Blue, Red } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + } + + module YY { + private class A { s: string } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + + private class BB extends A { + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + id: number; + } + } + + module YY2 { + private class AA { s: T } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + private interface I { id: number } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + + private class B extends AA implements I { id: number } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + } + + module YY3 { + private module Module { + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + class A { s: string } + } + } + + module YY4 { + private enum Color { Blue, Red } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + } + + + module YYY { + static class A { s: string } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + + static class BB extends A { + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + id: number; + } + } + + module YYY2 { + static class AA { s: T } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + static interface I { id: number } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + + static class B extends AA implements I { id: number } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + } + + module YYY3 { + static module Module { + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + class A { s: string } + } + } + + module YYY4 { + static enum Color { Blue, Red } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + } + \ No newline at end of file diff --git a/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt new file mode 100644 index 0000000000000..80f516a2f665b --- /dev/null +++ b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt @@ -0,0 +1,40 @@ +==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithVarStatements.ts (6 errors) ==== + // All of these should be an error + + module Y { + public var x: number = 0; + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + } + + module Y2 { + public function fn(x: string) { } + ~~~~~~ +!!! 'public' modifier cannot appear on a module element. + } + + module Y4 { + static var x: number = 0; + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + } + + module YY { + static function fn(x: string) { } + ~~~~~~ +!!! 'static' modifier cannot appear on a module element. + } + + module YY2 { + private var x: number = 0; + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + } + + + module YY3 { + private function fn(x: string) { } + ~~~~~~~ +!!! 'private' modifier cannot appear on a module element. + } + \ No newline at end of file diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt new file mode 100644 index 0000000000000..b09865a2f2580 --- /dev/null +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt @@ -0,0 +1,78 @@ +==== tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts (12 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + valid: boolean; + } + + class C2 extends C { + name: string; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + // all of these are errors + var a: any; + var a = 1; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. + var a = 'a string'; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. + var a = new C(); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. + var a = new D(); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. + var a = M; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'. + + var b: I; + var b = new C(); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'. + var b = new C2(); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'. + + var f = F; + var f = (x: number) => ''; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'. + + var arr: string[]; + var arr = [1, 2, 3, 4]; + ~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'. + var arr = [new C(), new C2(), new D()]; + ~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '{}[]'. + + var arr2 = [new D()]; + var arr2 = new Array>(); + ~~~~ +!!! Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. + + var m: typeof M; + var m = M.A; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js new file mode 100644 index 0000000000000..bf8261cbaa87f --- /dev/null +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -0,0 +1,113 @@ +//// [invalidMultipleVariableDeclarations.ts] +interface I { + id: number; +} + +class C implements I { + id: number; + valid: boolean; +} + +class C2 extends C { + name: string; +} + +class D{ + source: T; + recurse: D; + wrapped: D> +} + +function F(x: string): number { return 42; } + +module M { + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } +} + +// all of these are errors +var a: any; +var a = 1; +var a = 'a string'; +var a = new C(); +var a = new D(); +var a = M; + +var b: I; +var b = new C(); +var b = new C2(); + +var f = F; +var f = (x: number) => ''; + +var arr: string[]; +var arr = [1, 2, 3, 4]; +var arr = [new C(), new C2(), new D()]; + +var arr2 = [new D()]; +var arr2 = new Array>(); + +var m: typeof M; +var m = M.A; + +//// [invalidMultipleVariableDeclarations.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C); +var D = (function () { + function D() { + } + return D; +})(); +function F(x) { + return 42; +} +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + function F2(x) { + return x.toString(); + } + M.F2 = F2; +})(M || (M = {})); +var a; +var a = 1; +var a = 'a string'; +var a = new C(); +var a = new D(); +var a = M; +var b; +var b = new C(); +var b = new C2(); +var f = F; +var f = function (x) { return ''; }; +var arr; +var arr = [1, 2, 3, 4]; +var arr = [new C(), new C2(), new D()]; +var arr2 = [new D()]; +var arr2 = new Array(); +var m; +var m = M.A; diff --git a/tests/baselines/reference/invalidNestedModules.errors.txt b/tests/baselines/reference/invalidNestedModules.errors.txt new file mode 100644 index 0000000000000..73a9d1e8f7f5b --- /dev/null +++ b/tests/baselines/reference/invalidNestedModules.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/conformance/internalModules/moduleDeclarations/invalidNestedModules.ts (1 errors) ==== + module A.B.C { + export class Point { + x: number; + y: number; + } + } + + module A { + export module B { + export class C { // Error + name: string; + } + } + } + + module M2.X { + export class Point { + x: number; y: number; + } + } + + module M2 { + export module X { + export var Point: number; // Error + ~~~~~ +!!! Duplicate identifier 'Point'. + } + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/invalidNestedModules.js b/tests/baselines/reference/invalidNestedModules.js new file mode 100644 index 0000000000000..ece1aeeaa7f43 --- /dev/null +++ b/tests/baselines/reference/invalidNestedModules.js @@ -0,0 +1,78 @@ +//// [invalidNestedModules.ts] +module A.B.C { + export class Point { + x: number; + y: number; + } +} + +module A { + export module B { + export class C { // Error + name: string; + } + } +} + +module M2.X { + export class Point { + x: number; y: number; + } +} + +module M2 { + export module X { + export var Point: number; // Error + } +} + + + + +//// [invalidNestedModules.js] +var A; +(function (A) { + (function (B) { + (function (C) { + var Point = (function () { + function Point() { + } + return Point; + })(); + C.Point = Point; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var A; +(function (A) { + (function (B) { + var C = (function () { + function C() { + } + return C; + })(); + B.C = C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var M2; +(function (M2) { + (function (X) { + var Point = (function () { + function Point() { + } + return Point; + })(); + X.Point = Point; + })(M2.X || (M2.X = {})); + var X = M2.X; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (X) { + X.Point; + })(M2.X || (M2.X = {})); + var X = M2.X; +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt new file mode 100644 index 0000000000000..65284424b93e1 --- /dev/null +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts (10 errors) ==== + var x = 1; + + var a: boolean = x; + ~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'boolean'. + var b: string = x; + ~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + var c: void = x; + ~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'void'. + var d: typeof undefined = x; + + class C { foo: string; } + var e: C = x; + ~~~~~~~~ +!!! Type 'number' is not assignable to type 'C': +!!! Property 'foo' is missing in type 'Number'. + + interface I { bar: string; } + var f: I = x; + ~~~~~~~~ +!!! Type 'number' is not assignable to type 'I': +!!! Property 'bar' is missing in type 'Number'. + + var g: { baz: string } = 1; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ baz: string; }': +!!! Property 'baz' is missing in type 'Number'. + var g2: { 0: number } = 1; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ 0: number; }': +!!! Property '0' is missing in type 'Number'. + + module M { export var x = 1; } + M = x; + ~ +!!! Invalid left-hand side of assignment expression. + + function i(a: T) { + a = x; + ~ +!!! Type 'number' is not assignable to type 'T'. + } + i = x; + ~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidNumberAssignments.js b/tests/baselines/reference/invalidNumberAssignments.js new file mode 100644 index 0000000000000..b381f5b050230 --- /dev/null +++ b/tests/baselines/reference/invalidNumberAssignments.js @@ -0,0 +1,49 @@ +//// [invalidNumberAssignments.ts] +var x = 1; + +var a: boolean = x; +var b: string = x; +var c: void = x; +var d: typeof undefined = x; + +class C { foo: string; } +var e: C = x; + +interface I { bar: string; } +var f: I = x; + +var g: { baz: string } = 1; +var g2: { 0: number } = 1; + +module M { export var x = 1; } +M = x; + +function i(a: T) { + a = x; +} +i = x; + +//// [invalidNumberAssignments.js] +var x = 1; +var a = x; +var b = x; +var c = x; +var d = x; +var C = (function () { + function C() { + } + return C; +})(); +var e = x; +var f = x; +var g = 1; +var g2 = 1; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +M = x; +function i(a) { + a = x; +} +i = x; diff --git a/tests/baselines/reference/invalidReferenceSyntax1.errors.txt b/tests/baselines/reference/invalidReferenceSyntax1.errors.txt new file mode 100644 index 0000000000000..58fbc197af437 --- /dev/null +++ b/tests/baselines/reference/invalidReferenceSyntax1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/invalidReferenceSyntax1.ts (1 errors) ==== + /// (); // WAWA is not a valid type + ~~~~ +!!! Cannot find name 'WAWA'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/invalidSymbolInTypeParameter1.js b/tests/baselines/reference/invalidSymbolInTypeParameter1.js new file mode 100644 index 0000000000000..1530b50686746 --- /dev/null +++ b/tests/baselines/reference/invalidSymbolInTypeParameter1.js @@ -0,0 +1,10 @@ +//// [invalidSymbolInTypeParameter1.ts] +function test() { + var cats = new Array(); // WAWA is not a valid type +} + + +//// [invalidSymbolInTypeParameter1.js] +function test() { + var cats = new Array(); +} diff --git a/tests/baselines/reference/invalidThrowStatement.errors.txt b/tests/baselines/reference/invalidThrowStatement.errors.txt new file mode 100644 index 0000000000000..11bd4b4d56e32 --- /dev/null +++ b/tests/baselines/reference/invalidThrowStatement.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/statements/throwStatements/invalidThrowStatement.ts (2 errors) ==== + throw; + ~ +!!! Expression expected. + + export throw null; + ~~~~~~ +!!! Declaration or statement expected. + \ No newline at end of file diff --git a/tests/baselines/reference/invalidTripleSlashReference.errors.txt b/tests/baselines/reference/invalidTripleSlashReference.errors.txt new file mode 100644 index 0000000000000..638681f99f86b --- /dev/null +++ b/tests/baselines/reference/invalidTripleSlashReference.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/invalidTripleSlashReference.ts (2 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! File 'filedoesnotexist.ts' not found. + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! File 'otherdoesnotexist.d.ts' not found. + + // this test doesn't actually give the errors you want due to the way the compiler reports errors + var x = 1; \ No newline at end of file diff --git a/tests/baselines/reference/invalidTryStatements.errors.txt b/tests/baselines/reference/invalidTryStatements.errors.txt new file mode 100644 index 0000000000000..14f6ed993c0b9 --- /dev/null +++ b/tests/baselines/reference/invalidTryStatements.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (3 errors) ==== + function fn() { + try { + } catch (x) { + var x: string; // ensure x is 'Any' + } + + // no type annotation allowed + try { } catch (z: any) { } + ~ +!!! Catch clause parameter cannot have a type annotation. + try { } catch (a: number) { } + ~ +!!! Catch clause parameter cannot have a type annotation. + try { } catch (y: string) { } + ~ +!!! Catch clause parameter cannot have a type annotation. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt new file mode 100644 index 0000000000000..3a9aa15b54038 --- /dev/null +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ==== + function fn() { + try { + } catch { // syntax error, missing '(x)' + ~ +!!! '(' expected. + } + + catch(x) { } // error missing try + ~~~~~ +!!! Statement expected. + ~ +!!! ';' expected. + ~ +!!! Cannot find name 'x'. + + finally{ } // error missing try + ~~~~~~~ +!!! Statement expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/invalidTypeNames.js b/tests/baselines/reference/invalidTypeNames.js new file mode 100644 index 0000000000000..37e703a2a4ce4 --- /dev/null +++ b/tests/baselines/reference/invalidTypeNames.js @@ -0,0 +1,12 @@ +//// [invalidTypeNames.ts] +// Refer to calling code - a real illegal name is subbed in here +class illegal_name_here { +} + + +//// [invalidTypeNames.js] +var illegal_name_here = (function () { + function illegal_name_here() { + } + return illegal_name_here; +})(); diff --git a/tests/baselines/reference/invalidTypeOfTarget.errors.txt b/tests/baselines/reference/invalidTypeOfTarget.errors.txt new file mode 100644 index 0000000000000..fa7d77d1a1806 --- /dev/null +++ b/tests/baselines/reference/invalidTypeOfTarget.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts (9 errors) ==== + var x1: typeof {}; + ~ +!!! Identifier expected. + var x2: typeof (): void; + ~ +!!! Identifier expected. + ~ +!!! '=>' expected. + var x3: typeof 1; + ~ +!!! Identifier expected. + var x4: typeof ''; + ~~ +!!! Identifier expected. + var x5: typeof []; + ~ +!!! Identifier expected. + var x6: typeof null; + ~~~~ +!!! Identifier expected. + var x7: typeof function f() { }; + ~~~~~~~~ +!!! Identifier expected. + var x8: typeof /123/; + ~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt new file mode 100644 index 0000000000000..bc8ad3e251bce --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts (6 errors) ==== + var x: typeof undefined; + + enum E { A } + E = x; + ~ +!!! Invalid left-hand side of assignment expression. + E.A = x; + ~~~ +!!! Invalid left-hand side of assignment expression. + + class C { foo: string } + var f: C; + C = x; + ~ +!!! Invalid left-hand side of assignment expression. + + interface I { foo: string } + var g: I; + g = x; + I = x; + ~ +!!! Cannot find name 'I'. + + module M { export var x = 1; } + M = x; + ~ +!!! Invalid left-hand side of assignment expression. + + function i(a: T) { } + // BUG 767030 + i = x; + ~ +!!! Invalid left-hand side of assignment expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedAssignments.js b/tests/baselines/reference/invalidUndefinedAssignments.js new file mode 100644 index 0000000000000..7d0b408fc1b65 --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedAssignments.js @@ -0,0 +1,49 @@ +//// [invalidUndefinedAssignments.ts] +var x: typeof undefined; + +enum E { A } +E = x; +E.A = x; + +class C { foo: string } +var f: C; +C = x; + +interface I { foo: string } +var g: I; +g = x; +I = x; + +module M { export var x = 1; } +M = x; + +function i(a: T) { } +// BUG 767030 +i = x; + +//// [invalidUndefinedAssignments.js] +var x; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +E = x; +0 /* A */ = x; +var C = (function () { + function C() { + } + return C; +})(); +var f; +C = x; +var g; +g = x; +I = x; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +M = x; +function i(a) { +} +i = x; diff --git a/tests/baselines/reference/invalidUndefinedValues.js b/tests/baselines/reference/invalidUndefinedValues.js new file mode 100644 index 0000000000000..b2a308d2cbfac --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedValues.js @@ -0,0 +1,68 @@ +//// [invalidUndefinedValues.ts] +var x: typeof undefined; + +x = 1; +x = ''; +x = true; +var a: void; +x = a; +x = null; + +class C { foo: string } +var b: C; +x = C; +x = b; + +interface I { foo: string } +var c: I; +x = c; + +module M { export var x = 1; } +x = M; + +x = { f() { } } + +function f(a: T) { + x = a; +} +x = f; + +enum E { A } +x = E; +x = E.A; + +//// [invalidUndefinedValues.js] +var x; +x = 1; +x = ''; +x = true; +var a; +x = a; +x = null; +var C = (function () { + function C() { + } + return C; +})(); +var b; +x = C; +x = b; +var c; +x = c; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +x = M; +x = { f: function f() { +} }; +function f(a) { + x = a; +} +x = f; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +x = E; +x = 0 /* A */; diff --git a/tests/baselines/reference/invalidUnicodeEscapeSequance.errors.txt b/tests/baselines/reference/invalidUnicodeEscapeSequance.errors.txt new file mode 100644 index 0000000000000..955833f58af95 --- /dev/null +++ b/tests/baselines/reference/invalidUnicodeEscapeSequance.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/invalidUnicodeEscapeSequance.ts (1 errors) ==== + var arg\u003 + +!!! Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUnicodeEscapeSequance2.errors.txt b/tests/baselines/reference/invalidUnicodeEscapeSequance2.errors.txt new file mode 100644 index 0000000000000..9e50aefa40b21 --- /dev/null +++ b/tests/baselines/reference/invalidUnicodeEscapeSequance2.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/invalidUnicodeEscapeSequance2.ts (1 errors) ==== + var arg\uxxxx + +!!! Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt b/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt new file mode 100644 index 0000000000000..1c0eac06f3c22 --- /dev/null +++ b/tests/baselines/reference/invalidUnicodeEscapeSequance3.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/invalidUnicodeEscapeSequance3.ts (3 errors) ==== + a\u + +!!! Invalid character. + ~ +!!! Cannot find name 'a'. + ~ +!!! Cannot find name 'u'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUnicodeEscapeSequance4.errors.txt b/tests/baselines/reference/invalidUnicodeEscapeSequance4.errors.txt new file mode 100644 index 0000000000000..f352353148613 --- /dev/null +++ b/tests/baselines/reference/invalidUnicodeEscapeSequance4.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/invalidUnicodeEscapeSequance4.ts (1 errors) ==== + var a\u0031; // a1 is a valid identifier + var \u0031a; // 1a is an invalid identifier + +!!! Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt new file mode 100644 index 0000000000000..ccfc5d3d6162c --- /dev/null +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -0,0 +1,58 @@ +==== tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts (13 errors) ==== + var x: void; + + var a: boolean = x; + ~~~~~~~~~~~~~~ +!!! Type 'void' is not assignable to type 'boolean'. + var b: string = x; + ~~~~~~~~~~~~~ +!!! Type 'void' is not assignable to type 'string'. + var c: number = x; + ~~~~~~~~~~~~~ +!!! Type 'void' is not assignable to type 'number'. + var d: typeof undefined = x; + + class C { foo: string; } + var e: C = x; + ~~~~~~~~ +!!! Type 'void' is not assignable to type 'C'. + + interface I { bar: string; } + var f: I = x; + ~~~~~~~~ +!!! Type 'void' is not assignable to type 'I'. + + var g: { baz: string } = 1; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ baz: string; }': +!!! Property 'baz' is missing in type 'Number'. + var g2: { 0: number } = 1; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type '{ 0: number; }': +!!! Property '0' is missing in type 'Number'. + + module M { export var x = 1; } + M = x; + ~ +!!! Invalid left-hand side of assignment expression. + + function i(a: T) { + a = x; + ~ +!!! Type 'void' is not assignable to type 'T'. + } + i = x; + ~ +!!! Invalid left-hand side of assignment expression. + + enum E { A } + x = E; + ~ +!!! Type 'typeof E' is not assignable to type 'void'. + x = E.A; + ~ +!!! Type 'E' is not assignable to type 'void'. + + x = { f() { } } + ~ +!!! Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidAssignments.js b/tests/baselines/reference/invalidVoidAssignments.js new file mode 100644 index 0000000000000..4bce3d903986f --- /dev/null +++ b/tests/baselines/reference/invalidVoidAssignments.js @@ -0,0 +1,63 @@ +//// [invalidVoidAssignments.ts] +var x: void; + +var a: boolean = x; +var b: string = x; +var c: number = x; +var d: typeof undefined = x; + +class C { foo: string; } +var e: C = x; + +interface I { bar: string; } +var f: I = x; + +var g: { baz: string } = 1; +var g2: { 0: number } = 1; + +module M { export var x = 1; } +M = x; + +function i(a: T) { + a = x; +} +i = x; + +enum E { A } +x = E; +x = E.A; + +x = { f() { } } + +//// [invalidVoidAssignments.js] +var x; +var a = x; +var b = x; +var c = x; +var d = x; +var C = (function () { + function C() { + } + return C; +})(); +var e = x; +var f = x; +var g = 1; +var g2 = 1; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +M = x; +function i(a) { + a = x; +} +i = x; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +x = E; +x = 0 /* A */; +x = { f: function f() { +} }; diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt new file mode 100644 index 0000000000000..2bab9f2004400 --- /dev/null +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/types/primitives/void/invalidVoidValues.ts (11 errors) ==== + var x: void; + x = 1; + ~ +!!! Type 'number' is not assignable to type 'void'. + x = ''; + ~ +!!! Type 'string' is not assignable to type 'void'. + x = true; + ~ +!!! Type 'boolean' is not assignable to type 'void'. + + enum E { A } + x = E; + ~ +!!! Type 'typeof E' is not assignable to type 'void'. + x = E.A; + ~ +!!! Type 'E' is not assignable to type 'void'. + + class C { foo: string } + var a: C; + x = a; + ~ +!!! Type 'C' is not assignable to type 'void'. + + interface I { foo: string } + var b: I; + x = b; + ~ +!!! Type 'I' is not assignable to type 'void'. + + x = { f() {} } + ~ +!!! Type '{ f: () => void; }' is not assignable to type 'void'. + + module M { export var x = 1; } + x = M; + ~ +!!! Type 'typeof M' is not assignable to type 'void'. + + function f(a: T) { + x = a; + ~ +!!! Type 'T' is not assignable to type 'void'. + } + x = f; + ~ +!!! Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidValues.js b/tests/baselines/reference/invalidVoidValues.js new file mode 100644 index 0000000000000..cc6457a41cb7c --- /dev/null +++ b/tests/baselines/reference/invalidVoidValues.js @@ -0,0 +1,59 @@ +//// [invalidVoidValues.ts] +var x: void; +x = 1; +x = ''; +x = true; + +enum E { A } +x = E; +x = E.A; + +class C { foo: string } +var a: C; +x = a; + +interface I { foo: string } +var b: I; +x = b; + +x = { f() {} } + +module M { export var x = 1; } +x = M; + +function f(a: T) { + x = a; +} +x = f; + +//// [invalidVoidValues.js] +var x; +x = 1; +x = ''; +x = true; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +x = E; +x = 0 /* A */; +var C = (function () { + function C() { + } + return C; +})(); +var a; +x = a; +var b; +x = b; +x = { f: function f() { +} }; +var M; +(function (M) { + M.x = 1; +})(M || (M = {})); +x = M; +function f(a) { + x = a; +} +x = f; diff --git a/tests/baselines/reference/invalidWhileBreakStatements.js b/tests/baselines/reference/invalidWhileBreakStatements.js new file mode 100644 index 0000000000000..9206a28d09dac --- /dev/null +++ b/tests/baselines/reference/invalidWhileBreakStatements.js @@ -0,0 +1,63 @@ +//// [invalidWhileBreakStatements.ts] +// All errors + +// naked break not allowed +break; + +// non-existent label +ONE: +while (true) break TWO; + +// break from inside function +TWO: +while (true){ + var x = () => { + break TWO; + } +} + +THREE: +while (true) { + var fn = function () { + break THREE; + } +} + +// break forward +while (true) { + break FIVE; + FIVE: + while (true) { } +} + +// label on non-loop statement +NINE: +var y = 12; + +while (true) { + break NINE; +} + +//// [invalidWhileBreakStatements.js] +break; +ONE: while (true) + break TWO; +TWO: while (true) { + var x = function () { + break TWO; + }; +} +THREE: while (true) { + var fn = function () { + break THREE; + }; +} +while (true) { + break FIVE; + FIVE: while (true) { + } +} +NINE: var y = 12; +while (true) { + break NINE; +} diff --git a/tests/baselines/reference/invalidWhileContinueStatements.js b/tests/baselines/reference/invalidWhileContinueStatements.js new file mode 100644 index 0000000000000..afd5799a7cf6e --- /dev/null +++ b/tests/baselines/reference/invalidWhileContinueStatements.js @@ -0,0 +1,63 @@ +//// [invalidWhileContinueStatements.ts] +// All errors + +// naked continue not allowed +continue; + +// non-existent label +ONE: +while (true) continue TWO; + +// continue from inside function +TWO: +while (true){ + var x = () => { + continue TWO; + } +} + +THREE: +while (true) { + var fn = function () { + continue THREE; + } +} + +// continue forward +while (true) { + continue FIVE; + FIVE: + while (true) { } +} + +// label on non-loop statement +NINE: +var y = 12; + +while (true) { + continue NINE; +} + +//// [invalidWhileContinueStatements.js] +continue; +ONE: while (true) + continue TWO; +TWO: while (true) { + var x = function () { + continue TWO; + }; +} +THREE: while (true) { + var fn = function () { + continue THREE; + }; +} +while (true) { + continue FIVE; + FIVE: while (true) { + } +} +NINE: var y = 12; +while (true) { + continue NINE; +} diff --git a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt new file mode 100644 index 0000000000000..4aabeeae79a22 --- /dev/null +++ b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/invocationExpressionInFunctionParameter.ts (1 errors) ==== + function foo1(val: string) { + } + function foo3(x = foo1(123)) { //should error, 123 is not string + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } \ No newline at end of file diff --git a/tests/baselines/reference/invocationExpressionInFunctionParameter.js b/tests/baselines/reference/invocationExpressionInFunctionParameter.js new file mode 100644 index 0000000000000..a7666926fc2e9 --- /dev/null +++ b/tests/baselines/reference/invocationExpressionInFunctionParameter.js @@ -0,0 +1,12 @@ +//// [invocationExpressionInFunctionParameter.ts] +function foo1(val: string) { +} +function foo3(x = foo1(123)) { //should error, 123 is not string +} + +//// [invocationExpressionInFunctionParameter.js] +function foo1(val) { +} +function foo3(x) { + if (x === void 0) { x = foo1(123); } +} diff --git a/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.errors.txt b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.errors.txt new file mode 100644 index 0000000000000..2349b5724b6dd --- /dev/null +++ b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/invokingNonGenericMethodWithTypeArguments1.ts (1 errors) ==== + class Foo { + constructor() { + this.foo(); + ~~~ +!!! Property 'foo' does not exist on type 'Foo'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.js b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.js new file mode 100644 index 0000000000000..5ac4976398cef --- /dev/null +++ b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments1.js @@ -0,0 +1,15 @@ +//// [invokingNonGenericMethodWithTypeArguments1.ts] +class Foo { + constructor() { + this.foo(); + } +} + + +//// [invokingNonGenericMethodWithTypeArguments1.js] +var Foo = (function () { + function Foo() { + this.foo(); + } + return Foo; +})(); diff --git a/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.errors.txt b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.errors.txt new file mode 100644 index 0000000000000..86e22d8b7413d --- /dev/null +++ b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/invokingNonGenericMethodWithTypeArguments2.ts (1 errors) ==== + class Foo { + private foo: any; + + constructor() { + this.foo(); + ~~~~~~~~~~~~~~~~~~ +!!! Untyped function calls may not accept type arguments. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.js b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.js new file mode 100644 index 0000000000000..26719b80c810c --- /dev/null +++ b/tests/baselines/reference/invokingNonGenericMethodWithTypeArguments2.js @@ -0,0 +1,17 @@ +//// [invokingNonGenericMethodWithTypeArguments2.ts] +class Foo { + private foo: any; + + constructor() { + this.foo(); + } +} + + +//// [invokingNonGenericMethodWithTypeArguments2.js] +var Foo = (function () { + function Foo() { + this.foo(); + } + return Foo; +})(); diff --git a/tests/baselines/reference/ipromise2.js b/tests/baselines/reference/ipromise2.js new file mode 100644 index 0000000000000..0204ac1d4e662 --- /dev/null +++ b/tests/baselines/reference/ipromise2.js @@ -0,0 +1,29 @@ +//// [ipromise2.ts] +declare module Windows.Foundation { + export interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + value: T; + } +} + +var p: Windows.Foundation.IPromise; + +var p2 = p.then(function (s) { + return 34; +} ); + + +var x: number = p2.value; + + + +//// [ipromise2.js] +var p; +var p2 = p.then(function (s) { + return 34; +}); +var x = p2.value; diff --git a/tests/baselines/reference/ipromise3.js b/tests/baselines/reference/ipromise3.js new file mode 100644 index 0000000000000..60bb78228567f --- /dev/null +++ b/tests/baselines/reference/ipromise3.js @@ -0,0 +1,19 @@ +//// [ipromise3.ts] +interface IPromise3 { + then(success?: (value: T) => IPromise3, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; + then(success?: (value: T) => IPromise3, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; + then(success?: (value: T) => U, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +} +var p1: IPromise3; +var p2: IPromise3 = p1.then(function (x) { + return x; +}); + + +//// [ipromise3.js] +var p1; +var p2 = p1.then(function (x) { + return x; +}); diff --git a/tests/baselines/reference/ipromise4.js b/tests/baselines/reference/ipromise4.js new file mode 100644 index 0000000000000..19f0c8da685a8 --- /dev/null +++ b/tests/baselines/reference/ipromise4.js @@ -0,0 +1,27 @@ +//// [ipromise4.ts] +declare module Windows.Foundation { + export interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + } +} + +var p: Windows.Foundation.IPromise = null; + +p.then(function (x) { } ); // should not error +p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // should not error + + + +//// [ipromise4.js] +var p = null; +p.then(function (x) { +}); +p.then(function (x) { + return "hello"; +}).then(function (x) { + return x; +}); diff --git a/tests/baselines/reference/isLiteral1.js b/tests/baselines/reference/isLiteral1.js new file mode 100644 index 0000000000000..e688eef72c3c7 --- /dev/null +++ b/tests/baselines/reference/isLiteral1.js @@ -0,0 +1,5 @@ +//// [isLiteral1.ts] +var x: number = 02343; + +//// [isLiteral1.js] +var x = 02343; diff --git a/tests/baselines/reference/isLiteral2.js b/tests/baselines/reference/isLiteral2.js new file mode 100644 index 0000000000000..3987c4e89b453 --- /dev/null +++ b/tests/baselines/reference/isLiteral2.js @@ -0,0 +1,5 @@ +//// [isLiteral2.ts] +var x: number = 02343 + +//// [isLiteral2.js] +var x = 02343; diff --git a/tests/baselines/reference/keywordField.js b/tests/baselines/reference/keywordField.js new file mode 100644 index 0000000000000..581d5afa14a38 --- /dev/null +++ b/tests/baselines/reference/keywordField.js @@ -0,0 +1,18 @@ +//// [keywordField.ts] +var obj:any = {}; + +obj.if = 1; + +var a = { if: "test" } + +var n = a.if + +var q = a["if"]; + + +//// [keywordField.js] +var obj = {}; +obj.if = 1; +var a = { if: "test" }; +var n = a.if; +var q = a["if"]; diff --git a/tests/baselines/reference/knockout.errors.txt b/tests/baselines/reference/knockout.errors.txt new file mode 100644 index 0000000000000..345542509c519 --- /dev/null +++ b/tests/baselines/reference/knockout.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/knockout.ts (1 errors) ==== + declare module ko { + export interface Observable { + (): T; + (value: T): any; + N: number; + g: boolean; + r: T; + } + export function observable(value: T): Observable; + } + var o = { + name: ko.observable("Bob"), + age: ko.observable(37) + } + var x_v = o.name().length + var age_v = o.age(); + var name_v = o.name("Robert"); + var zz_v = o.name.N; + var yy_v = o.name.g; + var rr_v = o.name.r; + var dd_v = o.name.d; + ~ +!!! Property 'd' does not exist on type 'Observable'. + \ No newline at end of file diff --git a/tests/baselines/reference/knockout.js b/tests/baselines/reference/knockout.js new file mode 100644 index 0000000000000..590556e41afca --- /dev/null +++ b/tests/baselines/reference/knockout.js @@ -0,0 +1,36 @@ +//// [knockout.ts] + declare module ko { + export interface Observable { + (): T; + (value: T): any; + N: number; + g: boolean; + r: T; + } + export function observable(value: T): Observable; + } + var o = { + name: ko.observable("Bob"), + age: ko.observable(37) + } + var x_v = o.name().length + var age_v = o.age(); + var name_v = o.name("Robert"); + var zz_v = o.name.N; + var yy_v = o.name.g; + var rr_v = o.name.r; + var dd_v = o.name.d; + + +//// [knockout.js] +var o = { + name: ko.observable("Bob"), + age: ko.observable(37) +}; +var x_v = o.name().length; +var age_v = o.age(); +var name_v = o.name("Robert"); +var zz_v = o.name.N; +var yy_v = o.name.g; +var rr_v = o.name.r; +var dd_v = o.name.d; diff --git a/tests/baselines/reference/lambdaASIEmit.js b/tests/baselines/reference/lambdaASIEmit.js new file mode 100644 index 0000000000000..551aa5f93dd9f --- /dev/null +++ b/tests/baselines/reference/lambdaASIEmit.js @@ -0,0 +1,15 @@ +//// [lambdaASIEmit.ts] + +function Foo(x: any) +{ +} + +Foo(() => + // do something + 127); + + +//// [lambdaASIEmit.js] +function Foo(x) { +} +Foo(function () { return 127; }); diff --git a/tests/baselines/reference/lambdaArgCrash.errors.txt b/tests/baselines/reference/lambdaArgCrash.errors.txt new file mode 100644 index 0000000000000..71a9cf4217d80 --- /dev/null +++ b/tests/baselines/reference/lambdaArgCrash.errors.txt @@ -0,0 +1,39 @@ +==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ==== + class Event { + + private _listeners: any[] = []; + + constructor () { + + // TODO: remove + + this._listeners = []; + + } + + add(listener: () => any): void { + + /// Registers a new listener for the event. + + /// The callback function to register. + + this._listeners.push(listener); + + } + + } + + class ItemSetEvent extends Event { + + add(listener: (items: ItemSet) => void ) { + ~~~~~~~ +!!! Cannot find name 'ItemSet'. + + super.add(listener); + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js new file mode 100644 index 0000000000000..49121f63ba1eb --- /dev/null +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -0,0 +1,63 @@ +//// [lambdaArgCrash.ts] +class Event { + + private _listeners: any[] = []; + + constructor () { + + // TODO: remove + + this._listeners = []; + + } + + add(listener: () => any): void { + + /// Registers a new listener for the event. + + /// The callback function to register. + + this._listeners.push(listener); + + } + +} + +class ItemSetEvent extends Event { + + add(listener: (items: ItemSet) => void ) { + + super.add(listener); + + } + +} + + +//// [lambdaArgCrash.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Event = (function () { + function Event() { + this._listeners = []; + this._listeners = []; + } + Event.prototype.add = function (listener) { + this._listeners.push(listener); + }; + return Event; +})(); +var ItemSetEvent = (function (_super) { + __extends(ItemSetEvent, _super); + function ItemSetEvent() { + _super.apply(this, arguments); + } + ItemSetEvent.prototype.add = function (listener) { + _super.prototype.add.call(this, listener); + }; + return ItemSetEvent; +})(Event); diff --git a/tests/baselines/reference/lambdaExpression.js b/tests/baselines/reference/lambdaExpression.js new file mode 100644 index 0000000000000..65636b87dd108 --- /dev/null +++ b/tests/baselines/reference/lambdaExpression.js @@ -0,0 +1,12 @@ +//// [lambdaExpression.ts] +() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) +var y = 0; +(()=>0); +var x = 0; + + +//// [lambdaExpression.js] +(function () { return 0; }); +var y = 0; +(function () { return 0; }); +var x = 0; diff --git a/tests/baselines/reference/lambdaParamTypes.errors.txt b/tests/baselines/reference/lambdaParamTypes.errors.txt new file mode 100644 index 0000000000000..7322e7578e71f --- /dev/null +++ b/tests/baselines/reference/lambdaParamTypes.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/lambdaParamTypes.ts (6 errors) ==== + interface MyArrayWrapper { + constructor(initialItems?: T[]); + doSomething(predicate: (x: T, y: T) => string): void; + } + + declare function create(initialValues?: T[]): MyArrayWrapper; + + var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); + + // Below should all be OK + thing.doSomething((x, y) => x.name.charAt(0)); // x.name should be string, so should be OK + thing.doSomething((x, y) => x.id.toExponential(0)); // x.id should be string, so should be OK + thing.doSomething((x, y) => y.name.charAt(0)); // x.name should be string, so should be OK + thing.doSomething((x, y) => y.id.toExponential(0)); // x.id should be string, so should be OK + + // Below should all be in error + thing.doSomething((x, y) => x.foo); // no such property on x + ~~~ +!!! Property 'foo' does not exist on type '{ name: string; id: number; }'. + thing.doSomething((x, y) => y.foo); // no such property on y + ~~~ +!!! Property 'foo' does not exist on type '{ name: string; id: number; }'. + thing.doSomething((x, y) => x.id.charAt(0)); // x.id should be number, no charAt member + ~~~~~~ +!!! Property 'charAt' does not exist on type 'number'. + thing.doSomething((x, y) => x.name.toExponential(0)); // x.name should be string, no toExponential member + ~~~~~~~~~~~~~ +!!! Property 'toExponential' does not exist on type 'string'. + thing.doSomething((x, y) => y.id.charAt(0)); + ~~~~~~ +!!! Property 'charAt' does not exist on type 'number'. + thing.doSomething((x, y) => y.name.toExponential(0)); + ~~~~~~~~~~~~~ +!!! Property 'toExponential' does not exist on type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/lambdaParamTypes.js b/tests/baselines/reference/lambdaParamTypes.js new file mode 100644 index 0000000000000..c1457565d3c25 --- /dev/null +++ b/tests/baselines/reference/lambdaParamTypes.js @@ -0,0 +1,37 @@ +//// [lambdaParamTypes.ts] +interface MyArrayWrapper { + constructor(initialItems?: T[]); + doSomething(predicate: (x: T, y: T) => string): void; +} + +declare function create(initialValues?: T[]): MyArrayWrapper; + +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); + +// Below should all be OK +thing.doSomething((x, y) => x.name.charAt(0)); // x.name should be string, so should be OK +thing.doSomething((x, y) => x.id.toExponential(0)); // x.id should be string, so should be OK +thing.doSomething((x, y) => y.name.charAt(0)); // x.name should be string, so should be OK +thing.doSomething((x, y) => y.id.toExponential(0)); // x.id should be string, so should be OK + +// Below should all be in error +thing.doSomething((x, y) => x.foo); // no such property on x +thing.doSomething((x, y) => y.foo); // no such property on y +thing.doSomething((x, y) => x.id.charAt(0)); // x.id should be number, no charAt member +thing.doSomething((x, y) => x.name.toExponential(0)); // x.name should be string, no toExponential member +thing.doSomething((x, y) => y.id.charAt(0)); +thing.doSomething((x, y) => y.name.toExponential(0)); + + +//// [lambdaParamTypes.js] +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); +thing.doSomething(function (x, y) { return x.name.charAt(0); }); +thing.doSomething(function (x, y) { return x.id.toExponential(0); }); +thing.doSomething(function (x, y) { return y.name.charAt(0); }); +thing.doSomething(function (x, y) { return y.id.toExponential(0); }); +thing.doSomething(function (x, y) { return x.foo; }); +thing.doSomething(function (x, y) { return y.foo; }); +thing.doSomething(function (x, y) { return x.id.charAt(0); }); +thing.doSomething(function (x, y) { return x.name.toExponential(0); }); +thing.doSomething(function (x, y) { return y.id.charAt(0); }); +thing.doSomething(function (x, y) { return y.name.toExponential(0); }); diff --git a/tests/baselines/reference/lambdaPropSelf.errors.txt b/tests/baselines/reference/lambdaPropSelf.errors.txt new file mode 100644 index 0000000000000..ef79ee9d619b6 --- /dev/null +++ b/tests/baselines/reference/lambdaPropSelf.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/lambdaPropSelf.ts (1 errors) ==== + declare var ko: any; + + class Person { + children: string[]; + + constructor (public name: string, children: string[]) { + this.children = ko.observableArray(children); + } + + addChild = () => this.children.push("New child"); + } + + + class T { + fo() { + var x = this; + } + } + + module M { + var x = this; + ~~~~ +!!! 'this' cannot be referenced in a module body. + } + \ No newline at end of file diff --git a/tests/baselines/reference/lambdaPropSelf.js b/tests/baselines/reference/lambdaPropSelf.js new file mode 100644 index 0000000000000..1630bd0c5d7f5 --- /dev/null +++ b/tests/baselines/reference/lambdaPropSelf.js @@ -0,0 +1,47 @@ +//// [lambdaPropSelf.ts] +declare var ko: any; + +class Person { + children: string[]; + + constructor (public name: string, children: string[]) { + this.children = ko.observableArray(children); + } + + addChild = () => this.children.push("New child"); +} + + +class T { + fo() { + var x = this; + } +} + +module M { + var x = this; +} + + +//// [lambdaPropSelf.js] +var Person = (function () { + function Person(name, children) { + this.name = name; + var _this = this; + this.addChild = function () { return _this.children.push("New child"); }; + this.children = ko.observableArray(children); + } + return Person; +})(); +var T = (function () { + function T() { + } + T.prototype.fo = function () { + var x = this; + }; + return T; +})(); +var M; +(function (M) { + var x = this; +})(M || (M = {})); diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt new file mode 100644 index 0000000000000..2353947766faf --- /dev/null +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/lastPropertyInLiteralWins.ts (3 errors) ==== + interface Thing { + thunk: (str: string) => void; + } + function test(thing: Thing) { + thing.thunk("str"); + } + test({ // Should error, as last one wins, and is wrong type + thunk: (str: string) => {}, + thunk: (num: number) => {} + ~~~~~ +!!! Duplicate identifier 'thunk'. + }); + + test({ // Should be OK. Last 'thunk' is of correct type + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + thunk: (num: number) => {}, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + thunk: (str: string) => {} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! Duplicate identifier 'thunk'. + }); + ~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.js b/tests/baselines/reference/lastPropertyInLiteralWins.js new file mode 100644 index 0000000000000..19ec4e210003e --- /dev/null +++ b/tests/baselines/reference/lastPropertyInLiteralWins.js @@ -0,0 +1,34 @@ +//// [lastPropertyInLiteralWins.ts] +interface Thing { + thunk: (str: string) => void; +} +function test(thing: Thing) { + thing.thunk("str"); +} +test({ // Should error, as last one wins, and is wrong type + thunk: (str: string) => {}, + thunk: (num: number) => {} +}); + +test({ // Should be OK. Last 'thunk' is of correct type + thunk: (num: number) => {}, + thunk: (str: string) => {} +}); + + +//// [lastPropertyInLiteralWins.js] +function test(thing) { + thing.thunk("str"); +} +test({ + thunk: function (str) { + }, + thunk: function (num) { + } +}); +test({ + thunk: function (num) { + }, + thunk: function (str) { + } +}); diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt new file mode 100644 index 0000000000000..6212466b1efe7 --- /dev/null +++ b/tests/baselines/reference/libMembers.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/libMembers.ts (3 errors) ==== + var s="hello"; + s.substring(0); + s.substring(3,4); + s.subby(12); // error unresolved + ~~~~~ +!!! Property 'subby' does not exist on type 'string'. + String.fromCharCode(12); + module M { + export class C { + } + var a=new C[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + a.length; + a.push(new C()); + (new C()).prototype; + ~~~~~~~~~ +!!! Property 'prototype' does not exist on type 'C'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/libdtsFix.js b/tests/baselines/reference/libdtsFix.js new file mode 100644 index 0000000000000..2f3cabdd73744 --- /dev/null +++ b/tests/baselines/reference/libdtsFix.js @@ -0,0 +1,7 @@ +//// [libdtsFix.ts] +interface HTMLElement { + type: string; +} + + +//// [libdtsFix.js] diff --git a/tests/baselines/reference/library_ArraySlice.js b/tests/baselines/reference/library_ArraySlice.js new file mode 100644 index 0000000000000..89e4134237df3 --- /dev/null +++ b/tests/baselines/reference/library_ArraySlice.js @@ -0,0 +1,10 @@ +//// [library_ArraySlice.ts] +// Array.prototype.slice can have zero, one, or two arguments +Array.prototype.slice(); +Array.prototype.slice(0); +Array.prototype.slice(0, 1); + +//// [library_ArraySlice.js] +Array.prototype.slice(); +Array.prototype.slice(0); +Array.prototype.slice(0, 1); diff --git a/tests/baselines/reference/library_DatePrototypeProperties.js b/tests/baselines/reference/library_DatePrototypeProperties.js new file mode 100644 index 0000000000000..4a9b9269dfae1 --- /dev/null +++ b/tests/baselines/reference/library_DatePrototypeProperties.js @@ -0,0 +1,96 @@ +//// [library_DatePrototypeProperties.ts] +// Properties of the Date prototype object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.5 +Date.prototype.constructor; +Date.prototype.toString(); +Date.prototype.toDateString(); +Date.prototype.toTimeString(); +Date.prototype.toLocaleString(); +Date.prototype.toLocaleDateString(); +Date.prototype.toLocaleTimeString(); +Date.prototype.valueOf(); + +Date.prototype.getTime(); +Date.prototype.getFullYear(); +Date.prototype.getUTCFullYear(); +Date.prototype.getMonth(); +Date.prototype.getUTCMonth(); +Date.prototype.getDate(); +Date.prototype.getUTCDate(); +Date.prototype.getDay(); +Date.prototype.getUTCDay(); +Date.prototype.getHours(); +Date.prototype.getUTCHours(); +Date.prototype.getMinutes(); +Date.prototype.getUTCMinutes(); +Date.prototype.getSeconds(); +Date.prototype.getUTCSeconds(); +Date.prototype.getMilliseconds(); +Date.prototype.getUTCMilliseconds(); +Date.prototype.getTimezoneOffset(); + +Date.prototype.setTime(0); +Date.prototype.setMilliseconds(0); +Date.prototype.setUTCMilliseconds(0); +Date.prototype.setSeconds(0); +Date.prototype.setUTCSeconds(0); +Date.prototype.setMinutes(0); +Date.prototype.setUTCMinutes(0); +Date.prototype.setHours(0); +Date.prototype.setUTCHours(0); +Date.prototype.setDate(0); +Date.prototype.setUTCDate(0); +Date.prototype.setMonth(0); +Date.prototype.setUTCMonth(0); +Date.prototype.setFullYear(0); +Date.prototype.setUTCFullYear(0); + +Date.prototype.toUTCString(); +Date.prototype.toISOString(); +Date.prototype.toJSON(null); + +//// [library_DatePrototypeProperties.js] +Date.prototype.constructor; +Date.prototype.toString(); +Date.prototype.toDateString(); +Date.prototype.toTimeString(); +Date.prototype.toLocaleString(); +Date.prototype.toLocaleDateString(); +Date.prototype.toLocaleTimeString(); +Date.prototype.valueOf(); +Date.prototype.getTime(); +Date.prototype.getFullYear(); +Date.prototype.getUTCFullYear(); +Date.prototype.getMonth(); +Date.prototype.getUTCMonth(); +Date.prototype.getDate(); +Date.prototype.getUTCDate(); +Date.prototype.getDay(); +Date.prototype.getUTCDay(); +Date.prototype.getHours(); +Date.prototype.getUTCHours(); +Date.prototype.getMinutes(); +Date.prototype.getUTCMinutes(); +Date.prototype.getSeconds(); +Date.prototype.getUTCSeconds(); +Date.prototype.getMilliseconds(); +Date.prototype.getUTCMilliseconds(); +Date.prototype.getTimezoneOffset(); +Date.prototype.setTime(0); +Date.prototype.setMilliseconds(0); +Date.prototype.setUTCMilliseconds(0); +Date.prototype.setSeconds(0); +Date.prototype.setUTCSeconds(0); +Date.prototype.setMinutes(0); +Date.prototype.setUTCMinutes(0); +Date.prototype.setHours(0); +Date.prototype.setUTCHours(0); +Date.prototype.setDate(0); +Date.prototype.setUTCDate(0); +Date.prototype.setMonth(0); +Date.prototype.setUTCMonth(0); +Date.prototype.setFullYear(0); +Date.prototype.setUTCFullYear(0); +Date.prototype.toUTCString(); +Date.prototype.toISOString(); +Date.prototype.toJSON(null); diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.js b/tests/baselines/reference/library_ObjectPrototypeProperties.js new file mode 100644 index 0000000000000..ce3b18b28b6b3 --- /dev/null +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.js @@ -0,0 +1,19 @@ +//// [library_ObjectPrototypeProperties.ts] +// Properties of the Object Prototype Object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4 +Object.prototype.constructor; +Object.prototype.toString(); +Object.prototype.toLocaleString(); +Object.prototype.valueOf(); +Object.prototype.hasOwnProperty("string"); +Object.prototype.isPrototypeOf(Object); +Object.prototype.propertyIsEnumerable("string"); + +//// [library_ObjectPrototypeProperties.js] +Object.prototype.constructor; +Object.prototype.toString(); +Object.prototype.toLocaleString(); +Object.prototype.valueOf(); +Object.prototype.hasOwnProperty("string"); +Object.prototype.isPrototypeOf(Object); +Object.prototype.propertyIsEnumerable("string"); diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.js b/tests/baselines/reference/library_RegExpExecArraySlice.js new file mode 100644 index 0000000000000..f5a07524726a0 --- /dev/null +++ b/tests/baselines/reference/library_RegExpExecArraySlice.js @@ -0,0 +1,12 @@ +//// [library_RegExpExecArraySlice.ts] +// RegExpExecArray.slice can have zero, one, or two arguments +var regExpExecArrayValue: RegExpExecArray; +regExpExecArrayValue.slice(); +regExpExecArrayValue.slice(0); +regExpExecArrayValue.slice(0,1); + +//// [library_RegExpExecArraySlice.js] +var regExpExecArrayValue; +regExpExecArrayValue.slice(); +regExpExecArrayValue.slice(0); +regExpExecArrayValue.slice(0, 1); diff --git a/tests/baselines/reference/library_StringSlice.js b/tests/baselines/reference/library_StringSlice.js new file mode 100644 index 0000000000000..28a0b27b902da --- /dev/null +++ b/tests/baselines/reference/library_StringSlice.js @@ -0,0 +1,11 @@ +//// [library_StringSlice.ts] +// String.prototype.slice can have zero, one, or two arguments +String.prototype.slice(); +String.prototype.slice(0); +String.prototype.slice(0,1); + + +//// [library_StringSlice.js] +String.prototype.slice(); +String.prototype.slice(0); +String.prototype.slice(0, 1); diff --git a/tests/baselines/reference/lift.errors.txt b/tests/baselines/reference/lift.errors.txt new file mode 100644 index 0000000000000..56f8a8602115b --- /dev/null +++ b/tests/baselines/reference/lift.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/lift.ts (4 errors) ==== + class B { + constructor(public y:number) { + } + public ll:number; // to be shadowed + } + + class C extends B { + constructor(y:number,z:number,w:number) { + super(y) + var x=10+w; + var ll=x*w; + } + + public liftxyz () { return x+z+this.y; } + ~ +!!! Cannot find name 'x'. + ~ +!!! Cannot find name 'z'. + public liftxylocllz () { return x+z+this.y+this.ll; } + ~ +!!! Cannot find name 'x'. + ~ +!!! Cannot find name 'z'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js new file mode 100644 index 0000000000000..21c09aaeb53b0 --- /dev/null +++ b/tests/baselines/reference/lift.js @@ -0,0 +1,47 @@ +//// [lift.ts] +class B { + constructor(public y:number) { + } + public ll:number; // to be shadowed +} + +class C extends B { + constructor(y:number,z:number,w:number) { + super(y) + var x=10+w; + var ll=x*w; + } + + public liftxyz () { return x+z+this.y; } + public liftxylocllz () { return x+z+this.y+this.ll; } +} + + +//// [lift.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var B = (function () { + function B(y) { + this.y = y; + } + return B; +})(); +var C = (function (_super) { + __extends(C, _super); + function C(y, z, w) { + _super.call(this, y); + var x = 10 + w; + var ll = x * w; + } + C.prototype.liftxyz = function () { + return x + z + this.y; + }; + C.prototype.liftxylocllz = function () { + return x + z + this.y + this.ll; + }; + return C; +})(B); diff --git a/tests/baselines/reference/listFailure.js b/tests/baselines/reference/listFailure.js new file mode 100644 index 0000000000000..fa2fc9b345379 --- /dev/null +++ b/tests/baselines/reference/listFailure.js @@ -0,0 +1,89 @@ +//// [listFailure.ts] +module Editor { + + export class Buffer { + lines: List = ListMakeHead(); + + addLine(lineText: string): List { + + var line: Line = new Line(); + var lineEntry = this.lines.add(line); + + return lineEntry; + } + } + + export function ListRemoveEntry(entry: List): List { + return entry; + } + + export function ListMakeHead(): List { + return null; + } + + export function ListMakeEntry(data: U): List { + return null; + } + + class List { + public next: List; + + add(data: T): List { + this.next = ListMakeEntry(data); + return this.next; + } + + popEntry(head: List): List { + return (ListRemoveEntry(this.next)); + } + } + + export class Line {} +} + +//// [listFailure.js] +var Editor; +(function (Editor) { + var Buffer = (function () { + function Buffer() { + this.lines = ListMakeHead(); + } + Buffer.prototype.addLine = function (lineText) { + var line = new Line(); + var lineEntry = this.lines.add(line); + return lineEntry; + }; + return Buffer; + })(); + Editor.Buffer = Buffer; + function ListRemoveEntry(entry) { + return entry; + } + Editor.ListRemoveEntry = ListRemoveEntry; + function ListMakeHead() { + return null; + } + Editor.ListMakeHead = ListMakeHead; + function ListMakeEntry(data) { + return null; + } + Editor.ListMakeEntry = ListMakeEntry; + var List = (function () { + function List() { + } + List.prototype.add = function (data) { + this.next = ListMakeEntry(data); + return this.next; + }; + List.prototype.popEntry = function (head) { + return (ListRemoveEntry(this.next)); + }; + return List; + })(); + var Line = (function () { + function Line() { + } + return Line; + })(); + Editor.Line = Line; +})(Editor || (Editor = {})); diff --git a/tests/baselines/reference/literals-negative.errors.txt b/tests/baselines/reference/literals-negative.errors.txt new file mode 100644 index 0000000000000..a7e7b08d46a15 --- /dev/null +++ b/tests/baselines/reference/literals-negative.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/literals-negative.ts (1 errors) ==== + // Type type of the null literal is the Null type. + // Null can be converted to anything except Void + var n = (null); + var s = (null); + var b = (n); + ~~~~~~~~~~~~ +!!! Neither type 'boolean' nor type 'number' is assignable to the other. + + function isVoid() : void { } + + // Expected error: Values of type null and void cannot be compared + if(null === isVoid()) { } + \ No newline at end of file diff --git a/tests/baselines/reference/literals-negative.js b/tests/baselines/reference/literals-negative.js new file mode 100644 index 0000000000000..a16e1524e8c98 --- /dev/null +++ b/tests/baselines/reference/literals-negative.js @@ -0,0 +1,21 @@ +//// [literals-negative.ts] +// Type type of the null literal is the Null type. +// Null can be converted to anything except Void +var n = (null); +var s = (null); +var b = (n); + +function isVoid() : void { } + +// Expected error: Values of type null and void cannot be compared +if(null === isVoid()) { } + + +//// [literals-negative.js] +var n = (null); +var s = (null); +var b = (n); +function isVoid() { +} +if (null === isVoid()) { +} diff --git a/tests/baselines/reference/literals.errors.txt b/tests/baselines/reference/literals.errors.txt new file mode 100644 index 0000000000000..edfdad8c27975 --- /dev/null +++ b/tests/baselines/reference/literals.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/expressions/literals/literals.ts (4 errors) ==== + + //typeof null is Null + //typeof true is Boolean + //typeof false is Boolean + //typeof numeric literal is Number + //typeof string literal is String + //typeof regex literal is Regex + + var nu = null / null; + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var u = undefined / undefined; + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + var b: boolean; + var b = true; + var b = false; + + var n: number; + var n = 1; + var n = 1.0; + var n = 1e4; + var n = 001; // Error in ES5 + var n = 0x1; + var n = -1; + var n = -1.0; + var n = -1e-4; + var n = -003; // Error in ES5 + var n = -0x1; + + var s: string; + var s = ''; + var s = ""; + var s = 'foo\ + bar'; + var s = "foo\ + bar"; + + var r: RegExp; + var r = /what/; + var r = /\\\\/; + \ No newline at end of file diff --git a/tests/baselines/reference/literals.js b/tests/baselines/reference/literals.js new file mode 100644 index 0000000000000..da11b6cef49ce --- /dev/null +++ b/tests/baselines/reference/literals.js @@ -0,0 +1,68 @@ +//// [literals.ts] + +//typeof null is Null +//typeof true is Boolean +//typeof false is Boolean +//typeof numeric literal is Number +//typeof string literal is String +//typeof regex literal is Regex + +var nu = null / null; +var u = undefined / undefined; + +var b: boolean; +var b = true; +var b = false; + +var n: number; +var n = 1; +var n = 1.0; +var n = 1e4; +var n = 001; // Error in ES5 +var n = 0x1; +var n = -1; +var n = -1.0; +var n = -1e-4; +var n = -003; // Error in ES5 +var n = -0x1; + +var s: string; +var s = ''; +var s = ""; +var s = 'foo\ + bar'; +var s = "foo\ + bar"; + +var r: RegExp; +var r = /what/; +var r = /\\\\/; + + +//// [literals.js] +var nu = null / null; +var u = undefined / undefined; +var b; +var b = true; +var b = false; +var n; +var n = 1; +var n = 1.0; +var n = 1e4; +var n = 001; +var n = 0x1; +var n = -1; +var n = -1.0; +var n = -1e-4; +var n = -003; +var n = -0x1; +var s; +var s = ''; +var s = ""; +var s = 'foo\ + bar'; +var s = "foo\ + bar"; +var r; +var r = /what/; +var r = /\\\\/; diff --git a/tests/baselines/reference/literals1.js b/tests/baselines/reference/literals1.js new file mode 100644 index 0000000000000..dd8edd2356df1 --- /dev/null +++ b/tests/baselines/reference/literals1.js @@ -0,0 +1,34 @@ +//// [literals1.ts] +var a = 42; +var b = 0xFA34; +var c = 0.1715; +var d = 3.14E5; +var e = 8.14e-5; + +var f = true; +var g = false; + +var h = ""; +var i = "hi"; +var j = ''; +var k = 'q\tq'; + +var m = /q/; +var n = /\d+/g; +var o = /[3-5]+/i; + +//// [literals1.js] +var a = 42; +var b = 0xFA34; +var c = 0.1715; +var d = 3.14E5; +var e = 8.14e-5; +var f = true; +var g = false; +var h = ""; +var i = "hi"; +var j = ''; +var k = 'q\tq'; +var m = /q/; +var n = /\d+/g; +var o = /[3-5]+/i; diff --git a/tests/baselines/reference/localAliasExportAssignment.js b/tests/baselines/reference/localAliasExportAssignment.js new file mode 100644 index 0000000000000..66f30c04e3687 --- /dev/null +++ b/tests/baselines/reference/localAliasExportAssignment.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/localAliasExportAssignment.ts] //// + +//// [localAliasExportAssignment_0.ts] +var server: { + (): any; +}; + +export = server; + +//// [localAliasExportAssignment_1.ts] +/// +import connect = require('localAliasExportAssignment_0'); + +connect(); + + + + +//// [localAliasExportAssignment_0.js] +var server; +module.exports = server; +//// [localAliasExportAssignment_1.js] +var connect = require('localAliasExportAssignment_0'); +connect(); diff --git a/tests/baselines/reference/localImportNameVsGlobalName.js b/tests/baselines/reference/localImportNameVsGlobalName.js new file mode 100644 index 0000000000000..f27e7d648d10c --- /dev/null +++ b/tests/baselines/reference/localImportNameVsGlobalName.js @@ -0,0 +1,36 @@ +//// [localImportNameVsGlobalName.ts] +module Keyboard { + export enum Key { UP, DOWN, LEFT, RIGHT } +} + +module App { + import Key = Keyboard.Key; + + export function foo(key: Key): void {} + + foo(Key.UP); + foo(Key.DOWN); + foo(Key.LEFT); +} + +//// [localImportNameVsGlobalName.js] +var Keyboard; +(function (Keyboard) { + (function (Key) { + Key[Key["UP"] = 0] = "UP"; + Key[Key["DOWN"] = 1] = "DOWN"; + Key[Key["LEFT"] = 2] = "LEFT"; + Key[Key["RIGHT"] = 3] = "RIGHT"; + })(Keyboard.Key || (Keyboard.Key = {})); + var Key = Keyboard.Key; +})(Keyboard || (Keyboard = {})); +var App; +(function (App) { + var Key = Keyboard.Key; + function foo(key) { + } + App.foo = foo; + foo(0 /* UP */); + foo(1 /* DOWN */); + foo(2 /* LEFT */); +})(App || (App = {})); diff --git a/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.js b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.js new file mode 100644 index 0000000000000..ed020ceed326e --- /dev/null +++ b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.js @@ -0,0 +1,18 @@ +//// [localVariablesReturnedFromCatchBlocks.ts] +function f() { + try { + } catch (e) { + var stack2 = e.stack; + return stack2; //error TS2095: Could not find symbol 'stack2'. + } +} + +//// [localVariablesReturnedFromCatchBlocks.js] +function f() { + try { + } + catch (e) { + var stack2 = e.stack; + return stack2; + } +} diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.js b/tests/baselines/reference/logicalAndOperatorWithEveryType.js new file mode 100644 index 0000000000000..a9e714e8820a2 --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.js @@ -0,0 +1,240 @@ +//// [logicalAndOperatorWithEveryType.ts] +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +enum E { a, b, c } + +var a1: any; +var a2: boolean; +var a3: number +var a4: string; +var a5: void; +var a6: E; +var a7: {}; +var a8: string[]; + +var ra1 = a1 && a1; +var ra2 = a2 && a1; +var ra3 = a3 && a1; +var ra4 = a4 && a1; +var ra5 = a5 && a1; +var ra6 = a6 && a1; +var ra7 = a7 && a1; +var ra8 = a8 && a1; +var ra9 = null && a1; +var ra10 = undefined && a1; + +var rb1 = a1 && a2; +var rb2 = a2 && a2; +var rb3 = a3 && a2; +var rb4 = a4 && a2; +var rb5 = a5 && a2; +var rb6 = a6 && a2; +var rb7 = a7 && a2; +var rb8 = a8 && a2; +var rb9 = null && a2; +var rb10 = undefined && a2; + +var rc1 = a1 && a3; +var rc2 = a2 && a3; +var rc3 = a3 && a3; +var rc4 = a4 && a3; +var rc5 = a5 && a3; +var rc6 = a6 && a3; +var rc7 = a7 && a3; +var rc8 = a8 && a3; +var rc9 = null && a3; +var rc10 = undefined && a3; + +var rd1 = a1 && a4; +var rd2 = a2 && a4; +var rd3 = a3 && a4; +var rd4 = a4 && a4; +var rd5 = a5 && a4; +var rd6 = a6 && a4; +var rd7 = a7 && a4; +var rd8 = a8 && a4; +var rd9 = null && a4; +var rd10 = undefined && a4; + +var re1 = a1 && a5; +var re2 = a2 && a5; +var re3 = a3 && a5; +var re4 = a4 && a5; +var re5 = a5 && a5; +var re6 = a6 && a5; +var re7 = a7 && a5; +var re8 = a8 && a5; +var re9 = null && a5; +var re10 = undefined && a5; + +var rf1 = a1 && a6; +var rf2 = a2 && a6; +var rf3 = a3 && a6; +var rf4 = a4 && a6; +var rf5 = a5 && a6; +var rf6 = a6 && a6; +var rf7 = a7 && a6; +var rf8 = a8 && a6; +var rf9 = null && a6; +var rf10 = undefined && a6; + +var rg1 = a1 && a7; +var rg2 = a2 && a7; +var rg3 = a3 && a7; +var rg4 = a4 && a7; +var rg5 = a5 && a7; +var rg6 = a6 && a7; +var rg7 = a7 && a7; +var rg8 = a8 && a7; +var rg9 = null && a7; +var rg10 = undefined && a7; + +var rh1 = a1 && a8; +var rh2 = a2 && a8; +var rh3 = a3 && a8; +var rh4 = a4 && a8; +var rh5 = a5 && a8; +var rh6 = a6 && a8; +var rh7 = a7 && a8; +var rh8 = a8 && a8; +var rh9 = null && a8; +var rh10 = undefined && a8; + +var ri1 = a1 && null; +var ri2 = a2 && null; +var ri3 = a3 && null; +var ri4 = a4 && null; +var ri5 = a5 && null; +var ri6 = a6 && null; +var ri7 = a7 && null; +var ri8 = a8 && null; +var ri9 = null && null; +var ri10 = undefined && null; + +var rj1 = a1 && undefined; +var rj2 = a2 && undefined; +var rj3 = a3 && undefined; +var rj4 = a4 && undefined; +var rj5 = a5 && undefined; +var rj6 = a6 && undefined; +var rj7 = a7 && undefined; +var rj8 = a8 && undefined; +var rj9 = null && undefined; +var rj10 = undefined && undefined; + +//// [logicalAndOperatorWithEveryType.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a1; +var a2; +var a3; +var a4; +var a5; +var a6; +var a7; +var a8; +var ra1 = a1 && a1; +var ra2 = a2 && a1; +var ra3 = a3 && a1; +var ra4 = a4 && a1; +var ra5 = a5 && a1; +var ra6 = a6 && a1; +var ra7 = a7 && a1; +var ra8 = a8 && a1; +var ra9 = null && a1; +var ra10 = undefined && a1; +var rb1 = a1 && a2; +var rb2 = a2 && a2; +var rb3 = a3 && a2; +var rb4 = a4 && a2; +var rb5 = a5 && a2; +var rb6 = a6 && a2; +var rb7 = a7 && a2; +var rb8 = a8 && a2; +var rb9 = null && a2; +var rb10 = undefined && a2; +var rc1 = a1 && a3; +var rc2 = a2 && a3; +var rc3 = a3 && a3; +var rc4 = a4 && a3; +var rc5 = a5 && a3; +var rc6 = a6 && a3; +var rc7 = a7 && a3; +var rc8 = a8 && a3; +var rc9 = null && a3; +var rc10 = undefined && a3; +var rd1 = a1 && a4; +var rd2 = a2 && a4; +var rd3 = a3 && a4; +var rd4 = a4 && a4; +var rd5 = a5 && a4; +var rd6 = a6 && a4; +var rd7 = a7 && a4; +var rd8 = a8 && a4; +var rd9 = null && a4; +var rd10 = undefined && a4; +var re1 = a1 && a5; +var re2 = a2 && a5; +var re3 = a3 && a5; +var re4 = a4 && a5; +var re5 = a5 && a5; +var re6 = a6 && a5; +var re7 = a7 && a5; +var re8 = a8 && a5; +var re9 = null && a5; +var re10 = undefined && a5; +var rf1 = a1 && a6; +var rf2 = a2 && a6; +var rf3 = a3 && a6; +var rf4 = a4 && a6; +var rf5 = a5 && a6; +var rf6 = a6 && a6; +var rf7 = a7 && a6; +var rf8 = a8 && a6; +var rf9 = null && a6; +var rf10 = undefined && a6; +var rg1 = a1 && a7; +var rg2 = a2 && a7; +var rg3 = a3 && a7; +var rg4 = a4 && a7; +var rg5 = a5 && a7; +var rg6 = a6 && a7; +var rg7 = a7 && a7; +var rg8 = a8 && a7; +var rg9 = null && a7; +var rg10 = undefined && a7; +var rh1 = a1 && a8; +var rh2 = a2 && a8; +var rh3 = a3 && a8; +var rh4 = a4 && a8; +var rh5 = a5 && a8; +var rh6 = a6 && a8; +var rh7 = a7 && a8; +var rh8 = a8 && a8; +var rh9 = null && a8; +var rh10 = undefined && a8; +var ri1 = a1 && null; +var ri2 = a2 && null; +var ri3 = a3 && null; +var ri4 = a4 && null; +var ri5 = a5 && null; +var ri6 = a6 && null; +var ri7 = a7 && null; +var ri8 = a8 && null; +var ri9 = null && null; +var ri10 = undefined && null; +var rj1 = a1 && undefined; +var rj2 = a2 && undefined; +var rj3 = a3 && undefined; +var rj4 = a4 && undefined; +var rj5 = a5 && undefined; +var rj6 = a6 && undefined; +var rj7 = a7 && undefined; +var rj8 = a8 && undefined; +var rj9 = null && undefined; +var rj10 = undefined && undefined; diff --git a/tests/baselines/reference/logicalAndOperatorWithTypeParameters.js b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.js new file mode 100644 index 0000000000000..006b1a093c16e --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.js @@ -0,0 +1,35 @@ +//// [logicalAndOperatorWithTypeParameters.ts] +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +function foo(t: T, u: U, v: V) { + var r1 = t && t; + var r2 = u && t; + var r3 = v && t; + + var r4 = t && u; + var r5 = u && u; + var r6 = v && u; + + var r7 = t && v; + var r8 = u && v; + var r9 = v && v; + + var a: number; + var r10 = t && a; +} + +//// [logicalAndOperatorWithTypeParameters.js] +function foo(t, u, v) { + var r1 = t && t; + var r2 = u && t; + var r3 = v && t; + var r4 = t && u; + var r5 = u && u; + var r6 = v && u; + var r7 = t && v; + var r8 = u && v; + var r9 = v && v; + var a; + var r10 = t && a; +} diff --git a/tests/baselines/reference/logicalNotExpression1.js b/tests/baselines/reference/logicalNotExpression1.js new file mode 100644 index 0000000000000..116322d3dae9d --- /dev/null +++ b/tests/baselines/reference/logicalNotExpression1.js @@ -0,0 +1,5 @@ +//// [logicalNotExpression1.ts] +!foo; + +//// [logicalNotExpression1.js] +!foo; diff --git a/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt new file mode 100644 index 0000000000000..7b8e7de7d4ed1 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorInvalidOperations.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorInvalidOperations.ts (4 errors) ==== + // Unary operator ! + var b: number; + + // operand before ! + var BOOLEAN1 = b!; //expect error + ~ +!!! ',' expected. + ~ +!!! Expression expected. + + // miss parentheses + var BOOLEAN2 = !b + b; + ~~~~~~ +!!! Operator '+' cannot be applied to types 'boolean' and 'number'. + + // miss an operand + var BOOLEAN3 =!; + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..07aa1630e9fea --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,66 @@ +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ==== + // ! operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {} + var obj1 = { x: "", y: () => { }}; + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsBoolean1 = !ANY1; + var ResultIsBoolean2 = !ANY2; + var ResultIsBoolean3 = !A; + var ResultIsBoolean4 = !M; + var ResultIsBoolean5 = !obj; + var ResultIsBoolean6 = !obj1; + + // any type literal + var ResultIsBoolean7 = !undefined; + var ResultIsBoolean8 = !null; + + // any type expressions + var ResultIsBoolean9 = !ANY2[0]; + var ResultIsBoolean10 = !obj1.x; + var ResultIsBoolean11 = !obj1.y; + var ResultIsBoolean12 = !objA.a; + var ResultIsBoolean13 = !M.n; + var ResultIsBoolean14 = !foo(); + var ResultIsBoolean15 = !A.foo(); + var ResultIsBoolean16 = !(ANY + ANY1); + var ResultIsBoolean17 = !(null + undefined); + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsBoolean18 = !(null + null); + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsBoolean19 = !(undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + // multiple ! operators + var ResultIsBoolean20 = !!ANY; + var ResultIsBoolean21 = !!!(ANY + ANY1); + + // miss assignment operators + !ANY; + !ANY1; + !ANY2[0]; + !ANY, ANY1; + !objA.a; + !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..555f6f95e6e76 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.js @@ -0,0 +1,113 @@ +//// [logicalNotOperatorWithAnyOtherType.ts] +// ! operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj: () => {} +var obj1 = { x: "", y: () => { }}; +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsBoolean1 = !ANY1; +var ResultIsBoolean2 = !ANY2; +var ResultIsBoolean3 = !A; +var ResultIsBoolean4 = !M; +var ResultIsBoolean5 = !obj; +var ResultIsBoolean6 = !obj1; + +// any type literal +var ResultIsBoolean7 = !undefined; +var ResultIsBoolean8 = !null; + +// any type expressions +var ResultIsBoolean9 = !ANY2[0]; +var ResultIsBoolean10 = !obj1.x; +var ResultIsBoolean11 = !obj1.y; +var ResultIsBoolean12 = !objA.a; +var ResultIsBoolean13 = !M.n; +var ResultIsBoolean14 = !foo(); +var ResultIsBoolean15 = !A.foo(); +var ResultIsBoolean16 = !(ANY + ANY1); +var ResultIsBoolean17 = !(null + undefined); +var ResultIsBoolean18 = !(null + null); +var ResultIsBoolean19 = !(undefined + undefined); + +// multiple ! operators +var ResultIsBoolean20 = !!ANY; +var ResultIsBoolean21 = !!!(ANY + ANY1); + +// miss assignment operators +!ANY; +!ANY1; +!ANY2[0]; +!ANY, ANY1; +!objA.a; +!M.n; + +//// [logicalNotOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = !ANY1; +var ResultIsBoolean2 = !ANY2; +var ResultIsBoolean3 = !A; +var ResultIsBoolean4 = !M; +var ResultIsBoolean5 = !obj; +var ResultIsBoolean6 = !obj1; +var ResultIsBoolean7 = !undefined; +var ResultIsBoolean8 = !null; +var ResultIsBoolean9 = !ANY2[0]; +var ResultIsBoolean10 = !obj1.x; +var ResultIsBoolean11 = !obj1.y; +var ResultIsBoolean12 = !objA.a; +var ResultIsBoolean13 = !M.n; +var ResultIsBoolean14 = !foo(); +var ResultIsBoolean15 = !A.foo(); +var ResultIsBoolean16 = !(ANY + ANY1); +var ResultIsBoolean17 = !(null + undefined); +var ResultIsBoolean18 = !(null + null); +var ResultIsBoolean19 = !(undefined + undefined); +var ResultIsBoolean20 = !!ANY; +var ResultIsBoolean21 = !!!(ANY + ANY1); +!ANY; +!ANY1; +!ANY2[0]; +!ANY, ANY1; +!objA.a; +!M.n; diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.js b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js new file mode 100644 index 0000000000000..9b7e774138f6a --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.js @@ -0,0 +1,72 @@ +//// [logicalNotOperatorWithBooleanType.ts] +// ! operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return false; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsBoolean1 = !BOOLEAN; + +// boolean type literal +var ResultIsBoolean2 = !true; +var ResultIsBoolean3 = !{ x: true, y: false }; + +// boolean type expressions +var ResultIsBoolean4 = !objA.a; +var ResultIsBoolean5 = !M.n; +var ResultIsBoolean6 = !foo(); +var ResultIsBoolean7 = !A.foo(); + +// multiple ! operators +var ResultIsBoolean = !!BOOLEAN; + +// miss assignment operators +!true; +!BOOLEAN; +!foo(); +!true, false; +!objA.a; +!M.n; + +//// [logicalNotOperatorWithBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return false; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = !BOOLEAN; +var ResultIsBoolean2 = !true; +var ResultIsBoolean3 = !{ x: true, y: false }; +var ResultIsBoolean4 = !objA.a; +var ResultIsBoolean5 = !M.n; +var ResultIsBoolean6 = !foo(); +var ResultIsBoolean7 = !A.foo(); +var ResultIsBoolean = !!BOOLEAN; +!true; +!BOOLEAN; +!foo(); +!true, false; +!objA.a; +!M.n; diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.js b/tests/baselines/reference/logicalNotOperatorWithEnumType.js new file mode 100644 index 0000000000000..2c5ddc04e586e --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.js @@ -0,0 +1,44 @@ +//// [logicalNotOperatorWithEnumType.ts] +// ! operator on enum type + +enum ENUM { 1, 2, 3 }; +enum ENUM1 { }; + +// enum type var +var ResultIsBoolean1 = !ENUM; + +// enum type expressions +var ResultIsBoolean2 = !ENUM[1]; +var ResultIsBoolean3 = !(ENUM[1] + ENUM[2]); + +// multiple ! operators +var ResultIsBoolean4 = !!ENUM; +var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); + +// miss assignment operators +!ENUM; +!ENUM1; +!ENUM[1]; +!ENUM, ENUM1; + +//// [logicalNotOperatorWithEnumType.js] +var ENUM; +(function (ENUM) { + ENUM[ENUM["1"] = 0] = "1"; + ENUM[ENUM["2"] = 1] = "2"; + ENUM[ENUM["3"] = 2] = "3"; +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsBoolean1 = !ENUM; +var ResultIsBoolean2 = !ENUM[1]; +var ResultIsBoolean3 = !(ENUM[1] + ENUM[2]); +var ResultIsBoolean4 = !!ENUM; +var ResultIsBoolean5 = !!!(ENUM[1] + ENUM[2]); +!ENUM; +!ENUM1; +!ENUM[1]; +!ENUM, ENUM1; diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.js b/tests/baselines/reference/logicalNotOperatorWithNumberType.js new file mode 100644 index 0000000000000..6ab8b76a81e04 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.js @@ -0,0 +1,88 @@ +//// [logicalNotOperatorWithNumberType.ts] +// ! operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsBoolean1 = !NUMBER; +var ResultIsBoolean2 = !NUMBER1; + +// number type literal +var ResultIsBoolean3 = !1; +var ResultIsBoolean4 = !{ x: 1, y: 2}; +var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; + +// number type expressions +var ResultIsBoolean6 = !objA.a; +var ResultIsBoolean7 = !M.n; +var ResultIsBoolean8 = !NUMBER1[0]; +var ResultIsBoolean9 = !foo(); +var ResultIsBoolean10 = !A.foo(); +var ResultIsBoolean11 = !(NUMBER + NUMBER); + +// multiple ! operator +var ResultIsBoolean12 = !!NUMBER; +var ResultIsBoolean13 = !!!(NUMBER + NUMBER); + +// miss assignment operators +!1; +!NUMBER; +!NUMBER1; +!foo(); +!objA.a; +!M.n; +!objA.a, M.n; + +//// [logicalNotOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = !NUMBER; +var ResultIsBoolean2 = !NUMBER1; +var ResultIsBoolean3 = !1; +var ResultIsBoolean4 = !{ x: 1, y: 2 }; +var ResultIsBoolean5 = !{ x: 1, y: function (n) { + return n; +} }; +var ResultIsBoolean6 = !objA.a; +var ResultIsBoolean7 = !M.n; +var ResultIsBoolean8 = !NUMBER1[0]; +var ResultIsBoolean9 = !foo(); +var ResultIsBoolean10 = !A.foo(); +var ResultIsBoolean11 = !(NUMBER + NUMBER); +var ResultIsBoolean12 = !!NUMBER; +var ResultIsBoolean13 = !!!(NUMBER + NUMBER); +!1; +!NUMBER; +!NUMBER1; +!foo(); +!objA.a; +!M.n; +!objA.a, M.n; diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.js b/tests/baselines/reference/logicalNotOperatorWithStringType.js new file mode 100644 index 0000000000000..e259741e2f47e --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.js @@ -0,0 +1,86 @@ +//// [logicalNotOperatorWithStringType.ts] +// ! operator on string type +var STRING: string; +var STRING1: string[] = ["", "abc"]; + +function foo(): string { return "abc"; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsBoolean1 = !STRING; +var ResultIsBoolean2 = !STRING1; + +// string type literal +var ResultIsBoolean3 = !""; +var ResultIsBoolean4 = !{ x: "", y: "" }; +var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; + +// string type expressions +var ResultIsBoolean6 = !objA.a; +var ResultIsBoolean7 = !M.n; +var ResultIsBoolean8 = !STRING1[0]; +var ResultIsBoolean9 = !foo(); +var ResultIsBoolean10 = !A.foo(); +var ResultIsBoolean11 = !(STRING + STRING); +var ResultIsBoolean12 = !STRING.charAt(0); + +// multiple ! operator +var ResultIsBoolean13 = !!STRING; +var ResultIsBoolean14 = !!!(STRING + STRING); + +// miss assignment operators +!""; +!STRING; +!STRING1; +!foo(); +!objA.a,M.n; + +//// [logicalNotOperatorWithStringType.js] +var STRING; +var STRING1 = ["", "abc"]; +function foo() { + return "abc"; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsBoolean1 = !STRING; +var ResultIsBoolean2 = !STRING1; +var ResultIsBoolean3 = !""; +var ResultIsBoolean4 = !{ x: "", y: "" }; +var ResultIsBoolean5 = !{ x: "", y: function (s) { + return s; +} }; +var ResultIsBoolean6 = !objA.a; +var ResultIsBoolean7 = !M.n; +var ResultIsBoolean8 = !STRING1[0]; +var ResultIsBoolean9 = !foo(); +var ResultIsBoolean10 = !A.foo(); +var ResultIsBoolean11 = !(STRING + STRING); +var ResultIsBoolean12 = !STRING.charAt(0); +var ResultIsBoolean13 = !!STRING; +var ResultIsBoolean14 = !!!(STRING + STRING); +!""; +!STRING; +!STRING1; +!foo(); +!objA.a, M.n; diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js new file mode 100644 index 0000000000000..7997ecb0f2bf2 --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.js @@ -0,0 +1,10 @@ +//// [logicalOrExpressionIsContextuallyTyped.ts] +// The || operator permits the operands to be of any type. +// If the || expression is contextually typed, the operands are contextually typed by the +// same type and the result is of the best common type of the contextual type and the two +// operand types. + +var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; + +//// [logicalOrExpressionIsContextuallyTyped.js] +var r = { a: '', b: 123 } || { a: '', b: true }; diff --git a/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js new file mode 100644 index 0000000000000..8de01245b318b --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.js @@ -0,0 +1,15 @@ +//// [logicalOrExpressionIsNotContextuallyTyped.ts] +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + + +var a: (a: string) => string; + +// bug 786110 +var r = a || ((a) => a.toLowerCase()); + +//// [logicalOrExpressionIsNotContextuallyTyped.js] +var a; +var r = a || (function (a) { return a.toLowerCase(); }); diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.js b/tests/baselines/reference/logicalOrOperatorWithEveryType.js new file mode 100644 index 0000000000000..47b88946cc0ce --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.js @@ -0,0 +1,242 @@ +//// [logicalOrOperatorWithEveryType.ts] +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + +enum E { a, b, c } + +var a1: any; +var a2: boolean; +var a3: number +var a4: string; +var a5: void; +var a6: E; +var a7: {a: string}; +var a8: string[]; + +var ra1 = a1 || a1; // any || any is any +var ra2 = a2 || a1; // boolean || any is any +var ra3 = a3 || a1; // number || any is any +var ra4 = a4 || a1; // string || any is any +var ra5 = a5 || a1; // void || any is any +var ra6 = a6 || a1; // enum || any is any +var ra7 = a7 || a1; // object || any is any +var ra8 = a8 || a1; // array || any is any +var ra9 = null || a1; // null || any is any +var ra10 = undefined || a1; // undefined || any is any + +var rb1 = a1 || a2; // any || boolean is any +var rb2 = a2 || a2; // boolean || boolean is boolean +var rb3 = a3 || a2; // number || boolean is {} +var rb4 = a4 || a2; // string || boolean is {} +var rb5 = a5 || a2; // void || boolean is {} +var rb6 = a6 || a2; // enum || boolean is {} +var rb7 = a7 || a2; // object || boolean is {} +var rb8 = a8 || a2; // array || boolean is {} +var rb9 = null || a2; // null || boolean is boolean +var rb10= undefined || a2; // undefined || boolean is boolean + +var rc1 = a1 || a3; // any || number is any +var rc2 = a2 || a3; // boolean || number is {} +var rc3 = a3 || a3; // number || number is number +var rc4 = a4 || a3; // string || number is {} +var rc5 = a5 || a3; // void || number is {} +var rc6 = a6 || a3; // enum || number is number +var rc7 = a7 || a3; // object || number is {} +var rc8 = a8 || a3; // array || number is {} +var rc9 = null || a3; // null || number is number +var rc10 = undefined || a3; // undefined || number is number + +var rd1 = a1 || a4; // any || string is any +var rd2 = a2 || a4; // boolean || string is {} +var rd3 = a3 || a4; // number || string is {} +var rd4 = a4 || a4; // string || string is string +var rd5 = a5 || a4; // void || string is {} +var rd6 = a6 || a4; // enum || string is {} +var rd7 = a7 || a4; // object || string is {} +var rd8 = a8 || a4; // array || string is {} +var rd9 = null || a4; // null || string is string +var rd10 = undefined || a4; // undefined || string is string + +var re1 = a1 || a5; // any || void is any +var re2 = a2 || a5; // boolean || void is {} +var re3 = a3 || a5; // number || void is {} +var re4 = a4 || a5; // string || void is {} +var re5 = a5 || a5; // void || void is void +var re6 = a6 || a5; // enum || void is {} +var re7 = a7 || a5; // object || void is {} +var re8 = a8 || a5; // array || void is {} +var re9 = null || a5; // null || void is void +var re10 = undefined || a5; // undefined || void is void + +var rg1 = a1 || a6; // any || enum is any +var rg2 = a2 || a6; // boolean || enum is {} +var rg3 = a3 || a6; // number || enum is number +var rg4 = a4 || a6; // string || enum is {} +var rg5 = a5 || a6; // void || enum is {} +var rg6 = a6 || a6; // enum || enum is E +var rg7 = a7 || a6; // object || enum is {} +var rg8 = a8 || a6; // array || enum is {} +var rg9 = null || a6; // null || enum is E +var rg10 = undefined || a6; // undefined || enum is E + +var rh1 = a1 || a7; // any || object is any +var rh2 = a2 || a7; // boolean || object is {} +var rh3 = a3 || a7; // number || object is {} +var rh4 = a4 || a7; // string || object is {} +var rh5 = a5 || a7; // void || object is {} +var rh6 = a6 || a7; // enum || object is {} +var rh7 = a7 || a7; // object || object is object +var rh8 = a8 || a7; // array || object is {} +var rh9 = null || a7; // null || object is object +var rh10 = undefined || a7; // undefined || object is object + +var ri1 = a1 || a8; // any || array is any +var ri2 = a2 || a8; // boolean || array is {} +var ri3 = a3 || a8; // number || array is {} +var ri4 = a4 || a8; // string || array is {} +var ri5 = a5 || a8; // void || array is {} +var ri6 = a6 || a8; // enum || array is {} +var ri7 = a7 || a8; // object || array is {} +var ri8 = a8 || a8; // array || array is array +var ri9 = null || a8; // null || array is array +var ri10 = undefined || a8; // undefined || array is array + +var rj1 = a1 || null; // any || null is any +var rj2 = a2 || null; // boolean || null is boolean +var rj3 = a3 || null; // number || null is number +var rj4 = a4 || null; // string || null is string +var rj5 = a5 || null; // void || null is void +var rj6 = a6 || null; // enum || null is E +var rj7 = a7 || null; // object || null is object +var rj8 = a8 || null; // array || null is array +var rj9 = null || null; // null || null is any +var rj10 = undefined || null; // undefined || null is any + +var rf1 = a1 || undefined; // any || undefined is any +var rf2 = a2 || undefined; // boolean || undefined is boolean +var rf3 = a3 || undefined; // number || undefined is number +var rf4 = a4 || undefined; // string || undefined is string +var rf5 = a5 || undefined; // void || undefined is void +var rf6 = a6 || undefined; // enum || undefined is E +var rf7 = a7 || undefined; // object || undefined is object +var rf8 = a8 || undefined; // array || undefined is array +var rf9 = null || undefined; // null || undefined is any +var rf10 = undefined || undefined; // undefined || undefined is any + +//// [logicalOrOperatorWithEveryType.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; + E[E["c"] = 2] = "c"; +})(E || (E = {})); +var a1; +var a2; +var a3; +var a4; +var a5; +var a6; +var a7; +var a8; +var ra1 = a1 || a1; +var ra2 = a2 || a1; +var ra3 = a3 || a1; +var ra4 = a4 || a1; +var ra5 = a5 || a1; +var ra6 = a6 || a1; +var ra7 = a7 || a1; +var ra8 = a8 || a1; +var ra9 = null || a1; +var ra10 = undefined || a1; +var rb1 = a1 || a2; +var rb2 = a2 || a2; +var rb3 = a3 || a2; +var rb4 = a4 || a2; +var rb5 = a5 || a2; +var rb6 = a6 || a2; +var rb7 = a7 || a2; +var rb8 = a8 || a2; +var rb9 = null || a2; +var rb10 = undefined || a2; +var rc1 = a1 || a3; +var rc2 = a2 || a3; +var rc3 = a3 || a3; +var rc4 = a4 || a3; +var rc5 = a5 || a3; +var rc6 = a6 || a3; +var rc7 = a7 || a3; +var rc8 = a8 || a3; +var rc9 = null || a3; +var rc10 = undefined || a3; +var rd1 = a1 || a4; +var rd2 = a2 || a4; +var rd3 = a3 || a4; +var rd4 = a4 || a4; +var rd5 = a5 || a4; +var rd6 = a6 || a4; +var rd7 = a7 || a4; +var rd8 = a8 || a4; +var rd9 = null || a4; +var rd10 = undefined || a4; +var re1 = a1 || a5; +var re2 = a2 || a5; +var re3 = a3 || a5; +var re4 = a4 || a5; +var re5 = a5 || a5; +var re6 = a6 || a5; +var re7 = a7 || a5; +var re8 = a8 || a5; +var re9 = null || a5; +var re10 = undefined || a5; +var rg1 = a1 || a6; +var rg2 = a2 || a6; +var rg3 = a3 || a6; +var rg4 = a4 || a6; +var rg5 = a5 || a6; +var rg6 = a6 || a6; +var rg7 = a7 || a6; +var rg8 = a8 || a6; +var rg9 = null || a6; +var rg10 = undefined || a6; +var rh1 = a1 || a7; +var rh2 = a2 || a7; +var rh3 = a3 || a7; +var rh4 = a4 || a7; +var rh5 = a5 || a7; +var rh6 = a6 || a7; +var rh7 = a7 || a7; +var rh8 = a8 || a7; +var rh9 = null || a7; +var rh10 = undefined || a7; +var ri1 = a1 || a8; +var ri2 = a2 || a8; +var ri3 = a3 || a8; +var ri4 = a4 || a8; +var ri5 = a5 || a8; +var ri6 = a6 || a8; +var ri7 = a7 || a8; +var ri8 = a8 || a8; +var ri9 = null || a8; +var ri10 = undefined || a8; +var rj1 = a1 || null; +var rj2 = a2 || null; +var rj3 = a3 || null; +var rj4 = a4 || null; +var rj5 = a5 || null; +var rj6 = a6 || null; +var rj7 = a7 || null; +var rj8 = a8 || null; +var rj9 = null || null; +var rj10 = undefined || null; +var rf1 = a1 || undefined; +var rf2 = a2 || undefined; +var rf3 = a3 || undefined; +var rf4 = a4 || undefined; +var rf5 = a5 || undefined; +var rf6 = a6 || undefined; +var rf7 = a7 || undefined; +var rf8 = a8 || undefined; +var rf9 = null || undefined; +var rf10 = undefined || undefined; diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js new file mode 100644 index 0000000000000..0a246ea49b4da --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.js @@ -0,0 +1,45 @@ +//// [logicalOrOperatorWithTypeParameters.ts] +function fn1(t: T, u: U) { + var r1 = t || t; + var r2: T = t || t; + var r3 = t || u; + var r4: {} = t || u; +} + +function fn2(t: T, u: U, v: V) { + var r1 = t || u; + //var r2: T = t || u; + var r3 = u || u; + var r4: U = u || u; + var r5 = u || v; + var r6: {} = u || v; + //var r7: T = u || v; +} + +function fn3(t: T, u: U) { + var r1 = t || u; + var r2: {} = t || u; + var r3 = t || { a: '' }; + var r4: { a: string } = t || u; +} + +//// [logicalOrOperatorWithTypeParameters.js] +function fn1(t, u) { + var r1 = t || t; + var r2 = t || t; + var r3 = t || u; + var r4 = t || u; +} +function fn2(t, u, v) { + var r1 = t || u; + var r3 = u || u; + var r4 = u || u; + var r5 = u || v; + var r6 = u || v; +} +function fn3(t, u) { + var r1 = t || u; + var r2 = t || u; + var r3 = t || { a: '' }; + var r4 = t || u; +} diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js new file mode 100644 index 0000000000000..bd5a0f24c61e3 --- /dev/null +++ b/tests/baselines/reference/m7Bugs.js @@ -0,0 +1,52 @@ +//// [m7Bugs.ts] +// scenario 1 +interface ISomething { + something: number; +} + +var s: ISomething = ({ }); + + +// scenario 2 +interface A { x: string; } + +interface B extends A { } + +var x: B = { }; + +class C1 { + public x: string; +} + +class C2 extends C1 {} + +var y1: C1 = new C2(); +var y2: C1 = new C2(); +var y3: C1 = {}; + + + +//// [m7Bugs.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var s = ({}); +var x = {}; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C1); +var y1 = new C2(); +var y2 = new C2(); +var y3 = {}; diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt new file mode 100644 index 0000000000000..0daf93e939178 --- /dev/null +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== + // Represents a monster who enjoys ice cream + class IceCreamMonster { + private iceCreamFlavor: string; + private iceCreamRemaining: number; + private wantsSprinkles: boolean; + private soundsWhenEating: string; + public name: string; + constructor(iceCreamFlavor: string, wantsSprinkles: boolean, soundsWhenEating: string, name: string) { + this.iceCreamFlavor = iceCreamFlavor; + this.iceCreamRemaining = 100; + this.wantsSprinkles = wantsSprinkles; + this.soundsWhenEating = soundsWhenEating; + this.name = name; + } + /** + * Tells the IceCreamMonster to eat their ice cre am! + * + * @param {number} amount The amount of ice cream to e at. + * @return {boolean} True if ice cream remains, false if there is no more ice cream le ft. + */ + public eatIceCream(amount: number): boolean { + this.iceCreamRemaining -= amount; + if (this.iceCreamRemaining <= 0) + { + this.iceCreamRemaining = 0; + return false; + } + else + { + return 12345; + ~~~~~ +!!! Type 'number' is not assignable to type 'boolean'. + } + } + } + var cookieMonster: IceCreamMonster; + cookieMonster = new IceCreamMonster("Chocolate Chip", false, "COOOOOKIE", "Cookie Monster"); \ No newline at end of file diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.js b/tests/baselines/reference/matchReturnTypeInAllBranches.js new file mode 100644 index 0000000000000..dfcd55b847f91 --- /dev/null +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.js @@ -0,0 +1,60 @@ +//// [matchReturnTypeInAllBranches.ts] +// Represents a monster who enjoys ice cream +class IceCreamMonster { + private iceCreamFlavor: string; + private iceCreamRemaining: number; + private wantsSprinkles: boolean; + private soundsWhenEating: string; + public name: string; + constructor(iceCreamFlavor: string, wantsSprinkles: boolean, soundsWhenEating: string, name: string) { + this.iceCreamFlavor = iceCreamFlavor; + this.iceCreamRemaining = 100; + this.wantsSprinkles = wantsSprinkles; + this.soundsWhenEating = soundsWhenEating; + this.name = name; + } + /** +* Tells the IceCreamMonster to eat their ice cre am! +* +* @param {number} amount The amount of ice cream to e at. +* @return {boolean} True if ice cream remains, false if there is no more ice cream le ft. +*/ + public eatIceCream(amount: number): boolean { + this.iceCreamRemaining -= amount; + if (this.iceCreamRemaining <= 0) + { + this.iceCreamRemaining = 0; + return false; + } + else + { + return 12345; + } + } +} +var cookieMonster: IceCreamMonster; +cookieMonster = new IceCreamMonster("Chocolate Chip", false, "COOOOOKIE", "Cookie Monster"); + +//// [matchReturnTypeInAllBranches.js] +var IceCreamMonster = (function () { + function IceCreamMonster(iceCreamFlavor, wantsSprinkles, soundsWhenEating, name) { + this.iceCreamFlavor = iceCreamFlavor; + this.iceCreamRemaining = 100; + this.wantsSprinkles = wantsSprinkles; + this.soundsWhenEating = soundsWhenEating; + this.name = name; + } + IceCreamMonster.prototype.eatIceCream = function (amount) { + this.iceCreamRemaining -= amount; + if (this.iceCreamRemaining <= 0) { + this.iceCreamRemaining = 0; + return false; + } + else { + return 12345; + } + }; + return IceCreamMonster; +})(); +var cookieMonster; +cookieMonster = new IceCreamMonster("Chocolate Chip", false, "COOOOOKIE", "Cookie Monster"); diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt b/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt new file mode 100644 index 0000000000000..6c9c0f65d1986 --- /dev/null +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/matchingOfObjectLiteralConstraints.ts (1 errors) ==== + function foo2(x: U, z: T) { } + ~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo2({ y: "foo" }, "foo"); + + \ No newline at end of file diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.js b/tests/baselines/reference/matchingOfObjectLiteralConstraints.js new file mode 100644 index 0000000000000..cf70a4be51ba7 --- /dev/null +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.js @@ -0,0 +1,10 @@ +//// [matchingOfObjectLiteralConstraints.ts] +function foo2(x: U, z: T) { } +foo2({ y: "foo" }, "foo"); + + + +//// [matchingOfObjectLiteralConstraints.js] +function foo2(x, z) { +} +foo2({ y: "foo" }, "foo"); diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt new file mode 100644 index 0000000000000..027454e4be6d3 --- /dev/null +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/maxConstraints.ts (2 errors) ==== + interface Comparable { + compareTo(other: T): number; + } + interface Comparer { + >(x: T, y: T): T; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; + var maxResult = max2(1, 2); + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/maxConstraints.js b/tests/baselines/reference/maxConstraints.js new file mode 100644 index 0000000000000..4ea37d3050186 --- /dev/null +++ b/tests/baselines/reference/maxConstraints.js @@ -0,0 +1,15 @@ +//// [maxConstraints.ts] +interface Comparable { + compareTo(other: T): number; +} +interface Comparer { + >(x: T, y: T): T; +} +var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; +var maxResult = max2(1, 2); + +//// [maxConstraints.js] +var max2 = function (x, y) { + return (x.compareTo(y) > 0) ? x : y; +}; +var maxResult = max2(1, 2); diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.js b/tests/baselines/reference/memberAccessMustUseModuleInstances.js new file mode 100644 index 0000000000000..b6c26e908f725 --- /dev/null +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/memberAccessMustUseModuleInstances.ts] //// + +//// [memberAccessMustUseModuleInstances_0.ts] +export class Promise { + static timeout(delay: number): Promise { + return null; + } +} + +//// [memberAccessMustUseModuleInstances_1.ts] +/// +import WinJS = require('memberAccessMustUseModuleInstances_0'); + +WinJS.Promise.timeout(10); + + +//// [memberAccessMustUseModuleInstances_0.js] +define(["require", "exports"], function (require, exports) { + var Promise = (function () { + function Promise() { + } + Promise.timeout = function (delay) { + return null; + }; + return Promise; + })(); + exports.Promise = Promise; +}); +//// [memberAccessMustUseModuleInstances_1.js] +define(["require", "exports", 'memberAccessMustUseModuleInstances_0'], function (require, exports, WinJS) { + WinJS.Promise.timeout(10); +}); diff --git a/tests/baselines/reference/memberAccessOnConstructorType.js b/tests/baselines/reference/memberAccessOnConstructorType.js new file mode 100644 index 0000000000000..59684a091b86f --- /dev/null +++ b/tests/baselines/reference/memberAccessOnConstructorType.js @@ -0,0 +1,7 @@ +//// [memberAccessOnConstructorType.ts] +var f: new () => void; +f.arguments == 0; + +//// [memberAccessOnConstructorType.js] +var f; +f.arguments == 0; diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt new file mode 100644 index 0000000000000..08e1eb4e35d81 --- /dev/null +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts (8 errors) ==== + class C { + foo(); + ~~~~~~ +!!! Function implementation expected. + static foo(); // error + ~~~~~~~~~~~~~ +!!! Function implementation expected. + } + + class D { + static foo(); + ~~~~~~~~~~~~~ +!!! Function implementation expected. + foo(); // error + ~~~~~~ +!!! Function implementation expected. + } + + class E { + foo(x: T); + ~~~~~~~~~~ +!!! Function implementation expected. + static foo(x: number); // error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + } + + class F { + static foo(x: number); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + foo(x: T); // error + ~~~~~~~~~~ +!!! Function implementation expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js new file mode 100644 index 0000000000000..80c7043552c00 --- /dev/null +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.js @@ -0,0 +1,42 @@ +//// [memberFunctionOverloadMixingStaticAndInstance.ts] +class C { + foo(); + static foo(); // error +} + +class D { + static foo(); + foo(); // error +} + +class E { + foo(x: T); + static foo(x: number); // error +} + +class F { + static foo(x: number); + foo(x: T); // error +} + +//// [memberFunctionOverloadMixingStaticAndInstance.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var E = (function () { + function E() { + } + return E; +})(); +var F = (function () { + function F() { + } + return F; +})(); diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt new file mode 100644 index 0000000000000..0a84fc1a7512b --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.errors.txt @@ -0,0 +1,58 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPrivateOverloads.ts (4 errors) ==== + class C { + private foo(x: number); + private foo(x: number, y: string); + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + private bar(x: string); + private bar(x: number, y: string); + private bar(x: any, y?: any) { } + + private static foo(x: number); + private static foo(x: number, y: string); + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + private static bar(x: string); + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } + } + + class D { + private foo(x: number); + private foo(x: T, y: T); + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + private bar(x: string); + private bar(x: T, y: T); + private bar(x: any, y?: any) { } + + private static foo(x: number); + private static foo(x: number, y: number); + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + private static bar(x: string); + private static bar(x: number, y: number); + private static bar(x: any, y?: any) { } + + } + + var c: C; + var r = c.foo(1); // error + ~~~~~ +!!! Property 'C.foo' is inaccessible. + + var d: D; + var r2 = d.foo(2); // error + ~~~~~ +!!! Property 'D.foo' is inaccessible. + + var r3 = C.foo(1); // error + ~~~~~ +!!! Property 'C.foo' is inaccessible. + var r4 = D.bar(''); // error + ~~~~~ +!!! Property 'D.bar' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js new file mode 100644 index 0000000000000..cfd5d46a4a179 --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js @@ -0,0 +1,84 @@ +//// [memberFunctionsWithPrivateOverloads.ts] +class C { + private foo(x: number); + private foo(x: number, y: string); + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + private bar(x: string); + private bar(x: number, y: string); + private bar(x: any, y?: any) { } + + private static foo(x: number); + private static foo(x: number, y: string); + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + private static bar(x: string); + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } +} + +class D { + private foo(x: number); + private foo(x: T, y: T); + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + private bar(x: string); + private bar(x: T, y: T); + private bar(x: any, y?: any) { } + + private static foo(x: number); + private static foo(x: number, y: number); + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + private static bar(x: string); + private static bar(x: number, y: number); + private static bar(x: any, y?: any) { } + +} + +var c: C; +var r = c.foo(1); // error + +var d: D; +var r2 = d.foo(2); // error + +var r3 = C.foo(1); // error +var r4 = D.bar(''); // error + +//// [memberFunctionsWithPrivateOverloads.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + C.prototype.bar = function (x, y) { + }; + C.foo = function (x, y) { + }; + C.bar = function (x, y) { + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (x, y) { + }; + D.prototype.bar = function (x, y) { + }; + D.foo = function (x, y) { + }; + D.bar = function (x, y) { + }; + return D; +})(); +var c; +var r = c.foo(1); +var d; +var r2 = d.foo(2); +var r3 = C.foo(1); +var r4 = D.bar(''); diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js new file mode 100644 index 0000000000000..5eaf894f549ae --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.js @@ -0,0 +1,69 @@ +//// [memberFunctionsWithPublicOverloads.ts] +class C { + public foo(x: number); + public foo(x: number, y: string); + public foo(x: any, y?: any) { } + + public bar(x: 'hi'); + public bar(x: string); + public bar(x: number, y: string); + public bar(x: any, y?: any) { } + + public static foo(x: number); + public static foo(x: number, y: string); + public static foo(x: any, y?: any) { } + + public static bar(x: 'hi'); + public static bar(x: string); + public static bar(x: number, y: string); + public static bar(x: any, y?: any) { } +} + +class D { + public foo(x: number); + public foo(x: T, y: T); + public foo(x: any, y?: any) { } + + public bar(x: 'hi'); + public bar(x: string); + public bar(x: T, y: T); + public bar(x: any, y?: any) { } + + public static foo(x: number); + public static foo(x: number, y: string); + public static foo(x: any, y?: any) { } + + public static bar(x: 'hi'); + public static bar(x: string); + public static bar(x: number, y: string); + public static bar(x: any, y?: any) { } + +} + +//// [memberFunctionsWithPublicOverloads.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + C.prototype.bar = function (x, y) { + }; + C.foo = function (x, y) { + }; + C.bar = function (x, y) { + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (x, y) { + }; + D.prototype.bar = function (x, y) { + }; + D.foo = function (x, y) { + }; + D.bar = function (x, y) { + }; + return D; +})(); diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt new file mode 100644 index 0000000000000..962a00d95347b --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.errors.txt @@ -0,0 +1,66 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicPrivateOverloads.ts (10 errors) ==== + class C { + private foo(x: number); + public foo(x: number, y: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + public bar(x: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private bar(x: number, y: string); + private bar(x: any, y?: any) { } + + private static foo(x: number); + public static foo(x: number, y: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + public static bar(x: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } + } + + class D { + private foo(x: number); + public foo(x: T, y: T); // error + ~~~ +!!! Overload signatures must all be public or private. + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + public bar(x: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private bar(x: T, y: T); + private bar(x: any, y?: any) { } + + private static foo(x: number); + public static foo(x: number, y: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + public static bar(x: string); // error + ~~~ +!!! Overload signatures must all be public or private. + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } + } + + var c: C; + var r = c.foo(1); // error + ~~~~~ +!!! Property 'C.foo' is inaccessible. + + var d: D; + var r2 = d.foo(2); // error + ~~~~~ +!!! Property 'D.foo' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js new file mode 100644 index 0000000000000..2f4ff52b541d0 --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js @@ -0,0 +1,78 @@ +//// [memberFunctionsWithPublicPrivateOverloads.ts] +class C { + private foo(x: number); + public foo(x: number, y: string); // error + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + public bar(x: string); // error + private bar(x: number, y: string); + private bar(x: any, y?: any) { } + + private static foo(x: number); + public static foo(x: number, y: string); // error + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + public static bar(x: string); // error + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } +} + +class D { + private foo(x: number); + public foo(x: T, y: T); // error + private foo(x: any, y?: any) { } + + private bar(x: 'hi'); + public bar(x: string); // error + private bar(x: T, y: T); + private bar(x: any, y?: any) { } + + private static foo(x: number); + public static foo(x: number, y: string); // error + private static foo(x: any, y?: any) { } + + private static bar(x: 'hi'); + public static bar(x: string); // error + private static bar(x: number, y: string); + private static bar(x: any, y?: any) { } +} + +var c: C; +var r = c.foo(1); // error + +var d: D; +var r2 = d.foo(2); // error + +//// [memberFunctionsWithPublicPrivateOverloads.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + }; + C.prototype.bar = function (x, y) { + }; + C.foo = function (x, y) { + }; + C.bar = function (x, y) { + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (x, y) { + }; + D.prototype.bar = function (x, y) { + }; + D.foo = function (x, y) { + }; + D.bar = function (x, y) { + }; + return D; +})(); +var c; +var r = c.foo(1); +var d; +var r2 = d.foo(2); diff --git a/tests/baselines/reference/memberOverride.errors.txt b/tests/baselines/reference/memberOverride.errors.txt new file mode 100644 index 0000000000000..5a537b69a859b --- /dev/null +++ b/tests/baselines/reference/memberOverride.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/memberOverride.ts (2 errors) ==== + // An object initialiser accepts the first definition for the same property with a different type signature + // Should compile, since the second declaration of a overrides the first + var x = { + a: "", + a: 5 + ~ +!!! Duplicate identifier 'a'. + } + + var n: number = x.a; + ~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/memberOverride.js b/tests/baselines/reference/memberOverride.js new file mode 100644 index 0000000000000..aadeff78e8a90 --- /dev/null +++ b/tests/baselines/reference/memberOverride.js @@ -0,0 +1,16 @@ +//// [memberOverride.ts] +// An object initialiser accepts the first definition for the same property with a different type signature +// Should compile, since the second declaration of a overrides the first +var x = { + a: "", + a: 5 +} + +var n: number = x.a; + +//// [memberOverride.js] +var x = { + a: "", + a: 5 +}; +var n = x.a; diff --git a/tests/baselines/reference/memberScope.errors.txt b/tests/baselines/reference/memberScope.errors.txt new file mode 100644 index 0000000000000..8c059a077fbc1 --- /dev/null +++ b/tests/baselines/reference/memberScope.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/memberScope.ts (1 errors) ==== + module Salt { + export class Pepper {} + export module Basil { } + var z = Basil.Pepper; + ~~~~~ +!!! Cannot find name 'Basil'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/memberScope.js b/tests/baselines/reference/memberScope.js new file mode 100644 index 0000000000000..05123460f9760 --- /dev/null +++ b/tests/baselines/reference/memberScope.js @@ -0,0 +1,20 @@ +//// [memberScope.ts] +module Salt { + export class Pepper {} + export module Basil { } + var z = Basil.Pepper; +} + + + +//// [memberScope.js] +var Salt; +(function (Salt) { + var Pepper = (function () { + function Pepper() { + } + return Pepper; + })(); + Salt.Pepper = Pepper; + var z = Basil.Pepper; +})(Salt || (Salt = {})); diff --git a/tests/baselines/reference/memberVariableDeclarations1.js b/tests/baselines/reference/memberVariableDeclarations1.js new file mode 100644 index 0000000000000..f11ef9ca5558b --- /dev/null +++ b/tests/baselines/reference/memberVariableDeclarations1.js @@ -0,0 +1,50 @@ +//// [memberVariableDeclarations1.ts] +// from spec + +class Employee { + public name: string; + public address: string; + public retired = false; + public manager: Employee = null; + public reports: Employee[] = []; +} + +class Employee2 { + public name: string; + public address: string; + public retired: boolean; + public manager: Employee; + public reports: Employee[]; + constructor() { + this.retired = false; + this.manager = null; + this.reports = []; + } +} + +var e1: Employee; +var e2: Employee2; +e1 = e2; +e2 = e1; + +//// [memberVariableDeclarations1.js] +var Employee = (function () { + function Employee() { + this.retired = false; + this.manager = null; + this.reports = []; + } + return Employee; +})(); +var Employee2 = (function () { + function Employee2() { + this.retired = false; + this.manager = null; + this.reports = []; + } + return Employee2; +})(); +var e1; +var e2; +e1 = e2; +e2 = e1; diff --git a/tests/baselines/reference/mergeThreeInterfaces.js b/tests/baselines/reference/mergeThreeInterfaces.js new file mode 100644 index 0000000000000..e31395b583754 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces.js @@ -0,0 +1,100 @@ +//// [mergeThreeInterfaces.ts] +// interfaces with the same root module should merge + +// basic case +interface A { + foo: string; +} + +interface A { + bar: number; +} + +interface A { + baz: boolean; +} + +var a: A; +var r1 = a.foo +var r2 = a.bar; +var r3 = a.baz; + +// basic generic case +interface B { + foo: T; +} + +interface B { + bar: T; +} + +interface B { + baz: T; +} + +var b: B; +var r4 = b.foo +var r5 = b.bar; +var r6 = b.baz; + +// basic non-generic and generic case inside a module +module M { + interface A { + foo: string; + } + + interface A { + bar: number; + } + + interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo; + // BUG 856491 + var r2 = a.bar; // any, should be number + // BUG 856491 + var r3 = a.baz; // any, should be boolean + + interface B { + foo: T; + } + + interface B { + bar: T; + } + + interface B { + baz: T; + } + + var b: B; + var r4 = b.foo + // BUG 856491 + var r5 = b.bar; // any, should be number + // BUG 856491 + var r6 = b.baz; // any, should be boolean +} + +//// [mergeThreeInterfaces.js] +var a; +var r1 = a.foo; +var r2 = a.bar; +var r3 = a.baz; +var b; +var r4 = b.foo; +var r5 = b.bar; +var r6 = b.baz; +var M; +(function (M) { + var a; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; + var b; + var r4 = b.foo; + var r5 = b.bar; + var r6 = b.baz; +})(M || (M = {})); diff --git a/tests/baselines/reference/mergeThreeInterfaces2.js b/tests/baselines/reference/mergeThreeInterfaces2.js new file mode 100644 index 0000000000000..7ab7f0fd473e9 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces2.js @@ -0,0 +1,112 @@ +//// [mergeThreeInterfaces2.ts] +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; +} + +module M2 { + export interface A { + bar: number; + } + + export interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; +} + +// same as above but with an additional level of nesting and third module declaration +module M2 { + export module M3 { + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; + } +} + +module M2 { + export module M3 { + export interface A { + bar: number; + } + + var a: A; + + var r1 = a.foo + var r2 = a.bar; + var r3 = a.baz; + } +} + +module M2 { + export module M3 { + export interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + var r3 = a.baz; + } +} + +//// [mergeThreeInterfaces2.js] +var M2; +(function (M2) { + var a; + var r1 = a.foo; + var r2 = a.bar; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + var a; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (M3) { + var a; + var r1 = a.foo; + var r2 = a.bar; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (M3) { + var a; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (M3) { + var a; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/mergeTwoInterfaces.js b/tests/baselines/reference/mergeTwoInterfaces.js new file mode 100644 index 0000000000000..eb5bc7b621d99 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces.js @@ -0,0 +1,75 @@ +//// [mergeTwoInterfaces.ts] +// two interfaces with the same root module should merge + +// basic case +interface A { + foo: string; +} + +interface A { + bar: number; +} + +var a: A; +var r1 = a.foo +var r2 = a.bar; + +// basic generic case +interface B { + baz: string; + foo: T; +} + +interface B { + bar: T; +} + +var b: B; +var r3 = b.foo +var r4 = b.bar; + +// basic non-generic and generic case inside a module +module M { + interface A { + foo: string; + } + + interface A { + bar: number; + } + + var a: A; + var r1 = a.foo; + // BUG 856491 + var r2 = a.bar; // any, should be number + + interface B { + foo: T; + } + + interface B { + bar: T; + } + + var b: B; + var r3 = b.foo + // BUG 856491 + var r4 = b.bar; // any, should be string +} + +//// [mergeTwoInterfaces.js] +var a; +var r1 = a.foo; +var r2 = a.bar; +var b; +var r3 = b.foo; +var r4 = b.bar; +var M; +(function (M) { + var a; + var r1 = a.foo; + var r2 = a.bar; + var b; + var r3 = b.foo; + var r4 = b.bar; +})(M || (M = {})); diff --git a/tests/baselines/reference/mergeTwoInterfaces2.js b/tests/baselines/reference/mergeTwoInterfaces2.js new file mode 100644 index 0000000000000..73423602569c1 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces2.js @@ -0,0 +1,80 @@ +//// [mergeTwoInterfaces2.ts] +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; +} + +module M2 { + export interface A { + bar: number; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; +} + +// same as above but with an additional level of nesting +module M2 { + export module M3 { + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } +} + +module M2 { + export module M3 { + export interface A { + bar: number; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } +} + +//// [mergeTwoInterfaces2.js] +var M2; +(function (M2) { + var a; + var r1 = a.foo; + var r2 = a.bar; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + var a; + var r1 = a.foo; + var r2 = a.bar; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (M3) { + var a; + var r1 = a.foo; + var r2 = a.bar; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; +})(M2 || (M2 = {})); +var M2; +(function (M2) { + (function (M3) { + var a; + var r1 = a.foo; + var r2 = a.bar; + })(M2.M3 || (M2.M3 = {})); + var M3 = M2.M3; +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/mergedDeclarations1.js b/tests/baselines/reference/mergedDeclarations1.js new file mode 100644 index 0000000000000..641ff031ded0a --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations1.js @@ -0,0 +1,33 @@ +//// [mergedDeclarations1.ts] +interface Point { + x: number; + y: number; +} +function point(x: number, y: number): Point { + return { x: x, y: y }; +} +module point { + export var origin = point(0, 0); + export function equals(p1: Point, p2: Point) { + return p1.x == p2.x && p1.y == p2.y; + } +} +var p1 = point(0, 0); +var p2 = point.origin; +var b = point.equals(p1, p2); + +//// [mergedDeclarations1.js] +function point(x, y) { + return { x: x, y: y }; +} +var point; +(function (point) { + point.origin = point(0, 0); + function equals(p1, p2) { + return p1.x == p2.x && p1.y == p2.y; + } + point.equals = equals; +})(point || (point = {})); +var p1 = point(0, 0); +var p2 = point.origin; +var b = point.equals(p1, p2); diff --git a/tests/baselines/reference/mergedDeclarations2.errors.txt b/tests/baselines/reference/mergedDeclarations2.errors.txt new file mode 100644 index 0000000000000..a7aad4319ea42 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations2.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/mergedDeclarations2.ts (1 errors) ==== + enum Foo { + b + } + enum Foo { + a = b + } + + module Foo { + export var x = b + ~ +!!! Cannot find name 'b'. + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedDeclarations2.js b/tests/baselines/reference/mergedDeclarations2.js new file mode 100644 index 0000000000000..1e9254bb0bb75 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations2.js @@ -0,0 +1,25 @@ +//// [mergedDeclarations2.ts] +enum Foo { + b +} +enum Foo { + a = b +} + +module Foo { + export var x = b +} + +//// [mergedDeclarations2.js] +var Foo; +(function (Foo) { + Foo[Foo["b"] = 0] = "b"; +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + Foo[Foo["a"] = Foo.b] = "a"; +})(Foo || (Foo = {})); +var Foo; +(function (Foo) { + Foo.x = b; +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/mergedDeclarations3.errors.txt b/tests/baselines/reference/mergedDeclarations3.errors.txt new file mode 100644 index 0000000000000..38922ad62f718 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations3.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/compiler/mergedDeclarations3.ts (2 errors) ==== + module M { + export enum Color { + Red, Green + } + } + module M { + export module Color { + export var Blue = 4; + } + } + var p = M.Color.Blue; // ok + + module M { + export function foo() { + } + } + + module M { + module foo { + export var x = 1; + } + } + + module M { + export module foo { + export var y = 2 + } + } + + module M { + module foo { + export var z = 1; + } + } + + M.foo() // ok + M.foo.x // error + ~ +!!! Property 'x' does not exist on type 'typeof foo'. + M.foo.y // ok + M.foo.z // error + ~ +!!! Property 'z' does not exist on type 'typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedDeclarations3.js b/tests/baselines/reference/mergedDeclarations3.js new file mode 100644 index 0000000000000..2c606288a98de --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations3.js @@ -0,0 +1,89 @@ +//// [mergedDeclarations3.ts] +module M { + export enum Color { + Red, Green + } +} +module M { + export module Color { + export var Blue = 4; + } +} +var p = M.Color.Blue; // ok + +module M { + export function foo() { + } +} + +module M { + module foo { + export var x = 1; + } +} + +module M { + export module foo { + export var y = 2 + } +} + +module M { + module foo { + export var z = 1; + } +} + +M.foo() // ok +M.foo.x // error +M.foo.y // ok +M.foo.z // error + +//// [mergedDeclarations3.js] +var M; +(function (M) { + (function (Color) { + Color[Color["Red"] = 0] = "Red"; + Color[Color["Green"] = 1] = "Green"; + })(M.Color || (M.Color = {})); + var Color = M.Color; +})(M || (M = {})); +var M; +(function (M) { + (function (Color) { + Color.Blue = 4; + })(M.Color || (M.Color = {})); + var Color = M.Color; +})(M || (M = {})); +var p = M.Color.Blue; +var M; +(function (M) { + function foo() { + } + M.foo = foo; +})(M || (M = {})); +var M; +(function (M) { + var foo; + (function (foo) { + foo.x = 1; + })(foo || (foo = {})); +})(M || (M = {})); +var M; +(function (M) { + (function (foo) { + foo.y = 2; + })(M.foo || (M.foo = {})); + var foo = M.foo; +})(M || (M = {})); +var M; +(function (M) { + var foo; + (function (foo) { + foo.z = 1; + })(foo || (foo = {})); +})(M || (M = {})); +M.foo(); +M.foo.x; +M.foo.y; +M.foo.z; diff --git a/tests/baselines/reference/mergedDeclarations4.js b/tests/baselines/reference/mergedDeclarations4.js new file mode 100644 index 0000000000000..727549450c26e --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations4.js @@ -0,0 +1,42 @@ +//// [mergedDeclarations4.ts] +module M { + export function f() { } + f(); + M.f(); + var r = f.hello; +} + +module M { + export module f { + export var hello = 1; + } + f(); + M.f(); + var r = f.hello; +} + +M.f(); +M.f.hello; + +//// [mergedDeclarations4.js] +var M; +(function (M) { + function f() { + } + M.f = f; + f(); + M.f(); + var r = f.hello; +})(M || (M = {})); +var M; +(function (M) { + (function (f) { + f.hello = 1; + })(M.f || (M.f = {})); + var f = M.f; + f(); + M.f(); + var r = f.hello; +})(M || (M = {})); +M.f(); +M.f.hello; diff --git a/tests/baselines/reference/mergedEnumDeclarationCodeGen.js b/tests/baselines/reference/mergedEnumDeclarationCodeGen.js new file mode 100644 index 0000000000000..574ef6fa2d040 --- /dev/null +++ b/tests/baselines/reference/mergedEnumDeclarationCodeGen.js @@ -0,0 +1,19 @@ +//// [mergedEnumDeclarationCodeGen.ts] +enum E { + a, + b = a +} +enum E { + c = a +} + +//// [mergedEnumDeclarationCodeGen.js] +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = E.a] = "b"; +})(E || (E = {})); +var E; +(function (E) { + E[E["c"] = E.a] = "c"; +})(E || (E = {})); diff --git a/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.js b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.js new file mode 100644 index 0000000000000..8ac1ed7957145 --- /dev/null +++ b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/mergedInterfaceFromMultipleFiles1.ts] //// + +//// [mergedInterfaceFromMultipleFiles1_0.ts] + +interface I { foo(): string; } + +interface C extends I { + a(): number; +} + +//// [mergedInterfaceFromMultipleFiles1_1.ts] +/// + +interface D { bar(): number; } + +interface C extends D { + b(): Date; +} + +var c:C; +var a: string = c.foo(); +var b: number = c.bar(); +var d: number = c.a(); +var e: Date = c.b(); + +//// [mergedInterfaceFromMultipleFiles1_0.js] +//// [mergedInterfaceFromMultipleFiles1_1.js] +var c; +var a = c.foo(); +var b = c.bar(); +var d = c.a(); +var e = c.b(); diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt new file mode 100644 index 0000000000000..cae2b5a7053c3 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ==== + interface A { + x: string; // error + } + + interface A { + x: number; + ~ +!!! Duplicate identifier 'x'. + } + + module M { + interface A { + x: T; + } + + interface A { + x: number; // error + ~ +!!! Duplicate identifier 'x'. + } + } + + module M2 { + interface A { + x: T; + } + } + + module M2 { + interface A { + x: number; // ok, different declaration space than other M2 + } + } + + module M3 { + export interface A { + x: T; + } + } + + module M3 { + export interface A { + x: number; // error + ~ +!!! Duplicate identifier 'x'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.js b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.js new file mode 100644 index 0000000000000..c1c785b5dede8 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.js @@ -0,0 +1,44 @@ +//// [mergedInterfacesWithConflictingPropertyNames.ts] +interface A { + x: string; // error +} + +interface A { + x: number; +} + +module M { + interface A { + x: T; + } + + interface A { + x: number; // error + } +} + +module M2 { + interface A { + x: T; + } +} + +module M2 { + interface A { + x: number; // ok, different declaration space than other M2 + } +} + +module M3 { + export interface A { + x: T; + } +} + +module M3 { + export interface A { + x: number; // error + } +} + +//// [mergedInterfacesWithConflictingPropertyNames.js] diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt new file mode 100644 index 0000000000000..6c2dd7b657e07 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames2.ts (3 errors) ==== + interface A { + x: string; // error + } + + interface A { + x: string; // error + ~ +!!! Duplicate identifier 'x'. + } + + module M { + interface A { + x: T; + } + + interface A { + x: T; // error + ~ +!!! Duplicate identifier 'x'. + } + } + + module M2 { + interface A { + x: T; + } + } + + module M2 { + interface A { + x: T; // ok, different declaration space than other M2 + } + } + + module M3 { + export interface A { + x: T; + } + } + + module M3 { + export interface A { + x: T; // error + ~ +!!! Duplicate identifier 'x'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.js b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.js new file mode 100644 index 0000000000000..b298c74cdcab2 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.js @@ -0,0 +1,44 @@ +//// [mergedInterfacesWithConflictingPropertyNames2.ts] +interface A { + x: string; // error +} + +interface A { + x: string; // error +} + +module M { + interface A { + x: T; + } + + interface A { + x: T; // error + } +} + +module M2 { + interface A { + x: T; + } +} + +module M2 { + interface A { + x: T; // ok, different declaration space than other M2 + } +} + +module M3 { + export interface A { + x: T; + } +} + +module M3 { + export interface A { + x: T; // error + } +} + +//// [mergedInterfacesWithConflictingPropertyNames2.js] diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.js b/tests/baselines/reference/mergedInterfacesWithIndexers.js new file mode 100644 index 0000000000000..83f4638c94cb0 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.js @@ -0,0 +1,22 @@ +//// [mergedInterfacesWithIndexers.ts] +// indexers should behave like other members when merging interface declarations + +interface A { + [x: number]: string; +} + + +interface A { + [x: string]: { length: number }; +} + +var a: A; +var r = a[1]; +var r2 = a['1']; +var r3 = a['hi']; + +//// [mergedInterfacesWithIndexers.js] +var a; +var r = a[1]; +var r2 = a['1']; +var r3 = a['hi']; diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt b/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt new file mode 100644 index 0000000000000..89209f1a4dd52 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithIndexers2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers2.ts (3 errors) ==== + // indexers should behave like other members when merging interface declarations + + interface A { + [x: number]: string; // error + ~~~~~~~~~~~~~~~~~~~~ +!!! Numeric index type 'string' is not assignable to string index type '{ length: string; }'. + } + + + interface A { + [x: string]: { length: string }; // error + } + + interface A2 { + [x: number]: string; + 'a': number; //error + ~~~~~~~~~~~~ +!!! Property ''a'' of type 'number' is not assignable to string index type '{ length: number; }'. + } + + + interface A2 { + [x: string]: { length: number }; + 1: { length: number }; // error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Property '1' of type '{ length: number; }' is not assignable to numeric index type 'string'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers2.js b/tests/baselines/reference/mergedInterfacesWithIndexers2.js new file mode 100644 index 0000000000000..fa7edd08d5448 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithIndexers2.js @@ -0,0 +1,25 @@ +//// [mergedInterfacesWithIndexers2.ts] +// indexers should behave like other members when merging interface declarations + +interface A { + [x: number]: string; // error +} + + +interface A { + [x: string]: { length: string }; // error +} + +interface A2 { + [x: number]: string; + 'a': number; //error +} + + +interface A2 { + [x: string]: { length: number }; + 1: { length: number }; // error +} + + +//// [mergedInterfacesWithIndexers2.js] diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt new file mode 100644 index 0000000000000..3ad843c7f17df --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts (3 errors) ==== + class C { + private x: number; + } + + interface A extends C { + y: string; + } + + interface A { + z: string; + } + + class D implements A { // error + ~ +!!! Class 'D' incorrectly implements interface 'A': +!!! Private property 'x' cannot be reimplemented. + private x: number; + y: string; + z: string; + } + + class E implements A { // error + ~ +!!! Class 'E' incorrectly implements interface 'A': +!!! Private property 'x' cannot be reimplemented. + x: number; + y: string; + z: string; + } + + var a: A; + var r = a.x; // error + ~~~ +!!! Property 'C.x' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js new file mode 100644 index 0000000000000..527df77b0c66e --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js @@ -0,0 +1,46 @@ +//// [mergedInterfacesWithInheritedPrivates.ts] +class C { + private x: number; +} + +interface A extends C { + y: string; +} + +interface A { + z: string; +} + +class D implements A { // error + private x: number; + y: string; + z: string; +} + +class E implements A { // error + x: number; + y: string; + z: string; +} + +var a: A; +var r = a.x; // error + +//// [mergedInterfacesWithInheritedPrivates.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var E = (function () { + function E() { + } + return E; +})(); +var a; +var r = a.x; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt new file mode 100644 index 0000000000000..7ab40587207af --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts (5 errors) ==== + class C { + private x: number; + } + + class C2 { + private w: number; + } + + interface A extends C { + y: string; + } + + interface A extends C2 { + z: string; + } + + class D extends C implements A { // error + ~ +!!! Class 'D' incorrectly implements interface 'A': +!!! Private property 'w' cannot be reimplemented. + private w: number; + y: string; + z: string; + } + + class E extends C2 implements A { // error + ~ +!!! Class 'E' incorrectly extends base class 'C2': +!!! Private property 'w' cannot be reimplemented. + ~ +!!! Class 'E' incorrectly implements interface 'A': +!!! Property 'x' is missing in type 'E'. + w: number; + y: string; + z: string; + } + + var a: A; + var r = a.x; // error + ~~~ +!!! Property 'C.x' is inaccessible. + var r2 = a.w; // error + ~~~ +!!! Property 'C2.w' is inaccessible. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js new file mode 100644 index 0000000000000..98fa868bb530c --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -0,0 +1,67 @@ +//// [mergedInterfacesWithInheritedPrivates2.ts] +class C { + private x: number; +} + +class C2 { + private w: number; +} + +interface A extends C { + y: string; +} + +interface A extends C2 { + z: string; +} + +class D extends C implements A { // error + private w: number; + y: string; + z: string; +} + +class E extends C2 implements A { // error + w: number; + y: string; + z: string; +} + +var a: A; +var r = a.x; // error +var r2 = a.w; // error + +//// [mergedInterfacesWithInheritedPrivates2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var E = (function (_super) { + __extends(E, _super); + function E() { + _super.apply(this, arguments); + } + return E; +})(C2); +var a; +var r = a.x; +var r2 = a.w; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt new file mode 100644 index 0000000000000..9956bb45dc811 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt @@ -0,0 +1,45 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts (2 errors) ==== + class C { + private x: number; + } + + class C2 { + private x: number; + } + + interface A extends C { // error + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! Named properties 'x' of types 'C' and 'C2' are not identical. + y: string; + } + + interface A extends C2 { + z: string; + } + + class D extends C implements A { // error + y: string; + z: string; + } + + module M { + class C { + private x: string; + } + + class C2 { + private x: number; + } + + interface A extends C { // error, privates conflict + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! Named properties 'x' of types 'C' and 'C2' are not identical. + y: string; + } + + interface A extends C2 { + z: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js new file mode 100644 index 0000000000000..a58a62de26788 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -0,0 +1,77 @@ +//// [mergedInterfacesWithInheritedPrivates3.ts] +class C { + private x: number; +} + +class C2 { + private x: number; +} + +interface A extends C { // error + y: string; +} + +interface A extends C2 { + z: string; +} + +class D extends C implements A { // error + y: string; + z: string; +} + +module M { + class C { + private x: string; + } + + class C2 { + private x: number; + } + + interface A extends C { // error, privates conflict + y: string; + } + + interface A extends C2 { + z: string; + } +} + +//// [mergedInterfacesWithInheritedPrivates3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases.js new file mode 100644 index 0000000000000..1df74ff7ebbd2 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases.js @@ -0,0 +1,92 @@ +//// [mergedInterfacesWithMultipleBases.ts] +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { + a: number; +} + +class C2 { + b: number; +} + +interface A extends C { + y: string; +} + +interface A extends C2 { + z: string; +} + +class D implements A { + a: number; + b: number; + y: string; + z: string; +} + +var a: A; +var r = a.a; + +// generic interfaces in a module +module M { + class C { + a: T; + } + + class C2 { + b: T; + } + + interface A extends C { + y: T; + } + + interface A extends C2 { + z: T; + } + + class D implements A { + a: boolean; + b: string; + y: boolean; + z: boolean; + } +} + +//// [mergedInterfacesWithMultipleBases.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var a; +var r = a.a; +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var D = (function () { + function D() { + } + return D; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js new file mode 100644 index 0000000000000..896b9e07a2e67 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.js @@ -0,0 +1,133 @@ +//// [mergedInterfacesWithMultipleBases2.ts] +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { + a: number; +} + +class C2 { + b: number; +} + +class C3 { + c: string; +} + +class C4 { + d: string; +} + + +interface A extends C, C3 { + y: string; +} + +interface A extends C2, C4 { + z: string; +} + +class D implements A { + a: number; + b: number; + c: string; + d: string; + y: string; + z: string; +} + +var a: A; +var r = a.a; + +// generic interfaces in a module +module M { + class C { + a: T; + } + + class C2 { + b: T; + } + + class C3 { + c: T; + } + + class C4 { + d: T; + } + + interface A extends C, C3 { + y: T; + } + + interface A extends C2, C4 { + z: T; + } + + class D implements A { + a: boolean; + b: string; + c: boolean; + d: string; + y: boolean; + z: boolean; + } +} + +//// [mergedInterfacesWithMultipleBases2.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function () { + function C4() { + } + return C4; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var a; +var r = a.a; +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + var C2 = (function () { + function C2() { + } + return C2; + })(); + var C3 = (function () { + function C3() { + } + return C3; + })(); + var C4 = (function () { + function C4() { + } + return C4; + })(); + var D = (function () { + function D() { + } + return D; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js new file mode 100644 index 0000000000000..c1afde0ef4111 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.js @@ -0,0 +1,63 @@ +//// [mergedInterfacesWithMultipleBases3.ts] +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { + a: T; +} + +class C2 { + b: T; +} + +class C3 { + c: T; +} + +class C4 { + d: T; +} + +interface A extends C, C3 { + y: T; +} + +interface A extends C, C4 { + z: T; +} + +class D implements A { + a: string; + b: Date; + c: string; + d: string; + y: boolean; + z: boolean; +} + +//// [mergedInterfacesWithMultipleBases3.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function () { + function C4() { + } + return C4; +})(); +var D = (function () { + function D() { + } + return D; +})(); diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt new file mode 100644 index 0000000000000..76f837f8369a2 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts (1 errors) ==== + // merged interfaces behave as if all extends clauses from each declaration are merged together + + class C { + a: T; + } + + class C2 { + b: T; + } + + class C3 { + c: T; + } + + class C4 { + d: T; + } + + interface A extends C, C3 { // error + ~ +!!! Interface 'A' cannot simultaneously extend types 'C' and 'C': +!!! Named properties 'a' of types 'C' and 'C' are not identical. + y: T; + } + + interface A extends C, C4 { + z: T; + } + + class D implements A { + a: string; + b: string; + c: string; + d: string; + y: boolean; + z: boolean; + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js new file mode 100644 index 0000000000000..81421e79bf3e6 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.js @@ -0,0 +1,62 @@ +//// [mergedInterfacesWithMultipleBases4.ts] +// merged interfaces behave as if all extends clauses from each declaration are merged together + +class C { + a: T; +} + +class C2 { + b: T; +} + +class C3 { + c: T; +} + +class C4 { + d: T; +} + +interface A extends C, C3 { // error + y: T; +} + +interface A extends C, C4 { + z: T; +} + +class D implements A { + a: string; + b: string; + c: string; + d: string; + y: boolean; + z: boolean; +} + +//// [mergedInterfacesWithMultipleBases4.js] +var C = (function () { + function C() { + } + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var C4 = (function () { + function C4() { + } + return C4; +})(); +var D = (function () { + function D() { + } + return D; +})(); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt new file mode 100644 index 0000000000000..14222a376b073 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts (1 errors) ==== + export module X { + ~~~~~~~~~~~~~~~~~ + export module Y { + ~~~~~~~~~~~~~~~~~~~~~ + class A { + ~~~~~~~~~~~~~~~~~ + constructor(Y: any) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + new B(); + ~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export module X { + export module Y { + export class B { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js new file mode 100644 index 0000000000000..c560f7ee329b7 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.js @@ -0,0 +1,42 @@ +//// [mergedModuleDeclarationCodeGen.ts] +export module X { + export module Y { + class A { + constructor(Y: any) { + new B(); + } + } + } +} +export module X { + export module Y { + export class B { + } + } +} + +//// [mergedModuleDeclarationCodeGen.js] +(function (X) { + (function (Y) { + var A = (function () { + function A(Y) { + new Y.B(); + } + return A; + })(); + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(exports.X || (exports.X = {})); +var X = exports.X; +(function (X) { + (function (Y) { + var B = (function () { + function B() { + } + return B; + })(); + Y.B = B; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(exports.X || (exports.X = {})); +var X = exports.X; diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js new file mode 100644 index 0000000000000..3780b08a52b3d --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.js @@ -0,0 +1,32 @@ +//// [mergedModuleDeclarationCodeGen2.ts] +module my.data.foo { + export function buz() { } +} +module my.data { + function data(my) { + foo.buz(); + } +} + +//// [mergedModuleDeclarationCodeGen2.js] +var my; +(function (my) { + (function (data) { + (function (foo) { + function buz() { + } + foo.buz = buz; + })(data.foo || (data.foo = {})); + var foo = data.foo; + })(my.data || (my.data = {})); + var data = my.data; +})(my || (my = {})); +var my; +(function (my) { + (function (data) { + function data(my) { + data.foo.buz(); + } + })(my.data || (my.data = {})); + var data = my.data; +})(my || (my = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js new file mode 100644 index 0000000000000..36daa3e1957dd --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.js @@ -0,0 +1,32 @@ +//// [mergedModuleDeclarationCodeGen3.ts] +module my.data { + export function buz() { } +} +module my.data.foo { + function data(my, foo) { + buz(); + } +} + +//// [mergedModuleDeclarationCodeGen3.js] +var my; +(function (my) { + (function (data) { + function buz() { + } + data.buz = buz; + })(my.data || (my.data = {})); + var data = my.data; +})(my || (my = {})); +var my; +(function (my) { + (function (data) { + (function (foo) { + function data(my, foo) { + data.buz(); + } + })(data.foo || (data.foo = {})); + var foo = data.foo; + })(my.data || (my.data = {})); + var data = my.data; +})(my || (my = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js new file mode 100644 index 0000000000000..04ea06e0df9c5 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.js @@ -0,0 +1,50 @@ +//// [mergedModuleDeclarationCodeGen4.ts] +module superContain { + export module contain { + export module my.buz { + export module data { + export function foo() { } + } + } + export module my.buz { + export module data { + export function bar(contain, my, buz, data) { + foo(); + } + } + } + } +} + +//// [mergedModuleDeclarationCodeGen4.js] +var superContain; +(function (superContain) { + (function (contain) { + (function (my) { + (function (buz) { + (function (data) { + function foo() { + } + data.foo = foo; + })(buz.data || (buz.data = {})); + var data = buz.data; + })(my.buz || (my.buz = {})); + var buz = my.buz; + })(contain.my || (contain.my = {})); + var my = contain.my; + (function (my) { + (function (buz) { + (function (data) { + function bar(contain, my, buz, data) { + data.foo(); + } + data.bar = bar; + })(buz.data || (buz.data = {})); + var data = buz.data; + })(my.buz || (my.buz = {})); + var buz = my.buz; + })(contain.my || (contain.my = {})); + var my = contain.my; + })(superContain.contain || (superContain.contain = {})); + var contain = superContain.contain; +})(superContain || (superContain = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js new file mode 100644 index 0000000000000..e3d0de74497a7 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js @@ -0,0 +1,64 @@ +//// [mergedModuleDeclarationCodeGen5.ts] +module M.buz.plop { + export function doom() { } + export function M() { } +} +module M.buz.plop { + function gunk() { } + function buz() { } + export class fudge { } + export enum plop { } + + // Emit these references as follows + var v1 = gunk; // gunk + var v2 = buz; // buz + export var v3 = doom; // _plop.doom + export var v4 = M; // _plop.M + export var v5 = fudge; // fudge + export var v6 = plop; // plop +} + +//// [mergedModuleDeclarationCodeGen5.js] +var M; +(function (M) { + (function (buz) { + (function (plop) { + function doom() { + } + plop.doom = doom; + function M() { + } + plop.M = M; + })(buz.plop || (buz.plop = {})); + var plop = buz.plop; + })(M.buz || (M.buz = {})); + var buz = M.buz; +})(M || (M = {})); +var M; +(function (M) { + (function (buz) { + (function (plop) { + function gunk() { + } + function buz() { + } + var fudge = (function () { + function fudge() { + } + return fudge; + })(); + plop.fudge = fudge; + (function (plop) { + })(plop.plop || (plop.plop = {})); + var plop = plop.plop; + var v1 = gunk; + var v2 = buz; + plop.v3 = plop.doom; + plop.v4 = plop.M; + plop.v5 = fudge; + plop.v6 = plop; + })(buz.plop || (buz.plop = {})); + var plop = buz.plop; + })(M.buz || (M.buz = {})); + var buz = M.buz; +})(M || (M = {})); diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js new file mode 100644 index 0000000000000..f2f45c621d036 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.js @@ -0,0 +1,19 @@ +//// [mergedModuleDeclarationWithSharedExportedVar.ts] +module M { + export var v = 10; + v; +} +module M { + v; +} + +//// [mergedModuleDeclarationWithSharedExportedVar.js] +var M; +(function (M) { + M.v = 10; + M.v; +})(M || (M = {})); +var M; +(function (M) { + M.v; +})(M || (M = {})); diff --git a/tests/baselines/reference/methodContainingLocalFunction.js b/tests/baselines/reference/methodContainingLocalFunction.js new file mode 100644 index 0000000000000..b7838d3b06c3c --- /dev/null +++ b/tests/baselines/reference/methodContainingLocalFunction.js @@ -0,0 +1,122 @@ +//// [methodContainingLocalFunction.ts] +// The first case here (BugExhibition) caused a crash. Try with different permutations of features. +class BugExhibition { + public exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + } +} + +class BugExhibition2 { + private static get exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + return null; + } +} + +class BugExhibition3 { + public exhibitBug() { + function localGenericFunction(u?: U) { } + var x: { (): void; }; + x = localGenericFunction; + } +} + +class C { + exhibit() { + var funcExpr = (u?: U) => { }; + var x: { (): void; }; + x = funcExpr; + } +} + +module M { + export function exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + } +} + +enum E { + A = (() => { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + return 0; + })() +} + +//// [methodContainingLocalFunction.js] +var BugExhibition = (function () { + function BugExhibition() { + } + BugExhibition.prototype.exhibitBug = function () { + function localFunction() { + } + var x; + x = localFunction; + }; + return BugExhibition; +})(); +var BugExhibition2 = (function () { + function BugExhibition2() { + } + Object.defineProperty(BugExhibition2, "exhibitBug", { + get: function () { + function localFunction() { + } + var x; + x = localFunction; + return null; + }, + enumerable: true, + configurable: true + }); + return BugExhibition2; +})(); +var BugExhibition3 = (function () { + function BugExhibition3() { + } + BugExhibition3.prototype.exhibitBug = function () { + function localGenericFunction(u) { + } + var x; + x = localGenericFunction; + }; + return BugExhibition3; +})(); +var C = (function () { + function C() { + } + C.prototype.exhibit = function () { + var funcExpr = function (u) { + }; + var x; + x = funcExpr; + }; + return C; +})(); +var M; +(function (M) { + function exhibitBug() { + function localFunction() { + } + var x; + x = localFunction; + } + M.exhibitBug = exhibitBug; +})(M || (M = {})); +var E; +(function (E) { + E[E["A"] = (function () { + function localFunction() { + } + var x; + x = localFunction; + return 0; + })()] = "A"; +})(E || (E = {})); diff --git a/tests/baselines/reference/methodSignatureDeclarationEmit1.js b/tests/baselines/reference/methodSignatureDeclarationEmit1.js new file mode 100644 index 0000000000000..63d5a8c92092b --- /dev/null +++ b/tests/baselines/reference/methodSignatureDeclarationEmit1.js @@ -0,0 +1,19 @@ +//// [methodSignatureDeclarationEmit1.ts] +class C { + public foo(n: number): void; + public foo(s: string): void; + public foo(a: any): void { + } +} + +//// [methodSignatureDeclarationEmit1.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (a) { + }; + return C; +})(); + + +//// [methodSignatureDeclarationEmit1.d.ts] diff --git a/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt b/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt new file mode 100644 index 0000000000000..f41e12db99508 --- /dev/null +++ b/tests/baselines/reference/methodSignaturesWithOverloads.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads.ts (2 errors) ==== + // Object type literals permit overloads with optionality but they must match + + var c: { + func4?(x: number): number; + func4(s: string): string; // error, mismatched optionality + ~~~~~ +!!! Overload signatures must all be optional or required. + func5?: { + (x: number): number; + (s: string): string; + }; + }; + + var c2: { + func4(x: T): number; + func4? (s: T): string; // error, mismatched optionality + ~~~~~ +!!! Overload signatures must all be optional or required. + func5?: { + (x: T): number; + (s: T): string; + }; + }; \ No newline at end of file diff --git a/tests/baselines/reference/methodSignaturesWithOverloads.js b/tests/baselines/reference/methodSignaturesWithOverloads.js new file mode 100644 index 0000000000000..bbff03bcc75e2 --- /dev/null +++ b/tests/baselines/reference/methodSignaturesWithOverloads.js @@ -0,0 +1,24 @@ +//// [methodSignaturesWithOverloads.ts] +// Object type literals permit overloads with optionality but they must match + +var c: { + func4?(x: number): number; + func4(s: string): string; // error, mismatched optionality + func5?: { + (x: number): number; + (s: string): string; + }; +}; + +var c2: { + func4(x: T): number; + func4? (s: T): string; // error, mismatched optionality + func5?: { + (x: T): number; + (s: T): string; + }; +}; + +//// [methodSignaturesWithOverloads.js] +var c; +var c2; diff --git a/tests/baselines/reference/methodSignaturesWithOverloads2.js b/tests/baselines/reference/methodSignaturesWithOverloads2.js new file mode 100644 index 0000000000000..95f642e6b547d --- /dev/null +++ b/tests/baselines/reference/methodSignaturesWithOverloads2.js @@ -0,0 +1,37 @@ +//// [methodSignaturesWithOverloads2.ts] +// Object type literals permit overloads with optionality but they must match + +var c: { + func4?(x: number): number; + func4?(s: string): string; + func5?: { + (x: number): number; + (s: string): string; + }; +}; + +// no errors +c.func4 = c.func5; +c.func5 = c.func4; + + +var c2: { + func4?(x: T): number; + func4? (s: T): string; + func5?: { + (x: T): number; + (s: T): string; + }; +}; + +// no errors +c2.func4 = c2.func5; +c2.func5 = c2.func4; + +//// [methodSignaturesWithOverloads2.js] +var c; +c.func4 = c.func5; +c.func5 = c.func4; +var c2; +c2.func4 = c2.func5; +c2.func5 = c2.func4; diff --git a/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt b/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt new file mode 100644 index 0000000000000..450717d512432 --- /dev/null +++ b/tests/baselines/reference/mismatchedClassConstructorVariable.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/mismatchedClassConstructorVariable.ts (1 errors) ==== + var baz: foo; + class baz { } + ~~~ +!!! Duplicate identifier 'baz'. + class foo { } \ No newline at end of file diff --git a/tests/baselines/reference/mismatchedClassConstructorVariable.js b/tests/baselines/reference/mismatchedClassConstructorVariable.js new file mode 100644 index 0000000000000..ea3f95559c978 --- /dev/null +++ b/tests/baselines/reference/mismatchedClassConstructorVariable.js @@ -0,0 +1,17 @@ +//// [mismatchedClassConstructorVariable.ts] +var baz: foo; +class baz { } +class foo { } + +//// [mismatchedClassConstructorVariable.js] +var baz; +var baz = (function () { + function baz() { + } + return baz; +})(); +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt new file mode 100644 index 0000000000000..0e45ce8eb74b5 --- /dev/null +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts (2 errors) ==== + function map(xs: T[], f: (x: T) => U) { + var ys: U[] = []; + xs.forEach(x => ys.push(f(x))); + return ys; + } + + var r0 = map([1, ""], (x) => x.toString()); + var r5 = map([1, ""], (x) => x.toString()); + var r6 = map([1, ""], (x) => x.toString()); + var r7 = map([1, ""], (x) => x.toString()); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = map([1, ""], (x) => x.toString()); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r8 = map([1, ""], (x) => x.toString()); \ No newline at end of file diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js new file mode 100644 index 0000000000000..64c801b5af486 --- /dev/null +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js @@ -0,0 +1,26 @@ +//// [mismatchedExplicitTypeParameterAndArgumentType.ts] +function map(xs: T[], f: (x: T) => U) { + var ys: U[] = []; + xs.forEach(x => ys.push(f(x))); + return ys; +} + +var r0 = map([1, ""], (x) => x.toString()); +var r5 = map([1, ""], (x) => x.toString()); +var r6 = map([1, ""], (x) => x.toString()); +var r7 = map([1, ""], (x) => x.toString()); // error +var r7b = map([1, ""], (x) => x.toString()); // error +var r8 = map([1, ""], (x) => x.toString()); + +//// [mismatchedExplicitTypeParameterAndArgumentType.js] +function map(xs, f) { + var ys = []; + xs.forEach(function (x) { return ys.push(f(x)); }); + return ys; +} +var r0 = map([1, ""], function (x) { return x.toString(); }); +var r5 = map([1, ""], function (x) { return x.toString(); }); +var r6 = map([1, ""], function (x) { return x.toString(); }); +var r7 = map([1, ""], function (x) { return x.toString(); }); +var r7b = map([1, ""], function (x) { return x.toString(); }); +var r8 = map([1, ""], function (x) { return x.toString(); }); diff --git a/tests/baselines/reference/mismatchedGenericArguments1.js b/tests/baselines/reference/mismatchedGenericArguments1.js new file mode 100644 index 0000000000000..a702e369e9519 --- /dev/null +++ b/tests/baselines/reference/mismatchedGenericArguments1.js @@ -0,0 +1,34 @@ +//// [mismatchedGenericArguments1.ts] +interface IFoo { + foo(x: T): T; +} +class C implements IFoo { + foo(x: string): number { + return null; + } +} + +class C2 implements IFoo { + foo(x: string): number { + return null; + } +} + + +//// [mismatchedGenericArguments1.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function (x) { + return null; + }; + return C2; +})(); diff --git a/tests/baselines/reference/missingImportAfterModuleImport.js b/tests/baselines/reference/missingImportAfterModuleImport.js new file mode 100644 index 0000000000000..439bc9805ce71 --- /dev/null +++ b/tests/baselines/reference/missingImportAfterModuleImport.js @@ -0,0 +1,39 @@ +//// [tests/cases/compiler/missingImportAfterModuleImport.ts] //// + +//// [missingImportAfterModuleImport_0.ts] + +declare module "SubModule" { + class SubModule { + public static StaticVar: number; + public InstanceVar: number; + constructor(); + } + export = SubModule; +} + +//// [missingImportAfterModuleImport_1.ts] +/// +import SubModule = require('SubModule'); +class MainModule { + // public static SubModule: SubModule; + public SubModule: SubModule; + constructor() { } +} +export = MainModule; + + + +//// [missingImportAfterModuleImport_0.js] +//// [missingImportAfterModuleImport_1.js] +var MainModule = (function () { + function MainModule() { + } + return MainModule; +})(); +module.exports = MainModule; + + +//// [missingImportAfterModuleImport_0.d.ts] +//// [missingImportAfterModuleImport_1.d.ts] +/// +export = MainModule; diff --git a/tests/baselines/reference/missingReturnStatement.js b/tests/baselines/reference/missingReturnStatement.js new file mode 100644 index 0000000000000..91c461e47150a --- /dev/null +++ b/tests/baselines/reference/missingReturnStatement.js @@ -0,0 +1,21 @@ +//// [missingReturnStatement.ts] +module Test { + export class Bug { + public foo():string { + } + } +} + + +//// [missingReturnStatement.js] +var Test; +(function (Test) { + var Bug = (function () { + function Bug() { + } + Bug.prototype.foo = function () { + }; + return Bug; + })(); + Test.Bug = Bug; +})(Test || (Test = {})); diff --git a/tests/baselines/reference/missingReturnStatement1.js b/tests/baselines/reference/missingReturnStatement1.js new file mode 100644 index 0000000000000..91cc673dfd0bc --- /dev/null +++ b/tests/baselines/reference/missingReturnStatement1.js @@ -0,0 +1,16 @@ +//// [missingReturnStatement1.ts] +class Foo { + foo(): number { + //return 4; + } +} + + +//// [missingReturnStatement1.js] +var Foo = (function () { + function Foo() { + } + Foo.prototype.foo = function () { + }; + return Foo; +})(); diff --git a/tests/baselines/reference/missingSelf.js b/tests/baselines/reference/missingSelf.js new file mode 100644 index 0000000000000..efcec0f03ec5b --- /dev/null +++ b/tests/baselines/reference/missingSelf.js @@ -0,0 +1,46 @@ +//// [missingSelf.ts] +class CalcButton +{ + public a() { this.onClick(); } + public onClick() { } +} + +class CalcButton2 +{ + public b() { () => this.onClick(); } + public onClick() { } +} + +var c = new CalcButton(); +c.a(); +var c2 = new CalcButton2(); +c2.b(); + + + +//// [missingSelf.js] +var CalcButton = (function () { + function CalcButton() { + } + CalcButton.prototype.a = function () { + this.onClick(); + }; + CalcButton.prototype.onClick = function () { + }; + return CalcButton; +})(); +var CalcButton2 = (function () { + function CalcButton2() { + } + CalcButton2.prototype.b = function () { + var _this = this; + (function () { return _this.onClick(); }); + }; + CalcButton2.prototype.onClick = function () { + }; + return CalcButton2; +})(); +var c = new CalcButton(); +c.a(); +var c2 = new CalcButton2(); +c2.b(); diff --git a/tests/baselines/reference/missingTypeArguments1.errors.txt b/tests/baselines/reference/missingTypeArguments1.errors.txt new file mode 100644 index 0000000000000..87bb648a75102 --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments1.errors.txt @@ -0,0 +1,75 @@ +==== tests/cases/compiler/missingTypeArguments1.ts (10 errors) ==== + interface I { } + class Y {} + class X { + p1: () => X; + ~ +!!! Generic type 'X' requires 1 type argument(s). + } + var a: X; + + class X2 { + p2: { [idx: number]: X2 } + ~~ +!!! Generic type 'X2' requires 1 type argument(s). + } + var a2: X2; + + class X3 { + p3: X3[] + ~~ +!!! Generic type 'X3' requires 1 type argument(s). + } + var a3: X3; + + class X4 { + p4: I + ~~ +!!! Generic type 'X4' requires 1 type argument(s). + } + var a4: X4; + + class X5 { + p5: X5 + ~~ +!!! Generic type 'X5' requires 1 type argument(s). + } + var a5: X5; + + class X6 { + p6: () => Y; + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + var a6: X6; + + class X7 { + p7: { [idx: number]: Y } + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + var a7: X7; + + class X8 { + p8: Y[] + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + var a8: X8; + + class X9 { + p9: I + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + var a9: X9; + + class X10 { + pa: Y + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + var a10: X10; + + + \ No newline at end of file diff --git a/tests/baselines/reference/missingTypeArguments1.js b/tests/baselines/reference/missingTypeArguments1.js new file mode 100644 index 0000000000000..4284753142154 --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments1.js @@ -0,0 +1,122 @@ +//// [missingTypeArguments1.ts] +interface I { } +class Y {} +class X { + p1: () => X; +} +var a: X; + +class X2 { + p2: { [idx: number]: X2 } +} +var a2: X2; + +class X3 { + p3: X3[] +} +var a3: X3; + +class X4 { + p4: I +} +var a4: X4; + +class X5 { + p5: X5 +} +var a5: X5; + +class X6 { + p6: () => Y; +} +var a6: X6; + +class X7 { + p7: { [idx: number]: Y } +} +var a7: X7; + +class X8 { + p8: Y[] +} +var a8: X8; + +class X9 { + p9: I +} +var a9: X9; + +class X10 { + pa: Y +} +var a10: X10; + + + + +//// [missingTypeArguments1.js] +var Y = (function () { + function Y() { + } + return Y; +})(); +var X = (function () { + function X() { + } + return X; +})(); +var a; +var X2 = (function () { + function X2() { + } + return X2; +})(); +var a2; +var X3 = (function () { + function X3() { + } + return X3; +})(); +var a3; +var X4 = (function () { + function X4() { + } + return X4; +})(); +var a4; +var X5 = (function () { + function X5() { + } + return X5; +})(); +var a5; +var X6 = (function () { + function X6() { + } + return X6; +})(); +var a6; +var X7 = (function () { + function X7() { + } + return X7; +})(); +var a7; +var X8 = (function () { + function X8() { + } + return X8; +})(); +var a8; +var X9 = (function () { + function X9() { + } + return X9; +})(); +var a9; +var X10 = (function () { + function X10() { + } + return X10; +})(); +var a10; diff --git a/tests/baselines/reference/missingTypeArguments2.errors.txt b/tests/baselines/reference/missingTypeArguments2.errors.txt new file mode 100644 index 0000000000000..34daf27e8416f --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/missingTypeArguments2.ts (4 errors) ==== + class A { } + + var x: () => A; + ~ +!!! Generic type 'A' requires 1 type argument(s). + (a: A) => { }; + ~ +!!! Generic type 'A' requires 1 type argument(s). + var y: A; + ~ +!!! Generic type 'A' requires 1 type argument(s). + (): A => null; + ~ +!!! Generic type 'A' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/missingTypeArguments2.js b/tests/baselines/reference/missingTypeArguments2.js new file mode 100644 index 0000000000000..713023a3b6b76 --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments2.js @@ -0,0 +1,19 @@ +//// [missingTypeArguments2.ts] +class A { } + +var x: () => A; +(a: A) => { }; +var y: A; +(): A => null; + +//// [missingTypeArguments2.js] +var A = (function () { + function A() { + } + return A; +})(); +var x; +(function (a) { +}); +var y; +(function () { return null; }); diff --git a/tests/baselines/reference/missingTypeArguments3.js b/tests/baselines/reference/missingTypeArguments3.js new file mode 100644 index 0000000000000..e3320553b9c9d --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments3.js @@ -0,0 +1,44 @@ +//// [missingTypeArguments3.ts] +declare module linq { + + interface Enumerable { + OrderByDescending(keySelector?: string): OrderedEnumerable; + GroupBy(keySelector: (element: T) => TKey): Enumerable>; + GroupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): Enumerable>; + ToDictionary(keySelector: (element: T) => TKey): Dictionary; + } + + interface OrderedEnumerable extends Enumerable { + ThenBy(keySelector: (element: T) => TCompare): OrderedEnumerable; // used to incorrectly think this was missing a type argument + } + + interface Grouping extends Enumerable { + Key(): TKey; + } + + interface Lookup { + Count(): number; + Get(key): Enumerable; + Contains(key): boolean; + ToEnumerable(): Enumerable>; + } + + interface Dictionary { + Add(key: TKey, value: TValue): void; + Get(ke: TKey): TValue; + Set(key: TKey, value: TValue): boolean; + Contains(key: TKey): boolean; + Clear(): void; + Remove(key: TKey): void; + Count(): number; + ToEnumerable(): Enumerable>; + } + + interface KeyValuePair { + Key: TKey; + Value: TValue; + } +} + + +//// [missingTypeArguments3.js] diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.js b/tests/baselines/reference/mixingFunctionAndAmbientModule1.js new file mode 100644 index 0000000000000..3105c923304c5 --- /dev/null +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.js @@ -0,0 +1,64 @@ +//// [mixingFunctionAndAmbientModule1.ts] +module A { + declare module My { + export var x: number; + } + function My(s: string) { } +} + +module B { + declare module My { + export var x: number; + } + function My(s: boolean); + function My(s: any) { } +} + +module C { + declare module My { + export var x: number; + } + declare function My(s: boolean); +} + +module D { + declare module My { + export var x: number; + } + declare function My(s: boolean); + declare function My(s: any); +} + + +module E { + declare module My { + export var x: number; + } + declare function My(s: boolean); + declare module My { + export var y: number; + } + declare function My(s: any); +} + + +//// [mixingFunctionAndAmbientModule1.js] +var A; +(function (A) { + function My(s) { + } +})(A || (A = {})); +var B; +(function (B) { + function My(s) { + } +})(B || (B = {})); +var C; +(function (C) { +})(C || (C = {})); +var D; +(function (D) { +})(D || (D = {})); +var E; +(function (E) { +})(E || (E = {})); diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt new file mode 100644 index 0000000000000..db7dcf5bf6ec9 --- /dev/null +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/compiler/mixingStaticAndInstanceOverloads.ts (4 errors) ==== + class C1 { + // ERROR + foo1(n: number); + foo1(s: string); + ~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + static foo1(a) { } + } + class C2 { + // ERROR + static foo2(n: number); + static foo2(s: string); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + foo2(a) { } + } + class C3 { + // ERROR + foo3(n: number); + static foo3(s: string); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + foo3(a) { } + } + class C4 { + // ERROR + static foo4(n: number); + foo4(s: string); + ~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + static foo4(a) { } + } + class C5 { + // OK + foo5(n: number); + foo5(s: string); + foo5(a) { } + + // OK + static foo5(n: number); + static foo5(s: string); + static foo5(a) { } + } \ No newline at end of file diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.js b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js new file mode 100644 index 0000000000000..5949528077163 --- /dev/null +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.js @@ -0,0 +1,75 @@ +//// [mixingStaticAndInstanceOverloads.ts] +class C1 { + // ERROR + foo1(n: number); + foo1(s: string); + static foo1(a) { } +} +class C2 { + // ERROR + static foo2(n: number); + static foo2(s: string); + foo2(a) { } +} +class C3 { + // ERROR + foo3(n: number); + static foo3(s: string); + foo3(a) { } +} +class C4 { + // ERROR + static foo4(n: number); + foo4(s: string); + static foo4(a) { } +} +class C5 { + // OK + foo5(n: number); + foo5(s: string); + foo5(a) { } + + // OK + static foo5(n: number); + static foo5(s: string); + static foo5(a) { } +} + +//// [mixingStaticAndInstanceOverloads.js] +var C1 = (function () { + function C1() { + } + C1.foo1 = function (a) { + }; + return C1; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.foo2 = function (a) { + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + C3.prototype.foo3 = function (a) { + }; + return C3; +})(); +var C4 = (function () { + function C4() { + } + C4.foo4 = function (a) { + }; + return C4; +})(); +var C5 = (function () { + function C5() { + } + C5.prototype.foo5 = function (a) { + }; + C5.foo5 = function (a) { + }; + return C5; +})(); diff --git a/tests/baselines/reference/modFunctionCrash.js b/tests/baselines/reference/modFunctionCrash.js new file mode 100644 index 0000000000000..f216788c0eb3b --- /dev/null +++ b/tests/baselines/reference/modFunctionCrash.js @@ -0,0 +1,12 @@ +//// [modFunctionCrash.ts] +declare module Q { + function f(fn:()=>void); // typechecking the function type shouldnot crash the compiler +} + + +Q.f(function() {this;}); + +//// [modFunctionCrash.js] +Q.f(function () { + this; +}); diff --git a/tests/baselines/reference/modKeyword.js b/tests/baselines/reference/modKeyword.js new file mode 100644 index 0000000000000..5dc94dac8deed --- /dev/null +++ b/tests/baselines/reference/modKeyword.js @@ -0,0 +1,10 @@ +//// [modKeyword.ts] +var module:any; +var foo:any; + +var _ = module.exports = foo + +//// [modKeyword.js] +var module; +var foo; +var _ = module.exports = foo; diff --git a/tests/baselines/reference/moduleAliasAsFunctionArgument.js b/tests/baselines/reference/moduleAliasAsFunctionArgument.js new file mode 100644 index 0000000000000..df6487d57539f --- /dev/null +++ b/tests/baselines/reference/moduleAliasAsFunctionArgument.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/moduleAliasAsFunctionArgument.ts] //// + +//// [moduleAliasAsFunctionArgument_0.ts] +export var x: number; + +//// [moduleAliasAsFunctionArgument_1.ts] +/// +import a = require('moduleAliasAsFunctionArgument_0'); + +function fn(arg: { x: number }) { +} + +a.x; // OK +fn(a); // Error: property 'x' is missing from 'a' + + +//// [moduleAliasAsFunctionArgument_0.js] +define(["require", "exports"], function (require, exports) { + exports.x; +}); +//// [moduleAliasAsFunctionArgument_1.js] +define(["require", "exports", 'moduleAliasAsFunctionArgument_0'], function (require, exports, a) { + function fn(arg) { + } + a.x; + fn(a); +}); diff --git a/tests/baselines/reference/moduleAliasInterface.js b/tests/baselines/reference/moduleAliasInterface.js new file mode 100644 index 0000000000000..fc24795b99413 --- /dev/null +++ b/tests/baselines/reference/moduleAliasInterface.js @@ -0,0 +1,116 @@ +//// [moduleAliasInterface.ts] +module _modes { + export interface IMode { + + } + + export class Mode { + + } +} + +// _modes. // produces an internal error - please implement in derived class + +module editor { + import modes = _modes; + + var i : modes.IMode; + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { + constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported + public foo(p1:modes.IMode) { + + } + } +} + +import modesOuter = _modes; +module editor2 { + + var i : modesOuter.IMode; + + class Bug { + constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally + + } + + module Foo { export class Bar{} } + + class Bug2 { + constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } + } +} + +module A1 { + export interface A1I1 {} + export class A1C1 {} +} + +module B1 { + import A1Alias1 = A1; + + var i : A1Alias1.A1I1; + var c : A1Alias1.A1C1; +} + + +//// [moduleAliasInterface.js] +var _modes; +(function (_modes) { + var Mode = (function () { + function Mode() { + } + return Mode; + })(); + _modes.Mode = Mode; +})(_modes || (_modes = {})); +var editor; +(function (editor) { + var i; + var Bug = (function () { + function Bug(p1, p2) { + } + Bug.prototype.foo = function (p1) { + }; + return Bug; + })(); +})(editor || (editor = {})); +var modesOuter = _modes; +var editor2; +(function (editor2) { + var i; + var Bug = (function () { + function Bug(p1, p2) { + } + return Bug; + })(); + var Foo; + (function (Foo) { + var Bar = (function () { + function Bar() { + } + return Bar; + })(); + Foo.Bar = Bar; + })(Foo || (Foo = {})); + var Bug2 = (function () { + function Bug2(p1, p2) { + } + return Bug2; + })(); +})(editor2 || (editor2 = {})); +var A1; +(function (A1) { + var A1C1 = (function () { + function A1C1() { + } + return A1C1; + })(); + A1.A1C1 = A1C1; +})(A1 || (A1 = {})); +var B1; +(function (B1) { + var i; + var c; +})(B1 || (B1 = {})); diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.js b/tests/baselines/reference/moduleAndInterfaceSharingName.js new file mode 100644 index 0000000000000..6006208e1ade2 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.js @@ -0,0 +1,13 @@ +//// [moduleAndInterfaceSharingName.ts] +module X { + export module Y { + export interface Z { } + } + export interface Y { } +} +var z: X.Y.Z = null; +var z2: X.Y; + +//// [moduleAndInterfaceSharingName.js] +var z = null; +var z2; diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt new file mode 100644 index 0000000000000..32368edf11099 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/moduleAndInterfaceSharingName2.ts (1 errors) ==== + module X { + export module Y { + export interface Z { } + } + export interface Y { } + } + var z: X.Y.Z = null; + var z2: X.Y; + ~~~~~~~~~~~ +!!! Type 'Y' is not generic. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName2.js b/tests/baselines/reference/moduleAndInterfaceSharingName2.js new file mode 100644 index 0000000000000..29ddd2292cb50 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName2.js @@ -0,0 +1,13 @@ +//// [moduleAndInterfaceSharingName2.ts] +module X { + export module Y { + export interface Z { } + } + export interface Y { } +} +var z: X.Y.Z = null; +var z2: X.Y; + +//// [moduleAndInterfaceSharingName2.js] +var z = null; +var z2; diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.js b/tests/baselines/reference/moduleAndInterfaceSharingName3.js new file mode 100644 index 0000000000000..59097ec1f0914 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.js @@ -0,0 +1,13 @@ +//// [moduleAndInterfaceSharingName3.ts] +module X { + export module Y { + export interface Z { } + } + export interface Y { } +} +var z: X.Y.Z = null; +var z2: X.Y; + +//// [moduleAndInterfaceSharingName3.js] +var z = null; +var z2; diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.js b/tests/baselines/reference/moduleAndInterfaceSharingName4.js new file mode 100644 index 0000000000000..254bf0a52ffde --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.js @@ -0,0 +1,12 @@ +//// [moduleAndInterfaceSharingName4.ts] +declare module D3 { + var x: D3.Color.Color; + + module Color { + export interface Color { + darker: Color; + } + } +} + +//// [moduleAndInterfaceSharingName4.js] diff --git a/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt new file mode 100644 index 0000000000000..7f8ffb11a0160 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/moduleAndInterfaceWithSameName.ts (1 errors) ==== + module Foo1 { + export module Bar { + export var x = 42; + } + + export interface Bar { + y: string; + } + } + + module Foo2 { + module Bar { + export var x = 42; + } + + export interface Bar { + y: string; + } + } + + var z2 = Foo2.Bar.y; // Error for using interface name as a value. + ~~~ +!!! Property 'Bar' does not exist on type 'typeof Foo2'. + + module Foo3 { + export module Bar { + export var x = 42; + } + + interface Bar { + y: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceWithSameName.js b/tests/baselines/reference/moduleAndInterfaceWithSameName.js new file mode 100644 index 0000000000000..c88292bbb18c3 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceWithSameName.js @@ -0,0 +1,56 @@ +//// [moduleAndInterfaceWithSameName.ts] +module Foo1 { + export module Bar { + export var x = 42; + } + + export interface Bar { + y: string; + } +} + +module Foo2 { + module Bar { + export var x = 42; + } + + export interface Bar { + y: string; + } +} + +var z2 = Foo2.Bar.y; // Error for using interface name as a value. + +module Foo3 { + export module Bar { + export var x = 42; + } + + interface Bar { + y: string; + } +} + +//// [moduleAndInterfaceWithSameName.js] +var Foo1; +(function (Foo1) { + (function (Bar) { + Bar.x = 42; + })(Foo1.Bar || (Foo1.Bar = {})); + var Bar = Foo1.Bar; +})(Foo1 || (Foo1 = {})); +var Foo2; +(function (Foo2) { + var Bar; + (function (Bar) { + Bar.x = 42; + })(Bar || (Bar = {})); +})(Foo2 || (Foo2 = {})); +var z2 = Foo2.Bar.y; +var Foo3; +(function (Foo3) { + (function (Bar) { + Bar.x = 42; + })(Foo3.Bar || (Foo3.Bar = {})); + var Bar = Foo3.Bar; +})(Foo3 || (Foo3 = {})); diff --git a/tests/baselines/reference/moduleAsBaseType.errors.txt b/tests/baselines/reference/moduleAsBaseType.errors.txt new file mode 100644 index 0000000000000..942efd2381105 --- /dev/null +++ b/tests/baselines/reference/moduleAsBaseType.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/moduleAsBaseType.ts (3 errors) ==== + module M {} + class C extends M {} + ~ +!!! Cannot find name 'M'. + interface I extends M { } + ~ +!!! Cannot find name 'M'. + class C2 implements M { } + ~ +!!! Cannot find name 'M'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js new file mode 100644 index 0000000000000..2537611ddbcf5 --- /dev/null +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -0,0 +1,25 @@ +//// [moduleAsBaseType.ts] +module M {} +class C extends M {} +interface I extends M { } +class C2 implements M { } + +//// [moduleAsBaseType.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(M); +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/moduleAssignmentCompat1.errors.txt b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt new file mode 100644 index 0000000000000..b23e908c0869c --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/moduleAssignmentCompat1.ts (2 errors) ==== + module A { + export class C { } + } + module B { + export class C { } + class D { } + } + + var a: A; + ~ +!!! Cannot find name 'A'. + var b: B; + ~ +!!! Cannot find name 'B'. + + // no error + a = b; + b = a; + + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat1.js b/tests/baselines/reference/moduleAssignmentCompat1.js new file mode 100644 index 0000000000000..704b7640f15ae --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat1.js @@ -0,0 +1,46 @@ +//// [moduleAssignmentCompat1.ts] +module A { + export class C { } +} +module B { + export class C { } + class D { } +} + +var a: A; +var b: B; + +// no error +a = b; +b = a; + + + +//// [moduleAssignmentCompat1.js] +var A; +(function (A) { + var C = (function () { + function C() { + } + return C; + })(); + A.C = C; +})(A || (A = {})); +var B; +(function (B) { + var C = (function () { + function C() { + } + return C; + })(); + B.C = C; + var D = (function () { + function D() { + } + return D; + })(); +})(B || (B = {})); +var a; +var b; +a = b; +b = a; diff --git a/tests/baselines/reference/moduleAssignmentCompat2.errors.txt b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt new file mode 100644 index 0000000000000..9e6e142168550 --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/moduleAssignmentCompat2.ts (2 errors) ==== + module A { + export class C { } + } + module B { + export class C { } + export class D { } + } + + var a: A; + ~ +!!! Cannot find name 'A'. + var b: B; + ~ +!!! Cannot find name 'B'. + + a = b; + b = a; // error \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat2.js b/tests/baselines/reference/moduleAssignmentCompat2.js new file mode 100644 index 0000000000000..0b63b83dcac0f --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat2.js @@ -0,0 +1,44 @@ +//// [moduleAssignmentCompat2.ts] +module A { + export class C { } +} +module B { + export class C { } + export class D { } +} + +var a: A; +var b: B; + +a = b; +b = a; // error + +//// [moduleAssignmentCompat2.js] +var A; +(function (A) { + var C = (function () { + function C() { + } + return C; + })(); + A.C = C; +})(A || (A = {})); +var B; +(function (B) { + var C = (function () { + function C() { + } + return C; + })(); + B.C = C; + var D = (function () { + function D() { + } + return D; + })(); + B.D = D; +})(B || (B = {})); +var a; +var b; +a = b; +b = a; diff --git a/tests/baselines/reference/moduleAssignmentCompat3.errors.txt b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt new file mode 100644 index 0000000000000..c7f5b293da90f --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/moduleAssignmentCompat3.ts (2 errors) ==== + module A { + export var x = 1; + } + module B { + export var x = ""; + } + + var a: A; + ~ +!!! Cannot find name 'A'. + var b: B; + ~ +!!! Cannot find name 'B'. + + // both errors + a = b; + b = a; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat3.js b/tests/baselines/reference/moduleAssignmentCompat3.js new file mode 100644 index 0000000000000..e57119cc44649 --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat3.js @@ -0,0 +1,29 @@ +//// [moduleAssignmentCompat3.ts] +module A { + export var x = 1; +} +module B { + export var x = ""; +} + +var a: A; +var b: B; + +// both errors +a = b; +b = a; + + +//// [moduleAssignmentCompat3.js] +var A; +(function (A) { + A.x = 1; +})(A || (A = {})); +var B; +(function (B) { + B.x = ""; +})(B || (B = {})); +var a; +var b; +a = b; +b = a; diff --git a/tests/baselines/reference/moduleAssignmentCompat4.errors.txt b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt new file mode 100644 index 0000000000000..02b7b9531c823 --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/moduleAssignmentCompat4.ts (2 errors) ==== + module A { + export module M { + class C { } + } + } + module B { + export module M { + export class D { } + } + } + + var a: A; + ~ +!!! Cannot find name 'A'. + var b: B; + ~ +!!! Cannot find name 'B'. + + a = b; + b = a; // error \ No newline at end of file diff --git a/tests/baselines/reference/moduleAssignmentCompat4.js b/tests/baselines/reference/moduleAssignmentCompat4.js new file mode 100644 index 0000000000000..1f349443bf588 --- /dev/null +++ b/tests/baselines/reference/moduleAssignmentCompat4.js @@ -0,0 +1,46 @@ +//// [moduleAssignmentCompat4.ts] +module A { + export module M { + class C { } + } +} +module B { + export module M { + export class D { } + } +} + +var a: A; +var b: B; + +a = b; +b = a; // error + +//// [moduleAssignmentCompat4.js] +var A; +(function (A) { + (function (M) { + var C = (function () { + function C() { + } + return C; + })(); + })(A.M || (A.M = {})); + var M = A.M; +})(A || (A = {})); +var B; +(function (B) { + (function (M) { + var D = (function () { + function D() { + } + return D; + })(); + M.D = D; + })(B.M || (B.M = {})); + var M = B.M; +})(B || (B = {})); +var a; +var b; +a = b; +b = a; diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt new file mode 100644 index 0000000000000..583d88c0b8b29 --- /dev/null +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/moduleClassArrayCodeGenTest.ts (1 errors) ==== + // Invalid code gen for Array of Module class + + module M + { + export class A { } + class B{ } + } + + var t: M.A[] = []; + var t2: M.B[] = []; + ~~~ +!!! Module 'M' has no exported member 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.js b/tests/baselines/reference/moduleClassArrayCodeGenTest.js new file mode 100644 index 0000000000000..69e1017108073 --- /dev/null +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.js @@ -0,0 +1,29 @@ +//// [moduleClassArrayCodeGenTest.ts] +// Invalid code gen for Array of Module class + +module M +{ + export class A { } + class B{ } +} + +var t: M.A[] = []; +var t2: M.B[] = []; + +//// [moduleClassArrayCodeGenTest.js] +var M; +(function (M) { + var A = (function () { + function A() { + } + return A; + })(); + M.A = A; + var B = (function () { + function B() { + } + return B; + })(); +})(M || (M = {})); +var t = []; +var t2 = []; diff --git a/tests/baselines/reference/moduleCodeGenTest3.js b/tests/baselines/reference/moduleCodeGenTest3.js new file mode 100644 index 0000000000000..e48e13e6057df --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest3.js @@ -0,0 +1,11 @@ +//// [moduleCodeGenTest3.ts] +module Baz { export var x = "hello"; } + +Baz.x = "goodbye"; + +//// [moduleCodeGenTest3.js] +var Baz; +(function (Baz) { + Baz.x = "hello"; +})(Baz || (Baz = {})); +Baz.x = "goodbye"; diff --git a/tests/baselines/reference/moduleCodeGenTest5.js b/tests/baselines/reference/moduleCodeGenTest5.js new file mode 100644 index 0000000000000..6f5f0a4e91295 --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest5.js @@ -0,0 +1,58 @@ +//// [moduleCodeGenTest5.ts] +export var x = 0; +var y = 0; + +export function f1() {} +function f2() {} + +export class C1 { + public p1 = 0; + public p2() {} +} +class C2{ + public p1 = 0; + public p2() {} +} + +export enum E1 {A=0} +var u = E1.A; +enum E2 {B=0} +var v = E2.B; + + + +//// [moduleCodeGenTest5.js] +exports.x = 0; +var y = 0; +function f1() { +} +exports.f1 = f1; +function f2() { +} +var C1 = (function () { + function C1() { + this.p1 = 0; + } + C1.prototype.p2 = function () { + }; + return C1; +})(); +exports.C1 = C1; +var C2 = (function () { + function C2() { + this.p1 = 0; + } + C2.prototype.p2 = function () { + }; + return C2; +})(); +(function (E1) { + E1[E1["A"] = 0] = "A"; +})(exports.E1 || (exports.E1 = {})); +var E1 = exports.E1; +var u = 0 /* A */; +var E2; +(function (E2) { + E2[E2["B"] = 0] = "B"; +})(E2 || (E2 = {})); +var v = 0 /* B */; diff --git a/tests/baselines/reference/moduleCodegenTest4.js b/tests/baselines/reference/moduleCodegenTest4.js new file mode 100644 index 0000000000000..1c9c125fef08a --- /dev/null +++ b/tests/baselines/reference/moduleCodegenTest4.js @@ -0,0 +1,13 @@ +//// [moduleCodegenTest4.ts] +export module Baz { export var x = "hello"; } + +Baz.x = "goodbye"; +void 0; + +//// [moduleCodegenTest4.js] +(function (Baz) { + Baz.x = "hello"; +})(exports.Baz || (exports.Baz = {})); +var Baz = exports.Baz; +Baz.x = "goodbye"; +void 0; diff --git a/tests/baselines/reference/moduleCrashBug1.errors.txt b/tests/baselines/reference/moduleCrashBug1.errors.txt new file mode 100644 index 0000000000000..8f25fce0c2017 --- /dev/null +++ b/tests/baselines/reference/moduleCrashBug1.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/moduleCrashBug1.ts (1 errors) ==== + module _modes { + export interface IMode { + + } + + class Mode { + + } + } + + //_modes. // produces an internal error - please implement in derived class + + module editor { + import modes = _modes; + + } + + var m : _modes; + ~~~~~~ +!!! Cannot find name '_modes'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/moduleCrashBug1.js b/tests/baselines/reference/moduleCrashBug1.js new file mode 100644 index 0000000000000..1d8757f2396fe --- /dev/null +++ b/tests/baselines/reference/moduleCrashBug1.js @@ -0,0 +1,33 @@ +//// [moduleCrashBug1.ts] +module _modes { + export interface IMode { + + } + + class Mode { + + } +} + +//_modes. // produces an internal error - please implement in derived class + +module editor { + import modes = _modes; + +} + +var m : _modes; + + + + +//// [moduleCrashBug1.js] +var _modes; +(function (_modes) { + var Mode = (function () { + function Mode() { + } + return Mode; + })(); +})(_modes || (_modes = {})); +var m; diff --git a/tests/baselines/reference/moduleExports1.errors.txt b/tests/baselines/reference/moduleExports1.errors.txt new file mode 100644 index 0000000000000..e890f149c7fdc --- /dev/null +++ b/tests/baselines/reference/moduleExports1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/moduleExports1.ts (2 errors) ==== + export module TypeScript.Strasse.Street { + export class Rue { + public address:string; + } + } + + var rue = new TypeScript.Strasse.Street.Rue(); + + rue.address = "1 Main Street"; + + void 0; + + if (!module.exports) module.exports = ""; + ~~~~~~ +!!! Cannot find name 'module'. + ~~~~~~ +!!! Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleExports1.js b/tests/baselines/reference/moduleExports1.js new file mode 100644 index 0000000000000..8dbfe773271fb --- /dev/null +++ b/tests/baselines/reference/moduleExports1.js @@ -0,0 +1,38 @@ +//// [moduleExports1.ts] +export module TypeScript.Strasse.Street { + export class Rue { + public address:string; + } +} + +var rue = new TypeScript.Strasse.Street.Rue(); + +rue.address = "1 Main Street"; + +void 0; + +if (!module.exports) module.exports = ""; + +//// [moduleExports1.js] +define(["require", "exports"], function (require, exports) { + (function (TypeScript) { + (function (Strasse) { + (function (Street) { + var Rue = (function () { + function Rue() { + } + return Rue; + })(); + Street.Rue = Rue; + })(Strasse.Street || (Strasse.Street = {})); + var Street = Strasse.Street; + })(TypeScript.Strasse || (TypeScript.Strasse = {})); + var Strasse = TypeScript.Strasse; + })(exports.TypeScript || (exports.TypeScript = {})); + var TypeScript = exports.TypeScript; + var rue = new TypeScript.Strasse.Street.Rue(); + rue.address = "1 Main Street"; + void 0; + if (!module.exports) + module.exports = ""; +}); diff --git a/tests/baselines/reference/moduleIdentifiers.js b/tests/baselines/reference/moduleIdentifiers.js new file mode 100644 index 0000000000000..61298825f0483 --- /dev/null +++ b/tests/baselines/reference/moduleIdentifiers.js @@ -0,0 +1,18 @@ +//// [moduleIdentifiers.ts] +module M { + interface P { x: number; y: number; } + export var a = 1 +} + +//var p: M.P; +//var m: M = M; +var x1 = M.a; +//var x2 = m.a; +//var q: m.P; + +//// [moduleIdentifiers.js] +var M; +(function (M) { + M.a = 1; +})(M || (M = {})); +var x1 = M.a; diff --git a/tests/baselines/reference/moduleImport.errors.txt b/tests/baselines/reference/moduleImport.errors.txt new file mode 100644 index 0000000000000..9a4e57bdc0606 --- /dev/null +++ b/tests/baselines/reference/moduleImport.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/moduleImport.ts (1 errors) ==== + module A.B.C { + import XYZ = X.Y.Z; + ~~~~~~~~~~~~~~~~~~~ +!!! Module 'X' has no exported member 'Y'. + export function ping(x: number) { + if (x>0) XYZ.pong (x-1); + } + } + + module X { + import ABC = A.B.C; + export function pong(x: number) { + if (x > 0) ABC.ping(x-1); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleImport.js b/tests/baselines/reference/moduleImport.js new file mode 100644 index 0000000000000..a71b87b73ebb0 --- /dev/null +++ b/tests/baselines/reference/moduleImport.js @@ -0,0 +1,40 @@ +//// [moduleImport.ts] +module A.B.C { + import XYZ = X.Y.Z; + export function ping(x: number) { + if (x>0) XYZ.pong (x-1); + } +} + +module X { + import ABC = A.B.C; + export function pong(x: number) { + if (x > 0) ABC.ping(x-1); + } +} + +//// [moduleImport.js] +var A; +(function (A) { + (function (B) { + (function (C) { + var XYZ = X.Y.Z; + function ping(x) { + if (x > 0) + XYZ.pong(x - 1); + } + C.ping = ping; + })(B.C || (B.C = {})); + var C = B.C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var X; +(function (X) { + var ABC = A.B.C; + function pong(x) { + if (x > 0) + ABC.ping(x - 1); + } + X.pong = pong; +})(X || (X = {})); diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js new file mode 100644 index 0000000000000..62518b7ae0190 --- /dev/null +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/moduleImportedForTypeArgumentPosition.ts] //// + +//// [moduleImportedForTypeArgumentPosition_0.ts] +export interface M2C { } + +//// [moduleImportedForTypeArgumentPosition_1.ts] +/**This is on import declaration*/ +import M2 = require("moduleImportedForTypeArgumentPosition_0"); +class C1{ } +class Test1 extends C1 { +} + + +//// [moduleImportedForTypeArgumentPosition_0.js] +define(["require", "exports"], function (require, exports) { +}); +//// [moduleImportedForTypeArgumentPosition_1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +define(["require", "exports"], function (require, exports) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + var Test1 = (function (_super) { + __extends(Test1, _super); + function Test1() { + _super.apply(this, arguments); + } + return Test1; + })(C1); +}); diff --git a/tests/baselines/reference/moduleInTypePosition1.errors.txt b/tests/baselines/reference/moduleInTypePosition1.errors.txt new file mode 100644 index 0000000000000..7941093c10cc1 --- /dev/null +++ b/tests/baselines/reference/moduleInTypePosition1.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/moduleInTypePosition1_1.ts (1 errors) ==== + /// + import WinJS = require('moduleInTypePosition1_0'); + var x = (w1: WinJS) => { }; + ~~~~~ +!!! Cannot find name 'WinJS'. + +==== tests/cases/compiler/moduleInTypePosition1_0.ts (0 errors) ==== + export class Promise { + foo: string; + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleInTypePosition1.js b/tests/baselines/reference/moduleInTypePosition1.js new file mode 100644 index 0000000000000..92fcd5b16e2b9 --- /dev/null +++ b/tests/baselines/reference/moduleInTypePosition1.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/moduleInTypePosition1.ts] //// + +//// [moduleInTypePosition1_0.ts] +export class Promise { + foo: string; +} + +//// [moduleInTypePosition1_1.ts] +/// +import WinJS = require('moduleInTypePosition1_0'); +var x = (w1: WinJS) => { }; + + +//// [moduleInTypePosition1_0.js] +var Promise = (function () { + function Promise() { + } + return Promise; +})(); +exports.Promise = Promise; +//// [moduleInTypePosition1_1.js] +var x = function (w1) { +}; diff --git a/tests/baselines/reference/moduleKeywordRepeatError.errors.txt b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt new file mode 100644 index 0000000000000..33bb480291ffd --- /dev/null +++ b/tests/baselines/reference/moduleKeywordRepeatError.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/moduleKeywordRepeatError.ts (2 errors) ==== + // "module.module { }" should raise a syntax error + + module.module { } + ~ +!!! ';' expected. + ~~~~~~ +!!! Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js new file mode 100644 index 0000000000000..d2c53003e5f5f --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.js @@ -0,0 +1,118 @@ +//// [moduleMemberWithoutTypeAnnotation1.ts] +module TypeScript.Parser { + class SyntaxCursor { + public currentNode(): SyntaxNode { + return null; + } + } +} + +module TypeScript { + export interface ISyntaxElement { }; + export interface ISyntaxToken { }; + + export class PositionedElement { + public childIndex(child: ISyntaxElement) { + return Syntax.childIndex(); + } + } + + export class PositionedToken { + constructor(parent: PositionedElement, token: ISyntaxToken, fullStart: number) { + } + } +} + +module TypeScript { + export class SyntaxNode { + public findToken(position: number, includeSkippedTokens: boolean = false): PositionedToken { + var positionedToken = this.findTokenInternal(null, position, 0); + return null; + } + findTokenInternal(x, y, z) { + return null; + } + } +} + +module TypeScript.Syntax { + export function childIndex() { } + + export class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { + private findTokenInternal(parent: PositionedElement, position: number, fullStart: number) { + return new PositionedToken(parent, this, fullStart); + } + } +} + + +//// [moduleMemberWithoutTypeAnnotation1.js] +var TypeScript; +(function (TypeScript) { + (function (Parser) { + var SyntaxCursor = (function () { + function SyntaxCursor() { + } + SyntaxCursor.prototype.currentNode = function () { + return null; + }; + return SyntaxCursor; + })(); + })(TypeScript.Parser || (TypeScript.Parser = {})); + var Parser = TypeScript.Parser; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + ; + ; + var PositionedElement = (function () { + function PositionedElement() { + } + PositionedElement.prototype.childIndex = function (child) { + return TypeScript.Syntax.childIndex(); + }; + return PositionedElement; + })(); + TypeScript.PositionedElement = PositionedElement; + var PositionedToken = (function () { + function PositionedToken(parent, token, fullStart) { + } + return PositionedToken; + })(); + TypeScript.PositionedToken = PositionedToken; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var SyntaxNode = (function () { + function SyntaxNode() { + } + SyntaxNode.prototype.findToken = function (position, includeSkippedTokens) { + if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } + var positionedToken = this.findTokenInternal(null, position, 0); + return null; + }; + SyntaxNode.prototype.findTokenInternal = function (x, y, z) { + return null; + }; + return SyntaxNode; + })(); + TypeScript.SyntaxNode = SyntaxNode; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + (function (Syntax) { + function childIndex() { + } + Syntax.childIndex = childIndex; + var VariableWidthTokenWithTrailingTrivia = (function () { + function VariableWidthTokenWithTrailingTrivia() { + } + VariableWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { + return new TypeScript.PositionedToken(parent, this, fullStart); + }; + return VariableWidthTokenWithTrailingTrivia; + })(); + Syntax.VariableWidthTokenWithTrailingTrivia = VariableWidthTokenWithTrailingTrivia; + })(TypeScript.Syntax || (TypeScript.Syntax = {})); + var Syntax = TypeScript.Syntax; +})(TypeScript || (TypeScript = {})); diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.js b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.js new file mode 100644 index 0000000000000..7e2a9a0791a87 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.js @@ -0,0 +1,33 @@ +//// [moduleMemberWithoutTypeAnnotation2.ts] +module TypeScript { + export module CompilerDiagnostics { + + export interface IDiagnosticWriter { + Alert(output: string): void; + } + + export var diagnosticWriter = null; + + export function Alert(output: string) { + if (diagnosticWriter) { + diagnosticWriter.Alert(output); + } + } + } +} + + +//// [moduleMemberWithoutTypeAnnotation2.js] +var TypeScript; +(function (TypeScript) { + (function (CompilerDiagnostics) { + CompilerDiagnostics.diagnosticWriter = null; + function Alert(output) { + if (CompilerDiagnostics.diagnosticWriter) { + CompilerDiagnostics.diagnosticWriter.Alert(output); + } + } + CompilerDiagnostics.Alert = Alert; + })(TypeScript.CompilerDiagnostics || (TypeScript.CompilerDiagnostics = {})); + var CompilerDiagnostics = TypeScript.CompilerDiagnostics; +})(TypeScript || (TypeScript = {})); diff --git a/tests/baselines/reference/moduleMerge.js b/tests/baselines/reference/moduleMerge.js new file mode 100644 index 0000000000000..e939230daefcc --- /dev/null +++ b/tests/baselines/reference/moduleMerge.js @@ -0,0 +1,49 @@ +//// [moduleMerge.ts] +// This should not compile both B classes are in the same module this should be a collission + +module A +{ + class B + { + public Hello(): string + { + return "from private B"; + } + } +} + +module A +{ + export class B + { + public Hello(): string + { + return "from export B"; + } + } +} + +//// [moduleMerge.js] +var A; +(function (A) { + var B = (function () { + function B() { + } + B.prototype.Hello = function () { + return "from private B"; + }; + return B; + })(); +})(A || (A = {})); +var A; +(function (A) { + var B = (function () { + function B() { + } + B.prototype.Hello = function () { + return "from export B"; + }; + return B; + })(); + A.B = B; +})(A || (A = {})); diff --git a/tests/baselines/reference/moduleNewExportBug.errors.txt b/tests/baselines/reference/moduleNewExportBug.errors.txt new file mode 100644 index 0000000000000..dd89b135bdd34 --- /dev/null +++ b/tests/baselines/reference/moduleNewExportBug.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/moduleNewExportBug.ts (1 errors) ==== + module mod1 { + interface mInt { + new (bar:any):any; + foo (bar:any):any; + } + + class C { public moo() {}} + } + + var c : mod1.C; // ERROR: C should not be visible + ~~~~~~ +!!! Module 'mod1' has no exported member 'C'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/moduleNewExportBug.js b/tests/baselines/reference/moduleNewExportBug.js new file mode 100644 index 0000000000000..4fbc9e0ad25c6 --- /dev/null +++ b/tests/baselines/reference/moduleNewExportBug.js @@ -0,0 +1,27 @@ +//// [moduleNewExportBug.ts] +module mod1 { + interface mInt { + new (bar:any):any; + foo (bar:any):any; + } + + class C { public moo() {}} +} + +var c : mod1.C; // ERROR: C should not be visible + + + + +//// [moduleNewExportBug.js] +var mod1; +(function (mod1) { + var C = (function () { + function C() { + } + C.prototype.moo = function () { + }; + return C; + })(); +})(mod1 || (mod1 = {})); +var c; diff --git a/tests/baselines/reference/moduleNoEmit.js b/tests/baselines/reference/moduleNoEmit.js new file mode 100644 index 0000000000000..a298efd13aac0 --- /dev/null +++ b/tests/baselines/reference/moduleNoEmit.js @@ -0,0 +1,10 @@ +//// [moduleNoEmit.ts] +module Foo { + 1+1; +} + +//// [moduleNoEmit.js] +var Foo; +(function (Foo) { + 1 + 1; +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/moduleOuterQualification.js b/tests/baselines/reference/moduleOuterQualification.js new file mode 100644 index 0000000000000..b80f8388ae02a --- /dev/null +++ b/tests/baselines/reference/moduleOuterQualification.js @@ -0,0 +1,15 @@ +//// [moduleOuterQualification.ts] + +declare module outer { + interface Beta { } + module inner { + // .d.ts emit: should be 'extends outer.Beta' + export interface Beta extends outer.Beta { } + } +} + + +//// [moduleOuterQualification.js] + + +//// [moduleOuterQualification.d.ts] diff --git a/tests/baselines/reference/moduleProperty1.errors.txt b/tests/baselines/reference/moduleProperty1.errors.txt new file mode 100644 index 0000000000000..00ff0248b3fe3 --- /dev/null +++ b/tests/baselines/reference/moduleProperty1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/moduleProperty1.ts (3 errors) ==== + module M { + var x=10; // variable local to this module body + var y=x; // property visible only in module + export var z=y; // property visible to any code + } + + module M2 { + var x = 10; // variable local to this module body + private y = x; // can't use private in modules + ~~~~~~~ +!!! Declaration or statement expected. + ~ +!!! Cannot find name 'y'. + export var z = y; // property visible to any code + ~ +!!! Cannot find name 'y'. + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleProperty2.errors.txt b/tests/baselines/reference/moduleProperty2.errors.txt new file mode 100644 index 0000000000000..8b658f7692ad3 --- /dev/null +++ b/tests/baselines/reference/moduleProperty2.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/moduleProperty2.ts (2 errors) ==== + module M { + function f() { + var x; + } + var y; + export var z; + var test1=x; + ~ +!!! Cannot find name 'x'. + var test2=y; // y visible because same module + } + + module N { + var test3=M.y; // nope y private property of M + ~ +!!! Property 'y' does not exist on type 'typeof M'. + var test4=M.z; // ok public property of M + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleProperty2.js b/tests/baselines/reference/moduleProperty2.js new file mode 100644 index 0000000000000..d8027d8d67b06 --- /dev/null +++ b/tests/baselines/reference/moduleProperty2.js @@ -0,0 +1,32 @@ +//// [moduleProperty2.ts] +module M { + function f() { + var x; + } + var y; + export var z; + var test1=x; + var test2=y; // y visible because same module +} + +module N { + var test3=M.y; // nope y private property of M + var test4=M.z; // ok public property of M +} + +//// [moduleProperty2.js] +var M; +(function (M) { + function f() { + var x; + } + var y; + M.z; + var test1 = x; + var test2 = y; +})(M || (M = {})); +var N; +(function (N) { + var test3 = M.y; + var test4 = M.z; +})(N || (N = {})); diff --git a/tests/baselines/reference/moduleRedifinitionErrors.js b/tests/baselines/reference/moduleRedifinitionErrors.js new file mode 100644 index 0000000000000..1271463214642 --- /dev/null +++ b/tests/baselines/reference/moduleRedifinitionErrors.js @@ -0,0 +1,13 @@ +//// [moduleRedifinitionErrors.ts] +class A { +} +module A { +} + + +//// [moduleRedifinitionErrors.js] +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.js b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js new file mode 100644 index 0000000000000..d2dc938872a39 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.js @@ -0,0 +1,32 @@ +//// [moduleReopenedTypeOtherBlock.ts] +module M { + export class C1 { } + export interface I { n: number; } +} +module M { + export class C2 { f(): I { return null; } } +} + + +//// [moduleReopenedTypeOtherBlock.js] +var M; +(function (M) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + M.C1 = C1; +})(M || (M = {})); +var M; +(function (M) { + var C2 = (function () { + function C2() { + } + C2.prototype.f = function () { + return null; + }; + return C2; + })(); + M.C2 = C2; +})(M || (M = {})); diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.js b/tests/baselines/reference/moduleReopenedTypeSameBlock.js new file mode 100644 index 0000000000000..c3546f20b2f9e --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.js @@ -0,0 +1,30 @@ +//// [moduleReopenedTypeSameBlock.ts] +module M { export class C1 { } } +module M { + export interface I { n: number; } + export class C2 { f(): I { return null; } } +} + + +//// [moduleReopenedTypeSameBlock.js] +var M; +(function (M) { + var C1 = (function () { + function C1() { + } + return C1; + })(); + M.C1 = C1; +})(M || (M = {})); +var M; +(function (M) { + var C2 = (function () { + function C2() { + } + C2.prototype.f = function () { + return null; + }; + return C2; + })(); + M.C2 = C2; +})(M || (M = {})); diff --git a/tests/baselines/reference/moduleScoping.errors.txt b/tests/baselines/reference/moduleScoping.errors.txt new file mode 100644 index 0000000000000..d80f82e9443fe --- /dev/null +++ b/tests/baselines/reference/moduleScoping.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/conformance/externalModules/file1.ts (0 errors) ==== + var v1 = "sausages"; // Global scope + +==== tests/cases/conformance/externalModules/file2.ts (0 errors) ==== + var v2 = 42; // Global scope + var v4 = () => 5; + +==== tests/cases/conformance/externalModules/file3.ts (1 errors) ==== + export var v3 = true; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + var v2 = [1,2,3]; // Module scope. Should not appear in global scope + +==== tests/cases/conformance/externalModules/file4.ts (0 errors) ==== + import file3 = require('./file3'); + var t1 = v1; + var t2 = v2; + var t3 = file3.v3; + var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module + +==== tests/cases/conformance/externalModules/file5.ts (0 errors) ==== + var x = v2; // Should be global v2 of type number again + \ No newline at end of file diff --git a/tests/baselines/reference/moduleScoping.js b/tests/baselines/reference/moduleScoping.js new file mode 100644 index 0000000000000..49431acaecefe --- /dev/null +++ b/tests/baselines/reference/moduleScoping.js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/externalModules/moduleScoping.ts] //// + +//// [file1.ts] +var v1 = "sausages"; // Global scope + +//// [file2.ts] +var v2 = 42; // Global scope +var v4 = () => 5; + +//// [file3.ts] +export var v3 = true; +var v2 = [1,2,3]; // Module scope. Should not appear in global scope + +//// [file4.ts] +import file3 = require('./file3'); +var t1 = v1; +var t2 = v2; +var t3 = file3.v3; +var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module + +//// [file5.ts] +var x = v2; // Should be global v2 of type number again + + +//// [file1.js] +var v1 = "sausages"; +//// [file2.js] +var v2 = 42; +var v4 = function () { return 5; }; +//// [file3.js] +exports.v3 = true; +var v2 = [1, 2, 3]; +//// [file4.js] +var file3 = require('./file3'); +var t1 = v1; +var t2 = v2; +var t3 = file3.v3; +var v4 = { a: true, b: NaN }; +//// [file5.js] +var x = v2; diff --git a/tests/baselines/reference/moduleScopingBug.js b/tests/baselines/reference/moduleScopingBug.js new file mode 100644 index 0000000000000..45ac72055a4bb --- /dev/null +++ b/tests/baselines/reference/moduleScopingBug.js @@ -0,0 +1,49 @@ +//// [moduleScopingBug.ts] +module M + +{ + + var outer: number; + + function f() { + + var inner = outer; // Ok + + } + + class C { + + constructor() { + var inner = outer; // Ok + } + + } + + module X { + + var inner = outer; // Error: outer not visible + + } + +} + + + +//// [moduleScopingBug.js] +var M; +(function (M) { + var outer; + function f() { + var inner = outer; + } + var C = (function () { + function C() { + var inner = outer; + } + return C; + })(); + var X; + (function (X) { + var inner = outer; + })(X || (X = {})); +})(M || (M = {})); diff --git a/tests/baselines/reference/moduleUnassignedVariable.js b/tests/baselines/reference/moduleUnassignedVariable.js new file mode 100644 index 0000000000000..8a6866c387787 --- /dev/null +++ b/tests/baselines/reference/moduleUnassignedVariable.js @@ -0,0 +1,22 @@ +//// [moduleUnassignedVariable.ts] +module Bar { + export var a = 1; + function fooA() { return a; } // Correct: return Bar.a + + export var b; + function fooB() { return b; } // Incorrect: return b +} + + +//// [moduleUnassignedVariable.js] +var Bar; +(function (Bar) { + Bar.a = 1; + function fooA() { + return Bar.a; + } + Bar.b; + function fooB() { + return Bar.b; + } +})(Bar || (Bar = {})); diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.js b/tests/baselines/reference/moduleVariableArrayIndexer.js new file mode 100644 index 0000000000000..47a2ba5158f9b --- /dev/null +++ b/tests/baselines/reference/moduleVariableArrayIndexer.js @@ -0,0 +1,13 @@ +//// [moduleVariableArrayIndexer.ts] +module Bar { + export var a = 1; + var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; +} + + +//// [moduleVariableArrayIndexer.js] +var Bar; +(function (Bar) { + Bar.a = 1; + var t = undefined[Bar.a][Bar.a]; +})(Bar || (Bar = {})); diff --git a/tests/baselines/reference/moduleVariables.js b/tests/baselines/reference/moduleVariables.js new file mode 100644 index 0000000000000..428c48038903f --- /dev/null +++ b/tests/baselines/reference/moduleVariables.js @@ -0,0 +1,35 @@ +//// [moduleVariables.ts] +declare var console: any; + +var x = 1; +module M { + export var x = 2; + console.log(x); // 2 +} + +module M { + console.log(x); // 2 +} + +module M { + var x = 3; + console.log(x); // 3 +} + + +//// [moduleVariables.js] +var x = 1; +var M; +(function (M) { + M.x = 2; + console.log(M.x); +})(M || (M = {})); +var M; +(function (M) { + console.log(M.x); +})(M || (M = {})); +var M; +(function (M) { + var x = 3; + console.log(x); +})(M || (M = {})); diff --git a/tests/baselines/reference/moduleVisibilityTest1.js b/tests/baselines/reference/moduleVisibilityTest1.js new file mode 100644 index 0000000000000..b9a9649002da4 --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest1.js @@ -0,0 +1,147 @@ +//// [moduleVisibilityTest1.ts] + + +module OuterMod { + export function someExportedOuterFunc() { return -1; } + + export module OuterInnerMod { + export function someExportedOuterInnerFunc() { return "foo"; } + } +} + +import OuterInnerAlias = OuterMod.OuterInnerMod; + +module M { + + export module InnerMod { + export function someExportedInnerFunc() { return -2; } + } + + export enum E { + A, + B, + C, + } + + export var x = 5; + export declare var exported_var; + + var y = x + x; + + + export interface I { + someMethod():number; + } + + class B {public b = 0;} + + export class C implements I { + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} + public someMethod() { return 0; } + public someProp = 1; + + constructor() { + function someInnerFunc() { return 2; } + var someInnerVar = 3; + } + } + + var someModuleVar = 4; + + function someModuleFunction() { return 5;} +} + +module M { + export var c = x; + export var meb = M.E.B; +} + +var cprime : M.I = null; + +var c = new M.C(); +var z = M.x; +var alpha = M.E.A; +var omega = M.exported_var; +c.someMethodThatCallsAnOuterMethod(); + + +//// [moduleVisibilityTest1.js] +var OuterMod; +(function (OuterMod) { + function someExportedOuterFunc() { + return -1; + } + OuterMod.someExportedOuterFunc = someExportedOuterFunc; + (function (OuterInnerMod) { + function someExportedOuterInnerFunc() { + return "foo"; + } + OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; + })(OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); + var OuterInnerMod = OuterMod.OuterInnerMod; +})(OuterMod || (OuterMod = {})); +var OuterInnerAlias = OuterMod.OuterInnerMod; +var M; +(function (M) { + (function (InnerMod) { + function someExportedInnerFunc() { + return -2; + } + InnerMod.someExportedInnerFunc = someExportedInnerFunc; + })(M.InnerMod || (M.InnerMod = {})); + var InnerMod = M.InnerMod; + (function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; + })(M.E || (M.E = {})); + var E = M.E; + M.x = 5; + var y = M.x + M.x; + var B = (function () { + function B() { + this.b = 0; + } + return B; + })(); + var C = (function () { + function C() { + this.someProp = 1; + function someInnerFunc() { + return 2; + } + var someInnerVar = 3; + } + C.prototype.someMethodThatCallsAnOuterMethod = function () { + return OuterInnerAlias.someExportedOuterInnerFunc(); + }; + C.prototype.someMethodThatCallsAnInnerMethod = function () { + return InnerMod.someExportedInnerFunc(); + }; + C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { + return OuterMod.someExportedOuterFunc(); + }; + C.prototype.someMethod = function () { + return 0; + }; + return C; + })(); + M.C = C; + var someModuleVar = 4; + function someModuleFunction() { + return 5; + } +})(M || (M = {})); +var M; +(function (M) { + M.c = M.x; + M.meb = 1 /* B */; +})(M || (M = {})); +var cprime = null; +var c = new M.C(); +var z = M.x; +var alpha = 0 /* A */; +var omega = M.exported_var; +c.someMethodThatCallsAnOuterMethod(); diff --git a/tests/baselines/reference/moduleVisibilityTest2.errors.txt b/tests/baselines/reference/moduleVisibilityTest2.errors.txt new file mode 100644 index 0000000000000..bed0b43505b6c --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest2.errors.txt @@ -0,0 +1,81 @@ +==== tests/cases/compiler/moduleVisibilityTest2.ts (6 errors) ==== + + + module OuterMod { + export function someExportedOuterFunc() { return -1; } + + export module OuterInnerMod { + export function someExportedOuterInnerFunc() { return "foo"; } + } + } + + import OuterInnerAlias = OuterMod.OuterInnerMod; + + module M { + + module InnerMod { + export function someExportedInnerFunc() { return -2; } + } + + enum E { + A, + B, + C, + } + + var x = 5; + export declare var exported_var; + + var y = x + x; + + + interface I { + someMethod():number; + } + + class B {public b = 0;} + + export class C implements I { + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} + public someMethod() { return 0; } + public someProp = 1; + + constructor() { + function someInnerFunc() { return 2; } + var someInnerVar = 3; + } + + } + + var someModuleVar = 4; + + function someModuleFunction() { return 5;} + } + + module M { + export var c = x; + ~ +!!! Cannot find name 'x'. + export var meb = M.E.B; + ~ +!!! Property 'E' does not exist on type 'typeof M'. + } + + var cprime : M.I = null; + ~~~ +!!! Module 'M' has no exported member 'I'. + ~~~ +!!! Module 'M' has no exported member 'I'. + + var c = new M.C(); + var z = M.x; + ~ +!!! Property 'x' does not exist on type 'typeof M'. + var alpha = M.E.A; + ~ +!!! Property 'E' does not exist on type 'typeof M'. + var omega = M.exported_var; + c.someMethodThatCallsAnOuterMethod(); + \ No newline at end of file diff --git a/tests/baselines/reference/moduleVisibilityTest2.js b/tests/baselines/reference/moduleVisibilityTest2.js new file mode 100644 index 0000000000000..90de82ed6806a --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest2.js @@ -0,0 +1,148 @@ +//// [moduleVisibilityTest2.ts] + + +module OuterMod { + export function someExportedOuterFunc() { return -1; } + + export module OuterInnerMod { + export function someExportedOuterInnerFunc() { return "foo"; } + } +} + +import OuterInnerAlias = OuterMod.OuterInnerMod; + +module M { + + module InnerMod { + export function someExportedInnerFunc() { return -2; } + } + + enum E { + A, + B, + C, + } + + var x = 5; + export declare var exported_var; + + var y = x + x; + + + interface I { + someMethod():number; + } + + class B {public b = 0;} + + export class C implements I { + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} + public someMethod() { return 0; } + public someProp = 1; + + constructor() { + function someInnerFunc() { return 2; } + var someInnerVar = 3; + } + + } + + var someModuleVar = 4; + + function someModuleFunction() { return 5;} +} + +module M { + export var c = x; + export var meb = M.E.B; +} + +var cprime : M.I = null; + +var c = new M.C(); +var z = M.x; +var alpha = M.E.A; +var omega = M.exported_var; +c.someMethodThatCallsAnOuterMethod(); + + +//// [moduleVisibilityTest2.js] +var OuterMod; +(function (OuterMod) { + function someExportedOuterFunc() { + return -1; + } + OuterMod.someExportedOuterFunc = someExportedOuterFunc; + (function (OuterInnerMod) { + function someExportedOuterInnerFunc() { + return "foo"; + } + OuterInnerMod.someExportedOuterInnerFunc = someExportedOuterInnerFunc; + })(OuterMod.OuterInnerMod || (OuterMod.OuterInnerMod = {})); + var OuterInnerMod = OuterMod.OuterInnerMod; +})(OuterMod || (OuterMod = {})); +var OuterInnerAlias = OuterMod.OuterInnerMod; +var M; +(function (M) { + var InnerMod; + (function (InnerMod) { + function someExportedInnerFunc() { + return -2; + } + InnerMod.someExportedInnerFunc = someExportedInnerFunc; + })(InnerMod || (InnerMod = {})); + var E; + (function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; + })(E || (E = {})); + var x = 5; + var y = x + x; + var B = (function () { + function B() { + this.b = 0; + } + return B; + })(); + var C = (function () { + function C() { + this.someProp = 1; + function someInnerFunc() { + return 2; + } + var someInnerVar = 3; + } + C.prototype.someMethodThatCallsAnOuterMethod = function () { + return OuterInnerAlias.someExportedOuterInnerFunc(); + }; + C.prototype.someMethodThatCallsAnInnerMethod = function () { + return InnerMod.someExportedInnerFunc(); + }; + C.prototype.someMethodThatCallsAnOuterInnerMethod = function () { + return OuterMod.someExportedOuterFunc(); + }; + C.prototype.someMethod = function () { + return 0; + }; + return C; + })(); + M.C = C; + var someModuleVar = 4; + function someModuleFunction() { + return 5; + } +})(M || (M = {})); +var M; +(function (M) { + M.c = x; + M.meb = M.E.B; +})(M || (M = {})); +var cprime = null; +var c = new M.C(); +var z = M.x; +var alpha = M.E.A; +var omega = M.exported_var; +c.someMethodThatCallsAnOuterMethod(); diff --git a/tests/baselines/reference/moduleVisibilityTest3.errors.txt b/tests/baselines/reference/moduleVisibilityTest3.errors.txt new file mode 100644 index 0000000000000..d13c597d6ce31 --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest3.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/moduleVisibilityTest3.ts (3 errors) ==== + module _modes { + export interface IMode { + + } + + class Mode { + + } + } + + //_modes. // produces an internal error - please implement in derived class + + module editor { + import modes = _modes; + + var i : modes.IMode; + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { + constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported + ~~~~~ +!!! Cannot find name 'modes'. + ~~~~~~~~~~ +!!! Module '_modes' has no exported member 'Mode'. + var x:modes.Mode; + ~~~~~~~~~~ +!!! Module '_modes' has no exported member 'Mode'. + } + + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleVisibilityTest3.js b/tests/baselines/reference/moduleVisibilityTest3.js new file mode 100644 index 0000000000000..57743b9df2415 --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest3.js @@ -0,0 +1,47 @@ +//// [moduleVisibilityTest3.ts] +module _modes { + export interface IMode { + + } + + class Mode { + + } +} + +//_modes. // produces an internal error - please implement in derived class + +module editor { + import modes = _modes; + + var i : modes.IMode; + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { + constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported + var x:modes.Mode; + } + + } +} + + +//// [moduleVisibilityTest3.js] +var _modes; +(function (_modes) { + var Mode = (function () { + function Mode() { + } + return Mode; + })(); +})(_modes || (_modes = {})); +var editor; +(function (editor) { + var i; + var Bug = (function () { + function Bug(p1, p2) { + var x; + } + return Bug; + })(); +})(editor || (editor = {})); diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt new file mode 100644 index 0000000000000..e22bdb1c7f2bd --- /dev/null +++ b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/moduleWithNoValuesAsType.ts (3 errors) ==== + module A { } + var a: A; // error + ~ +!!! Cannot find name 'A'. + + module B { + interface I {} + } + var b: B; // error + ~ +!!! Cannot find name 'B'. + + module C { + module M { + interface I {} + } + } + + var c: C; // error + ~ +!!! Cannot find name 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.js b/tests/baselines/reference/moduleWithNoValuesAsType.js new file mode 100644 index 0000000000000..eeeabf23c7186 --- /dev/null +++ b/tests/baselines/reference/moduleWithNoValuesAsType.js @@ -0,0 +1,21 @@ +//// [moduleWithNoValuesAsType.ts] +module A { } +var a: A; // error + +module B { + interface I {} +} +var b: B; // error + +module C { + module M { + interface I {} + } +} + +var c: C; // error + +//// [moduleWithNoValuesAsType.js] +var a; +var b; +var c; diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js new file mode 100644 index 0000000000000..d3d320b376f7b --- /dev/null +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -0,0 +1,162 @@ +//// [moduleWithStatementsOfEveryKind.ts] +module A { + class A { s: string } + class AA { s: T } + interface I { id: number } + + class B extends AA implements I { id: number } + class BB extends A { + id: number; + } + + module Module { + class A { s: string } + } + enum Color { Blue, Red } + var x = 12; + function F(s: string): number { + return 2; + } + var array: I[] = null; + var fn = (s: string) => { + return 'hello ' + s; + } + var ol = { s: 'hello', id: 2, isvalid: true }; +} + +module Y { + export class A { s: string } + export class AA { s: T } + export interface I { id: number } + + export class B extends AA implements I { id: number } + export class BB extends A { + id: number; + } + + export module Module { + class A { s: string } + } + export enum Color { Blue, Red } + export var x = 12; + export function F(s: string): number { + return 2; + } + export var array: I[] = null; + export var fn = (s: string) => { + return 'hello ' + s; + } + export var ol = { s: 'hello', id: 2, isvalid: true }; +} + + +//// [moduleWithStatementsOfEveryKind.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A; +(function (A) { + var A = (function () { + function A() { + } + return A; + })(); + var AA = (function () { + function AA() { + } + return AA; + })(); + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(AA); + var BB = (function (_super) { + __extends(BB, _super); + function BB() { + _super.apply(this, arguments); + } + return BB; + })(A); + var Module; + (function (Module) { + var A = (function () { + function A() { + } + return A; + })(); + })(Module || (Module = {})); + var Color; + (function (Color) { + Color[Color["Blue"] = 0] = "Blue"; + Color[Color["Red"] = 1] = "Red"; + })(Color || (Color = {})); + var x = 12; + function F(s) { + return 2; + } + var array = null; + var fn = function (s) { + return 'hello ' + s; + }; + var ol = { s: 'hello', id: 2, isvalid: true }; +})(A || (A = {})); +var Y; +(function (Y) { + var A = (function () { + function A() { + } + return A; + })(); + Y.A = A; + var AA = (function () { + function AA() { + } + return AA; + })(); + Y.AA = AA; + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(AA); + Y.B = B; + var BB = (function (_super) { + __extends(BB, _super); + function BB() { + _super.apply(this, arguments); + } + return BB; + })(A); + Y.BB = BB; + (function (Module) { + var A = (function () { + function A() { + } + return A; + })(); + })(Y.Module || (Y.Module = {})); + var Module = Y.Module; + (function (Color) { + Color[Color["Blue"] = 0] = "Blue"; + Color[Color["Red"] = 1] = "Red"; + })(Y.Color || (Y.Color = {})); + var Color = Y.Color; + Y.x = 12; + function F(s) { + return 2; + } + Y.F = F; + Y.array = null; + Y.fn = function (s) { + return 'hello ' + s; + }; + Y.ol = { s: 'hello', id: 2, isvalid: true }; +})(Y || (Y = {})); diff --git a/tests/baselines/reference/moduleWithTryStatement1.js b/tests/baselines/reference/moduleWithTryStatement1.js new file mode 100644 index 0000000000000..9b3f43dc36a72 --- /dev/null +++ b/tests/baselines/reference/moduleWithTryStatement1.js @@ -0,0 +1,19 @@ +//// [moduleWithTryStatement1.ts] +module M { + try { + } + catch (e) { + } +} +var v = M; + + +//// [moduleWithTryStatement1.js] +var M; +(function (M) { + try { + } + catch (e) { + } +})(M || (M = {})); +var v = M; diff --git a/tests/baselines/reference/moduleWithValuesAsType.errors.txt b/tests/baselines/reference/moduleWithValuesAsType.errors.txt new file mode 100644 index 0000000000000..cf496f76627ec --- /dev/null +++ b/tests/baselines/reference/moduleWithValuesAsType.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/moduleWithValuesAsType.ts (1 errors) ==== + module A { + var b = 1; + } + + var a: A; // no error + ~ +!!! Cannot find name 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithValuesAsType.js b/tests/baselines/reference/moduleWithValuesAsType.js new file mode 100644 index 0000000000000..ed1dc3d548787 --- /dev/null +++ b/tests/baselines/reference/moduleWithValuesAsType.js @@ -0,0 +1,13 @@ +//// [moduleWithValuesAsType.ts] +module A { + var b = 1; +} + +var a: A; // no error + +//// [moduleWithValuesAsType.js] +var A; +(function (A) { + var b = 1; +})(A || (A = {})); +var a; diff --git a/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt new file mode 100644 index 0000000000000..c2abe8fc6b90c --- /dev/null +++ b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/module_augmentExistingAmbientVariable.ts (1 errors) ==== + declare var console: any; + + module console { + ~~~~~~~ +!!! Duplicate identifier 'console'. + export var x = 2; + } \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentExistingAmbientVariable.js b/tests/baselines/reference/module_augmentExistingAmbientVariable.js new file mode 100644 index 0000000000000..99e5a1ddfa304 --- /dev/null +++ b/tests/baselines/reference/module_augmentExistingAmbientVariable.js @@ -0,0 +1,12 @@ +//// [module_augmentExistingAmbientVariable.ts] +declare var console: any; + +module console { + export var x = 2; +} + +//// [module_augmentExistingAmbientVariable.js] +var console; +(function (console) { + console.x = 2; +})(console || (console = {})); diff --git a/tests/baselines/reference/module_augmentExistingVariable.errors.txt b/tests/baselines/reference/module_augmentExistingVariable.errors.txt new file mode 100644 index 0000000000000..25bd8b843fad0 --- /dev/null +++ b/tests/baselines/reference/module_augmentExistingVariable.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/module_augmentExistingVariable.ts (1 errors) ==== + var console: any; + + module console { + ~~~~~~~ +!!! Duplicate identifier 'console'. + export var x = 2; + } \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentExistingVariable.js b/tests/baselines/reference/module_augmentExistingVariable.js new file mode 100644 index 0000000000000..ac320428e410e --- /dev/null +++ b/tests/baselines/reference/module_augmentExistingVariable.js @@ -0,0 +1,13 @@ +//// [module_augmentExistingVariable.ts] +var console: any; + +module console { + export var x = 2; +} + +//// [module_augmentExistingVariable.js] +var console; +var console; +(function (console) { + console.x = 2; +})(console || (console = {})); diff --git a/tests/baselines/reference/moduledecl.errors.txt b/tests/baselines/reference/moduledecl.errors.txt new file mode 100644 index 0000000000000..927f143183e4a --- /dev/null +++ b/tests/baselines/reference/moduledecl.errors.txt @@ -0,0 +1,237 @@ +==== tests/cases/compiler/moduledecl.ts (2 errors) ==== + module a { + } + + module b.a { + } + + module c.a.b { + import ma = a; + } + + module mImport { + import d = a; + import e = b.a; + import d1 = a; + import e1 = b.a; + } + + module m0 { + function f1() { + } + + function f2(s: string); + function f2(n: number); + function f2(ns: any) { + } + + class c1 { + public a : ()=>string; + private b: ()=>number; + private static s1; + public static s2; + } + + interface i1 { + () : Object; + [n: number]: c1; + } + + import m2 = a; + import m3 = b; + import m4 = b.a; + import m5 = c; + import m6 = c.a; + import m7 = c.a.b; + } + + module m1 { + export function f1() { + } + + export function f2(s: string); + export function f2(n: number); + export function f2(ns: any) { + } + + export class c1 { + public a: () =>string; + private b: () =>number; + private static s1; + public static s2; + + public d() { + return "Hello"; + } + + public e: { x: number; y: string; }; + constructor (public n, public n2: number, private n3, private n4: string) { + } + } + + export interface i1 { + () : Object; + [n: number]: c1; + } + + import m2 = a; + import m3 = b; + import m4 = b.a; + import m5 = c; + import m6 = c.a; + import m7 = c.a.b; + } + + module m { + export module m2 { + var a = 10; + export var b: number; + } + + export module m3 { + export var c: number; + } + } + + module m { + + export module m25 { + export module m5 { + export var c: number; + } + } + } + + module m13 { + export module m4 { + export module m2 { + export module m3 { + export var c: number; + } + } + + export function f() { + return 20; + } + } + } + + declare module m4 { + export var b; + } + + declare module m5 { + export var c; + } + + declare module m43 { + export var b; + } + + declare module m55 { + export var c; + } + + declare module "m3" { + export var b: number; + } + + module exportTests { + export class C1_public { + private f2() { + return 30; + } + + public f3() { + return "string"; + } + } + class C2_private { + private f2() { + return 30; + } + + public f3() { + return "string"; + } + } + + export class C3_public { + private getC2_private() { + return new C2_private(); + } + private setC2_private(arg: C2_private) { + } + private get c2() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + public getC1_public() { + return new C1_public(); + } + public setC1_public(arg: C1_public) { + } + public get c1() { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + } + } + + declare module mAmbient { + class C { + public myProp: number; + } + + function foo() : C; + var aVar: C; + interface B { + x: number; + y: C; + } + enum e { + x, + y, + z + } + + module m3 { + class C { + public myProp: number; + } + + function foo(): C; + var aVar: C; + interface B { + x: number; + y: C; + } + enum e { + x, + y, + z + } + } + } + + function foo() { + return mAmbient.foo(); + } + + var cVar = new mAmbient.C(); + var aVar = mAmbient.aVar; + var bB: mAmbient.B; + var eVar: mAmbient.e; + + function m3foo() { + return mAmbient.m3.foo(); + } + + var m3cVar = new mAmbient.m3.C(); + var m3aVar = mAmbient.m3.aVar; + var m3bB: mAmbient.m3.B; + var m3eVar: mAmbient.m3.e; + + \ No newline at end of file diff --git a/tests/baselines/reference/multiCallOverloads.js b/tests/baselines/reference/multiCallOverloads.js new file mode 100644 index 0000000000000..94edef40bd53d --- /dev/null +++ b/tests/baselines/reference/multiCallOverloads.js @@ -0,0 +1,28 @@ +//// [multiCallOverloads.ts] +interface ICallback { + (x?: string):void; +} + +function load(f: ICallback) {} + +var f1: ICallback = function(z?) {} +var f2: ICallback = function(z?) {} +load(f1) // ok +load(f2) // ok +load(function() {}) // this shouldn’t be an error +load(function(z?) {}) // this shouldn't be an error + + +//// [multiCallOverloads.js] +function load(f) { +} +var f1 = function (z) { +}; +var f2 = function (z) { +}; +load(f1); +load(f2); +load(function () { +}); +load(function (z) { +}); diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt b/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt new file mode 100644 index 0000000000000..b412d2ea4486a --- /dev/null +++ b/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/multiExtendsSplitInterfaces1.ts (1 errors) ==== + self.cancelAnimationFrame(0); + ~~~~ +!!! Cannot find name 'self'. \ No newline at end of file diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.js b/tests/baselines/reference/multiExtendsSplitInterfaces1.js new file mode 100644 index 0000000000000..6dc619d89dc45 --- /dev/null +++ b/tests/baselines/reference/multiExtendsSplitInterfaces1.js @@ -0,0 +1,5 @@ +//// [multiExtendsSplitInterfaces1.ts] +self.cancelAnimationFrame(0); + +//// [multiExtendsSplitInterfaces1.js] +self.cancelAnimationFrame(0); diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces2.js b/tests/baselines/reference/multiExtendsSplitInterfaces2.js new file mode 100644 index 0000000000000..0d91d2ae2cd39 --- /dev/null +++ b/tests/baselines/reference/multiExtendsSplitInterfaces2.js @@ -0,0 +1,30 @@ +//// [multiExtendsSplitInterfaces2.ts] +interface A { + a: number; +} + +interface I extends A { + i1: number; +} + +interface B { + b: number; +} + +interface I extends B { + i2: number; +} + +var i: I; + +var a = i.a; +var i1 = i.i1; +var b = i.b; +var i2 = i.i2; + +//// [multiExtendsSplitInterfaces2.js] +var i; +var a = i.a; +var i1 = i.i1; +var b = i.b; +var i2 = i.i2; diff --git a/tests/baselines/reference/multiImportExport.errors.txt b/tests/baselines/reference/multiImportExport.errors.txt new file mode 100644 index 0000000000000..6237131d641ef --- /dev/null +++ b/tests/baselines/reference/multiImportExport.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/consumer.ts (0 errors) ==== + import Drawing = require('./Drawing'); + var addr = new Drawing.Math.Adder(); + +==== tests/cases/compiler/Drawing.ts (0 errors) ==== + export import Math = require('Math/Math') + +==== tests/cases/compiler/Math/Math.ts (0 errors) ==== + import Adder = require('Math/Adder'); + + var Math = { + Adder:Adder + }; + + export = Math + +==== tests/cases/compiler/Math/Adder.ts (1 errors) ==== + class Adder { + add(a: number, b: number) { + + } + } + + export = Adder; + ~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/multiImportExport.js b/tests/baselines/reference/multiImportExport.js new file mode 100644 index 0000000000000..f462ae3dff714 --- /dev/null +++ b/tests/baselines/reference/multiImportExport.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/multiImportExport.ts] //// + +//// [consumer.ts] +import Drawing = require('./Drawing'); +var addr = new Drawing.Math.Adder(); + +//// [Drawing.ts] +export import Math = require('Math/Math') + +//// [Math.ts] +import Adder = require('Math/Adder'); + +var Math = { + Adder:Adder +}; + +export = Math + +//// [Adder.ts] +class Adder { + add(a: number, b: number) { + + } +} + +export = Adder; + +//// [Adder.js] +var Adder = (function () { + function Adder() { + } + Adder.prototype.add = function (a, b) { + }; + return Adder; +})(); +module.exports = Adder; +//// [Math.js] +var Adder = require('Math/Adder'); +var Math = { + Adder: Adder +}; +module.exports = Math; +//// [Drawing.js] +exports.Math = require('Math/Math'); +//// [consumer.js] +var Drawing = require('./Drawing'); +var addr = new Drawing.Math.Adder(); diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt new file mode 100644 index 0000000000000..b01adc3bfb057 --- /dev/null +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/multiLineErrors.ts (1 errors) ==== + var t = 32; + + function noReturn(): { + n: string; + y: number; + } + { + var x = 4; + var y = 10; + } + + interface A1 { + x: { y: number; }; + } + interface A2 { + x: { y: string; }; + } + + var t1: A1; + var t2: A2; + t1 = t2; + ~~ +!!! Type 'A2' is not assignable to type 'A1': +!!! Types of property 'x' are incompatible: +!!! Type '{ y: string; }' is not assignable to type '{ y: number; }': +!!! Types of property 'y' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/multiLineErrors.js b/tests/baselines/reference/multiLineErrors.js new file mode 100644 index 0000000000000..c12933ef1ce99 --- /dev/null +++ b/tests/baselines/reference/multiLineErrors.js @@ -0,0 +1,33 @@ +//// [multiLineErrors.ts] +var t = 32; + +function noReturn(): { + n: string; + y: number; +} +{ + var x = 4; + var y = 10; +} + +interface A1 { + x: { y: number; }; +} +interface A2 { + x: { y: string; }; +} + +var t1: A1; +var t2: A2; +t1 = t2; + + +//// [multiLineErrors.js] +var t = 32; +function noReturn() { + var x = 4; + var y = 10; +} +var t1; +var t2; +t1 = t2; diff --git a/tests/baselines/reference/multiModuleClodule1.js b/tests/baselines/reference/multiModuleClodule1.js new file mode 100644 index 0000000000000..a64abd816807f --- /dev/null +++ b/tests/baselines/reference/multiModuleClodule1.js @@ -0,0 +1,48 @@ +//// [multiModuleClodule1.ts] +class C { + constructor(x: number) { } + foo() { } + bar() { } + static boo() { } +} + +module C { + export var x = 1; + var y = 2; +} +module C { + export function foo() { } + function baz() { return ''; } +} + +var c = new C(C.x); +c.foo = C.foo; + +//// [multiModuleClodule1.js] +var C = (function () { + function C(x) { + } + C.prototype.foo = function () { + }; + C.prototype.bar = function () { + }; + C.boo = function () { + }; + return C; +})(); +var C; +(function (C) { + C.x = 1; + var y = 2; +})(C || (C = {})); +var C; +(function (C) { + function foo() { + } + C.foo = foo; + function baz() { + return ''; + } +})(C || (C = {})); +var c = new C(C.x); +c.foo = C.foo; diff --git a/tests/baselines/reference/multiModuleFundule1.js b/tests/baselines/reference/multiModuleFundule1.js new file mode 100644 index 0000000000000..bf2abfb7dc82f --- /dev/null +++ b/tests/baselines/reference/multiModuleFundule1.js @@ -0,0 +1,30 @@ +//// [multiModuleFundule1.ts] +function C(x: number) { } + +module C { + export var x = 1; +} +module C { + export function foo() { } +} + +var r = C(2); +var r2 = new C(2); // using void returning function as constructor +var r3 = C.foo(); + +//// [multiModuleFundule1.js] +function C(x) { +} +var C; +(function (C) { + C.x = 1; +})(C || (C = {})); +var C; +(function (C) { + function foo() { + } + C.foo = foo; +})(C || (C = {})); +var r = C(2); +var r2 = new C(2); +var r3 = C.foo(); diff --git a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt new file mode 100644 index 0000000000000..533cb8f2da623 --- /dev/null +++ b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts (1 errors) ==== + interface A + { + x: T + } + + interface C extends A, A { } + ~ +!!! Interface 'C' cannot simultaneously extend types 'A' and 'A': +!!! Named properties 'x' of types 'A' and 'A' are not identical. + \ No newline at end of file diff --git a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.js b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.js new file mode 100644 index 0000000000000..3ba5d51b7ea2f --- /dev/null +++ b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.js @@ -0,0 +1,10 @@ +//// [multipleBaseInterfaesWithIncompatibleProperties.ts] +interface A +{ + x: T +} + +interface C extends A, A { } + + +//// [multipleBaseInterfaesWithIncompatibleProperties.js] diff --git a/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt b/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt new file mode 100644 index 0000000000000..09c39bdbcca93 --- /dev/null +++ b/tests/baselines/reference/multipleClassPropertyModifiers.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/multipleClassPropertyModifiers.ts (2 errors) ==== + class C { + public static p1; + static public p2; + ~~~~~~ +!!! 'public' modifier must precede 'static' modifier. + private static p3; + static private p4; + ~~~~~~~ +!!! 'private' modifier must precede 'static' modifier. + } \ No newline at end of file diff --git a/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt b/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt new file mode 100644 index 0000000000000..dd5e4af80318a --- /dev/null +++ b/tests/baselines/reference/multipleClassPropertyModifiersErrors.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/multipleClassPropertyModifiersErrors.ts (5 errors) ==== + class C { + public public p1; + ~~~~~~ +!!! Accessibility modifier already seen. + private private p2; + ~~~~~~~ +!!! Accessibility modifier already seen. + static static p3; + ~~~~~~ +!!! 'static' modifier already seen. + public private p4; + ~~~~~~~ +!!! Accessibility modifier already seen. + private public p5; + ~~~~~~ +!!! Accessibility modifier already seen. + public static p6; + private static p7; + } \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignments.errors.txt b/tests/baselines/reference/multipleExportAssignments.errors.txt new file mode 100644 index 0000000000000..5f23f30c3e7d5 --- /dev/null +++ b/tests/baselines/reference/multipleExportAssignments.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/multipleExportAssignments.ts (2 errors) ==== + interface connectModule { + (res, req, next): void; + } + interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + var server: { + (): connectExport; + test1: connectModule; + test2(): connectModule; + }; + export = server; + ~~~~~~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = connectExport; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + + \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignments.js b/tests/baselines/reference/multipleExportAssignments.js new file mode 100644 index 0000000000000..4068cb7a04d2b --- /dev/null +++ b/tests/baselines/reference/multipleExportAssignments.js @@ -0,0 +1,21 @@ +//// [multipleExportAssignments.ts] +interface connectModule { + (res, req, next): void; +} +interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; +} +var server: { + (): connectExport; + test1: connectModule; + test2(): connectModule; +}; +export = server; +export = connectExport; + + + +//// [multipleExportAssignments.js] +var server; +module.exports = server; diff --git a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt new file mode 100644 index 0000000000000..8ec47acbc68f7 --- /dev/null +++ b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts (2 errors) ==== + declare module "m1" { + var a: number + var b: number; + export = a; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + export = b; + ~~~~~~~~~~~ +!!! A module cannot have more than one export assignment. + } \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.js b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.js new file mode 100644 index 0000000000000..4829a79498b5a --- /dev/null +++ b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.js @@ -0,0 +1,9 @@ +//// [multipleExportAssignmentsInAmbientDeclaration.ts] +declare module "m1" { + var a: number + var b: number; + export = a; + export = b; +} + +//// [multipleExportAssignmentsInAmbientDeclaration.js] diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt new file mode 100644 index 0000000000000..cb3e360fcc6e6 --- /dev/null +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/multipleInheritance.ts (6 errors) ==== + class B1 { + public x; + } + + class B2 { + public x; + } + + class C extends B1, B2 { // duplicate member + ~ +!!! '{' expected. + ~ +!!! ';' expected. + } + + class D1 extends B1 { + } + + class D2 extends B2 { + } + + class E extends D1, D2 { // nope, duplicate member + ~ +!!! '{' expected. + ~ +!!! ';' expected. + } + + class N { + public y:number; + } + + class ND extends N { // any is assignable to number + public y; + } + + class Good { + public f:() => number = function() { return 0; } + public g() { return 0; } + } + + class Baad extends Good { + ~~~~ +!!! Class 'Baad' incorrectly extends base class 'Good': +!!! Types of property 'g' are incompatible: +!!! Type '(n: number) => number' is not assignable to type '() => number'. + public f(): number { return 0; } + ~ +!!! Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. + public g(n:number) { return 0; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/multipleNumericIndexers.errors.txt b/tests/baselines/reference/multipleNumericIndexers.errors.txt new file mode 100644 index 0000000000000..5ee665a47030b --- /dev/null +++ b/tests/baselines/reference/multipleNumericIndexers.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts (8 errors) ==== + // Multiple indexers of the same type are an error + + class C { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + interface I { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + var a: { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + var b: { + [x: number]: string; + [x: number]: string + ~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } = { 1: '', "2": '' } + + class C2 { + [x: number]: string; + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + + interface I { + ~ +!!! All declarations of an interface must have identical type parameters. + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + [x: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } + \ No newline at end of file diff --git a/tests/baselines/reference/multipleNumericIndexers.js b/tests/baselines/reference/multipleNumericIndexers.js new file mode 100644 index 0000000000000..a4b6d5d0616d9 --- /dev/null +++ b/tests/baselines/reference/multipleNumericIndexers.js @@ -0,0 +1,47 @@ +//// [multipleNumericIndexers.ts] +// Multiple indexers of the same type are an error + +class C { + [x: number]: string; + [x: number]: string; +} + +interface I { + [x: number]: string; + [x: number]: string; +} + +var a: { + [x: number]: string; + [x: number]: string; +} + +var b: { + [x: number]: string; + [x: number]: string +} = { 1: '', "2": '' } + +class C2 { + [x: number]: string; + [x: number]: string; +} + +interface I { + [x: number]: string; + [x: number]: string; +} + + +//// [multipleNumericIndexers.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { 1: '', "2": '' }; +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/multipleStringIndexers.errors.txt b/tests/baselines/reference/multipleStringIndexers.errors.txt new file mode 100644 index 0000000000000..b6328f2edca9a --- /dev/null +++ b/tests/baselines/reference/multipleStringIndexers.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts (6 errors) ==== + // Multiple indexers of the same type are an error + + class C { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + interface I { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + var a: { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + var b: { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } = { y: '' } + + class C2 { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } + + interface I2 { + [x: string]: string; + [x: string]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate string index signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/multipleStringIndexers.js b/tests/baselines/reference/multipleStringIndexers.js new file mode 100644 index 0000000000000..8919cd62c33a2 --- /dev/null +++ b/tests/baselines/reference/multipleStringIndexers.js @@ -0,0 +1,46 @@ +//// [multipleStringIndexers.ts] +// Multiple indexers of the same type are an error + +class C { + [x: string]: string; + [x: string]: string; +} + +interface I { + [x: string]: string; + [x: string]: string; +} + +var a: { + [x: string]: string; + [x: string]: string; +} + +var b: { + [x: string]: string; + [x: string]: string; +} = { y: '' } + +class C2 { + [x: string]: string; + [x: string]: string; +} + +interface I2 { + [x: string]: string; + [x: string]: string; +} + +//// [multipleStringIndexers.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { y: '' }; +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/multivar.errors.txt b/tests/baselines/reference/multivar.errors.txt new file mode 100644 index 0000000000000..bc46109903d1e --- /dev/null +++ b/tests/baselines/reference/multivar.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/compiler/multivar.ts (1 errors) ==== + var a,b,c; + var x=1,y=2,z=3; + + module m2 { + + export var a, b2: number = 10, b; + var m1; + var a2, b22: number = 10, b222; + var m3; + + class C { + constructor (public b) { + } + } + + export class C2 { + constructor (public b) { + } + } + var m; + declare var d1, d2; + var b2; + ~~ +!!! Duplicate identifier 'b2'. + + declare var v1; + } + + var d; + var a22, b22 = 10, c22 = 30, dn; + var nn; + + declare var da1, da2; + var normalVar; + declare var dv1; + var xl; + var x3; + var z4; + + function foo(a2) { + var a = 10; + } + + + for (var i = 0; i < 30; i++) { + i++; + } + var b5 = 10; \ No newline at end of file diff --git a/tests/baselines/reference/multivar.js b/tests/baselines/reference/multivar.js new file mode 100644 index 0000000000000..b5a997a2bd558 --- /dev/null +++ b/tests/baselines/reference/multivar.js @@ -0,0 +1,87 @@ +//// [multivar.ts] +var a,b,c; +var x=1,y=2,z=3; + +module m2 { + + export var a, b2: number = 10, b; + var m1; + var a2, b22: number = 10, b222; + var m3; + + class C { + constructor (public b) { + } + } + + export class C2 { + constructor (public b) { + } + } + var m; + declare var d1, d2; + var b2; + + declare var v1; +} + +var d; +var a22, b22 = 10, c22 = 30, dn; +var nn; + +declare var da1, da2; +var normalVar; +declare var dv1; +var xl; +var x3; +var z4; + +function foo(a2) { + var a = 10; +} + + +for (var i = 0; i < 30; i++) { + i++; +} +var b5 = 10; + +//// [multivar.js] +var a, b, c; +var x = 1, y = 2, z = 3; +var m2; +(function (m2) { + m2.a, m2.b2 = 10, m2.b; + var m1; + var a2, b22 = 10, b222; + var m3; + var C = (function () { + function C(b) { + this.b = b; + } + return C; + })(); + var C2 = (function () { + function C2(b) { + this.b = b; + } + return C2; + })(); + m2.C2 = C2; + var m; + var b2; +})(m2 || (m2 = {})); +var d; +var a22, b22 = 10, c22 = 30, dn; +var nn; +var normalVar; +var xl; +var x3; +var z4; +function foo(a2) { + var a = 10; +} +for (var i = 0; i < 30; i++) { + i++; +} +var b5 = 10; diff --git a/tests/baselines/reference/mutrec.js b/tests/baselines/reference/mutrec.js new file mode 100644 index 0000000000000..ba6c8ade036fa --- /dev/null +++ b/tests/baselines/reference/mutrec.js @@ -0,0 +1,61 @@ +//// [mutrec.ts] +interface A { + x:B[]; +} + +interface B { + x:A[]; +} + +function f(p: A) { return p }; +var b:B; +f(b); + +interface I1 { + y:I2; +} + +interface I2 { + y:I3; +} + +interface I3 { + y:I1; +} + +function g(p: I1) { return p }; +var i2:I2; +g(i2); +var i3:I3; +g(i3); + +interface I4 { + y:I5; +} + +interface I5 { + y:I4; +} + +var i4:I4; +g(i4); + + + +//// [mutrec.js] +function f(p) { + return p; +} +; +var b; +f(b); +function g(p) { + return p; +} +; +var i2; +g(i2); +var i3; +g(i3); +var i4; +g(i4); diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.js new file mode 100644 index 0000000000000..d66c16bc24131 --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.js @@ -0,0 +1,21 @@ +//// [mutuallyRecursiveGenericBaseTypes1.ts] +interface A { + foo(): B; // instead of B does see this + foo(): void; // instead of B does see this + + foo2(): B; +} + +interface B extends A { + bar(): void; +} + +var b: B; +b.foo(); // should not error + + + + +//// [mutuallyRecursiveGenericBaseTypes1.js] +var b; +b.foo(); diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js new file mode 100644 index 0000000000000..585a3d2178b9a --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -0,0 +1,35 @@ +//// [mutuallyRecursiveGenericBaseTypes2.ts] +class foo +{ + bar(): foo2 { return null; } +} + +class foo2 extends foo { +} + +var test = new foo(); + + +//// [mutuallyRecursiveGenericBaseTypes2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var foo = (function () { + function foo() { + } + foo.prototype.bar = function () { + return null; + }; + return foo; +})(); +var foo2 = (function (_super) { + __extends(foo2, _super); + function foo2() { + _super.apply(this, arguments); + } + return foo2; +})(foo); +var test = new foo(); diff --git a/tests/baselines/reference/nameCollision.js b/tests/baselines/reference/nameCollision.js new file mode 100644 index 0000000000000..4bdf4750d54d0 --- /dev/null +++ b/tests/baselines/reference/nameCollision.js @@ -0,0 +1,95 @@ +//// [nameCollision.ts] +module A { + // these 2 statements force an underscore before the 'A' + // in the generated function call. + var A = 12; + var _A = ''; +} + +module B { + var A = 12; +} + +module B { + // re-opened module with colliding name + // this should add an underscore. + class B { + name: string; + } +} + +module X { + var X = 13; + export module Y { + var Y = 13; + export module Z { + var X = 12; + var Y = 12; + var Z = 12; + } + } +} + +module Y.Y { + export enum Y { + Red, Blue + } +} + +// no collision, since interface doesn't +// generate code. +module D { + export interface D { + id: number; + } + + export var E = 'hello'; +} + +//// [nameCollision.js] +var A; +(function (A) { + var A = 12; + var _A = ''; +})(A || (A = {})); +var B; +(function (B) { + var A = 12; +})(B || (B = {})); +var B; +(function (B) { + var B = (function () { + function B() { + } + return B; + })(); +})(B || (B = {})); +var X; +(function (X) { + var X = 13; + (function (Y) { + var Y = 13; + (function (Z) { + var X = 12; + var Y = 12; + var Z = 12; + })(Y.Z || (Y.Z = {})); + var Z = Y.Z; + })(X.Y || (X.Y = {})); + var Y = X.Y; +})(X || (X = {})); +var Y; +(function (Y) { + (function (Y) { + (function (Y) { + Y[Y["Red"] = 0] = "Red"; + Y[Y["Blue"] = 1] = "Blue"; + })(Y.Y || (Y.Y = {})); + var Y = Y.Y; + })(Y.Y || (Y.Y = {})); + var Y = Y.Y; +})(Y || (Y = {})); +var D; +(function (D) { + D.E = 'hello'; +})(D || (D = {})); diff --git a/tests/baselines/reference/nameCollisions.errors.txt b/tests/baselines/reference/nameCollisions.errors.txt new file mode 100644 index 0000000000000..21246658bc2a9 --- /dev/null +++ b/tests/baselines/reference/nameCollisions.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/compiler/nameCollisions.ts (8 errors) ==== + module T { + var x = 2; + + module x { // error + ~ +!!! Duplicate identifier 'x'. + export class Bar { + test: number; + } + } + + module z { + var t; + } + var z; // error + ~ +!!! Duplicate identifier 'z'. + + module y { + var b; + } + + class y { } // error + + var w; + module w { } //ok + + var f; + function f() { } //error + ~ +!!! Duplicate identifier 'f'. + + function f2() { } + var f2; // error + ~~ +!!! Duplicate identifier 'f2'. + + var i; + interface i { } //ok + + class C { } + function C() { } // error + ~ +!!! Duplicate identifier 'C'. + + function C2() { } + class C2 { } // error + ~~ +!!! Duplicate identifier 'C2'. + + function fi() { } + interface fi { } // ok + + class cli { } + interface cli { } // error + ~~~ +!!! Duplicate identifier 'cli'. + + interface cli2 { } + class cli2 { } // error + ~~~~ +!!! Duplicate identifier 'cli2'. + } \ No newline at end of file diff --git a/tests/baselines/reference/nameCollisions.js b/tests/baselines/reference/nameCollisions.js new file mode 100644 index 0000000000000..0591989adbbaa --- /dev/null +++ b/tests/baselines/reference/nameCollisions.js @@ -0,0 +1,111 @@ +//// [nameCollisions.ts] +module T { + var x = 2; + + module x { // error + export class Bar { + test: number; + } + } + + module z { + var t; + } + var z; // error + + module y { + var b; + } + + class y { } // error + + var w; + module w { } //ok + + var f; + function f() { } //error + + function f2() { } + var f2; // error + + var i; + interface i { } //ok + + class C { } + function C() { } // error + + function C2() { } + class C2 { } // error + + function fi() { } + interface fi { } // ok + + class cli { } + interface cli { } // error + + interface cli2 { } + class cli2 { } // error +} + +//// [nameCollisions.js] +var T; +(function (T) { + var x = 2; + var x; + (function (x) { + var Bar = (function () { + function Bar() { + } + return Bar; + })(); + x.Bar = Bar; + })(x || (x = {})); + var z; + (function (z) { + var t; + })(z || (z = {})); + var z; + var y; + (function (y) { + var b; + })(y || (y = {})); + var y = (function () { + function y() { + } + return y; + })(); + var w; + var f; + function f() { + } + function f2() { + } + var f2; + var i; + var C = (function () { + function C() { + } + return C; + })(); + function C() { + } + function C2() { + } + var C2 = (function () { + function C2() { + } + return C2; + })(); + function fi() { + } + var cli = (function () { + function cli() { + } + return cli; + })(); + var cli2 = (function () { + function cli2() { + } + return cli2; + })(); +})(T || (T = {})); diff --git a/tests/baselines/reference/nameDelimitedBySlashes.js b/tests/baselines/reference/nameDelimitedBySlashes.js new file mode 100644 index 0000000000000..3088545261f7f --- /dev/null +++ b/tests/baselines/reference/nameDelimitedBySlashes.js @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/externalModules/nameDelimitedBySlashes.ts] //// + +//// [foo_0.ts] +export var foo = 42; + +//// [foo_1.ts] +import foo = require('./test/foo_0'); +var x = foo.foo + 42; + + +//// [foo_0.js] +exports.foo = 42; +//// [foo_1.js] +var foo = require('./test/foo_0'); +var x = foo.foo + 42; diff --git a/tests/baselines/reference/nameWithFileExtension.errors.txt b/tests/baselines/reference/nameWithFileExtension.errors.txt new file mode 100644 index 0000000000000..154ed8047ff60 --- /dev/null +++ b/tests/baselines/reference/nameWithFileExtension.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== + import foo = require('./foo_0.js'); + ~~~~~~~~~~~~ +!!! Cannot find external module './foo_0.js'. + var x = foo.foo + 42; + +==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== + export var foo = 42; + \ No newline at end of file diff --git a/tests/baselines/reference/nameWithFileExtension.js b/tests/baselines/reference/nameWithFileExtension.js new file mode 100644 index 0000000000000..9f601e19aef3e --- /dev/null +++ b/tests/baselines/reference/nameWithFileExtension.js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/externalModules/nameWithFileExtension.ts] //// + +//// [foo_0.ts] +export var foo = 42; + +//// [foo_1.ts] +import foo = require('./foo_0.js'); +var x = foo.foo + 42; + + +//// [foo_1.js] +var foo = require('./foo_0.js'); +var x = foo.foo + 42; diff --git a/tests/baselines/reference/nameWithRelativePaths.js b/tests/baselines/reference/nameWithRelativePaths.js new file mode 100644 index 0000000000000..ba8e933dabd60 --- /dev/null +++ b/tests/baselines/reference/nameWithRelativePaths.js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/externalModules/nameWithRelativePaths.ts] //// + +//// [foo_0.ts] +export var foo = 42; + +//// [foo_1.ts] +export function f(){ + return 42; +} + +//// [foo_2.ts] +export module M2 { + export var x = true; +} + +//// [foo_3.ts] +import foo0 = require('../foo_0'); +import foo1 = require('./test/foo_1'); +import foo2 = require('./.././test/foo_2'); + +if(foo2.M2.x){ + var x = foo0.foo + foo1.f(); +} + + +//// [foo_0.js] +exports.foo = 42; +//// [foo_1.js] +function f() { + return 42; +} +exports.f = f; +//// [foo_2.js] +(function (M2) { + M2.x = true; +})(exports.M2 || (exports.M2 = {})); +var M2 = exports.M2; +//// [foo_3.js] +var foo0 = require('../foo_0'); +var foo1 = require('./test/foo_1'); +var foo2 = require('./.././test/foo_2'); +if (foo2.M2.x) { + var x = foo0.foo + foo1.f(); +} diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js new file mode 100644 index 0000000000000..ea97d23f8d62d --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js @@ -0,0 +1,24 @@ +//// [namedFunctionExpressionAssignedToClassProperty.ts] +class Foo{ + + a = function bar(){ + + }; // this shouldn't crash the compiler... + + + + constructor(){ + + } + +} + + +//// [namedFunctionExpressionAssignedToClassProperty.js] +var Foo = (function () { + function Foo() { + this.a = function bar() { + }; + } + return Foo; +})(); diff --git a/tests/baselines/reference/namedFunctionExpressionCall.js b/tests/baselines/reference/namedFunctionExpressionCall.js new file mode 100644 index 0000000000000..6e9eeae1197d8 --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionCall.js @@ -0,0 +1,22 @@ +//// [namedFunctionExpressionCall.ts] +var recurser = function foo() { + // using the local name + foo(); + + // using the globally visible name + recurser(); +}; + + +(function bar() { + bar(); +}); + +//// [namedFunctionExpressionCall.js] +var recurser = function foo() { + foo(); + recurser(); +}; +(function bar() { + bar(); +}); diff --git a/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt b/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt new file mode 100644 index 0000000000000..22be4433c138a --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionCallErrors.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/namedFunctionExpressionCallErrors.ts (3 errors) ==== + var recurser = function foo() { + }; + + // Error: foo should not be visible here + foo(); + ~~~ +!!! Cannot find name 'foo'. + + // recurser should be + recurser(); + + (function bar() { + // Error: foo should not be visible here either + foo(); + ~~~ +!!! Cannot find name 'foo'. + }); + + // Error: bar should not be visible + bar(); + ~~~ +!!! Cannot find name 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/namedFunctionExpressionCallErrors.js b/tests/baselines/reference/namedFunctionExpressionCallErrors.js new file mode 100644 index 0000000000000..484b65e63593f --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionCallErrors.js @@ -0,0 +1,27 @@ +//// [namedFunctionExpressionCallErrors.ts] +var recurser = function foo() { +}; + +// Error: foo should not be visible here +foo(); + +// recurser should be +recurser(); + +(function bar() { + // Error: foo should not be visible here either + foo(); +}); + +// Error: bar should not be visible +bar(); + +//// [namedFunctionExpressionCallErrors.js] +var recurser = function foo() { +}; +foo(); +recurser(); +(function bar() { + foo(); +}); +bar(); diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.js b/tests/baselines/reference/namedFunctionExpressionInModule.js new file mode 100644 index 0000000000000..7f255c416f119 --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionInModule.js @@ -0,0 +1,15 @@ +//// [namedFunctionExpressionInModule.ts] +module Variables{ + var x = function bar(a, b, c) { + } + x(1, 2, 3); +} + + +//// [namedFunctionExpressionInModule.js] +var Variables; +(function (Variables) { + var x = function bar(a, b, c) { + }; + x(1, 2, 3); +})(Variables || (Variables = {})); diff --git a/tests/baselines/reference/namespaces1.js b/tests/baselines/reference/namespaces1.js new file mode 100644 index 0000000000000..954d7a6e60e74 --- /dev/null +++ b/tests/baselines/reference/namespaces1.js @@ -0,0 +1,14 @@ +//// [namespaces1.ts] +module X { + export module Y { + export interface Z { } + } + export interface Y { } +} + +var x: X.Y.Z; +var x2: X.Y; + +//// [namespaces1.js] +var x; +var x2; diff --git a/tests/baselines/reference/namespaces2.js b/tests/baselines/reference/namespaces2.js new file mode 100644 index 0000000000000..88edd87190218 --- /dev/null +++ b/tests/baselines/reference/namespaces2.js @@ -0,0 +1,23 @@ +//// [namespaces2.ts] +module A { + export module B { + export class C { } + } +} + +var c: A.B.C = new A.B.C(); + +//// [namespaces2.js] +var A; +(function (A) { + (function (B) { + var C = (function () { + function C() { + } + return C; + })(); + B.C = C; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var c = new A.B.C(); diff --git a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt new file mode 100644 index 0000000000000..f8dc0aeb6d816 --- /dev/null +++ b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts (10 errors) ==== + // Unary operator - + + // operand before - + var NUMBER1 = var NUMBER-; //expect error + ~~~ +!!! Expression expected. + ~ +!!! '=' expected. + ~ +!!! Expression expected. + + // invalid expressions + var NUMBER2 = -(null - undefined); + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var NUMBER3 = -(null - null); + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + var NUMBER4 = -(undefined - undefined); + ~~~~~~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + // miss operand + var NUMBER =-; + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.js b/tests/baselines/reference/negateOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..2652ddf81d54e --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.js @@ -0,0 +1,102 @@ +//// [negateOperatorWithAnyOtherType.ts] +// - operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj: () => {} +var obj1 = { x: "", y: () => { }}; + +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any type var +var ResultIsNumber1 = -ANY1; +var ResultIsNumber2 = -ANY2; +var ResultIsNumber3 = -A; +var ResultIsNumber4 = -M; +var ResultIsNumber5 = -obj; +var ResultIsNumber6 = -obj1; + +// any type literal +var ResultIsNumber7 = -undefined; +var ResultIsNumber = -null; + +// any type expressions +var ResultIsNumber8 = -ANY2[0]; +var ResultIsNumber9 = -obj1.x; +var ResultIsNumber10 = -obj1.y; +var ResultIsNumber11 = -objA.a; +var ResultIsNumber12 = -M.n; +var ResultIsNumber13 = -foo(); +var ResultIsNumber14 = -A.foo(); +var ResultIsNumber15 = -(ANY - ANY1); + +// miss assignment operators +-ANY; +-ANY1; +-ANY2[0]; +-ANY, ANY1; +-objA.a; +-M.n; + +//// [negateOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: "", y: function () { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = -ANY1; +var ResultIsNumber2 = -ANY2; +var ResultIsNumber3 = -A; +var ResultIsNumber4 = -M; +var ResultIsNumber5 = -obj; +var ResultIsNumber6 = -obj1; +var ResultIsNumber7 = -undefined; +var ResultIsNumber = -null; +var ResultIsNumber8 = -ANY2[0]; +var ResultIsNumber9 = -obj1.x; +var ResultIsNumber10 = -obj1.y; +var ResultIsNumber11 = -objA.a; +var ResultIsNumber12 = -M.n; +var ResultIsNumber13 = -foo(); +var ResultIsNumber14 = -A.foo(); +var ResultIsNumber15 = -(ANY - ANY1); +-ANY; +-ANY1; +-ANY2[0]; +-ANY, ANY1; +-objA.a; +-M.n; diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.js b/tests/baselines/reference/negateOperatorWithBooleanType.js new file mode 100644 index 0000000000000..a05e053bb4dfd --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.js @@ -0,0 +1,68 @@ +//// [negateOperatorWithBooleanType.ts] +// - operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return false; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsNumber1 = -BOOLEAN; + +// boolean type literal +var ResultIsNumber2 = -true; +var ResultIsNumber3 = -{ x: true, y: false }; + +// boolean type expressions +var ResultIsNumber4 = -objA.a; +var ResultIsNumber5 = -M.n; +var ResultIsNumber6 = -foo(); +var ResultIsNumber7 = -A.foo(); + +// miss assignment operators +-true; +-BOOLEAN; +-foo(); +-true, false; +-objA.a; +-M.n; + +//// [negateOperatorWithBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return false; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = -BOOLEAN; +var ResultIsNumber2 = -true; +var ResultIsNumber3 = -{ x: true, y: false }; +var ResultIsNumber4 = -objA.a; +var ResultIsNumber5 = -M.n; +var ResultIsNumber6 = -foo(); +var ResultIsNumber7 = -A.foo(); +-true; +-BOOLEAN; +-foo(); +-true, false; +-objA.a; +-M.n; diff --git a/tests/baselines/reference/negateOperatorWithEnumType.js b/tests/baselines/reference/negateOperatorWithEnumType.js new file mode 100644 index 0000000000000..fa45b524df5f3 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.js @@ -0,0 +1,38 @@ +//// [negateOperatorWithEnumType.ts] +// - operator on enum type + +enum ENUM { }; +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsNumber1 = -ENUM; + +// expressions +var ResultIsNumber2 = -ENUM1[1]; +var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); + +// miss assignment operators +-ENUM; +-ENUM1; +-ENUM1[1]; +-ENUM, ENUM1; + +//// [negateOperatorWithEnumType.js] +var ENUM; +(function (ENUM) { +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = -ENUM; +var ResultIsNumber2 = -ENUM1[1]; +var ResultIsNumber3 = -(ENUM1[1] + ENUM1[2]); +-ENUM; +-ENUM1; +-ENUM1[1]; +-ENUM, ENUM1; diff --git a/tests/baselines/reference/negateOperatorWithNumberType.js b/tests/baselines/reference/negateOperatorWithNumberType.js new file mode 100644 index 0000000000000..a68e1351d41ca --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.js @@ -0,0 +1,82 @@ +//// [negateOperatorWithNumberType.ts] +// - operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsNumber1 = -NUMBER; +var ResultIsNumber2 = -NUMBER1; + +// number type literal +var ResultIsNumber3 = -1; +var ResultIsNumber4 = -{ x: 1, y: 2}; +var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; + +// number type expressions +var ResultIsNumber6 = -objA.a; +var ResultIsNumber7 = -M.n; +var ResultIsNumber8 = -NUMBER1[0]; +var ResultIsNumber9 = -foo(); +var ResultIsNumber10 = -A.foo(); +var ResultIsNumber11 = -(NUMBER - NUMBER); + +// miss assignment operators +-1; +-NUMBER; +-NUMBER1; +-foo(); +-objA.a; +-M.n; +-objA.a, M.n; + +//// [negateOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = -NUMBER; +var ResultIsNumber2 = -NUMBER1; +var ResultIsNumber3 = -1; +var ResultIsNumber4 = -{ x: 1, y: 2 }; +var ResultIsNumber5 = -{ x: 1, y: function (n) { + return n; +} }; +var ResultIsNumber6 = -objA.a; +var ResultIsNumber7 = -M.n; +var ResultIsNumber8 = -NUMBER1[0]; +var ResultIsNumber9 = -foo(); +var ResultIsNumber10 = -A.foo(); +var ResultIsNumber11 = -(NUMBER - NUMBER); +-1; +-NUMBER; +-NUMBER1; +-foo(); +-objA.a; +-M.n; +-objA.a, M.n; diff --git a/tests/baselines/reference/negateOperatorWithStringType.js b/tests/baselines/reference/negateOperatorWithStringType.js new file mode 100644 index 0000000000000..abcb6a6056f69 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.js @@ -0,0 +1,80 @@ +//// [negateOperatorWithStringType.ts] +// - operator on string type +var STRING: string; +var STRING1: string[] = ["", "abc"]; + +function foo(): string { return "abc"; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsNumber1 = -STRING; +var ResultIsNumber2 = -STRING1; + +// string type literal +var ResultIsNumber3 = -""; +var ResultIsNumber4 = -{ x: "", y: "" }; +var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; + +// string type expressions +var ResultIsNumber6 = -objA.a; +var ResultIsNumber7 = -M.n; +var ResultIsNumber8 = -STRING1[0]; +var ResultIsNumber9 = -foo(); +var ResultIsNumber10 = -A.foo(); +var ResultIsNumber11 = -(STRING + STRING); +var ResultIsNumber12 = -STRING.charAt(0); + +// miss assignment operators +-""; +-STRING; +-STRING1; +-foo(); +-objA.a,M.n; + +//// [negateOperatorWithStringType.js] +var STRING; +var STRING1 = ["", "abc"]; +function foo() { + return "abc"; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = -STRING; +var ResultIsNumber2 = -STRING1; +var ResultIsNumber3 = -""; +var ResultIsNumber4 = -{ x: "", y: "" }; +var ResultIsNumber5 = -{ x: "", y: function (s) { + return s; +} }; +var ResultIsNumber6 = -objA.a; +var ResultIsNumber7 = -M.n; +var ResultIsNumber8 = -STRING1[0]; +var ResultIsNumber9 = -foo(); +var ResultIsNumber10 = -A.foo(); +var ResultIsNumber11 = -(STRING + STRING); +var ResultIsNumber12 = -STRING.charAt(0); +-""; +-STRING; +-STRING1; +-foo(); +-objA.a, M.n; diff --git a/tests/baselines/reference/negativeZero.js b/tests/baselines/reference/negativeZero.js new file mode 100644 index 0000000000000..572e2d21d0791 --- /dev/null +++ b/tests/baselines/reference/negativeZero.js @@ -0,0 +1,6 @@ +//// [negativeZero.ts] +var x = -0 + + +//// [negativeZero.js] +var x = -0; diff --git a/tests/baselines/reference/nestedClassDeclaration.errors.txt b/tests/baselines/reference/nestedClassDeclaration.errors.txt new file mode 100644 index 0000000000000..1e64dad4968ad --- /dev/null +++ b/tests/baselines/reference/nestedClassDeclaration.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/conformance/classes/nestedClassDeclaration.ts (8 errors) ==== + // nested classes are not allowed + + class C { + x: string; + class C2 { + ~~~~~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + } + } + ~ +!!! Declaration or statement expected. + + function foo() { + class C3 { + ~~~~~ +!!! Statement expected. + } + } + ~ +!!! Declaration or statement expected. + + var x = { + class C4 { + ~~ +!!! ':' expected. + ~ +!!! ',' expected. + ~~ +!!! Cannot find name 'C4'. + } + } + ~ +!!! Declaration or statement expected. + \ No newline at end of file diff --git a/tests/baselines/reference/nestedGenerics.js b/tests/baselines/reference/nestedGenerics.js new file mode 100644 index 0000000000000..27a6007e58415 --- /dev/null +++ b/tests/baselines/reference/nestedGenerics.js @@ -0,0 +1,9 @@ +//// [nestedGenerics.ts] +interface Foo { + t: T; +} + +var f: Foo>; + +//// [nestedGenerics.js] +var f; diff --git a/tests/baselines/reference/nestedIfStatement.js b/tests/baselines/reference/nestedIfStatement.js new file mode 100644 index 0000000000000..d0d0cbd0af21b --- /dev/null +++ b/tests/baselines/reference/nestedIfStatement.js @@ -0,0 +1,19 @@ +//// [nestedIfStatement.ts] +if (0) { +} else if (1) { +} else if (2) { +} else if (3) { +} else { +} + +//// [nestedIfStatement.js] +if (0) { +} +else if (1) { +} +else if (2) { +} +else if (3) { +} +else { +} diff --git a/tests/baselines/reference/nestedIndexer.js b/tests/baselines/reference/nestedIndexer.js new file mode 100644 index 0000000000000..b0a9b0ce66298 --- /dev/null +++ b/tests/baselines/reference/nestedIndexer.js @@ -0,0 +1,12 @@ +//// [nestedIndexer.ts] +function then(x) { + +var match: { [index: number]: string; } + +} + + +//// [nestedIndexer.js] +function then(x) { + var match; +} diff --git a/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.js b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.js new file mode 100644 index 0000000000000..afd32579de5c4 --- /dev/null +++ b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.js @@ -0,0 +1,18 @@ +//// [nestedInfinitelyExpandedRecursiveTypes.ts] +interface F { + t: G T>>; +} +interface G { + t: G U>>; +} + +var f: F; +var g: G; +f = g; +g = f; + +//// [nestedInfinitelyExpandedRecursiveTypes.js] +var f; +var g; +f = g; +g = f; diff --git a/tests/baselines/reference/nestedModulePrivateAccess.js b/tests/baselines/reference/nestedModulePrivateAccess.js new file mode 100644 index 0000000000000..fd6efb5e4025d --- /dev/null +++ b/tests/baselines/reference/nestedModulePrivateAccess.js @@ -0,0 +1,17 @@ +//// [nestedModulePrivateAccess.ts] +module a{ + var x:number; + module b{ + var y = x; // should not be an error + } +} + +//// [nestedModulePrivateAccess.js] +var a; +(function (a) { + var x; + var b; + (function (b) { + var y = x; + })(b || (b = {})); +})(a || (a = {})); diff --git a/tests/baselines/reference/nestedModules.js b/tests/baselines/reference/nestedModules.js new file mode 100644 index 0000000000000..147e6d43b490a --- /dev/null +++ b/tests/baselines/reference/nestedModules.js @@ -0,0 +1,54 @@ +//// [nestedModules.ts] +module A.B.C { + export interface Point { + x: number; + y: number; + } +} + +module A { + export module B { + var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' + } +} + +module M2.X { + export interface Point { + x: number; y: number; + } +} + +module M2 { + export module X { + export var Point: number; + } +} + +var m = M2.X; +var point: number; +var point = m.Point; + +var p: { x: number; y: number; } +var p: M2.X.Point; + + +//// [nestedModules.js] +var A; +(function (A) { + (function (B) { + var Point = { x: 0, y: 0 }; + })(A.B || (A.B = {})); + var B = A.B; +})(A || (A = {})); +var M2; +(function (M2) { + (function (X) { + X.Point; + })(M2.X || (M2.X = {})); + var X = M2.X; +})(M2 || (M2 = {})); +var m = M2.X; +var point; +var point = m.Point; +var p; +var p; diff --git a/tests/baselines/reference/nestedRecursiveLambda.js b/tests/baselines/reference/nestedRecursiveLambda.js new file mode 100644 index 0000000000000..0273b5691e667 --- /dev/null +++ b/tests/baselines/reference/nestedRecursiveLambda.js @@ -0,0 +1,15 @@ +//// [nestedRecursiveLambda.ts] +function f(a:any) { +void (r =>(r => r)); +} +f((r =>(r => r))); +void(r =>(r => r)); +[(r =>(r => r))] + +//// [nestedRecursiveLambda.js] +function f(a) { + void (function (r) { return (function (r) { return r; }); }); +} +f((function (r) { return (function (r) { return r; }); })); +void (function (r) { return (function (r) { return r; }); }); +[(function (r) { return (function (r) { return r; }); })]; diff --git a/tests/baselines/reference/nestedSelf.js b/tests/baselines/reference/nestedSelf.js new file mode 100644 index 0000000000000..897bdd720e7a2 --- /dev/null +++ b/tests/baselines/reference/nestedSelf.js @@ -0,0 +1,27 @@ +//// [nestedSelf.ts] +module M { + export class C { + public n = 42; + public foo() { [1,2,3].map((x) => { return this.n * x; })} + } +} + + + +//// [nestedSelf.js] +var M; +(function (M) { + var C = (function () { + function C() { + this.n = 42; + } + C.prototype.foo = function () { + var _this = this; + [1, 2, 3].map(function (x) { + return _this.n * x; + }); + }; + return C; + })(); + M.C = C; +})(M || (M = {})); diff --git a/tests/baselines/reference/newArrays.js b/tests/baselines/reference/newArrays.js new file mode 100644 index 0000000000000..adc51eb843ae2 --- /dev/null +++ b/tests/baselines/reference/newArrays.js @@ -0,0 +1,33 @@ +//// [newArrays.ts] +module M { + class Foo {} + class Gar { + public fa: Foo[]; + public x = 10; + public y = 10; + + public m () { + this.fa = new Array(this.x * this.y); + } + } +} + +//// [newArrays.js] +var M; +(function (M) { + var Foo = (function () { + function Foo() { + } + return Foo; + })(); + var Gar = (function () { + function Gar() { + this.x = 10; + this.y = 10; + } + Gar.prototype.m = function () { + this.fa = new Array(this.x * this.y); + }; + return Gar; + })(); +})(M || (M = {})); diff --git a/tests/baselines/reference/newExpressionWithCast.errors.txt b/tests/baselines/reference/newExpressionWithCast.errors.txt new file mode 100644 index 0000000000000..a7e9ef10d50e3 --- /dev/null +++ b/tests/baselines/reference/newExpressionWithCast.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/newExpressionWithCast.ts (4 errors) ==== + + function Test() { } + // valid but error with noImplicitAny + var test = new Test(); + ~~~~~~~~~~ +!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + function Test2() { } + // parse error + var test2 = new Test2(); + ~ +!!! Expression expected. + ~~~~~~~~~~~~~~~~ +!!! Operator '>' cannot be applied to types 'boolean' and 'void'. + ~~~ +!!! Cannot find name 'any'. + + function Test3() { } + // valid with noImplicitAny + var test3 = new (Test3)(); + + \ No newline at end of file diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js new file mode 100644 index 0000000000000..f1e7136eb12c2 --- /dev/null +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js @@ -0,0 +1,10 @@ +//// [newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts] +interface I { + new (u: U): U; +} +var i: I; +var y = new i(""); // y should be string + +//// [newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js] +var i; +var y = new i(""); diff --git a/tests/baselines/reference/newFunctionImplicitAny.errors.txt b/tests/baselines/reference/newFunctionImplicitAny.errors.txt new file mode 100644 index 0000000000000..2f507f61557e0 --- /dev/null +++ b/tests/baselines/reference/newFunctionImplicitAny.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/newFunctionImplicitAny.ts (1 errors) ==== + // No implicit any error given when newing a function (up for debate) + + function Test() { } + var test = new Test(); + ~~~~~~~~~~ +!!! 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/newFunctionImplicitAny.js b/tests/baselines/reference/newFunctionImplicitAny.js new file mode 100644 index 0000000000000..94fc146f4a51c --- /dev/null +++ b/tests/baselines/reference/newFunctionImplicitAny.js @@ -0,0 +1,10 @@ +//// [newFunctionImplicitAny.ts] +// No implicit any error given when newing a function (up for debate) + +function Test() { } +var test = new Test(); + +//// [newFunctionImplicitAny.js] +function Test() { +} +var test = new Test(); diff --git a/tests/baselines/reference/newMissingIdentifier.errors.txt b/tests/baselines/reference/newMissingIdentifier.errors.txt new file mode 100644 index 0000000000000..673129e5b09a5 --- /dev/null +++ b/tests/baselines/reference/newMissingIdentifier.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/newMissingIdentifier.ts (1 errors) ==== + var x = new (); + ~ +!!! Expression expected. + \ No newline at end of file diff --git a/tests/baselines/reference/newNonReferenceType.errors.txt b/tests/baselines/reference/newNonReferenceType.errors.txt new file mode 100644 index 0000000000000..68761488aa711 --- /dev/null +++ b/tests/baselines/reference/newNonReferenceType.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/newNonReferenceType.ts (2 errors) ==== + var a = new any(); + ~~~ +!!! Cannot find name 'any'. + var b = new boolean(); // error + ~~~~~~~ +!!! Cannot find name 'boolean'. + \ No newline at end of file diff --git a/tests/baselines/reference/newNonReferenceType.js b/tests/baselines/reference/newNonReferenceType.js new file mode 100644 index 0000000000000..8647b2379a0d9 --- /dev/null +++ b/tests/baselines/reference/newNonReferenceType.js @@ -0,0 +1,8 @@ +//// [newNonReferenceType.ts] +var a = new any(); +var b = new boolean(); // error + + +//// [newNonReferenceType.js] +var a = new any(); +var b = new boolean(); diff --git a/tests/baselines/reference/newOnInstanceSymbol.errors.txt b/tests/baselines/reference/newOnInstanceSymbol.errors.txt new file mode 100644 index 0000000000000..11f9e589db457 --- /dev/null +++ b/tests/baselines/reference/newOnInstanceSymbol.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/newOnInstanceSymbol.ts (1 errors) ==== + class C {} + var x = new C(); // should be ok + new x(); // should error + ~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/newOnInstanceSymbol.js b/tests/baselines/reference/newOnInstanceSymbol.js new file mode 100644 index 0000000000000..428841de21bf8 --- /dev/null +++ b/tests/baselines/reference/newOnInstanceSymbol.js @@ -0,0 +1,13 @@ +//// [newOnInstanceSymbol.ts] +class C {} +var x = new C(); // should be ok +new x(); // should error + +//// [newOnInstanceSymbol.js] +var C = (function () { + function C() { + } + return C; +})(); +var x = new C(); +new x(); diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt new file mode 100644 index 0000000000000..f522ce63f8558 --- /dev/null +++ b/tests/baselines/reference/newOperator.errors.txt @@ -0,0 +1,72 @@ +==== tests/cases/compiler/newOperator.ts (11 errors) ==== + interface ifc { } + // Attempting to 'new' an interface yields poor error + var i = new ifc(); + ~~~ +!!! Cannot find name 'ifc'. + + // Parens are optional + var x = new Date; + var y = new Date(); + + // Target is not a class or var, good error + var t1 = new 53(); + ~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var t2 = new ''(); + ~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + new string; + ~~~~~~ +!!! Cannot find name 'string'. + + // Use in LHS of expression? + (new Date()).toString(); + + // Various spacing + var t3 = new string[]( ); + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ~~~~~~ +!!! Cannot find name 'string'. + var t4 = + new + string + ~~~~~~ +!!! Cannot find name 'string'. + [ + ~ + ] + ~~~~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + ( + ); + + // Unresolved symbol + var f = new q(); + ~ +!!! Cannot find name 'q'. + + // not legal + var t5 = new new Date; + ~~~~~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + + // Can be an expression + new String; + + + module M { + export class T { + x: number; + } + } + + class S { + public get xs(): M.T[] { + return new M.T[]; + ~~ +!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/newOperatorConformance.js b/tests/baselines/reference/newOperatorConformance.js new file mode 100644 index 0000000000000..0fe5565c2f738 --- /dev/null +++ b/tests/baselines/reference/newOperatorConformance.js @@ -0,0 +1,106 @@ +//// [newOperatorConformance.ts] + +class C0 { + +} +class C1 { + constructor(n: number, s: string) { } +} + +class T { + constructor(n?: T) { } +} + +var anyCtor: { + new (): any; +}; + +var anyCtor1: { + new (n): any; +}; + +interface nestedCtor { + new (): nestedCtor; +} +var nestedCtor: nestedCtor; + +// Construct expression with no parentheses for construct signature with 0 parameters +var a = new C0; +var a: C0; + + +// Generic construct expression with no parentheses +var c1 = new T; +var c1: T<{}>; + +// Construct expression where constructor is of type 'any' with no parentheses +var d = new anyCtor; +var d: any; + +// Construct expression where constructor is of type 'any' with > 1 arg +var d = new anyCtor1(undefined); + +// Construct expression of type where apparent type has a construct signature with 0 arguments +function newFn1(s: T) { + var p = new s; + var p: number; +} + +// Construct expression of type where apparent type has a construct signature with 1 arguments +function newFn2(s: T) { + var p = new s(32); + var p: string; +} + +// Construct expression of void returning function +function fnVoid(): void { } +var t = new fnVoid(); +var t: any; + +// Chained new expressions +var nested = new (new (new nestedCtor())())(); +var n = new nested(); +var n = new nested(); + + +//// [newOperatorConformance.js] +var C0 = (function () { + function C0() { + } + return C0; +})(); +var C1 = (function () { + function C1(n, s) { + } + return C1; +})(); +var T = (function () { + function T(n) { + } + return T; +})(); +var anyCtor; +var anyCtor1; +var nestedCtor; +var a = new C0; +var a; +var c1 = new T; +var c1; +var d = new anyCtor; +var d; +var d = new anyCtor1(undefined); +function newFn1(s) { + var p = new s; + var p; +} +function newFn2(s) { + var p = new s(32); + var p; +} +function fnVoid() { +} +var t = new fnVoid(); +var t; +var nested = new (new (new nestedCtor())())(); +var n = new nested(); +var n = new nested(); diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt new file mode 100644 index 0000000000000..17dd55d0ebbee --- /dev/null +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -0,0 +1,47 @@ +==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (4 errors) ==== + + class C0 { + + } + class C1 { + constructor(n: number, s: string) { } + } + + class T { + constructor(n?: T) { } + } + + var anyCtor: { + new (): any; + }; + + var anyCtor1: { + new (n): any; + }; + + interface nestedCtor { + new (): nestedCtor; + } + var nestedCtor: nestedCtor; + + // Construct expression with no parentheses for construct signature with > 0 parameters + var b = new C0 32, ''; // Parse error + ~~ +!!! ',' expected. + + // Generic construct expression with no parentheses + var c1 = new T; + var c1: T<{}>; + var c2 = new T; // Parse error + ~ +!!! Expression expected. + ~~~~~~ +!!! Cannot find name 'string'. + + + // Construct expression of non-void returning function + function fnNumber(): number { return 32; } + var s = new fnNumber(); // Error + ~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. + \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.js b/tests/baselines/reference/noCatchBlock.js new file mode 100644 index 0000000000000..7b0404c3cadd7 --- /dev/null +++ b/tests/baselines/reference/noCatchBlock.js @@ -0,0 +1,14 @@ +//// [noCatchBlock.ts] + +try { + // ... +} finally { + // N.B. No 'catch' block +} + +//// [noCatchBlock.js] +try { +} +finally { +} +//# sourceMappingURL=noCatchBlock.js.map \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.js.map b/tests/baselines/reference/noCatchBlock.js.map new file mode 100644 index 0000000000000..dccc7798c9275 --- /dev/null +++ b/tests/baselines/reference/noCatchBlock.js.map @@ -0,0 +1,2 @@ +//// [noCatchBlock.js.map] +{"version":3,"file":"noCatchBlock.js","sourceRoot":"","sources":["noCatchBlock.ts"],"names":[],"mappings":"AACA,IAAA,CAAC;AAED,CAAC;QAAC,CAAC;AAEH,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.sourcemap.txt b/tests/baselines/reference/noCatchBlock.sourcemap.txt new file mode 100644 index 0000000000000..8d5a67339f607 --- /dev/null +++ b/tests/baselines/reference/noCatchBlock.sourcemap.txt @@ -0,0 +1,53 @@ +=================================================================== +JsFile: noCatchBlock.js +mapUrl: noCatchBlock.js.map +sourceRoot: +sources: noCatchBlock.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/noCatchBlock.js +sourceFile:noCatchBlock.ts +------------------------------------------------------------------- +>>>try { +1 > +2 >^^^^ +3 > ^ +1 > + > +2 > +3 > t +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 1) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 2) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^-> +1 >ry { + > // ... + > +2 >} +1 >Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 2) Source(4, 2) + SourceIndex(0) +--- +>>>finally { +1->^^^^^^^^ +2 > ^ +1-> +2 > f +1->Emitted(3, 9) Source(4, 3) + SourceIndex(0) +2 >Emitted(3, 10) Source(4, 4) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >inally { + > // N.B. No 'catch' block + > +2 >} +1 >Emitted(4, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(6, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=noCatchBlock.js.map \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js new file mode 100644 index 0000000000000..8a485a2ebe25e --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.js @@ -0,0 +1,12 @@ +//// [noCollisionThisExpressionAndClassInGlobal.ts] +class _this { +} +var f = () => _this; + +//// [noCollisionThisExpressionAndClassInGlobal.js] +var _this = (function () { + function _this() { + } + return _this; +})(); +var f = function () { return _this; }; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt new file mode 100644 index 0000000000000..04b5ae07b6438 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInAccessors.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInAccessors.ts (4 errors) ==== + class class1 { + get a(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } + } + + return 10; + } + set a(val: number) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } + } + + } + } + + class class2 { + get a(): number { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(_this); + } + } + + return 10; + } + set a(val: number) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(_this); + } + } + + } + } \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js new file mode 100644 index 0000000000000..a01996848b13b --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.js @@ -0,0 +1,46 @@ +//// [noCollisionThisExpressionAndLocalVarInConstructor.ts] +class class1 { + constructor() { + var x2 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } + } + } +} + +class class2 { + constructor() { + var _this = 2; + var x2 = { + doStuff: (callback) => () => { + return callback(_this); + } + } + } +} + +//// [noCollisionThisExpressionAndLocalVarInConstructor.js] +var class1 = (function () { + function class1() { + var x2 = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + } + return class1; +})(); +var class2 = (function () { + function class2() { + var _this = 2; + var x2 = { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + } + return class2; +})(); diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js new file mode 100644 index 0000000000000..d144a78fae34a --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.js @@ -0,0 +1,17 @@ +//// [noCollisionThisExpressionAndLocalVarInFunction.ts] +var console: { + log(val: any); +} +function x() { + var _this = 5; + x => { console.log(_this); }; +} + +//// [noCollisionThisExpressionAndLocalVarInFunction.js] +var console; +function x() { + var _this = 5; + (function (x) { + console.log(_this); + }); +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js new file mode 100644 index 0000000000000..83f21d104252b --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.js @@ -0,0 +1,18 @@ +//// [noCollisionThisExpressionAndLocalVarInLambda.ts] +declare function alert(message?: any): void; +var x = { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } +} +alert(x.doStuff(x => alert(x))); + +//// [noCollisionThisExpressionAndLocalVarInLambda.js] +var x = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } +}; +alert(x.doStuff(function (x) { return alert(x); })); diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js new file mode 100644 index 0000000000000..b7e9cc7561fae --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.js @@ -0,0 +1,44 @@ +//// [noCollisionThisExpressionAndLocalVarInMethod.ts] +var _this = 2; +class a { + method1() { + return { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } + } + } + method2() { + var _this = 2; + return { + doStuff: (callback) => () => { + return callback(_this); + } + } + } +} + +//// [noCollisionThisExpressionAndLocalVarInMethod.js] +var _this = 2; +var a = (function () { + function a() { + } + a.prototype.method1 = function () { + return { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + }; + a.prototype.method2 = function () { + var _this = 2; + return { + doStuff: function (callback) { return function () { + return callback(_this); + }; } + }; + }; + return a; +})(); diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js new file mode 100644 index 0000000000000..da989bed263ff --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.js @@ -0,0 +1,44 @@ +//// [noCollisionThisExpressionAndLocalVarInProperty.ts] +class class1 { + public prop1 = { + doStuff: (callback) => () => { + var _this = 2; + return callback(_this); + } + } +} + +class class2 { + constructor() { + var _this = 2; + } + public prop1 = { + doStuff: (callback) => () => { + return callback(10); + } + } +} + +//// [noCollisionThisExpressionAndLocalVarInProperty.js] +var class1 = (function () { + function class1() { + this.prop1 = { + doStuff: function (callback) { return function () { + var _this = 2; + return callback(_this); + }; } + }; + } + return class1; +})(); +var class2 = (function () { + function class2() { + this.prop1 = { + doStuff: function (callback) { return function () { + return callback(10); + }; } + }; + var _this = 2; + } + return class2; +})(); diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js new file mode 100644 index 0000000000000..bea476ed09fef --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.js @@ -0,0 +1,7 @@ +//// [noCollisionThisExpressionAndVarInGlobal.ts] +var _this = 1; +var f = () => _this; + +//// [noCollisionThisExpressionAndVarInGlobal.js] +var _this = 1; +var f = function () { return _this; }; diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js new file mode 100644 index 0000000000000..c34ad4c97bd5d --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.js @@ -0,0 +1,18 @@ +//// [noCollisionThisExpressionInFunctionAndVarInGlobal.ts] +var console: { + log(val: any); +} +var _this = 5; +function x() { + x => { console.log(this); }; +} + +//// [noCollisionThisExpressionInFunctionAndVarInGlobal.js] +var console; +var _this = 5; +function x() { + var _this = this; + (function (x) { + console.log(_this); + }); +} diff --git a/tests/baselines/reference/noConstraintInReturnType1.js b/tests/baselines/reference/noConstraintInReturnType1.js new file mode 100644 index 0000000000000..0c9fe01bae8bc --- /dev/null +++ b/tests/baselines/reference/noConstraintInReturnType1.js @@ -0,0 +1,18 @@ +//// [noConstraintInReturnType1.ts] +class List { + static empty(): List { return null; } +} + + +//// [noConstraintInReturnType1.js] +var List = (function () { + function List() { + } + List.empty = function () { + return null; + }; + return List; +})(); + + +//// [noConstraintInReturnType1.d.ts] diff --git a/tests/baselines/reference/noErrorsInCallback.errors.txt b/tests/baselines/reference/noErrorsInCallback.errors.txt new file mode 100644 index 0000000000000..7ead7bc332794 --- /dev/null +++ b/tests/baselines/reference/noErrorsInCallback.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/noErrorsInCallback.ts (2 errors) ==== + class Bar { + constructor(public foo: string) { } + } + var one = new Bar({}); // Error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + [].forEach(() => { + var two = new Bar({}); // No error? + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + }); + \ No newline at end of file diff --git a/tests/baselines/reference/noErrorsInCallback.js b/tests/baselines/reference/noErrorsInCallback.js new file mode 100644 index 0000000000000..7cae7858db778 --- /dev/null +++ b/tests/baselines/reference/noErrorsInCallback.js @@ -0,0 +1,21 @@ +//// [noErrorsInCallback.ts] +class Bar { + constructor(public foo: string) { } +} +var one = new Bar({}); // Error +[].forEach(() => { + var two = new Bar({}); // No error? +}); + + +//// [noErrorsInCallback.js] +var Bar = (function () { + function Bar(foo) { + this.foo = foo; + } + return Bar; +})(); +var one = new Bar({}); +[].forEach(function () { + var two = new Bar({}); +}); diff --git a/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.js b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.js new file mode 100644 index 0000000000000..24425ff0d0ce9 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.js @@ -0,0 +1,16 @@ +//// [tests/cases/compiler/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.ts] //// + +//// [test.d.ts] +declare class Something +{ + private static someStaticVar; + private someVar; +} + +//// [app.ts] +/// +var x = new Something(); + + +//// [app.js] +var x = new Something(); diff --git a/tests/baselines/reference/noImplicitAnyForIn.errors.txt b/tests/baselines/reference/noImplicitAnyForIn.errors.txt new file mode 100644 index 0000000000000..589e10d833d1b --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForIn.errors.txt @@ -0,0 +1,42 @@ +==== tests/cases/compiler/noImplicitAnyForIn.ts (5 errors) ==== + + var x: {}[] = [[1, 2, 3], ["hello"]]; + + for (var i in x) { + for (var j in x[i]) { + + //Should yield an implicit 'any' error + var _j = x[i][j]; + ~~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + } + + for (var k in x[0]) { + var k1 = x[0]; + + //Should yield an implicit 'any' error + var k2 = k1[k]; + ~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + } + } + + for (var a in x) { + // Should yield an implicit 'any' error. + var b; + ~ +!!! Variable 'b' implicitly has an 'any' type. + + var c = a || b; + } + + var idx = 0; + var m = [1, 2, 3, 4, 5]; + // Should yield an implicit 'any' error. + var n = [[]] || []; + ~~~~~~~~~~~~~~ +!!! Variable 'n' implicitly has an 'any[][]' type. + + for (n[idx++] in m); + ~~~~~~~~ +!!! Variable declarations of a 'for' statement must be of types 'string' or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForIn.js b/tests/baselines/reference/noImplicitAnyForIn.js new file mode 100644 index 0000000000000..d60d08313ec8b --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForIn.js @@ -0,0 +1,53 @@ +//// [noImplicitAnyForIn.ts] + +var x: {}[] = [[1, 2, 3], ["hello"]]; + +for (var i in x) { + for (var j in x[i]) { + + //Should yield an implicit 'any' error + var _j = x[i][j]; + } + + for (var k in x[0]) { + var k1 = x[0]; + + //Should yield an implicit 'any' error + var k2 = k1[k]; + } +} + +for (var a in x) { + // Should yield an implicit 'any' error. + var b; + + var c = a || b; +} + +var idx = 0; +var m = [1, 2, 3, 4, 5]; +// Should yield an implicit 'any' error. +var n = [[]] || []; + +for (n[idx++] in m); + +//// [noImplicitAnyForIn.js] +var x = [[1, 2, 3], ["hello"]]; +for (var i in x) { + for (var j in x[i]) { + var _j = x[i][j]; + } + for (var k in x[0]) { + var k1 = x[0]; + var k2 = k1[k]; + } +} +for (var a in x) { + var b; + var c = a || b; +} +var idx = 0; +var m = [1, 2, 3, 4, 5]; +var n = [[]] || []; +for (n[idx++] in m) + ; diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt b/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt new file mode 100644 index 0000000000000..622914ea41902 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/noImplicitAnyForMethodParameters.ts (4 errors) ==== + declare class A { + private foo(a); // OK - ambient class and private method - no error + } + + declare class B { + public foo(a); // OK - ambient class and public method - error + ~~~~~~~~~~~~~~ +!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! Parameter 'a' implicitly has an 'any' type. + } + + class C { + private foo(a) { } // OK - non-ambient class and private method - error + ~ +!!! Parameter 'a' implicitly has an 'any' type. + } + class D { + public foo(a) { } // OK - non-ambient class and public method - error + ~ +!!! Parameter 'a' implicitly has an 'any' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.js b/tests/baselines/reference/noImplicitAnyForMethodParameters.js new file mode 100644 index 0000000000000..2ddc8b3f86eab --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.js @@ -0,0 +1,31 @@ +//// [noImplicitAnyForMethodParameters.ts] +declare class A { + private foo(a); // OK - ambient class and private method - no error +} + +declare class B { + public foo(a); // OK - ambient class and public method - error +} + +class C { + private foo(a) { } // OK - non-ambient class and private method - error +} +class D { + public foo(a) { } // OK - non-ambient class and public method - error +} + +//// [noImplicitAnyForMethodParameters.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (a) { + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (a) { + }; + return D; +})(); diff --git a/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt new file mode 100644 index 0000000000000..7d02a12556943 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/noImplicitAnyForwardReferencedInterface.ts (1 errors) ==== + declare var x: Entry; + + interface Entry { + // Should return error for implicit any. + new (); + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.js b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.js new file mode 100644 index 0000000000000..a212200ef0b97 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyForwardReferencedInterface.js @@ -0,0 +1,9 @@ +//// [noImplicitAnyForwardReferencedInterface.ts] +declare var x: Entry; + +interface Entry { + // Should return error for implicit any. + new (); +} + +//// [noImplicitAnyForwardReferencedInterface.js] diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt new file mode 100644 index 0000000000000..89c4ffe6ac7ad --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/noImplicitAnyFunctionExpressionAssignment.ts (2 errors) ==== + + var x: (a: any) => void = function (x: T) { + ~~~~~~~~~~~~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~ + }; + ~ +!!! Function expression, which lacks return-type annotation, implicitly has an 'any' return type. + + var x2: (a: any) => void = function f(x: T) { + ~~~~~~~~~~~~~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~ + }; + ~ +!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.js b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.js new file mode 100644 index 0000000000000..568d94c53bae3 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.js @@ -0,0 +1,17 @@ +//// [noImplicitAnyFunctionExpressionAssignment.ts] + +var x: (a: any) => void = function (x: T) { + return null; +}; + +var x2: (a: any) => void = function f(x: T) { + return null; +}; + +//// [noImplicitAnyFunctionExpressionAssignment.js] +var x = function (x) { + return null; +}; +var x2 = function f(x) { + return null; +}; diff --git a/tests/baselines/reference/noImplicitAnyFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyFunctions.errors.txt new file mode 100644 index 0000000000000..a3768a1c7a54d --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctions.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/noImplicitAnyFunctions.ts (5 errors) ==== + + declare function f1(); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! 'f1', which lacks return-type annotation, implicitly has an 'any' return type. + + declare function f2(): any; + + function f3(x) { + ~ +!!! Parameter 'x' implicitly has an 'any' type. + } + + function f4(x: any) { + return x; + } + + function f5(x: any): any { + return x; + } + + function f6(x: string, y: number); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type. + function f6(x: string, y: string): any; + function f6(x: string, y) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ +!!! Parameter 'y' implicitly has an 'any' type. + return null; + ~~~~~~~~~~~~~~~~ + } + ~ +!!! 'f6', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyFunctions.js b/tests/baselines/reference/noImplicitAnyFunctions.js new file mode 100644 index 0000000000000..57998188d9e4a --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctions.js @@ -0,0 +1,35 @@ +//// [noImplicitAnyFunctions.ts] + +declare function f1(); + +declare function f2(): any; + +function f3(x) { +} + +function f4(x: any) { + return x; +} + +function f5(x: any): any { + return x; +} + +function f6(x: string, y: number); +function f6(x: string, y: string): any; +function f6(x: string, y) { + return null; +} + +//// [noImplicitAnyFunctions.js] +function f3(x) { +} +function f4(x) { + return x; +} +function f5(x) { + return x; +} +function f6(x, y) { + return null; +} diff --git a/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt b/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt new file mode 100644 index 0000000000000..f96c1b9882787 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInBareInterface.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/noImplicitAnyInBareInterface.ts (2 errors) ==== + + interface Entry { + // Should return error for implicit any on `new` and `foo`. + new (); + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + few() : any; + foo(); + ~~~~~~ +!!! 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyInBareInterface.js b/tests/baselines/reference/noImplicitAnyInBareInterface.js new file mode 100644 index 0000000000000..0a3bbe1bb8ec4 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInBareInterface.js @@ -0,0 +1,10 @@ +//// [noImplicitAnyInBareInterface.ts] + +interface Entry { + // Should return error for implicit any on `new` and `foo`. + new (); + few() : any; + foo(); +} + +//// [noImplicitAnyInBareInterface.js] diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js new file mode 100644 index 0000000000000..7722165fd231a --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.js @@ -0,0 +1,9 @@ +//// [noImplicitAnyInContextuallyTypesFunctionParamter.ts] + +var regexMatchList = ['', '']; +regexMatchList.forEach(match => ''.replace(match, '')); + + +//// [noImplicitAnyInContextuallyTypesFunctionParamter.js] +var regexMatchList = ['', '']; +regexMatchList.forEach(function (match) { return ''.replace(match, ''); }); diff --git a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt new file mode 100644 index 0000000000000..857809c3e841f --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt @@ -0,0 +1,58 @@ +==== tests/cases/compiler/noImplicitAnyIndexing.ts (4 errors) ==== + + enum MyEmusEnum { + emu + } + + // Should be okay; should be a string. + var strRepresentation1 = MyEmusEnum[0] + + // Should be okay; should be a string. + var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] + + // Should be implicit 'any' ; property access fails, no string indexer. + var strRepresentation3 = MyEmusEnum["monehh"]; + ~~~~~~~~~~~~~~~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + + // Should be okay; should be a MyEmusEnum + var strRepresentation4 = MyEmusEnum["emu"]; + + + // Should report an implicit 'any'. + var x = {}["hi"]; + ~~~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + + // Should report an implicit 'any'. + var y = {}[10]; + ~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + + + var hi: any = "hi"; + + var emptyObj = {}; + + // Should report an implicit 'any'. + var z1 = emptyObj[hi]; + ~~~~~~~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. + var z2 = (emptyObj)[hi]; + + interface MyMap { + [key: string]: T; + } + + var m: MyMap = { + "0": 0, + "1": 1, + "2": 2, + "Okay that's enough for today.": NaN + }; + + var mResult1 = m[MyEmusEnum.emu]; + var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]]; + var mResult3 = m[hi]; + + \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyIndexing.js b/tests/baselines/reference/noImplicitAnyIndexing.js new file mode 100644 index 0000000000000..0e7bc3e328f7d --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyIndexing.js @@ -0,0 +1,75 @@ +//// [noImplicitAnyIndexing.ts] + +enum MyEmusEnum { + emu +} + +// Should be okay; should be a string. +var strRepresentation1 = MyEmusEnum[0] + +// Should be okay; should be a string. +var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] + +// Should be implicit 'any' ; property access fails, no string indexer. +var strRepresentation3 = MyEmusEnum["monehh"]; + +// Should be okay; should be a MyEmusEnum +var strRepresentation4 = MyEmusEnum["emu"]; + + +// Should report an implicit 'any'. +var x = {}["hi"]; + +// Should report an implicit 'any'. +var y = {}[10]; + + +var hi: any = "hi"; + +var emptyObj = {}; + +// Should report an implicit 'any'. +var z1 = emptyObj[hi]; +var z2 = (emptyObj)[hi]; + +interface MyMap { + [key: string]: T; +} + +var m: MyMap = { + "0": 0, + "1": 1, + "2": 2, + "Okay that's enough for today.": NaN +}; + +var mResult1 = m[MyEmusEnum.emu]; +var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]]; +var mResult3 = m[hi]; + + + +//// [noImplicitAnyIndexing.js] +var MyEmusEnum; +(function (MyEmusEnum) { + MyEmusEnum[MyEmusEnum["emu"] = 0] = "emu"; +})(MyEmusEnum || (MyEmusEnum = {})); +var strRepresentation1 = MyEmusEnum[0]; +var strRepresentation2 = MyEmusEnum[0 /* emu */]; +var strRepresentation3 = MyEmusEnum["monehh"]; +var strRepresentation4 = MyEmusEnum["emu"]; +var x = {}["hi"]; +var y = {}[10]; +var hi = "hi"; +var emptyObj = {}; +var z1 = emptyObj[hi]; +var z2 = emptyObj[hi]; +var m = { + "0": 0, + "1": 1, + "2": 2, + "Okay that's enough for today.": NaN +}; +var mResult1 = m[0 /* emu */]; +var mResult2 = m[MyEmusEnum[0 /* emu */]]; +var mResult3 = m[hi]; diff --git a/tests/baselines/reference/noImplicitAnyModule.errors.txt b/tests/baselines/reference/noImplicitAnyModule.errors.txt new file mode 100644 index 0000000000000..81e07fad9cb95 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyModule.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/noImplicitAnyModule.ts (4 errors) ==== + + declare module Module { + interface Interface { + // Should return error for implicit any on return type. + new (); + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + } + + class Class { + // Should return error for implicit `any` on parameter. + public f(x): any; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + public g(x: any); + ~~~~~~~~~~~~~~~~~ +!!! 'g', which lacks return-type annotation, implicitly has an 'any' return type. + + // Should not return error at all. + private h(x); + } + + // Should return error for implicit any on return type. + function f(x: number); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! 'f', which lacks return-type annotation, implicitly has an 'any' return type. + } + \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyModule.js b/tests/baselines/reference/noImplicitAnyModule.js new file mode 100644 index 0000000000000..9ce7309e370b7 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyModule.js @@ -0,0 +1,23 @@ +//// [noImplicitAnyModule.ts] + +declare module Module { + interface Interface { + // Should return error for implicit any on return type. + new (); + } + + class Class { + // Should return error for implicit `any` on parameter. + public f(x): any; + public g(x: any); + + // Should not return error at all. + private h(x); + } + + // Should return error for implicit any on return type. + function f(x: number); +} + + +//// [noImplicitAnyModule.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt new file mode 100644 index 0000000000000..d81e3e384047d --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt @@ -0,0 +1,155 @@ +==== tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts (31 errors) ==== + + declare class D_C { + // No implicit-'any' errors. + public pub_f1(): void; + + // Implicit-'any' errors for x. + public pub_f2(x): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + public pub_f3(x: any): void; + + // Implicit-'any' errors for x, y, and z. + public pub_f4(x, y, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + public pub_f5(x, y: any, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + public pub_f6(...r): void; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f7(x, ...r): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + public pub_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + public pub_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + public pub_f8(x3, y3): any; + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + public pub_f9: () => string; + + // Implicit-'any' error for x. + public pub_f10: (x) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + public pub_f11: (x, y, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + public pub_f12: (x, y: any, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + public pub_f13: (...r) => string; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f14: (x, ...r) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + /////////////////////////////////////////// + + // No implicit-'any' errors. + private priv_f1(): void; + + // No implicit-'any' errors. + private priv_f2(x): void; + + // No implicit-'any' errors. + private priv_f3(x: any): void; + + // No implicit-'any' errors. + private priv_f4(x, y, z): void; + + // No implicit-'any' errors. + private priv_f5(x, y: any, z): void; + + // No implicit-'any' errors. + private priv_f6(...r): void; + + // No implicit-'any' errors. + private priv_f7(x, ...r): void; + + // No implicit-'any' errors. + private priv_f8(x1, y1: number): any; + private priv_f8(x2: string, y2): any; + private priv_f8(x3, y3): any; + + // No implicit-'any' errors. + private priv_f9: () => string; + + // Implicit-'any' error for x. + private priv_f10: (x) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + private priv_f11: (x, y, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + private priv_f12: (x, y: any, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + private priv_f13: (...r) => string; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f14: (x, ...r) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js new file mode 100644 index 0000000000000..4af0a8c74a3e2 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js @@ -0,0 +1,95 @@ +//// [noImplicitAnyParametersInAmbientClass.ts] + +declare class D_C { + // No implicit-'any' errors. + public pub_f1(): void; + + // Implicit-'any' errors for x. + public pub_f2(x): void; + + // No implicit-'any' errors. + public pub_f3(x: any): void; + + // Implicit-'any' errors for x, y, and z. + public pub_f4(x, y, z): void; + + // Implicit-'any' errors for x, and z. + public pub_f5(x, y: any, z): void; + + // Implicit-'any[]' errors for r. + public pub_f6(...r): void; + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f7(x, ...r): void; + + // Implicit-'any' errors for x1, y2, x3, and y3. + public pub_f8(x1, y1: number): any; + public pub_f8(x2: string, y2): any; + public pub_f8(x3, y3): any; + + // No implicit-'any' errors. + public pub_f9: () => string; + + // Implicit-'any' error for x. + public pub_f10: (x) => string; + + // Implicit-'any' errors for x, y, and z. + public pub_f11: (x, y, z) => string; + + // Implicit-'any' errors for x and z. + public pub_f12: (x, y: any, z) => string; + + // Implicit-'any[]' error for r. + public pub_f13: (...r) => string; + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f14: (x, ...r) => string; + + /////////////////////////////////////////// + + // No implicit-'any' errors. + private priv_f1(): void; + + // No implicit-'any' errors. + private priv_f2(x): void; + + // No implicit-'any' errors. + private priv_f3(x: any): void; + + // No implicit-'any' errors. + private priv_f4(x, y, z): void; + + // No implicit-'any' errors. + private priv_f5(x, y: any, z): void; + + // No implicit-'any' errors. + private priv_f6(...r): void; + + // No implicit-'any' errors. + private priv_f7(x, ...r): void; + + // No implicit-'any' errors. + private priv_f8(x1, y1: number): any; + private priv_f8(x2: string, y2): any; + private priv_f8(x3, y3): any; + + // No implicit-'any' errors. + private priv_f9: () => string; + + // Implicit-'any' error for x. + private priv_f10: (x) => string; + + // Implicit-'any' errors for x, y, and z. + private priv_f11: (x, y, z) => string; + + // Implicit-'any' errors for x and z. + private priv_f12: (x, y: any, z) => string; + + // Implicit-'any[]' error for r. + private priv_f13: (...r) => string; + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f14: (x, ...r) => string; +} + +//// [noImplicitAnyParametersInAmbientClass.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt new file mode 100644 index 0000000000000..905ea1ac9f06c --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt @@ -0,0 +1,89 @@ +==== tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts (22 errors) ==== + + // No implicit-'any' errors. + declare function d_f1(): void; + + // Implicit-'any' errors for x. + declare function d_f2(x): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + declare function d_f3(x: any): void; + + // Implicit-'any' errors for x, y, and z. + declare function d_f4(x, y, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + declare function d_f5(x, y: any, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + declare function d_f6(...r): void; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + declare function d_f7(x, ...r): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + declare function d_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + declare function d_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + declare function d_f8(x3, y3): any; + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + declare var d_f9: () => string; + + // Implicit-'any' error for x. + declare var d_f10: (x) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + declare var d_f11: (x, y, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + declare var d_f12: (x, y: any, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + declare var d_f13: (...r) => string; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + declare var d_f14: (x, ...r) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js new file mode 100644 index 0000000000000..3e825c2b24fc2 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js @@ -0,0 +1,47 @@ +//// [noImplicitAnyParametersInAmbientFunctions.ts] + +// No implicit-'any' errors. +declare function d_f1(): void; + +// Implicit-'any' errors for x. +declare function d_f2(x): void; + +// No implicit-'any' errors. +declare function d_f3(x: any): void; + +// Implicit-'any' errors for x, y, and z. +declare function d_f4(x, y, z): void; + +// Implicit-'any' errors for x, and z. +declare function d_f5(x, y: any, z): void; + +// Implicit-'any[]' errors for r. +declare function d_f6(...r): void; + +// Implicit-'any'/'any[]' errors for x, r. +declare function d_f7(x, ...r): void; + +// Implicit-'any' errors for x1, y2, x3, and y3. +declare function d_f8(x1, y1: number): any; +declare function d_f8(x2: string, y2): any; +declare function d_f8(x3, y3): any; + +// No implicit-'any' errors. +declare var d_f9: () => string; + +// Implicit-'any' error for x. +declare var d_f10: (x) => string; + +// Implicit-'any' errors for x, y, and z. +declare var d_f11: (x, y, z) => string; + +// Implicit-'any' errors for x and z. +declare var d_f12: (x, y: any, z) => string; + +// Implicit-'any[]' error for r. +declare var d_f13: (...r) => string; + +// Implicit-'any'/'any[]' errors for x, r. +declare var d_f14: (x, ...r) => string; + +//// [noImplicitAnyParametersInAmbientFunctions.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt new file mode 100644 index 0000000000000..99779ab769726 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt @@ -0,0 +1,91 @@ +==== tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts (22 errors) ==== + + declare module D_M { + // No implicit-'any' errors. + function dm_f1(): void; + + // No implicit-'any' errors. + function dm_f2(x): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + function dm_f3(x: any): void; + + // No implicit-'any' errors. + function dm_f4(x, y, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // No implicit-'any' errors. + function dm_f5(x, y: any, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // No implicit-'any' errors. + function dm_f6(...r): void; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // No implicit-'any' errors. + function dm_f7(x, ...r): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // No implicit-'any' errors. + function dm_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + function dm_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + function dm_f8(x3, y3): any; + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + var dm_f9: () => string; + + // No implicit-'any' errors. + var dm_f10: (x) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + var dm_f11: (x, y, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // No implicit-'any' errors. + var dm_f12: (x, y: any, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // No implicit-'any' errors. + var dm_f13: (...r) => string; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // No implicit-'any' errors. + var dm_f14: (x, ...r) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js new file mode 100644 index 0000000000000..d35cbe9d9d48f --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js @@ -0,0 +1,49 @@ +//// [noImplicitAnyParametersInAmbientModule.ts] + +declare module D_M { + // No implicit-'any' errors. + function dm_f1(): void; + + // No implicit-'any' errors. + function dm_f2(x): void; + + // No implicit-'any' errors. + function dm_f3(x: any): void; + + // No implicit-'any' errors. + function dm_f4(x, y, z): void; + + // No implicit-'any' errors. + function dm_f5(x, y: any, z): void; + + // No implicit-'any' errors. + function dm_f6(...r): void; + + // No implicit-'any' errors. + function dm_f7(x, ...r): void; + + // No implicit-'any' errors. + function dm_f8(x1, y1: number): any; + function dm_f8(x2: string, y2): any; + function dm_f8(x3, y3): any; + + // No implicit-'any' errors. + var dm_f9: () => string; + + // No implicit-'any' errors. + var dm_f10: (x) => string; + + // No implicit-'any' errors. + var dm_f11: (x, y, z) => string; + + // No implicit-'any' errors. + var dm_f12: (x, y: any, z) => string; + + // No implicit-'any' errors. + var dm_f13: (...r) => string; + + // No implicit-'any' errors. + var dm_f14: (x, ...r) => string; +} + +//// [noImplicitAnyParametersInAmbientModule.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt new file mode 100644 index 0000000000000..ed49e1dbd1114 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt @@ -0,0 +1,89 @@ +==== tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts (22 errors) ==== + + // No implicit-'any' errors. + function f1(): void { } + + // Implicit-'any' error for x. + function f2(x): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + function f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + function f4(x, y, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + function f5(x, y: any, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + function f6(...r): void { } + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + function f7(x, ...r): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + function f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + function f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + function f8(x3, y3): any { } + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + var f9 = () => ""; + + // Implicit-'any' errors for x. + var f10 = (x) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + var f11 = (x, y, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + var f12 = (x, y: any, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + var f13 = (...r) => ""; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + var f14 = (x, ...r) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js new file mode 100644 index 0000000000000..cef6b8faa16fa --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.js @@ -0,0 +1,89 @@ +//// [noImplicitAnyParametersInBareFunctions.ts] + +// No implicit-'any' errors. +function f1(): void { } + +// Implicit-'any' error for x. +function f2(x): void { } + +// No implicit-'any' errors. +function f3(x: any): void { } + +// Implicit-'any' errors for x, y, and z. +function f4(x, y, z): void { } + +// Implicit-'any' errors for x, and z. +function f5(x, y: any, z): void { } + +// Implicit-'any[]' error for r. +function f6(...r): void { } + +// Implicit-'any'/'any[]' errors for x, r. +function f7(x, ...r): void { } + +// Implicit-'any' errors for x1, y2, x3, and y3. +function f8(x1, y1: number): any; +function f8(x2: string, y2): any; +function f8(x3, y3): any { } + +// No implicit-'any' errors. +var f9 = () => ""; + +// Implicit-'any' errors for x. +var f10 = (x) => ""; + +// Implicit-'any' errors for x, y, and z. +var f11 = (x, y, z) => ""; + +// Implicit-'any' errors for x and z. +var f12 = (x, y: any, z) => ""; + +// Implicit-'any[]' error for r. +var f13 = (...r) => ""; + +// Implicit-'any'/'any[]' errors for x, r. +var f14 = (x, ...r) => ""; + +//// [noImplicitAnyParametersInBareFunctions.js] +function f1() { +} +function f2(x) { +} +function f3(x) { +} +function f4(x, y, z) { +} +function f5(x, y, z) { +} +function f6() { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } +} +function f7(x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } +} +function f8(x3, y3) { +} +var f9 = function () { return ""; }; +var f10 = function (x) { return ""; }; +var f11 = function (x, y, z) { return ""; }; +var f12 = function (x, y, z) { return ""; }; +var f13 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + return ""; +}; +var f14 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + return ""; +}; diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt new file mode 100644 index 0000000000000..785ebe83b876c --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt @@ -0,0 +1,181 @@ +==== tests/cases/compiler/noImplicitAnyParametersInClass.ts (44 errors) ==== + + class C { + // No implicit-'any' errors. + public pub_f1(): void { } + + // Implicit-'any' errors for x. + public pub_f2(x): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + public pub_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + public pub_f4(x, y, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + public pub_f5(x, y: any, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + public pub_f6(...r): void { } + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f7(x, ...r): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + public pub_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + public pub_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + public pub_f8(x3, y3): any { } + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + public pub_f9 = () => ""; + + // Implicit-'any' errors for x. + public pub_f10 = (x) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + public pub_f11 = (x, y, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + public pub_f12 = (x, y: any, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + public pub_f13 = (...r) => ""; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f14 = (x, ...r) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + /////////////////////////////////////////// + + // No implicit-'any' errors. + private priv_f1(): void { } + + // Implicit-'any' errors for x. + private priv_f2(x): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + private priv_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + private priv_f4(x, y, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + private priv_f5(x, y: any, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + private priv_f6(...r): void { } + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f7(x, ...r): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + private priv_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + private priv_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + private priv_f8(x3, y3): any { } + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + private priv_f9 = () => ""; + + // Implicit-'any' errors for x. + private priv_f10 = (x) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + private priv_f11 = (x, y, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + private priv_f12 = (x, y: any, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + private priv_f13 = (...r) => ""; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f14 = (x, ...r) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.js b/tests/baselines/reference/noImplicitAnyParametersInClass.js new file mode 100644 index 0000000000000..d5373319766be --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInClass.js @@ -0,0 +1,184 @@ +//// [noImplicitAnyParametersInClass.ts] + +class C { + // No implicit-'any' errors. + public pub_f1(): void { } + + // Implicit-'any' errors for x. + public pub_f2(x): void { } + + // No implicit-'any' errors. + public pub_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + public pub_f4(x, y, z): void { } + + // Implicit-'any' errors for x, and z. + public pub_f5(x, y: any, z): void { } + + // Implicit-'any[]' errors for r. + public pub_f6(...r): void { } + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f7(x, ...r): void { } + + // Implicit-'any' errors for x1, y2, x3, and y3. + public pub_f8(x1, y1: number): any; + public pub_f8(x2: string, y2): any; + public pub_f8(x3, y3): any { } + + // No implicit-'any' errors. + public pub_f9 = () => ""; + + // Implicit-'any' errors for x. + public pub_f10 = (x) => ""; + + // Implicit-'any' errors for x, y, and z. + public pub_f11 = (x, y, z) => ""; + + // Implicit-'any' errors for x and z. + public pub_f12 = (x, y: any, z) => ""; + + // Implicit-'any[]' error for r. + public pub_f13 = (...r) => ""; + + // Implicit-'any'/'any[]' errors for x, r. + public pub_f14 = (x, ...r) => ""; + + /////////////////////////////////////////// + + // No implicit-'any' errors. + private priv_f1(): void { } + + // Implicit-'any' errors for x. + private priv_f2(x): void { } + + // No implicit-'any' errors. + private priv_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + private priv_f4(x, y, z): void { } + + // Implicit-'any' errors for x, and z. + private priv_f5(x, y: any, z): void { } + + // Implicit-'any[]' errors for r. + private priv_f6(...r): void { } + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f7(x, ...r): void { } + + // Implicit-'any' errors for x1, y2, x3, and y3. + private priv_f8(x1, y1: number): any; + private priv_f8(x2: string, y2): any; + private priv_f8(x3, y3): any { } + + // No implicit-'any' errors. + private priv_f9 = () => ""; + + // Implicit-'any' errors for x. + private priv_f10 = (x) => ""; + + // Implicit-'any' errors for x, y, and z. + private priv_f11 = (x, y, z) => ""; + + // Implicit-'any' errors for x and z. + private priv_f12 = (x, y: any, z) => ""; + + // Implicit-'any[]' error for r. + private priv_f13 = (...r) => ""; + + // Implicit-'any'/'any[]' errors for x, r. + private priv_f14 = (x, ...r) => ""; +} + +//// [noImplicitAnyParametersInClass.js] +var C = (function () { + function C() { + this.pub_f9 = function () { return ""; }; + this.pub_f10 = function (x) { return ""; }; + this.pub_f11 = function (x, y, z) { return ""; }; + this.pub_f12 = function (x, y, z) { return ""; }; + this.pub_f13 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + return ""; + }; + this.pub_f14 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + return ""; + }; + this.priv_f9 = function () { return ""; }; + this.priv_f10 = function (x) { return ""; }; + this.priv_f11 = function (x, y, z) { return ""; }; + this.priv_f12 = function (x, y, z) { return ""; }; + this.priv_f13 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + return ""; + }; + this.priv_f14 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + return ""; + }; + } + C.prototype.pub_f1 = function () { + }; + C.prototype.pub_f2 = function (x) { + }; + C.prototype.pub_f3 = function (x) { + }; + C.prototype.pub_f4 = function (x, y, z) { + }; + C.prototype.pub_f5 = function (x, y, z) { + }; + C.prototype.pub_f6 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + }; + C.prototype.pub_f7 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + }; + C.prototype.pub_f8 = function (x3, y3) { + }; + C.prototype.priv_f1 = function () { + }; + C.prototype.priv_f2 = function (x) { + }; + C.prototype.priv_f3 = function (x) { + }; + C.prototype.priv_f4 = function (x, y, z) { + }; + C.prototype.priv_f5 = function (x, y, z) { + }; + C.prototype.priv_f6 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + }; + C.prototype.priv_f7 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + }; + C.prototype.priv_f8 = function (x3, y3) { + }; + return C; +})(); diff --git a/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt new file mode 100644 index 0000000000000..c9bece57671dd --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt @@ -0,0 +1,106 @@ +==== tests/cases/compiler/noImplicitAnyParametersInInterface.ts (27 errors) ==== + + interface I { + // Implicit-'any' errors for first two call signatures, x1, x2, z2. + (); + ~~~ +!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. + (x1); + ~~~~~ +!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + (x2, y2: string, z2): any; + ~~ +!!! Parameter 'x2' implicitly has an 'any' type. + ~~ +!!! Parameter 'z2' implicitly has an 'any' type. + + // No implicit-'any' errors. + f1(): void; + + // Implicit-'any' errors for x. + f2(x): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + f3(x: any): void; + + // Implicit-'any' errors for x, y, and z. + f4(x, y, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x, and z. + f5(x, y: any, z): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + f6(...r): void; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + f7(x, ...r): void; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + f8(x3, y3): any; + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + f9: () => string; + + // Implicit-'any' errors for x. + f10: (x) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + f11: (x, y, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + f12: (x, y: any, z) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + f13: (...r) => string; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x, r. + f14: (x, ...r) => string; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInInterface.js b/tests/baselines/reference/noImplicitAnyParametersInInterface.js new file mode 100644 index 0000000000000..e8844fa1fad72 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInInterface.js @@ -0,0 +1,54 @@ +//// [noImplicitAnyParametersInInterface.ts] + +interface I { + // Implicit-'any' errors for first two call signatures, x1, x2, z2. + (); + (x1); + (x2, y2: string, z2): any; + + // No implicit-'any' errors. + f1(): void; + + // Implicit-'any' errors for x. + f2(x): void; + + // No implicit-'any' errors. + f3(x: any): void; + + // Implicit-'any' errors for x, y, and z. + f4(x, y, z): void; + + // Implicit-'any' errors for x, and z. + f5(x, y: any, z): void; + + // Implicit-'any[]' errors for r. + f6(...r): void; + + // Implicit-'any'/'any[]' errors for x, r. + f7(x, ...r): void; + + // Implicit-'any' errors for x1, y2, x3, and y3. + f8(x1, y1: number): any; + f8(x2: string, y2): any; + f8(x3, y3): any; + + // No implicit-'any' errors. + f9: () => string; + + // Implicit-'any' errors for x. + f10: (x) => string; + + // Implicit-'any' errors for x, y, and z. + f11: (x, y, z) => string; + + // Implicit-'any' errors for x and z. + f12: (x, y: any, z) => string; + + // Implicit-'any[]' error for r. + f13: (...r) => string; + + // Implicit-'any'/'any[]' errors for x, r. + f14: (x, ...r) => string; +} + +//// [noImplicitAnyParametersInInterface.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt new file mode 100644 index 0000000000000..87912f0dcfa6b --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt @@ -0,0 +1,91 @@ +==== tests/cases/compiler/noImplicitAnyParametersInModule.ts (22 errors) ==== + + module M { + // No implicit-'any' errors. + function m_f1(): void { } + + // Implicit-'any' error for x. + function m_f2(x): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // No implicit-'any' errors. + function m_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + function m_f4(x, y, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + function m_f5(x, y: any, z): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' error for r. + function m_f6(...r): void { } + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x and r. + function m_f7(x, ...r): void { } + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any' errors for x1, y2, x3, and y3. + function m_f8(x1, y1: number): any; + ~~ +!!! Parameter 'x1' implicitly has an 'any' type. + function m_f8(x2: string, y2): any; + ~~ +!!! Parameter 'y2' implicitly has an 'any' type. + function m_f8(x3, y3): any { } + ~~ +!!! Parameter 'x3' implicitly has an 'any' type. + ~~ +!!! Parameter 'y3' implicitly has an 'any' type. + + // No implicit-'any' errors. + var m_f9 = () => ""; + + // Implicit-'any' error for x. + var m_f10 = (x) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + + // Implicit-'any' errors for x, y, and z. + var m_f11 = (x, y, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'y' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any' errors for x and z. + var m_f12 = (x, y: any, z) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~ +!!! Parameter 'z' implicitly has an 'any' type. + + // Implicit-'any[]' errors for r. + var m_f13 = (...r) => ""; + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + + // Implicit-'any'/'any[]' errors for x and r. + var m_f14 = (x, ...r) => ""; + ~ +!!! Parameter 'x' implicitly has an 'any' type. + ~~~~ +!!! Rest parameter 'r' implicitly has an 'any[]' type. + } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.js b/tests/baselines/reference/noImplicitAnyParametersInModule.js new file mode 100644 index 0000000000000..d606f8d2f5386 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyParametersInModule.js @@ -0,0 +1,94 @@ +//// [noImplicitAnyParametersInModule.ts] + +module M { + // No implicit-'any' errors. + function m_f1(): void { } + + // Implicit-'any' error for x. + function m_f2(x): void { } + + // No implicit-'any' errors. + function m_f3(x: any): void { } + + // Implicit-'any' errors for x, y, and z. + function m_f4(x, y, z): void { } + + // Implicit-'any' errors for x and z. + function m_f5(x, y: any, z): void { } + + // Implicit-'any[]' error for r. + function m_f6(...r): void { } + + // Implicit-'any'/'any[]' errors for x and r. + function m_f7(x, ...r): void { } + + // Implicit-'any' errors for x1, y2, x3, and y3. + function m_f8(x1, y1: number): any; + function m_f8(x2: string, y2): any; + function m_f8(x3, y3): any { } + + // No implicit-'any' errors. + var m_f9 = () => ""; + + // Implicit-'any' error for x. + var m_f10 = (x) => ""; + + // Implicit-'any' errors for x, y, and z. + var m_f11 = (x, y, z) => ""; + + // Implicit-'any' errors for x and z. + var m_f12 = (x, y: any, z) => ""; + + // Implicit-'any[]' errors for r. + var m_f13 = (...r) => ""; + + // Implicit-'any'/'any[]' errors for x and r. + var m_f14 = (x, ...r) => ""; +} + +//// [noImplicitAnyParametersInModule.js] +var M; +(function (M) { + function m_f1() { + } + function m_f2(x) { + } + function m_f3(x) { + } + function m_f4(x, y, z) { + } + function m_f5(x, y, z) { + } + function m_f6() { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + } + function m_f7(x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + } + function m_f8(x3, y3) { + } + var m_f9 = function () { return ""; }; + var m_f10 = function (x) { return ""; }; + var m_f11 = function (x, y, z) { return ""; }; + var m_f12 = function (x, y, z) { return ""; }; + var m_f13 = function () { + var r = []; + for (var _i = 0; _i < arguments.length; _i++) { + r[_i - 0] = arguments[_i]; + } + return ""; + }; + var m_f14 = function (x) { + var r = []; + for (var _i = 1; _i < arguments.length; _i++) { + r[_i - 1] = arguments[_i]; + } + return ""; + }; +})(M || (M = {})); diff --git a/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt new file mode 100644 index 0000000000000..b3dce9b2f77d6 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/noImplicitAnyReferencingDeclaredInterface.ts (1 errors) ==== + + interface Entry { + // Should return error for implicit any. + new (); + ~~~~~~~ +!!! Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. + } + + declare var x: Entry; \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.js b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.js new file mode 100644 index 0000000000000..d688e84911c79 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyReferencingDeclaredInterface.js @@ -0,0 +1,10 @@ +//// [noImplicitAnyReferencingDeclaredInterface.ts] + +interface Entry { + // Should return error for implicit any. + new (); +} + +declare var x: Entry; + +//// [noImplicitAnyReferencingDeclaredInterface.js] diff --git a/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt new file mode 100644 index 0000000000000..c19ff9f396e3b --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/noImplicitAnyStringIndexerOnObject.ts (1 errors) ==== + + var x = {}["hello"]; + ~~~~~~~~~~~ +!!! Index signature of object type implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.js b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.js new file mode 100644 index 0000000000000..ab9ab1752a1f2 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyStringIndexerOnObject.js @@ -0,0 +1,6 @@ +//// [noImplicitAnyStringIndexerOnObject.ts] + +var x = {}["hello"]; + +//// [noImplicitAnyStringIndexerOnObject.js] +var x = {}["hello"]; diff --git a/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt b/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt new file mode 100644 index 0000000000000..490d3e41cfb89 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyWithOverloads.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/noImplicitAnyWithOverloads.ts (4 errors) ==== + interface A { + foo; + ~~~~ +!!! Member 'foo' implicitly has an 'any' type. + } + interface B { } + + function callb(lam: (l: A) => void); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'callb', which lacks return-type annotation, implicitly has an 'any' return type. + function callb(lam: (n: B) => void); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'callb', which lacks return-type annotation, implicitly has an 'any' return type. + function callb(a) { } + ~ +!!! Parameter 'a' implicitly has an 'any' type. + callb((a) => { a.foo; }); // error, chose first overload \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyWithOverloads.js b/tests/baselines/reference/noImplicitAnyWithOverloads.js new file mode 100644 index 0000000000000..e0eba16dacf45 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyWithOverloads.js @@ -0,0 +1,17 @@ +//// [noImplicitAnyWithOverloads.ts] +interface A { + foo; +} +interface B { } + +function callb(lam: (l: A) => void); +function callb(lam: (n: B) => void); +function callb(a) { } +callb((a) => { a.foo; }); // error, chose first overload + +//// [noImplicitAnyWithOverloads.js] +function callb(a) { +} +callb(function (a) { + a.foo; +}); diff --git a/tests/baselines/reference/noSelfOnVars.js b/tests/baselines/reference/noSelfOnVars.js new file mode 100644 index 0000000000000..2e1f5080c2671 --- /dev/null +++ b/tests/baselines/reference/noSelfOnVars.js @@ -0,0 +1,15 @@ +//// [noSelfOnVars.ts] +function foo() { + function bar() { } + var x = bar; +} + + + + +//// [noSelfOnVars.js] +function foo() { + function bar() { + } + var x = bar; +} diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt new file mode 100644 index 0000000000000..949364d138b1b --- /dev/null +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/noTypeArgumentOnReturnType1.ts (1 errors) ==== + class A{ + + foo(): A{ + ~ +!!! Generic type 'A' requires 1 type argument(s). + return null; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.js b/tests/baselines/reference/noTypeArgumentOnReturnType1.js new file mode 100644 index 0000000000000..ca13067c15ead --- /dev/null +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.js @@ -0,0 +1,17 @@ +//// [noTypeArgumentOnReturnType1.ts] +class A{ + + foo(): A{ + return null; + } +} + +//// [noTypeArgumentOnReturnType1.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return null; + }; + return A; +})(); diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.js b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.js new file mode 100644 index 0000000000000..3259b3287fa50 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.js @@ -0,0 +1,21 @@ +//// [nominalSubtypeCheckOfTypeParameter.ts] +interface Tuple { + first: T + second: S +} + +interface Sequence { + hasNext(): boolean + pop(): T + zip(seq: Sequence): Sequence> +} + +// error, despite the fact that the code explicitly says List extends Sequence, the current rules for infinitely expanding type references +// perform nominal subtyping checks that allow variance for type arguments, but not nominal subtyping for the generic type itself +interface List extends Sequence { + getLength(): number + zip(seq: Sequence): List> +} + + +//// [nominalSubtypeCheckOfTypeParameter.js] diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.js b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.js new file mode 100644 index 0000000000000..b0c3414e9dd19 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.js @@ -0,0 +1,25 @@ +//// [nominalSubtypeCheckOfTypeParameter2.ts] +interface B { + bar: T; +} + +// ok +interface A extends B { + foo: T; +} + +// ok +interface A2 extends B> { + baz: T; +} + +interface C { + bam: T; +} + +// ok +interface A3 extends B> { + bing: T; +} + +//// [nominalSubtypeCheckOfTypeParameter2.js] diff --git a/tests/baselines/reference/nonArrayRestArgs.errors.txt b/tests/baselines/reference/nonArrayRestArgs.errors.txt new file mode 100644 index 0000000000000..7262e0a92a7c2 --- /dev/null +++ b/tests/baselines/reference/nonArrayRestArgs.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/nonArrayRestArgs.ts (1 errors) ==== + function foo(...rest: number) { // error + ~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var x: string = rest[0]; + return x; + } \ No newline at end of file diff --git a/tests/baselines/reference/nonArrayRestArgs.js b/tests/baselines/reference/nonArrayRestArgs.js new file mode 100644 index 0000000000000..d16b7dea3466e --- /dev/null +++ b/tests/baselines/reference/nonArrayRestArgs.js @@ -0,0 +1,15 @@ +//// [nonArrayRestArgs.ts] +function foo(...rest: number) { // error + var x: string = rest[0]; + return x; +} + +//// [nonArrayRestArgs.js] +function foo() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i - 0] = arguments[_i]; + } + var x = rest[0]; + return x; +} diff --git a/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.js b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.js new file mode 100644 index 0000000000000..6e77029fa94f5 --- /dev/null +++ b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.js @@ -0,0 +1,12 @@ +//// [nonConflictingRecursiveBaseTypeMembers.ts] +interface A { + x: C +} + +interface B { + x: C +} + +interface C extends A, B { } // Should not be an error + +//// [nonConflictingRecursiveBaseTypeMembers.js] diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt b/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt new file mode 100644 index 0000000000000..e7d301b6edc99 --- /dev/null +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts (1 errors) ==== + interface Contextual { + dummy; + p?: number; + } + + interface Ellement { + dummy; + p: any; + } + + var c: Contextual; + var e: Ellement; + + // This should error. Even though we are contextually typing e with Contextual, the RHS still + // needs to be a supertype of the LHS to win as the best common type. + (c || e).dummy; + ~~~~~ +!!! Property 'dummy' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.js b/tests/baselines/reference/nonContextuallyTypedLogicalOr.js new file mode 100644 index 0000000000000..765b83e4091e5 --- /dev/null +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.js @@ -0,0 +1,22 @@ +//// [nonContextuallyTypedLogicalOr.ts] +interface Contextual { + dummy; + p?: number; +} + +interface Ellement { + dummy; + p: any; +} + +var c: Contextual; +var e: Ellement; + +// This should error. Even though we are contextually typing e with Contextual, the RHS still +// needs to be a supertype of the LHS to win as the best common type. +(c || e).dummy; + +//// [nonContextuallyTypedLogicalOr.js] +var c; +var e; +(c || e).dummy; diff --git a/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt new file mode 100644 index 0000000000000..f4f1fe043e7cd --- /dev/null +++ b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/nonExportedElementsOfMergedModules.ts (1 errors) ==== + module One { + enum A { X } + module B { + export var x; + } + } + + module One { + enum A { Y } + module B { + export var y; + } + B.x; + ~ +!!! Property 'x' does not exist on type 'typeof B'. + B.y; + } + \ No newline at end of file diff --git a/tests/baselines/reference/nonExportedElementsOfMergedModules.js b/tests/baselines/reference/nonExportedElementsOfMergedModules.js new file mode 100644 index 0000000000000..25efa8a7ec4e0 --- /dev/null +++ b/tests/baselines/reference/nonExportedElementsOfMergedModules.js @@ -0,0 +1,43 @@ +//// [nonExportedElementsOfMergedModules.ts] +module One { + enum A { X } + module B { + export var x; + } +} + +module One { + enum A { Y } + module B { + export var y; + } + B.x; + B.y; +} + + +//// [nonExportedElementsOfMergedModules.js] +var One; +(function (One) { + var A; + (function (A) { + A[A["X"] = 0] = "X"; + })(A || (A = {})); + var B; + (function (B) { + B.x; + })(B || (B = {})); +})(One || (One = {})); +var One; +(function (One) { + var A; + (function (A) { + A[A["Y"] = 0] = "Y"; + })(A || (A = {})); + var B; + (function (B) { + B.y; + })(B || (B = {})); + B.x; + B.y; +})(One || (One = {})); diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js new file mode 100644 index 0000000000000..a5254b5ffffc7 --- /dev/null +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -0,0 +1,26 @@ +//// [nonGenericClassExtendingGenericClassWithAny.ts] +class Foo { + t: T; +} + +class Bar extends Foo { } // Valid + +//// [nonGenericClassExtendingGenericClassWithAny.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + return Bar; +})(Foo); diff --git a/tests/baselines/reference/nonInstantiatedModule.js b/tests/baselines/reference/nonInstantiatedModule.js new file mode 100644 index 0000000000000..1284b38fe16cb --- /dev/null +++ b/tests/baselines/reference/nonInstantiatedModule.js @@ -0,0 +1,81 @@ +//// [nonInstantiatedModule.ts] +module M { + export interface Point { x: number; y: number } + export var a = 1; +} + +// primary expression +var m : typeof M; +var m = M; + +var a1: number; +var a1 = M.a; + +var a2: number; +var a2 = m.a; + +module M2 { + export module Point { + export function Origin(): Point { + return { x: 0, y: 0 }; + } + } + + export interface Point { + x: number; + y: number; + } +} + +var p: { x: number; y: number; }; +var p: M2.Point; + +var p2: { Origin() : { x: number; y: number; } }; +var p2: typeof M2.Point; + +module M3 { + export module Utils { + export interface Point { + x: number; y: number; + } + } + + export class Utils { + name: string; + } +} + +//// [nonInstantiatedModule.js] +var M; +(function (M) { + M.a = 1; +})(M || (M = {})); +var m; +var m = M; +var a1; +var a1 = M.a; +var a2; +var a2 = m.a; +var M2; +(function (M2) { + (function (Point) { + function Origin() { + return { x: 0, y: 0 }; + } + Point.Origin = Origin; + })(M2.Point || (M2.Point = {})); + var Point = M2.Point; +})(M2 || (M2 = {})); +var p; +var p; +var p2; +var p2; +var M3; +(function (M3) { + var Utils = (function () { + function Utils() { + } + return Utils; + })(); + M3.Utils = Utils; +})(M3 || (M3 = {})); diff --git a/tests/baselines/reference/null.js b/tests/baselines/reference/null.js new file mode 100644 index 0000000000000..499d6901847b4 --- /dev/null +++ b/tests/baselines/reference/null.js @@ -0,0 +1,41 @@ +//// [null.ts] +var x=null; +var y=3+x; +var z=3+null; +class C { +} +function f() { + return null; + return new C(); +} +function g() { + return null; + return 3; +} +interface I { + x:any; + y:number; +} +var w:I={x:null,y:3}; + + + + +//// [null.js] +var x = null; +var y = 3 + x; +var z = 3 + null; +var C = (function () { + function C() { + } + return C; +})(); +function f() { + return null; + return new C(); +} +function g() { + return null; + return 3; +} +var w = { x: null, y: 3 }; diff --git a/tests/baselines/reference/nullAssignableToEveryType.js b/tests/baselines/reference/nullAssignableToEveryType.js new file mode 100644 index 0000000000000..4901f4837bbda --- /dev/null +++ b/tests/baselines/reference/nullAssignableToEveryType.js @@ -0,0 +1,82 @@ +//// [nullAssignableToEveryType.ts] +class C { + foo: string; +} +var ac: C; +interface I { + foo: string; +} +var ai: I; + +enum E { A } +var ae: E; + +var b: number = null; +var c: string = null; +var d: boolean = null; +var e: Date = null; +var f: any = null; +var g: void = null; +var h: Object = null; +var i: {} = null; +var j: () => {} = null; +var k: Function = null; +var l: (x: number) => string = null; +ac = null; +ai = null; +ae = null; +var m: number[] = null; +var n: { foo: string } = null; +var o: (x: T) => T = null; +var p: Number = null; +var q: String = null; + +function foo(x: T, y: U, z: V) { + x = null; + y = null; + z = null; +} + +//function foo(x: T, y: U, z: V) { +// x = null; +// y = null; +// z = null; +//} + +//// [nullAssignableToEveryType.js] +var C = (function () { + function C() { + } + return C; +})(); +var ac; +var ai; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var ae; +var b = null; +var c = null; +var d = null; +var e = null; +var f = null; +var g = null; +var h = null; +var i = null; +var j = null; +var k = null; +var l = null; +ac = null; +ai = null; +ae = null; +var m = null; +var n = null; +var o = null; +var p = null; +var q = null; +function foo(x, y, z) { + x = null; + y = null; + z = null; +} diff --git a/tests/baselines/reference/nullAssignedToUndefined.errors.txt b/tests/baselines/reference/nullAssignedToUndefined.errors.txt new file mode 100644 index 0000000000000..964fec0d3bf11 --- /dev/null +++ b/tests/baselines/reference/nullAssignedToUndefined.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignedToUndefined.ts (1 errors) ==== + var x = undefined = null; // error + ~~~~~~~~~ +!!! Invalid left-hand side of assignment expression. + var y: typeof undefined = null; // ok, widened \ No newline at end of file diff --git a/tests/baselines/reference/nullAssignedToUndefined.js b/tests/baselines/reference/nullAssignedToUndefined.js new file mode 100644 index 0000000000000..b91acd88c0074 --- /dev/null +++ b/tests/baselines/reference/nullAssignedToUndefined.js @@ -0,0 +1,7 @@ +//// [nullAssignedToUndefined.ts] +var x = undefined = null; // error +var y: typeof undefined = null; // ok, widened + +//// [nullAssignedToUndefined.js] +var x = undefined = null; +var y = null; diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js new file mode 100644 index 0000000000000..c7f31731d0e6a --- /dev/null +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js @@ -0,0 +1,181 @@ +//// [nullIsSubtypeOfEverythingButUndefined.ts] +// null is a subtype of any other types except undefined + +var r0 = true ? null : null; +var r0 = true ? null : null; + +var u: typeof undefined; +var r0b = true ? u : null; +var r0b = true ? null : u; + +var r1 = true ? 1 : null; +var r1 = true ? null : 1; + +var r2 = true ? '' : null; +var r2 = true ? null : ''; + +var r3 = true ? true : null; +var r3 = true ? null : true; + +var r4 = true ? new Date() : null; +var r4 = true ? null : new Date(); + +var r5 = true ? /1/ : null; +var r5 = true ? null : /1/; + +var r6 = true ? { foo: 1 } : null; +var r6 = true ? null : { foo: 1 }; + +var r7 = true ? () => { } : null; +var r7 = true ? null : () => { }; + +var r8 = true ? (x: T) => { return x } : null; +var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations + +interface I1 { foo: number; } +var i1: I1; +var r9 = true ? i1 : null; +var r9 = true ? null : i1; + +class C1 { foo: number; } +var c1: C1; +var r10 = true ? c1 : null; +var r10 = true ? null : c1; + +class C2 { foo: T; } +var c2: C2; +var r12 = true ? c2 : null; +var r12 = true ? null : c2; + +enum E { A } +var r13 = true ? E : null; +var r13 = true ? null : E; + +var r14 = true ? E.A : null; +var r14 = true ? null : E.A; + +function f() { } +module f { + export var bar = 1; +} +var af: typeof f; +var r15 = true ? af : null; +var r15 = true ? null : af; + +class c { baz: string } +module c { + export var bar = 1; +} +var ac: typeof c; +var r16 = true ? ac : null; +var r16 = true ? null : ac; + +function f17(x: T) { + var r17 = true ? x : null; + var r17 = true ? null : x; +} + +function f18(x: U) { + var r18 = true ? x : null; + var r18 = true ? null : x; +} +//function f18(x: U) { +// var r18 = true ? x : null; +// var r18 = true ? null : x; +//} + +var r19 = true ? new Object() : null; +var r19 = true ? null : new Object(); + +var r20 = true ? {} : null; +var r20 = true ? null : {}; + + +//// [nullIsSubtypeOfEverythingButUndefined.js] +var r0 = true ? null : null; +var r0 = true ? null : null; +var u; +var r0b = true ? u : null; +var r0b = true ? null : u; +var r1 = true ? 1 : null; +var r1 = true ? null : 1; +var r2 = true ? '' : null; +var r2 = true ? null : ''; +var r3 = true ? true : null; +var r3 = true ? null : true; +var r4 = true ? new Date() : null; +var r4 = true ? null : new Date(); +var r5 = true ? /1/ : null; +var r5 = true ? null : /1/; +var r6 = true ? { foo: 1 } : null; +var r6 = true ? null : { foo: 1 }; +var r7 = true ? function () { +} : null; +var r7 = true ? null : function () { +}; +var r8 = true ? function (x) { + return x; +} : null; +var r8b = true ? null : function (x) { + return x; +}; +var i1; +var r9 = true ? i1 : null; +var r9 = true ? null : i1; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var c1; +var r10 = true ? c1 : null; +var r10 = true ? null : c1; +var C2 = (function () { + function C2() { + } + return C2; +})(); +var c2; +var r12 = true ? c2 : null; +var r12 = true ? null : c2; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var r13 = true ? E : null; +var r13 = true ? null : E; +var r14 = true ? 0 /* A */ : null; +var r14 = true ? null : 0 /* A */; +function f() { +} +var f; +(function (f) { + f.bar = 1; +})(f || (f = {})); +var af; +var r15 = true ? af : null; +var r15 = true ? null : af; +var c = (function () { + function c() { + } + return c; +})(); +var c; +(function (c) { + c.bar = 1; +})(c || (c = {})); +var ac; +var r16 = true ? ac : null; +var r16 = true ? null : ac; +function f17(x) { + var r17 = true ? x : null; + var r17 = true ? null : x; +} +function f18(x) { + var r18 = true ? x : null; + var r18 = true ? null : x; +} +var r19 = true ? new Object() : null; +var r19 = true ? null : new Object(); +var r20 = true ? {} : null; +var r20 = true ? null : {}; diff --git a/tests/baselines/reference/nullKeyword.errors.txt b/tests/baselines/reference/nullKeyword.errors.txt new file mode 100644 index 0000000000000..ab3616d777299 --- /dev/null +++ b/tests/baselines/reference/nullKeyword.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/nullKeyword.ts (1 errors) ==== + null.foo; + ~~~ +!!! Property 'foo' does not exist on type 'null'. \ No newline at end of file diff --git a/tests/baselines/reference/nullKeyword.js b/tests/baselines/reference/nullKeyword.js new file mode 100644 index 0000000000000..4aa74e0e46c7b --- /dev/null +++ b/tests/baselines/reference/nullKeyword.js @@ -0,0 +1,5 @@ +//// [nullKeyword.ts] +null.foo; + +//// [nullKeyword.js] +null.foo; diff --git a/tests/baselines/reference/numLit.errors.txt b/tests/baselines/reference/numLit.errors.txt new file mode 100644 index 0000000000000..97c80e656773c --- /dev/null +++ b/tests/baselines/reference/numLit.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/numLit.ts (2 errors) ==== + 1..toString(); + 1.0.toString(); + 1.toString(); + ~~~~~~~~ +!!! ';' expected. + ~~~~~~~~ +!!! Cannot find name 'toString'. + 1.+2.0 + 3. ; \ No newline at end of file diff --git a/tests/baselines/reference/numberAsInLHS.js b/tests/baselines/reference/numberAsInLHS.js new file mode 100644 index 0000000000000..d2fee353ab47a --- /dev/null +++ b/tests/baselines/reference/numberAsInLHS.js @@ -0,0 +1,5 @@ +//// [numberAsInLHS.ts] +3 in [0, 1] + +//// [numberAsInLHS.js] +3 in [0, 1]; diff --git a/tests/baselines/reference/numberAssignableToEnum.js b/tests/baselines/reference/numberAssignableToEnum.js new file mode 100644 index 0000000000000..888aa9f7f2046 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnum.js @@ -0,0 +1,16 @@ +//// [numberAssignableToEnum.ts] +enum E { A } +var n: number; +var e: E; +e = n; +n = e; + +//// [numberAssignableToEnum.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var n; +var e; +e = n; +n = e; diff --git a/tests/baselines/reference/numberOnLeftSideOfInExpression.js b/tests/baselines/reference/numberOnLeftSideOfInExpression.js new file mode 100644 index 0000000000000..d7a180cb578fb --- /dev/null +++ b/tests/baselines/reference/numberOnLeftSideOfInExpression.js @@ -0,0 +1,9 @@ +//// [numberOnLeftSideOfInExpression.ts] +var left: number; +var right: any; +left in right; + +//// [numberOnLeftSideOfInExpression.js] +var left; +var right; +left in right; diff --git a/tests/baselines/reference/numberPropertyAccess.js b/tests/baselines/reference/numberPropertyAccess.js new file mode 100644 index 0000000000000..cf5d075d0b9ba --- /dev/null +++ b/tests/baselines/reference/numberPropertyAccess.js @@ -0,0 +1,14 @@ +//// [numberPropertyAccess.ts] +var x = 1; +var a = x.toExponential(); +var b = x.hasOwnProperty('toFixed'); + +var c = x['toExponential'](); +var d = x['hasOwnProperty']('toFixed'); + +//// [numberPropertyAccess.js] +var x = 1; +var a = x.toExponential(); +var b = x.hasOwnProperty('toFixed'); +var c = x['toExponential'](); +var d = x['hasOwnProperty']('toFixed'); diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt new file mode 100644 index 0000000000000..655bd6f99db03 --- /dev/null +++ b/tests/baselines/reference/numberToString.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/numberToString.ts (2 errors) ==== + function f1(n:number):string { + return n; // error return type mismatch + ~ +!!! Type 'number' is not assignable to type 'string'. + } + + function f2(s:string):void { + } + + f1(3); + f2(3); // error no coercion to string + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2(3+""); // ok + operator promotes + \ No newline at end of file diff --git a/tests/baselines/reference/numberToString.js b/tests/baselines/reference/numberToString.js new file mode 100644 index 0000000000000..52ac05b342357 --- /dev/null +++ b/tests/baselines/reference/numberToString.js @@ -0,0 +1,22 @@ +//// [numberToString.ts] +function f1(n:number):string { + return n; // error return type mismatch +} + +function f2(s:string):void { +} + +f1(3); +f2(3); // error no coercion to string +f2(3+""); // ok + operator promotes + + +//// [numberToString.js] +function f1(n) { + return n; +} +function f2(s) { +} +f1(3); +f2(3); +f2(3 + ""); diff --git a/tests/baselines/reference/numericClassMembers1.errors.txt b/tests/baselines/reference/numericClassMembers1.errors.txt new file mode 100644 index 0000000000000..160c6e88207da --- /dev/null +++ b/tests/baselines/reference/numericClassMembers1.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/numericClassMembers1.ts (2 errors) ==== + class C234 { + 0 = 1; + 0.0 = 2; + ~~~ +!!! Duplicate identifier '0.0'. + } + + class C235 { + 0.0 = 1; + '0' = 2; + ~~~ +!!! Duplicate identifier ''0''. + } + + class C236 { + '0.0' = 1; + '0' = 2; + } + \ No newline at end of file diff --git a/tests/baselines/reference/numericClassMembers1.js b/tests/baselines/reference/numericClassMembers1.js new file mode 100644 index 0000000000000..4b17677b8a446 --- /dev/null +++ b/tests/baselines/reference/numericClassMembers1.js @@ -0,0 +1,39 @@ +//// [numericClassMembers1.ts] +class C234 { + 0 = 1; + 0.0 = 2; +} + +class C235 { + 0.0 = 1; + '0' = 2; +} + +class C236 { + '0.0' = 1; + '0' = 2; +} + + +//// [numericClassMembers1.js] +var C234 = (function () { + function C234() { + this[0] = 1; + this[0.0] = 2; + } + return C234; +})(); +var C235 = (function () { + function C235() { + this[0.0] = 1; + this['0'] = 2; + } + return C235; +})(); +var C236 = (function () { + function C236() { + this['0.0'] = 1; + this['0'] = 2; + } + return C236; +})(); diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt new file mode 100644 index 0000000000000..b471b45c7dd13 --- /dev/null +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/numericIndexExpressions.ts (4 errors) ==== + interface Numbers1 { + 1: string; + } + interface Strings1 { + '1': string; + } + + + var x: Numbers1; + x[1] = 4; // error + ~~~~ +!!! Type 'number' is not assignable to type 'string'. + x['1'] = 4; // error + ~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + + var y: Strings1; + y['1'] = 4; // should be error + ~~~~~~ +!!! Type 'number' is not assignable to type 'string'. + y[1] = 4; // should be error + ~~~~ +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexExpressions.js b/tests/baselines/reference/numericIndexExpressions.js new file mode 100644 index 0000000000000..c7c636293ac4c --- /dev/null +++ b/tests/baselines/reference/numericIndexExpressions.js @@ -0,0 +1,24 @@ +//// [numericIndexExpressions.ts] +interface Numbers1 { + 1: string; +} +interface Strings1 { + '1': string; +} + + +var x: Numbers1; +x[1] = 4; // error +x['1'] = 4; // error + +var y: Strings1; +y['1'] = 4; // should be error +y[1] = 4; // should be error + +//// [numericIndexExpressions.js] +var x; +x[1] = 4; +x['1'] = 4; +var y; +y['1'] = 4; +y[1] = 4; diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt new file mode 100644 index 0000000000000..3430ff4927b0f --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -0,0 +1,147 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts (14 errors) ==== + // String indexer types constrain the types of named properties in their containing type + + interface MyNumber extends Number { + foo: number; + } + + class C { + [x: number]: string; + + constructor() { } // ok + + a: string; // ok + b: number; // ok + c: () => {} // ok + "d": string; // ok + "e": number; // ok + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. + 3.0: MyNumber // error + ~~~~~~~~~~~~~ +!!! Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. + + get X() { // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return ''; + } + set X(v) { } // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + foo() { + return ''; + } + + static sa: number; // ok + static sb: string; // ok + + static foo() { } // ok + static get X() { // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + } + + interface I { + [x: number]: string; + + a: string; // ok + b: number; // ok + c: () => {} // ok + "d": string; // ok + "e": number; // ok + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. + (): string; // ok + (x): number // ok + foo(): string; // ok + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. + f: MyNumber; // error + } + + var a: { + [x: number]: string; + + a: string; // ok + b: number; // ok + c: () => {} // ok + "d": string; // ok + "e": number; // ok + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to numeric index type 'string'. + (): string; // ok + (x): number // ok + foo(): string; // ok + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to numeric index type 'string'. + f: MyNumber; // error + } + + // error + var b: { [x: number]: string; } = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + a: '', + ~~~~~~~~~~ + b: 1, + ~~~~~~~~~~ + c: () => { }, + ~~~~~~~~~~~~~~~~~~ + "d": '', + ~~~~~~~~~~~~~ + "e": 1, + ~~~~~~~~~~~~ + 1.0: '', + ~~~~~~~~~~~~ + 2.0: 1, + ~~~~~~~~~~~~ + "3.0": '', + ~~~~~~~~~~~~~~~ + "4.0": 1, + ~~~~~~~~~~~~~~ + f: null, + ~~~~~~~~~~~~~~~~~~ + ~~~ +!!! Cannot find name 'Myn'. + + + get X() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + set X(v) { }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~ + foo() { + ~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! Type '{ [x: number]: {}; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: unknown; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': +!!! Index signatures are incompatible: +!!! Type '{}' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt new file mode 100644 index 0000000000000..e02f4a31450ce --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -0,0 +1,69 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts (7 errors) ==== + // String indexer providing a constraint of a user defined type + + class A { + foo(): string { return ''; } + } + + class B extends A { + bar(): string { return ''; } + } + + class Foo { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + ~~~~~~~~~~~~ +!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. + "4.0": string; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. + } + + interface Foo2 { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + ~~~~~~~~~~~~ +!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. + "4.0": string; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. + } + + var a: { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + ~~~~~~~~~~~~ +!!! Property '3.0' of type 'number' is not assignable to numeric index type 'A'. + "4.0": string; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'string' is not assignable to numeric index type 'A'. + }; + + // error + var b: { [x: number]: A } = { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + 1.0: new A(), + ~~~~~~~~~~~~~~~~~~ + 2.0: new B(), + ~~~~~~~~~~~~~~~~~~ + "2.5": new B(), + ~~~~~~~~~~~~~~~~~~~ + 3.0: 1, + ~~~~~~~~~~~ + "4.0": '' + ~~~~~~~~~~~~~ + } + ~ +!!! Type '{ [x: number]: {}; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': +!!! Index signatures are incompatible: +!!! Type '{}' is not assignable to type 'A': +!!! Property 'foo' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js new file mode 100644 index 0000000000000..16b5c0f1470f8 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -0,0 +1,85 @@ +//// [numericIndexerConstrainsPropertyDeclarations2.ts] +// String indexer providing a constraint of a user defined type + +class A { + foo(): string { return ''; } +} + +class B extends A { + bar(): string { return ''; } +} + +class Foo { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + "4.0": string; // error +} + +interface Foo2 { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + "4.0": string; // error +} + +var a: { + [x: number]: A; + 1.0: A; // ok + 2.0: B; // ok + "2.5": B // ok + 3.0: number; // error + "4.0": string; // error +}; + +// error +var b: { [x: number]: A } = { + 1.0: new A(), + 2.0: new B(), + "2.5": new B(), + 3.0: 1, + "4.0": '' +} + +//// [numericIndexerConstrainsPropertyDeclarations2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ''; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return ''; + }; + return B; +})(A); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var a; +var b = { + 1.0: new A(), + 2.0: new B(), + "2.5": new B(), + 3.0: 1, + "4.0": '' +}; diff --git a/tests/baselines/reference/numericIndexerConstraint.errors.txt b/tests/baselines/reference/numericIndexerConstraint.errors.txt new file mode 100644 index 0000000000000..4ff9b00897e0a --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/numericIndexerConstraint.ts (1 errors) ==== + class C { + 0: number; + ~~~~~~~~~~ +!!! Property '0' of type 'number' is not assignable to numeric index type 'RegExp'. + [x: number]: RegExp; + } \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint.js b/tests/baselines/reference/numericIndexerConstraint.js new file mode 100644 index 0000000000000..38fe6b58d66a1 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint.js @@ -0,0 +1,12 @@ +//// [numericIndexerConstraint.ts] +class C { + 0: number; + [x: number]: RegExp; +} + +//// [numericIndexerConstraint.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt new file mode 100644 index 0000000000000..99a41c85c7c06 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/numericIndexerConstraint1.ts (1 errors) ==== + class Foo { foo() { } } + var x: { [index: string]: number; }; + var result: Foo = x["one"]; // error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'Foo': +!!! Property 'foo' is missing in type 'Number'. + \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint1.js b/tests/baselines/reference/numericIndexerConstraint1.js new file mode 100644 index 0000000000000..e587ed6753ce2 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint1.js @@ -0,0 +1,16 @@ +//// [numericIndexerConstraint1.ts] +class Foo { foo() { } } +var x: { [index: string]: number; }; +var result: Foo = x["one"]; // error + + +//// [numericIndexerConstraint1.js] +var Foo = (function () { + function Foo() { + } + Foo.prototype.foo = function () { + }; + return Foo; +})(); +var x; +var result = x["one"]; diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt new file mode 100644 index 0000000000000..1bd9aea28d1f1 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/numericIndexerConstraint2.ts (1 errors) ==== + class Foo { foo() { } } + var x: { [index: string]: Foo; }; + var a: { one: number; }; + x = a; + ~ +!!! Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': +!!! Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint2.js b/tests/baselines/reference/numericIndexerConstraint2.js new file mode 100644 index 0000000000000..edc9df36a131b --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint2.js @@ -0,0 +1,17 @@ +//// [numericIndexerConstraint2.ts] +class Foo { foo() { } } +var x: { [index: string]: Foo; }; +var a: { one: number; }; +x = a; + +//// [numericIndexerConstraint2.js] +var Foo = (function () { + function Foo() { + } + Foo.prototype.foo = function () { + }; + return Foo; +})(); +var x; +var a; +x = a; diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js new file mode 100644 index 0000000000000..4f4fd826c25f6 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -0,0 +1,38 @@ +//// [numericIndexerConstraint3.ts] +class A { + foo: number; +} + +class B extends A { + bar: string; +} + +class C { + 0: B; + [x: number]: A; +} + +//// [numericIndexerConstraint3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js new file mode 100644 index 0000000000000..531c450e7e164 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -0,0 +1,33 @@ +//// [numericIndexerConstraint4.ts] +class A { + foo: number; +} + +class B extends A { + bar: string; +} + +var x: { + [idx: number]: A; +} = { data: new B() } + +//// [numericIndexerConstraint4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var x = { data: new B() }; diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt new file mode 100644 index 0000000000000..8725a3879fa0a --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/numericIndexerConstraint5.ts (1 errors) ==== + var x = { name: "x", 0: new Date() }; + var z: { [name: number]: string } = x; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': +!!! Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint5.js b/tests/baselines/reference/numericIndexerConstraint5.js new file mode 100644 index 0000000000000..3ad19f75d0b1d --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint5.js @@ -0,0 +1,7 @@ +//// [numericIndexerConstraint5.ts] +var x = { name: "x", 0: new Date() }; +var z: { [name: number]: string } = x; + +//// [numericIndexerConstraint5.js] +var x = { name: "x", 0: new Date() }; +var z = x; diff --git a/tests/baselines/reference/numericIndexerTyping1.errors.txt b/tests/baselines/reference/numericIndexerTyping1.errors.txt new file mode 100644 index 0000000000000..2f8c12d7d0025 --- /dev/null +++ b/tests/baselines/reference/numericIndexerTyping1.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/numericIndexerTyping1.ts (2 errors) ==== + interface I { + [x: string]: Date; + } + + interface I2 extends I { + } + + var i: I; + var r: string = i[1]; // error: numeric indexer returns the type of the string indexer + ~~~~~~~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'string'. + + var i2: I2; + var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexer + ~~~~~~~~~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping1.js b/tests/baselines/reference/numericIndexerTyping1.js new file mode 100644 index 0000000000000..7e4a1f07de550 --- /dev/null +++ b/tests/baselines/reference/numericIndexerTyping1.js @@ -0,0 +1,19 @@ +//// [numericIndexerTyping1.ts] +interface I { + [x: string]: Date; +} + +interface I2 extends I { +} + +var i: I; +var r: string = i[1]; // error: numeric indexer returns the type of the string indexer + +var i2: I2; +var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexer + +//// [numericIndexerTyping1.js] +var i; +var r = i[1]; +var i2; +var r2 = i2[1]; diff --git a/tests/baselines/reference/numericIndexerTyping2.errors.txt b/tests/baselines/reference/numericIndexerTyping2.errors.txt new file mode 100644 index 0000000000000..961f424ea966a --- /dev/null +++ b/tests/baselines/reference/numericIndexerTyping2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/numericIndexerTyping2.ts (2 errors) ==== + class I { + [x: string]: Date + } + + class I2 extends I { + } + + var i: I; + var r: string = i[1]; // error: numeric indexer returns the type of the string indexer + ~~~~~~~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'string'. + + var i2: I2; + var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere + ~~~~~~~~~~~~~~~~~~ +!!! Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js new file mode 100644 index 0000000000000..6e6a9396be1e7 --- /dev/null +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -0,0 +1,37 @@ +//// [numericIndexerTyping2.ts] +class I { + [x: string]: Date +} + +class I2 extends I { +} + +var i: I; +var r: string = i[1]; // error: numeric indexer returns the type of the string indexer + +var i2: I2; +var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere + +//// [numericIndexerTyping2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var I = (function () { + function I() { + } + return I; +})(); +var I2 = (function (_super) { + __extends(I2, _super); + function I2() { + _super.apply(this, arguments); + } + return I2; +})(I); +var i; +var r = i[1]; +var i2; +var r2 = i2[1]; diff --git a/tests/baselines/reference/numericIndexingResults.js b/tests/baselines/reference/numericIndexingResults.js new file mode 100644 index 0000000000000..70c6e15d15ae9 --- /dev/null +++ b/tests/baselines/reference/numericIndexingResults.js @@ -0,0 +1,101 @@ +//// [numericIndexingResults.ts] +class C { + [x: number]: string; + 1 = ''; + "2" = '' +} + +var c: C; +var r1 = c['1']; +var r2 = c['2']; +var r3 = c['3']; +var r4 = c[1]; +var r5 = c[2]; +var r6 = c[3]; + +interface I { + [x: number]: string; + 1: string; + "2": string; +} + +var i: I +var r1 = i['1']; +var r2 = i['2']; +var r3 = i['3']; +var r4 = i[1]; +var r5 = i[2]; +var r6 = i[3]; + +var a: { + [x: number]: string; + 1: string; + "2": string; +} + +var r1 = a['1']; +var r2 = a['2']; +var r3 = a['3']; +var r4 = a[1]; +var r5 = a[2]; +var r6 = a[3]; + +var b: { [x: number]: string } = { 1: '', "2": '' } +var r1a = b['1']; +var r2a = b['2']; +var r3 = b['3']; +var r4 = b[1]; +var r5 = b[2]; +var r6 = b[3]; + +var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } +var r1b = b2['1']; +var r2b = b2['2']; +var r3 = b2['3']; +var r4 = b2[1]; +var r5 = b2[2]; +var r6 = b2[3]; + +//// [numericIndexingResults.js] +var C = (function () { + function C() { + this[1] = ''; + this["2"] = ''; + } + return C; +})(); +var c; +var r1 = c['1']; +var r2 = c['2']; +var r3 = c['3']; +var r4 = c[1]; +var r5 = c[2]; +var r6 = c[3]; +var i; +var r1 = i['1']; +var r2 = i['2']; +var r3 = i['3']; +var r4 = i[1]; +var r5 = i[2]; +var r6 = i[3]; +var a; +var r1 = a['1']; +var r2 = a['2']; +var r3 = a['3']; +var r4 = a[1]; +var r5 = a[2]; +var r6 = a[3]; +var b = { 1: '', "2": '' }; +var r1a = b['1']; +var r2a = b['2']; +var r3 = b['3']; +var r4 = b[1]; +var r5 = b[2]; +var r6 = b[3]; +var b2 = { 1: '', "2": '' }; +var r1b = b2['1']; +var r2b = b2['2']; +var r3 = b2['3']; +var r4 = b2[1]; +var r5 = b2[2]; +var r6 = b2[3]; diff --git a/tests/baselines/reference/numericMethodName1.js b/tests/baselines/reference/numericMethodName1.js new file mode 100644 index 0000000000000..294e5a1491b63 --- /dev/null +++ b/tests/baselines/reference/numericMethodName1.js @@ -0,0 +1,13 @@ +//// [numericMethodName1.ts] +class C { + 1 = 2; +} + + +//// [numericMethodName1.js] +var C = (function () { + function C() { + this[1] = 2; + } + return C; +})(); diff --git a/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt new file mode 100644 index 0000000000000..7ecf5f15824df --- /dev/null +++ b/tests/baselines/reference/numericNamedPropertyDuplicates.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericNamedPropertyDuplicates.ts (6 errors) ==== + class C { + 1: number; + 1.0: number; + ~~~ +!!! Duplicate identifier '1.0'. + static 2: number; + static 2: number; + ~ +!!! Duplicate identifier '2'. + } + + interface I { + 2: number; + 2.: number; + ~~ +!!! Duplicate identifier '2.'. + } + + var a: { + 1: number; + 1: number; + ~ +!!! Duplicate identifier '1'. + } + + var b = { + 2: 1 + 2: 1 + ~ +!!! ',' expected. + ~ +!!! Duplicate identifier '2'. + } \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt new file mode 100644 index 0000000000000..ddde515f49841 --- /dev/null +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts (4 errors) ==== + // Each of these types has an error in it. + // String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. + class C { + "1": number; + "1.0": number; // not a duplicate + 1.0: number; + ~~~ +!!! Duplicate identifier '1.0'. + } + + interface I { + "1": number; + "1.": number; // not a duplicate + 1: number; + ~ +!!! Duplicate identifier '1'. + } + + var a: { + "1": number; + 1.0: string; + ~~~ +!!! Duplicate identifier '1.0'. + } + + var b = { + "0": '', + 0: '' + ~ +!!! Duplicate identifier '0'. + } \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.js b/tests/baselines/reference/numericStringNamedPropertyEquivalence.js new file mode 100644 index 0000000000000..476dd22b3551b --- /dev/null +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.js @@ -0,0 +1,36 @@ +//// [numericStringNamedPropertyEquivalence.ts] +// Each of these types has an error in it. +// String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. +class C { + "1": number; + "1.0": number; // not a duplicate + 1.0: number; +} + +interface I { + "1": number; + "1.": number; // not a duplicate + 1: number; +} + +var a: { + "1": number; + 1.0: string; +} + +var b = { + "0": '', + 0: '' +} + +//// [numericStringNamedPropertyEquivalence.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { + "0": '', + 0: '' +}; diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt new file mode 100644 index 0000000000000..be9704ab9a495 --- /dev/null +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts (2 errors) ==== + class A { + constructor(public a1: string) { + } + } + function foo(x = new A(123)) { //should error, 123 is not string + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + }} + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt new file mode 100644 index 0000000000000..d4bafcbc9cd20 --- /dev/null +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/compiler/objectCreationOfElementAccessExpression.ts (4 errors) ==== + class Food { + private amount: number; + constructor(public name: string) { + this.amount = 100; + } + public eat(amountToEat: number): boolean { + this.amount -= amountToEat; + if (this.amount <= 0) { + this.amount = 0; + return false; + } + else { + return true; + } + } + } + class MonsterFood extends Food { + constructor(name: string, public flavor: string) { + super(name); + } + } + class IceCream extends MonsterFood { + private isDairyFree: boolean; + constructor(public flavor: string) { + super("Ice Cream", flavor); + } + } + class Cookie extends MonsterFood { + constructor(public flavor: string, public isGlutenFree: boolean) { + super("Cookie", flavor); + } + } + class PetFood extends Food { + constructor(name: string, public whereToBuy: number) { + super(name); + } + } + class ExpensiveOrganicDogFood extends PetFood { + constructor(public whereToBuy: number) { + super("Origen", whereToBuy); + } + } + class ExpensiveOrganicCatFood extends PetFood { + constructor(public whereToBuy: number, public containsFish: boolean) { + super("Nature's Logic", whereToBuy); + } + } + class Slug { + // This is NOT a food!!! + } + + // ElementAccessExpressions can only contain one expression. There should be a parse error here. + var foods = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An index expression argument must be of type 'string', 'number', or 'any'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? + var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! An index expression argument must be of type 'string', 'number', or 'any'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Value of type 'typeof Cookie' is not callable. Did you mean to include 'new'? + \ No newline at end of file diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js new file mode 100644 index 0000000000000..d5430dd52e5b4 --- /dev/null +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -0,0 +1,138 @@ +//// [objectCreationOfElementAccessExpression.ts] +class Food { + private amount: number; + constructor(public name: string) { + this.amount = 100; + } + public eat(amountToEat: number): boolean { + this.amount -= amountToEat; + if (this.amount <= 0) { + this.amount = 0; + return false; + } + else { + return true; + } + } +} +class MonsterFood extends Food { + constructor(name: string, public flavor: string) { + super(name); + } +} +class IceCream extends MonsterFood { + private isDairyFree: boolean; + constructor(public flavor: string) { + super("Ice Cream", flavor); + } +} +class Cookie extends MonsterFood { + constructor(public flavor: string, public isGlutenFree: boolean) { + super("Cookie", flavor); + } +} +class PetFood extends Food { + constructor(name: string, public whereToBuy: number) { + super(name); + } +} +class ExpensiveOrganicDogFood extends PetFood { + constructor(public whereToBuy: number) { + super("Origen", whereToBuy); + } +} +class ExpensiveOrganicCatFood extends PetFood { + constructor(public whereToBuy: number, public containsFish: boolean) { + super("Nature's Logic", whereToBuy); + } +} +class Slug { + // This is NOT a food!!! +} + +// ElementAccessExpressions can only contain one expression. There should be a parse error here. +var foods = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; +var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Cookie('Chocolate chip', false) , new Cookie('Peanut butter', true)]; + + +//// [objectCreationOfElementAccessExpression.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Food = (function () { + function Food(name) { + this.name = name; + this.amount = 100; + } + Food.prototype.eat = function (amountToEat) { + this.amount -= amountToEat; + if (this.amount <= 0) { + this.amount = 0; + return false; + } + else { + return true; + } + }; + return Food; +})(); +var MonsterFood = (function (_super) { + __extends(MonsterFood, _super); + function MonsterFood(name, flavor) { + _super.call(this, name); + this.flavor = flavor; + } + return MonsterFood; +})(Food); +var IceCream = (function (_super) { + __extends(IceCream, _super); + function IceCream(flavor) { + _super.call(this, "Ice Cream", flavor); + this.flavor = flavor; + } + return IceCream; +})(MonsterFood); +var Cookie = (function (_super) { + __extends(Cookie, _super); + function Cookie(flavor, isGlutenFree) { + _super.call(this, "Cookie", flavor); + this.flavor = flavor; + this.isGlutenFree = isGlutenFree; + } + return Cookie; +})(MonsterFood); +var PetFood = (function (_super) { + __extends(PetFood, _super); + function PetFood(name, whereToBuy) { + _super.call(this, name); + this.whereToBuy = whereToBuy; + } + return PetFood; +})(Food); +var ExpensiveOrganicDogFood = (function (_super) { + __extends(ExpensiveOrganicDogFood, _super); + function ExpensiveOrganicDogFood(whereToBuy) { + _super.call(this, "Origen", whereToBuy); + this.whereToBuy = whereToBuy; + } + return ExpensiveOrganicDogFood; +})(PetFood); +var ExpensiveOrganicCatFood = (function (_super) { + __extends(ExpensiveOrganicCatFood, _super); + function ExpensiveOrganicCatFood(whereToBuy, containsFish) { + _super.call(this, "Nature's Logic", whereToBuy); + this.whereToBuy = whereToBuy; + this.containsFish = containsFish; + } + return ExpensiveOrganicCatFood; +})(PetFood); +var Slug = (function () { + function Slug() { + } + return Slug; +})(); +var foods = new PetFood[new IceCream('Mint chocolate chip'), Cookie('Chocolate chip', false), new Cookie('Peanut butter', true)]; +var foods2 = new PetFood[new IceCream('Mint chocolate chip'), Cookie('Chocolate chip', false), new Cookie('Peanut butter', true)]; diff --git a/tests/baselines/reference/objectIndexer.js b/tests/baselines/reference/objectIndexer.js new file mode 100644 index 0000000000000..27dc6e2bd1a89 --- /dev/null +++ b/tests/baselines/reference/objectIndexer.js @@ -0,0 +1,26 @@ +//// [objectIndexer.ts] +export interface Callback { + (value: any): void; +} + +interface IMap { + [s: string]: Callback; +} + +class Emitter { + private listeners: IMap; + constructor () { + this.listeners = {}; + } +} + + +//// [objectIndexer.js] +define(["require", "exports"], function (require, exports) { + var Emitter = (function () { + function Emitter() { + this.listeners = {}; + } + return Emitter; + })(); +}); diff --git a/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt new file mode 100644 index 0000000000000..b7d5ae0f61627 --- /dev/null +++ b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/objectLitArrayDeclNoNew.ts (2 errors) ==== + declare var console; + "use strict"; + module Test { + export interface IState { + } + + export interface IToken { + } + + export interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + + export class Gar { + public moo: number = 0; + } + + export function bug(): ILineTokens { + var state:IState= null; + return { + tokens: Gar[],//IToken[], // Missing new. Correct syntax is: tokens: new IToken[] + ~ +!!! Expression expected. + endState: state + }; + } + } + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitGetterSetter.js b/tests/baselines/reference/objectLitGetterSetter.js new file mode 100644 index 0000000000000..8dac7b94f502d --- /dev/null +++ b/tests/baselines/reference/objectLitGetterSetter.js @@ -0,0 +1,22 @@ +//// [objectLitGetterSetter.ts] + var obj = {}; + Object.defineProperty(obj, "accProperty", ({ + get: function () { + eval("public = 1;"); + return 11; + }, + set: function (v) { + } + })) + + +//// [objectLitGetterSetter.js] +var obj = {}; +Object.defineProperty(obj, "accProperty", ({ + get: function () { + eval("public = 1;"); + return 11; + }, + set: function (v) { + } +})); diff --git a/tests/baselines/reference/objectLitIndexerContextualType.errors.txt b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt new file mode 100644 index 0000000000000..b9d92a78385e9 --- /dev/null +++ b/tests/baselines/reference/objectLitIndexerContextualType.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/objectLitIndexerContextualType.ts (6 errors) ==== + interface I { + [s: string]: (s: string) => number; + } + + interface J { + [s: number]: (s: string) => number; + } + + var x: I; + var y: J; + x = { + s: t => t * t, // Should error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + }; + x = { + 0: t => t * t, // Should error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + }; + y = { + s: t => t * t, // Should not error + }; + y = { + 0: t => t * t, // Should error + ~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + }; \ No newline at end of file diff --git a/tests/baselines/reference/objectLitIndexerContextualType.js b/tests/baselines/reference/objectLitIndexerContextualType.js new file mode 100644 index 0000000000000..f0cf90724b3f3 --- /dev/null +++ b/tests/baselines/reference/objectLitIndexerContextualType.js @@ -0,0 +1,39 @@ +//// [objectLitIndexerContextualType.ts] +interface I { + [s: string]: (s: string) => number; +} + +interface J { + [s: number]: (s: string) => number; +} + +var x: I; +var y: J; +x = { + s: t => t * t, // Should error +}; +x = { + 0: t => t * t, // Should error +}; +y = { + s: t => t * t, // Should not error +}; +y = { + 0: t => t * t, // Should error +}; + +//// [objectLitIndexerContextualType.js] +var x; +var y; +x = { + s: function (t) { return t * t; } +}; +x = { + 0: function (t) { return t * t; } +}; +y = { + s: function (t) { return t * t; } +}; +y = { + 0: function (t) { return t * t; } +}; diff --git a/tests/baselines/reference/objectLitPropertyScoping.errors.txt b/tests/baselines/reference/objectLitPropertyScoping.errors.txt new file mode 100644 index 0000000000000..f317de68e75ae --- /dev/null +++ b/tests/baselines/reference/objectLitPropertyScoping.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/objectLitPropertyScoping.ts (2 errors) ==== + // Should compile, x and y should not be picked up from the properties + + function makePoint(x: number, y: number) { + return { + get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return x; + }, + get y() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return y; + }, + dist: function () { + return Math.sqrt(x * x + y * y); + } + } + }; \ No newline at end of file diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt new file mode 100644 index 0000000000000..538dec7d8dac3 --- /dev/null +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/objectLitStructuralTypeMismatch.ts (1 errors) ==== + // Shouldn't compile + var x: { a: number; } = { b: 5 }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ b: number; }' is not assignable to type '{ a: number; }': +!!! Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.js b/tests/baselines/reference/objectLitStructuralTypeMismatch.js new file mode 100644 index 0000000000000..421f30fe6a933 --- /dev/null +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.js @@ -0,0 +1,6 @@ +//// [objectLitStructuralTypeMismatch.ts] +// Shouldn't compile +var x: { a: number; } = { b: 5 }; + +//// [objectLitStructuralTypeMismatch.js] +var x = { b: 5 }; diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt new file mode 100644 index 0000000000000..f82baa1e4c2cd --- /dev/null +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/objectLitTargetTypeCallSite.ts (1 errors) ==== + function process( x: {a:number; b:string;}) { + return x.a; + } + + process({a:true,b:"y"}); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.js b/tests/baselines/reference/objectLitTargetTypeCallSite.js new file mode 100644 index 0000000000000..999b889e41582 --- /dev/null +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.js @@ -0,0 +1,12 @@ +//// [objectLitTargetTypeCallSite.ts] +function process( x: {a:number; b:string;}) { + return x.a; +} + +process({a:true,b:"y"}); + +//// [objectLitTargetTypeCallSite.js] +function process(x) { + return x.a; +} +process({ a: true, b: "y" }); diff --git a/tests/baselines/reference/objectLiteral1.js b/tests/baselines/reference/objectLiteral1.js new file mode 100644 index 0000000000000..ebeabd011b5f3 --- /dev/null +++ b/tests/baselines/reference/objectLiteral1.js @@ -0,0 +1,5 @@ +//// [objectLiteral1.ts] +var v30 = {a:1, b:2}; + +//// [objectLiteral1.js] +var v30 = { a: 1, b: 2 }; diff --git a/tests/baselines/reference/objectLiteral2.js b/tests/baselines/reference/objectLiteral2.js new file mode 100644 index 0000000000000..189e495c5f53f --- /dev/null +++ b/tests/baselines/reference/objectLiteral2.js @@ -0,0 +1,5 @@ +//// [objectLiteral2.ts] +var v30 = {a:1, b:2}, v31; + +//// [objectLiteral2.js] +var v30 = { a: 1, b: 2 }, v31; diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.js b/tests/baselines/reference/objectLiteralArraySpecialization.js new file mode 100644 index 0000000000000..dc8ab70a1ab04 --- /dev/null +++ b/tests/baselines/reference/objectLiteralArraySpecialization.js @@ -0,0 +1,13 @@ +//// [objectLiteralArraySpecialization.ts] +declare function create(initialValues?: T[]): MyArrayWrapper; +interface MyArrayWrapper { + constructor(initialItems?: T[]); + doSomething(predicate: (x: T, y: T) => boolean): void; +} +var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // should not error +thing.doSomething((x, y) => x.name === "bob"); // should not error + + +//// [objectLiteralArraySpecialization.js] +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); +thing.doSomething(function (x, y) { return x.name === "bob"; }); diff --git a/tests/baselines/reference/objectLiteralDeclarationGeneration1.js b/tests/baselines/reference/objectLiteralDeclarationGeneration1.js new file mode 100644 index 0000000000000..107a17d49eb8d --- /dev/null +++ b/tests/baselines/reference/objectLiteralDeclarationGeneration1.js @@ -0,0 +1,12 @@ +//// [objectLiteralDeclarationGeneration1.ts] +class y{ } + +//// [objectLiteralDeclarationGeneration1.js] +var y = (function () { + function y() { + } + return y; +})(); + + +//// [objectLiteralDeclarationGeneration1.d.ts] diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt new file mode 100644 index 0000000000000..a36e532b4be8e --- /dev/null +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -0,0 +1,129 @@ +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (41 errors) ==== + + // Multiple properties with the same name + var e1 = { a: 0, a: 0 }; + ~ +!!! Duplicate identifier 'a'. + var e2 = { a: '', a: '' }; + ~ +!!! Duplicate identifier 'a'. + var e3 = { a: 0, a: '' }; + ~ +!!! Duplicate identifier 'a'. + var e4 = { a: true, a: false }; + ~ +!!! Duplicate identifier 'a'. + var e5 = { a: {}, a: {} }; + ~ +!!! Duplicate identifier 'a'. + var e6 = { a: 0, 'a': 0 }; + ~~~ +!!! Duplicate identifier ''a''. + var e7 = { 'a': 0, a: 0 }; + ~ +!!! Duplicate identifier 'a'. + var e8 = { 'a': 0, "a": 0 }; + ~~~ +!!! Duplicate identifier '"a"'. + var e9 = { 'a': 0, 'a': 0 }; + ~~~ +!!! Duplicate identifier ''a''. + var e10 = { "a": 0, 'a': 0 }; + ~~~ +!!! Duplicate identifier ''a''. + var e11 = { 1.0: 0, '1': 0 }; + ~~~ +!!! Duplicate identifier ''1''. + var e12 = { 0: 0, 0: 0 }; + ~ +!!! Duplicate identifier '0'. + var e13 = { 0: 0, 0: 0 }; + ~ +!!! Duplicate identifier '0'. + var e14 = { 0: 0, 0x0: 0 }; + ~~~ +!!! Duplicate identifier '0x0'. + var e14 = { 0: 0, 000: 0 }; + ~~~ +!!! Duplicate identifier '000'. + var e15 = { "100": 0, 1e2: 0 }; + ~~~ +!!! Duplicate identifier '1e2'. + var e16 = { 0x20: 0, 3.2e1: 0 }; + ~~~~~ +!!! Duplicate identifier '3.2e1'. + var e17 = { a: 0, b: 1, a: 0 }; + ~ +!!! Duplicate identifier 'a'. + + // Accessor and property with the same name + var f1 = { a: 0, get a() { return 0; } }; + ~ +!!! Duplicate identifier 'a'. + var f2 = { a: '', get a() { return ''; } }; + ~ +!!! Duplicate identifier 'a'. + var f3 = { a: 0, get a() { return ''; } }; + ~ +!!! Duplicate identifier 'a'. + var f4 = { a: true, get a() { return false; } }; + ~ +!!! Duplicate identifier 'a'. + var f5 = { a: {}, get a() { return {}; } }; + ~ +!!! Duplicate identifier 'a'. + var f6 = { a: 0, get 'a'() { return 0; } }; + ~~~ +!!! Duplicate identifier ''a''. + var f7 = { 'a': 0, get a() { return 0; } }; + ~ +!!! Duplicate identifier 'a'. + var f8 = { 'a': 0, get "a"() { return 0; } }; + ~~~ +!!! Duplicate identifier '"a"'. + var f9 = { 'a': 0, get 'a'() { return 0; } }; + ~~~ +!!! Duplicate identifier ''a''. + var f10 = { "a": 0, get 'a'() { return 0; } }; + ~~~ +!!! Duplicate identifier ''a''. + var f11 = { 1.0: 0, get '1'() { return 0; } }; + ~~~ +!!! Duplicate identifier ''1''. + var f12 = { 0: 0, get 0() { return 0; } }; + ~ +!!! Duplicate identifier '0'. + var f13 = { 0: 0, get 0() { return 0; } }; + ~ +!!! Duplicate identifier '0'. + var f14 = { 0: 0, get 0x0() { return 0; } }; + ~~~ +!!! Duplicate identifier '0x0'. + var f14 = { 0: 0, get 000() { return 0; } }; + ~~~ +!!! Duplicate identifier '000'. + var f15 = { "100": 0, get 1e2() { return 0; } }; + ~~~ +!!! Duplicate identifier '1e2'. + var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; + ~~~~~ +!!! Duplicate identifier '3.2e1'. + var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; + ~ +!!! Duplicate identifier 'a'. + + // Get and set accessor with mismatched type annotations + var g1 = { get a(): number { return 4; }, set a(n: string) { } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'get' and 'set' accessor must have the same type. + ~~~~~~~~~~~~~~~~~~~~ +!!! 'get' and 'set' accessor must have the same type. + var g2 = { get a() { return 4; }, set a(n: string) { } }; + ~ +!!! Type 'number' is not assignable to type 'string'. + var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! 'get' and 'set' accessor must have the same type. + ~~~~~~~~~~~~~~~~~~~~ +!!! 'get' and 'set' accessor must have the same type. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.js b/tests/baselines/reference/objectLiteralErrors.js new file mode 100644 index 0000000000000..151cf10a6abfd --- /dev/null +++ b/tests/baselines/reference/objectLiteralErrors.js @@ -0,0 +1,135 @@ +//// [objectLiteralErrors.ts] + +// Multiple properties with the same name +var e1 = { a: 0, a: 0 }; +var e2 = { a: '', a: '' }; +var e3 = { a: 0, a: '' }; +var e4 = { a: true, a: false }; +var e5 = { a: {}, a: {} }; +var e6 = { a: 0, 'a': 0 }; +var e7 = { 'a': 0, a: 0 }; +var e8 = { 'a': 0, "a": 0 }; +var e9 = { 'a': 0, 'a': 0 }; +var e10 = { "a": 0, 'a': 0 }; +var e11 = { 1.0: 0, '1': 0 }; +var e12 = { 0: 0, 0: 0 }; +var e13 = { 0: 0, 0: 0 }; +var e14 = { 0: 0, 0x0: 0 }; +var e14 = { 0: 0, 000: 0 }; +var e15 = { "100": 0, 1e2: 0 }; +var e16 = { 0x20: 0, 3.2e1: 0 }; +var e17 = { a: 0, b: 1, a: 0 }; + +// Accessor and property with the same name +var f1 = { a: 0, get a() { return 0; } }; +var f2 = { a: '', get a() { return ''; } }; +var f3 = { a: 0, get a() { return ''; } }; +var f4 = { a: true, get a() { return false; } }; +var f5 = { a: {}, get a() { return {}; } }; +var f6 = { a: 0, get 'a'() { return 0; } }; +var f7 = { 'a': 0, get a() { return 0; } }; +var f8 = { 'a': 0, get "a"() { return 0; } }; +var f9 = { 'a': 0, get 'a'() { return 0; } }; +var f10 = { "a": 0, get 'a'() { return 0; } }; +var f11 = { 1.0: 0, get '1'() { return 0; } }; +var f12 = { 0: 0, get 0() { return 0; } }; +var f13 = { 0: 0, get 0() { return 0; } }; +var f14 = { 0: 0, get 0x0() { return 0; } }; +var f14 = { 0: 0, get 000() { return 0; } }; +var f15 = { "100": 0, get 1e2() { return 0; } }; +var f16 = { 0x20: 0, get 3.2e1() { return 0; } }; +var f17 = { a: 0, get b() { return 1; }, get a() { return 0; } }; + +// Get and set accessor with mismatched type annotations +var g1 = { get a(): number { return 4; }, set a(n: string) { } }; +var g2 = { get a() { return 4; }, set a(n: string) { } }; +var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; + + +//// [objectLiteralErrors.js] +var e1 = { a: 0, a: 0 }; +var e2 = { a: '', a: '' }; +var e3 = { a: 0, a: '' }; +var e4 = { a: true, a: false }; +var e5 = { a: {}, a: {} }; +var e6 = { a: 0, 'a': 0 }; +var e7 = { 'a': 0, a: 0 }; +var e8 = { 'a': 0, "a": 0 }; +var e9 = { 'a': 0, 'a': 0 }; +var e10 = { "a": 0, 'a': 0 }; +var e11 = { 1.0: 0, '1': 0 }; +var e12 = { 0: 0, 0: 0 }; +var e13 = { 0: 0, 0: 0 }; +var e14 = { 0: 0, 0x0: 0 }; +var e14 = { 0: 0, 000: 0 }; +var e15 = { "100": 0, 1e2: 0 }; +var e16 = { 0x20: 0, 3.2e1: 0 }; +var e17 = { a: 0, b: 1, a: 0 }; +var f1 = { a: 0, get a() { + return 0; +} }; +var f2 = { a: '', get a() { + return ''; +} }; +var f3 = { a: 0, get a() { + return ''; +} }; +var f4 = { a: true, get a() { + return false; +} }; +var f5 = { a: {}, get a() { + return {}; +} }; +var f6 = { a: 0, get 'a'() { + return 0; +} }; +var f7 = { 'a': 0, get a() { + return 0; +} }; +var f8 = { 'a': 0, get "a"() { + return 0; +} }; +var f9 = { 'a': 0, get 'a'() { + return 0; +} }; +var f10 = { "a": 0, get 'a'() { + return 0; +} }; +var f11 = { 1.0: 0, get '1'() { + return 0; +} }; +var f12 = { 0: 0, get 0() { + return 0; +} }; +var f13 = { 0: 0, get 0() { + return 0; +} }; +var f14 = { 0: 0, get 0x0() { + return 0; +} }; +var f14 = { 0: 0, get 000() { + return 0; +} }; +var f15 = { "100": 0, get 1e2() { + return 0; +} }; +var f16 = { 0x20: 0, get 3.2e1() { + return 0; +} }; +var f17 = { a: 0, get b() { + return 1; +}, get a() { + return 0; +} }; +var g1 = { get a() { + return 4; +}, set a(n) { +} }; +var g2 = { get a() { + return 4; +}, set a(n) { +} }; +var g3 = { get a() { + return undefined; +}, set a(n) { +} }; diff --git a/tests/baselines/reference/objectLiteralErrorsES3.errors.txt b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt new file mode 100644 index 0000000000000..b928d9546a47e --- /dev/null +++ b/tests/baselines/reference/objectLiteralErrorsES3.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrorsES3.ts (4 errors) ==== + + var e1 = { get a() { return 4; } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var e2 = { set a(n) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var e3 = { get a() { return ''; }, set a(n) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt new file mode 100644 index 0000000000000..22dca9e99a5f8 --- /dev/null +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts (4 errors) ==== + interface I { + value: string; + toString: (t: string) => string; + } + + function f2(args: I) { } + + f2({ hello: 1 }) // error + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ value: '' }) // missing toString satisfied by Object's member + f2({ value: '', what: 1 }) // missing toString satisfied by Object's member + f2({ toString: (s) => s }) // error, missing property value from ArgsString + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ toString: (s: string) => s }) // error, missing property value from ArgsString + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ value: '', toString: (s) => s.uhhh }) // error + ~~~~ +!!! Property 'uhhh' does not exist on type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js new file mode 100644 index 0000000000000..7391c6b09f5a6 --- /dev/null +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.js @@ -0,0 +1,24 @@ +//// [objectLiteralFunctionArgContextualTyping.ts] +interface I { + value: string; + toString: (t: string) => string; +} + +function f2(args: I) { } + +f2({ hello: 1 }) // error +f2({ value: '' }) // missing toString satisfied by Object's member +f2({ value: '', what: 1 }) // missing toString satisfied by Object's member +f2({ toString: (s) => s }) // error, missing property value from ArgsString +f2({ toString: (s: string) => s }) // error, missing property value from ArgsString +f2({ value: '', toString: (s) => s.uhhh }) // error + +//// [objectLiteralFunctionArgContextualTyping.js] +function f2(args) { +} +f2({ hello: 1 }); +f2({ value: '' }); +f2({ value: '', what: 1 }); +f2({ toString: function (s) { return s; } }); +f2({ toString: function (s) { return s; } }); +f2({ value: '', toString: function (s) { return s.uhhh; } }); diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt new file mode 100644 index 0000000000000..4d30e0cfcaa74 --- /dev/null +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts (6 errors) ==== + interface I2 { + value: string; + doStuff: (t: string) => string; + } + + function f2(args: I2) { } + + f2({ hello: 1 }) + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ value: '' }) + ~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ value: '', what: 1 }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ toString: (s) => s }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ toString: (s: string) => s }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f2({ value: '', toString: (s) => s.uhhh }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js new file mode 100644 index 0000000000000..d7e9681791e5c --- /dev/null +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.js @@ -0,0 +1,24 @@ +//// [objectLiteralFunctionArgContextualTyping2.ts] +interface I2 { + value: string; + doStuff: (t: string) => string; +} + +function f2(args: I2) { } + +f2({ hello: 1 }) +f2({ value: '' }) +f2({ value: '', what: 1 }) +f2({ toString: (s) => s }) +f2({ toString: (s: string) => s }) +f2({ value: '', toString: (s) => s.uhhh }) + +//// [objectLiteralFunctionArgContextualTyping2.js] +function f2(args) { +} +f2({ hello: 1 }); +f2({ value: '' }); +f2({ value: '', what: 1 }); +f2({ toString: function (s) { return s; } }); +f2({ toString: function (s) { return s; } }); +f2({ value: '', toString: function (s) { return s.uhhh; } }); diff --git a/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt new file mode 100644 index 0000000000000..9019cd7246a96 --- /dev/null +++ b/tests/baselines/reference/objectLiteralGettersAndSetters.errors.txt @@ -0,0 +1,152 @@ +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts (34 errors) ==== + // Get and set accessor with the same name + var sameName1a = { get 'a'() { return ''; }, set a(n) { var p = n; var p: string; } }; + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameName2a = { get 0.0() { return ''; }, set 0(n) { var p = n; var p: string; } }; + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameName3a = { get 0x20() { return ''; }, set 3.2e1(n) { var p = n; var p: string; } }; + ~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameName4a = { get ''() { return ''; }, set ""(n) { var p = n; var p: string; } }; + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameName5a = { get '\t'() { return ''; }, set '\t'(n) { var p = n; var p: string; } }; + ~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameName6a = { get 'a'() { return ''; }, set a(n) { var p = n; var p: string; } }; + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + // PropertyName CallSignature{FunctionBody} is equivalent to PropertyName:function CallSignature{FunctionBody} + var callSig1 = { num(n: number) { return '' } }; + var callSig1: { num: (n: number) => string; }; + var callSig2 = { num: function (n: number) { return '' } }; + var callSig2: { num: (n: number) => string; }; + var callSig3 = { num: (n: number) => '' }; + var callSig3: { num: (n: number) => string; }; + + // Get accessor only, type of the property is the annotated return type of the get accessor + var getter1 = { get x(): string { return undefined; } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var getter1: { x: string; } + + // Get accessor only, type of the property is the inferred return type of the get accessor + var getter2 = { get x() { return ''; } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var getter2: { x: string; } + + // Set accessor only, type of the property is the param type of the set accessor + var setter1 = { set x(n: number) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var setter1: { x: number }; + + // Set accessor only, type of the property is Any for an unannotated set accessor + var setter2 = { set x(n) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var setter2: { x: any }; + + var anyVar: any; + // Get and set accessor with matching type annotations + var sameType1 = { get x(): string { return undefined; }, set x(n: string) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameType2 = { get x(): Array { return undefined; }, set x(n: number[]) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameType3 = { get x(): any { return undefined; }, set x(n: typeof anyVar) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var sameType4 = { get x(): Date { return undefined; }, set x(n: Date) { } }; + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + // Type of unannotated get accessor return type is the type annotation of the set accessor param + var setParamType1 = { + set n(x: (t: string) => void) { }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + get n() { return (t) => { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var p: string; + var p = t; + } + } + }; + var setParamType2 = { + get n() { return (t) => { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var p: string; + var p = t; + } + }, + set n(x: (t: string) => void) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + + // Type of unannotated set accessor parameter is the return type annotation of the get accessor + var getParamType1 = { + set n(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var y = x; + var y: string; + }, + get n() { return ''; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + var getParamType2 = { + get n() { return ''; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set n(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var y = x; + var y: string; + } + }; + + // Type of unannotated accessors is the inferred return type of the get accessor + var getParamType3 = { + get n() { return ''; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + set n(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var y = x; + var y: string; + } + }; + + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt new file mode 100644 index 0000000000000..348e28089d948 --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ==== + interface A { + x: number; + } + + interface B extends A { + y: string; + } + + var a: A; + var b: B; + var c: any; + + var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': +!!! Index signatures are incompatible: +!!! Type 'A' is not assignable to type 'B': +!!! Property 'y' is missing in type 'A'. + o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.js b/tests/baselines/reference/objectLiteralIndexerErrors.js new file mode 100644 index 0000000000000..a0f57f2338244 --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexerErrors.js @@ -0,0 +1,22 @@ +//// [objectLiteralIndexerErrors.ts] +interface A { + x: number; +} + +interface B extends A { + y: string; +} + +var a: A; +var b: B; +var c: any; + +var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A +o1 = { x: c, 0: a }; // string indexer is any, number indexer is A + +//// [objectLiteralIndexerErrors.js] +var a; +var b; +var c; +var o1 = { x: b, 0: a }; +o1 = { x: c, 0: a }; diff --git a/tests/baselines/reference/objectLiteralIndexers.js b/tests/baselines/reference/objectLiteralIndexers.js new file mode 100644 index 0000000000000..f2d9ea634302a --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexers.js @@ -0,0 +1,24 @@ +//// [objectLiteralIndexers.ts] +interface A { + x: number; +} + +interface B extends A { + y: string; +} + +var a: A; +var b: B; +var c: any; + +var o1: { [s: string]: A;[n: number]: B; } = { x: a, 0: b }; // string indexer is A, number indexer is B +o1 = { x: b, 0: c }; // both indexers are any +o1 = { x: c, 0: b }; // string indexer is any, number indexer is B + +//// [objectLiteralIndexers.js] +var a; +var b; +var c; +var o1 = { x: a, 0: b }; +o1 = { x: b, 0: c }; +o1 = { x: c, 0: b }; diff --git a/tests/baselines/reference/objectLiteralParameterResolution.errors.txt b/tests/baselines/reference/objectLiteralParameterResolution.errors.txt new file mode 100644 index 0000000000000..4380a976380e0 --- /dev/null +++ b/tests/baselines/reference/objectLiteralParameterResolution.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/objectLiteralParameterResolution.ts (6 errors) ==== + interface Foo{ + extend(target: T, ...objs: any[]): T; + extend(deep: boolean, target: T, ...objs: any[]): T; + } + declare var $: Foo; + var s = $.extend({ + type: "GET" , + data: "data" , + success: wrapSuccessCallback(requestContext, callback) , + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'wrapSuccessCallback'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'requestContext'. + ~~~~~~~~ +!!! Cannot find name 'callback'. + error: wrapErrorCallback(requestContext, errorCallback) , + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'wrapErrorCallback'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'requestContext'. + ~~~~~~~~~~~~~ +!!! Cannot find name 'errorCallback'. + dataType: "json" , + converters: { "text json": "" }, + traditional: true , + timeout: 12, + }, ""); + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralParameterResolution.js b/tests/baselines/reference/objectLiteralParameterResolution.js new file mode 100644 index 0000000000000..5912a2229b1ff --- /dev/null +++ b/tests/baselines/reference/objectLiteralParameterResolution.js @@ -0,0 +1,29 @@ +//// [objectLiteralParameterResolution.ts] +interface Foo{ + extend(target: T, ...objs: any[]): T; + extend(deep: boolean, target: T, ...objs: any[]): T; +} +declare var $: Foo; +var s = $.extend({ + type: "GET" , + data: "data" , + success: wrapSuccessCallback(requestContext, callback) , + error: wrapErrorCallback(requestContext, errorCallback) , + dataType: "json" , + converters: { "text json": "" }, + traditional: true , + timeout: 12, + }, ""); + + +//// [objectLiteralParameterResolution.js] +var s = $.extend({ + type: "GET", + data: "data", + success: wrapSuccessCallback(requestContext, callback), + error: wrapErrorCallback(requestContext, errorCallback), + dataType: "json", + converters: { "text json": "" }, + traditional: true, + timeout: 12 +}, ""); diff --git a/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt b/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt new file mode 100644 index 0000000000000..c5bffb34662de --- /dev/null +++ b/tests/baselines/reference/objectLiteralReferencingInternalProperties.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/objectLiteralReferencingInternalProperties.ts (1 errors) ==== + var a = { b: 10, c: b }; // Should give error for attempting to reference b. + ~ +!!! Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralReferencingInternalProperties.js b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js new file mode 100644 index 0000000000000..9612144dbefba --- /dev/null +++ b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js @@ -0,0 +1,5 @@ +//// [objectLiteralReferencingInternalProperties.ts] +var a = { b: 10, c: b }; // Should give error for attempting to reference b. + +//// [objectLiteralReferencingInternalProperties.js] +var a = { b: 10, c: b }; diff --git a/tests/baselines/reference/objectLiteralWidened.js b/tests/baselines/reference/objectLiteralWidened.js new file mode 100644 index 0000000000000..30dc1109ef0f3 --- /dev/null +++ b/tests/baselines/reference/objectLiteralWidened.js @@ -0,0 +1,28 @@ +//// [objectLiteralWidened.ts] +// object literal properties are widened to any + +var x = { + foo: null, + bar: undefined +} + +var y = { + foo: null, + bar: { + baz: null, + boo: undefined + } +} + +//// [objectLiteralWidened.js] +var x = { + foo: null, + bar: undefined +}; +var y = { + foo: null, + bar: { + baz: null, + boo: undefined + } +}; diff --git a/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt b/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt new file mode 100644 index 0000000000000..7c3f272c683c0 --- /dev/null +++ b/tests/baselines/reference/objectLiteralWithGetAccessorInsideFunction.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/objectLiteralWithGetAccessorInsideFunction.ts (1 errors) ==== + function bar() { + var x = { + get _extraOccluded() { + ~~~~~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + var occluded = 0; + return occluded; + }, + } + } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt new file mode 100644 index 0000000000000..09ce84892dcbf --- /dev/null +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/objectLiteralWithNumericPropertyName.ts (1 errors) ==== + interface A { + 0: string; + } + var x: A = { + ~~~~~~~~ + 0: 3 + ~~~~~~~~ + }; + ~ +!!! Type '{ 0: number; }' is not assignable to type 'A': +!!! Types of property '0' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.js b/tests/baselines/reference/objectLiteralWithNumericPropertyName.js new file mode 100644 index 0000000000000..af53f85dd5a69 --- /dev/null +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.js @@ -0,0 +1,13 @@ +//// [objectLiteralWithNumericPropertyName.ts] +interface A { + 0: string; +} +var x: A = { + 0: 3 +}; + + +//// [objectLiteralWithNumericPropertyName.js] +var x = { + 0: 3 +}; diff --git a/tests/baselines/reference/objectMembersOnTypes.js b/tests/baselines/reference/objectMembersOnTypes.js new file mode 100644 index 0000000000000..7a82de789f957 --- /dev/null +++ b/tests/baselines/reference/objectMembersOnTypes.js @@ -0,0 +1,23 @@ +//// [objectMembersOnTypes.ts] +interface I {} +class AAA implements I { } +var x: number; +x.toString(); +var i: I; +i.toString(); // used to be an error +var c: AAA; +c.toString(); // used to be an error + + +//// [objectMembersOnTypes.js] +var AAA = (function () { + function AAA() { + } + return AAA; +})(); +var x; +x.toString(); +var i; +i.toString(); +var c; +c.toString(); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt new file mode 100644 index 0000000000000..65b100d9b8b08 --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.errors.txt @@ -0,0 +1,71 @@ +==== tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts (8 errors) ==== + class A { + foo: string; + } + + class B extends A { + bar: string; + } + + interface Object { + data: A; + [x: string]: Object; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'data' of type 'A' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toString' of type '() => string' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. + } + + class C { + valueOf() { } + data: B; + [x: string]: any; + } + + var c: C; + var r1: void = c.valueOf(); + var r1b: B = c.data; + var r1c = r1b['hm']; // should be 'Object' + var r1d = c['hm']; // should be 'any' + + interface I { + valueOf(): void; + data: B; + [x: string]: any; + } + + var i: I; + var r2: void = i.valueOf(); + var r2b: B = i.data; + var r2c = r2b['hm']; // should be 'Object' + var r2d = i['hm']; // should be 'any' + + var a = { + valueOf: () => { }, + data: new B() + } + + var r3: void = a.valueOf(); + var r3b: B = a.data; + var r3c = r3b['hm']; // should be 'Object' + var r3d = i['hm']; + + var b: { + valueOf(): void; + data: B; + [x: string]: any; + } + + var r4: void = b.valueOf(); \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js new file mode 100644 index 0000000000000..daa19478e69b5 --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -0,0 +1,103 @@ +//// [objectTypeHidingMembersOfExtendedObject.ts] +class A { + foo: string; +} + +class B extends A { + bar: string; +} + +interface Object { + data: A; + [x: string]: Object; +} + +class C { + valueOf() { } + data: B; + [x: string]: any; +} + +var c: C; +var r1: void = c.valueOf(); +var r1b: B = c.data; +var r1c = r1b['hm']; // should be 'Object' +var r1d = c['hm']; // should be 'any' + +interface I { + valueOf(): void; + data: B; + [x: string]: any; +} + +var i: I; +var r2: void = i.valueOf(); +var r2b: B = i.data; +var r2c = r2b['hm']; // should be 'Object' +var r2d = i['hm']; // should be 'any' + +var a = { + valueOf: () => { }, + data: new B() +} + +var r3: void = a.valueOf(); +var r3b: B = a.data; +var r3c = r3b['hm']; // should be 'Object' +var r3d = i['hm']; + +var b: { + valueOf(): void; + data: B; + [x: string]: any; +} + +var r4: void = b.valueOf(); + +//// [objectTypeHidingMembersOfExtendedObject.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function () { + function C() { + } + C.prototype.valueOf = function () { + }; + return C; +})(); +var c; +var r1 = c.valueOf(); +var r1b = c.data; +var r1c = r1b['hm']; +var r1d = c['hm']; +var i; +var r2 = i.valueOf(); +var r2b = i.data; +var r2c = r2b['hm']; +var r2d = i['hm']; +var a = { + valueOf: function () { + }, + data: new B() +}; +var r3 = a.valueOf(); +var r3b = a.data; +var r3c = r3b['hm']; +var r3d = i['hm']; +var b; +var r4 = b.valueOf(); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.js b/tests/baselines/reference/objectTypeHidingMembersOfObject.js new file mode 100644 index 0000000000000..6d071068e2dfd --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.js @@ -0,0 +1,48 @@ +//// [objectTypeHidingMembersOfObject.ts] +// all of these valueOf calls should return the type shown in the overriding signatures here + +class C { + valueOf() { } +} + +var c: C; +var r1: void = c.valueOf(); + +interface I { + valueOf(): void; +} + +var i: I; +var r2: void = i.valueOf(); + +var a = { + valueOf: () => { } +} + +var r3: void = a.valueOf(); + +var b: { + valueOf(): void; +} + +var r4: void = b.valueOf(); + +//// [objectTypeHidingMembersOfObject.js] +var C = (function () { + function C() { + } + C.prototype.valueOf = function () { + }; + return C; +})(); +var c; +var r1 = c.valueOf(); +var i; +var r2 = i.valueOf(); +var a = { + valueOf: function () { + } +}; +var r3 = a.valueOf(); +var b; +var r4 = b.valueOf(); diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..a592cca8f5ff0 --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -0,0 +1,37 @@ +==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts (3 errors) ==== + interface I { + toString(): void; + } + + var i: I; + var o: Object; + o = i; // error + ~ +!!! Type 'I' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => void' is not assignable to type '() => string': +!!! Type 'void' is not assignable to type 'string'. + i = o; // ok + + class C { + toString(): void { } + } + var c: C; + o = c; // error + ~ +!!! Type 'C' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => void' is not assignable to type '() => string': +!!! Type 'void' is not assignable to type 'string'. + c = o; // ok + + var a = { + toString: () => { } + } + o = a; // error + ~ +!!! Type '{ toString: () => void; }' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => void' is not assignable to type '() => string': +!!! Type 'void' is not assignable to type 'string'. + a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js new file mode 100644 index 0000000000000..379c74c1a4797 --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.js @@ -0,0 +1,44 @@ +//// [objectTypeHidingMembersOfObjectAssignmentCompat.ts] +interface I { + toString(): void; +} + +var i: I; +var o: Object; +o = i; // error +i = o; // ok + +class C { + toString(): void { } +} +var c: C; +o = c; // error +c = o; // ok + +var a = { + toString: () => { } +} +o = a; // error +a = o; // ok + +//// [objectTypeHidingMembersOfObjectAssignmentCompat.js] +var i; +var o; +o = i; +i = o; +var C = (function () { + function C() { + } + C.prototype.toString = function () { + }; + return C; +})(); +var c; +o = c; +c = o; +var a = { + toString: function () { + } +}; +o = a; +a = o; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt new file mode 100644 index 0000000000000..7bfc0894d3a21 --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -0,0 +1,47 @@ +==== tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts (5 errors) ==== + interface I { + toString(): number; + } + + var i: I; + var o: Object; + o = i; // error + ~ +!!! Type 'I' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => number' is not assignable to type '() => string': +!!! Type 'number' is not assignable to type 'string'. + i = o; // error + ~ +!!! Type 'Object' is not assignable to type 'I': +!!! Types of property 'toString' are incompatible: +!!! Type '() => string' is not assignable to type '() => number': +!!! Type 'string' is not assignable to type 'number'. + + class C { + toString(): number { return 1; } + } + var c: C; + o = c; // error + ~ +!!! Type 'C' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => number' is not assignable to type '() => string': +!!! Type 'number' is not assignable to type 'string'. + c = o; // error + ~ +!!! Type 'Object' is not assignable to type 'C': +!!! Types of property 'toString' are incompatible: +!!! Type '() => string' is not assignable to type '() => number': +!!! Type 'string' is not assignable to type 'number'. + + var a = { + toString: () => { } + } + o = a; // error + ~ +!!! Type '{ toString: () => void; }' is not assignable to type 'Object': +!!! Types of property 'toString' are incompatible: +!!! Type '() => void' is not assignable to type '() => string': +!!! Type 'void' is not assignable to type 'string'. + a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js new file mode 100644 index 0000000000000..b287e2efa804b --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.js @@ -0,0 +1,45 @@ +//// [objectTypeHidingMembersOfObjectAssignmentCompat2.ts] +interface I { + toString(): number; +} + +var i: I; +var o: Object; +o = i; // error +i = o; // error + +class C { + toString(): number { return 1; } +} +var c: C; +o = c; // error +c = o; // error + +var a = { + toString: () => { } +} +o = a; // error +a = o; // ok + +//// [objectTypeHidingMembersOfObjectAssignmentCompat2.js] +var i; +var o; +o = i; +i = o; +var C = (function () { + function C() { + } + C.prototype.toString = function () { + return 1; + }; + return C; +})(); +var c; +o = c; +c = o; +var a = { + toString: function () { + } +}; +o = a; +a = o; diff --git a/tests/baselines/reference/objectTypeLiteralSyntax.js b/tests/baselines/reference/objectTypeLiteralSyntax.js new file mode 100644 index 0000000000000..1de8cccfee04b --- /dev/null +++ b/tests/baselines/reference/objectTypeLiteralSyntax.js @@ -0,0 +1,14 @@ +//// [objectTypeLiteralSyntax.ts] +var x: { + foo: string; + bar: string; +} + +var y: { + foo: string; + bar: string +} + +//// [objectTypeLiteralSyntax.js] +var x; +var y; diff --git a/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt b/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt new file mode 100644 index 0000000000000..9608cf8442127 --- /dev/null +++ b/tests/baselines/reference/objectTypeLiteralSyntax2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax2.ts (2 errors) ==== + var x: { + foo: string, + ~ +!!! ';' expected. + bar: string + } + + // ASI makes this work + var y: { + foo: string + bar: string + } + + var z: { foo: string bar: string } + ~~~ +!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypePropertyAccess.js b/tests/baselines/reference/objectTypePropertyAccess.js new file mode 100644 index 0000000000000..48099c47bd476 --- /dev/null +++ b/tests/baselines/reference/objectTypePropertyAccess.js @@ -0,0 +1,54 @@ +//// [objectTypePropertyAccess.ts] +// Index notation should resolve to the type of a declared property with that same name +class C { + foo: string; +} + +var c: C; +var r1 = c.toString(); +var r2 = c['toString'](); +var r3 = c.foo; +var r4 = c['foo']; + +interface I { + bar: string; +} +var i: I; +var r4 = i.toString(); +var r5 = i['toString'](); +var r6 = i.bar; +var r7 = i['bar']; + +var a = { + foo: '' +} + +var r8 = a.toString(); +var r9 = a['toString'](); +var r10 = a.foo; +var r11 = a['foo']; + + +//// [objectTypePropertyAccess.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r1 = c.toString(); +var r2 = c['toString'](); +var r3 = c.foo; +var r4 = c['foo']; +var i; +var r4 = i.toString(); +var r5 = i['toString'](); +var r6 = i.bar; +var r7 = i['bar']; +var a = { + foo: '' +}; +var r8 = a.toString(); +var r9 = a['toString'](); +var r10 = a.foo; +var r11 = a['foo']; diff --git a/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.js b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.js new file mode 100644 index 0000000000000..75a6364d6905a --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.js @@ -0,0 +1,26 @@ +//// [objectTypeWithCallSignatureAppearsToBeFunctionType.ts] +// objects with call signatures should be permitted where function types are expected +// no errors expected below + +interface I { + (): void; +} + +var i: I; +var r2: void = i(); +var r2b: (x: any, y?: any) => any = i.apply; + +var b: { + (): void; +} + +var r4: void = b(); +var rb4: (x: any, y?: any) => any = b.apply; + +//// [objectTypeWithCallSignatureAppearsToBeFunctionType.js] +var i; +var r2 = i(); +var r2b = i.apply; +var b; +var r4 = b(); +var rb4 = b.apply; diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js new file mode 100644 index 0000000000000..6ab634243290b --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js @@ -0,0 +1,47 @@ +//// [objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts] +// object types with call signatures can override members of Function +// no errors expected below + +interface Function { + data: number; + [x: string]: Object; +} + +interface I { + (): void; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var i: I; +var r1: (a: any, b?: any) => void = i.apply; +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +var r1c = i.arguments; +var r1d = i.data; +var r1e = i['hm']; // should be Object + +var x: { + (): void; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var r2: (a: any, b?: any) => void = x.apply; +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +var r2c = x.arguments; +var r2d = x.data; +var r2e = x['hm']; // should be Object + +//// [objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js] +var i; +var r1 = i.apply; +var r1b = i.call; +var r1c = i.arguments; +var r1d = i.data; +var r1e = i['hm']; +var x; +var r2 = x.apply; +var r2b = x.call; +var r2c = x.arguments; +var r2d = x.data; +var r2e = x['hm']; diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.js b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.js new file mode 100644 index 0000000000000..16908733725d3 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.js @@ -0,0 +1,35 @@ +//// [objectTypeWithCallSignatureHidingMembersOfFunction.ts] +// object types with call signatures can override members of Function +// no errors expected below + +interface I { + (): void; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var i: I; +var r1: (a: any, b?: any) => void = i.apply; +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +var r1c = i.arguments; + +var x: { + (): void; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var r2: (a: any, b?: any) => void = x.apply; +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +var r2c = x.arguments; + + +//// [objectTypeWithCallSignatureHidingMembersOfFunction.js] +var i; +var r1 = i.apply; +var r1b = i.call; +var r1c = i.arguments; +var x; +var r2 = x.apply; +var r2b = x.call; +var r2c = x.arguments; diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..8fbbcddff0b25 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== + interface I { + (): void; + } + + var i: I; + var f: Object; + f = i; + i = f; + ~ +!!! Type 'Object' is not assignable to type 'I'. + + var a: { + (): void + } + f = a; + a = f; + ~ +!!! Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.js b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.js new file mode 100644 index 0000000000000..3f23ffd63a6ec --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.js @@ -0,0 +1,24 @@ +//// [objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts] +interface I { + (): void; +} + +var i: I; +var f: Object; +f = i; +i = f; + +var a: { + (): void +} +f = a; +a = f; + +//// [objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.js] +var i; +var f; +f = i; +i = f; +var a; +f = a; +a = f; diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt new file mode 100644 index 0000000000000..cb6bedb21794a --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureAppearsToBeFunctionType.ts (2 errors) ==== + // no errors expected below + + interface I { + new(): number; + } + + var i: I; + var r2: number = i(); + ~~~ +!!! Value of type 'I' is not callable. Did you mean to include 'new'? + var r2b: number = new i(); + var r2c: (x: any, y?: any) => any = i.apply; + + var b: { + new(): number; + } + + var r4: number = b(); + ~~~ +!!! Value of type 'new () => number' is not callable. Did you mean to include 'new'? + var r4b: number = new b(); + var r4c: (x: any, y?: any) => any = b.apply; \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.js b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.js new file mode 100644 index 0000000000000..4794296391163 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureAppearsToBeFunctionType.js @@ -0,0 +1,29 @@ +//// [objectTypeWithConstructSignatureAppearsToBeFunctionType.ts] +// no errors expected below + +interface I { + new(): number; +} + +var i: I; +var r2: number = i(); +var r2b: number = new i(); +var r2c: (x: any, y?: any) => any = i.apply; + +var b: { + new(): number; +} + +var r4: number = b(); +var r4b: number = new b(); +var r4c: (x: any, y?: any) => any = b.apply; + +//// [objectTypeWithConstructSignatureAppearsToBeFunctionType.js] +var i; +var r2 = i(); +var r2b = new i(); +var r2c = i.apply; +var b; +var r4 = b(); +var r4b = new b(); +var r4c = b.apply; diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js new file mode 100644 index 0000000000000..33d9f067656ef --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js @@ -0,0 +1,44 @@ +//// [objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts] +interface Function { + data: number; + [x: string]: Object; +} + +interface I { + new(): number; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var i: I; +var r1: (a: any, b?: any) => void = i.apply; +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +var r1c = i.arguments; +var r1d = i.data; +var r1e = i['hm']; // should be Object + +var x: { + new(): number; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var r2: (a: any, b?: any) => void = x.apply; +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +var r2c = x.arguments; +var r2d = x.data; +var r2e = x['hm']; // should be Object + +//// [objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js] +var i; +var r1 = i.apply; +var r1b = i.call; +var r1c = i.arguments; +var r1d = i.data; +var r1e = i['hm']; +var x; +var r2 = x.apply; +var r2b = x.call; +var r2c = x.arguments; +var r2d = x.data; +var r2e = x['hm']; diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.js b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.js new file mode 100644 index 0000000000000..8d0dc4146ab4c --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.js @@ -0,0 +1,32 @@ +//// [objectTypeWithConstructSignatureHidingMembersOfFunction.ts] +interface I { + new(): number; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var i: I; +var r1: (a: any, b?: any) => void = i.apply; +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +var r1c = i.arguments; + +var x: { + new(): number; + apply(a: any, b?: any): void; + call(thisArg: number, ...argArray: number[]): any; +} + +var r2: (a: any, b?: any) => void = x.apply; +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +var r2c = x.arguments; + + +//// [objectTypeWithConstructSignatureHidingMembersOfFunction.js] +var i; +var r1 = i.apply; +var r1b = i.call; +var r1c = i.arguments; +var x; +var r2 = x.apply; +var r2b = x.call; +var r2c = x.arguments; diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..9696c68769d82 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== + interface I { + new(): any; + } + + var i: I; + var f: Object; + f = i; + i = f; + ~ +!!! Type 'Object' is not assignable to type 'I'. + + var a: { + new(): any + } + f = a; + a = f; + ~ +!!! Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.js b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.js new file mode 100644 index 0000000000000..70ca09d382850 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.js @@ -0,0 +1,24 @@ +//// [objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts] +interface I { + new(): any; +} + +var i: I; +var f: Object; +f = i; +i = f; + +var a: { + new(): any +} +f = a; +a = f; + +//// [objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.js] +var i; +var f; +f = i; +i = f; +var a; +f = a; +a = f; diff --git a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt new file mode 100644 index 0000000000000..2049e3c9607e2 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (12 errors) ==== + // numeric properties must be distinct after a ToNumber operation + // so the below are all errors + + class C { + 1; + 1.0; + ~~~ +!!! Duplicate identifier '1.0'. + 1.; + ~~ +!!! Duplicate identifier '1.'. + 1.00; + ~~~~ +!!! Duplicate identifier '1.00'. + } + + interface I { + 1; + 1.0; + ~~~ +!!! Duplicate identifier '1.0'. + 1.; + ~~ +!!! Duplicate identifier '1.'. + 1.00; + ~~~~ +!!! Duplicate identifier '1.00'. + } + + var a: { + 1; + 1.0; + ~~~ +!!! Duplicate identifier '1.0'. + 1.; + ~~ +!!! Duplicate identifier '1.'. + 1.00; + ~~~~ +!!! Duplicate identifier '1.00'. + } + + var b = { + 1: 1, + 1.0: 1, + ~~~ +!!! Duplicate identifier '1.0'. + 1.: 1, + ~~ +!!! Duplicate identifier '1.'. + 1.00: 1 + ~~~~ +!!! Duplicate identifier '1.00'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js new file mode 100644 index 0000000000000..f61906ed4f155 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithDuplicateNumericProperty.js @@ -0,0 +1,47 @@ +//// [objectTypeWithDuplicateNumericProperty.ts] +// numeric properties must be distinct after a ToNumber operation +// so the below are all errors + +class C { + 1; + 1.0; + 1.; + 1.00; +} + +interface I { + 1; + 1.0; + 1.; + 1.00; +} + +var a: { + 1; + 1.0; + 1.; + 1.00; +} + +var b = { + 1: 1, + 1.0: 1, + 1.: 1, + 1.00: 1 +} + + + +//// [objectTypeWithDuplicateNumericProperty.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { + 1: 1, + 1.0: 1, + 1.: 1, + 1.00: 1 +}; diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.js b/tests/baselines/reference/objectTypeWithNumericProperty.js new file mode 100644 index 0000000000000..94c524353d824 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithNumericProperty.js @@ -0,0 +1,74 @@ +//// [objectTypeWithNumericProperty.ts] +// no errors here + +class C { + 1: number; + 1.1: string; +} + +var c: C; +var r1 = c[1]; +var r2 = c[1.1]; +var r3 = c['1']; +var r4 = c['1.1']; + +interface I { + 1: number; + 1.1: string; +} + +var i: I; +var r1 = i[1]; +var r2 = i[1.1]; +var r3 = i['1']; +var r4 = i['1.1']; + +var a: { + 1: number; + 1.1: string; +} + +var r1 = a[1]; +var r2 = a[1.1]; +var r3 = a['1']; +var r4 = a['1.1']; + +var b = { + 1: 1, + 1.1: "" +} + +var r1 = b[1]; +var r2 = b[1.1]; +var r3 = b['1']; +var r4 = b['1.1']; + +//// [objectTypeWithNumericProperty.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r1 = c[1]; +var r2 = c[1.1]; +var r3 = c['1']; +var r4 = c['1.1']; +var i; +var r1 = i[1]; +var r2 = i[1.1]; +var r3 = i['1']; +var r4 = i['1.1']; +var a; +var r1 = a[1]; +var r2 = a[1.1]; +var r3 = a['1']; +var r4 = a['1.1']; +var b = { + 1: 1, + 1.1: "" +}; +var r1 = b[1]; +var r2 = b[1.1]; +var r3 = b['1']; +var r4 = b['1.1']; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt new file mode 100644 index 0000000000000..21ec31d40858f --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts (1 errors) ==== + // Basic recursive type + + class List { + data: T; + next: List>; + } + + var list1 = new List(); + var list2 = new List(); + var list3 = new List(); + + list1 = list2; // ok + list1 = list3; // error + ~~~~~ +!!! Type 'List' is not assignable to type 'List': +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js new file mode 100644 index 0000000000000..bc08dd92f54e7 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.js @@ -0,0 +1,26 @@ +//// [objectTypeWithRecursiveWrappedProperty.ts] +// Basic recursive type + +class List { + data: T; + next: List>; +} + +var list1 = new List(); +var list2 = new List(); +var list3 = new List(); + +list1 = list2; // ok +list1 = list3; // error + +//// [objectTypeWithRecursiveWrappedProperty.js] +var List = (function () { + function List() { + } + return List; +})(); +var list1 = new List(); +var list2 = new List(); +var list3 = new List(); +list1 = list2; +list1 = list3; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt new file mode 100644 index 0000000000000..7e209541a0080 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts (1 errors) ==== + // Basic recursive type + + class List { + data: T; + next: List>; + } + + var list1 = new List(); + var list2 = new List(); + var list3 = new List(); + + list1 = list2; // ok + list1 = list3; // error + ~~~~~ +!!! Type 'List' is not assignable to type 'List': +!!! Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js new file mode 100644 index 0000000000000..bd120357b2051 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.js @@ -0,0 +1,26 @@ +//// [objectTypeWithRecursiveWrappedProperty2.ts] +// Basic recursive type + +class List { + data: T; + next: List>; +} + +var list1 = new List(); +var list2 = new List(); +var list3 = new List(); + +list1 = list2; // ok +list1 = list3; // error + +//// [objectTypeWithRecursiveWrappedProperty2.js] +var List = (function () { + function List() { + } + return List; +})(); +var list1 = new List(); +var list2 = new List(); +var list3 = new List(); +list1 = list2; +list1 = list3; diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt new file mode 100644 index 0000000000000..123a8289f7fd2 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -0,0 +1,75 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (9 errors) ==== + // Types with infinitely expanding recursive types are type checked nominally + + class List { + data: T; + next: List>; + } + + class MyList { + data: T; + next: MyList>; + } + + var list1 = new List(); + var list2 = new List(); + + var myList1 = new MyList(); + var myList2 = new MyList(); + + list1 = myList1; // error, not nominally equal + list1 = myList2; // error, type mismatch + ~~~~~ +!!! Type 'MyList' is not assignable to type 'List': +!!! Types of property 'data' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + + list2 = myList1; // error, not nominally equal + ~~~~~ +!!! Type 'MyList' is not assignable to type 'List': +!!! Types of property 'data' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + list2 = myList2; // error, type mismatch + + var rList1 = new List>(); + var rMyList1 = new List>(); + rList1 = rMyList1; // error, not nominally equal + + function foo, U extends MyList>(t: T, u: U) { + t = u; // error + ~ +!!! Type 'U' is not assignable to type 'T'. + u = t; // error + ~ +!!! Type 'T' is not assignable to type 'U'. + + var a: List; + var b: MyList; + a = t; // ok + a = u; // error + b = t; // error + b = u; // ok + } + + function foo2>(t: T, u: U) { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + t = u; // error + ~ +!!! Type 'U' is not assignable to type 'T'. + u = t; // was error, ok after constraint made illegal, doesn't matter + ~ +!!! Type 'T' is not assignable to type 'U'. + + var a: List; + var b: MyList; + + a = t; // error + ~ +!!! Type 'T' is not assignable to type 'List'. + a = u; // error + b = t; // ok + ~ +!!! Type 'T' is not assignable to type 'MyList'. + b = u; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js new file mode 100644 index 0000000000000..2da990a2f7ea0 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.js @@ -0,0 +1,96 @@ +//// [objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts] +// Types with infinitely expanding recursive types are type checked nominally + +class List { + data: T; + next: List>; +} + +class MyList { + data: T; + next: MyList>; +} + +var list1 = new List(); +var list2 = new List(); + +var myList1 = new MyList(); +var myList2 = new MyList(); + +list1 = myList1; // error, not nominally equal +list1 = myList2; // error, type mismatch + +list2 = myList1; // error, not nominally equal +list2 = myList2; // error, type mismatch + +var rList1 = new List>(); +var rMyList1 = new List>(); +rList1 = rMyList1; // error, not nominally equal + +function foo, U extends MyList>(t: T, u: U) { + t = u; // error + u = t; // error + + var a: List; + var b: MyList; + a = t; // ok + a = u; // error + b = t; // error + b = u; // ok +} + +function foo2>(t: T, u: U) { + t = u; // error + u = t; // was error, ok after constraint made illegal, doesn't matter + + var a: List; + var b: MyList; + + a = t; // error + a = u; // error + b = t; // ok + b = u; // ok +} + +//// [objectTypeWithRecursiveWrappedPropertyCheckedNominally.js] +var List = (function () { + function List() { + } + return List; +})(); +var MyList = (function () { + function MyList() { + } + return MyList; +})(); +var list1 = new List(); +var list2 = new List(); +var myList1 = new MyList(); +var myList2 = new MyList(); +list1 = myList1; +list1 = myList2; +list2 = myList1; +list2 = myList2; +var rList1 = new List(); +var rMyList1 = new List(); +rList1 = rMyList1; +function foo(t, u) { + t = u; + u = t; + var a; + var b; + a = t; + a = u; + b = t; + b = u; +} +function foo2(t, u) { + t = u; + u = t; + var a; + var b; + a = t; + a = u; + b = t; + b = u; +} diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt new file mode 100644 index 0000000000000..8d05f4aa45a31 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts (7 errors) ==== + // object types can define string indexers that are more specific than the default 'any' that would be returned + // no errors expected below + + interface Object { + [x: string]: Object; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'constructor' of type 'Function' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'hasOwnProperty' of type '(v: string) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'propertyIsEnumerable' of type '(v: string) => boolean' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'toString' of type '() => string' is not assignable to string index type 'Object'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'valueOf' of type '() => Object' is not assignable to string index type 'Object'. + } + var o = {}; + var r = o['']; // should be Object + + class C { + foo: string; + [x: string]: string; + } + var c: C; + var r2: string = c['']; + + interface I { + bar: string; + [x: string]: string; + } + var i: I; + var r3: string = i['']; + + var o2: { + baz: string; + [x: string]: string; + } + var r4: string = o2['']; + + + \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js new file mode 100644 index 0000000000000..59537954ab770 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js @@ -0,0 +1,47 @@ +//// [objectTypeWithStringIndexerHidingObjectIndexer.ts] +// object types can define string indexers that are more specific than the default 'any' that would be returned +// no errors expected below + +interface Object { + [x: string]: Object; +} +var o = {}; +var r = o['']; // should be Object + +class C { + foo: string; + [x: string]: string; +} +var c: C; +var r2: string = c['']; + +interface I { + bar: string; + [x: string]: string; +} +var i: I; +var r3: string = i['']; + +var o2: { + baz: string; + [x: string]: string; +} +var r4: string = o2['']; + + + + +//// [objectTypeWithStringIndexerHidingObjectIndexer.js] +var o = {}; +var r = o['']; +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r2 = c['']; +var i; +var r3 = i['']; +var o2; +var r4 = o2['']; diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js new file mode 100644 index 0000000000000..d2fc04fabdf37 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js @@ -0,0 +1,216 @@ +//// [objectTypeWithStringNamedNumericProperty.ts] + +// string named numeric properties are legal and distinct when indexed by string values +// indexed numerically the value is converted to a number +// no errors expected below + +class C { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; +} + +var c: C; +var r1 = c['0.1']; +var r2 = c['.1']; +var r3 = c['1']; +var r3 = c[1]; +var r4 = c['1.']; +var r3 = c[1.]; // same as indexing by 1 when done numerically +var r5 = c['1..']; +var r6 = c['1.0']; +var r3 = c[1.0]; // same as indexing by 1 when done numerically +// BUG 823822 +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1] +var r11 = i[-0x1] +var r12 = i[01] +var r13 = i[-01] + +interface I { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; +} + +var i: I; +var r1 = i['0.1']; +var r2 = i['.1']; +var r3 = i['1']; +var r3 = c[1]; +var r4 = i['1.']; +var r3 = c[1.]; // same as indexing by 1 when done numerically +var r5 = i['1..']; +var r6 = i['1.0']; +var r3 = c[1.0]; // same as indexing by 1 when done numerically +// BUG 823822 +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1] +var r11 = i[-0x1] +var r12 = i[01] +var r13 = i[-01] + +var a: { + "0.1": void; + ".1": Object; + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; + "-1.0": RegExp; + "-1": Date; +} + +var r1 = a['0.1']; +var r2 = a['.1']; +var r3 = a['1']; +var r3 = c[1]; +var r4 = a['1.']; +var r3 = c[1.]; // same as indexing by 1 when done numerically +var r5 = a['1..']; +var r6 = a['1.0']; +var r3 = c[1.0]; // same as indexing by 1 when done numerically +// BUG 823822 +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1] +var r11 = i[-0x1] +var r12 = i[01] +var r13 = i[-01] + +var b = { + "0.1": null, + ".1": new Object(), + "1": 1, + "1.": "", + "1..": true, + "1.0": new Date(), + "-1.0": /123/, + "-1": Date +}; + +var r1 = b['0.1']; +var r2 = b['.1']; +var r3 = b['1']; +var r3 = c[1]; +var r4 = b['1.']; +var r3 = c[1.]; // same as indexing by 1 when done numerically +var r5 = b['1..']; +var r6 = b['1.0']; +var r3 = c[1.0]; // same as indexing by 1 when done numerically +// BUG 823822 +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1] +var r11 = i[-0x1] +var r12 = i[01] +var r13 = i[-01] + + +//// [objectTypeWithStringNamedNumericProperty.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r1 = c['0.1']; +var r2 = c['.1']; +var r3 = c['1']; +var r3 = c[1]; +var r4 = c['1.']; +var r3 = c[1.]; +var r5 = c['1..']; +var r6 = c['1.0']; +var r3 = c[1.0]; +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1]; +var r11 = i[-0x1]; +var r12 = i[01]; +var r13 = i[-01]; +var i; +var r1 = i['0.1']; +var r2 = i['.1']; +var r3 = i['1']; +var r3 = c[1]; +var r4 = i['1.']; +var r3 = c[1.]; +var r5 = i['1..']; +var r6 = i['1.0']; +var r3 = c[1.0]; +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1]; +var r11 = i[-0x1]; +var r12 = i[01]; +var r13 = i[-01]; +var a; +var r1 = a['0.1']; +var r2 = a['.1']; +var r3 = a['1']; +var r3 = c[1]; +var r4 = a['1.']; +var r3 = c[1.]; +var r5 = a['1..']; +var r6 = a['1.0']; +var r3 = c[1.0]; +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1]; +var r11 = i[-0x1]; +var r12 = i[01]; +var r13 = i[-01]; +var b = { + "0.1": null, + ".1": new Object(), + "1": 1, + "1.": "", + "1..": true, + "1.0": new Date(), + "-1.0": /123/, + "-1": Date +}; +var r1 = b['0.1']; +var r2 = b['.1']; +var r3 = b['1']; +var r3 = c[1]; +var r4 = b['1.']; +var r3 = c[1.]; +var r5 = b['1..']; +var r6 = b['1.0']; +var r3 = c[1.0]; +var r7 = i[-1]; +var r7 = i[-1.0]; +var r8 = i["-1.0"]; +var r9 = i["-1"]; +var r10 = i[0x1]; +var r11 = i[-0x1]; +var r12 = i[01]; +var r13 = i[-01]; diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js new file mode 100644 index 0000000000000..9c674854cdc51 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.js @@ -0,0 +1,85 @@ +//// [objectTypeWithStringNamedPropertyOfIllegalCharacters.ts] +class C { + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; + "a\a": number; + static "a ": number +} + +var c: C; +var r = c[" "]; +var r2 = c[" "]; +var r3 = c["a b"]; +// BUG 817263 +var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; + +interface I { + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var i: I; +var r = i[" "]; +var r2 = i[" "]; +var r3 = i["a b"]; +// BUG 817263 +var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; + + +var a: { + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var r = a[" "]; +var r2 = a[" "]; +var r3 = a["a b"]; +// BUG 817263 +var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; + +var b = { + " ": 1, + "a b": "", + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, +} + +var r = b[" "]; +var r2 = b[" "]; +var r3 = b["a b"]; +// BUG 817263 +var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; + + +//// [objectTypeWithStringNamedPropertyOfIllegalCharacters.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r = c[" "]; +var r2 = c[" "]; +var r3 = c["a b"]; +var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +var i; +var r = i[" "]; +var r2 = i[" "]; +var r3 = i["a b"]; +var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +var a; +var r = a[" "]; +var r2 = a[" "]; +var r3 = a["a b"]; +var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +var b = { + " ": 1, + "a b": "", + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1 +}; +var r = b[" "]; +var r2 = b[" "]; +var r3 = b["a b"]; +var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; diff --git a/tests/baselines/reference/objectTypesIdentity.js b/tests/baselines/reference/objectTypesIdentity.js new file mode 100644 index 0000000000000..c583ca4e5fbd7 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity.js @@ -0,0 +1,142 @@ +//// [objectTypesIdentity.ts] +// object types are identical structurally + +class A { + foo: string; +} + +class B { + foo: string; +} + +class C { + foo: T; +} + +interface I { + foo: string; +} + +var a: { foo: string; } +var b = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +//// [objectTypesIdentity.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentity2.js b/tests/baselines/reference/objectTypesIdentity2.js new file mode 100644 index 0000000000000..60d950328720c --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity2.js @@ -0,0 +1,111 @@ +//// [objectTypesIdentity2.ts] +// object types are identical structurally + +class A { + foo: number; +} + +class B { + foo: boolean; +} + +class C { + foo: T; +} + +interface I { + foo: Date; +} + +var a: { foo: RegExp; } +enum E { A } +var b = { foo: E.A }; + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentity2.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var a; +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var b = { foo: 0 /* A */ }; +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js new file mode 100644 index 0000000000000..733d378cdf0fa --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithCallSignatures.ts] +// object types are identical structurally + +class A { + foo(x: string): string { return null; } +} + +class B { + foo(x: string): string { return null; } +} + +class C { + foo(x: T): T { return null; } +} + +interface I { + foo(x: string): string; +} + +interface I2 { + foo(x: T): T; +} + +var a: { foo(x: string): string } +var b = { foo(x: string) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // error +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignatures.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js new file mode 100644 index 0000000000000..4eb44d8daecba --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithCallSignatures2.ts] +// object types are identical structurally + +class A { + foo(x: string): string { return null; } +} + +class B { + foo(x: number): string { return null; } +} + +class C { + foo(x: T): T { return null; } +} + +interface I { + foo(x: boolean): string; +} + +interface I2 { + foo(x: T): T; +} + +var a: { foo(x: Date): string } +var b = { foo(x: RegExp) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // error +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignatures2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt new file mode 100644 index 0000000000000..994ce2a1cef98 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures3.ts (2 errors) ==== + // object types are identical structurally + + interface I { + (x: string): string; + } + + interface I2 { + (x: T): T; + } + + var a: { (x: string): string } + + function foo2(x: I); + function foo2(x: I); // error + function foo2(x: any) { } + + function foo3(x: typeof a); + function foo3(x: typeof a); // error + function foo3(x: any) { } + + function foo4(x: typeof b); + ~ +!!! Cannot find name 'b'. + function foo4(x: typeof b); // error + ~ +!!! Cannot find name 'b'. + function foo4(x: any) { } + + function foo13(x: I); + function foo13(x: typeof a); // error + function foo13(x: any) { } + + function foo14(x: I); + function foo14(x: I2); // error + function foo14(x: any) { } + + function foo14b(x: typeof a); + function foo14b(x: I2); // error + function foo14b(x: any) { } + + function foo15(x: I); + function foo15(x: I2); // ok + function foo15(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js new file mode 100644 index 0000000000000..988d48ad92cd3 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures3.js @@ -0,0 +1,57 @@ +//// [objectTypesIdentityWithCallSignatures3.ts] +// object types are identical structurally + +interface I { + (x: string): string; +} + +interface I2 { + (x: T): T; +} + +var a: { (x: string): string } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: I2); // error +function foo14(x: any) { } + +function foo14b(x: typeof a); +function foo14b(x: I2); // error +function foo14b(x: any) { } + +function foo15(x: I); +function foo15(x: I2); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignatures3.js] +var a; +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo14b(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js new file mode 100644 index 0000000000000..314015046a9f5 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts] +// object types are identical structurally + +class A { + foo(x: string): string { return null; } +} + +class B { + foo(x: string, y: string): string { return null; } +} + +class C { + foo(x: T, y: T): T { return null; } +} + +interface I { + foo(x: string): string; +} + +interface I2 { + foo(x: T): T; +} + +var a: { foo(x: string, y: string): string } +var b = { foo(x: string) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignaturesDifferingParamCounts.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js new file mode 100644 index 0000000000000..5fbcf648a97c7 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js @@ -0,0 +1,63 @@ +//// [objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts] +// object types are identical structurally + +interface I { + (x: string): string; +} + +interface I2 { + (x: T): T; +} + +var a: { (x: string, y: string): string } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: I2); +function foo4(x: I2); // error +function foo4(x: any) { } + +function foo5(x: I2); +function foo5(x: I2); // ok +function foo5(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: I2); // error +function foo14(x: any) { } + +function foo14b(x: typeof a); +function foo14b(x: I2); // ok +function foo14b(x: any) { } + +function foo15(x: I); +function foo15(x: I2); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignaturesDifferingParamCounts2.js] +var a; +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo14b(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js new file mode 100644 index 0000000000000..7182e5cd0aff1 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.js @@ -0,0 +1,187 @@ +//// [objectTypesIdentityWithCallSignaturesWithOverloads.ts] +// object types are identical structurally + +class A { + foo(x: number): number; + foo(x: string): string; + foo(x: any): any { return null; } +} + +class B { + foo(x: number): number; + foo(x: string): string; + foo(x: any): any { return null; } +} + +class C { + foo(x: number): number; + foo(x: string): string; + foo(x: T): T; + foo(x: any): any { return null; } +} + +interface I { + foo(x: number): number; + foo(x: string): string; +} + +interface I2 { + foo(x: number): number; + foo(x: string): string; + foo(x: T): T; +} + +var a: { + foo(x: number): number + foo(x: string): string +} + +var b = { + foo(x: any) { return ''; } +}; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // BUG 831930 +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // BUG 831930 +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // BUG 831930 +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // BUG 831930 +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithCallSignaturesWithOverloads.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { + foo: function foo(x) { + return ''; + } +}; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt new file mode 100644 index 0000000000000..c3032d3eac111 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts (1 errors) ==== + interface A { + (x: T, y: S): void + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }>(x: T, y: T): void + ~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + interface B { + (x: U, y: U): void + } + + // ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters + function foo(x: A); + function foo(x: B); // error after constraints above made illegal + function foo(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js new file mode 100644 index 0000000000000..9f16153da372b --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.js @@ -0,0 +1,19 @@ +//// [objectTypesIdentityWithComplexConstraints.ts] +interface A { + (x: T, y: S): void + }>(x: T, y: T): void +} + +interface B { + (x: U, y: U): void +} + +// ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters +function foo(x: A); +function foo(x: B); // error after constraints above made illegal +function foo(x: any) { } + +//// [objectTypesIdentityWithComplexConstraints.js] +function foo(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js new file mode 100644 index 0000000000000..0b14f982b403c --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.js @@ -0,0 +1,138 @@ +//// [objectTypesIdentityWithConstructSignatures.ts] +// object types are identical structurally + +class A { + constructor(x: string) { } +} + +class B { + constructor(x: string) { } +} + +class C { + constructor(x: T) { } +} + +interface I { + new(x: string); +} + +interface I2 { + new(x: T): T; +} + +var a: { new(x: string) } + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithConstructSignatures.js] +var A = (function () { + function A(x) { + } + return A; +})(); +var B = (function () { + function B(x) { + } + return B; +})(); +var C = (function () { + function C(x) { + } + return C; +})(); +var a; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js new file mode 100644 index 0000000000000..b60ab7a68b420 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js @@ -0,0 +1,123 @@ +//// [objectTypesIdentityWithConstructSignatures2.ts] +// object types are identical structurally + +class B { + constructor(x: number) { return null; } +} + +class C { + constructor(x: T) { return null; } +} + +interface I { + new(x: boolean): string; +} + +interface I2 { + new(x: T): T; +} + +var a: { new(x: Date): string } +var b = { new(x: RegExp) { return ''; } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error, types are structurally equal +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithConstructSignatures2.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return ''; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js new file mode 100644 index 0000000000000..a49e12a7fb5f1 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js @@ -0,0 +1,123 @@ +//// [objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts] +// object types are identical structurally + +class B { + constructor(x: string, y: string) { return null; } +} + +class C { + constructor(x: T, y: T) { return null; } +} + +interface I { + new(x: string): string; +} + +interface I2 { + new(x: T): T; +} + +var a: { new(x: string, y: string): string } +var b = { new(x: string) { return ''; } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error, types are structurally equal +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js] +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return ''; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js new file mode 100644 index 0000000000000..b967ef12e2356 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithGenericCallSignatures.ts] +// object types are identical structurally + +class A { + foo(x: T): T { return null; } +} + +class B { + foo(x: T): T { return null; } +} + +class C { + foo(x: T): T { return null; } +} + +interface I { + foo(x: T): T; +} + +interface I2 { + foo(x: T): T; +} + +var a: { foo(x: T): T } +var b = { foo(x: T) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignatures.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js new file mode 100644 index 0000000000000..7bb41dbb4f226 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithGenericCallSignatures2.ts] +// object types are identical structurally + +class A { + foo(x: T, y: U): T { return null; } +} + +class B { + foo(x: T, y: U): T { return null; } +} + +class C { + foo(x: T, y: U): T { return null; } +} + +interface I { + foo(x: T, y: U): T; +} + +interface I2 { + foo(x: T, y: U): T; +} + +var a: { foo(x: T, y: U): T } +var b = { foo(x: T, y: U) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error, bug? +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignatures2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x, y) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js new file mode 100644 index 0000000000000..3953d2529c6bb --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T): string { return null; } +} + +class B> { + foo(x: T): string { return null; } +} + +class C { + foo(x: T): string { return null; } +} + +interface I { + foo(x: T): string; +} + +interface I2 { + foo(x: T): string; +} + +var a: { foo>(x: T): string } +var b = { foo(x: T) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B>); +function foo1b(x: B>); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B>); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B>); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B>); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B>); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B>); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt new file mode 100644 index 0000000000000..3dc6c5f5d3439 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt @@ -0,0 +1,131 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts (8 errors) ==== + // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those + // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, + // optional or rest) and types, and identical return types. + + class A { + foo(x: T, y: U): string { return null; } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + class B> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + class D { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + interface I { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string; + } + + interface I2 { + foo(x: T, y: U): string; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + var a: { foo>(x: T, y: U): string } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b = { foo(x: T, y: U) { return ''; } }; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + function foo1(x: A); + function foo1(x: A); // error + function foo1(x: any) { } + + function foo1b(x: B, Array>); + function foo1b(x: B, Array>); // error + function foo1b(x: any) { } + + function foo1c(x: C); + function foo1c(x: C); // error + function foo1c(x: any) { } + + function foo2(x: I); + function foo2(x: I); // error + function foo2(x: any) { } + + function foo3(x: typeof a); + function foo3(x: typeof a); // error + function foo3(x: any) { } + + function foo4(x: typeof b); + function foo4(x: typeof b); // error + function foo4(x: any) { } + + function foo5(x: A); + function foo5(x: B, Array>); // ok + function foo5(x: any) { } + + function foo5b(x: A); + function foo5b(x: C); // ok + function foo5b(x: any) { } + + function foo5c(x: C); + function foo5c(x: D); // ok + function foo5c(x: any) { } + + function foo6c(x: C); + function foo6c(x: D); // error, "any" does not satisfy the constraint + function foo6c(x: any) { } + + function foo6(x: A); + function foo6(x: I); // ok + function foo6(x: any) { } + + function foo7(x: A); + function foo7(x: typeof a); // ok + function foo7(x: any) { } + + function foo8(x: B, Array>); + function foo8(x: I); // ok + function foo8(x: any) { } + + function foo9(x: B, Array>); + function foo9(x: C); // ok + function foo9(x: any) { } + + function foo10(x: B, Array>); + function foo10(x: typeof a); // ok + function foo10(x: any) { } + + function foo11(x: B, Array>); + function foo11(x: typeof b); // ok + function foo11(x: any) { } + + function foo12(x: I); + function foo12(x: C); // ok + function foo12(x: any) { } + + function foo12b(x: I2); + function foo12b(x: C); // ok + function foo12b(x: any) { } + + function foo13(x: I); + function foo13(x: typeof a); // ok + function foo13(x: any) { } + + function foo14(x: I); + function foo14(x: typeof b); // ok + function foo14(x: any) { } + + function foo15(x: I2); + function foo15(x: C); // ok + function foo15(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js new file mode 100644 index 0000000000000..b9d3ad18f12ac --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js @@ -0,0 +1,195 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T, y: U): string { return null; } +} + +class B> { + foo(x: T, y: U): string { return null; } +} + +class C { + foo(x: T, y: U): string { return null; } +} + +class D { + foo(x: T, y: U): string { return null; } +} + +interface I { + foo(x: T, y: U): string; +} + +interface I2 { + foo(x: T, y: U): string; +} + +var a: { foo>(x: T, y: U): string } +var b = { foo(x: T, y: U) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B, Array>); +function foo1b(x: B, Array>); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B, Array>); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo5c(x: C); +function foo5c(x: D); // ok +function foo5c(x: any) { } + +function foo6c(x: C); +function foo6c(x: D); // error, "any" does not satisfy the constraint +function foo6c(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B, Array>); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B, Array>); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B, Array>); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B, Array>); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (x, y) { + return null; + }; + return D; +})(); +var a; +var b = { foo: function foo(x, y) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo6c(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt new file mode 100644 index 0000000000000..8ec2435ba29cf --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt @@ -0,0 +1,140 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts (8 errors) ==== + // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those + // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, + // optional or rest) and types, and identical return types. + + class One { foo: string } + class Two { foo: string } + interface Three { foo: string } + interface Four { foo: T } + interface Five extends Four { } + interface Six { + foo: T; + } + + class A { + foo(x: T, y: U): string { return null; } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + class B { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + class D> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string { return null; } + } + + interface I> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo(x: T, y: U): string; + } + + interface I2 { + foo>(x: T, y: U): string; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + var a: { foo(x: T, y: U): string } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b = { foo(x: T, y: U) { return ''; } }; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + function foo1(x: A); + function foo1(x: A); // error + function foo1(x: any) { } + + function foo1b(x: B); + function foo1b(x: B); // error + function foo1b(x: any) { } + + function foo1c(x: C); + function foo1c(x: C); // error + function foo1c(x: any) { } + + function foo2(x: I, Five>); + function foo2(x: I, Five>); // error + function foo2(x: any) { } + + function foo3(x: typeof a); + function foo3(x: typeof a); // error + function foo3(x: any) { } + + function foo4(x: typeof b); + function foo4(x: typeof b); // error + function foo4(x: any) { } + + function foo5(x: A); + function foo5(x: B); // ok + function foo5(x: any) { } + + function foo5b(x: A); + function foo5b(x: C); // ok + function foo5b(x: any) { } + + function foo5c(x: C); + function foo5c(x: D, Four>); // error + function foo5c(x: any) { } + + function foo6c(x: C); + function foo6c(x: D, Four>); // error + function foo6c(x: any) { } + + function foo6(x: A); + function foo6(x: I, Five>); // ok + function foo6(x: any) { } + + function foo7(x: A); + function foo7(x: typeof a); // error + function foo7(x: any) { } + + function foo8(x: B); + function foo8(x: I, Five>); // error + function foo8(x: any) { } + + function foo9(x: B); + function foo9(x: C); // error + function foo9(x: any) { } + + function foo10(x: B); + function foo10(x: typeof a); // ok + function foo10(x: any) { } + + function foo11(x: B); + function foo11(x: typeof b); // ok + function foo11(x: any) { } + + function foo12(x: I, Five>); + function foo12(x: C); // error + function foo12(x: any) { } + + function foo12b(x: I2); + function foo12b(x: C); // ok + function foo12b(x: any) { } + + function foo13(x: I, Five>); + function foo13(x: typeof a); // ok + function foo13(x: any) { } + + function foo14(x: I, Five>); + function foo14(x: typeof b); // ok + function foo14(x: any) { } + + function foo15(x: I2); + function foo15(x: C); // ok + function foo15(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js new file mode 100644 index 0000000000000..180301492f0df --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js @@ -0,0 +1,214 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +class Two { foo: string } +interface Three { foo: string } +interface Four { foo: T } +interface Five extends Four { } +interface Six { + foo: T; +} + +class A { + foo(x: T, y: U): string { return null; } +} + +class B { + foo(x: T, y: U): string { return null; } +} + +class C { + foo(x: T, y: U): string { return null; } +} + +class D> { + foo(x: T, y: U): string { return null; } +} + +interface I> { + foo(x: T, y: U): string; +} + +interface I2 { + foo>(x: T, y: U): string; +} + +var a: { foo(x: T, y: U): string } +var b = { foo(x: T, y: U) { return ''; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I, Five>); +function foo2(x: I, Five>); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo5c(x: C); +function foo5c(x: D, Four>); // error +function foo5c(x: any) { } + +function foo6c(x: C); +function foo6c(x: D, Four>); // error +function foo6c(x: any) { } + +function foo6(x: A); +function foo6(x: I, Five>); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I, Five>); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I, Five>); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I, Five>); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I, Five>); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.js] +var One = (function () { + function One() { + } + return One; +})(); +var Two = (function () { + function Two() { + } + return Two; +})(); +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.foo = function (x, y) { + return null; + }; + return D; +})(); +var a; +var b = { foo: function foo(x, y) { + return ''; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo6c(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js new file mode 100644 index 0000000000000..4ee59c0e33685 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T): string { return null; } +} + +class B { + foo(x: T): number { return null; } +} + +class C { + foo(x: T): boolean { return null; } +} + +interface I { + foo(x: T): Date; +} + +interface I2 { + foo(x: T): RegExp; +} + +var a: { foo(x: T): T } +var b = { foo(x: T) { return null; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return null; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js new file mode 100644 index 0000000000000..f8476f53d6877 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T): string { return null; } +} + +class B { + foo(x: T): number { return null; } +} + +class C { + foo(x: T): boolean { return null; } +} + +interface I { + foo(x: T): Date; +} + +interface I2 { + foo(x: T): RegExp; +} + +var a: { foo(x: T): T } +var b = { foo(x: T) { return null; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return null; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js new file mode 100644 index 0000000000000..aceea0523ff41 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts] +// object types are identical structurally + +class A { + foo(x: T): T { return null; } +} + +class B { + foo(x: U): U { return null; } +} + +class C { + foo(x: V): V { return null; } +} + +interface I { + foo(x: X): X; +} + +interface I2 { + foo(x: Y): Y; +} + +var a: { foo(x: Z): Z } +var b = { foo(x: A) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error, bug? +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C>); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I, number, Date, string>); +function foo12(x: C, number, Date>); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C, B>); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js new file mode 100644 index 0000000000000..4d434a28f8420 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js @@ -0,0 +1,58 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts] +// object types are identical structurally + + +interface I { + (x: X): X; +} + +interface I2 { + (x: Y): Y; +} + +var a: { (x: Z): Z } + +function foo1(x: I); +function foo1(x: I); // error +function foo1(x: any) { } + +function foo2(x: I2); +function foo2(x: I2); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: I2); // error +function foo14(x: any) { } + +function foo14b(x: typeof a); +function foo14b(x: I2); // ok +function foo14b(x: any) { } + +function foo15(x: I); +function foo15(x: I2); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.js] +var a; +function foo1(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo14b(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js new file mode 100644 index 0000000000000..0c29c37687c15 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js @@ -0,0 +1,169 @@ +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts] +// object types are identical structurally + +class A { + foo(x: T): T { return null; } +} + +class B { + foo(x: U): U { return null; } +} + +class C { + foo(x: V): V { return null; } +} + +interface I { + foo(x: X): X; +} + +interface I2 { + foo(x: Y): Y; +} + +var a: { foo(x: Z): Z } +var b = { foo(x: A) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js new file mode 100644 index 0000000000000..c7725f4e29dc2 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T, y?: T): T { return null; } +} + +class B { + foo(x: T, y?: T): T { return null; } +} + +class C { + foo(x: T, y?: T): T { return null; } +} + +interface I { + foo(x: T, y?: T): T; +} + +interface I2 { + foo(x: T, y?: T): T; +} + +var a: { foo(x: T, y?: T): T } +var b = { foo(x: T, y?: T) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error, bug? +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x, y) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js new file mode 100644 index 0000000000000..433f734ab4ecb --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T, y?: U): T { return null; } +} + +class B { + foo(x: T, y?: U): T { return null; } +} + +class C { + foo(x: T, y?: U): T { return null; } +} + +interface I { + foo(x: T, y?: U): T; +} + +interface I2 { + foo(x: T, y?: U): T; +} + +var a: { foo(x: T, y?: U): T } +var b = { foo(x: T, y?: U) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error, bug? +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams2.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x, y) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js new file mode 100644 index 0000000000000..ea044f43302aa --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js @@ -0,0 +1,171 @@ +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { + foo(x: T, y?: U): T { return null; } +} + +class B { + foo(x: T, y: U): T { return null; } +} + +class C { + foo(x: T, y?: U): T { return null; } +} + +interface I { + foo(x: T, y?: U): T; +} + +interface I2 { + foo(x: T, y: U): T; +} + +var a: { foo(x: T, y?: U): T } +var b = { foo(x: T, y: U) { return x; } }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error, bug? +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericCallSignaturesOptionalParams3.js] +var A = (function () { + function A() { + } + A.prototype.foo = function (x, y) { + return null; + }; + return A; +})(); +var B = (function () { + function B() { + } + B.prototype.foo = function (x, y) { + return null; + }; + return B; +})(); +var C = (function () { + function C() { + } + C.prototype.foo = function (x, y) { + return null; + }; + return C; +})(); +var a; +var b = { foo: function foo(x, y) { + return x; +} }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js new file mode 100644 index 0000000000000..69f8510f463ee --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js @@ -0,0 +1,120 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { + constructor(x: T) { return null; } +} + +class C { + constructor(x: T) { return null; } +} + +interface I { + new(x: T): string; +} + +interface I2 { + new(x: T): string; +} + +var a: { new>(x: T): string } +var b = { new(x: T) { return ''; } }; // not a construct signature, function called new + +function foo1b(x: B>); +function foo1b(x: B>); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B>); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B>); +function foo9(x: C); // error, types are structurally equal +function foo9(x: any) { } + +function foo10(x: B>); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B>); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return ''; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt new file mode 100644 index 0000000000000..7f1d923565a0b --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt @@ -0,0 +1,101 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts (7 errors) ==== + // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those + // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, + // optional or rest) and types, and identical return types. + + class B> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + class D { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + interface I { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + new(x: T, y: U): string; + } + + interface I2 { + new(x: T, y: U): string; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + var a: { new>(x: T, y: U): string } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + function foo1b(x: B, Array>); + function foo1b(x: B, Array>); // error + function foo1b(x: any) { } + + function foo1c(x: C); + function foo1c(x: C); // error + function foo1c(x: any) { } + + function foo2(x: I); + function foo2(x: I); // error + function foo2(x: any) { } + + function foo3(x: typeof a); + function foo3(x: typeof a); // error + function foo3(x: any) { } + + function foo4(x: typeof b); + function foo4(x: typeof b); // error + function foo4(x: any) { } + + function foo5c(x: C); + function foo5c(x: D); // ok + function foo5c(x: any) { } + + function foo6c(x: C); + function foo6c(x: D); // ok + function foo6c(x: any) { } + + function foo8(x: B, Array>); + function foo8(x: I); // ok + function foo8(x: any) { } + + function foo9(x: B, Array>); + function foo9(x: C); // error, types are structurally equal + function foo9(x: any) { } + + function foo10(x: B, Array>); + function foo10(x: typeof a); // ok + function foo10(x: any) { } + + function foo11(x: B, Array>); + function foo11(x: typeof b); // ok + function foo11(x: any) { } + + function foo12(x: I); + function foo12(x: C); // ok + function foo12(x: any) { } + + function foo12b(x: I2); + function foo12b(x: C); // ok + function foo12b(x: any) { } + + function foo13(x: I); + function foo13(x: typeof a); // ok + function foo13(x: any) { } + + function foo14(x: I); + function foo14(x: typeof b); // ok + function foo14(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js new file mode 100644 index 0000000000000..add492d94f97f --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js @@ -0,0 +1,141 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { + constructor(x: T, y: U) { return null; } +} + +class C { + constructor(x: T, y: U) { return null; } +} + +class D { + constructor(x: T, y: U) { return null; } +} + +interface I { + new(x: T, y: U): string; +} + +interface I2 { + new(x: T, y: U): string; +} + +var a: { new>(x: T, y: U): string } +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new + +function foo1b(x: B, Array>); +function foo1b(x: B, Array>); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5c(x: C); +function foo5c(x: D); // ok +function foo5c(x: any) { } + +function foo6c(x: C); +function foo6c(x: D); // ok +function foo6c(x: any) { } + +function foo8(x: B, Array>); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B, Array>); +function foo9(x: C); // error, types are structurally equal +function foo9(x: any) { } + +function foo10(x: B, Array>); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B, Array>); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js] +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var D = (function () { + function D(x, y) { + return null; + } + return D; +})(); +var a; +var b = { new: function new(x, y) { + return ''; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5c(x) { +} +function foo6c(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt new file mode 100644 index 0000000000000..053dec33b4ab7 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt @@ -0,0 +1,110 @@ +==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts (7 errors) ==== + // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those + // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, + // optional or rest) and types, and identical return types. + + class One { foo: string } + class Two { foo: string } + interface Three { foo: string } + interface Four { foo: T } + interface Five extends Four { } + interface Six { + foo: T; + } + + class B { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + class D> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + constructor(x: T, y: U) { return null; } + } + + interface I> { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + new(x: T, y: U): string; + } + + interface I2 { + new>(x: T, y: U): string; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + + var a: { new(x: T, y: U): string } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + function foo1b(x: B); + function foo1b(x: B); // error + function foo1b(x: any) { } + + function foo1c(x: C); + function foo1c(x: C); // error + function foo1c(x: any) { } + + function foo2(x: I, Five>); + function foo2(x: I, Five>); // error + function foo2(x: any) { } + + function foo3(x: typeof a); + function foo3(x: typeof a); // error + function foo3(x: any) { } + + function foo4(x: typeof b); + function foo4(x: typeof b); // error + function foo4(x: any) { } + + function foo5c(x: C); + function foo5c(x: D, Four>); // error + function foo5c(x: any) { } + + function foo6c(x: C); + function foo6c(x: D, Four>); // error + function foo6c(x: any) { } + + function foo8(x: B); + function foo8(x: I, Five>); // error + function foo8(x: any) { } + + function foo9(x: B); + function foo9(x: C); // error + function foo9(x: any) { } + + function foo10(x: B); + function foo10(x: typeof a); // ok + function foo10(x: any) { } + + function foo11(x: B); + function foo11(x: typeof b); // ok + function foo11(x: any) { } + + function foo12(x: I, Five>); + function foo12(x: C); // ok + function foo12(x: any) { } + + function foo12b(x: I2); + function foo12b(x: C); // ok + function foo12b(x: any) { } + + function foo13(x: I, Five>); + function foo13(x: typeof a); // ok + function foo13(x: any) { } + + function foo14(x: I, Five>); + function foo14(x: typeof b); // ok + function foo14(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js new file mode 100644 index 0000000000000..6364251541099 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js @@ -0,0 +1,160 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +class Two { foo: string } +interface Three { foo: string } +interface Four { foo: T } +interface Five extends Four { } +interface Six { + foo: T; +} + +class B { + constructor(x: T, y: U) { return null; } +} + +class C { + constructor(x: T, y: U) { return null; } +} + +class D> { + constructor(x: T, y: U) { return null; } +} + +interface I> { + new(x: T, y: U): string; +} + +interface I2 { + new>(x: T, y: U): string; +} + +var a: { new(x: T, y: U): string } +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I, Five>); +function foo2(x: I, Five>); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5c(x: C); +function foo5c(x: D, Four>); // error +function foo5c(x: any) { } + +function foo6c(x: C); +function foo6c(x: D, Four>); // error +function foo6c(x: any) { } + +function foo8(x: B); +function foo8(x: I, Five>); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I, Five>); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I, Five>); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I, Five>); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js] +var One = (function () { + function One() { + } + return One; +})(); +var Two = (function () { + function Two() { + } + return Two; +})(); +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var D = (function () { + function D(x, y) { + return null; + } + return D; +})(); +var a; +var b = { new: function new(x, y) { + return ''; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5c(x) { +} +function foo6c(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js new file mode 100644 index 0000000000000..6caa70f01d027 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js @@ -0,0 +1,131 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { + constructor(x: T) { return null; } +} + +class C { + constructor(x: T) { return null; } +} + +interface I { + new(x: T): Date; +} + +interface I2 { + new(x: T): RegExp; +} + +var a: { new(x: T): T } +var b = { new(x: T): T { return null; } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: typeof a): number; +function foo5(x: typeof b): string; // ok +function foo5(x: any): any { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error since types are structurally equal +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return null; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js new file mode 100644 index 0000000000000..de1fbae6e51de --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js @@ -0,0 +1,125 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { + constructor(x: T) { return null; } +} + +class C { + constructor(x: T) { return null; } +} + +interface I { + new(x: T): Date; +} + +interface I2 { + new(x: T): RegExp; +} + +var a: { new(x: T): T } +var b = { new(x: T) { return null; } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error since types are structurally equal +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I2); +function foo15(x: C); // ok +function foo15(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return null; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js new file mode 100644 index 0000000000000..8967ad413ad41 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js @@ -0,0 +1,117 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts] +// object types are identical structurally + +class B { + constructor(x: U) { return null; } +} + +class C { + constructor(x: V) { return null; } +} + +interface I { + new(x: X): B; +} + +interface I2 { + new (x: Y): C; +} + +var a: { new (x: Z): C; } +var b = { new(x: A) { return x; } }; + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // BUG 832086 +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C>); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I, number, Date, string>); +function foo12(x: C, number, Date>); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // BUG 832086 +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return x; +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js new file mode 100644 index 0000000000000..8ba7ad89579dd --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js @@ -0,0 +1,117 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts] +// object types are identical structurally + +class B { + constructor(x: U) { return null; } +} + +class C { + constructor(x: V) { return null; } +} + +interface I { + new(x: X): B; +} + +interface I2 { + new(x: Y): C; +} + +var a: { new(x: Z): B } +var b = { new(x: A) { return new C(x); } }; + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // BUG 832086 +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // BUG 832086 +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // BUG 832086 +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // BUG 832086 +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.js] +var B = (function () { + function B(x) { + return null; + } + return B; +})(); +var C = (function () { + function C(x) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x) { + return new C(x); +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js new file mode 100644 index 0000000000000..20deac456adf1 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js @@ -0,0 +1,119 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { + constructor(x: T, y?: T) { return null; } +} + +class C { + constructor(x: T, y?: T) { return null; } +} + +interface I { + new(x: T, y?: T): B; +} + +interface I2 { + new(x: T, y?: T): C; +} + +var a: { new(x: T, y?: T): B } +var b = { new(x: T, y?: T) { return new C(x, y); } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B): string; +function foo8(x: I): number; // BUG 832086 +function foo8(x: any): any { } + +function foo9(x: B); +function foo9(x: C); // error, differ only by return type +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // BUG 832086 +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // BUG 832086 +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // BUG 832086 +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js] +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x, y) { + return new C(x, y); +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js new file mode 100644 index 0000000000000..b29859f08e0e7 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js @@ -0,0 +1,119 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { + constructor(x: T, y?: U) { return null; } +} + +class C { + constructor(x: T, y?: U) { return null; } +} + +interface I { + new (x: T, y?: U): B; +} + +interface I2 { + new (x: T, y?: U): C; +} + +var a: { new(x: T, y?: U): B } +var b = { new(x: T, y?: U) { return new C(x, y); } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // BUG 832086 +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // BUG 832086 +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // BUG 832086 +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // ok +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // BUG 832086 +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js] +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x, y) { + return new C(x, y); +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js new file mode 100644 index 0000000000000..ba3ea4cc3b6ff --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js @@ -0,0 +1,119 @@ +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts] +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { + constructor(x: T, y: U) { return null; } +} + +class C { + constructor(x: T, y?: U) { return null; } +} + +interface I { + new(x: T, y?: U): B; +} + +interface I2 { + new(x: T, y: U): C; +} + +var a: { new (x: T, y?: U): B }; +var b = { new(x: T, y: U) { return new C(x, y); } }; // not a construct signature, function called new + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo8(x: B); +function foo8(x: I); // BUG 832086 +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error, differ only by return type +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // BUG 832086 +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo12b(x: I2); +function foo12b(x: C); // BUG 832086 +function foo12b(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // BUG 832086 +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js] +var B = (function () { + function B(x, y) { + return null; + } + return B; +})(); +var C = (function () { + function C(x, y) { + return null; + } + return C; +})(); +var a; +var b = { new: function new(x, y) { + return new C(x, y); +} }; +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo12b(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js new file mode 100644 index 0000000000000..b4eb5dbb104ab --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -0,0 +1,208 @@ +//// [objectTypesIdentityWithNumericIndexers1.ts] +// object types are identical structurally + +class A { + [x: number]: string; +} + +class B { + [x: number]: string; +} + +class C { + [x: number]: T; +} + +interface I { + [x: number]: string; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { + [x: number]: string; +} +var b: { [x: number]: string; } = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // error +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // error +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // error +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithNumericIndexers1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js new file mode 100644 index 0000000000000..38ab266de447e --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -0,0 +1,223 @@ +//// [objectTypesIdentityWithNumericIndexers2.ts] +// object types are identical structurally + +class Base { foo: string; } +class Derived extends Base { bar: string; } + +class A { + [x: number]: Base; +} + +class B { + [x: number]: Derived; +} + +class C { + [x: number]: T; +} + +interface I { + [x: number]: Derived; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { + [x: number]: Base; +} +var b: { [x: number]: Derived; } = { foo: null }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // ok +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // ok +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // ok +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithNumericIndexers2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: null }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js new file mode 100644 index 0000000000000..2cd751de2b742 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -0,0 +1,208 @@ +//// [objectTypesIdentityWithNumericIndexers3.ts] +// object types are identical structurally + +class A { + [x: number]: string; +} + +class B { + [x: string]: string; +} + +class C { + [x: number]: T; +} + +interface I { + [x: string]: string; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { + [x: string]: string; +} +var b: { [x: number]: string; } = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // ok +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // ok +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // ok +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // ok +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithNumericIndexers3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.js b/tests/baselines/reference/objectTypesIdentityWithOptionality.js new file mode 100644 index 0000000000000..45cf97cb5918c --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.js @@ -0,0 +1,94 @@ +//// [objectTypesIdentityWithOptionality.ts] +// object types are identical structurally + +class A { + foo: string; +} + +class B { + foo: string; +} + +class C { + foo: T; +} + +interface I { + foo?: string; +} + +var a: { foo?: string; } +var b = { foo: '' }; + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // ok +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // ok +function foo8(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo12(x: I); +function foo12(x: C); // ok +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // ok +function foo14(x: any) { } + +//// [objectTypesIdentityWithOptionality.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { foo: '' }; +function foo2(x) { +} +function foo3(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo10(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js new file mode 100644 index 0000000000000..f14833bbd05be --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -0,0 +1,206 @@ +//// [objectTypesIdentityWithPrivates.ts] +// object types are identical structurally + +class A { + private foo: string; +} + +class B { + private foo: string; +} + +class C { + private foo: T; +} + +interface I { + foo: string; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { foo: string; } +var b = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // no error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // no error +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // no error +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // no error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // no error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // no error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // no error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // no error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // no error +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // no error +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // no error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // no error +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // no error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithPrivates.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js new file mode 100644 index 0000000000000..5eedb318fd093 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -0,0 +1,73 @@ +//// [objectTypesIdentityWithPrivates2.ts] +// object types are identical structurally + +class C { + private foo: T; +} + +class D extends C { +} + +function foo1(x: C); +function foo1(x: C); // ok +function foo1(x: any) { } + +function foo2(x: D); +function foo2(x: D); // ok +function foo2(x: any) { } + +function foo3(x: C); +function foo3(x: D); // ok +function foo3(x: any) { } + +function foo4(x: C): number; +function foo4(x: D): string; // BUG 831926 +function foo4(x: any): any { } + +var r = foo4(new C()); +var r = foo4(new D()); + +function foo5(x: C): number; +function foo5(x: C): string; // error +function foo5(x: any): any { } + +function foo6(x: D): number; +function foo6(x: D): string; // error +function foo6(x: any): any { } + + + + +//// [objectTypesIdentityWithPrivates2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +function foo1(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +var r = foo4(new C()); +var r = foo4(new D()); +function foo5(x) { +} +function foo6(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.js b/tests/baselines/reference/objectTypesIdentityWithPublics.js new file mode 100644 index 0000000000000..1bc042a138fca --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.js @@ -0,0 +1,142 @@ +//// [objectTypesIdentityWithPublics.ts] +// object types are identical structurally + +class A { + public foo: string; +} + +class B { + public foo: string; +} + +class C { + public foo: T; +} + +interface I { + foo: string; +} + +var a: { foo: string; } +var b = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +//// [objectTypesIdentityWithPublics.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js new file mode 100644 index 0000000000000..4e09410e0f986 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -0,0 +1,208 @@ +//// [objectTypesIdentityWithStringIndexers.ts] +// object types are identical structurally + +class A { + [x: string]: string; +} + +class B { + [x: string]: string; +} + +class C { + [x: string]: T; +} + +interface I { + [x: string]: string; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { + [x: string]: string; +} +var b: { [x: string]: string; } = { foo: '' }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // error +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // error +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // error +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // error +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // error +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // error +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // error +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // error +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // error +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithStringIndexers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: '' }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js new file mode 100644 index 0000000000000..46a4065a7eb70 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -0,0 +1,223 @@ +//// [objectTypesIdentityWithStringIndexers2.ts] +// object types are identical structurally + +class Base { foo: string; } +class Derived extends Base { bar: string; } + +class A { + [x: string]: Base; +} + +class B { + [x: string]: Derived; +} + +class C { + [x: string]: T; +} + +interface I { + [x: string]: Derived; +} + +class PA extends A { +} + +class PB extends B { +} + +var a: { + [x: string]: Base; +} +var b: { [x: string]: Derived; } = { foo: null }; + +function foo1(x: A); +function foo1(x: A); // error +function foo1(x: any) { } + +function foo1b(x: B); +function foo1b(x: B); // error +function foo1b(x: any) { } + +function foo1c(x: C); +function foo1c(x: C); // error +function foo1c(x: any) { } + +function foo2(x: I); +function foo2(x: I); // error +function foo2(x: any) { } + +function foo3(x: typeof a); +function foo3(x: typeof a); // error +function foo3(x: any) { } + +function foo4(x: typeof b); +function foo4(x: typeof b); // error +function foo4(x: any) { } + +function foo5(x: A); +function foo5(x: B); // ok +function foo5(x: any) { } + +function foo5b(x: A); +function foo5b(x: C); // ok +function foo5b(x: any) { } + +function foo5c(x: A); +function foo5c(x: PA); // error +function foo5c(x: any) { } + +function foo5d(x: A); +function foo5d(x: PB); // ok +function foo5d(x: any) { } + +function foo6(x: A); +function foo6(x: I); // ok +function foo6(x: any) { } + +function foo7(x: A); +function foo7(x: typeof a); // error +function foo7(x: any) { } + +function foo8(x: B); +function foo8(x: I); // error +function foo8(x: any) { } + +function foo9(x: B); +function foo9(x: C); // ok +function foo9(x: any) { } + +function foo10(x: B); +function foo10(x: typeof a); // ok +function foo10(x: any) { } + +function foo11(x: B); +function foo11(x: typeof b); // error +function foo11(x: any) { } + +function foo11b(x: B); +function foo11b(x: PA); // ok +function foo11b(x: any) { } + +function foo11c(x: B); +function foo11c(x: PB); // error +function foo11c(x: any) { } + +function foo12(x: I); +function foo12(x: C); // error +function foo12(x: any) { } + +function foo13(x: I); +function foo13(x: typeof a); // ok +function foo13(x: any) { } + +function foo14(x: I); +function foo14(x: typeof b); // error +function foo14(x: any) { } + +function foo15(x: I); +function foo15(x: PA); // ok +function foo15(x: any) { } + +function foo16(x: I); +function foo16(x: PB); // error +function foo16(x: any) { } + + + +//// [objectTypesIdentityWithStringIndexers2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var PA = (function (_super) { + __extends(PA, _super); + function PA() { + _super.apply(this, arguments); + } + return PA; +})(A); +var PB = (function (_super) { + __extends(PB, _super); + function PB() { + _super.apply(this, arguments); + } + return PB; +})(B); +var a; +var b = { foo: null }; +function foo1(x) { +} +function foo1b(x) { +} +function foo1c(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +function foo5b(x) { +} +function foo5c(x) { +} +function foo5d(x) { +} +function foo6(x) { +} +function foo7(x) { +} +function foo8(x) { +} +function foo9(x) { +} +function foo10(x) { +} +function foo11(x) { +} +function foo11b(x) { +} +function foo11c(x) { +} +function foo12(x) { +} +function foo13(x) { +} +function foo14(x) { +} +function foo15(x) { +} +function foo16(x) { +} diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt new file mode 100644 index 0000000000000..72759fbded227 --- /dev/null +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (4 errors) ==== + // Basic uses of optional properties + + var a: { + x?: number; // ok + } + + interface I { + x?: number; // ok + } + + class C { + x?: number; // error + ~ +!!! A class member cannot be declared optional. + } + + interface I2 { + x?: T; // ok + } + + class C2 { + x?: T; // error + ~ +!!! A class member cannot be declared optional. + } + + var b = { + x?: 1 // error + ~ +!!! ':' expected. + ~ +!!! Expression expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt new file mode 100644 index 0000000000000..96ed619a37ab8 --- /dev/null +++ b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties2.ts (15 errors) ==== + // Illegal attempts to define optional methods + + var a: { + x()?: number; // error + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + } + + interface I { + x()?: number; // error + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + } + + class C { + x()?: number; // error + ~ +!!! Block or ';' expected. + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~~~ +!!! Function implementation expected. + } + + interface I2 { + x()?: T; // error + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + } + + class C2 { + x()?: T; // error + ~ +!!! Block or ';' expected. + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~~~ +!!! Function implementation expected. + } + + + var b = { + x()?: 1 // error + ~ +!!! '{' expected. + ~ +!!! Property assignment expected. + } + ~ +!!! ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt new file mode 100644 index 0000000000000..630f4c2ee7c6c --- /dev/null +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName.ts (4 errors) ==== + // it is an error to use a predefined type as a type name + + class any { } + ~~~ +!!! Class name cannot be 'any' + + class number { } + ~~~~~~ +!!! Class name cannot be 'number' + + class boolean { } + ~~~~~~~ +!!! Class name cannot be 'boolean' + class bool { } // not a predefined type anymore + + class string { } + ~~~~~~ +!!! Class name cannot be 'string' + + + \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js new file mode 100644 index 0000000000000..7026ae1d89261 --- /dev/null +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js @@ -0,0 +1,41 @@ +//// [objectTypesWithPredefinedTypesAsName.ts] +// it is an error to use a predefined type as a type name + +class any { } + +class number { } + +class boolean { } +class bool { } // not a predefined type anymore + +class string { } + + + + +//// [objectTypesWithPredefinedTypesAsName.js] +var any = (function () { + function any() { + } + return any; +})(); +var number = (function () { + function number() { + } + return number; +})(); +var boolean = (function () { + function boolean() { + } + return boolean; +})(); +var bool = (function () { + function bool() { + } + return bool; +})(); +var string = (function () { + function string() { + } + return string; +})(); diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt new file mode 100644 index 0000000000000..0e36e0cdefa4a --- /dev/null +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/types/specifyingTypes/predefinedTypes/objectTypesWithPredefinedTypesAsName2.ts (1 errors) ==== + // it is an error to use a predefined type as a type name + + class void {} // parse error unlike the others + ~~~~ +!!! Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/operatorAddNullUndefined.errors.txt b/tests/baselines/reference/operatorAddNullUndefined.errors.txt new file mode 100644 index 0000000000000..5accc58a1cc9a --- /dev/null +++ b/tests/baselines/reference/operatorAddNullUndefined.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/operatorAddNullUndefined.ts (4 errors) ==== + enum E { x } + var x1 = null + null; + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var x2 = null + undefined; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var x3 = undefined + null; + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var x4 = undefined + undefined; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var x5 = 1 + null; + var x6 = 1 + undefined; + var x7 = null + 1; + var x8 = undefined + 1; + var x9 = "test" + null; + var x10 = "test" + undefined; + var x11 = null + "test"; + var x12 = undefined + "test"; + var x13 = null + E.x + var x14 = undefined + E.x + var x15 = E.x + null + var x16 = E.x + undefined \ No newline at end of file diff --git a/tests/baselines/reference/operatorAddNullUndefined.js b/tests/baselines/reference/operatorAddNullUndefined.js new file mode 100644 index 0000000000000..f6b4fd240b257 --- /dev/null +++ b/tests/baselines/reference/operatorAddNullUndefined.js @@ -0,0 +1,40 @@ +//// [operatorAddNullUndefined.ts] +enum E { x } +var x1 = null + null; +var x2 = null + undefined; +var x3 = undefined + null; +var x4 = undefined + undefined; +var x5 = 1 + null; +var x6 = 1 + undefined; +var x7 = null + 1; +var x8 = undefined + 1; +var x9 = "test" + null; +var x10 = "test" + undefined; +var x11 = null + "test"; +var x12 = undefined + "test"; +var x13 = null + E.x +var x14 = undefined + E.x +var x15 = E.x + null +var x16 = E.x + undefined + +//// [operatorAddNullUndefined.js] +var E; +(function (E) { + E[E["x"] = 0] = "x"; +})(E || (E = {})); +var x1 = null + null; +var x2 = null + undefined; +var x3 = undefined + null; +var x4 = undefined + undefined; +var x5 = 1 + null; +var x6 = 1 + undefined; +var x7 = null + 1; +var x8 = undefined + 1; +var x9 = "test" + null; +var x10 = "test" + undefined; +var x11 = null + "test"; +var x12 = undefined + "test"; +var x13 = null + 0 /* x */; +var x14 = undefined + 0 /* x */; +var x15 = 0 /* x */ + null; +var x16 = 0 /* x */ + undefined; diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.js b/tests/baselines/reference/optionalAccessorsInInterface1.js new file mode 100644 index 0000000000000..3ebccc2ea8efb --- /dev/null +++ b/tests/baselines/reference/optionalAccessorsInInterface1.js @@ -0,0 +1,25 @@ +//// [optionalAccessorsInInterface1.ts] +interface MyPropertyDescriptor { + get? (): any; + set? (v: any): void; +} + +declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any; +defineMyProperty({}, "name", { get: function () { return 5; } }); + +interface MyPropertyDescriptor2 { + get?: () => any; + set?: (v: any) => void; +} + +declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any; +defineMyProperty2({}, "name", { get: function () { return 5; } }); + + +//// [optionalAccessorsInInterface1.js] +defineMyProperty({}, "name", { get: function () { + return 5; +} }); +defineMyProperty2({}, "name", { get: function () { + return 5; +} }); diff --git a/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt b/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt new file mode 100644 index 0000000000000..def37b39fe41f --- /dev/null +++ b/tests/baselines/reference/optionalArgsWithDefaultValues.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/optionalArgsWithDefaultValues.ts (5 errors) ==== + function foo(x: number, y?:boolean=false, z?=0) {} + ~ +!!! Parameter cannot have question mark and initializer. + + class CCC { + public foo(x: number, y?:boolean=false, z?=0) {} + ~ +!!! Parameter cannot have question mark and initializer. + static foo2(x: number, y?:boolean=false, z?=0) {} + ~ +!!! Parameter cannot have question mark and initializer. + } + + var a = (x?=0) => { return 1; }; + ~ +!!! Parameter cannot have question mark and initializer. + var b = (x, y?:number = 2) => { x; }; + ~ +!!! Parameter cannot have question mark and initializer. \ No newline at end of file diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js new file mode 100644 index 0000000000000..1e88fd8129979 --- /dev/null +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -0,0 +1,36 @@ +//// [optionalConstructorArgInSuper.ts] +class Base { + constructor(opt?) { } + foo(other?) { } +} +class Derived extends Base { +} +var d = new Derived(); // bug caused an error here, couldn't select overload +var d2: Derived; +d2.foo(); + + +//// [optionalConstructorArgInSuper.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base(opt) { + } + Base.prototype.foo = function (other) { + }; + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + return Derived; +})(Base); +var d = new Derived(); +var d2; +d2.foo(); diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt new file mode 100644 index 0000000000000..93ddbfa149b7b --- /dev/null +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/optionalFunctionArgAssignability.ts (1 errors) ==== + interface Promise { + then(onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; + } + + var a = function then(onFulfill?: (value: string) => U, onReject?: (reason: any) => U): Promise { return null }; + var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; + a = b; // error because number is not assignable to string + ~ +!!! Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': +!!! Types of parameters 'onFulFill' and 'onFulfill' are incompatible: +!!! Type '(value: number) => any' is not assignable to type '(value: string) => any': +!!! Types of parameters 'value' and 'value' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.js b/tests/baselines/reference/optionalFunctionArgAssignability.js new file mode 100644 index 0000000000000..1179bdf58da30 --- /dev/null +++ b/tests/baselines/reference/optionalFunctionArgAssignability.js @@ -0,0 +1,18 @@ +//// [optionalFunctionArgAssignability.ts] +interface Promise { + then(onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise; +} + +var a = function then(onFulfill?: (value: string) => U, onReject?: (reason: any) => U): Promise { return null }; +var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; +a = b; // error because number is not assignable to string + + +//// [optionalFunctionArgAssignability.js] +var a = function then(onFulfill, onReject) { + return null; +}; +var b = function then(onFulFill, onReject) { + return null; +}; +a = b; diff --git a/tests/baselines/reference/optionalParamArgsTest.errors.txt b/tests/baselines/reference/optionalParamArgsTest.errors.txt new file mode 100644 index 0000000000000..b3be75d6daa6c --- /dev/null +++ b/tests/baselines/reference/optionalParamArgsTest.errors.txt @@ -0,0 +1,169 @@ +==== tests/cases/compiler/optionalParamArgsTest.ts (22 errors) ==== + // Optional parameter and default argument tests + + // Key: + // Cx - "Class x" + // My - "Method x" + // Az - "Argument z" + // E.g., C1M1A1 = "Class 1, Method 1, Argument 1" + + interface I1 { + C1M1():number; + C1M2(C1M2A1:number):number; + C1M3(C1M3A1?:number,C1M3A2?:number):number; + C1M4(C1M4A1:number,C1M4A2?:number):number; + } + + // test basic configurations + class C1 { + constructor(v: number = 1, p: number = 0) { } + public n:number = 0; + + public C1M1() { return 0; } // returning C1M1A1 will result in "Unresolved symbol C1M1A1" + + public C1M2(C1M2A1:number) { return C1M2A1; } // will return C1M1A2 without complaint + + // C1M3 contains all optional parameters + public C1M3(C1M3A1:number=0,C1M3A2:number=C1M3A1) {return C1M3A1 + C1M3A2; } + + // C1M4 contains a mix of optional and non-optional parameters + public C1M4(C1M4A1:number,C1M4A2?:number) { return C1M4A1 + C1M4A2; } + + public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3?:number) { return C1M5A1 + C1M5A2; } + + // Negative test + // "Optional parameters may only be followed by other optional parameters" + public C1M5(C1M5A1:number,C1M5A2:number=0,C1M5A3:number) { return C1M5A1 + C1M5A2; } + ~~~~~~ +!!! A required parameter cannot follow an optional parameter. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate function implementation. + } + + class C2 extends C1 { + constructor(v2: number = 6) { + super(v2); + } + } + + + function F1() { return 0; } + function F2(F2A1:number) { return F2A1; } + function F3(F3A1=0,F3A2=F3A1) {return F3A1 + F3A2; } + function F4(F4A1:number,F4A2?:number) { return F4A1 + F4A2; } + + var L1 = function() {return 0;} + var L2 = function (L2A1:number) { return L2A1; } + var L3 = function (L3A1=0,L3A2=L3A1) {return L3A1 + L3A2; } + var L4 = function (L4A1:number,L4A2?:number) { return L4A1 + L4A2; } + + var c1o1:C1 = new C1(5); + var i1o1:I1 = new C1(5); + // Valid + c1o1.C1M1(); + var f1v1=F1(); + var l1v1=L1(); + + // Valid + c1o1.C1M2(1); + i1o1.C1M2(1); + var f2v1=F2(1); + var l2v1=L2(1); + + // Valid + c1o1.C1M3(1,2); + i1o1.C1M3(1,2); + var f3v1=F3(1,2); + var l3v1=L3(1,2); + + // Valid + c1o1.C1M4(1,2); + i1o1.C1M4(1,2); + var f4v1=F4(1,2); + var l4v1=L4(1,2); + + // Valid + c1o1.C1M3(1); + i1o1.C1M3(1); + var f3v2=F3(1); + var l3v2=L3(1); + + // Valid + c1o1.C1M3(); + i1o1.C1M3(); + var f3v3=F3(); + var l3v3=L3(); + + // Valid + c1o1.C1M4(1); + i1o1.C1M4(1); + var f4v2=F4(1); + var l4v2=L4(1); + + // Negative tests - we expect these cases to fail + c1o1.C1M1(1); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + i1o1.C1M1(1); + ~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + F1(1); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + L1(1); + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + c1o1.C1M2(); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + i1o1.C1M2(); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + F2(); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + L2(); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + c1o1.C1M2(1,2); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + i1o1.C1M2(1,2); + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + F2(1,2); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + L2(1,2); + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + c1o1.C1M3(1,2,3); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + i1o1.C1M3(1,2,3); + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + F3(1,2,3); + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + L3(1,2,3); + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + c1o1.C1M4(); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + i1o1.C1M4(); + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + F4(); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + L4(); + ~~~~ +!!! Supplied parameters do not match any signature of call target. + + function fnOpt1(id: number, children: number[] = [], expectedPath: number[] = [], isRoot?: boolean): void {} + function fnOpt2(id: number, children?: number[], expectedPath?: number[], isRoot?: boolean): void {} + fnOpt1(1, [2, 3], [1], true); + fnOpt2(1, [2, 3], [1], true); + \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..7871655b215ee --- /dev/null +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/optionalParamAssignmentCompat.ts (1 errors) ==== + interface I1 { + (p1: number, p2: string): void; + } + interface I2 { + p1: I1; + m1(p1?: string): I1; + } + var i2: I2; + var c: I1 = i2.p1; // should be ok + var d: I1 = i2.m1; // should error + ~~~~~~~~~~~~~ +!!! Type '(p1?: string) => I1' is not assignable to type 'I1': +!!! Types of parameters 'p1' and 'p1' are incompatible: +!!! Type 'string' is not assignable to type 'number'. + \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.js b/tests/baselines/reference/optionalParamAssignmentCompat.js new file mode 100644 index 0000000000000..a2b5267786967 --- /dev/null +++ b/tests/baselines/reference/optionalParamAssignmentCompat.js @@ -0,0 +1,17 @@ +//// [optionalParamAssignmentCompat.ts] +interface I1 { + (p1: number, p2: string): void; +} +interface I2 { + p1: I1; + m1(p1?: string): I1; +} +var i2: I2; +var c: I1 = i2.p1; // should be ok +var d: I1 = i2.m1; // should error + + +//// [optionalParamAssignmentCompat.js] +var i2; +var c = i2.p1; +var d = i2.m1; diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js new file mode 100644 index 0000000000000..0a094c6534c98 --- /dev/null +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -0,0 +1,32 @@ +//// [optionalParamInOverride.ts] +class Z { + public func(): void { } +} +class Y extends Z { + public func(value?: any): void { } +} + + +//// [optionalParamInOverride.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Z = (function () { + function Z() { + } + Z.prototype.func = function () { + }; + return Z; +})(); +var Y = (function (_super) { + __extends(Y, _super); + function Y() { + _super.apply(this, arguments); + } + Y.prototype.func = function (value) { + }; + return Y; +})(Z); diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.js b/tests/baselines/reference/optionalParamReferencingOtherParams1.js new file mode 100644 index 0000000000000..148b8f6d9b0d7 --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.js @@ -0,0 +1,11 @@ +//// [optionalParamReferencingOtherParams1.ts] +function strange(x: number, y = x * 1, z = x + y) { + return z; +} + +//// [optionalParamReferencingOtherParams1.js] +function strange(x, y, z) { + if (y === void 0) { y = x * 1; } + if (z === void 0) { z = x + y; } + return z; +} diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt b/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt new file mode 100644 index 0000000000000..51c632bded940 --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/optionalParamReferencingOtherParams2.ts (1 errors) ==== + var a = 1; + function strange(x = a, y = b) { + ~ +!!! Initializer of parameter 'y' cannot reference identifier 'b' declared after it. + var b = ""; + return y; + } \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams2.js b/tests/baselines/reference/optionalParamReferencingOtherParams2.js new file mode 100644 index 0000000000000..2fa267c81d99c --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams2.js @@ -0,0 +1,15 @@ +//// [optionalParamReferencingOtherParams2.ts] +var a = 1; +function strange(x = a, y = b) { + var b = ""; + return y; +} + +//// [optionalParamReferencingOtherParams2.js] +var a = 1; +function strange(x, y) { + if (x === void 0) { x = a; } + if (y === void 0) { y = b; } + var b = ""; + return y; +} diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt b/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt new file mode 100644 index 0000000000000..ab344ba4f8dd0 --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams3.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/optionalParamReferencingOtherParams3.ts (1 errors) ==== + function right(a = b, b = a) { + ~ +!!! Initializer of parameter 'a' cannot reference identifier 'b' declared after it. + a; + b; + } \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams3.js b/tests/baselines/reference/optionalParamReferencingOtherParams3.js new file mode 100644 index 0000000000000..a54e2a74293bc --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams3.js @@ -0,0 +1,13 @@ +//// [optionalParamReferencingOtherParams3.ts] +function right(a = b, b = a) { + a; + b; +} + +//// [optionalParamReferencingOtherParams3.js] +function right(a, b) { + if (a === void 0) { a = b; } + if (b === void 0) { b = a; } + a; + b; +} diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt new file mode 100644 index 0000000000000..f80329a5b1bb4 --- /dev/null +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/optionalParamTypeComparison.ts (2 errors) ==== + var f: (s: string, n?: number) => void; + var g: (s: string, b?: boolean) => void; + + f = g; + ~ +!!! Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': +!!! Types of parameters 'b' and 'n' are incompatible: +!!! Type 'boolean' is not assignable to type 'number'. + g = f; + ~ +!!! Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': +!!! Types of parameters 'n' and 'b' are incompatible: +!!! Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.js b/tests/baselines/reference/optionalParamTypeComparison.js new file mode 100644 index 0000000000000..7a4090cd8449e --- /dev/null +++ b/tests/baselines/reference/optionalParamTypeComparison.js @@ -0,0 +1,12 @@ +//// [optionalParamTypeComparison.ts] +var f: (s: string, n?: number) => void; +var g: (s: string, b?: boolean) => void; + +f = g; +g = f; + +//// [optionalParamTypeComparison.js] +var f; +var g; +f = g; +g = f; diff --git a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt new file mode 100644 index 0000000000000..d63270ea0fa4d --- /dev/null +++ b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/optionalPropertiesInClasses.ts (1 errors) ==== + interface ifoo { + x?:number; + y:number; + } + + class C1 implements ifoo { + public y:number; + } + + class C2 implements ifoo { // ERROR - still need 'y' + ~~ +!!! Class 'C2' incorrectly implements interface 'ifoo': +!!! Property 'y' is missing in type 'C2'. + public x:number; + } + + class C3 implements ifoo { + public x:number; + public y:number; + } \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesInClasses.js b/tests/baselines/reference/optionalPropertiesInClasses.js new file mode 100644 index 0000000000000..24f52e9d76a63 --- /dev/null +++ b/tests/baselines/reference/optionalPropertiesInClasses.js @@ -0,0 +1,35 @@ +//// [optionalPropertiesInClasses.ts] +interface ifoo { + x?:number; + y:number; +} + +class C1 implements ifoo { + public y:number; +} + +class C2 implements ifoo { // ERROR - still need 'y' + public x:number; +} + +class C3 implements ifoo { + public x:number; + public y:number; +} + +//// [optionalPropertiesInClasses.js] +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); diff --git a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt new file mode 100644 index 0000000000000..348eed0916bcc --- /dev/null +++ b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt @@ -0,0 +1,64 @@ +==== tests/cases/compiler/optionalPropertiesSyntax.ts (14 errors) ==== + interface fnSigs { + //functions signatures can be optional + fn(): void; + fn?(): void; //err + ~~ +!!! Overload signatures must all be optional or required. + fn2?(): void; + } + + interface callSig { + //Call signatures can't be optional + (): any; + ()?: any; //err + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + ?(): any; //err + ~ +!!! Property or signature expected. + } + + interface constructSig { + //Construct signatures can't be optional + new (): any; + new ()?: any; //err + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + new ?(): any; //err + } + + interface propertySig { + //Property signatures can be optional + prop: any; + prop?: any; + ~~~~ +!!! Duplicate identifier 'prop'. + prop2?: any; + } + + interface indexSig { + //Index signatures can't be optional + [idx: number]: any; + [idx: number]?: any; //err + ~ +!!! ';' expected. + ~ +!!! Property or signature expected. + ~~~~~~~~~~~~~ +!!! Duplicate number index signature. + ? [idx: number]: any; //err + ~ +!!! Property or signature expected. + ~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + [idx?: number]: any; //err + ~~~ +!!! An index signature parameter cannot have a question mark. + ~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate number index signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt new file mode 100644 index 0000000000000..faa4f4241c4af --- /dev/null +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/optionalPropertiesTest.ts (4 errors) ==== + var x: {p1:number; p2?:string; p3?:{():number;};}; + + interface IFoo + { + id: number; + name?: string; + print?(): void; + } + + + var foo: IFoo; + foo = { id: 1234 }; // Ok + foo = { id: 1234, name: "test" }; // Ok + foo = { name: "test" }; // Error, id missing + ~~~ +!!! Type '{ name: string; }' is not assignable to type 'IFoo': +!!! Property 'id' is missing in type '{ name: string; }'. + foo = {id: 1234, print:()=>{}} // Ok + + var s = foo.name || "default"; + if (foo.print !== undefined) foo.print(); + + interface i1 { M: () => void; }; + interface i2 { M?: () => void; }; + interface i3 { M: number; }; + interface i4 { M?: number; }; + + var test1: i1 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i1': +!!! Property 'M' is missing in type '{}'. + var test2: i3 = {}; + ~~~~~~~~~~~~~~ +!!! Type '{}' is not assignable to type 'i3': +!!! Property 'M' is missing in type '{}'. + var test3: i2 = {}; + var test4: i4 = {}; + var test5: i1 = { M: function () { } }; + var test6: i3 = { M: 5 }; + var test7: i2 = { M: function () { } }; + test7 = {}; + var test8: i4 = { M: 5 } + test8 = {}; + var test9_1: i2; + var test9_2: i1; + test9_1 = test9_2; + var test10_1: i1; + var test10_2: i2; + test10_1 = test10_2; + ~~~~~~~~ +!!! Type 'i2' is not assignable to type 'i1': +!!! Required property 'M' cannot be reimplemented with optional property in 'i2'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesTest.js b/tests/baselines/reference/optionalPropertiesTest.js new file mode 100644 index 0000000000000..ec59d76d44e2a --- /dev/null +++ b/tests/baselines/reference/optionalPropertiesTest.js @@ -0,0 +1,75 @@ +//// [optionalPropertiesTest.ts] +var x: {p1:number; p2?:string; p3?:{():number;};}; + +interface IFoo +{ + id: number; + name?: string; + print?(): void; +} + + +var foo: IFoo; +foo = { id: 1234 }; // Ok +foo = { id: 1234, name: "test" }; // Ok +foo = { name: "test" }; // Error, id missing +foo = {id: 1234, print:()=>{}} // Ok + +var s = foo.name || "default"; +if (foo.print !== undefined) foo.print(); + +interface i1 { M: () => void; }; +interface i2 { M?: () => void; }; +interface i3 { M: number; }; +interface i4 { M?: number; }; + +var test1: i1 = {}; +var test2: i3 = {}; +var test3: i2 = {}; +var test4: i4 = {}; +var test5: i1 = { M: function () { } }; +var test6: i3 = { M: 5 }; +var test7: i2 = { M: function () { } }; +test7 = {}; +var test8: i4 = { M: 5 } +test8 = {}; +var test9_1: i2; +var test9_2: i1; +test9_1 = test9_2; +var test10_1: i1; +var test10_2: i2; +test10_1 = test10_2; + +//// [optionalPropertiesTest.js] +var x; +var foo; +foo = { id: 1234 }; +foo = { id: 1234, name: "test" }; +foo = { name: "test" }; +foo = { id: 1234, print: function () { +} }; +var s = foo.name || "default"; +if (foo.print !== undefined) + foo.print(); +; +; +; +; +var test1 = {}; +var test2 = {}; +var test3 = {}; +var test4 = {}; +var test5 = { M: function () { +} }; +var test6 = { M: 5 }; +var test7 = { M: function () { +} }; +test7 = {}; +var test8 = { M: 5 }; +test8 = {}; +var test9_1; +var test9_2; +test9_1 = test9_2; +var test10_1; +var test10_2; +test10_1 = test10_2; diff --git a/tests/baselines/reference/optionalSetterParam.errors.txt b/tests/baselines/reference/optionalSetterParam.errors.txt new file mode 100644 index 0000000000000..6f3b39e713856 --- /dev/null +++ b/tests/baselines/reference/optionalSetterParam.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/optionalSetterParam.ts (1 errors) ==== + class foo { + + public set bar(param?:any) { } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt new file mode 100644 index 0000000000000..9ff39d72f45f7 --- /dev/null +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (1 errors) ==== + interface A { + (x: { s: string }): string + (x: { n: number }): number + } + + interface B { + (x: { s: string }): string + (x: { n: number }): number + } + + interface C { + (x: { n: number }): number + (x: { s: string }): string + } + + var v: A; + var v: B; + + v({ s: "", n: 0 }).toLowerCase(); + + var w: A; + var w: C; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. + + w({ s: "", n: 0 }).toLowerCase(); \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js new file mode 100644 index 0000000000000..9a04ea28fbaa5 --- /dev/null +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.js @@ -0,0 +1,33 @@ +//// [orderMattersForSignatureGroupIdentity.ts] +interface A { + (x: { s: string }): string + (x: { n: number }): number +} + +interface B { + (x: { s: string }): string + (x: { n: number }): number +} + +interface C { + (x: { n: number }): number + (x: { s: string }): string +} + +var v: A; +var v: B; + +v({ s: "", n: 0 }).toLowerCase(); + +var w: A; +var w: C; + +w({ s: "", n: 0 }).toLowerCase(); + +//// [orderMattersForSignatureGroupIdentity.js] +var v; +var v; +v({ s: "", n: 0 }).toLowerCase(); +var w; +var w; +w({ s: "", n: 0 }).toLowerCase(); diff --git a/tests/baselines/reference/out-flag.js b/tests/baselines/reference/out-flag.js new file mode 100644 index 0000000000000..f634bad26dbf6 --- /dev/null +++ b/tests/baselines/reference/out-flag.js @@ -0,0 +1,32 @@ +//// [out-flag.ts] +//// @out: bin\ + +// my class comments +class MyClass +{ + // my function comments + public Count(): number + { + return 42; + } + + public SetCount(value: number) + { + // + } +} + +//// [out-flag.js] +var MyClass = (function () { + function MyClass() { + } + MyClass.prototype.Count = function () { + return 42; + }; + MyClass.prototype.SetCount = function (value) { + }; + return MyClass; +})(); +//# sourceMappingURL=out-flag.js.map + +//// [out-flag.d.ts] diff --git a/tests/baselines/reference/out-flag.js.map b/tests/baselines/reference/out-flag.js.map new file mode 100644 index 0000000000000..c6371924e7c6f --- /dev/null +++ b/tests/baselines/reference/out-flag.js.map @@ -0,0 +1,2 @@ +//// [out-flag.js.map] +{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count","MyClass.SetCount"],"mappings":"AAGA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAYbC,CAACA;IATUD,uBAAKA,GAAZA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IAEMF,0BAAQA,GAAfA,UAAgBA,KAAaA;IAG7BG,CAACA;IACLH,cAACA;AAADA,CAACA,AAZD,IAYC"} \ No newline at end of file diff --git a/tests/baselines/reference/out-flag.sourcemap.txt b/tests/baselines/reference/out-flag.sourcemap.txt new file mode 100644 index 0000000000000..89856a332a3f5 --- /dev/null +++ b/tests/baselines/reference/out-flag.sourcemap.txt @@ -0,0 +1,165 @@ +=================================================================== +JsFile: out-flag.js +mapUrl: out-flag.js.map +sourceRoot: +sources: out-flag.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/out-flag.js +sourceFile:out-flag.ts +------------------------------------------------------------------- +>>>var MyClass = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 >//// @out: bin\ + > + >// my class comments + > +2 >class +3 > MyClass +1 >Emitted(1, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(1, 12) Source(4, 14) + SourceIndex(0) +--- +>>> function MyClass() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +1-> +2 > class +3 > MyClass +1->Emitted(2, 5) Source(4, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(2, 14) Source(4, 7) + SourceIndex(0) name (MyClass) +3 >Emitted(2, 21) Source(4, 14) + SourceIndex(0) name (MyClass) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > // my function comments + > public Count(): number + > { + > return 42; + > } + > + > public SetCount(value: number) + > { + > // + > } + > +2 > } +1 >Emitted(3, 5) Source(16, 1) + SourceIndex(0) name (MyClass.constructor) +2 >Emitted(3, 6) Source(16, 2) + SourceIndex(0) name (MyClass.constructor) +--- +>>> MyClass.prototype.Count = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> +2 > Count +3 > +1->Emitted(4, 5) Source(7, 12) + SourceIndex(0) name (MyClass) +2 >Emitted(4, 28) Source(7, 17) + SourceIndex(0) name (MyClass) +3 >Emitted(4, 31) Source(7, 5) + SourceIndex(0) name (MyClass) +--- +>>> return 42; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >public Count(): number + > { + > +2 > return +3 > +4 > 42 +5 > ; +1 >Emitted(5, 9) Source(9, 9) + SourceIndex(0) name (MyClass.Count) +2 >Emitted(5, 15) Source(9, 15) + SourceIndex(0) name (MyClass.Count) +3 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) name (MyClass.Count) +4 >Emitted(5, 18) Source(9, 18) + SourceIndex(0) name (MyClass.Count) +5 >Emitted(5, 19) Source(9, 19) + SourceIndex(0) name (MyClass.Count) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(10, 5) + SourceIndex(0) name (MyClass.Count) +2 >Emitted(6, 6) Source(10, 6) + SourceIndex(0) name (MyClass.Count) +--- +>>> MyClass.prototype.SetCount = function (value) { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^^^^^ +1-> + > + > public +2 > SetCount +3 > +4 > public SetCount( +5 > value: number +1->Emitted(7, 5) Source(12, 12) + SourceIndex(0) name (MyClass) +2 >Emitted(7, 31) Source(12, 20) + SourceIndex(0) name (MyClass) +3 >Emitted(7, 34) Source(12, 5) + SourceIndex(0) name (MyClass) +4 >Emitted(7, 44) Source(12, 21) + SourceIndex(0) name (MyClass) +5 >Emitted(7, 49) Source(12, 34) + SourceIndex(0) name (MyClass) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 >) + > { + > // + > +2 > } +1 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) name (MyClass.SetCount) +2 >Emitted(8, 6) Source(15, 6) + SourceIndex(0) name (MyClass.SetCount) +--- +>>> return MyClass; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(9, 5) Source(16, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(9, 19) Source(16, 2) + SourceIndex(0) name (MyClass) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class MyClass + > { + > // my function comments + > public Count(): number + > { + > return 42; + > } + > + > public SetCount(value: number) + > { + > // + > } + > } +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) name (MyClass) +3 >Emitted(10, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(10, 6) Source(16, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=out-flag.js.map \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt new file mode 100644 index 0000000000000..3f7fe83fa6288 --- /dev/null +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/overEagerReturnTypeSpecialization.ts (1 errors) ==== + //Note: Below simpler repro + + interface I1 { + func(callback: (value: T) => U): I1; + } + + declare var v1: I1; + var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .func(str => str.length); // should error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'I1' is not assignable to type 'I1': +!!! Type 'number' is not assignable to type 'string'. + + var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 + .func(str => str.length); // should be ok + + \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.js b/tests/baselines/reference/overEagerReturnTypeSpecialization.js new file mode 100644 index 0000000000000..4d921fb6b81cf --- /dev/null +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.js @@ -0,0 +1,19 @@ +//// [overEagerReturnTypeSpecialization.ts] +//Note: Below simpler repro + +interface I1 { + func(callback: (value: T) => U): I1; +} + +declare var v1: I1; +var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 + .func(str => str.length); // should error + +var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 + .func(str => str.length); // should be ok + + + +//// [overEagerReturnTypeSpecialization.js] +var r1 = v1.func(function (num) { return num.toString(); }).func(function (str) { return str.length; }); +var r2 = v1.func(function (num) { return num.toString(); }).func(function (str) { return str.length; }); diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt new file mode 100644 index 0000000000000..8fc569fee9ea3 --- /dev/null +++ b/tests/baselines/reference/overload1.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/overload1.ts (6 errors) ==== + module O { + export class A { + + } + + export class B extends A { + } + + export class C extends B { + + } + + export interface I { + f(s:string):number; + f(n:number):string; + g(n1:number,n2:number):number; + g(n:number):string; + g(a:A):C; + g(c:C):string; + h(s1:string,s2:number):string; + h(s1:number,s2:string):number; + } + } + + declare var x:O.I; + + var e:string=x.g(new O.A()); // matches overload but bad assignment + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'C' is not assignable to type 'string'. + var y:string=x.f(3); // good + y=x.f("nope"); // can't assign number to string + ~ +!!! Type 'number' is not assignable to type 'string'. + var z:string=x.g(x.g(3,3)); // good + z=x.g(2,2,2); // no match + ~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + z=x.g(); // no match + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + z=x.g(new O.B()); // ambiguous (up and down conversion) + ~ +!!! Type 'C' is not assignable to type 'string'. + z=x.h(2,2); // no match + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + z=x.h("hello",0); // good + + var v=x.g; + + \ No newline at end of file diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js new file mode 100644 index 0000000000000..e6bfc058db7ec --- /dev/null +++ b/tests/baselines/reference/overload1.js @@ -0,0 +1,83 @@ +//// [overload1.ts] +module O { + export class A { + + } + + export class B extends A { + } + + export class C extends B { + + } + + export interface I { + f(s:string):number; + f(n:number):string; + g(n1:number,n2:number):number; + g(n:number):string; + g(a:A):C; + g(c:C):string; + h(s1:string,s2:number):string; + h(s1:number,s2:string):number; + } +} + +declare var x:O.I; + +var e:string=x.g(new O.A()); // matches overload but bad assignment +var y:string=x.f(3); // good +y=x.f("nope"); // can't assign number to string +var z:string=x.g(x.g(3,3)); // good +z=x.g(2,2,2); // no match +z=x.g(); // no match +z=x.g(new O.B()); // ambiguous (up and down conversion) +z=x.h(2,2); // no match +z=x.h("hello",0); // good + +var v=x.g; + + + +//// [overload1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var O; +(function (O) { + var A = (function () { + function A() { + } + return A; + })(); + O.A = A; + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + })(A); + O.B = B; + var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; + })(B); + O.C = C; +})(O || (O = {})); +var e = x.g(new O.A()); +var y = x.f(3); +y = x.f("nope"); +var z = x.g(x.g(3, 3)); +z = x.g(2, 2, 2); +z = x.g(); +z = x.g(new O.B()); +z = x.h(2, 2); +z = x.h("hello", 0); +var v = x.g; diff --git a/tests/baselines/reference/overload2.js b/tests/baselines/reference/overload2.js new file mode 100644 index 0000000000000..6d1697897c4a7 --- /dev/null +++ b/tests/baselines/reference/overload2.js @@ -0,0 +1,34 @@ +//// [overload2.ts] +enum A { } +enum B { } + +function foo(a: A); +function foo(b: B); +// should be ok +function foo(x: number) { +} + +class C { } +function foo1(a: A); +function foo1(c: C); +// should be ok +function foo1(x: number) { +} + + +//// [overload2.js] +var A; +(function (A) { +})(A || (A = {})); +var B; +(function (B) { +})(B || (B = {})); +function foo(x) { +} +var C = (function () { + function C() { + } + return C; +})(); +function foo1(x) { +} diff --git a/tests/baselines/reference/overloadAssignmentCompat.errors.txt b/tests/baselines/reference/overloadAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..f5cf4b6a6f683 --- /dev/null +++ b/tests/baselines/reference/overloadAssignmentCompat.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/compiler/overloadAssignmentCompat.ts (1 errors) ==== + + // ok - overload signatures are assignment compatible with their implementation + class Accessor {} + + function attr(name: string): string; + function attr(name: string, value: string): Accessor; + function attr(map: any): Accessor; + function attr(nameOrMap: any, value?: string): any { + if (nameOrMap && typeof nameOrMap === "object") { + // handle map case + return new Accessor; + } + else { + // handle string case + return "s"; + } + } + + // not ok - there's an assignment compat error + function attr2(name: string): string; + function attr2(name: string, value: string): Accessor; + function attr2(map: any): Accessor; + function attr2(nameOrMap: any, value?: string): string { + if (nameOrMap && typeof nameOrMap === "object") { + // handle map case + return "t"; + } + else { + // handle string case + return "s"; + } + } + + // error - signatures are not assignment compatible + function foo():number; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo():string { return "a" }; + + \ No newline at end of file diff --git a/tests/baselines/reference/overloadAssignmentCompat.js b/tests/baselines/reference/overloadAssignmentCompat.js new file mode 100644 index 0000000000000..70d05ef59605c --- /dev/null +++ b/tests/baselines/reference/overloadAssignmentCompat.js @@ -0,0 +1,66 @@ +//// [overloadAssignmentCompat.ts] + +// ok - overload signatures are assignment compatible with their implementation +class Accessor {} + +function attr(name: string): string; +function attr(name: string, value: string): Accessor; +function attr(map: any): Accessor; +function attr(nameOrMap: any, value?: string): any { + if (nameOrMap && typeof nameOrMap === "object") { + // handle map case + return new Accessor; + } + else { + // handle string case + return "s"; + } +} + +// not ok - there's an assignment compat error +function attr2(name: string): string; +function attr2(name: string, value: string): Accessor; +function attr2(map: any): Accessor; +function attr2(nameOrMap: any, value?: string): string { + if (nameOrMap && typeof nameOrMap === "object") { + // handle map case + return "t"; + } + else { + // handle string case + return "s"; + } +} + +// error - signatures are not assignment compatible +function foo():number; +function foo():string { return "a" }; + + + +//// [overloadAssignmentCompat.js] +var Accessor = (function () { + function Accessor() { + } + return Accessor; +})(); +function attr(nameOrMap, value) { + if (nameOrMap && typeof nameOrMap === "object") { + return new Accessor; + } + else { + return "s"; + } +} +function attr2(nameOrMap, value) { + if (nameOrMap && typeof nameOrMap === "object") { + return "t"; + } + else { + return "s"; + } +} +function foo() { + return "a"; +} +; diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.js b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.js new file mode 100644 index 0000000000000..ba8f45a82d7d0 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.js @@ -0,0 +1,41 @@ +//// [overloadBindingAcrossDeclarationBoundaries.ts] +interface Opt1 { + p?: any; +} +interface Opt2 { + q?: any; +} +interface Opt3 { + r?: any; +} +interface Opt4 { + s?: any; +} +interface A { + a(o: Opt1): Opt1; + a(o: Opt2): Opt2; + (o: Opt1): Opt1; + (o: Opt2): Opt2; + new (o: Opt1): Opt1; + new (o: Opt2): Opt2; +} +interface A { + a(o: Opt3): Opt3; + a(o: Opt4): Opt4; + (o: Opt3): Opt3; + (o: Opt4): Opt4; + new (o: Opt3): Opt3; + new (o: Opt4): Opt4; +} + +var a: A; +// These should all be Opt3 +var a1 = a.a({}); +var a1 = a({}); +var a1 = new a({}); + +//// [overloadBindingAcrossDeclarationBoundaries.js] +var a; +var a1 = a.a({}); +var a1 = a({}); +var a1 = new a({}); diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.js b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.js new file mode 100644 index 0000000000000..6037f45bc1ef5 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries2.ts] //// + +//// [overloadBindingAcrossDeclarationBoundaries_file0.ts] +interface Opt1 { + p?: any; +} +interface Opt2 { + q?: any; +} +interface Opt3 { + r?: any; +} +interface Opt4 { + s?: any; +} + +interface A { + a(o: Opt1): Opt1; + a(o: Opt2): Opt2; + (o: Opt1): Opt1; + (o: Opt2): Opt2; + new (o: Opt1): Opt1; + new (o: Opt2): Opt2; +} + +//// [overloadBindingAcrossDeclarationBoundaries_file1.ts] +interface A { + a(o: Opt3): Opt3; + a(o: Opt4): Opt4; + (o: Opt3): Opt3; + (o: Opt4): Opt4; + new (o: Opt3): Opt3; + new (o: Opt4): Opt4; +} + +var a: A; +// These should all be Opt3 +var a1 = a.a({}); +var a1 = a({}); +var a1 = new a({}); + +//// [overloadBindingAcrossDeclarationBoundaries_file0.js] +//// [overloadBindingAcrossDeclarationBoundaries_file1.js] +var a; +var a1 = a.a({}); +var a1 = a({}); +var a1 = new a({}); diff --git a/tests/baselines/reference/overloadCallTest.js b/tests/baselines/reference/overloadCallTest.js new file mode 100644 index 0000000000000..f7eb97fc9eb33 --- /dev/null +++ b/tests/baselines/reference/overloadCallTest.js @@ -0,0 +1,30 @@ +//// [overloadCallTest.ts] +class foo { + constructor() { + function bar(): string; + function bar(s:string); + function bar(foo?: string) { return "foo" }; + + var test = bar("test"); + var goo = bar(); + + goo = bar("test"); + } + +} + + + +//// [overloadCallTest.js] +var foo = (function () { + function foo() { + function bar(foo) { + return "foo"; + } + ; + var test = bar("test"); + var goo = bar(); + goo = bar("test"); + } + return foo; +})(); diff --git a/tests/baselines/reference/overloadCrash.js b/tests/baselines/reference/overloadCrash.js new file mode 100644 index 0000000000000..bcb7b8dd848d3 --- /dev/null +++ b/tests/baselines/reference/overloadCrash.js @@ -0,0 +1,19 @@ +//// [overloadCrash.ts] +interface I1 {a:number; b:number;}; +interface I2 {c:number; d:number;}; +interface I3 {a:number; b:number; c:number; d:number;}; + +declare function foo(...n:I1[]); +declare function foo(n1:I2, n3:I2); + +var i3:I3; + +foo(i3, i3); // should not crash the compiler :) + + +//// [overloadCrash.js] +; +; +; +var i3; +foo(i3, i3); diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.js b/tests/baselines/reference/overloadEquivalenceWithStatics.js new file mode 100644 index 0000000000000..72692c4d89f46 --- /dev/null +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.js @@ -0,0 +1,19 @@ +//// [overloadEquivalenceWithStatics.ts] +class A1 { +static B(v: A1): A1; // 1 +static B(v: S): A1; // 2 : Error Duplicate signature +static B(v: any): A1 { +return null; +} +} + + +//// [overloadEquivalenceWithStatics.js] +var A1 = (function () { + function A1() { + } + A1.B = function (v) { + return null; + }; + return A1; +})(); diff --git a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js new file mode 100644 index 0000000000000..c4b133ea44c48 --- /dev/null +++ b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.js @@ -0,0 +1,30 @@ +//// [overloadGenericFunctionWithRestArgs.ts] +class B{ + private id: V; +} +class A{ + GetEnumerator: () => B; +} +function Choice(...v_args: T[]): A; +function Choice(...v_args: T[]): A { + return new A(); +} + +//// [overloadGenericFunctionWithRestArgs.js] +var B = (function () { + function B() { + } + return B; +})(); +var A = (function () { + function A() { + } + return A; +})(); +function Choice() { + var v_args = []; + for (var _i = 0; _i < arguments.length; _i++) { + v_args[_i - 0] = arguments[_i]; + } + return new A(); +} diff --git a/tests/baselines/reference/overloadModifiersMustAgree.errors.txt b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt new file mode 100644 index 0000000000000..cad91215f0689 --- /dev/null +++ b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/overloadModifiersMustAgree.ts (5 errors) ==== + class baz { + public foo(); + ~~~ +!!! Overload signatures must all be public or private. + private foo(bar?: any) { } // error - access modifiers do not agree + } + + declare function bar(); + ~~~ +!!! Overload signatures must all be ambient or non-ambient. + export function bar(s: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Function implementation expected. + ~~~ +!!! Duplicate identifier 'bar'. + function bar(s?: string) { } + + interface I { + foo? (); + foo(s: string); + ~~~ +!!! Overload signatures must all be optional or required. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/overloadModifiersMustAgree.js b/tests/baselines/reference/overloadModifiersMustAgree.js new file mode 100644 index 0000000000000..141b5727383e5 --- /dev/null +++ b/tests/baselines/reference/overloadModifiersMustAgree.js @@ -0,0 +1,27 @@ +//// [overloadModifiersMustAgree.ts] +class baz { + public foo(); + private foo(bar?: any) { } // error - access modifiers do not agree +} + +declare function bar(); +export function bar(s: string); +function bar(s?: string) { } + +interface I { + foo? (); + foo(s: string); +} + + + +//// [overloadModifiersMustAgree.js] +var baz = (function () { + function baz() { + } + baz.prototype.foo = function (bar) { + }; + return baz; +})(); +function bar(s) { +} diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..2dcdf22960d25 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (3 errors) ==== + var f: (x: 'hi') => number = ('hi') => { return 1; }; + ~~ +!!! ';' expected. + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + ~~~~~~~~~ +!!! 'return' statement has no containing function. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js new file mode 100644 index 0000000000000..a59ca2ceda12d --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -0,0 +1,73 @@ +//// [overloadOnConstConstraintChecks1.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +class Derived2 extends Base { baz() { } } +class Derived3 extends Base { biz() { } } + +interface MyDoc { // Document + createElement(tagName: string): Base; + createElement(tagName: 'canvas'): Derived1; + createElement(tagName: 'div'): Derived2; + createElement(tagName: 'span'): Derived3; + // + 100 more +} + +class D implements MyDoc { + createElement(tagName:string): Base; + createElement(tagName: 'canvas'): Derived1; + createElement(tagName: 'div'): Derived2; + createElement(tagName: 'span'): Derived3; + createElement(tagName:any): Base { + return null; + } +} + +//// [overloadOnConstConstraintChecks1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + Derived2.prototype.baz = function () { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + _super.apply(this, arguments); + } + Derived3.prototype.biz = function () { + }; + return Derived3; +})(Base); +var D = (function () { + function D() { + } + D.prototype.createElement = function (tagName) { + return null; + }; + return D; +})(); diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js new file mode 100644 index 0000000000000..071b93726363e --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -0,0 +1,44 @@ +//// [overloadOnConstConstraintChecks2.ts] +class A {} +class B extends A {} +class C extends A { + public foo() { } +} +function foo(name: 'hi'): B; +function foo(name: 'bye'): C; +function foo(name: string): A; +function foo(name: any): A { + return null; +} + +//// [overloadOnConstConstraintChecks2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.foo = function () { + }; + return C; +})(A); +function foo(name) { + return null; +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js new file mode 100644 index 0000000000000..961411bf6e572 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -0,0 +1,46 @@ +//// [overloadOnConstConstraintChecks3.ts] +class A { private x = 1} +class B extends A {} +class C extends A { + public foo() { } +} +function foo(name: 'hi'): B; +function foo(name: 'bye'): C; +function foo(name: string): A; +function foo(name: any): A { + return null; +} + + +//// [overloadOnConstConstraintChecks3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + this.x = 1; + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.foo = function () { + }; + return C; +})(A); +function foo(name) { + return null; +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt b/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt new file mode 100644 index 0000000000000..b64650db42229 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/overloadOnConstConstraintChecks4.ts (1 errors) ==== + class Z { } + class A extends Z { private x = 1 } + class B extends A {} + class C extends A { + public foo() { } + } + function foo(name: 'hi'): B; + function foo(name: 'bye'): C; + function foo(name: string): A; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function foo(name: any): Z { + return null; + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js new file mode 100644 index 0000000000000..5192afc35a2d7 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -0,0 +1,54 @@ +//// [overloadOnConstConstraintChecks4.ts] +class Z { } +class A extends Z { private x = 1 } +class B extends A {} +class C extends A { + public foo() { } +} +function foo(name: 'hi'): B; +function foo(name: 'bye'): C; +function foo(name: string): A; // error +function foo(name: any): Z { + return null; +} + + +//// [overloadOnConstConstraintChecks4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Z = (function () { + function Z() { + } + return Z; +})(); +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + this.x = 1; + } + return A; +})(Z); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + C.prototype.foo = function () { + }; + return C; +})(A); +function foo(name) { + return null; +} diff --git a/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt new file mode 100644 index 0000000000000..04df57d7fcc4c --- /dev/null +++ b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/overloadOnConstDuplicateOverloads1.ts (2 errors) ==== + function foo(a: 'hi', x: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(a: 'hi', x: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(a: any, x: any) { + } + + function foo2(a: 'hi', x: string); + function foo2(a: 'hi', x: string); + function foo2(a: string, x: string); + function foo2(a: any, x: any) { + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstDuplicateOverloads1.js b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.js new file mode 100644 index 0000000000000..b6d1a7ed52bf4 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstDuplicateOverloads1.js @@ -0,0 +1,17 @@ +//// [overloadOnConstDuplicateOverloads1.ts] +function foo(a: 'hi', x: string); +function foo(a: 'hi', x: string); +function foo(a: any, x: any) { +} + +function foo2(a: 'hi', x: string); +function foo2(a: 'hi', x: string); +function foo2(a: string, x: string); +function foo2(a: any, x: any) { +} + +//// [overloadOnConstDuplicateOverloads1.js] +function foo(a, x) { +} +function foo2(a, x) { +} diff --git a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt new file mode 100644 index 0000000000000..4124c643554bf --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/overloadOnConstInBaseWithBadImplementationInDerived.ts (2 errors) ==== + interface I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + class C implements I { + x1(a: number, callback: (x: 'hi') => number) { // error + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js new file mode 100644 index 0000000000000..1b6062e7b2163 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInBaseWithBadImplementationInDerived.js @@ -0,0 +1,18 @@ +//// [overloadOnConstInBaseWithBadImplementationInDerived.ts] +interface I { + x1(a: number, callback: (x: 'hi') => number); +} + +class C implements I { + x1(a: number, callback: (x: 'hi') => number) { // error + } +} + +//// [overloadOnConstInBaseWithBadImplementationInDerived.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a, callback) { + }; + return C; +})(); diff --git a/tests/baselines/reference/overloadOnConstInCallback1.errors.txt b/tests/baselines/reference/overloadOnConstInCallback1.errors.txt new file mode 100644 index 0000000000000..40473b6b6aac2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInCallback1.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/overloadOnConstInCallback1.ts (1 errors) ==== + class C { + x1(a: number, callback: (x: 'hi') => number); // error + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + x1(a: number, callback: (x: any) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInCallback1.js b/tests/baselines/reference/overloadOnConstInCallback1.js new file mode 100644 index 0000000000000..90bffd4e75cab --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInCallback1.js @@ -0,0 +1,23 @@ +//// [overloadOnConstInCallback1.ts] +class C { + x1(a: number, callback: (x: 'hi') => number); // error + x1(a: number, callback: (x: any) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + } +} + +//// [overloadOnConstInCallback1.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a, callback) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + }; + return C; +})(); diff --git a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt new file mode 100644 index 0000000000000..11d35bdedf538 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/overloadOnConstInObjectLiteralImplementingAnInterface.ts (2 errors) ==== + interface I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + var i2: I = { x1: (a: number, cb: (x: 'hi') => number) => { } }; // error + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js new file mode 100644 index 0000000000000..25672c0f8ef7f --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInObjectLiteralImplementingAnInterface.js @@ -0,0 +1,10 @@ +//// [overloadOnConstInObjectLiteralImplementingAnInterface.ts] +interface I { + x1(a: number, callback: (x: 'hi') => number); +} + +var i2: I = { x1: (a: number, cb: (x: 'hi') => number) => { } }; // error + +//// [overloadOnConstInObjectLiteralImplementingAnInterface.js] +var i2 = { x1: function (a, cb) { +} }; diff --git a/tests/baselines/reference/overloadOnConstInheritance1.js b/tests/baselines/reference/overloadOnConstInheritance1.js new file mode 100644 index 0000000000000..7bdbdada083d2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance1.js @@ -0,0 +1,12 @@ +//// [overloadOnConstInheritance1.ts] +interface Base { + addEventListener(x: string): any; + addEventListener(x: 'foo'): string; +} +interface Deriver extends Base { + addEventListener(x: string): any; + addEventListener(x: 'bar'): string; +} + + +//// [overloadOnConstInheritance1.js] diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt new file mode 100644 index 0000000000000..ff965b47a1800 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/overloadOnConstInheritance2.ts (2 errors) ==== + interface Base { + addEventListener(x: string): any; + addEventListener(x: 'foo'): string; + } + interface Deriver extends Base { + ~~~~~~~ +!!! Interface 'Deriver' incorrectly extends interface 'Base': +!!! Types of property 'addEventListener' are incompatible: +!!! Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. + addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance2.js b/tests/baselines/reference/overloadOnConstInheritance2.js new file mode 100644 index 0000000000000..edfcf11f38fa2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance2.js @@ -0,0 +1,11 @@ +//// [overloadOnConstInheritance2.ts] +interface Base { + addEventListener(x: string): any; + addEventListener(x: 'foo'): string; +} +interface Deriver extends Base { + addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload +} + + +//// [overloadOnConstInheritance2.js] diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt new file mode 100644 index 0000000000000..cbfd32b1d6d3a --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/overloadOnConstInheritance3.ts (3 errors) ==== + interface Base { + addEventListener(x: string): any; + } + interface Deriver extends Base { + ~~~~~~~ +!!! Interface 'Deriver' incorrectly extends interface 'Base': +!!! Types of property 'addEventListener' are incompatible: +!!! Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. + // shouldn't need to redeclare the string overload + addEventListener(x: 'bar'): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + addEventListener(x: 'foo'): string; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance3.js b/tests/baselines/reference/overloadOnConstInheritance3.js new file mode 100644 index 0000000000000..d3cd27f223c56 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance3.js @@ -0,0 +1,12 @@ +//// [overloadOnConstInheritance3.ts] +interface Base { + addEventListener(x: string): any; +} +interface Deriver extends Base { + // shouldn't need to redeclare the string overload + addEventListener(x: 'bar'): string; + addEventListener(x: 'foo'): string; +} + + +//// [overloadOnConstInheritance3.js] diff --git a/tests/baselines/reference/overloadOnConstInheritance4.errors.txt b/tests/baselines/reference/overloadOnConstInheritance4.errors.txt new file mode 100644 index 0000000000000..f2debeac4fff9 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance4.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/overloadOnConstInheritance4.ts (3 errors) ==== + interface I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + class C implements I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + x1(a: number, callback: (x: 'hi') => number) { + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstInheritance4.js b/tests/baselines/reference/overloadOnConstInheritance4.js new file mode 100644 index 0000000000000..7bfad88a7a7e9 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance4.js @@ -0,0 +1,19 @@ +//// [overloadOnConstInheritance4.ts] +interface I { + x1(a: number, callback: (x: 'hi') => number); +} +class C implements I { + x1(a: number, callback: (x: 'hi') => number); + x1(a: number, callback: (x: 'hi') => number) { + } +} + + +//// [overloadOnConstInheritance4.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a, callback) { + }; + return C; +})(); diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt new file mode 100644 index 0000000000000..34d6f43c487e1 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt @@ -0,0 +1,24 @@ +==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (4 errors) ==== + function x1(a: number, cb: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function x1(a: number, cb: (x: 'bye') => number); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function x1(a: number, cb: (x: string) => number) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); + cb('uh'); + cb(1); // error + ~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + var cb: (number) => number = (x: number) => 1; + x1(1, cb); + x1(1, (x: 'hi') => 1); // error + ~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + x1(1, (x: string) => 1); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.js b/tests/baselines/reference/overloadOnConstNoAnyImplementation.js new file mode 100644 index 0000000000000..78de2aa272783 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.js @@ -0,0 +1,30 @@ +//// [overloadOnConstNoAnyImplementation.ts] +function x1(a: number, cb: (x: 'hi') => number); +function x1(a: number, cb: (x: 'bye') => number); +function x1(a: number, cb: (x: string) => number) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); + cb('uh'); + cb(1); // error +} + +var cb: (number) => number = (x: number) => 1; +x1(1, cb); +x1(1, (x: 'hi') => 1); // error +x1(1, (x: string) => 1); + +//// [overloadOnConstNoAnyImplementation.js] +function x1(a, cb) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); + cb('uh'); + cb(1); +} +var cb = function (x) { return 1; }; +x1(1, cb); +x1(1, function (x) { return 1; }); +x1(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt new file mode 100644 index 0000000000000..309d04e118094 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts (5 errors) ==== + interface I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + class C { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + x1(a: number, callback: (x: string) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); // error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + } + + var c: C; + c.x1(1, (x: 'hi') => { return 1; } ); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + c.x1(1, (x: 'bye') => { return 1; } ); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + c.x1(1, (x) => { return 1; } ); + + c.x1(1, (x: number) => { return 1; } ); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js new file mode 100644 index 0000000000000..6a5ac8973a01c --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.js @@ -0,0 +1,49 @@ +//// [overloadOnConstNoAnyImplementation2.ts] +interface I { + x1(a: number, callback: (x: 'hi') => number); +} + +class C { + x1(a: number, callback: (x: 'hi') => number); + x1(a: number, callback: (x: string) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); // error + } +} + +var c: C; +c.x1(1, (x: 'hi') => { return 1; } ); +c.x1(1, (x: 'bye') => { return 1; } ); +c.x1(1, (x) => { return 1; } ); + +c.x1(1, (x: number) => { return 1; } ); + +//// [overloadOnConstNoAnyImplementation2.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a, callback) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); + }; + return C; +})(); +var c; +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); diff --git a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt new file mode 100644 index 0000000000000..73c954ef10ceb --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/overloadOnConstNoNonSpecializedSignature.ts (1 errors) ==== + class C { + x1(a: 'hi'); // error, no non-specialized signature in overload list + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + x1(a: string) { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js new file mode 100644 index 0000000000000..33cc9c81b2cf0 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoNonSpecializedSignature.js @@ -0,0 +1,15 @@ +//// [overloadOnConstNoNonSpecializedSignature.ts] +class C { + x1(a: 'hi'); // error, no non-specialized signature in overload list + x1(a: string) { } +} + + +//// [overloadOnConstNoNonSpecializedSignature.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a) { + }; + return C; +})(); diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt new file mode 100644 index 0000000000000..8ac0806a4964f --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/overloadOnConstNoStringImplementation.ts (3 errors) ==== + function x2(a: number, cb: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function x2(a: number, cb: (x: 'bye') => number); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function x2(a: number, cb: (x: any) => number) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); // should this work without a string definition? + cb('uh'); + cb(1); + } + + var cb: (number) => number = (x: number) => 1; + x2(1, cb); // error + x2(1, (x: 'hi') => 1); // error + ~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + x2(1, (x: string) => 1); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.js b/tests/baselines/reference/overloadOnConstNoStringImplementation.js new file mode 100644 index 0000000000000..1b014bd708c46 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.js @@ -0,0 +1,30 @@ +//// [overloadOnConstNoStringImplementation.ts] +function x2(a: number, cb: (x: 'hi') => number); +function x2(a: number, cb: (x: 'bye') => number); +function x2(a: number, cb: (x: any) => number) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); // should this work without a string definition? + cb('uh'); + cb(1); +} + +var cb: (number) => number = (x: number) => 1; +x2(1, cb); // error +x2(1, (x: 'hi') => 1); // error +x2(1, (x: string) => 1); + +//// [overloadOnConstNoStringImplementation.js] +function x2(a, cb) { + cb('hi'); + cb('bye'); + var hm = 'hm'; + cb(hm); + cb('uh'); + cb(1); +} +var cb = function (x) { return 1; }; +x2(1, cb); +x2(1, function (x) { return 1; }); +x2(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt new file mode 100644 index 0000000000000..f7fdeed169bb5 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/compiler/overloadOnConstNoStringImplementation2.ts (4 errors) ==== + interface I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + class C implements I { + x1(a: number, callback: (x: 'hi') => number); + ~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + x1(a: number, callback: (x: any) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); + } + } + + var c: C; + c.x1(1, (x: 'hi') => { return 1; } ); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + c.x1(1, (x: 'bye') => { return 1; } ); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + c.x1(1, (x: string) => { return 1; } ); + c.x1(1, (x: number) => { return 1; } ); \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.js b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js new file mode 100644 index 0000000000000..f51f84acb2a08 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.js @@ -0,0 +1,48 @@ +//// [overloadOnConstNoStringImplementation2.ts] +interface I { + x1(a: number, callback: (x: 'hi') => number); +} + +class C implements I { + x1(a: number, callback: (x: 'hi') => number); + x1(a: number, callback: (x: any) => number) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); + } +} + +var c: C; +c.x1(1, (x: 'hi') => { return 1; } ); +c.x1(1, (x: 'bye') => { return 1; } ); +c.x1(1, (x: string) => { return 1; } ); +c.x1(1, (x: number) => { return 1; } ); + +//// [overloadOnConstNoStringImplementation2.js] +var C = (function () { + function C() { + } + C.prototype.x1 = function (a, callback) { + callback('hi'); + callback('bye'); + var hm = "hm"; + callback(hm); + callback(1); + }; + return C; +})(); +var c; +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); +c.x1(1, function (x) { + return 1; +}); diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt new file mode 100644 index 0000000000000..72d1dd5af258c --- /dev/null +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts (3 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + class Derived2 extends Base { baz() { } } + class Derived3 extends Base { biz() { } } + + function foo(name: "SPAN"): Derived1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(name: "DIV"): Derived2 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~ + } + ~ +!!! A signature with an implementation cannot use a string literal type. + + foo("HI"); + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js new file mode 100644 index 0000000000000..f4037c3f668c2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -0,0 +1,58 @@ +//// [overloadOnConstantsInvalidOverload1.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +class Derived2 extends Base { baz() { } } +class Derived3 extends Base { biz() { } } + +function foo(name: "SPAN"): Derived1; +function foo(name: "DIV"): Derived2 { + return null; +} + +foo("HI"); + +//// [overloadOnConstantsInvalidOverload1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + Derived2.prototype.baz = function () { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + _super.apply(this, arguments); + } + Derived3.prototype.biz = function () { + }; + return Derived3; +})(Base); +function foo(name) { + return null; +} +foo("HI"); diff --git a/tests/baselines/reference/overloadOnGenericArity.js b/tests/baselines/reference/overloadOnGenericArity.js new file mode 100644 index 0000000000000..5ee0e501b2bba --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericArity.js @@ -0,0 +1,9 @@ +//// [overloadOnGenericArity.ts] +interface Test { + then(p: string): string; + then(p: string): Date; // Error: Overloads cannot differ only by return type +} + + + +//// [overloadOnGenericArity.js] diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js new file mode 100644 index 0000000000000..bb082ac97fc49 --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js @@ -0,0 +1,54 @@ +//// [overloadOnGenericClassAndNonGenericClass.ts] +class A { a; } +class B { b; } +class C { c; } +class X { x: T; } +class X1 { x: string; } +class X2 { x: string; } +function f(a: X1): A; +function f(a: X): B; +function f(a): any { +} + +var xs: X; + +var t3 = f(xs); +var t3: A; // should not error + + +//// [overloadOnGenericClassAndNonGenericClass.js] +var A = (function () { + function A() { + } + return A; +})(); +var B = (function () { + function B() { + } + return B; +})(); +var C = (function () { + function C() { + } + return C; +})(); +var X = (function () { + function X() { + } + return X; +})(); +var X1 = (function () { + function X1() { + } + return X1; +})(); +var X2 = (function () { + function X2() { + } + return X2; +})(); +function f(a) { +} +var xs; +var t3 = f(xs); +var t3; diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt new file mode 100644 index 0000000000000..15666ec6f1d34 --- /dev/null +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -0,0 +1,129 @@ +==== tests/cases/conformance/expressions/functionCalls/overloadResolution.ts (17 errors) ==== + class SomeBase { + private n; + + public s: string; + } + class SomeDerived1 extends SomeBase { + private m; + } + class SomeDerived2 extends SomeBase { + private m; + } + class SomeDerived3 extends SomeBase { + private m; + } + + + // Ambiguous call picks the first overload in declaration order + function fn1(s: string): string; + function fn1(s: number): number; + function fn1() { return null; } + + var s = fn1(undefined); + var s: string; + + + // No candidate overloads found + fn1({}); // Error + ~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic and non - generic overload where generic overload is the only candidate when called with type arguments + function fn2(s: string, n: number): number; + function fn2(n: number, t: T): T; + function fn2() { return undefined; } + + var d = fn2(0, undefined); + var d: Date; + + // Generic and non - generic overload where generic overload is the only candidate when called without type arguments + var s = fn2(0, ''); + + // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments + fn2('', 0); // Error + ~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments + fn2('', 0); // OK + + // Generic overloads with differing arity called without type arguments + function fn3(n: T): string; + function fn3(s: string, t: T, u: U): U; + function fn3(v: V, u: U, t: T): number; + function fn3() { return null; } + + var s = fn3(3); + var s = fn3('', 3, ''); + var n = fn3(5, 5, 5); + var n: number; + + // Generic overloads with differing arity called with type arguments matching each overload type parameter count + var s = fn3(4); + var s = fn3('', '', ''); + var n = fn3('', '', 3); + + // Generic overloads with differing arity called with type argument count that doesn't match any overload + fn3(); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic overloads with constraints called with type arguments that satisfy the constraints + function fn4(n: T, m: U); + function fn4(n: T, m: U); + function fn4() { } + fn4('', 3); + fn4(3, ''); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + fn4('', 3); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + fn4(3, ''); + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that satisfy the constraints + fn4('', 3); + fn4(3, ''); + fn4(3, undefined); + fn4('', null); + + // Generic overloads with constraints called with type arguments that do not satisfy the constraints + fn4(null, null); // Error + ~~~~~~~ +!!! Type 'boolean' does not satisfy the constraint 'string'. + ~~~~ +!!! Type 'Date' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints + fn4(true, null); // Error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + fn4(null, true); // Error + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Non - generic overloads where contextual typing of function arguments has errors + function fn5(f: (n: string) => void): string; + function fn5(f: (n: number) => void): number; + function fn5() { return undefined; } + var n = fn5((n) => n.toFixed()); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. + ~~~~~~~ +!!! Property 'toFixed' does not exist on type 'string'. + var s = fn5((n) => n.substr(0)); + + \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js new file mode 100644 index 0000000000000..5d542baa07cb1 --- /dev/null +++ b/tests/baselines/reference/overloadResolution.js @@ -0,0 +1,172 @@ +//// [overloadResolution.ts] +class SomeBase { + private n; + + public s: string; +} +class SomeDerived1 extends SomeBase { + private m; +} +class SomeDerived2 extends SomeBase { + private m; +} +class SomeDerived3 extends SomeBase { + private m; +} + + +// Ambiguous call picks the first overload in declaration order +function fn1(s: string): string; +function fn1(s: number): number; +function fn1() { return null; } + +var s = fn1(undefined); +var s: string; + + +// No candidate overloads found +fn1({}); // Error + +// Generic and non - generic overload where generic overload is the only candidate when called with type arguments +function fn2(s: string, n: number): number; +function fn2(n: number, t: T): T; +function fn2() { return undefined; } + +var d = fn2(0, undefined); +var d: Date; + +// Generic and non - generic overload where generic overload is the only candidate when called without type arguments +var s = fn2(0, ''); + +// Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments +fn2('', 0); // Error + +// Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments +fn2('', 0); // OK + +// Generic overloads with differing arity called without type arguments +function fn3(n: T): string; +function fn3(s: string, t: T, u: U): U; +function fn3(v: V, u: U, t: T): number; +function fn3() { return null; } + +var s = fn3(3); +var s = fn3('', 3, ''); +var n = fn3(5, 5, 5); +var n: number; + +// Generic overloads with differing arity called with type arguments matching each overload type parameter count +var s = fn3(4); +var s = fn3('', '', ''); +var n = fn3('', '', 3); + +// Generic overloads with differing arity called with type argument count that doesn't match any overload +fn3(); // Error + +// Generic overloads with constraints called with type arguments that satisfy the constraints +function fn4(n: T, m: U); +function fn4(n: T, m: U); +function fn4() { } +fn4('', 3); +fn4(3, ''); // Error +fn4('', 3); // Error +fn4(3, ''); + +// Generic overloads with constraints called without type arguments but with types that satisfy the constraints +fn4('', 3); +fn4(3, ''); +fn4(3, undefined); +fn4('', null); + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +fn4(null, null); // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +fn4(true, null); // Error +fn4(null, true); // Error + +// Non - generic overloads where contextual typing of function arguments has errors +function fn5(f: (n: string) => void): string; +function fn5(f: (n: number) => void): number; +function fn5() { return undefined; } +var n = fn5((n) => n.toFixed()); +var s = fn5((n) => n.substr(0)); + + + +//// [overloadResolution.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SomeBase = (function () { + function SomeBase() { + } + return SomeBase; +})(); +var SomeDerived1 = (function (_super) { + __extends(SomeDerived1, _super); + function SomeDerived1() { + _super.apply(this, arguments); + } + return SomeDerived1; +})(SomeBase); +var SomeDerived2 = (function (_super) { + __extends(SomeDerived2, _super); + function SomeDerived2() { + _super.apply(this, arguments); + } + return SomeDerived2; +})(SomeBase); +var SomeDerived3 = (function (_super) { + __extends(SomeDerived3, _super); + function SomeDerived3() { + _super.apply(this, arguments); + } + return SomeDerived3; +})(SomeBase); +function fn1() { + return null; +} +var s = fn1(undefined); +var s; +fn1({}); +function fn2() { + return undefined; +} +var d = fn2(0, undefined); +var d; +var s = fn2(0, ''); +fn2('', 0); +fn2('', 0); +function fn3() { + return null; +} +var s = fn3(3); +var s = fn3('', 3, ''); +var n = fn3(5, 5, 5); +var n; +var s = fn3(4); +var s = fn3('', '', ''); +var n = fn3('', '', 3); +fn3(); +function fn4() { +} +fn4('', 3); +fn4(3, ''); +fn4('', 3); +fn4(3, ''); +fn4('', 3); +fn4(3, ''); +fn4(3, undefined); +fn4('', null); +fn4(null, null); +fn4(true, null); +fn4(null, true); +function fn5() { + return undefined; +} +var n = fn5(function (n) { return n.toFixed(); }); +var s = fn5(function (n) { return n.substr(0); }); diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt new file mode 100644 index 0000000000000..65c32ed46c005 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -0,0 +1,138 @@ +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts (18 errors) ==== + class SomeBase { + private n; + + public s: string; + } + class SomeDerived1 extends SomeBase { + private m; + } + class SomeDerived2 extends SomeBase { + private m; + } + class SomeDerived3 extends SomeBase { + private m; + } + + + // Ambiguous call picks the first overload in declaration order + class fn1 { + constructor(s: string); + constructor(s: number); + constructor() { } + } + + new fn1(undefined); + + // No candidate overloads found + new fn1({}); // Error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic and non - generic overload where generic overload is the only candidate when called with type arguments + class fn2 { + constructor(s: string, n: number); + constructor(n: number, t: T); + constructor() { } + } + + var d = new fn2(0, undefined); + + // Generic and non - generic overload where generic overload is the only candidate when called without type arguments + var s = new fn2(0, ''); + + // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments + new fn2('', 0); // OK + + // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments + new fn2('', 0); // OK + + // Generic overloads with differing arity called without type arguments + class fn3 { + constructor(n: T); + constructor(s: string, t: T, u: U); + constructor(v: V, u: U, t: T); + constructor() { } + } + + new fn3(3); + new fn3('', 3, ''); + new fn3(5, 5, 5); + + // Generic overloads with differing arity called with type arguments matching each overload type parameter count + new fn3(4); // Error + ~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn3('', '', ''); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn3('', '', 3); + + // Generic overloads with differing arity called with type argument count that doesn't match any overload + new fn3(); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic overloads with constraints called with type arguments that satisfy the constraints + class fn4 { + constructor(n: T, m: U); + constructor() { } + } + new fn4('', 3); + new fn4(3, ''); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn4('', 3); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + new fn4(3, ''); // Error + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that satisfy the constraints + new fn4('', 3); + new fn4(3, ''); // Error + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn4(3, undefined); // Error + ~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn4('', null); + + // Generic overloads with constraints called with type arguments that do not satisfy the constraints + new fn4(null, null); // Error + ~~~~~~~ +!!! Type 'boolean' does not satisfy the constraint 'string'. + ~~~~ +!!! Type 'Date' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints + new fn4(true, null); // Error + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn4(null, true); // Error + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Non - generic overloads where contextual typing of function arguments has errors + class fn5 { + constructor(f: (n: string) => void); + constructor(f: (n: number) => void); + constructor() { return undefined; } + } + new fn5((n) => n.toFixed()); + ~~~~~~~ +!!! Property 'toFixed' does not exist on type 'string'. + new fn5((n) => n.substr(0)); + new fn5((n) => n.blah); // Error + ~~~~ +!!! Property 'blah' does not exist on type 'string'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js new file mode 100644 index 0000000000000..dadb6af41e8ef --- /dev/null +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -0,0 +1,189 @@ +//// [overloadResolutionClassConstructors.ts] +class SomeBase { + private n; + + public s: string; +} +class SomeDerived1 extends SomeBase { + private m; +} +class SomeDerived2 extends SomeBase { + private m; +} +class SomeDerived3 extends SomeBase { + private m; +} + + +// Ambiguous call picks the first overload in declaration order +class fn1 { + constructor(s: string); + constructor(s: number); + constructor() { } +} + +new fn1(undefined); + +// No candidate overloads found +new fn1({}); // Error + +// Generic and non - generic overload where generic overload is the only candidate when called with type arguments +class fn2 { + constructor(s: string, n: number); + constructor(n: number, t: T); + constructor() { } +} + +var d = new fn2(0, undefined); + +// Generic and non - generic overload where generic overload is the only candidate when called without type arguments +var s = new fn2(0, ''); + +// Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments +new fn2('', 0); // OK + +// Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments +new fn2('', 0); // OK + +// Generic overloads with differing arity called without type arguments +class fn3 { + constructor(n: T); + constructor(s: string, t: T, u: U); + constructor(v: V, u: U, t: T); + constructor() { } +} + +new fn3(3); +new fn3('', 3, ''); +new fn3(5, 5, 5); + +// Generic overloads with differing arity called with type arguments matching each overload type parameter count +new fn3(4); // Error +new fn3('', '', ''); // Error +new fn3('', '', 3); + +// Generic overloads with differing arity called with type argument count that doesn't match any overload +new fn3(); // Error + +// Generic overloads with constraints called with type arguments that satisfy the constraints +class fn4 { + constructor(n: T, m: U); + constructor() { } +} +new fn4('', 3); +new fn4(3, ''); // Error +new fn4('', 3); // Error +new fn4(3, ''); // Error + +// Generic overloads with constraints called without type arguments but with types that satisfy the constraints +new fn4('', 3); +new fn4(3, ''); // Error +new fn4(3, undefined); // Error +new fn4('', null); + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +new fn4(null, null); // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +new fn4(true, null); // Error +new fn4(null, true); // Error + +// Non - generic overloads where contextual typing of function arguments has errors +class fn5 { + constructor(f: (n: string) => void); + constructor(f: (n: number) => void); + constructor() { return undefined; } +} +new fn5((n) => n.toFixed()); +new fn5((n) => n.substr(0)); +new fn5((n) => n.blah); // Error + + + + +//// [overloadResolutionClassConstructors.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SomeBase = (function () { + function SomeBase() { + } + return SomeBase; +})(); +var SomeDerived1 = (function (_super) { + __extends(SomeDerived1, _super); + function SomeDerived1() { + _super.apply(this, arguments); + } + return SomeDerived1; +})(SomeBase); +var SomeDerived2 = (function (_super) { + __extends(SomeDerived2, _super); + function SomeDerived2() { + _super.apply(this, arguments); + } + return SomeDerived2; +})(SomeBase); +var SomeDerived3 = (function (_super) { + __extends(SomeDerived3, _super); + function SomeDerived3() { + _super.apply(this, arguments); + } + return SomeDerived3; +})(SomeBase); +var fn1 = (function () { + function fn1() { + } + return fn1; +})(); +new fn1(undefined); +new fn1({}); +var fn2 = (function () { + function fn2() { + } + return fn2; +})(); +var d = new fn2(0, undefined); +var s = new fn2(0, ''); +new fn2('', 0); +new fn2('', 0); +var fn3 = (function () { + function fn3() { + } + return fn3; +})(); +new fn3(3); +new fn3('', 3, ''); +new fn3(5, 5, 5); +new fn3(4); +new fn3('', '', ''); +new fn3('', '', 3); +new fn3(); +var fn4 = (function () { + function fn4() { + } + return fn4; +})(); +new fn4('', 3); +new fn4(3, ''); +new fn4('', 3); +new fn4(3, ''); +new fn4('', 3); +new fn4(3, ''); +new fn4(3, undefined); +new fn4('', null); +new fn4(null, null); +new fn4(true, null); +new fn4(null, true); +var fn5 = (function () { + function fn5() { + return undefined; + } + return fn5; +})(); +new fn5(function (n) { return n.toFixed(); }); +new fn5(function (n) { return n.substr(0); }); +new fn5(function (n) { return n.blah; }); diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt new file mode 100644 index 0000000000000..c026fbe1c84a1 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -0,0 +1,137 @@ +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts (17 errors) ==== + class SomeBase { + private n; + + public s: string; + } + class SomeDerived1 extends SomeBase { + private m; + } + class SomeDerived2 extends SomeBase { + private m; + } + class SomeDerived3 extends SomeBase { + private m; + } + + interface fn1 { + new (s: string): string; + new (s: number): number; + } + var fn1: fn1; + + // Ambiguous call picks the first overload in declaration order + var s = new fn1(undefined); + var s: string; + + // No candidate overloads found + new fn1({}); // Error + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic and non - generic overload where generic overload is the only candidate when called with type arguments + interface fn2 { + new (s: string, n: number): number; + new (n: number, t: T): T; + } + var fn2: fn2; + + var d = new fn2(0, undefined); + var d: Date; + + // Generic and non - generic overload where generic overload is the only candidate when called without type arguments + var s = new fn2(0, ''); + + // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments + new fn2('', 0); // Error + ~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments + new fn2('', 0); // OK + + // Generic overloads with differing arity called without type arguments + interface fn3 { + new(n: T): string; + new(s: string, t: T, u: U): U; + new(v: V, u: U, t: T): number; + } + var fn3: fn3; + + var s = new fn3(3); + var s = new fn3('', 3, ''); + var n = new fn3(5, 5, 5); + var n: number; + + // Generic overloads with differing arity called with type arguments matching each overload type parameter count + var s = new fn3(4); + var s = new fn3('', '', ''); + var n = new fn3('', '', 3); + + // Generic overloads with differing arity called with type argument count that doesn't match any overload + new fn3(); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Generic overloads with constraints called with type arguments that satisfy the constraints + interface fn4 { + new(n: T, m: U); + new(n: T, m: U); + } + var fn4: fn4; + + new fn4('', 3); + new fn4(3, ''); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + new fn4('', 3); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + new fn4(3, ''); + ~~~~~~ +!!! Type 'number' does not satisfy the constraint 'string'. + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that satisfy the constraints + new fn4('', 3); + new fn4(3, ''); + new fn4(3, undefined); + new fn4('', null); + + // Generic overloads with constraints called with type arguments that do not satisfy the constraints + new fn4(null, null); // Error + ~~~~~~~ +!!! Type 'boolean' does not satisfy the constraint 'string'. + ~~~~ +!!! Type 'Date' does not satisfy the constraint 'number'. + + // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints + new fn4(true, null); // Error + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new fn4(null, true); // Error + ~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + // Non - generic overloads where contextual typing of function arguments has errors + interface fn5 { + new(f: (n: string) => void): string; + new(f: (n: number) => void): number; + } + var fn5: fn5; + var n = new fn5((n) => n.toFixed()); + ~ +!!! Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. + ~~~~~~~ +!!! Property 'toFixed' does not exist on type 'string'. + var s = new fn5((n) => n.substr(0)); + \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js new file mode 100644 index 0000000000000..c018922c23d9a --- /dev/null +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -0,0 +1,171 @@ +//// [overloadResolutionConstructors.ts] +class SomeBase { + private n; + + public s: string; +} +class SomeDerived1 extends SomeBase { + private m; +} +class SomeDerived2 extends SomeBase { + private m; +} +class SomeDerived3 extends SomeBase { + private m; +} + +interface fn1 { + new (s: string): string; + new (s: number): number; +} +var fn1: fn1; + +// Ambiguous call picks the first overload in declaration order +var s = new fn1(undefined); +var s: string; + +// No candidate overloads found +new fn1({}); // Error + +// Generic and non - generic overload where generic overload is the only candidate when called with type arguments +interface fn2 { + new (s: string, n: number): number; + new (n: number, t: T): T; +} +var fn2: fn2; + +var d = new fn2(0, undefined); +var d: Date; + +// Generic and non - generic overload where generic overload is the only candidate when called without type arguments +var s = new fn2(0, ''); + +// Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments +new fn2('', 0); // Error + +// Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments +new fn2('', 0); // OK + +// Generic overloads with differing arity called without type arguments +interface fn3 { + new(n: T): string; + new(s: string, t: T, u: U): U; + new(v: V, u: U, t: T): number; +} +var fn3: fn3; + +var s = new fn3(3); +var s = new fn3('', 3, ''); +var n = new fn3(5, 5, 5); +var n: number; + +// Generic overloads with differing arity called with type arguments matching each overload type parameter count +var s = new fn3(4); +var s = new fn3('', '', ''); +var n = new fn3('', '', 3); + +// Generic overloads with differing arity called with type argument count that doesn't match any overload +new fn3(); // Error + +// Generic overloads with constraints called with type arguments that satisfy the constraints +interface fn4 { + new(n: T, m: U); + new(n: T, m: U); +} +var fn4: fn4; + +new fn4('', 3); +new fn4(3, ''); // Error +new fn4('', 3); // Error +new fn4(3, ''); + +// Generic overloads with constraints called without type arguments but with types that satisfy the constraints +new fn4('', 3); +new fn4(3, ''); +new fn4(3, undefined); +new fn4('', null); + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +new fn4(null, null); // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +new fn4(true, null); // Error +new fn4(null, true); // Error + +// Non - generic overloads where contextual typing of function arguments has errors +interface fn5 { + new(f: (n: string) => void): string; + new(f: (n: number) => void): number; +} +var fn5: fn5; +var n = new fn5((n) => n.toFixed()); +var s = new fn5((n) => n.substr(0)); + + +//// [overloadResolutionConstructors.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SomeBase = (function () { + function SomeBase() { + } + return SomeBase; +})(); +var SomeDerived1 = (function (_super) { + __extends(SomeDerived1, _super); + function SomeDerived1() { + _super.apply(this, arguments); + } + return SomeDerived1; +})(SomeBase); +var SomeDerived2 = (function (_super) { + __extends(SomeDerived2, _super); + function SomeDerived2() { + _super.apply(this, arguments); + } + return SomeDerived2; +})(SomeBase); +var SomeDerived3 = (function (_super) { + __extends(SomeDerived3, _super); + function SomeDerived3() { + _super.apply(this, arguments); + } + return SomeDerived3; +})(SomeBase); +var fn1; +var s = new fn1(undefined); +var s; +new fn1({}); +var fn2; +var d = new fn2(0, undefined); +var d; +var s = new fn2(0, ''); +new fn2('', 0); +new fn2('', 0); +var fn3; +var s = new fn3(3); +var s = new fn3('', 3, ''); +var n = new fn3(5, 5, 5); +var n; +var s = new fn3(4); +var s = new fn3('', '', ''); +var n = new fn3('', '', 3); +new fn3(); +var fn4; +new fn4('', 3); +new fn4(3, ''); +new fn4('', 3); +new fn4(3, ''); +new fn4('', 3); +new fn4(3, ''); +new fn4(3, undefined); +new fn4('', null); +new fn4(null, null); +new fn4(true, null); +new fn4(null, true); +var fn5; +var n = new fn5(function (n) { return n.toFixed(); }); +var s = new fn5(function (n) { return n.substr(0); }); diff --git a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js new file mode 100644 index 0000000000000..3c7f6bc760909 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.js @@ -0,0 +1,16 @@ +//// [overloadResolutionOnDefaultConstructor1.ts] +class Bar { + public clone() { + return new Bar(0); + } +} + +//// [overloadResolutionOnDefaultConstructor1.js] +var Bar = (function () { + function Bar() { + } + Bar.prototype.clone = function () { + return new Bar(0); + }; + return Bar; +})(); diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt new file mode 100644 index 0000000000000..cc23f5c066ba3 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/overloadResolutionOverCTLambda.ts (1 errors) ==== + function foo(b: (item: number) => boolean) { } + foo(a => a); // can not convert (number)=>bool to (number)=>number + ~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionOverCTLambda.js b/tests/baselines/reference/overloadResolutionOverCTLambda.js new file mode 100644 index 0000000000000..6876795e2c6c0 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverCTLambda.js @@ -0,0 +1,8 @@ +//// [overloadResolutionOverCTLambda.ts] +function foo(b: (item: number) => boolean) { } +foo(a => a); // can not convert (number)=>bool to (number)=>number + +//// [overloadResolutionOverCTLambda.js] +function foo(b) { +} +foo(function (a) { return a; }); diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js new file mode 100644 index 0000000000000..4446d0f69ccb0 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.js @@ -0,0 +1,59 @@ +//// [overloadResolutionOverNonCTLambdas.ts] +module Bugs { + class A { + } + + // replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + function bug2(message:string, ...args:any[]):string { + var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) { + var index= rest[0]; + return typeof args[index] !== 'undefined' + ? args[index] + : match; + }); + return result; + } +} + +function bug3(f:(x:string)=>string) { return f("s") } + +function fprime(x:string):string { return x; } + +bug3(fprime); + +bug3(function(x:string):string { return x; }); + +//// [overloadResolutionOverNonCTLambdas.js] +var Bugs; +(function (Bugs) { + var A = (function () { + function A() { + } + return A; + })(); + function bug2(message) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var result = message.replace(/\{(\d+)\}/g, function (match) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + return result; + } +})(Bugs || (Bugs = {})); +function bug3(f) { + return f("s"); +} +function fprime(x) { + return x; +} +bug3(fprime); +bug3(function (x) { + return x; +}); diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js new file mode 100644 index 0000000000000..cf125bebbf515 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.js @@ -0,0 +1,32 @@ +//// [overloadResolutionOverNonCTObjectLit.ts] +module Bugs { + export interface IToken { + startIndex:number; + type:string; + bracket:number; + } + + export interface IState { + } + + export interface IStateToken extends IToken { + state: IState; + length: number; + } + + function bug3() { + var tokens:IToken[]= []; + tokens.push({ startIndex: 1, type: '', bracket: 3 }); + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); + } +} + +//// [overloadResolutionOverNonCTObjectLit.js] +var Bugs; +(function (Bugs) { + function bug3() { + var tokens = []; + tokens.push({ startIndex: 1, type: '', bracket: 3 }); + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); + } +})(Bugs || (Bugs = {})); diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt new file mode 100644 index 0000000000000..d5aa2705d1d2a --- /dev/null +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ==== + + function foo(bar:{a:number;}[]):string; + function foo(bar:{a:boolean;}[]):number; + function foo(bar:{a:any;}[]):any{ return bar }; + + var x1 = foo([{a:true}]); // works + var x11 = foo([{a:0}]); // works + var x111 = foo([{a:"s"}]); // error - does not match any signature + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string + + + + function foo2(bar:{a:number;}):string; + function foo2(bar:{a:boolean;}):number; + function foo2(bar:{a:any;}):any{ return bar }; + + var x2 = foo2({a:0}); // works + var x3 = foo2({a:true}); // works + var x4 = foo2({a:"s"}); // error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + + function foo4(bar:{a:number;}):number; + function foo4(bar:{a:string;}):string; + function foo4(bar:{a:any;}):any{ return bar }; + var x = foo4({a:true}); // error + ~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionTest1.js b/tests/baselines/reference/overloadResolutionTest1.js new file mode 100644 index 0000000000000..b24723d8210bb --- /dev/null +++ b/tests/baselines/reference/overloadResolutionTest1.js @@ -0,0 +1,48 @@ +//// [overloadResolutionTest1.ts] + +function foo(bar:{a:number;}[]):string; +function foo(bar:{a:boolean;}[]):number; +function foo(bar:{a:any;}[]):any{ return bar }; + +var x1 = foo([{a:true}]); // works +var x11 = foo([{a:0}]); // works +var x111 = foo([{a:"s"}]); // error - does not match any signature +var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string + + + +function foo2(bar:{a:number;}):string; +function foo2(bar:{a:boolean;}):number; +function foo2(bar:{a:any;}):any{ return bar }; + +var x2 = foo2({a:0}); // works +var x3 = foo2({a:true}); // works +var x4 = foo2({a:"s"}); // error + + +function foo4(bar:{a:number;}):number; +function foo4(bar:{a:string;}):string; +function foo4(bar:{a:any;}):any{ return bar }; +var x = foo4({a:true}); // error + +//// [overloadResolutionTest1.js] +function foo(bar) { + return bar; +} +; +var x1 = foo([{ a: true }]); +var x11 = foo([{ a: 0 }]); +var x111 = foo([{ a: "s" }]); +var x1111 = foo([{ a: null }]); +function foo2(bar) { + return bar; +} +; +var x2 = foo2({ a: 0 }); +var x3 = foo2({ a: true }); +var x4 = foo2({ a: "s" }); +function foo4(bar) { + return bar; +} +; +var x = foo4({ a: true }); diff --git a/tests/baselines/reference/overloadResolutionWithAny.js b/tests/baselines/reference/overloadResolutionWithAny.js new file mode 100644 index 0000000000000..6f4e2b15216b7 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionWithAny.js @@ -0,0 +1,34 @@ +//// [overloadResolutionWithAny.ts] +var func: { + (s: string): number; + (s: any): string; +}; + +func(""); // number +func(3); // string +var x: any; +func(x); // string + +var func2: { + (s: string, t: string): number; + (s: any, t: string): boolean; + (s: string, t: any): RegExp; + (s: any, t: any): string; +} + +func2(x, x); // string +func2("", ""); // number +func2(x, ""); // boolean +func2("", x); // RegExp + +//// [overloadResolutionWithAny.js] +var func; +func(""); +func(3); +var x; +func(x); +var func2; +func2(x, x); +func2("", ""); +func2(x, ""); +func2("", x); diff --git a/tests/baselines/reference/overloadRet.js b/tests/baselines/reference/overloadRet.js new file mode 100644 index 0000000000000..169bac3dfc547 --- /dev/null +++ b/tests/baselines/reference/overloadRet.js @@ -0,0 +1,13 @@ +//// [overloadRet.ts] +interface I { + f(s:string):number; + f(n:number):string; + g(n:number):any; + g(n:number,m:number):string; + h(n:number):I; + h(b:boolean):number; + i(b:boolean):number; + i(b:boolean):any; +} + +//// [overloadRet.js] diff --git a/tests/baselines/reference/overloadReturnTypes.js b/tests/baselines/reference/overloadReturnTypes.js new file mode 100644 index 0000000000000..161f505626657 --- /dev/null +++ b/tests/baselines/reference/overloadReturnTypes.js @@ -0,0 +1,39 @@ +//// [overloadReturnTypes.ts] +class Accessor {} + +function attr(name: string): string; +function attr(name: string, value: string): Accessor; +function attr(map: any): Accessor; +function attr(nameOrMap: any, value?: string): any { + if (nameOrMap && typeof nameOrMap === "object") { + // handle map case + return new Accessor; + } + else { + // handle string case + return "s"; + } +} + + +interface IFace { + attr(name:string):string; + attr(name: string, value: string): Accessor; + attr(map: any): Accessor; +} + + +//// [overloadReturnTypes.js] +var Accessor = (function () { + function Accessor() { + } + return Accessor; +})(); +function attr(nameOrMap, value) { + if (nameOrMap && typeof nameOrMap === "object") { + return new Accessor; + } + else { + return "s"; + } +} diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js new file mode 100644 index 0000000000000..d4d0287bc004a --- /dev/null +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.js @@ -0,0 +1,13 @@ +//// [overloadWithCallbacksWithDifferingOptionalityOnArgs.ts] +function x2(callback: (x?: number) => number); +function x2(callback: (x: string) => number); +function x2(callback: (x: any) => number) { } +x2(() => 1); +x2((x) => 1 ); + + +//// [overloadWithCallbacksWithDifferingOptionalityOnArgs.js] +function x2(callback) { +} +x2(function () { return 1; }); +x2(function (x) { return 1; }); diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.js b/tests/baselines/reference/overloadedStaticMethodSpecialization.js new file mode 100644 index 0000000000000..db50cbc992c0a --- /dev/null +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.js @@ -0,0 +1,19 @@ +//// [overloadedStaticMethodSpecialization.ts] +class A { + static B(v: A): A; + static B(v: S): A; + static B(v: any): A { + return null; + } +} + + +//// [overloadedStaticMethodSpecialization.js] +var A = (function () { + function A() { + } + A.B = function (v) { + return null; + }; + return A; +})(); diff --git a/tests/baselines/reference/overloadingOnConstants1.errors.txt b/tests/baselines/reference/overloadingOnConstants1.errors.txt new file mode 100644 index 0000000000000..93ca40cad8863 --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstants1.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/overloadingOnConstants1.ts (4 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + class Derived2 extends Base { baz() { } } + class Derived3 extends Base { biz() { } } + + interface Document2 { + createElement(tagName: 'canvas'): Derived1; + createElement(tagName: 'div'): Derived2; + createElement(tagName: 'span'): Derived3; + createElement(tagName: string): Base; + } + + var d2: Document2; + + // these are ok + var htmlElement: Base = d2.createElement("yo") + var htmlCanvasElement: Derived1 = d2.createElement("canvas"); + var htmlDivElement: Derived2 = d2.createElement("div"); + var htmlSpanElement: Derived3 = d2.createElement("span"); + + // these are errors + var htmlElement2: Derived1 = d2.createElement("yo") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Base' is not assignable to type 'Derived1': +!!! Property 'bar' is missing in type 'Base'. + var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Derived1' is not assignable to type 'Derived3': +!!! Property 'biz' is missing in type 'Derived1'. + var htmlDivElement2: Derived1 = d2.createElement("div"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Derived2' is not assignable to type 'Derived1': +!!! Property 'bar' is missing in type 'Derived2'. + var htmlSpanElement2: Derived1 = d2.createElement("span"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'Derived3' is not assignable to type 'Derived1': +!!! Property 'bar' is missing in type 'Derived3'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js new file mode 100644 index 0000000000000..8ba27fa41bf94 --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -0,0 +1,77 @@ +//// [overloadingOnConstants1.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +class Derived2 extends Base { baz() { } } +class Derived3 extends Base { biz() { } } + +interface Document2 { + createElement(tagName: 'canvas'): Derived1; + createElement(tagName: 'div'): Derived2; + createElement(tagName: 'span'): Derived3; + createElement(tagName: string): Base; +} + +var d2: Document2; + +// these are ok +var htmlElement: Base = d2.createElement("yo") +var htmlCanvasElement: Derived1 = d2.createElement("canvas"); +var htmlDivElement: Derived2 = d2.createElement("div"); +var htmlSpanElement: Derived3 = d2.createElement("span"); + +// these are errors +var htmlElement2: Derived1 = d2.createElement("yo") +var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); +var htmlDivElement2: Derived1 = d2.createElement("div"); +var htmlSpanElement2: Derived1 = d2.createElement("span"); + +//// [overloadingOnConstants1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + Derived2.prototype.baz = function () { + }; + return Derived2; +})(Base); +var Derived3 = (function (_super) { + __extends(Derived3, _super); + function Derived3() { + _super.apply(this, arguments); + } + Derived3.prototype.biz = function () { + }; + return Derived3; +})(Base); +var d2; +var htmlElement = d2.createElement("yo"); +var htmlCanvasElement = d2.createElement("canvas"); +var htmlDivElement = d2.createElement("div"); +var htmlSpanElement = d2.createElement("span"); +var htmlElement2 = d2.createElement("yo"); +var htmlCanvasElement2 = d2.createElement("canvas"); +var htmlDivElement2 = d2.createElement("div"); +var htmlSpanElement2 = d2.createElement("span"); diff --git a/tests/baselines/reference/overloadingOnConstants2.errors.txt b/tests/baselines/reference/overloadingOnConstants2.errors.txt new file mode 100644 index 0000000000000..d89ee5b44ea48 --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstants2.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/overloadingOnConstants2.ts (4 errors) ==== + class C { + private x = 1; + } + class D extends C {} + class E { + private y = 1; + } + function foo(x: "hi", items: string[]): D; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(x: "bye", items: string[]): E; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(x: string, items: string[]): C { + return null; + } + var a: D = foo("hi", []); // D + var b: E = foo("bye", []); // E + var c = foo("um", []); // error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + + //function bar(x: "hi", items: string[]): D; + function bar(x: "bye", items: string[]): E; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function bar(x: string, items: string[]): C; + function bar(x: string, items: string[]): C { + return null; + } + + var d: D = bar("hi", []); // D + var e: E = bar("bye", []); // E + var f: C = bar("um", []); // C \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js new file mode 100644 index 0000000000000..34094804f6a3d --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -0,0 +1,67 @@ +//// [overloadingOnConstants2.ts] +class C { + private x = 1; +} +class D extends C {} +class E { + private y = 1; +} +function foo(x: "hi", items: string[]): D; +function foo(x: "bye", items: string[]): E; +function foo(x: string, items: string[]): C { + return null; +} +var a: D = foo("hi", []); // D +var b: E = foo("bye", []); // E +var c = foo("um", []); // error + + +//function bar(x: "hi", items: string[]): D; +function bar(x: "bye", items: string[]): E; +function bar(x: string, items: string[]): C; +function bar(x: string, items: string[]): C { + return null; +} + +var d: D = bar("hi", []); // D +var e: E = bar("bye", []); // E +var f: C = bar("um", []); // C + +//// [overloadingOnConstants2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + this.x = 1; + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var E = (function () { + function E() { + this.y = 1; + } + return E; +})(); +function foo(x, items) { + return null; +} +var a = foo("hi", []); +var b = foo("bye", []); +var c = foo("um", []); +function bar(x, items) { + return null; +} +var d = bar("hi", []); +var e = bar("bye", []); +var f = bar("um", []); diff --git a/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt b/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt new file mode 100644 index 0000000000000..6313010ef8cf7 --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstantsInImplementation.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/overloadingOnConstantsInImplementation.ts (3 errors) ==== + function foo(a: 'hi', x: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(a: 'hi', x: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(a: 'hi', x: any) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! A signature with an implementation cannot use a string literal type. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstantsInImplementation.js b/tests/baselines/reference/overloadingOnConstantsInImplementation.js new file mode 100644 index 0000000000000..cf938c295d281 --- /dev/null +++ b/tests/baselines/reference/overloadingOnConstantsInImplementation.js @@ -0,0 +1,9 @@ +//// [overloadingOnConstantsInImplementation.ts] +function foo(a: 'hi', x: string); +function foo(a: 'hi', x: string); +function foo(a: 'hi', x: any) { +} + +//// [overloadingOnConstantsInImplementation.js] +function foo(a, x) { +} diff --git a/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt new file mode 100644 index 0000000000000..2d8832f67dad2 --- /dev/null +++ b/tests/baselines/reference/overloadingStaticFunctionsInFunctions.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts (14 errors) ==== + function boo { + ~ +!!! '(' expected. + static test() + ~~~~~~ +!!! Statement expected. + ~~~~ +!!! Cannot find name 'test'. + static test(name:string) + ~~~~~~ +!!! Statement expected. + ~ +!!! ',' expected. + ~~~~ +!!! Cannot find name 'test'. + ~~~~ +!!! Cannot find name 'name'. + ~~~~~~ +!!! Cannot find name 'string'. + static test(name?:any){ } + ~~~~~~ +!!! Statement expected. + ~ +!!! Expression expected. + ~ +!!! ';' expected. + ~~~~ +!!! Cannot find name 'test'. + ~~~~ +!!! Cannot find name 'name'. + ~~~ +!!! Cannot find name 'any'. + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt new file mode 100644 index 0000000000000..3cd453c779ad3 --- /dev/null +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts (6 errors) ==== + interface A { x } + interface B { x; y } + interface C { z } + interface D { q } + + class G { + constructor(x: T) { } + } + + declare function foo(arg: (x: D) => number): string; + declare function foo(arg: (x: C) => any): string; + declare function foo(arg: (x: B) => any): number; + + var result: number = foo(x => new G(x)); // No error, returns number + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + ~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var result2: number = foo(x => new G(x)); // No error, returns number + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! Type 'D' does not satisfy the constraint 'A'. + + var result3: string = foo(x => { // returns string because the C overload is picked + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var y: G; // error that C does not satisfy constraint + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! Type 'D' does not satisfy the constraint 'A'. + return y; + ~~~~~~~~~~~~~ + }); + ~~ +!!! Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js new file mode 100644 index 0000000000000..b56693c97cd08 --- /dev/null +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -0,0 +1,36 @@ +//// [overloadresolutionWithConstraintCheckingDeferred.ts] +interface A { x } +interface B { x; y } +interface C { z } +interface D { q } + +class G { + constructor(x: T) { } +} + +declare function foo(arg: (x: D) => number): string; +declare function foo(arg: (x: C) => any): string; +declare function foo(arg: (x: B) => any): number; + +var result: number = foo(x => new G(x)); // No error, returns number + +var result2: number = foo(x => new G(x)); // No error, returns number + +var result3: string = foo(x => { // returns string because the C overload is picked + var y: G; // error that C does not satisfy constraint + return y; +}); + + +//// [overloadresolutionWithConstraintCheckingDeferred.js] +var G = (function () { + function G(x) { + } + return G; +})(); +var result = foo(function (x) { return new G(x); }); +var result2 = foo(function (x) { return new G(x); }); +var result3 = foo(function (x) { + var y; + return y; +}); diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.js b/tests/baselines/reference/overloadsAndTypeArgumentArity.js new file mode 100644 index 0000000000000..e08a64b6e4798 --- /dev/null +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.js @@ -0,0 +1,12 @@ +//// [overloadsAndTypeArgumentArity.ts] +declare function Callbacks(flags?: string): void; +declare function Callbacks(flags?: string): void; +declare function Callbacks(flags?: string): void; +declare function Callbacks(flags?: string): void; + +Callbacks('s'); // no error +new Callbacks('s'); // no error + +//// [overloadsAndTypeArgumentArity.js] +Callbacks('s'); +new Callbacks('s'); diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt new file mode 100644 index 0000000000000..3b9543f50cca5 --- /dev/null +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts (3 errors) ==== + declare function Callbacks(flags?: string): void; + declare function Callbacks(flags?: string): void; + declare function Callbacks(flags?: string): void; + + Callbacks('s'); // wrong number of type arguments + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + new Callbacks('s'); // wrong number of type arguments + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Only a void function can be called with the 'new' keyword. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.js b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.js new file mode 100644 index 0000000000000..7809929aab801 --- /dev/null +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.js @@ -0,0 +1,11 @@ +//// [overloadsAndTypeArgumentArityErrors.ts] +declare function Callbacks(flags?: string): void; +declare function Callbacks(flags?: string): void; +declare function Callbacks(flags?: string): void; + +Callbacks('s'); // wrong number of type arguments +new Callbacks('s'); // wrong number of type arguments + +//// [overloadsAndTypeArgumentArityErrors.js] +Callbacks('s'); +new Callbacks('s'); diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt new file mode 100644 index 0000000000000..06bd4d0f62d47 --- /dev/null +++ b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/overloadsInDifferentContainersDisagreeOnAmbient.ts (1 errors) ==== + declare module M { + // Error because body is not ambient and this overload is + export function f(); + } + + module M { + export function f() { } + ~ +!!! Overload signatures must all be ambient or non-ambient. + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js new file mode 100644 index 0000000000000..4d0ac15c7179b --- /dev/null +++ b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js @@ -0,0 +1,17 @@ +//// [overloadsInDifferentContainersDisagreeOnAmbient.ts] +declare module M { + // Error because body is not ambient and this overload is + export function f(); +} + +module M { + export function f() { } +} + +//// [overloadsInDifferentContainersDisagreeOnAmbient.js] +var M; +(function (M) { + function f() { + } + M.f = f; +})(M || (M = {})); diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt new file mode 100644 index 0000000000000..17049fba3b160 --- /dev/null +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/overloadsWithProvisionalErrors.ts (4 errors) ==== + var func: { + (s: string): number; + (lambda: (s: string) => { a: number; b: number }): string; + }; + + func(s => ({})); // Error for no applicable overload (object type is missing a and b) + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) + ~~~~ +!!! Cannot find name 'blah'. + func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~ +!!! Cannot find name 'blah'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.js b/tests/baselines/reference/overloadsWithProvisionalErrors.js new file mode 100644 index 0000000000000..5d201e770cd9e --- /dev/null +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.js @@ -0,0 +1,15 @@ +//// [overloadsWithProvisionalErrors.ts] +var func: { + (s: string): number; + (lambda: (s: string) => { a: number; b: number }): string; +}; + +func(s => ({})); // Error for no applicable overload (object type is missing a and b) +func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) +func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway + +//// [overloadsWithProvisionalErrors.js] +var func; +func(function (s) { return ({}); }); +func(function (s) { return ({ a: blah, b: 3 }); }); +func(function (s) { return ({ a: blah }); }); diff --git a/tests/baselines/reference/overloadsWithinClasses.errors.txt b/tests/baselines/reference/overloadsWithinClasses.errors.txt new file mode 100644 index 0000000000000..c67bba6162695 --- /dev/null +++ b/tests/baselines/reference/overloadsWithinClasses.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/overloadsWithinClasses.ts (1 errors) ==== + class foo { + + static fnOverload( ) {} + + static fnOverload(foo: string){ } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Duplicate function implementation. + + } + + class bar { + + static fnOverload( ); + + static fnOverload(foo?: string){ } // no error + + } + + class X { + public attr(name:string):string; + public attr(name:string, value:string):X; + public attr(first:any, second?:any):any { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/overloadsWithinClasses.js b/tests/baselines/reference/overloadsWithinClasses.js new file mode 100644 index 0000000000000..8ef9341ec157b --- /dev/null +++ b/tests/baselines/reference/overloadsWithinClasses.js @@ -0,0 +1,49 @@ +//// [overloadsWithinClasses.ts] +class foo { + + static fnOverload( ) {} + + static fnOverload(foo: string){ } // error + +} + +class bar { + + static fnOverload( ); + + static fnOverload(foo?: string){ } // no error + +} + +class X { + public attr(name:string):string; + public attr(name:string, value:string):X; + public attr(first:any, second?:any):any { + } +} + + +//// [overloadsWithinClasses.js] +var foo = (function () { + function foo() { + } + foo.fnOverload = function () { + }; + foo.fnOverload = function (foo) { + }; + return foo; +})(); +var bar = (function () { + function bar() { + } + bar.fnOverload = function (foo) { + }; + return bar; +})(); +var X = (function () { + function X() { + } + X.prototype.attr = function (first, second) { + }; + return X; +})(); diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt new file mode 100644 index 0000000000000..0e7200d122d08 --- /dev/null +++ b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/overridingPrivateStaticMembers.ts (1 errors) ==== + class Base2 { + private static y: { foo: string }; + } + + class Derived2 extends Base2 { + ~~~~~~~~ +!!! Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +!!! Private property 'y' cannot be reimplemented. + private static y: { foo: string; bar: string; }; + } \ No newline at end of file diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js new file mode 100644 index 0000000000000..2174f9e298b77 --- /dev/null +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -0,0 +1,28 @@ +//// [overridingPrivateStaticMembers.ts] +class Base2 { + private static y: { foo: string }; +} + +class Derived2 extends Base2 { + private static y: { foo: string; bar: string; }; +} + +//// [overridingPrivateStaticMembers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base2 = (function () { + function Base2() { + } + return Base2; +})(); +var Derived2 = (function (_super) { + __extends(Derived2, _super); + function Derived2() { + _super.apply(this, arguments); + } + return Derived2; +})(Base2); diff --git a/tests/baselines/reference/paramPropertiesInSignatures.errors.txt b/tests/baselines/reference/paramPropertiesInSignatures.errors.txt new file mode 100644 index 0000000000000..46ac90581e973 --- /dev/null +++ b/tests/baselines/reference/paramPropertiesInSignatures.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/paramPropertiesInSignatures.ts (5 errors) ==== + class C1 { + constructor(public p1:string); // ERROR + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(private p2:number); // ERROR + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public p3:any) {} // OK + } + + declare class C2 { + constructor(public p1:string); // ERROR + ~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(private p2:number); // ERROR + ~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public p3:any); // ERROR + ~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } \ No newline at end of file diff --git a/tests/baselines/reference/paramPropertiesInSignatures.js b/tests/baselines/reference/paramPropertiesInSignatures.js new file mode 100644 index 0000000000000..03e73d143ae36 --- /dev/null +++ b/tests/baselines/reference/paramPropertiesInSignatures.js @@ -0,0 +1,20 @@ +//// [paramPropertiesInSignatures.ts] +class C1 { + constructor(public p1:string); // ERROR + constructor(private p2:number); // ERROR + constructor(public p3:any) {} // OK +} + +declare class C2 { + constructor(public p1:string); // ERROR + constructor(private p2:number); // ERROR + constructor(public p3:any); // ERROR +} + +//// [paramPropertiesInSignatures.js] +var C1 = (function () { + function C1(p3) { + this.p3 = p3; + } + return C1; +})(); diff --git a/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt new file mode 100644 index 0000000000000..2394b91104e95 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/parameterPropertyInConstructor1.ts (1 errors) ==== + declare module mod { + class Customers { + constructor(public names: string); + ~~~~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/parameterPropertyInConstructor1.js b/tests/baselines/reference/parameterPropertyInConstructor1.js new file mode 100644 index 0000000000000..1f862ca7fa19e --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInConstructor1.js @@ -0,0 +1,9 @@ +//// [parameterPropertyInConstructor1.ts] +declare module mod { + class Customers { + constructor(public names: string); + } +} + + +//// [parameterPropertyInConstructor1.js] diff --git a/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt new file mode 100644 index 0000000000000..deb9806812bc8 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/parameterPropertyInConstructor2.ts (3 errors) ==== + module mod { + class Customers { + constructor(public names: string); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + ~~~~~~~~~~~~~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + constructor(public names: string, public ages: number) { + ~~~~~ +!!! Duplicate identifier 'names'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/parameterPropertyInConstructor2.js b/tests/baselines/reference/parameterPropertyInConstructor2.js new file mode 100644 index 0000000000000..595f3f3d0ffe5 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInConstructor2.js @@ -0,0 +1,21 @@ +//// [parameterPropertyInConstructor2.ts] +module mod { + class Customers { + constructor(public names: string); + constructor(public names: string, public ages: number) { + } + } +} + + +//// [parameterPropertyInConstructor2.js] +var mod; +(function (mod) { + var Customers = (function () { + function Customers(names, ages) { + this.names = names; + this.ages = ages; + } + return Customers; + })(); +})(mod || (mod = {})); diff --git a/tests/baselines/reference/parameterPropertyInitializerInInitializers.js b/tests/baselines/reference/parameterPropertyInitializerInInitializers.js new file mode 100644 index 0000000000000..d3cd88764f40a --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInitializerInInitializers.js @@ -0,0 +1,14 @@ +//// [parameterPropertyInitializerInInitializers.ts] +class Foo { + constructor(public x: number, public y: number = x) { } +} + +//// [parameterPropertyInitializerInInitializers.js] +var Foo = (function () { + function Foo(x, y) { + if (y === void 0) { y = x; } + this.x = x; + this.y = y; + } + return Foo; +})(); diff --git a/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt b/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt new file mode 100644 index 0000000000000..316a71a37b92e --- /dev/null +++ b/tests/baselines/reference/parameterPropertyOutsideConstructor.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/parameterPropertyOutsideConstructor.ts (1 errors) ==== + class C { + foo(public x) { + ~~~~~~~~ +!!! A parameter property is only allowed in a constructor implementation. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/parameterPropertyOutsideConstructor.js b/tests/baselines/reference/parameterPropertyOutsideConstructor.js new file mode 100644 index 0000000000000..43e20d4fa6397 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyOutsideConstructor.js @@ -0,0 +1,14 @@ +//// [parameterPropertyOutsideConstructor.ts] +class C { + foo(public x) { + } +} + +//// [parameterPropertyOutsideConstructor.js] +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); diff --git a/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js new file mode 100644 index 0000000000000..18cb0e4a41c27 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.js @@ -0,0 +1,15 @@ +//// [parameterPropertyReferencingOtherParameter.ts] +class Foo { + constructor(public x: number, public y: number = x) { } +} + + +//// [parameterPropertyReferencingOtherParameter.js] +var Foo = (function () { + function Foo(x, y) { + if (y === void 0) { y = x; } + this.x = x; + this.y = y; + } + return Foo; +})(); diff --git a/tests/baselines/reference/parameterReferencesOtherParameter1.js b/tests/baselines/reference/parameterReferencesOtherParameter1.js new file mode 100644 index 0000000000000..6c8bb8a06a8fd --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter1.js @@ -0,0 +1,23 @@ +//// [parameterReferencesOtherParameter1.ts] +class Model { + public name: string; +} + +class UI { + constructor(model: Model, foo:string = model.name) + { + } +} + +//// [parameterReferencesOtherParameter1.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +var UI = (function () { + function UI(model, foo) { + if (foo === void 0) { foo = model.name; } + } + return UI; +})(); diff --git a/tests/baselines/reference/parameterReferencesOtherParameter2.js b/tests/baselines/reference/parameterReferencesOtherParameter2.js new file mode 100644 index 0000000000000..e9c9ff4e5d4d6 --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter2.js @@ -0,0 +1,23 @@ +//// [parameterReferencesOtherParameter2.ts] +class Model { + public name: string; +} + +class UI { + constructor(model: Model, foo = model.name) + { + } +} + +//// [parameterReferencesOtherParameter2.js] +var Model = (function () { + function Model() { + } + return Model; +})(); +var UI = (function () { + function UI(model, foo) { + if (foo === void 0) { foo = model.name; } + } + return UI; +})(); diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.js b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js new file mode 100644 index 0000000000000..64452744c96b8 --- /dev/null +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.js @@ -0,0 +1,58 @@ +//// [parametersWithNoAnnotationAreAny.ts] +function foo(x) { return x; } +var f = function foo(x) { return x; } +var f2 = (x) => x; +var f3 = (x) => x; + +class C { + foo(x) { + return x; + } +} + +interface I { + foo(x); + foo2(x, y); +} + +var a: { + foo(x); +} + +var b = { + foo(x) { + return x; + }, + a: function foo(x) { + return x; + }, + b: (x) => x +} + +//// [parametersWithNoAnnotationAreAny.js] +function foo(x) { + return x; +} +var f = function foo(x) { + return x; +}; +var f2 = function (x) { return x; }; +var f3 = function (x) { return x; }; +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + return x; + }; + return C; +})(); +var a; +var b = { + foo: function foo(x) { + return x; + }, + a: function foo(x) { + return x; + }, + b: function (x) { return x; } +}; diff --git a/tests/baselines/reference/parse1.errors.txt b/tests/baselines/reference/parse1.errors.txt new file mode 100644 index 0000000000000..b2c9a06efe6b8 --- /dev/null +++ b/tests/baselines/reference/parse1.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/parse1.ts (1 errors) ==== + var bar = 42; + function foo() { + bar. + } + ~ +!!! Identifier expected. + \ No newline at end of file diff --git a/tests/baselines/reference/parse2.errors.txt b/tests/baselines/reference/parse2.errors.txt new file mode 100644 index 0000000000000..f7d424001caeb --- /dev/null +++ b/tests/baselines/reference/parse2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/parse2.ts (1 errors) ==== + function foo() { + foo( + } + ~ +!!! Argument expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parseShortform.js b/tests/baselines/reference/parseShortform.js new file mode 100644 index 0000000000000..b2a50609d21e0 --- /dev/null +++ b/tests/baselines/reference/parseShortform.js @@ -0,0 +1,14 @@ +//// [parseShortform.ts] +interface I { + w: { + z: I; + (): boolean; + [s: string]: { x: any; y: any; }; + [n: number]: { x: any; y: any; }; + }; + x: boolean; + y: (s: string) => boolean; + z: I; +} + +//// [parseShortform.js] diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt new file mode 100644 index 0000000000000..49b9218320c03 --- /dev/null +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/parseTypes.ts (4 errors) ==== + + var x = <() => number>null; + var y = <{(): number; }>null; + var z = <{new(): number; }>null + var w = <{[x:number]: number; }>null + function f() { return 3 }; + function g(s: string) { true }; + y=f; + y=g; + ~ +!!! Type '(s: string) => void' is not assignable to type '() => number'. + x=g; + ~ +!!! Type '(s: string) => void' is not assignable to type '() => number'. + w=g; + ~ +!!! Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': +!!! Index signature is missing in type '(s: string) => void'. + z=g; + ~ +!!! Type '(s: string) => void' is not assignable to type 'new () => number'. + \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.js b/tests/baselines/reference/parseTypes.js new file mode 100644 index 0000000000000..193533de04a91 --- /dev/null +++ b/tests/baselines/reference/parseTypes.js @@ -0,0 +1,33 @@ +//// [parseTypes.ts] + +var x = <() => number>null; +var y = <{(): number; }>null; +var z = <{new(): number; }>null +var w = <{[x:number]: number; }>null +function f() { return 3 }; +function g(s: string) { true }; +y=f; +y=g; +x=g; +w=g; +z=g; + + +//// [parseTypes.js] +var x = null; +var y = null; +var z = null; +var w = null; +function f() { + return 3; +} +; +function g(s) { + true; +} +; +y = f; +y = g; +x = g; +w = g; +z = g; diff --git a/tests/baselines/reference/parser0_004152.errors.txt b/tests/baselines/reference/parser0_004152.errors.txt new file mode 100644 index 0000000000000..81e6d44af87fb --- /dev/null +++ b/tests/baselines/reference/parser0_004152.errors.txt @@ -0,0 +1,82 @@ +==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (38 errors) ==== + export class Game { + ~~~~~~~~~~~~~~~~~~~ + private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0); + ~ +!!! Expression or comma expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! ';' expected. + ~ +!!! ';' expected. + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'DisplayPosition'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '3'. + ~ +!!! Duplicate identifier '0'. + ~ +!!! Duplicate identifier '0'. + private prevConfig: SeedCoords[][]; + ~~~~~~~ +!!! Declaration or statement expected. + ~ +!!! Expression expected. + ~ +!!! Expression expected. + ~~~~~~~~~~ +!!! Cannot find name 'SeedCoords'. + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt new file mode 100644 index 0000000000000..4482dd6f1d34b --- /dev/null +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (1 errors) ==== + /// Copyright (c) 2012 Ecma International. All rights reserved. + /// Ecma International makes this code available under the terms and conditions set + /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the + /// "Use Terms"). Any redistribution of this code must retain the above + /// copyright and this notice and otherwise comply with the Use Terms. + + /** + * @path ch10/10.1/10.1.1/10.1.1-8gs.js + * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code + * @noStrict + * @negative ^((?!NotEarlyError).)*$ + */ + + "use strict"; + "use strict"; + throw NotEarlyError; + ~~~~~~~~~~~~~ +!!! Cannot find name 'NotEarlyError'. + var public = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.js b/tests/baselines/reference/parser10.1.1-8gs.js new file mode 100644 index 0000000000000..6c04bffc223b2 --- /dev/null +++ b/tests/baselines/reference/parser10.1.1-8gs.js @@ -0,0 +1,25 @@ +//// [parser10.1.1-8gs.ts] +/// Copyright (c) 2012 Ecma International. All rights reserved. +/// Ecma International makes this code available under the terms and conditions set +/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +/// "Use Terms"). Any redistribution of this code must retain the above +/// copyright and this notice and otherwise comply with the Use Terms. + +/** + * @path ch10/10.1/10.1.1/10.1.1-8gs.js + * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code + * @noStrict + * @negative ^((?!NotEarlyError).)*$ + */ + +"use strict"; +"use strict"; +throw NotEarlyError; +var public = 1; + + +//// [parser10.1.1-8gs.js] +"use strict"; +"use strict"; +throw NotEarlyError; +var public = 1; diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt new file mode 100644 index 0000000000000..694dc1ac57a49 --- /dev/null +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (1 errors) ==== + /// Copyright (c) 2012 Ecma International. All rights reserved. + /// Ecma International makes this code available under the terms and conditions set + /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the + /// "Use Terms"). Any redistribution of this code must retain the above + /// copyright and this notice and otherwise comply with the Use Terms. + /** + * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js + * @description Array.prototype.indexOf must return correct index (Number) + */ + + + function testcase() { + var obj = {toString:function (){return 0}}; + var one = 1; + var _float = -(4/3); + var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); + if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) + a.indexOf(0) === 7 && // a[7] = +0, 0===+0 + a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 + a.indexOf(1) === 10 ) // a[10] =one=== 1 + { + return true; + } + } + runTestCase(testcase); + ~~~~~~~~~~~ +!!! Cannot find name 'runTestCase'. + \ No newline at end of file diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.js b/tests/baselines/reference/parser15.4.4.14-9-2.js new file mode 100644 index 0000000000000..0b965e55ac04c --- /dev/null +++ b/tests/baselines/reference/parser15.4.4.14-9-2.js @@ -0,0 +1,41 @@ +//// [parser15.4.4.14-9-2.ts] +/// Copyright (c) 2012 Ecma International. All rights reserved. +/// Ecma International makes this code available under the terms and conditions set +/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +/// "Use Terms"). Any redistribution of this code must retain the above +/// copyright and this notice and otherwise comply with the Use Terms. +/** + * @path ch15/15.4/15.4.4/15.4.4.14/15.4.4.14-9-2.js + * @description Array.prototype.indexOf must return correct index (Number) + */ + + +function testcase() { + var obj = {toString:function (){return 0}}; + var one = 1; + var _float = -(4/3); + var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); + if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) + a.indexOf(0) === 7 && // a[7] = +0, 0===+0 + a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 + a.indexOf(1) === 10 ) // a[10] =one=== 1 + { + return true; + } + } +runTestCase(testcase); + + +//// [parser15.4.4.14-9-2.js] +function testcase() { + var obj = { toString: function () { + return 0; + } }; + var one = 1; + var _float = -(4 / 3); + var a = new Array(false, undefined, null, "0", obj, -1.3333333333333, "str", -0, true, +0, one, 1, 0, false, _float, -(4 / 3)); + if (a.indexOf(-(4 / 3)) === 14 && a.indexOf(0) === 7 && a.indexOf(-0) === 7 && a.indexOf(1) === 10) { + return true; + } +} +runTestCase(testcase); diff --git a/tests/baselines/reference/parser509534.errors.txt b/tests/baselines/reference/parser509534.errors.txt new file mode 100644 index 0000000000000..e40d485cb60de --- /dev/null +++ b/tests/baselines/reference/parser509534.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts (2 errors) ==== + "use strict"; + var config = require("../config"); + ~~~~~~~ +!!! Cannot find name 'require'. + module.exports.route = function (server) { + ~~~~~~ +!!! Cannot find name 'module'. + + // General Login Page + server.get(config.env.siteRoot + "/auth/login", function (req, res, next) { + + // TODO Should render login page that shows auth options + req.redirect("/auth/live"); + }); + } + \ No newline at end of file diff --git a/tests/baselines/reference/parser509534.js b/tests/baselines/reference/parser509534.js new file mode 100644 index 0000000000000..c066d5c089554 --- /dev/null +++ b/tests/baselines/reference/parser509534.js @@ -0,0 +1,22 @@ +//// [parser509534.ts] +"use strict"; +var config = require("../config"); +module.exports.route = function (server) { + + // General Login Page + server.get(config.env.siteRoot + "/auth/login", function (req, res, next) { + + // TODO Should render login page that shows auth options + req.redirect("/auth/live"); + }); +} + + +//// [parser509534.js] +"use strict"; +var config = require("../config"); +module.exports.route = function (server) { + server.get(config.env.siteRoot + "/auth/login", function (req, res, next) { + req.redirect("/auth/live"); + }); +}; diff --git a/tests/baselines/reference/parser509546.errors.txt b/tests/baselines/reference/parser509546.errors.txt new file mode 100644 index 0000000000000..6246327a3fa5f --- /dev/null +++ b/tests/baselines/reference/parser509546.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts (1 errors) ==== + export class Logger { + ~~~~~~~~~~~~~~~~~~~~~~ + public + ~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/parser509546.js b/tests/baselines/reference/parser509546.js new file mode 100644 index 0000000000000..5524a4d606f6c --- /dev/null +++ b/tests/baselines/reference/parser509546.js @@ -0,0 +1,13 @@ +//// [parser509546.ts] +export class Logger { + public +} + + +//// [parser509546.js] +var Logger = (function () { + function Logger() { + } + return Logger; +})(); +exports.Logger = Logger; diff --git a/tests/baselines/reference/parser509546_1.errors.txt b/tests/baselines/reference/parser509546_1.errors.txt new file mode 100644 index 0000000000000..7fd1229704fa7 --- /dev/null +++ b/tests/baselines/reference/parser509546_1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts (1 errors) ==== + export class Logger { + ~~~~~~~~~~~~~~~~~~~~~~ + public + ~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_1.js b/tests/baselines/reference/parser509546_1.js new file mode 100644 index 0000000000000..d0e32feb1cad8 --- /dev/null +++ b/tests/baselines/reference/parser509546_1.js @@ -0,0 +1,13 @@ +//// [parser509546_1.ts] +export class Logger { + public +} + + +//// [parser509546_1.js] +var Logger = (function () { + function Logger() { + } + return Logger; +})(); +exports.Logger = Logger; diff --git a/tests/baselines/reference/parser509546_2.errors.txt b/tests/baselines/reference/parser509546_2.errors.txt new file mode 100644 index 0000000000000..d97511abaad69 --- /dev/null +++ b/tests/baselines/reference/parser509546_2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts (1 errors) ==== + "use strict"; + + export class Logger { + ~~~~~~~~~~~~~~~~~~~~~~ + public + ~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/parser509546_2.js b/tests/baselines/reference/parser509546_2.js new file mode 100644 index 0000000000000..976bbd1e471d1 --- /dev/null +++ b/tests/baselines/reference/parser509546_2.js @@ -0,0 +1,16 @@ +//// [parser509546_2.ts] +"use strict"; + +export class Logger { + public +} + + +//// [parser509546_2.js] +"use strict"; +var Logger = (function () { + function Logger() { + } + return Logger; +})(); +exports.Logger = Logger; diff --git a/tests/baselines/reference/parser509618.errors.txt b/tests/baselines/reference/parser509618.errors.txt new file mode 100644 index 0000000000000..84ea778e0cae0 --- /dev/null +++ b/tests/baselines/reference/parser509618.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts (1 errors) ==== + declare module ambiModule { + interface i1 { }; + ~ +!!! Statements are not allowed in ambient contexts. + } + \ No newline at end of file diff --git a/tests/baselines/reference/parser509630.errors.txt b/tests/baselines/reference/parser509630.errors.txt new file mode 100644 index 0000000000000..72be30146de6f --- /dev/null +++ b/tests/baselines/reference/parser509630.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts (1 errors) ==== + class Type { + public examples = [ // typing here + } + ~ +!!! Expression or comma expected. + class Any extends Type { + } + \ No newline at end of file diff --git a/tests/baselines/reference/parser509667.errors.txt b/tests/baselines/reference/parser509667.errors.txt new file mode 100644 index 0000000000000..684616da4193a --- /dev/null +++ b/tests/baselines/reference/parser509667.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts (1 errors) ==== + class Foo { + f1() { + if (this. + } + ~ +!!! Identifier expected. + + f2() { + } + + f3() { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/parser509668.errors.txt b/tests/baselines/reference/parser509668.errors.txt new file mode 100644 index 0000000000000..36dc0523dd2ea --- /dev/null +++ b/tests/baselines/reference/parser509668.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 errors) ==== + class Foo3 { + // Doesn't work, but should + constructor (public ...args: string[]) { } + ~~~ +!!! ',' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/parser509669.errors.txt b/tests/baselines/reference/parser509669.errors.txt new file mode 100644 index 0000000000000..05ce0f609e3cd --- /dev/null +++ b/tests/baselines/reference/parser509669.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts (1 errors) ==== + function foo():any { + return ():void {}; + ~ +!!! '=>' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/parser509677.js b/tests/baselines/reference/parser509677.js new file mode 100644 index 0000000000000..791d9bab95ce0 --- /dev/null +++ b/tests/baselines/reference/parser509677.js @@ -0,0 +1,5 @@ +//// [parser509677.ts] +var n: { y: string }; + +//// [parser509677.js] +var n; diff --git a/tests/baselines/reference/parser509693.errors.txt b/tests/baselines/reference/parser509693.errors.txt new file mode 100644 index 0000000000000..dd1aa4b120fbd --- /dev/null +++ b/tests/baselines/reference/parser509693.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts (2 errors) ==== + if (!module.exports) module.exports = ""; + ~~~~~~ +!!! Cannot find name 'module'. + ~~~~~~ +!!! Cannot find name 'module'. \ No newline at end of file diff --git a/tests/baselines/reference/parser509693.js b/tests/baselines/reference/parser509693.js new file mode 100644 index 0000000000000..d7620bf98070e --- /dev/null +++ b/tests/baselines/reference/parser509693.js @@ -0,0 +1,6 @@ +//// [parser509693.ts] +if (!module.exports) module.exports = ""; + +//// [parser509693.js] +if (!module.exports) + module.exports = ""; diff --git a/tests/baselines/reference/parser509698.errors.txt b/tests/baselines/reference/parser509698.errors.txt new file mode 100644 index 0000000000000..ded1a87c9f33b --- /dev/null +++ b/tests/baselines/reference/parser509698.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts (0 errors) ==== + /// "); + + export interface BaselineOptions { + LineEndingSensitive?: boolean; + } + + function localPath(filename: string) { + if (global.runners[0].testType === 'prototyping') { + return Harness.userSpecifiedroot + 'tests/baselines/prototyping/local/' + filename; + } + else { + return Harness.userSpecifiedroot + 'tests/baselines/local/' + filename; + } + } + + function referencePath(filename: string) { + if (global.runners[0].testType === 'prototyping') { + return Harness.userSpecifiedroot + 'tests/baselines/prototyping/reference/' + filename; + } + else { + return Harness.userSpecifiedroot + 'tests/baselines/reference/' + filename; + } + } + + export function reset() { + if (IO.fileExists(reportFilename)) { + IO.deleteFile(reportFilename); + } + } + + function prepareBaselineReport(): string { + var reportContent = htmlLeader; + // Delete the baseline-report.html file if needed + if (IO.fileExists(reportFilename)) { + reportContent = IO.readFile(reportFilename); + reportContent = reportContent.replace(htmlTrailer, ''); + } else { + reportContent = htmlLeader; + } + return reportContent; + } + + function generateActual(actualFilename: string, generateContent: () => string): string { + // Create folders if needed + IO.createDirectory(IO.dirName(IO.dirName(actualFilename))); + IO.createDirectory(IO.dirName(actualFilename)); + + // Delete the actual file in case it fails + if (IO.fileExists(actualFilename)) { + IO.deleteFile(actualFilename); + } + + var actual = generateContent(); + + if (actual === undefined) { + throw new Error('The generated content was "undefined". Return "null" if no baselining is required."'); + } + + // Store the content in the 'local' folder so we + // can accept it later (manually) + if (actual !== null) { + IO.writeFile(actualFilename, actual); + } + + return actual; + } + + function compareToBaseline(actual: string, relativeFilename: string, opts: BaselineOptions) { + // actual is now either undefined (the generator had an error), null (no file requested), + // or some real output of the function + if (actual === undefined) { + // Nothing to do + return; + } + + var refFilename = referencePath(relativeFilename); + + if (actual === null) { + actual = ''; + } + + var expected = ''; + if (IO.fileExists(refFilename)) { + expected = IO.readFile(refFilename); + } + + var lineEndingSensitive = opts && opts.LineEndingSensitive; + + if (!lineEndingSensitive) { + expected = expected.replace(/\r\n?/g, '\n') + actual = actual.replace(/\r\n?/g, '\n') + } + + return { expected: expected, actual: actual }; + } + + function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { + if (expected != actual) { + // Overwrite & issue error + var errMsg = 'The baseline file ' + relativeFilename + ' has changed. Please refer to baseline-report.html and '; + errMsg += 'either fix the regression (if unintended) or run nmake baseline-accept (if intended).' + + var refFilename = referencePath(relativeFilename); + + // Append diff to the report + var diff = new Diff.StringDiff(expected, actual); + ~~~~ +!!! Cannot find name 'Diff'. + var header = '

' + descriptionForDescribe + '

'; + header += '

Left file: ' + actualFilename + '; Right file: ' + refFilename + '

'; + var trailer = '
'; + + var reportContentSoFar = prepareBaselineReport(); + reportContentSoFar = reportContentSoFar + header + '
' + diff.mergedHtml + '
' + trailer + htmlTrailer; + IO.writeFile(reportFilename, reportContentSoFar); + + throw new Error(errMsg); + } + } + + export function runBaseline( + descriptionForDescribe: string, + relativeFilename: string, + generateContent: () => string, + runImmediately? = false, + ~~~~~~~~~~~~~~ +!!! Parameter cannot have question mark and initializer. + opts?: BaselineOptions) { + + var actual = undefined; + var actualFilename = localPath(relativeFilename); + + if (runImmediately) { + var actual = generateActual(actualFilename, generateContent); + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + } else { + describe(descriptionForDescribe, () => { + var actual: string; + + it('Can generate the content without error', () => { + actual = generateActual(actualFilename, generateContent); + }); + + it('Matches the baseline file', () => { + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + }); + }); + } + } + } + + var currentRun = new Run(); + + global.describe = describe; + global.run = run; + global.it = it; + global.assert = Harness.Assert; + } + \ No newline at end of file diff --git a/tests/baselines/reference/parserindenter.errors.txt b/tests/baselines/reference/parserindenter.errors.txt new file mode 100644 index 0000000000000..6ae3710a4f262 --- /dev/null +++ b/tests/baselines/reference/parserindenter.errors.txt @@ -0,0 +1,998 @@ +==== tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts (128 errors) ==== + // + // Copyright (c) Microsoft Corporation. All rights reserved. + // + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // http://www.apache.org/licenses/LICENSE-2.0 + // + // Unless required by applicable law or agreed to in writing, software + // distributed under the License is distributed on an "AS IS" BASIS, + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + // See the License for the specific language governing permissions and + // limitations under the License. + // + + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! File 'formatting.ts' not found. + + + module Formatting { + export class Indenter implements ILineIndenationResolver { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'ILineIndenationResolver'. + + private indentationBag: IndentationBag; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationBag'. + private scriptBlockBeginLineNumber: number; + private offsetIndentationDeltas: Dictionary_int_int; + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Dictionary_int_int'. + + constructor( + public logger: TypeScript.ILogger, + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'TypeScript'. + public tree: ParseTree, + ~~~~~~~~~ +!!! Cannot find name 'ParseTree'. + public snapshot: ITextSnapshot, + ~~~~~~~~~~~~~ +!!! Cannot find name 'ITextSnapshot'. + public languageHostIndentation: string, + public editorOptions: Services.EditorOptions, + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Services'. + public firstToken: TokenSpan, + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + public smartIndent: boolean) { + + this.indentationBag = new IndentationBag(this.snapshot); + ~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationBag'. + this.scriptBlockBeginLineNumber = -1; + this.offsetIndentationDeltas = new Dictionary_int_int(); // text offset -> indentation delta + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Dictionary_int_int'. + + // by default the root (program) has zero indendation + this.tree.Root.SetIndentationOverride(""); + + this.ApplyScriptBlockIndentation(this.languageHostIndentation, this.tree); + this.FillInheritedIndentation(this.tree); + + } + + public GetIndentationEdits(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'List_TextEditInfo'. + if (this.logger.information()) { + this.logger.log("GetIndentationEdits(" + + "t1=[" + token.Span.startPosition() + "," + token.Span.endPosition()+ "], " + + "t2=[" + (nextToken == null ? "null" : (nextToken.Span.startPosition() + "," + nextToken.Span.endPosition())) + "]" + + ")"); + } + + var result = this.GetIndentationEditsWorker(token, nextToken, node, sameLineIndent); + + if (this.logger.information()) { + for (var i = 0; i < result.count() ; i++) { + var edit = result.get(i); + this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", text=\"" + TypeScript.stringToLiteral(edit.replaceWith, 30) + "\""); + ~~~~~~~~~~ +!!! Cannot find name 'TypeScript'. + } + } + + return result; + } + + public GetIndentationEditsWorker(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'List_TextEditInfo'. + var result = new List_TextEditInfo(); + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'List_TextEditInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + // This handles the case: + // return ( + // function() { + // }) + // The given function's node indicates that the function starts directly after "return (". + // In this case, we adjust the span to point to the function keyword. + // The same applies to objects and arrays. + // The reason this is done inside the Indenter is because it only affects indentation behavior. + // It's also done in ParseTree when we traverse up the tree because we don't have the + // tokens for nodes outside the span we are formatting. + this.AdjustStartOffsetIfNeeded(token, node); + + // Don't adjust indentation on the same line of a script block + if (this.scriptBlockBeginLineNumber == token.lineNumber()) { + return result; + } + + // Don't indent multi-line strings + if (!sameLineIndent && this.IsMultiLineString(token)) { + return result; + } + + // Special cases for the tokens that don't show up in the tree, such as curly braces and comments + indentationInfo = this.GetSpecialCaseIndentation(token, node); + if (indentationInfo == null) { + //// For anything else + + // Get the indentation level only from the node that starts on the same offset as the token + // otherwise the token is not meant to be indented + while (!node.CanIndent() && node.Parent != null && token.Span.span.start() == node.Parent.AuthorNode.Details.StartOffset) + node = node.Parent; + + if (node.CanIndent() && token.Span.span.start() == node.AuthorNode.Details.StartOffset) { + indentationInfo = node.GetEffectiveIndentation(this); + } + else { + //// Special cases for anything else that is not in the tree and should be indented + + // check for label (identifier followed by a colon) + if (token.Token == AuthorTokenKind.atkIdentifier && nextToken != null && nextToken.Token == AuthorTokenKind.atkColon) { + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + // This will make the label on the same level as the surrounding function/block + // ex: + // { + // statement; + // label: + // statement; + // } + indentationInfo = node.GetEffectiveChildrenIndentation(this); + } + else { + //// Move the token the same indentation-delta that moved its indentable parent + //// For example: + //// var a, + //// b; + //// The declaration 'b' would remain under 'a' even if 'var' got indented. + indentationInfo = this.ApplyIndentationDeltaFromParent(token, node); + } + } + } + + // Get the indent edit from the indentation info + if (indentationInfo != null) { + var edit = this.GetIndentEdit(indentationInfo, token.Span.startPosition(), sameLineIndent); + if (edit != null) { + this.RegisterIndentation(edit, sameLineIndent); + + result.add(edit); + + // multi-line comments, apply delta indentation to all the other lines + if (token.Token == AuthorTokenKind.atkComment) { + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + var commentEdits = this.GetCommentIndentationEdits(token); + commentEdits.foreach((item) => { + result.add(item); + }); + } + } + } + + return result; + } + + private GetCommentIndentationEdits(token: TokenSpan): List_TextEditInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'List_TextEditInfo'. + var result = new List_TextEditInfo(); + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'List_TextEditInfo'. + + if (token.Token != AuthorTokenKind.atkComment) + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + return result; + + var commentLastLineNumber = this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()); + if (token.lineNumber() == commentLastLineNumber) + return result; + + var commentFirstLineIndentationDelta = this.GetIndentationDelta(token.Span.startPosition(), null); + if (commentFirstLineIndentationDelta != undefined) { + for (var line = token.lineNumber() + 1; line <= commentLastLineNumber; line++) { + var lineStartPosition = this.snapshot.GetLineFromLineNumber(line).startPosition(); + var lineIndent = this.GetLineIndentationForOffset(lineStartPosition); + + var commentIndentationInfo = this.ApplyIndentationDelta2(lineIndent, commentFirstLineIndentationDelta); + if (commentIndentationInfo != null) { + var tokenStartPosition = lineStartPosition + lineIndent.length; + var commentIndentationEdit = this.GetIndentEdit(commentIndentationInfo, tokenStartPosition, false); + if (commentIndentationEdit != null) { + result.add(commentIndentationEdit); + } + } + } + } + + return result; + } + + static GetIndentSizeFromIndentText(indentText: string, editorOptions: Services.EditorOptions): number { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Services'. + return GetIndentSizeFromText(indentText, editorOptions, /*includeNonIndentChars:*/ false); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'GetIndentSizeFromText'. + } + + static GetIndentSizeFromText(text: string, editorOptions: Services.EditorOptions, includeNonIndentChars: boolean): number { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Services'. + var indentSize = 0; + + for (var i = 0; i < text.length; i++) { + var c = text.charAt(i); + + if (c == '\t') + indentSize = (indentSize + editorOptions.TabSize) - (indentSize % editorOptions.TabSize); + else if (c == ' ') + indentSize += 1; + else { + if (includeNonIndentChars) + indentSize += 1; + else + break; + } + } + + return indentSize; + } + + private GetSpecialCaseIndentation(token: TokenSpan, node: ParseNode): IndentationInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + switch (token.Token) { + case AuthorTokenKind.atkLCurly: // { is not part of the tree + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + indentationInfo = this.GetSpecialCaseIndentationForLCurly(node); + return indentationInfo; + + case AuthorTokenKind.atkElse: // else is not part of the tree + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + case AuthorTokenKind.atkRBrack: // ] is not part of the tree + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + + case AuthorTokenKind.atkRCurly: // } is not part of the tree + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + // if '}' is for a body-block, get indentation based on its parent. + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkBlock && node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneBody) + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeEdge'. + node = node.Parent; + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + + case AuthorTokenKind.atkWhile: // while (in do-while) is not part of the tree + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkDoWhile) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + } + + return null; + + case AuthorTokenKind.atkSColon: + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + return this.GetSpecialCaseIndentationForSemicolon(token, node); + + case AuthorTokenKind.atkComment: + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + return this.GetSpecialCaseIndentationForComment(token, node); + + default: + return indentationInfo; + } + } + + private GetSpecialCaseIndentationForLCurly(node: ParseNode): IndentationInfo { + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl || + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneThen || node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneElse) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeEdge'. + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeEdge'. + // flushed with the node (function & if) + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + } + else if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkObject && !node.CanIndent()) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + // if the open curly belongs to a non-indented object, do nothing here. + return null; + } + + // effective identation of the block + indentationInfo = node.GetEffectiveIndentation(this); + return indentationInfo; + } + + private GetSpecialCaseIndentationForSemicolon(token: TokenSpan, node: ParseNode): IndentationInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + if (this.smartIndent) { + indentationInfo = node.GetEffectiveChildrenIndentation(this); + return indentationInfo; + } + else { + // Indent all semicolons except the ones that belong to the for statement parts (initalizer, condition, itnrement) + if (node.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkFor) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + // The passed node is actually either the program or the list because semicolon doesn't belong + // to any statement in the tree, though the statement extends up to the semicolon position. + // To find the correct statement, we look for the adjacent node on the left of the semicolon. + var semiColonStartSpan = new Span(token.Span.startPosition(), 0); + ~~~~ +!!! Cannot find name 'Span'. + node = ParseTree.FindCommonParentNode(semiColonStartSpan, semiColonStartSpan, node); + ~~~~~~~~~ +!!! Cannot find name 'ParseTree'. + indentationInfo = node.GetEffectiveChildrenIndentation(this); + return indentationInfo; + } + } + + return null; + } + + private GetSpecialCaseIndentationForComment(token: TokenSpan, node: ParseNode): IndentationInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + // Only indent line comment and the first line of block comment + var twoCharSpan = token.Span.Intersection(new Span(token.Span.startPosition(), 2)); + ~~~~ +!!! Cannot find name 'Span'. + if (twoCharSpan != null && (twoCharSpan.GetText() == "//" || twoCharSpan.GetText() == "/*")) { + while (node.ChildrenIndentationDelta == null && node.Parent != null) + node = node.Parent; + + if (this.CanIndentComment(token, node)) { + indentationInfo = node.GetEffectiveChildrenIndentationForComment(this); + } + else { + indentationInfo = this.ApplyIndentationDeltaFromParent(token, node); + } + } + + return indentationInfo; + } + + private CanIndentComment(token: TokenSpan, node: ParseNode): boolean { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + switch (node.AuthorNode.Details.Kind) { + case AuthorParseNodeKind.apnkProg: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkBlock: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkSwitch: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkCase: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkDefaultCase: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkIf: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkFor: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkForIn: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkWhile: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkWith: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkDoWhile: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + case AuthorParseNodeKind.apnkObject: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + return true; + + case AuthorParseNodeKind.apnkFncDecl: + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + // Comments before arguments are not indented. + // This code doesn't cover the cases of comment after the last argument or + // when there are no arguments. Though this is okay since the only case we care about is: + // function foo(/* test */ a, + // /* test */ b) + var result = true; + var children = ParseNodeExtensions.FindChildrenWithEdge(node, AuthorParseNodeEdge.apneArgument); + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'ParseNodeExtensions'. + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeEdge'. + children.foreach((argumentNode) => { + if (token.Span.startPosition() < argumentNode.AuthorNode.Details.StartOffset) + result = false; + }); + + return result; + } + + return false; + } + + private ApplyScriptBlockIndentation(languageHostIndentation: string, tree: ParseTree): void + ~~~~~~~~~ +!!! Cannot find name 'ParseTree'. + { + if (languageHostIndentation == null || tree.StartNodeSelf == null) + return; + + var scriptBlockIndentation = this.ApplyIndentationLevel(languageHostIndentation, 1); + + //TypeScript: Projection snapshots not supported + + // Disconnect the sibling node if it belongs to a different script block + //IProjectionSnapshot projectionSnapshot = this.snapshot as IProjectionSnapshot; + //if (projectionSnapshot != null) + //{ + // // Get script block spans. + // foreach (SnapshotSpan sourceSpan in projectionSnapshot.GetSourceSpans()) + // { + // // Map the spans to the JavaScript buffer. + // ReadOnlyCollection spans = projectionSnapshot.MapFromSourceSnapshot(sourceSpan); + + // Debug.Assert(spans.Count == 1, string.Format(CultureInfo.InvariantCulture, "Unexpected span count of {0}.", spans.Count)); + + // if (spans.Count > 0) + // { + // Span span = spans.First(); + + // // If the "self" node is the first root-level node in a script block, then remove the start node. + // if (span.Contains(tree.StartNodethis.AuthorNode.Details.StartOffset)) + // { + // this.scriptBlockBeginLineNumber = projectionSnapshot.GetLineNumberFromPosition(span.Start); + + // if (tree.StartNodePreviousSibling.HasValue) + // { + // int siblingStartOffset = tree.StartNodePreviousSibling.Value.Details.StartOffset; + + // // Don't consider sibling in these cases: + // // 1. The sibling belongs to another script block + // // 2. The sibling is on the same line of the script block + // if (!span.Contains(siblingStartOffset) || projectionSnapshot.GetLineNumberFromPosition(siblingStartOffset) == this.scriptBlockBeginLineNumber) + // { + // tree.StartNodePreviousSibling = null; + // } + // } + + // break; + // } + // } + // } + //} + + // The root is the program. + tree.Root.SetIndentationOverride(scriptBlockIndentation); + } + + private GetIndentEdit(indentInfo: IndentationInfo, tokenStartPosition: number, sameLineIndent: boolean): TextEditInfo { + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + ~~~~~~~~~~~~ +!!! Cannot find name 'TextEditInfo'. + var indentText = this.ApplyIndentationLevel(indentInfo.Prefix, indentInfo.Level); + + if (sameLineIndent) { + return new TextEditInfo(tokenStartPosition, 0, indentText); + ~~~~~~~~~~~~ +!!! Cannot find name 'TextEditInfo'. + } + else { + var snapshotLine = this.snapshot.GetLineFromPosition(tokenStartPosition); + var currentIndentSpan = new Span(snapshotLine.startPosition(), tokenStartPosition - snapshotLine.startPosition()); + ~~~~ +!!! Cannot find name 'Span'. + var currentIndentText = this.snapshot.GetText(currentIndentSpan); + + if (currentIndentText !== indentText) { + if (this.logger.debug()) { + // Verify that currentIndentText is all whitespaces + for (var i = 0, len = currentIndentText.length; i < len; i++) { + var c = currentIndentText.charCodeAt(i); + if (!StringUtils.IsWhiteSpace(c)) { + ~~~~~~~~~~~ +!!! Cannot find name 'StringUtils'. + Debug.Fail("Formatting error: Will remove user code when indenting the line: " + snapshotLine.getText()); + ~~~~~ +!!! Cannot find name 'Debug'. + break; + } + } + } + return new TextEditInfo(currentIndentSpan.start(), currentIndentSpan.length(), indentText); + ~~~~~~~~~~~~ +!!! Cannot find name 'TextEditInfo'. + } + } + + return null; + } + + private ApplyIndentationLevel(existingIndentation: string, level: number): string { + var indentSize = this.editorOptions.IndentSize; + var tabSize = this.editorOptions.TabSize; + var convertTabsToSpaces = this.editorOptions.ConvertTabsToSpaces; + + if (level < 0) { + if (StringUtils.IsNullOrEmpty(existingIndentation)) + ~~~~~~~~~~~ +!!! Cannot find name 'StringUtils'. + return ""; + + var totalIndent = 0; + StringUtils.foreach(existingIndentation, (c) => { + ~~~~~~~~~~~ +!!! Cannot find name 'StringUtils'. + if (c == '\t') + totalIndent += tabSize; + else + totalIndent++; + }); + + totalIndent += level * indentSize; + if (totalIndent < 0) + return ""; + else + return this.GetIndentString(null, totalIndent, tabSize, convertTabsToSpaces); + } + + var totalIndentSize = level * indentSize; + return this.GetIndentString(existingIndentation, totalIndentSize, tabSize, convertTabsToSpaces); + } + + private GetIndentString(prefix: string, totalIndentSize: number, tabSize: number, convertTabsToSpaces: boolean): string { + var tabString = convertTabsToSpaces ? StringUtils.create(' ', tabSize) : "\t"; + ~~~~~~~~~~~ +!!! Cannot find name 'StringUtils'. + + var text = ""; + if (!StringUtils.IsNullOrEmpty(prefix)) + ~~~~~~~~~~~ +!!! Cannot find name 'StringUtils'. + text += prefix; + + var pos = 0; + + // fill first with tabs + while (pos <= totalIndentSize - tabSize) { + text += tabString; + pos += tabSize; + } + + // fill the reminder with spaces + while (pos < totalIndentSize) { + text += ' '; + pos++; + } + + return text; + } + + private ApplyIndentationDeltaFromParent(token: TokenSpan, node: ParseNode): IndentationInfo { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + var indentationInfo: IndentationInfo = null; + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + + var indentableParent = node; + while (indentableParent != null && !indentableParent.CanIndent()) + indentableParent = indentableParent.Parent; + + if (indentableParent != null && indentableParent.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkProg) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + var parentIndentationDeltaSize = this.GetIndentationDelta(indentableParent.AuthorNode.Details.StartOffset, token.Span.startPosition()); + if (parentIndentationDeltaSize !== undefined) { + indentationInfo = this.ApplyIndentationDelta1(token.Span.startPosition(), parentIndentationDeltaSize); + } + } + + return indentationInfo; + } + + private ApplyIndentationDelta1(tokenStartPosition: number, delta: number): IndentationInfo { + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + // Get current indentation + var snapshotLine = this.snapshot.GetLineFromPosition(tokenStartPosition); + var currentIndentSpan = new Span(snapshotLine.startPosition(), tokenStartPosition - snapshotLine.startPosition()); + ~~~~ +!!! Cannot find name 'Span'. + var currentIndent = this.snapshot.GetText(currentIndentSpan); + + // Calculate new indentation from current-indentation and delta + return this.ApplyIndentationDelta2(currentIndent, delta); + } + + private ApplyIndentationDelta2(currentIndent: string, delta: number): IndentationInfo { + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + if (delta == 0) + return null; + + var currentIndentSize = Indenter.GetIndentSizeFromIndentText(currentIndent, this.editorOptions); + + var newIndentSize = currentIndentSize + delta; + if (newIndentSize < 0) { + newIndentSize = 0; + } + + var newIndent = this.GetIndentString(null, newIndentSize, this.editorOptions.TabSize, this.editorOptions.ConvertTabsToSpaces); + if (newIndent != null) { + return new IndentationInfo(newIndent, 0); + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationInfo'. + } + + return null; + } + + private GetIndentationDelta(tokenStartPosition: number, childTokenStartPosition: number/*?*/): number/*?*/ { + Debug.Assert(childTokenStartPosition !== undefined, "Error: caller must pass 'null' for undefined position"); + ~~~~~ +!!! Cannot find name 'Debug'. + + var indentationDeltaSize = this.offsetIndentationDeltas.GetValue(tokenStartPosition); + if (indentationDeltaSize === null) { + var indentEditInfo = this.indentationBag.FindIndent(tokenStartPosition); + + // No recorded indentation, return null + if (indentEditInfo == null) + return null; + + var origIndentText = this.snapshot.GetText(new Span(indentEditInfo.OrigIndentPosition, indentEditInfo.OrigIndentLength())); + ~~~~ +!!! Cannot find name 'Span'. + var newIndentText = indentEditInfo.Indentation(); + + var origIndentSize = Indenter.GetIndentSizeFromText(origIndentText, this.editorOptions, /*includeNonIndentChars*/true); + var newIndentSize = Indenter.GetIndentSizeFromIndentText(newIndentText, this.editorOptions); + + // Check the child's position whether it's before the parent position + // if so indent the child based on the first token on the line as opposed to the parent position + // + // Example of relative to parent (not line), relative indentation should be "4 (newIndentSize) - 9 (indentSize up to for) = -5" + // + // if (1) { for (i = 0; i < 10; => if (1) { + // i++) { for (i = 0; i < 10; + // i++) { + // + // Example of relative to line, relative indentation should be "4 (newIndentSize) - 0 (indentSize up to if) = 4" + // + // if (1) { for (i = 0; i < 10; => if (1) { + // i++) { for (i = 0; i < 10; + // i++) { + if (childTokenStartPosition !== null) { + var childTokenLineStartPosition = this.snapshot.GetLineFromPosition(childTokenStartPosition).startPosition(); + var childIndentText = this.snapshot.GetText(new Span(childTokenLineStartPosition, childTokenStartPosition - childTokenLineStartPosition)); + ~~~~ +!!! Cannot find name 'Span'. + + var childIndentSize = Indenter.GetIndentSizeFromIndentText(childIndentText, this.editorOptions); + + if (childIndentSize < origIndentSize) + origIndentSize = Indenter.GetIndentSizeFromIndentText(origIndentText, this.editorOptions); + } + + indentationDeltaSize = newIndentSize - origIndentSize; + this.offsetIndentationDeltas.Add(tokenStartPosition, indentationDeltaSize); + } + + return indentationDeltaSize; + } + + private FillInheritedIndentation(tree: ParseTree): void + ~~~~~~~~~ +!!! Cannot find name 'ParseTree'. + { + var offset = -1; + var indentNode: ParseNode = null; + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + + if (tree.StartNodeSelf != null) { + if (!this.smartIndent && tree.StartNodePreviousSibling !== null && tree.StartNodeSelf.AuthorNode.Label == 0 && tree.StartNodePreviousSibling.Label == 0) { + indentNode = tree.StartNodeSelf; + offset = tree.StartNodePreviousSibling.Details.StartOffset; + + // In case the sibling node is on the same line of a parent node, ex: + // case 1: a++; + // break; + // In this example, the sibling of break is a++ but a++ is on the same line of its parent. + var lineNum = this.snapshot.GetLineNumberFromPosition(offset); + var node = indentNode; + while (node.Parent != null && this.snapshot.GetLineNumberFromPosition(node.Parent.AuthorNode.Details.StartOffset) == lineNum) { + node = node.Parent; + if (node.CanIndent()) { + indentNode = node; + indentNode.IndentationDelta = 0; + } + } + } + else { + var parent: ParseNode; + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + + // Otherwise base on parent indentation. + if (this.smartIndent) { + // in smartIndent the self node is the parent node since it's the closest node to the new line + // ... unless in case if the startNodeSelf represents the firstToken then we need to choose its parent + parent = tree.StartNodeSelf; + while (parent != null && parent.AuthorNode.Details.StartOffset == this.firstToken.Span.startPosition()) + parent = parent.Parent; + } + else { + // Get the parent that is really on a different line from the self node + var startNodeLineNumber = this.snapshot.GetLineNumberFromPosition(tree.StartNodeSelf.AuthorNode.Details.StartOffset); + parent = tree.StartNodeSelf.Parent; + while (parent != null && + startNodeLineNumber == this.snapshot.GetLineNumberFromPosition(parent.AuthorNode.Details.StartOffset)) { + parent = parent.Parent; + } + } + + // The parent node to take its indentation is the first parent that has indentation. + while (parent != null && !parent.CanIndent()) { + parent = parent.Parent; + } + + // Skip Program since it has no indentation + if (parent != null && parent.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkProg) { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + offset = parent.AuthorNode.Details.StartOffset; + indentNode = parent; + } + } + } + + if (indentNode != null) { + var indentOverride = this.GetLineIndentationForOffset(offset); + + // Set the indentation on all the siblings to be the same as indentNode + if (!this.smartIndent && tree.StartNodePreviousSibling !== null && indentNode.Parent != null) { + ParseNodeExtensions.GetChildren(indentNode.Parent).foreach((sibling) => { + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'ParseNodeExtensions'. + if (sibling !== indentNode) { + if (sibling.CanIndent()) + sibling.SetIndentationOverride(indentOverride); + } + }); + } + + // Set the indent override string on the indent node and on every parent (on different line) after adjusting the indent by the negative delta + var lastDelta = 0; + var lastLine = this.snapshot.GetLineNumberFromPosition(indentNode.AuthorNode.Details.StartOffset); + do { + var currentLine = this.snapshot.GetLineNumberFromPosition(indentNode.AuthorNode.Details.StartOffset); + if (lastLine != currentLine) { + lastLine = currentLine; + indentOverride = this.ApplyIndentationLevel(indentOverride, -lastDelta); + lastDelta = 0; + } + + if (indentNode.CanIndent()) { + indentNode.SetIndentationOverride(indentOverride); + lastDelta = indentNode.IndentationDelta; + } + + indentNode = indentNode.Parent; + } + while (indentNode != null); + } + } + + public GetLineIndentationForOffset(offset: number): string { + var indentationEdit: IndentationEditInfo; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationEditInfo'. + + // First check if we already have indentation info in our indentation bag + indentationEdit = this.indentationBag.FindIndent(offset); + if (indentationEdit != null) { + return indentationEdit.Indentation(); + } + else { + // Otherwise, use the indentation from the textBuffer + var line = this.snapshot.GetLineFromPosition(offset); + var lineText = line.getText(); + var index = 0; + + while (index < lineText.length && (lineText.charAt(index) == ' ' || lineText.charAt(index) == '\t')) { + ++index; + } + + return lineText.substr(0, index); + } + } + + private RegisterIndentation(indent: TextEditInfo, sameLineIndent: boolean): void + ~~~~~~~~~~~~ +!!! Cannot find name 'TextEditInfo'. + { + var indentationInfo: IndentationEditInfo = null; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationEditInfo'. + + if (sameLineIndent) { + // Consider the original indentation from the beginning of the line up to the indent position (or really the token position) + var lineStartPosition = this.snapshot.GetLineFromPosition(indent.Position).startPosition(); + var lineIndentLength = indent.Position - lineStartPosition; + + indentationInfo = IndentationEditInfo.create2(indent.Position, indent.ReplaceWith, lineStartPosition, lineIndentLength); + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationEditInfo'. + } + else { + indentationInfo = new IndentationEditInfo(indent); + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'IndentationEditInfo'. + } + + this.indentationBag.AddIndent(indentationInfo); + } + + public RegisterIndentation2(position: number, indent: string): void + { + this.RegisterIndentation(new TextEditInfo(position, 0, indent), false); + ~~~~~~~~~~~~ +!!! Cannot find name 'TextEditInfo'. + } + + private AdjustStartOffsetIfNeeded(token: TokenSpan, node: ParseNode): void + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + ~~~~~~~~~ +!!! Cannot find name 'ParseNode'. + { + if (token == null) + return; + + var updateStartOffset = false; + + switch (token.Token) { + case AuthorTokenKind.atkFunction: + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + break; + + case AuthorTokenKind.atkLCurly: + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkObject; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + break; + + case AuthorTokenKind.atkLBrack: + ~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorTokenKind'. + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkArray; + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'AuthorParseNodeKind'. + break; + } + + if (updateStartOffset) { + ParseNodeExtensions.SetNodeSpan(node, token.Span.startPosition(), node.AuthorNode.Details.EndOffset); + ~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'ParseNodeExtensions'. + } + } + + private IsMultiLineString(token: TokenSpan): boolean { + ~~~~~~~~~ +!!! Cannot find name 'TokenSpan'. + return token.tokenID === TypeScript.TokenID.StringLiteral && + ~~~~~~~~~~ +!!! Cannot find name 'TypeScript'. + this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()) > this.snapshot.GetLineNumberFromPosition(token.Span.startPosition()); + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/parservoidInQualifiedName0.js b/tests/baselines/reference/parservoidInQualifiedName0.js new file mode 100644 index 0000000000000..f586cfcd96e27 --- /dev/null +++ b/tests/baselines/reference/parservoidInQualifiedName0.js @@ -0,0 +1,5 @@ +//// [parservoidInQualifiedName0.ts] +var v : void; + +//// [parservoidInQualifiedName0.js] +var v; diff --git a/tests/baselines/reference/parservoidInQualifiedName1.errors.txt b/tests/baselines/reference/parservoidInQualifiedName1.errors.txt new file mode 100644 index 0000000000000..70e29fc904fb7 --- /dev/null +++ b/tests/baselines/reference/parservoidInQualifiedName1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName1.ts (2 errors) ==== + var v : void.x; + ~~~~ +!!! Identifier expected. + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parservoidInQualifiedName2.errors.txt b/tests/baselines/reference/parservoidInQualifiedName2.errors.txt new file mode 100644 index 0000000000000..146f792b64de4 --- /dev/null +++ b/tests/baselines/reference/parservoidInQualifiedName2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/conformance/parser/ecmascript5/parservoidInQualifiedName2.ts (3 errors) ==== + var v : x.void; + ~~~~ +!!! Identifier expected. + ~ +!!! Expression expected. + ~~ +!!! Cannot find name 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/partiallyAmbientClodule.js b/tests/baselines/reference/partiallyAmbientClodule.js new file mode 100644 index 0000000000000..d7182e73e091d --- /dev/null +++ b/tests/baselines/reference/partiallyAmbientClodule.js @@ -0,0 +1,12 @@ +//// [partiallyAmbientClodule.ts] +declare module foo { + export function x(): any; +} +class foo { } // Legal, because module is ambient + +//// [partiallyAmbientClodule.js] +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/partiallyAmbientFundule.js b/tests/baselines/reference/partiallyAmbientFundule.js new file mode 100644 index 0000000000000..e4712fbe730b8 --- /dev/null +++ b/tests/baselines/reference/partiallyAmbientFundule.js @@ -0,0 +1,9 @@ +//// [partiallyAmbientFundule.ts] +declare module foo { + export function x(): any; +} +function foo () { } // Legal, because module is ambient + +//// [partiallyAmbientFundule.js] +function foo() { +} diff --git a/tests/baselines/reference/plusOperatorInvalidOperations.errors.txt b/tests/baselines/reference/plusOperatorInvalidOperations.errors.txt new file mode 100644 index 0000000000000..0f92d05cd642b --- /dev/null +++ b/tests/baselines/reference/plusOperatorInvalidOperations.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorInvalidOperations.ts (2 errors) ==== + // Unary operator + + var b; + + // operand before + + var result1 = b+; //expect error + ~ +!!! Expression expected. + + // miss an operand + var result2 =+; + ~ +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..b0339cef559ea --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,63 @@ +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (3 errors) ==== + // + operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {} + var obj1 = { x: (s: string) => { }, y: (s1) => { }}; + + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any other type var + var ResultIsNumber1 = +ANY1; + var ResultIsNumber2 = +ANY2; + var ResultIsNumber3 = +A; + var ResultIsNumber4 = +M; + var ResultIsNumber5 = +obj; + var ResultIsNumber6 = +obj1; + + // any type literal + var ResultIsNumber7 = +undefined; + var ResultIsNumber8 = +null; + + // any type expressions + var ResultIsNumber9 = +ANY2[0]; + var ResultIsNumber10 = +obj1.x; + var ResultIsNumber11 = +obj1.y; + var ResultIsNumber12 = +objA.a; + var ResultIsNumber13 = +M.n; + var ResultIsNumber14 = +foo(); + var ResultIsNumber15 = +A.foo(); + var ResultIsNumber16 = +(ANY + ANY1); + var ResultIsNumber17 = +(null + undefined); + ~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + var ResultIsNumber18 = +(null + null); + ~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'null' and 'null'. + var ResultIsNumber19 = +(undefined + undefined); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Operator '+' cannot be applied to types 'undefined' and 'undefined'. + + // miss assignment operators + +ANY; + +ANY1; + +ANY2[0]; + +ANY, ANY1; + +objA.a; + +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.js b/tests/baselines/reference/plusOperatorWithAnyOtherType.js new file mode 100644 index 0000000000000..394c635aedfb5 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.js @@ -0,0 +1,109 @@ +//// [plusOperatorWithAnyOtherType.ts] +// + operator on any type + +var ANY: any; +var ANY1; +var ANY2: any[] = ["", ""]; +var obj: () => {} +var obj1 = { x: (s: string) => { }, y: (s1) => { }}; + +function foo(): any { + var a; + return a; +} +class A { + public a: any; + static foo() { + var a; + return a; + } +} +module M { + export var n: any; +} +var objA = new A(); + +// any other type var +var ResultIsNumber1 = +ANY1; +var ResultIsNumber2 = +ANY2; +var ResultIsNumber3 = +A; +var ResultIsNumber4 = +M; +var ResultIsNumber5 = +obj; +var ResultIsNumber6 = +obj1; + +// any type literal +var ResultIsNumber7 = +undefined; +var ResultIsNumber8 = +null; + +// any type expressions +var ResultIsNumber9 = +ANY2[0]; +var ResultIsNumber10 = +obj1.x; +var ResultIsNumber11 = +obj1.y; +var ResultIsNumber12 = +objA.a; +var ResultIsNumber13 = +M.n; +var ResultIsNumber14 = +foo(); +var ResultIsNumber15 = +A.foo(); +var ResultIsNumber16 = +(ANY + ANY1); +var ResultIsNumber17 = +(null + undefined); +var ResultIsNumber18 = +(null + null); +var ResultIsNumber19 = +(undefined + undefined); + +// miss assignment operators ++ANY; ++ANY1; ++ANY2[0]; ++ANY, ANY1; ++objA.a; ++M.n; + +//// [plusOperatorWithAnyOtherType.js] +var ANY; +var ANY1; +var ANY2 = ["", ""]; +var obj; +var obj1 = { x: function (s) { +}, y: function (s1) { +} }; +function foo() { + var a; + return a; +} +var A = (function () { + function A() { + } + A.foo = function () { + var a; + return a; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = +ANY1; +var ResultIsNumber2 = +ANY2; +var ResultIsNumber3 = +A; +var ResultIsNumber4 = +M; +var ResultIsNumber5 = +obj; +var ResultIsNumber6 = +obj1; +var ResultIsNumber7 = +undefined; +var ResultIsNumber8 = +null; +var ResultIsNumber9 = +ANY2[0]; +var ResultIsNumber10 = +obj1.x; +var ResultIsNumber11 = +obj1.y; +var ResultIsNumber12 = +objA.a; +var ResultIsNumber13 = +M.n; +var ResultIsNumber14 = +foo(); +var ResultIsNumber15 = +A.foo(); +var ResultIsNumber16 = +(ANY + ANY1); +var ResultIsNumber17 = +(null + undefined); +var ResultIsNumber18 = +(null + null); +var ResultIsNumber19 = +(undefined + undefined); ++ANY; ++ANY1; ++ANY2[0]; ++ANY, ANY1; ++objA.a; ++M.n; diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.js b/tests/baselines/reference/plusOperatorWithBooleanType.js new file mode 100644 index 0000000000000..1d5d2ae1958c8 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithBooleanType.js @@ -0,0 +1,68 @@ +//// [plusOperatorWithBooleanType.ts] +// + operator on boolean type +var BOOLEAN: boolean; + +function foo(): boolean { return true; } + +class A { + public a: boolean; + static foo() { return false; } +} +module M { + export var n: boolean; +} + +var objA = new A(); + +// boolean type var +var ResultIsNumber1 = +BOOLEAN; + +// boolean type literal +var ResultIsNumber2 = +true; +var ResultIsNumber3 = +{ x: true, y: false }; + +// boolean type expressions +var ResultIsNumber4 = +objA.a; +var ResultIsNumber5 = +M.n; +var ResultIsNumber6 = +foo(); +var ResultIsNumber7 = +A.foo(); + +// miss assignment operators ++true; ++BOOLEAN; ++foo(); ++true, false; ++objA.a; ++M.n; + +//// [plusOperatorWithBooleanType.js] +var BOOLEAN; +function foo() { + return true; +} +var A = (function () { + function A() { + } + A.foo = function () { + return false; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = +BOOLEAN; +var ResultIsNumber2 = +true; +var ResultIsNumber3 = +{ x: true, y: false }; +var ResultIsNumber4 = +objA.a; +var ResultIsNumber5 = +M.n; +var ResultIsNumber6 = +foo(); +var ResultIsNumber7 = +A.foo(); ++true; ++BOOLEAN; ++foo(); ++true, false; ++objA.a; ++M.n; diff --git a/tests/baselines/reference/plusOperatorWithEnumType.js b/tests/baselines/reference/plusOperatorWithEnumType.js new file mode 100644 index 0000000000000..a2897f644bbf7 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithEnumType.js @@ -0,0 +1,40 @@ +//// [plusOperatorWithEnumType.ts] +// + operator on enum type + +enum ENUM { }; +enum ENUM1 { 1, 2, "" }; + +// enum type var +var ResultIsNumber1 = +ENUM; +var ResultIsNumber2 = +ENUM1; + +// enum type expressions +var ResultIsNumber3 = +ENUM1[0]; +var ResultIsNumber4 = +(ENUM[0] + ENUM1[1]); + +// miss assignment operators ++ENUM; ++ENUM1; ++ENUM1[1]; ++ENUM, ENUM1; + +//// [plusOperatorWithEnumType.js] +var ENUM; +(function (ENUM) { +})(ENUM || (ENUM = {})); +; +var ENUM1; +(function (ENUM1) { + ENUM1[ENUM1["1"] = 0] = "1"; + ENUM1[ENUM1["2"] = 1] = "2"; + ENUM1[ENUM1[""] = 2] = ""; +})(ENUM1 || (ENUM1 = {})); +; +var ResultIsNumber1 = +ENUM; +var ResultIsNumber2 = +ENUM1; +var ResultIsNumber3 = +ENUM1[0]; +var ResultIsNumber4 = +(ENUM[0] + ENUM1[1]); ++ENUM; ++ENUM1; ++ENUM1[1]; ++ENUM, ENUM1; diff --git a/tests/baselines/reference/plusOperatorWithNumberType.js b/tests/baselines/reference/plusOperatorWithNumberType.js new file mode 100644 index 0000000000000..9d89d8a94fc1f --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithNumberType.js @@ -0,0 +1,82 @@ +//// [plusOperatorWithNumberType.ts] +// + operator on number type +var NUMBER: number; +var NUMBER1: number[] = [1, 2]; + +function foo(): number { return 1; } + +class A { + public a: number; + static foo() { return 1; } +} +module M { + export var n: number; +} + +var objA = new A(); + +// number type var +var ResultIsNumber1 = +NUMBER; +var ResultIsNumber2 = +NUMBER1; + +// number type literal +var ResultIsNumber3 = +1; +var ResultIsNumber4 = +{ x: 1, y: 2}; +var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } }; + +// number type expressions +var ResultIsNumber6 = +objA.a; +var ResultIsNumber7 = +M.n; +var ResultIsNumber8 = +NUMBER1[0]; +var ResultIsNumber9 = +foo(); +var ResultIsNumber10 = +A.foo(); +var ResultIsNumber11 = +(NUMBER + NUMBER); + +// miss assignment operators ++1; ++NUMBER; ++NUMBER1; ++foo(); ++objA.a; ++M.n; ++objA.a, M.n; + +//// [plusOperatorWithNumberType.js] +var NUMBER; +var NUMBER1 = [1, 2]; +function foo() { + return 1; +} +var A = (function () { + function A() { + } + A.foo = function () { + return 1; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = +NUMBER; +var ResultIsNumber2 = +NUMBER1; +var ResultIsNumber3 = +1; +var ResultIsNumber4 = +{ x: 1, y: 2 }; +var ResultIsNumber5 = +{ x: 1, y: function (n) { + return n; +} }; +var ResultIsNumber6 = +objA.a; +var ResultIsNumber7 = +M.n; +var ResultIsNumber8 = +NUMBER1[0]; +var ResultIsNumber9 = +foo(); +var ResultIsNumber10 = +A.foo(); +var ResultIsNumber11 = +(NUMBER + NUMBER); ++1; ++NUMBER; ++NUMBER1; ++foo(); ++objA.a; ++M.n; ++objA.a, M.n; diff --git a/tests/baselines/reference/plusOperatorWithStringType.js b/tests/baselines/reference/plusOperatorWithStringType.js new file mode 100644 index 0000000000000..d7cd25005b767 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithStringType.js @@ -0,0 +1,80 @@ +//// [plusOperatorWithStringType.ts] +// + operator on string type +var STRING: string; +var STRING1: string[] = ["", "abc"]; + +function foo(): string { return "abc"; } + +class A { + public a: string; + static foo() { return ""; } +} +module M { + export var n: string; +} + +var objA = new A(); + +// string type var +var ResultIsNumber1 = +STRING; +var ResultIsNumber2 = +STRING1; + +// string type literal +var ResultIsNumber3 = +""; +var ResultIsNumber4 = +{ x: "", y: "" }; +var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } }; + +// string type expressions +var ResultIsNumber6 = +objA.a; +var ResultIsNumber7 = +M.n; +var ResultIsNumber8 = +STRING1[0]; +var ResultIsNumber9 = +foo(); +var ResultIsNumber10 = +A.foo(); +var ResultIsNumber11 = +(STRING + STRING); +var ResultIsNumber12 = +STRING.charAt(0); + +// miss assignment operators ++""; ++STRING; ++STRING1; ++foo(); ++objA.a,M.n; + +//// [plusOperatorWithStringType.js] +var STRING; +var STRING1 = ["", "abc"]; +function foo() { + return "abc"; +} +var A = (function () { + function A() { + } + A.foo = function () { + return ""; + }; + return A; +})(); +var M; +(function (M) { + M.n; +})(M || (M = {})); +var objA = new A(); +var ResultIsNumber1 = +STRING; +var ResultIsNumber2 = +STRING1; +var ResultIsNumber3 = +""; +var ResultIsNumber4 = +{ x: "", y: "" }; +var ResultIsNumber5 = +{ x: "", y: function (s) { + return s; +} }; +var ResultIsNumber6 = +objA.a; +var ResultIsNumber7 = +M.n; +var ResultIsNumber8 = +STRING1[0]; +var ResultIsNumber9 = +foo(); +var ResultIsNumber10 = +A.foo(); +var ResultIsNumber11 = +(STRING + STRING); +var ResultIsNumber12 = +STRING.charAt(0); ++""; ++STRING; ++STRING1; ++foo(); ++objA.a, M.n; diff --git a/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.js b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.js new file mode 100644 index 0000000000000..719dceb3423fc --- /dev/null +++ b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.js @@ -0,0 +1,11 @@ +//// [prefixIncrementAsOperandOfPlusExpression.ts] +var x = 1; +var y = 1; ++ ++x; ++ ++y; + +//// [prefixIncrementAsOperandOfPlusExpression.js] +var x = 1; +var y = 1; ++ ++x; ++ ++y; diff --git a/tests/baselines/reference/prespecializedGenericMembers1.js b/tests/baselines/reference/prespecializedGenericMembers1.js new file mode 100644 index 0000000000000..26edee4e3f7da --- /dev/null +++ b/tests/baselines/reference/prespecializedGenericMembers1.js @@ -0,0 +1,40 @@ +//// [prespecializedGenericMembers1.ts] +export interface IKitty { + + } + +export class Cat { + constructor() { + + } +} + +export class CatBag { + constructor(cats: { barry: Cat; }) { + + } +} +var cat = new Cat(); +var catThing = { + barry: cat +}; +var catBag = new CatBag(catThing); + +//// [prespecializedGenericMembers1.js] +var Cat = (function () { + function Cat() { + } + return Cat; +})(); +exports.Cat = Cat; +var CatBag = (function () { + function CatBag(cats) { + } + return CatBag; +})(); +exports.CatBag = CatBag; +var cat = new Cat(); +var catThing = { + barry: cat +}; +var catBag = new CatBag(catThing); diff --git a/tests/baselines/reference/primaryExpressionMods.errors.txt b/tests/baselines/reference/primaryExpressionMods.errors.txt new file mode 100644 index 0000000000000..1f7d923482e07 --- /dev/null +++ b/tests/baselines/reference/primaryExpressionMods.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/primaryExpressionMods.ts (2 errors) ==== + module M + { + export interface P { x: number; y: number; } + export var a = 1; + } + var p: M.P; // Used as ModuleName + var m: M = M; // Used as TypeName and PrimaryExpression (error on TypeName) + ~ +!!! Cannot find name 'M'. + var m2: typeof M = M; // Used as PrimaryExpression in TypeQuery + var x1 = M.a; // Used as PrimaryExpression + var x2 = m.a; // Same as M.a + var q: m.P; // Error + ~~~ +!!! Cannot find name 'm'. + \ No newline at end of file diff --git a/tests/baselines/reference/primaryExpressionMods.js b/tests/baselines/reference/primaryExpressionMods.js new file mode 100644 index 0000000000000..ced35861a2b14 --- /dev/null +++ b/tests/baselines/reference/primaryExpressionMods.js @@ -0,0 +1,25 @@ +//// [primaryExpressionMods.ts] +module M +{ + export interface P { x: number; y: number; } + export var a = 1; +} +var p: M.P; // Used as ModuleName +var m: M = M; // Used as TypeName and PrimaryExpression (error on TypeName) +var m2: typeof M = M; // Used as PrimaryExpression in TypeQuery +var x1 = M.a; // Used as PrimaryExpression +var x2 = m.a; // Same as M.a +var q: m.P; // Error + + +//// [primaryExpressionMods.js] +var M; +(function (M) { + M.a = 1; +})(M || (M = {})); +var p; +var m = M; +var m2 = M; +var x1 = M.a; +var x2 = m.a; +var q; diff --git a/tests/baselines/reference/primitiveConstraints1.errors.txt b/tests/baselines/reference/primitiveConstraints1.errors.txt new file mode 100644 index 0000000000000..90653f8912e2b --- /dev/null +++ b/tests/baselines/reference/primitiveConstraints1.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/primitiveConstraints1.ts (2 errors) ==== + function foo1(t: T, u: U) { } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo1('hm', 1); // no error + + function foo2(t: T, u: U) { } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo2(1, 'hm'); // error + \ No newline at end of file diff --git a/tests/baselines/reference/primitiveConstraints1.js b/tests/baselines/reference/primitiveConstraints1.js new file mode 100644 index 0000000000000..03db6bb961658 --- /dev/null +++ b/tests/baselines/reference/primitiveConstraints1.js @@ -0,0 +1,15 @@ +//// [primitiveConstraints1.ts] +function foo1(t: T, u: U) { } +foo1('hm', 1); // no error + +function foo2(t: T, u: U) { } +foo2(1, 'hm'); // error + + +//// [primitiveConstraints1.js] +function foo1(t, u) { +} +foo1('hm', 1); +function foo2(t, u) { +} +foo2(1, 'hm'); diff --git a/tests/baselines/reference/primitiveConstraints2.errors.txt b/tests/baselines/reference/primitiveConstraints2.errors.txt new file mode 100644 index 0000000000000..556808e674e1f --- /dev/null +++ b/tests/baselines/reference/primitiveConstraints2.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/primitiveConstraints2.ts (2 errors) ==== + class C { + public bar2(x: T, y: U): T { + return null; + } + } + + var x = new C(); + x.bar2(2, ""); // should error + ~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + x.bar2(2, ""); // should error + ~~~~~~ +!!! Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/primitiveConstraints2.js b/tests/baselines/reference/primitiveConstraints2.js new file mode 100644 index 0000000000000..5f5e0f590e8d4 --- /dev/null +++ b/tests/baselines/reference/primitiveConstraints2.js @@ -0,0 +1,23 @@ +//// [primitiveConstraints2.ts] +class C { + public bar2(x: T, y: U): T { + return null; + } +} + +var x = new C(); +x.bar2(2, ""); // should error +x.bar2(2, ""); // should error + +//// [primitiveConstraints2.js] +var C = (function () { + function C() { + } + C.prototype.bar2 = function (x, y) { + return null; + }; + return C; +})(); +var x = new C(); +x.bar2(2, ""); +x.bar2(2, ""); diff --git a/tests/baselines/reference/primitiveMembers.errors.txt b/tests/baselines/reference/primitiveMembers.errors.txt new file mode 100644 index 0000000000000..3134927df802c --- /dev/null +++ b/tests/baselines/reference/primitiveMembers.errors.txt @@ -0,0 +1,44 @@ +==== tests/cases/compiler/primitiveMembers.ts (6 errors) ==== + var x = 5; + var r = /yo/; + r.source; + + x.toBAZ(); + ~~~~~ +!!! Property 'toBAZ' does not exist on type 'number'. + x.toString(); + + var n = 0; + var N: Number; + + n = N; // should not work, as 'number' has a different brand + ~ +!!! Type 'Number' is not assignable to type 'number'. + N = n; // should work + + var o: Object = {} + var f: Function = (x: string) => x.length; + var r2: RegExp = /./g; + var n2: Number = 34; + var s: String = "yo"; + var b: Boolean = true; + + var n3 = 5 || {}; + + + class baz { public bar(): void { }; } + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! Declaration or statement expected. + class foo extends baz { public bar(){ return undefined}; } + ~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! Declaration or statement expected. + + + + + + \ No newline at end of file diff --git a/tests/baselines/reference/primitiveTypeAsClassName.errors.txt b/tests/baselines/reference/primitiveTypeAsClassName.errors.txt new file mode 100644 index 0000000000000..d8613408dbd17 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsClassName.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/primitiveTypeAsClassName.ts (1 errors) ==== + class any {} + ~~~ +!!! Class name cannot be 'any' \ No newline at end of file diff --git a/tests/baselines/reference/primitiveTypeAsClassName.js b/tests/baselines/reference/primitiveTypeAsClassName.js new file mode 100644 index 0000000000000..5890e53d14451 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsClassName.js @@ -0,0 +1,9 @@ +//// [primitiveTypeAsClassName.ts] +class any {} + +//// [primitiveTypeAsClassName.js] +var any = (function () { + function any() { + } + return any; +})(); diff --git a/tests/baselines/reference/primitiveTypeAsInterfaceName.errors.txt b/tests/baselines/reference/primitiveTypeAsInterfaceName.errors.txt new file mode 100644 index 0000000000000..f4f76ce068d65 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsInterfaceName.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/primitiveTypeAsInterfaceName.ts (1 errors) ==== + interface number {} + ~~~~~~ +!!! Interface name cannot be 'number' \ No newline at end of file diff --git a/tests/baselines/reference/primitiveTypeAsInterfaceName.js b/tests/baselines/reference/primitiveTypeAsInterfaceName.js new file mode 100644 index 0000000000000..4d5594e1b0a2f --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsInterfaceName.js @@ -0,0 +1,4 @@ +//// [primitiveTypeAsInterfaceName.ts] +interface number {} + +//// [primitiveTypeAsInterfaceName.js] diff --git a/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.errors.txt b/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.errors.txt new file mode 100644 index 0000000000000..362c96580ef18 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/primitiveTypeAsInterfaceNameGeneric.ts (1 errors) ==== + interface number {} + ~~~~~~ +!!! Interface name cannot be 'number' \ No newline at end of file diff --git a/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.js b/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.js new file mode 100644 index 0000000000000..d2576b38bb1d6 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsInterfaceNameGeneric.js @@ -0,0 +1,4 @@ +//// [primitiveTypeAsInterfaceNameGeneric.ts] +interface number {} + +//// [primitiveTypeAsInterfaceNameGeneric.js] diff --git a/tests/baselines/reference/primitiveTypeAsmoduleName.js b/tests/baselines/reference/primitiveTypeAsmoduleName.js new file mode 100644 index 0000000000000..3c16114ab1ce6 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsmoduleName.js @@ -0,0 +1,4 @@ +//// [primitiveTypeAsmoduleName.ts] +module string {} + +//// [primitiveTypeAsmoduleName.js] diff --git a/tests/baselines/reference/primitiveTypeAssignment.errors.txt b/tests/baselines/reference/primitiveTypeAssignment.errors.txt new file mode 100644 index 0000000000000..578ff3cb862b7 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAssignment.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/primitiveTypeAssignment.ts (3 errors) ==== + var x = any; + ~~~ +!!! Cannot find name 'any'. + + var y = number; + ~~~~~~ +!!! Cannot find name 'number'. + + var z = boolean; + ~~~~~~~ +!!! Cannot find name 'boolean'. + \ No newline at end of file diff --git a/tests/baselines/reference/primitiveTypeAssignment.js b/tests/baselines/reference/primitiveTypeAssignment.js new file mode 100644 index 0000000000000..94fad8b333aef --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAssignment.js @@ -0,0 +1,12 @@ +//// [primitiveTypeAssignment.ts] +var x = any; + +var y = number; + +var z = boolean; + + +//// [primitiveTypeAssignment.js] +var x = any; +var y = number; +var z = boolean; diff --git a/tests/baselines/reference/primtiveTypesAreIdentical.js b/tests/baselines/reference/primtiveTypesAreIdentical.js new file mode 100644 index 0000000000000..d5c0e15d41343 --- /dev/null +++ b/tests/baselines/reference/primtiveTypesAreIdentical.js @@ -0,0 +1,52 @@ +//// [primtiveTypesAreIdentical.ts] +// primitive types are identical to themselves so these overloads will all cause errors + +function foo1(x: number); +function foo1(x: number); +function foo1(x: any) { } + +function foo2(x: string); +function foo2(x: string); +function foo2(x: any) { } + +function foo3(x: boolean); +function foo3(x: boolean); +function foo3(x: any) { } + +function foo4(x: any); +function foo4(x: any); +function foo4(x: any) { } + +function foo5(x: 'a'); +function foo5(x: 'a'); +function foo5(x: string); +function foo5(x: any) { } + +enum E { A } +function foo6(x: E); +function foo6(x: E); +function foo6(x: any) { } + +function foo7(x: void); +function foo7(x: void); +function foo7(x: any) { } + +//// [primtiveTypesAreIdentical.js] +function foo1(x) { +} +function foo2(x) { +} +function foo3(x) { +} +function foo4(x) { +} +function foo5(x) { +} +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +function foo6(x) { +} +function foo7(x) { +} diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js new file mode 100644 index 0000000000000..899f18693dcbd --- /dev/null +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js @@ -0,0 +1,32 @@ +//// [privacyCheckAnonymousFunctionParameter.ts] +export var x = 1; // Makes this an external module +interface Iterator { +} + +module Query { + export function fromDoWhile(doWhile: (test: Iterator) => boolean): Iterator { + return null; + } + + function fromOrderBy() { + return fromDoWhile(test => { + return true; + }); + } +} + + +//// [privacyCheckAnonymousFunctionParameter.js] +exports.x = 1; +var Query; +(function (Query) { + function fromDoWhile(doWhile) { + return null; + } + Query.fromDoWhile = fromDoWhile; + function fromOrderBy() { + return fromDoWhile(function (test) { + return true; + }); + } +})(Query || (Query = {})); diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js new file mode 100644 index 0000000000000..ac899bbdf14bd --- /dev/null +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js @@ -0,0 +1,33 @@ +//// [privacyCheckAnonymousFunctionParameter2.ts] +export var x = 1; // Makes this an external module +interface Iterator { x: T } + +module Q { + export function foo(x: (a: Iterator) => number) { + return x; + } +} + +module Q { + function bar() { + foo(null); + } +} + +//// [privacyCheckAnonymousFunctionParameter2.js] +define(["require", "exports"], function (require, exports) { + exports.x = 1; + var Q; + (function (Q) { + function foo(x) { + return x; + } + Q.foo = foo; + })(Q || (Q = {})); + var Q; + (function (Q) { + function bar() { + Q.foo(null); + } + })(Q || (Q = {})); +}); diff --git a/tests/baselines/reference/privacyCheckCallbackOfInterfaceMethodWithTypeParameter.js b/tests/baselines/reference/privacyCheckCallbackOfInterfaceMethodWithTypeParameter.js new file mode 100644 index 0000000000000..02a4b682d9453 --- /dev/null +++ b/tests/baselines/reference/privacyCheckCallbackOfInterfaceMethodWithTypeParameter.js @@ -0,0 +1,12 @@ +//// [privacyCheckCallbackOfInterfaceMethodWithTypeParameter.ts] +export interface A { + f1(callback: (p: T) => any); +} + +export interface B extends A { +} + + +//// [privacyCheckCallbackOfInterfaceMethodWithTypeParameter.js] +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.js b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.js new file mode 100644 index 0000000000000..1b02a38307b39 --- /dev/null +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.js @@ -0,0 +1,13 @@ +//// [privacyCheckExportAssignmentOnExportedGenericInterface1.ts] +module Foo { + export interface A { + } +} +interface Foo { +} +var Foo: new () => Foo.A>; +export = Foo; + +//// [privacyCheckExportAssignmentOnExportedGenericInterface1.js] +var Foo; +module.exports = Foo; diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js new file mode 100644 index 0000000000000..2b4e9ddf83359 --- /dev/null +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.js @@ -0,0 +1,26 @@ +//// [privacyCheckExportAssignmentOnExportedGenericInterface2.ts] +export = Foo; + +interface Foo { +} + +function Foo(array: T[]): Foo { + return undefined; +} + +module Foo { + export var x = "hello"; +} + + +//// [privacyCheckExportAssignmentOnExportedGenericInterface2.js] +define(["require", "exports"], function (require, exports) { + function Foo(array) { + return undefined; + } + var Foo; + (function (Foo) { + Foo.x = "hello"; + })(Foo || (Foo = {})); + return Foo; +}); diff --git a/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js b/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js new file mode 100644 index 0000000000000..94aa5c28e923f --- /dev/null +++ b/tests/baselines/reference/privacyCheckExternalModuleExportAssignmentOfGenericClass.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/privacyCheckExternalModuleExportAssignmentOfGenericClass.ts] //// + +//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_0.ts] +export = Foo; +class Foo
{ + constructor(public a: A) { } +} + +//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_1.ts] +import Foo = require("privacyCheckExternalModuleExportAssignmentOfGenericClass_0"); +export = Bar; +interface Bar { + foo: Foo; +} + +//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_0.js] +var Foo = (function () { + function Foo(a) { + this.a = a; + } + return Foo; +})(); +module.exports = Foo; +//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_1.js] diff --git a/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js b/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js new file mode 100644 index 0000000000000..a1def38580932 --- /dev/null +++ b/tests/baselines/reference/privacyCheckOnTypeParameterReferenceInConstructorParameter.js @@ -0,0 +1,28 @@ +//// [privacyCheckOnTypeParameterReferenceInConstructorParameter.ts] +export class A{ + constructor(callback: (self: A) => void) { + var child = new B(this); + } +} + +export class B { + constructor(parent: T2) { } +} + + +//// [privacyCheckOnTypeParameterReferenceInConstructorParameter.js] +define(["require", "exports"], function (require, exports) { + var A = (function () { + function A(callback) { + var child = new B(this); + } + return A; + })(); + exports.A = A; + var B = (function () { + function B(parent) { + } + return B; + })(); + exports.B = B; +}); diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt new file mode 100644 index 0000000000000..3132a1c56a72c --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/privacyCheckTypeOfFunction.ts (1 errors) ==== + function foo() { + } + export var x: typeof foo; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export var b = foo; + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.js b/tests/baselines/reference/privacyCheckTypeOfFunction.js new file mode 100644 index 0000000000000..757416c691b97 --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfFunction.js @@ -0,0 +1,12 @@ +//// [privacyCheckTypeOfFunction.ts] +function foo() { +} +export var x: typeof foo; +export var b = foo; + + +//// [privacyCheckTypeOfFunction.js] +function foo() { +} +exports.x; +exports.b = foo; diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.js b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.js new file mode 100644 index 0000000000000..80941509d4f93 --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.js @@ -0,0 +1,19 @@ +//// [privacyCheckTypeOfInvisibleModuleError.ts] +module Outer { + module Inner { + export var m: typeof Inner; + } + + export var f: typeof Inner; +} + + +//// [privacyCheckTypeOfInvisibleModuleError.js] +var Outer; +(function (Outer) { + var Inner; + (function (Inner) { + Inner.m; + })(Inner || (Inner = {})); + Outer.f; +})(Outer || (Outer = {})); diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js new file mode 100644 index 0000000000000..c5243f65d0989 --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js @@ -0,0 +1,22 @@ +//// [privacyCheckTypeOfInvisibleModuleNoError.ts] +module Outer { + module Inner { + export var m: number; + } + + export var f: typeof Inner; // Since we dont unwind inner any more, it is error here +} + + +//// [privacyCheckTypeOfInvisibleModuleNoError.js] +var Outer; +(function (Outer) { + var Inner; + (function (Inner) { + Inner.m; + })(Inner || (Inner = {})); + Outer.f; +})(Outer || (Outer = {})); + + +//// [privacyCheckTypeOfInvisibleModuleNoError.d.ts] diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js new file mode 100644 index 0000000000000..8cacd983510ec --- /dev/null +++ b/tests/baselines/reference/privacyClass.js @@ -0,0 +1,427 @@ +//// [privacyClass.ts] +export module m1 { + export interface m1_i_public { + } + + interface m1_i_private { + } + + export class m1_c_public { + private f1() { + } + } + + class m1_c_private { + } + + class m1_C1_private extends m1_c_public { + } + class m1_C2_private extends m1_c_private { + } + export class m1_C3_public extends m1_c_public { + } + export class m1_C4_public extends m1_c_private { + } + + class m1_C5_private implements m1_i_public { + } + class m1_C6_private implements m1_i_private { + } + export class m1_C7_public implements m1_i_public { + } + export class m1_C8_public implements m1_i_private { + } + + class m1_C9_private extends m1_c_public implements m1_i_private, m1_i_public { + } + class m1_C10_private extends m1_c_private implements m1_i_private, m1_i_public { + } + export class m1_C11_public extends m1_c_public implements m1_i_private, m1_i_public { + } + export class m1_C12_public extends m1_c_private implements m1_i_private, m1_i_public { + } +} + + +module m2 { + export interface m2_i_public { + } + + interface m2_i_private { + } + + export class m2_c_public { + private f1() { + } + } + + class m2_c_private { + } + + class m2_C1_private extends m2_c_public { + } + class m2_C2_private extends m2_c_private { + } + export class m2_C3_public extends m2_c_public { + } + export class m2_C4_public extends m2_c_private { + } + + class m2_C5_private implements m2_i_public { + } + class m2_C6_private implements m2_i_private { + } + export class m2_C7_public implements m2_i_public { + } + export class m2_C8_public implements m2_i_private { + } + + class m2_C9_private extends m2_c_public implements m2_i_private, m2_i_public { + } + class m2_C10_private extends m2_c_private implements m2_i_private, m2_i_public { + } + export class m2_C11_public extends m2_c_public implements m2_i_private, m2_i_public { + } + export class m2_C12_public extends m2_c_private implements m2_i_private, m2_i_public { + } +} + +export interface glo_i_public { +} + +interface glo_i_private { +} + +export class glo_c_public { + private f1() { + } +} + +class glo_c_private { +} + +class glo_C1_private extends glo_c_public { +} +class glo_C2_private extends glo_c_private { +} +export class glo_C3_public extends glo_c_public { +} +export class glo_C4_public extends glo_c_private { +} + +class glo_C5_private implements glo_i_public { +} +class glo_C6_private implements glo_i_private { +} +export class glo_C7_public implements glo_i_public { +} +export class glo_C8_public implements glo_i_private { +} + +class glo_C9_private extends glo_c_public implements glo_i_private, glo_i_public { +} +class glo_C10_private extends glo_c_private implements glo_i_private, glo_i_public { +} +export class glo_C11_public extends glo_c_public implements glo_i_private, glo_i_public { +} +export class glo_C12_public extends glo_c_private implements glo_i_private, glo_i_public { +} + +//// [privacyClass.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +(function (m1) { + var m1_c_public = (function () { + function m1_c_public() { + } + m1_c_public.prototype.f1 = function () { + }; + return m1_c_public; + })(); + m1.m1_c_public = m1_c_public; + var m1_c_private = (function () { + function m1_c_private() { + } + return m1_c_private; + })(); + var m1_C1_private = (function (_super) { + __extends(m1_C1_private, _super); + function m1_C1_private() { + _super.apply(this, arguments); + } + return m1_C1_private; + })(m1_c_public); + var m1_C2_private = (function (_super) { + __extends(m1_C2_private, _super); + function m1_C2_private() { + _super.apply(this, arguments); + } + return m1_C2_private; + })(m1_c_private); + var m1_C3_public = (function (_super) { + __extends(m1_C3_public, _super); + function m1_C3_public() { + _super.apply(this, arguments); + } + return m1_C3_public; + })(m1_c_public); + m1.m1_C3_public = m1_C3_public; + var m1_C4_public = (function (_super) { + __extends(m1_C4_public, _super); + function m1_C4_public() { + _super.apply(this, arguments); + } + return m1_C4_public; + })(m1_c_private); + m1.m1_C4_public = m1_C4_public; + var m1_C5_private = (function () { + function m1_C5_private() { + } + return m1_C5_private; + })(); + var m1_C6_private = (function () { + function m1_C6_private() { + } + return m1_C6_private; + })(); + var m1_C7_public = (function () { + function m1_C7_public() { + } + return m1_C7_public; + })(); + m1.m1_C7_public = m1_C7_public; + var m1_C8_public = (function () { + function m1_C8_public() { + } + return m1_C8_public; + })(); + m1.m1_C8_public = m1_C8_public; + var m1_C9_private = (function (_super) { + __extends(m1_C9_private, _super); + function m1_C9_private() { + _super.apply(this, arguments); + } + return m1_C9_private; + })(m1_c_public); + var m1_C10_private = (function (_super) { + __extends(m1_C10_private, _super); + function m1_C10_private() { + _super.apply(this, arguments); + } + return m1_C10_private; + })(m1_c_private); + var m1_C11_public = (function (_super) { + __extends(m1_C11_public, _super); + function m1_C11_public() { + _super.apply(this, arguments); + } + return m1_C11_public; + })(m1_c_public); + m1.m1_C11_public = m1_C11_public; + var m1_C12_public = (function (_super) { + __extends(m1_C12_public, _super); + function m1_C12_public() { + _super.apply(this, arguments); + } + return m1_C12_public; + })(m1_c_private); + m1.m1_C12_public = m1_C12_public; +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var m2; +(function (m2) { + var m2_c_public = (function () { + function m2_c_public() { + } + m2_c_public.prototype.f1 = function () { + }; + return m2_c_public; + })(); + m2.m2_c_public = m2_c_public; + var m2_c_private = (function () { + function m2_c_private() { + } + return m2_c_private; + })(); + var m2_C1_private = (function (_super) { + __extends(m2_C1_private, _super); + function m2_C1_private() { + _super.apply(this, arguments); + } + return m2_C1_private; + })(m2_c_public); + var m2_C2_private = (function (_super) { + __extends(m2_C2_private, _super); + function m2_C2_private() { + _super.apply(this, arguments); + } + return m2_C2_private; + })(m2_c_private); + var m2_C3_public = (function (_super) { + __extends(m2_C3_public, _super); + function m2_C3_public() { + _super.apply(this, arguments); + } + return m2_C3_public; + })(m2_c_public); + m2.m2_C3_public = m2_C3_public; + var m2_C4_public = (function (_super) { + __extends(m2_C4_public, _super); + function m2_C4_public() { + _super.apply(this, arguments); + } + return m2_C4_public; + })(m2_c_private); + m2.m2_C4_public = m2_C4_public; + var m2_C5_private = (function () { + function m2_C5_private() { + } + return m2_C5_private; + })(); + var m2_C6_private = (function () { + function m2_C6_private() { + } + return m2_C6_private; + })(); + var m2_C7_public = (function () { + function m2_C7_public() { + } + return m2_C7_public; + })(); + m2.m2_C7_public = m2_C7_public; + var m2_C8_public = (function () { + function m2_C8_public() { + } + return m2_C8_public; + })(); + m2.m2_C8_public = m2_C8_public; + var m2_C9_private = (function (_super) { + __extends(m2_C9_private, _super); + function m2_C9_private() { + _super.apply(this, arguments); + } + return m2_C9_private; + })(m2_c_public); + var m2_C10_private = (function (_super) { + __extends(m2_C10_private, _super); + function m2_C10_private() { + _super.apply(this, arguments); + } + return m2_C10_private; + })(m2_c_private); + var m2_C11_public = (function (_super) { + __extends(m2_C11_public, _super); + function m2_C11_public() { + _super.apply(this, arguments); + } + return m2_C11_public; + })(m2_c_public); + m2.m2_C11_public = m2_C11_public; + var m2_C12_public = (function (_super) { + __extends(m2_C12_public, _super); + function m2_C12_public() { + _super.apply(this, arguments); + } + return m2_C12_public; + })(m2_c_private); + m2.m2_C12_public = m2_C12_public; +})(m2 || (m2 = {})); +var glo_c_public = (function () { + function glo_c_public() { + } + glo_c_public.prototype.f1 = function () { + }; + return glo_c_public; +})(); +exports.glo_c_public = glo_c_public; +var glo_c_private = (function () { + function glo_c_private() { + } + return glo_c_private; +})(); +var glo_C1_private = (function (_super) { + __extends(glo_C1_private, _super); + function glo_C1_private() { + _super.apply(this, arguments); + } + return glo_C1_private; +})(glo_c_public); +var glo_C2_private = (function (_super) { + __extends(glo_C2_private, _super); + function glo_C2_private() { + _super.apply(this, arguments); + } + return glo_C2_private; +})(glo_c_private); +var glo_C3_public = (function (_super) { + __extends(glo_C3_public, _super); + function glo_C3_public() { + _super.apply(this, arguments); + } + return glo_C3_public; +})(glo_c_public); +exports.glo_C3_public = glo_C3_public; +var glo_C4_public = (function (_super) { + __extends(glo_C4_public, _super); + function glo_C4_public() { + _super.apply(this, arguments); + } + return glo_C4_public; +})(glo_c_private); +exports.glo_C4_public = glo_C4_public; +var glo_C5_private = (function () { + function glo_C5_private() { + } + return glo_C5_private; +})(); +var glo_C6_private = (function () { + function glo_C6_private() { + } + return glo_C6_private; +})(); +var glo_C7_public = (function () { + function glo_C7_public() { + } + return glo_C7_public; +})(); +exports.glo_C7_public = glo_C7_public; +var glo_C8_public = (function () { + function glo_C8_public() { + } + return glo_C8_public; +})(); +exports.glo_C8_public = glo_C8_public; +var glo_C9_private = (function (_super) { + __extends(glo_C9_private, _super); + function glo_C9_private() { + _super.apply(this, arguments); + } + return glo_C9_private; +})(glo_c_public); +var glo_C10_private = (function (_super) { + __extends(glo_C10_private, _super); + function glo_C10_private() { + _super.apply(this, arguments); + } + return glo_C10_private; +})(glo_c_private); +var glo_C11_public = (function (_super) { + __extends(glo_C11_public, _super); + function glo_C11_public() { + _super.apply(this, arguments); + } + return glo_C11_public; +})(glo_c_public); +exports.glo_C11_public = glo_C11_public; +var glo_C12_public = (function (_super) { + __extends(glo_C12_public, _super); + function glo_C12_public() { + _super.apply(this, arguments); + } + return glo_C12_public; +})(glo_c_private); +exports.glo_C12_public = glo_C12_public; diff --git a/tests/baselines/reference/privacyFunc.js b/tests/baselines/reference/privacyFunc.js new file mode 100644 index 0000000000000..f6904be082e44 --- /dev/null +++ b/tests/baselines/reference/privacyFunc.js @@ -0,0 +1,421 @@ +//// [privacyFunc.ts] +module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + constructor (m1_c3_c1: C1_public); + constructor (m1_c3_c2: C2_private); //error + constructor (m1_c3_c1_2: any) { + } + + private f1_private(m1_c3_f1_arg: C1_public) { + } + + public f2_public(m1_c3_f2_arg: C1_public) { + } + + private f3_private(m1_c3_f3_arg: C2_private) { + } + + public f4_public(m1_c3_f4_arg: C2_private) { // error + } + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); // error + } + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + class C4_private { + constructor (m1_c4_c1: C1_public); + constructor (m1_c4_c2: C2_private); + constructor (m1_c4_c1_2: any) { + } + private f1_private(m1_c4_f1_arg: C1_public) { + } + + public f2_public(m1_c4_f2_arg: C1_public) { + } + + private f3_private(m1_c4_f3_arg: C2_private) { + } + + public f4_public(m1_c4_f4_arg: C2_private) { + } + + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); + } + + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { + return new C2_private(); + } + } + + export class C5_public { + constructor (m1_c5_c: C1_public) { + } + } + + class C6_private { + constructor (m1_c6_c: C1_public) { + } + } + export class C7_public { + constructor (m1_c7_c: C2_private) { // error + } + } + + class C8_private { + constructor (m1_c8_c: C2_private) { + } + } + + function f1_public(m1_f1_arg: C1_public) { + } + + export function f2_public(m1_f2_arg: C1_public) { + } + + function f3_public(m1_f3_arg: C2_private) { + } + + export function f4_public(m1_f4_arg: C2_private) { // error + } + + + function f5_public() { + return new C1_public(); + } + + export function f6_public() { + return new C1_public(); + } + + function f7_public() { + return new C2_private(); + } + + export function f8_public() { + return new C2_private(); // error + } + + + function f9_private(): C1_public { + return new C1_public(); + } + + export function f10_public(): C1_public { + return new C1_public(); + } + + function f11_private(): C2_private { + return new C2_private(); + } + + export function f12_public(): C2_private { // error + return new C2_private(); //error + } +} + +class C6_public { +} + +class C7_public { + constructor (c7_c2: C6_public); + constructor (c7_c1_2: any) { + } + private f1_private(c7_f1_arg: C6_public) { + } + + public f2_public(c7_f2_arg: C6_public) { + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } +} + +class C9_public { + constructor (c9_c: C6_public) { + } +} + + +function f4_public(f4_arg: C6_public) { +} + + + +function f6_public() { + return new C6_public(); +} + + +function f10_public(): C6_public { + return new C6_public(); +} + + +//// [privacyFunc.js] +var m1; +(function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); + var C3_public = (function () { + function C3_public(m1_c3_c1_2) { + } + C3_public.prototype.f1_private = function (m1_c3_f1_arg) { + }; + C3_public.prototype.f2_public = function (m1_c3_f2_arg) { + }; + C3_public.prototype.f3_private = function (m1_c3_f3_arg) { + }; + C3_public.prototype.f4_public = function (m1_c3_f4_arg) { + }; + C3_public.prototype.f5_private = function () { + return new C1_public(); + }; + C3_public.prototype.f6_public = function () { + return new C1_public(); + }; + C3_public.prototype.f7_private = function () { + return new C2_private(); + }; + C3_public.prototype.f8_public = function () { + return new C2_private(); + }; + C3_public.prototype.f9_private = function () { + return new C1_public(); + }; + C3_public.prototype.f10_public = function () { + return new C1_public(); + }; + C3_public.prototype.f11_private = function () { + return new C2_private(); + }; + C3_public.prototype.f12_public = function () { + return new C2_private(); + }; + return C3_public; + })(); + m1.C3_public = C3_public; + var C4_private = (function () { + function C4_private(m1_c4_c1_2) { + } + C4_private.prototype.f1_private = function (m1_c4_f1_arg) { + }; + C4_private.prototype.f2_public = function (m1_c4_f2_arg) { + }; + C4_private.prototype.f3_private = function (m1_c4_f3_arg) { + }; + C4_private.prototype.f4_public = function (m1_c4_f4_arg) { + }; + C4_private.prototype.f5_private = function () { + return new C1_public(); + }; + C4_private.prototype.f6_public = function () { + return new C1_public(); + }; + C4_private.prototype.f7_private = function () { + return new C2_private(); + }; + C4_private.prototype.f8_public = function () { + return new C2_private(); + }; + C4_private.prototype.f9_private = function () { + return new C1_public(); + }; + C4_private.prototype.f10_public = function () { + return new C1_public(); + }; + C4_private.prototype.f11_private = function () { + return new C2_private(); + }; + C4_private.prototype.f12_public = function () { + return new C2_private(); + }; + return C4_private; + })(); + var C5_public = (function () { + function C5_public(m1_c5_c) { + } + return C5_public; + })(); + m1.C5_public = C5_public; + var C6_private = (function () { + function C6_private(m1_c6_c) { + } + return C6_private; + })(); + var C7_public = (function () { + function C7_public(m1_c7_c) { + } + return C7_public; + })(); + m1.C7_public = C7_public; + var C8_private = (function () { + function C8_private(m1_c8_c) { + } + return C8_private; + })(); + function f1_public(m1_f1_arg) { + } + function f2_public(m1_f2_arg) { + } + m1.f2_public = f2_public; + function f3_public(m1_f3_arg) { + } + function f4_public(m1_f4_arg) { + } + m1.f4_public = f4_public; + function f5_public() { + return new C1_public(); + } + function f6_public() { + return new C1_public(); + } + m1.f6_public = f6_public; + function f7_public() { + return new C2_private(); + } + function f8_public() { + return new C2_private(); + } + m1.f8_public = f8_public; + function f9_private() { + return new C1_public(); + } + function f10_public() { + return new C1_public(); + } + m1.f10_public = f10_public; + function f11_private() { + return new C2_private(); + } + function f12_public() { + return new C2_private(); + } + m1.f12_public = f12_public; +})(m1 || (m1 = {})); +var C6_public = (function () { + function C6_public() { + } + return C6_public; +})(); +var C7_public = (function () { + function C7_public(c7_c1_2) { + } + C7_public.prototype.f1_private = function (c7_f1_arg) { + }; + C7_public.prototype.f2_public = function (c7_f2_arg) { + }; + C7_public.prototype.f5_private = function () { + return new C6_public(); + }; + C7_public.prototype.f6_public = function () { + return new C6_public(); + }; + C7_public.prototype.f9_private = function () { + return new C6_public(); + }; + C7_public.prototype.f10_public = function () { + return new C6_public(); + }; + return C7_public; +})(); +var C9_public = (function () { + function C9_public(c9_c) { + } + return C9_public; +})(); +function f4_public(f4_arg) { +} +function f6_public() { + return new C6_public(); +} +function f10_public() { + return new C6_public(); +} diff --git a/tests/baselines/reference/privacyGetter.errors.txt b/tests/baselines/reference/privacyGetter.errors.txt new file mode 100644 index 0000000000000..ea185031726a9 --- /dev/null +++ b/tests/baselines/reference/privacyGetter.errors.txt @@ -0,0 +1,304 @@ +==== tests/cases/compiler/privacyGetter.ts (48 errors) ==== + export module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C2_private { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C2_private) { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class C4_private { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C2_private { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + public set p4_public(m1_c3_p4_arg: C2_private) { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + } + + module m2 { + export class m2_C1_public { + private f1() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C1_public(); + } + + private set p1_private(m2_c3_p1_arg: m2_C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C1_public(); + } + + private set p2_private(m2_c3_p2_arg: m2_C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C2_private(); + } + + private set p3_private(m2_c3_p3_arg: m2_C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): m2_C2_private { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C2_private(); + } + + public set p4_public(m2_c3_p4_arg: m2_C2_private) { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class m2_C4_private { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C1_public(); + } + + private set p1_private(m2_c3_p1_arg: m2_C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C1_public(); + } + + private set p2_private(m2_c3_p2_arg: m2_C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C2_private(); + } + + private set p3_private(m2_c3_p3_arg: m2_C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): m2_C2_private { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new m2_C2_private(); + } + + public set p4_public(m2_c3_p4_arg: m2_C2_private) { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + } + + class C5_private { + private f() { + } + } + + export class C6_public { + } + + export class C7_public { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C5_private(); + } + + private set p3_private(m1_c3_p3_arg: C5_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C5_private { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C5_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C5_private) { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class C8_private { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C5_private(); + } + + private set p3_private(m1_c3_p3_arg: C5_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C5_private { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C5_private(); + } + + public set p4_public(m1_c3_p4_arg: C5_private) { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js new file mode 100644 index 0000000000000..5cd5ace324783 --- /dev/null +++ b/tests/baselines/reference/privacyGloClass.js @@ -0,0 +1,193 @@ +//// [privacyGloClass.ts] +module m1 { + export interface m1_i_public { + } + + interface m1_i_private { + } + + export class m1_c_public { + private f1() { + } + } + + class m1_c_private { + } + + class m1_C1_private extends m1_c_public { + } + class m1_C2_private extends m1_c_private { + } + export class m1_C3_public extends m1_c_public { + } + export class m1_C4_public extends m1_c_private { + } + + class m1_C5_private implements m1_i_public { + } + class m1_C6_private implements m1_i_private { + } + export class m1_C7_public implements m1_i_public { + } + export class m1_C8_public implements m1_i_private { + } + + class m1_C9_private extends m1_c_public implements m1_i_private, m1_i_public { + } + class m1_C10_private extends m1_c_private implements m1_i_private, m1_i_public { + } + export class m1_C11_public extends m1_c_public implements m1_i_private, m1_i_public { + } + export class m1_C12_public extends m1_c_private implements m1_i_private, m1_i_public { + } +} + +interface glo_i_public { +} + +class glo_c_public { + private f1() { + } +} + +class glo_C3_public extends glo_c_public { +} + +class glo_C7_public implements glo_i_public { +} + +class glo_C11_public extends glo_c_public implements glo_i_public { +} + + +//// [privacyGloClass.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var m1; +(function (m1) { + var m1_c_public = (function () { + function m1_c_public() { + } + m1_c_public.prototype.f1 = function () { + }; + return m1_c_public; + })(); + m1.m1_c_public = m1_c_public; + var m1_c_private = (function () { + function m1_c_private() { + } + return m1_c_private; + })(); + var m1_C1_private = (function (_super) { + __extends(m1_C1_private, _super); + function m1_C1_private() { + _super.apply(this, arguments); + } + return m1_C1_private; + })(m1_c_public); + var m1_C2_private = (function (_super) { + __extends(m1_C2_private, _super); + function m1_C2_private() { + _super.apply(this, arguments); + } + return m1_C2_private; + })(m1_c_private); + var m1_C3_public = (function (_super) { + __extends(m1_C3_public, _super); + function m1_C3_public() { + _super.apply(this, arguments); + } + return m1_C3_public; + })(m1_c_public); + m1.m1_C3_public = m1_C3_public; + var m1_C4_public = (function (_super) { + __extends(m1_C4_public, _super); + function m1_C4_public() { + _super.apply(this, arguments); + } + return m1_C4_public; + })(m1_c_private); + m1.m1_C4_public = m1_C4_public; + var m1_C5_private = (function () { + function m1_C5_private() { + } + return m1_C5_private; + })(); + var m1_C6_private = (function () { + function m1_C6_private() { + } + return m1_C6_private; + })(); + var m1_C7_public = (function () { + function m1_C7_public() { + } + return m1_C7_public; + })(); + m1.m1_C7_public = m1_C7_public; + var m1_C8_public = (function () { + function m1_C8_public() { + } + return m1_C8_public; + })(); + m1.m1_C8_public = m1_C8_public; + var m1_C9_private = (function (_super) { + __extends(m1_C9_private, _super); + function m1_C9_private() { + _super.apply(this, arguments); + } + return m1_C9_private; + })(m1_c_public); + var m1_C10_private = (function (_super) { + __extends(m1_C10_private, _super); + function m1_C10_private() { + _super.apply(this, arguments); + } + return m1_C10_private; + })(m1_c_private); + var m1_C11_public = (function (_super) { + __extends(m1_C11_public, _super); + function m1_C11_public() { + _super.apply(this, arguments); + } + return m1_C11_public; + })(m1_c_public); + m1.m1_C11_public = m1_C11_public; + var m1_C12_public = (function (_super) { + __extends(m1_C12_public, _super); + function m1_C12_public() { + _super.apply(this, arguments); + } + return m1_C12_public; + })(m1_c_private); + m1.m1_C12_public = m1_C12_public; +})(m1 || (m1 = {})); +var glo_c_public = (function () { + function glo_c_public() { + } + glo_c_public.prototype.f1 = function () { + }; + return glo_c_public; +})(); +var glo_C3_public = (function (_super) { + __extends(glo_C3_public, _super); + function glo_C3_public() { + _super.apply(this, arguments); + } + return glo_C3_public; +})(glo_c_public); +var glo_C7_public = (function () { + function glo_C7_public() { + } + return glo_C7_public; +})(); +var glo_C11_public = (function (_super) { + __extends(glo_C11_public, _super); + function glo_C11_public() { + _super.apply(this, arguments); + } + return glo_C11_public; +})(glo_c_public); diff --git a/tests/baselines/reference/privacyGloFunc.js b/tests/baselines/reference/privacyGloFunc.js new file mode 100644 index 0000000000000..c6aa1ca42b223 --- /dev/null +++ b/tests/baselines/reference/privacyGloFunc.js @@ -0,0 +1,985 @@ +//// [privacyGloFunc.ts] +export module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + constructor (m1_c3_c1: C1_public); + constructor (m1_c3_c2: C2_private); //error + constructor (m1_c3_c1_2: any) { + } + + private f1_private(m1_c3_f1_arg: C1_public) { + } + + public f2_public(m1_c3_f2_arg: C1_public) { + } + + private f3_private(m1_c3_f3_arg: C2_private) { + } + + public f4_public(m1_c3_f4_arg: C2_private) { // error + } + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); // error + } + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + class C4_private { + constructor (m1_c4_c1: C1_public); + constructor (m1_c4_c2: C2_private); + constructor (m1_c4_c1_2: any) { + } + private f1_private(m1_c4_f1_arg: C1_public) { + } + + public f2_public(m1_c4_f2_arg: C1_public) { + } + + private f3_private(m1_c4_f3_arg: C2_private) { + } + + public f4_public(m1_c4_f4_arg: C2_private) { + } + + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); + } + + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { + return new C2_private(); + } + } + + export class C5_public { + constructor (m1_c5_c: C1_public) { + } + } + + class C6_private { + constructor (m1_c6_c: C1_public) { + } + } + export class C7_public { + constructor (m1_c7_c: C2_private) { // error + } + } + + class C8_private { + constructor (m1_c8_c: C2_private) { + } + } + + function f1_public(m1_f1_arg: C1_public) { + } + + export function f2_public(m1_f2_arg: C1_public) { + } + + function f3_public(m1_f3_arg: C2_private) { + } + + export function f4_public(m1_f4_arg: C2_private) { // error + } + + + function f5_public() { + return new C1_public(); + } + + export function f6_public() { + return new C1_public(); + } + + function f7_public() { + return new C2_private(); + } + + export function f8_public() { + return new C2_private(); // error + } + + + function f9_private(): C1_public { + return new C1_public(); + } + + export function f10_public(): C1_public { + return new C1_public(); + } + + function f11_private(): C2_private { + return new C2_private(); + } + + export function f12_public(): C2_private { // error + return new C2_private(); //error + } +} + +module m2 { + export class m2_C1_public { + private f() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + constructor (m2_c3_c1: m2_C1_public); + constructor (m2_c3_c2: m2_C2_private); + constructor (m2_c3_c1_2: any) { + } + + private f1_private(m2_c3_f1_arg: m2_C1_public) { + } + + public f2_public(m2_c3_f2_arg: m2_C1_public) { + } + + private f3_private(m2_c3_f3_arg: m2_C2_private) { + } + + public f4_public(m2_c3_f4_arg: m2_C2_private) { + } + + private f5_private() { + return new m2_C1_public(); + } + + public f6_public() { + return new m2_C1_public(); + } + + private f7_private() { + return new m2_C2_private(); + } + + public f8_public() { + return new m2_C2_private(); + } + + private f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + public f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + private f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + public f12_public(): m2_C2_private { + return new m2_C2_private(); + } + } + + class m2_C4_private { + constructor (m2_c4_c1: m2_C1_public); + constructor (m2_c4_c2: m2_C2_private); + constructor (m2_c4_c1_2: any) { + } + + private f1_private(m2_c4_f1_arg: m2_C1_public) { + } + + public f2_public(m2_c4_f2_arg: m2_C1_public) { + } + + private f3_private(m2_c4_f3_arg: m2_C2_private) { + } + + public f4_public(m2_c4_f4_arg: m2_C2_private) { + } + + + private f5_private() { + return new m2_C1_public(); + } + + public f6_public() { + return new m2_C1_public(); + } + + private f7_private() { + return new m2_C2_private(); + } + + public f8_public() { + return new m2_C2_private(); + } + + + private f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + public f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + private f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + public f12_public(): m2_C2_private { + return new m2_C2_private(); + } + } + + export class m2_C5_public { + constructor (m2_c5_c: m2_C1_public) { + } + } + + class m2_C6_private { + constructor (m2_c6_c: m2_C1_public) { + } + } + export class m2_C7_public { + constructor (m2_c7_c: m2_C2_private) { + } + } + + class m2_C8_private { + constructor (m2_c8_c: m2_C2_private) { + } + } + + function f1_public(m2_f1_arg: m2_C1_public) { + } + + export function f2_public(m2_f2_arg: m2_C1_public) { + } + + function f3_public(m2_f3_arg: m2_C2_private) { + } + + export function f4_public(m2_f4_arg: m2_C2_private) { + } + + + function f5_public() { + return new m2_C1_public(); + } + + export function f6_public() { + return new m2_C1_public(); + } + + function f7_public() { + return new m2_C2_private(); + } + + export function f8_public() { + return new m2_C2_private(); + } + + + function f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + export function f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + function f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + export function f12_public(): m2_C2_private { + return new m2_C2_private(); + } +} + +class C5_private { + private f() { + } +} + +export class C6_public { +} + +export class C7_public { + constructor (c7_c1: C5_private); // error + constructor (c7_c2: C6_public); + constructor (c7_c1_2: any) { + } + private f1_private(c7_f1_arg: C6_public) { + } + + public f2_public(c7_f2_arg: C6_public) { + } + + private f3_private(c7_f3_arg: C5_private) { + } + + public f4_public(c7_f4_arg: C5_private) { //error + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f7_private() { + return new C5_private(); + } + + public f8_public() { + return new C5_private(); //error + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } + + private f11_private(): C5_private { + return new C5_private(); + } + + public f12_public(): C5_private { //error + return new C5_private(); //error + } +} + +class C8_private { + constructor (c8_c1: C5_private); + constructor (c8_c2: C6_public); + constructor (c8_c1_2: any) { + } + + private f1_private(c8_f1_arg: C6_public) { + } + + public f2_public(c8_f2_arg: C6_public) { + } + + private f3_private(c8_f3_arg: C5_private) { + } + + public f4_public(c8_f4_arg: C5_private) { + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f7_private() { + return new C5_private(); + } + + public f8_public() { + return new C5_private(); + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } + + private f11_private(): C5_private { + return new C5_private(); + } + + public f12_public(): C5_private { + return new C5_private(); + } +} + + +export class C9_public { + constructor (c9_c: C6_public) { + } +} + +class C10_private { + constructor (c10_c: C6_public) { + } +} +export class C11_public { + constructor (c11_c: C5_private) { // error + } +} + +class C12_private { + constructor (c12_c: C5_private) { + } +} + +function f1_private(f1_arg: C5_private) { +} + +export function f2_public(f2_arg: C5_private) { // error +} + +function f3_private(f3_arg: C6_public) { +} + +export function f4_public(f4_arg: C6_public) { +} + +function f5_private() { + return new C6_public(); +} + +export function f6_public() { + return new C6_public(); +} + +function f7_private() { + return new C5_private(); +} + +export function f8_public() { + return new C5_private(); //error +} + +function f9_private(): C6_public { + return new C6_public(); +} + +export function f10_public(): C6_public { + return new C6_public(); +} + +function f11_private(): C5_private { + return new C5_private(); +} + +export function f12_public(): C5_private { //error + return new C5_private(); //error +} + + +//// [privacyGloFunc.js] +define(["require", "exports"], function (require, exports) { + (function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); + var C3_public = (function () { + function C3_public(m1_c3_c1_2) { + } + C3_public.prototype.f1_private = function (m1_c3_f1_arg) { + }; + C3_public.prototype.f2_public = function (m1_c3_f2_arg) { + }; + C3_public.prototype.f3_private = function (m1_c3_f3_arg) { + }; + C3_public.prototype.f4_public = function (m1_c3_f4_arg) { + }; + C3_public.prototype.f5_private = function () { + return new C1_public(); + }; + C3_public.prototype.f6_public = function () { + return new C1_public(); + }; + C3_public.prototype.f7_private = function () { + return new C2_private(); + }; + C3_public.prototype.f8_public = function () { + return new C2_private(); + }; + C3_public.prototype.f9_private = function () { + return new C1_public(); + }; + C3_public.prototype.f10_public = function () { + return new C1_public(); + }; + C3_public.prototype.f11_private = function () { + return new C2_private(); + }; + C3_public.prototype.f12_public = function () { + return new C2_private(); + }; + return C3_public; + })(); + m1.C3_public = C3_public; + var C4_private = (function () { + function C4_private(m1_c4_c1_2) { + } + C4_private.prototype.f1_private = function (m1_c4_f1_arg) { + }; + C4_private.prototype.f2_public = function (m1_c4_f2_arg) { + }; + C4_private.prototype.f3_private = function (m1_c4_f3_arg) { + }; + C4_private.prototype.f4_public = function (m1_c4_f4_arg) { + }; + C4_private.prototype.f5_private = function () { + return new C1_public(); + }; + C4_private.prototype.f6_public = function () { + return new C1_public(); + }; + C4_private.prototype.f7_private = function () { + return new C2_private(); + }; + C4_private.prototype.f8_public = function () { + return new C2_private(); + }; + C4_private.prototype.f9_private = function () { + return new C1_public(); + }; + C4_private.prototype.f10_public = function () { + return new C1_public(); + }; + C4_private.prototype.f11_private = function () { + return new C2_private(); + }; + C4_private.prototype.f12_public = function () { + return new C2_private(); + }; + return C4_private; + })(); + var C5_public = (function () { + function C5_public(m1_c5_c) { + } + return C5_public; + })(); + m1.C5_public = C5_public; + var C6_private = (function () { + function C6_private(m1_c6_c) { + } + return C6_private; + })(); + var C7_public = (function () { + function C7_public(m1_c7_c) { + } + return C7_public; + })(); + m1.C7_public = C7_public; + var C8_private = (function () { + function C8_private(m1_c8_c) { + } + return C8_private; + })(); + function f1_public(m1_f1_arg) { + } + function f2_public(m1_f2_arg) { + } + m1.f2_public = f2_public; + function f3_public(m1_f3_arg) { + } + function f4_public(m1_f4_arg) { + } + m1.f4_public = f4_public; + function f5_public() { + return new C1_public(); + } + function f6_public() { + return new C1_public(); + } + m1.f6_public = f6_public; + function f7_public() { + return new C2_private(); + } + function f8_public() { + return new C2_private(); + } + m1.f8_public = f8_public; + function f9_private() { + return new C1_public(); + } + function f10_public() { + return new C1_public(); + } + m1.f10_public = f10_public; + function f11_private() { + return new C2_private(); + } + function f12_public() { + return new C2_private(); + } + m1.f12_public = f12_public; + })(exports.m1 || (exports.m1 = {})); + var m1 = exports.m1; + var m2; + (function (m2) { + var m2_C1_public = (function () { + function m2_C1_public() { + } + m2_C1_public.prototype.f = function () { + }; + return m2_C1_public; + })(); + m2.m2_C1_public = m2_C1_public; + var m2_C2_private = (function () { + function m2_C2_private() { + } + return m2_C2_private; + })(); + var m2_C3_public = (function () { + function m2_C3_public(m2_c3_c1_2) { + } + m2_C3_public.prototype.f1_private = function (m2_c3_f1_arg) { + }; + m2_C3_public.prototype.f2_public = function (m2_c3_f2_arg) { + }; + m2_C3_public.prototype.f3_private = function (m2_c3_f3_arg) { + }; + m2_C3_public.prototype.f4_public = function (m2_c3_f4_arg) { + }; + m2_C3_public.prototype.f5_private = function () { + return new m2_C1_public(); + }; + m2_C3_public.prototype.f6_public = function () { + return new m2_C1_public(); + }; + m2_C3_public.prototype.f7_private = function () { + return new m2_C2_private(); + }; + m2_C3_public.prototype.f8_public = function () { + return new m2_C2_private(); + }; + m2_C3_public.prototype.f9_private = function () { + return new m2_C1_public(); + }; + m2_C3_public.prototype.f10_public = function () { + return new m2_C1_public(); + }; + m2_C3_public.prototype.f11_private = function () { + return new m2_C2_private(); + }; + m2_C3_public.prototype.f12_public = function () { + return new m2_C2_private(); + }; + return m2_C3_public; + })(); + m2.m2_C3_public = m2_C3_public; + var m2_C4_private = (function () { + function m2_C4_private(m2_c4_c1_2) { + } + m2_C4_private.prototype.f1_private = function (m2_c4_f1_arg) { + }; + m2_C4_private.prototype.f2_public = function (m2_c4_f2_arg) { + }; + m2_C4_private.prototype.f3_private = function (m2_c4_f3_arg) { + }; + m2_C4_private.prototype.f4_public = function (m2_c4_f4_arg) { + }; + m2_C4_private.prototype.f5_private = function () { + return new m2_C1_public(); + }; + m2_C4_private.prototype.f6_public = function () { + return new m2_C1_public(); + }; + m2_C4_private.prototype.f7_private = function () { + return new m2_C2_private(); + }; + m2_C4_private.prototype.f8_public = function () { + return new m2_C2_private(); + }; + m2_C4_private.prototype.f9_private = function () { + return new m2_C1_public(); + }; + m2_C4_private.prototype.f10_public = function () { + return new m2_C1_public(); + }; + m2_C4_private.prototype.f11_private = function () { + return new m2_C2_private(); + }; + m2_C4_private.prototype.f12_public = function () { + return new m2_C2_private(); + }; + return m2_C4_private; + })(); + var m2_C5_public = (function () { + function m2_C5_public(m2_c5_c) { + } + return m2_C5_public; + })(); + m2.m2_C5_public = m2_C5_public; + var m2_C6_private = (function () { + function m2_C6_private(m2_c6_c) { + } + return m2_C6_private; + })(); + var m2_C7_public = (function () { + function m2_C7_public(m2_c7_c) { + } + return m2_C7_public; + })(); + m2.m2_C7_public = m2_C7_public; + var m2_C8_private = (function () { + function m2_C8_private(m2_c8_c) { + } + return m2_C8_private; + })(); + function f1_public(m2_f1_arg) { + } + function f2_public(m2_f2_arg) { + } + m2.f2_public = f2_public; + function f3_public(m2_f3_arg) { + } + function f4_public(m2_f4_arg) { + } + m2.f4_public = f4_public; + function f5_public() { + return new m2_C1_public(); + } + function f6_public() { + return new m2_C1_public(); + } + m2.f6_public = f6_public; + function f7_public() { + return new m2_C2_private(); + } + function f8_public() { + return new m2_C2_private(); + } + m2.f8_public = f8_public; + function f9_private() { + return new m2_C1_public(); + } + function f10_public() { + return new m2_C1_public(); + } + m2.f10_public = f10_public; + function f11_private() { + return new m2_C2_private(); + } + function f12_public() { + return new m2_C2_private(); + } + m2.f12_public = f12_public; + })(m2 || (m2 = {})); + var C5_private = (function () { + function C5_private() { + } + C5_private.prototype.f = function () { + }; + return C5_private; + })(); + var C6_public = (function () { + function C6_public() { + } + return C6_public; + })(); + exports.C6_public = C6_public; + var C7_public = (function () { + function C7_public(c7_c1_2) { + } + C7_public.prototype.f1_private = function (c7_f1_arg) { + }; + C7_public.prototype.f2_public = function (c7_f2_arg) { + }; + C7_public.prototype.f3_private = function (c7_f3_arg) { + }; + C7_public.prototype.f4_public = function (c7_f4_arg) { + }; + C7_public.prototype.f5_private = function () { + return new C6_public(); + }; + C7_public.prototype.f6_public = function () { + return new C6_public(); + }; + C7_public.prototype.f7_private = function () { + return new C5_private(); + }; + C7_public.prototype.f8_public = function () { + return new C5_private(); + }; + C7_public.prototype.f9_private = function () { + return new C6_public(); + }; + C7_public.prototype.f10_public = function () { + return new C6_public(); + }; + C7_public.prototype.f11_private = function () { + return new C5_private(); + }; + C7_public.prototype.f12_public = function () { + return new C5_private(); + }; + return C7_public; + })(); + exports.C7_public = C7_public; + var C8_private = (function () { + function C8_private(c8_c1_2) { + } + C8_private.prototype.f1_private = function (c8_f1_arg) { + }; + C8_private.prototype.f2_public = function (c8_f2_arg) { + }; + C8_private.prototype.f3_private = function (c8_f3_arg) { + }; + C8_private.prototype.f4_public = function (c8_f4_arg) { + }; + C8_private.prototype.f5_private = function () { + return new C6_public(); + }; + C8_private.prototype.f6_public = function () { + return new C6_public(); + }; + C8_private.prototype.f7_private = function () { + return new C5_private(); + }; + C8_private.prototype.f8_public = function () { + return new C5_private(); + }; + C8_private.prototype.f9_private = function () { + return new C6_public(); + }; + C8_private.prototype.f10_public = function () { + return new C6_public(); + }; + C8_private.prototype.f11_private = function () { + return new C5_private(); + }; + C8_private.prototype.f12_public = function () { + return new C5_private(); + }; + return C8_private; + })(); + var C9_public = (function () { + function C9_public(c9_c) { + } + return C9_public; + })(); + exports.C9_public = C9_public; + var C10_private = (function () { + function C10_private(c10_c) { + } + return C10_private; + })(); + var C11_public = (function () { + function C11_public(c11_c) { + } + return C11_public; + })(); + exports.C11_public = C11_public; + var C12_private = (function () { + function C12_private(c12_c) { + } + return C12_private; + })(); + function f1_private(f1_arg) { + } + function f2_public(f2_arg) { + } + exports.f2_public = f2_public; + function f3_private(f3_arg) { + } + function f4_public(f4_arg) { + } + exports.f4_public = f4_public; + function f5_private() { + return new C6_public(); + } + function f6_public() { + return new C6_public(); + } + exports.f6_public = f6_public; + function f7_private() { + return new C5_private(); + } + function f8_public() { + return new C5_private(); + } + exports.f8_public = f8_public; + function f9_private() { + return new C6_public(); + } + function f10_public() { + return new C6_public(); + } + exports.f10_public = f10_public; + function f11_private() { + return new C5_private(); + } + function f12_public() { + return new C5_private(); + } + exports.f12_public = f12_public; +}); diff --git a/tests/baselines/reference/privacyGloGetter.errors.txt b/tests/baselines/reference/privacyGloGetter.errors.txt new file mode 100644 index 0000000000000..d23ed7d149167 --- /dev/null +++ b/tests/baselines/reference/privacyGloGetter.errors.txt @@ -0,0 +1,129 @@ +==== tests/cases/compiler/privacyGloGetter.ts (20 errors) ==== + module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C2_private { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C2_private) { // error + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + + class C4_private { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p3_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + public get p4_public(): C2_private { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C2_private(); + } + + public set p4_public(m1_c3_p4_arg: C2_private) { + ~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } + } + + class C6_public { + } + + class C7_public { + private get p1_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + private get p2_private() { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + ~~~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloImport.errors.txt b/tests/baselines/reference/privacyGloImport.errors.txt new file mode 100644 index 0000000000000..fdba7d6b44130 --- /dev/null +++ b/tests/baselines/reference/privacyGloImport.errors.txt @@ -0,0 +1,211 @@ +==== tests/cases/compiler/privacyGloImport.ts (21 errors) ==== + module m1 { + export module m1_M1_public { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m1_M2_private { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + declare export module "m1_M3_public" { + ~~~~~~ +!!! 'export' modifier must precede 'declare' modifier. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + declare module "m1_M4_private" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + import m1_im1_private = m1_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m1_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + import m1_im3_private = require("m1_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~ +!!! Cannot find external module 'm1_M3_public'. + export var m1_im3_private_v1_public = m1_im3_private.c1; + export var m1_im3_private_v2_public = new m1_im3_private.c1(); + export var m1_im3_private_v3_public = m1_im3_private.f1; + export var m1_im3_private_v4_public = m1_im3_private.f1(); + var m1_im3_private_v1_private = m1_im3_private.c1; + var m1_im3_private_v2_private = new m1_im3_private.c1(); + var m1_im3_private_v3_private = m1_im3_private.f1; + var m1_im3_private_v4_private = m1_im3_private.f1(); + + import m1_im4_private = require("m1_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'm1_M4_private'. + export var m1_im4_private_v1_public = m1_im4_private.c1; + export var m1_im4_private_v2_public = new m1_im4_private.c1(); + export var m1_im4_private_v3_public = m1_im4_private.f1; + export var m1_im4_private_v4_public = m1_im4_private.f1(); + var m1_im4_private_v1_private = m1_im4_private.c1; + var m1_im4_private_v2_private = new m1_im4_private.c1(); + var m1_im4_private_v3_private = m1_im4_private.f1; + var m1_im4_private_v4_private = m1_im4_private.f1(); + + // Parse error to export module + export import m1_im1_public = m1_M1_public; + export import m1_im2_public = m1_M2_private; + export import m1_im3_public = require("m1_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + export import m1_im4_public = require("m1_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + module glo_M1_public { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + declare module "glo_M2_public" { + export function f1(); + export class c1 { + } + export var v1: { new (): c1; }; + export var v2: c1; + } + + declare module "use_glo_M1_public" { + import use_glo_M1_public = glo_M1_public; + export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; + export var use_glo_M1_public_v2_public: use_glo_M1_public; + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M1_public'. + export var use_glo_M1_public_v3_public: ()=> use_glo_M1_public.c1; + var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; }; + var use_glo_M1_public_v2_private: use_glo_M1_public; + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M1_public'. + var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; + + import use_glo_M2_public = require("glo_M2_public"); + export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; + export var use_glo_M2_public_v2_public: use_glo_M2_public; + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M2_public'. + export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; + var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; }; + var use_glo_M2_public_v2_private: use_glo_M2_public; + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M2_public'. + var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; + + module m2 { + import errorImport = require("glo_M2_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + import nonerrorImport = glo_M1_public; + + module m5 { + import m5_errorImport = require("glo_M2_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + import m5_nonerrorImport = glo_M1_public; + } + } + } + + declare module "anotherParseError" { + module m2 { + declare module "abc" { + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + + module m2 { + module "abc2" { + ~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + module "abc3" { + ~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + + module m2 { + import m3 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + module m4 { + var a = 10; + import m2 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloInterface.js b/tests/baselines/reference/privacyGloInterface.js new file mode 100644 index 0000000000000..f4469942b5452 --- /dev/null +++ b/tests/baselines/reference/privacyGloInterface.js @@ -0,0 +1,145 @@ +//// [privacyGloInterface.ts] +module m1 { + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } +} + +class C5_public { + private f1() { + } +} + + +interface C7_public { + (c1: C5_public); + (): C5_public; + + new (c1: C5_public); + new (): C5_public; + + [c: number]: C5_public; + + x: C5_public; + + a?: C5_public; + + f1(a1: C5_public); + f3(): C5_public; +} + +module m3 { + export interface m3_i_public { + f1(): number; + } + + interface m3_i_private { + f2(): string; + } + + interface m3_C1_private extends m3_i_public { + } + interface m3_C2_private extends m3_i_private { + } + export interface m3_C3_public extends m3_i_public { + } + export interface m3_C4_public extends m3_i_private { + } + + interface m3_C5_private extends m3_i_private, m3_i_public { + } + export interface m3_C6_public extends m3_i_private, m3_i_public { + } +} + +interface glo_i_public { + f1(): number; +} + +interface glo_C3_public extends glo_i_public { +} + + +//// [privacyGloInterface.js] +var m1; +(function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); +})(m1 || (m1 = {})); +var C5_public = (function () { + function C5_public() { + } + C5_public.prototype.f1 = function () { + }; + return C5_public; +})(); diff --git a/tests/baselines/reference/privacyGloVar.js b/tests/baselines/reference/privacyGloVar.js new file mode 100644 index 0000000000000..f0a2611979883 --- /dev/null +++ b/tests/baselines/reference/privacyGloVar.js @@ -0,0 +1,157 @@ +//// [privacyGloVar.ts] +module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private C3_v1_private: C1_public; + public C3_v2_public: C1_public; + private C3_v3_private: C2_private; + public C3_v4_public: C2_private; // error + + private C3_v11_private = new C1_public(); + public C3_v12_public = new C1_public(); + private C3_v13_private = new C2_private(); + public C3_v14_public = new C2_private(); // error + + private C3_v21_private: C1_public = new C1_public(); + public C3_v22_public: C1_public = new C1_public(); + private C3_v23_private: C2_private = new C2_private(); + public C3_v24_public: C2_private = new C2_private(); // error + } + + class C4_public { + private C4_v1_private: C1_public; + public C4_v2_public: C1_public; + private C4_v3_private: C2_private; + public C4_v4_public: C2_private; + + private C4_v11_private = new C1_public(); + public C4_v12_public = new C1_public(); + private C4_v13_private = new C2_private(); + public C4_v14_public = new C2_private(); + + private C4_v21_private: C1_public = new C1_public(); + public C4_v22_public: C1_public = new C1_public(); + private C4_v23_private: C2_private = new C2_private(); + public C4_v24_public: C2_private = new C2_private(); + } + + var m1_v1_private: C1_public; + export var m1_v2_public: C1_public; + var m1_v3_private: C2_private; + export var m1_v4_public: C2_private; // error + + var m1_v11_private = new C1_public(); + export var m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + export var m1_v14_public = new C2_private(); //error + + var m1_v21_private: C1_public = new C1_public(); + export var m1_v22_public: C1_public = new C1_public(); + var m1_v23_private: C2_private = new C2_private(); + export var m1_v24_public: C2_private = new C2_private(); // error +} + +class glo_C1_public { + private f1() { + } +} + +class glo_C3_public { + private glo_C3_v1_private: glo_C1_public; + public glo_C3_v2_public: glo_C1_public; + + private glo_C3_v11_private = new glo_C1_public(); + public glo_C3_v12_public = new glo_C1_public(); + + private glo_C3_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C3_v22_public: glo_C1_public = new glo_C1_public(); +} + + +var glo_v2_public: glo_C1_public; +var glo_v12_public = new glo_C1_public(); +var glo_v22_public: glo_C1_public = new glo_C1_public(); + + +//// [privacyGloVar.js] +var m1; +(function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); + var C3_public = (function () { + function C3_public() { + this.C3_v11_private = new C1_public(); + this.C3_v12_public = new C1_public(); + this.C3_v13_private = new C2_private(); + this.C3_v14_public = new C2_private(); + this.C3_v21_private = new C1_public(); + this.C3_v22_public = new C1_public(); + this.C3_v23_private = new C2_private(); + this.C3_v24_public = new C2_private(); + } + return C3_public; + })(); + m1.C3_public = C3_public; + var C4_public = (function () { + function C4_public() { + this.C4_v11_private = new C1_public(); + this.C4_v12_public = new C1_public(); + this.C4_v13_private = new C2_private(); + this.C4_v14_public = new C2_private(); + this.C4_v21_private = new C1_public(); + this.C4_v22_public = new C1_public(); + this.C4_v23_private = new C2_private(); + this.C4_v24_public = new C2_private(); + } + return C4_public; + })(); + var m1_v1_private; + m1.m1_v2_public; + var m1_v3_private; + m1.m1_v4_public; + var m1_v11_private = new C1_public(); + m1.m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + m1.m1_v14_public = new C2_private(); + var m1_v21_private = new C1_public(); + m1.m1_v22_public = new C1_public(); + var m1_v23_private = new C2_private(); + m1.m1_v24_public = new C2_private(); +})(m1 || (m1 = {})); +var glo_C1_public = (function () { + function glo_C1_public() { + } + glo_C1_public.prototype.f1 = function () { + }; + return glo_C1_public; +})(); +var glo_C3_public = (function () { + function glo_C3_public() { + this.glo_C3_v11_private = new glo_C1_public(); + this.glo_C3_v12_public = new glo_C1_public(); + this.glo_C3_v21_private = new glo_C1_public(); + this.glo_C3_v22_public = new glo_C1_public(); + } + return glo_C3_public; +})(); +var glo_v2_public; +var glo_v12_public = new glo_C1_public(); +var glo_v22_public = new glo_C1_public(); diff --git a/tests/baselines/reference/privacyImport.errors.txt b/tests/baselines/reference/privacyImport.errors.txt new file mode 100644 index 0000000000000..5758d6c51070e --- /dev/null +++ b/tests/baselines/reference/privacyImport.errors.txt @@ -0,0 +1,573 @@ +==== tests/cases/compiler/privacyImport.ts (49 errors) ==== + export module m1 { + export module m1_M1_public { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m1_M2_private { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + export declare module "m1_M3_public" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + declare module "m1_M4_private" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + import m1_im1_private = m1_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m1_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + import m1_im3_private = require("m1_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~ +!!! Cannot find external module 'm1_M3_public'. + export var m1_im3_private_v1_public = m1_im3_private.c1; + export var m1_im3_private_v2_public = new m1_im3_private.c1(); + export var m1_im3_private_v3_public = m1_im3_private.f1; + export var m1_im3_private_v4_public = m1_im3_private.f1(); + var m1_im3_private_v1_private = m1_im3_private.c1; + var m1_im3_private_v2_private = new m1_im3_private.c1(); + var m1_im3_private_v3_private = m1_im3_private.f1; + var m1_im3_private_v4_private = m1_im3_private.f1(); + + import m1_im4_private = require("m1_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'm1_M4_private'. + export var m1_im4_private_v1_public = m1_im4_private.c1; + export var m1_im4_private_v2_public = new m1_im4_private.c1(); + export var m1_im4_private_v3_public = m1_im4_private.f1; + export var m1_im4_private_v4_public = m1_im4_private.f1(); + var m1_im4_private_v1_private = m1_im4_private.c1; + var m1_im4_private_v2_private = new m1_im4_private.c1(); + var m1_im4_private_v3_private = m1_im4_private.f1; + var m1_im4_private_v4_private = m1_im4_private.f1(); + + export import m1_im1_public = m1_M1_public; + export import m1_im2_public = m1_M2_private; + export import m1_im3_public = require("m1_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + export import m1_im4_public = require("m1_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + module m2 { + export module m2_M1_public { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m2_M2_private { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + export declare module "m2_M3_public" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + declare module "m2_M4_private" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + + import m1_im1_private = m2_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m2_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + import m1_im3_private = require("m2_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~ +!!! Cannot find external module 'm2_M3_public'. + export var m1_im3_private_v1_public = m1_im3_private.c1; + export var m1_im3_private_v2_public = new m1_im3_private.c1(); + export var m1_im3_private_v3_public = m1_im3_private.f1; + export var m1_im3_private_v4_public = m1_im3_private.f1(); + var m1_im3_private_v1_private = m1_im3_private.c1; + var m1_im3_private_v2_private = new m1_im3_private.c1(); + var m1_im3_private_v3_private = m1_im3_private.f1; + var m1_im3_private_v4_private = m1_im3_private.f1(); + + import m1_im4_private = require("m2_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'm2_M4_private'. + export var m1_im4_private_v1_public = m1_im4_private.c1; + export var m1_im4_private_v2_public = new m1_im4_private.c1(); + export var m1_im4_private_v3_public = m1_im4_private.f1; + export var m1_im4_private_v4_public = m1_im4_private.f1(); + var m1_im4_private_v1_private = m1_im4_private.c1; + var m1_im4_private_v2_private = new m1_im4_private.c1(); + var m1_im4_private_v3_private = m1_im4_private.f1; + var m1_im4_private_v4_private = m1_im4_private.f1(); + + // Parse error to export module + export import m1_im1_public = m2_M1_public; + export import m1_im2_public = m2_M2_private; + export import m1_im3_public = require("m2_M3_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + export import m1_im4_public = require("m2_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + export module glo_M1_public { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + export declare module "glo_M2_public" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + export module glo_M3_private { + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + export declare module "glo_M4_private" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export function f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~ + export class c1 { + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + export var v1: { new (): c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var v2: c1; + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + + import glo_im1_private = glo_M1_public; + export var glo_im1_private_v1_public = glo_im1_private.c1; + export var glo_im1_private_v2_public = new glo_im1_private.c1(); + export var glo_im1_private_v3_public = glo_im1_private.f1; + export var glo_im1_private_v4_public = glo_im1_private.f1(); + var glo_im1_private_v1_private = glo_im1_private.c1; + var glo_im1_private_v2_private = new glo_im1_private.c1(); + var glo_im1_private_v3_private = glo_im1_private.f1; + var glo_im1_private_v4_private = glo_im1_private.f1(); + + + import glo_im2_private = require("glo_M2_public"); + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M2_public'. + export var glo_im2_private_v1_public = glo_im2_private.c1; + export var glo_im2_private_v2_public = new glo_im2_private.c1(); + export var glo_im2_private_v3_public = glo_im2_private.f1; + export var glo_im2_private_v4_public = glo_im2_private.f1(); + var glo_im2_private_v1_private = glo_im2_private.c1; + var glo_im2_private_v2_private = new glo_im2_private.c1(); + var glo_im2_private_v3_private = glo_im2_private.f1; + var glo_im2_private_v4_private = glo_im2_private.f1(); + + import glo_im3_private = glo_M3_private; + export var glo_im3_private_v1_public = glo_im3_private.c1; + export var glo_im3_private_v2_public = new glo_im3_private.c1(); + export var glo_im3_private_v3_public = glo_im3_private.f1; + export var glo_im3_private_v4_public = glo_im3_private.f1(); + var glo_im3_private_v1_private = glo_im3_private.c1; + var glo_im3_private_v2_private = new glo_im3_private.c1(); + var glo_im3_private_v3_private = glo_im3_private.f1; + var glo_im3_private_v4_private = glo_im3_private.f1(); + + import glo_im4_private = require("glo_M4_private"); + ~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M4_private'. + export var glo_im4_private_v1_public = glo_im4_private.c1; + export var glo_im4_private_v2_public = new glo_im4_private.c1(); + export var glo_im4_private_v3_public = glo_im4_private.f1; + export var glo_im4_private_v4_public = glo_im4_private.f1(); + var glo_im4_private_v1_private = glo_im4_private.c1; + var glo_im4_private_v2_private = new glo_im4_private.c1(); + var glo_im4_private_v3_private = glo_im4_private.f1; + var glo_im4_private_v4_private = glo_im4_private.f1(); + + // Parse error to export module + export import glo_im1_public = glo_M1_public; + export import glo_im2_public = glo_M3_private; + export import glo_im3_public = require("glo_M2_public"); + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M2_public'. + export import glo_im4_public = require("glo_M4_private"); + ~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M4_private'. + + + export declare module "use_glo_M1_public" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import use_glo_M1_public = glo_M1_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M1_public_v2_public: use_glo_M1_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M1_public'. + export var use_glo_M1_public_v3_public: () => use_glo_M1_public.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M1_public_v2_private: use_glo_M1_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M1_public'. + var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + import use_glo_M2_public = require("glo_M2_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M2_public'. + export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M2_public_v2_public: use_glo_M2_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M2_public_v2_private: use_glo_M2_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + module m2 { + ~~~~~~~~~~~~~~~ + import errorImport = require("glo_M2_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import nonerrorImport = glo_M1_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + module m5 { + ~~~~~~~~~~~~~~~~~~~ + import m5_errorImport = require("glo_M2_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import m5_nonerrorImport = glo_M1_public; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + + declare module "use_glo_M3_private" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import use_glo_M3_private = glo_M3_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M3_private_v1_public: { new (): use_glo_M3_private.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M3_private_v2_public: use_glo_M3_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M3_private'. + export var use_glo_M3_private_v3_public: () => use_glo_M3_private.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M3_private_v1_private: { new (): use_glo_M3_private.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M3_private_v2_private: use_glo_M3_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'use_glo_M3_private'. + var use_glo_M3_private_v3_private: () => use_glo_M3_private.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + import use_glo_M4_private = require("glo_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'glo_M4_private'. + export var use_glo_M4_private_v1_public: { new (): use_glo_M4_private.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M4_private_v2_public: use_glo_M4_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var use_glo_M4_private_v3_public: () => use_glo_M4_private.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M4_private_v1_private: { new (): use_glo_M4_private.c1; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M4_private_v2_private: use_glo_M4_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var use_glo_M4_private_v3_private: () => use_glo_M4_private.c1; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + module m2 { + ~~~~~~~~~~~~~~~ + import errorImport = require("glo_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import nonerrorImport = glo_M3_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + module m5 { + ~~~~~~~~~~~~~~~~~~~ + import m5_errorImport = require("glo_M4_private"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + import m5_nonerrorImport = glo_M3_private; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + declare module "anotherParseError" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + module m2 { + ~~~~~~~~~~~~~~~ + declare module "abc" { + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~~~~~ + + + module m2 { + ~~~~~~~~~~~~~~~ + module "abc2" { + ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~~~~~ + module "abc3" { + ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ + } + ~~~~~ + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + declare export module "anotherParseError2" { + ~~~~~~ +!!! 'export' modifier must precede 'declare' modifier. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + module m2 { + ~~~~~~~~~~~~~~~ + declare module "abc" { + ~~~~~~~ +!!! A 'declare' modifier cannot be used in an already ambient context. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~~~~~ + + + module m2 { + ~~~~~~~~~~~~~~~ + module "abc2" { + ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + ~~~~~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~~~~~ + module "abc3" { + ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ + } + ~~~~~ + ~~~~~ +!!! Ambient external modules cannot be nested in other modules. + } + ~ +!!! Ambient external modules cannot be nested in other modules. + + module m2 { + import m3 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + module m4 { + var a = 10; + import m2 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + } + + export module m3 { + import m3 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + module m4 { + var a = 10; + import m2 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Import declarations in an internal module cannot reference an external module. + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyInterface.js b/tests/baselines/reference/privacyInterface.js new file mode 100644 index 0000000000000..c368b18b10a4e --- /dev/null +++ b/tests/baselines/reference/privacyInterface.js @@ -0,0 +1,312 @@ +//// [privacyInterface.ts] +export module m1 { + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } +} + + +module m2 { + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } +} + +export class C5_public { + private f1() { + } +} + + +class C6_private { +} + +export interface C7_public { + (c1: C5_public); + (c1: C6_private); + (): C5_public; + (c2: number): C6_private; + + new (c1: C5_public); + new (c1: C6_private); + new (): C5_public; + new (c2: number): C6_private; + + [c: number]: C5_public; + [c: string]: C6_private; + + x: C5_public; + y: C6_private; + + a?: C5_public; + b?: C6_private; + + f1(a1: C5_public); + f2(a1: C6_private); + f3(): C5_public; + f4(): C6_private; + +} + +interface C8_private { + (c1: C5_public); + (c1: C6_private); + (): C5_public; + (c2: number): C6_private; + + new (c1: C5_public); + new (c1: C6_private); + new (): C5_public; + new (c2: number): C6_private; + + [c: number]: C5_public; + [c: string]: C6_private; + + x: C5_public; + y: C6_private; + + a?: C5_public; + b?: C6_private; + + f1(a1: C5_public); + f2(a1: C6_private); + f3(): C5_public; + f4(): C6_private; + +} + +export module m3 { + export interface m3_i_public { + f1(): number; + } + + interface m3_i_private { + f2(): string; + } + + interface m3_C1_private extends m3_i_public { + } + interface m3_C2_private extends m3_i_private { + } + export interface m3_C3_public extends m3_i_public { + } + export interface m3_C4_public extends m3_i_private { + } + + interface m3_C5_private extends m3_i_private, m3_i_public { + } + export interface m3_C6_public extends m3_i_private, m3_i_public { + } +} + + +module m4 { + export interface m4_i_public { + f1(): number; + } + + interface m4_i_private { + f2(): string; + } + + interface m4_C1_private extends m4_i_public { + } + interface m4_C2_private extends m4_i_private { + } + export interface m4_C3_public extends m4_i_public { + } + export interface m4_C4_public extends m4_i_private { + } + + interface m4_C5_private extends m4_i_private, m4_i_public { + } + export interface m4_C6_public extends m4_i_private, m4_i_public { + } +} + +export interface glo_i_public { + f1(): number; +} + +interface glo_i_private { + f2(): string; +} + +interface glo_C1_private extends glo_i_public { +} +interface glo_C2_private extends glo_i_private { +} +export interface glo_C3_public extends glo_i_public { +} +export interface glo_C4_public extends glo_i_private { +} + +interface glo_C5_private extends glo_i_private, glo_i_public { +} +export interface glo_C6_public extends glo_i_private, glo_i_public { +} + +//// [privacyInterface.js] +(function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var m2; +(function (m2) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m2.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); +})(m2 || (m2 = {})); +var C5_public = (function () { + function C5_public() { + } + C5_public.prototype.f1 = function () { + }; + return C5_public; +})(); +exports.C5_public = C5_public; +var C6_private = (function () { + function C6_private() { + } + return C6_private; +})(); diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js new file mode 100644 index 0000000000000..f597ff7b1e748 --- /dev/null +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.js @@ -0,0 +1,293 @@ +//// [privacyLocalInternalReferenceImportWithExport.ts] +// private elements +module m_private { + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + export class c { + } + } + export module mu_private { + export interface i { + } + } +} + +// Public elements +export module m_public { + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + export class c { + } + } + export module mu_public { + export interface i { + } + } +} + +export module import_public { + // Privacy errors - importing private elements + export import im_public_c_private = m_private.c_private; + export import im_public_e_private = m_private.e_private; + export import im_public_f_private = m_private.f_private; + export import im_public_v_private = m_private.v_private; + export import im_public_i_private = m_private.i_private; + export import im_public_mi_private = m_private.mi_private; + export import im_public_mu_private = m_private.mu_private; + + // Usage of privacy error imports + var privateUse_im_public_c_private = new im_public_c_private(); + export var publicUse_im_public_c_private = new im_public_c_private(); + var privateUse_im_public_e_private = im_public_e_private.Happy; + export var publicUse_im_public_e_private = im_public_e_private.Grumpy; + var privateUse_im_public_f_private = im_public_f_private(); + export var publicUse_im_public_f_private = im_public_f_private(); + var privateUse_im_public_v_private = im_public_v_private; + export var publicUse_im_public_v_private = im_public_v_private; + var privateUse_im_public_i_private: im_public_i_private; + export var publicUse_im_public_i_private: im_public_i_private; + var privateUse_im_public_mi_private = new im_public_mi_private.c(); + export var publicUse_im_public_mi_private = new im_public_mi_private.c(); + var privateUse_im_public_mu_private: im_public_mu_private.i; + export var publicUse_im_public_mu_private: im_public_mu_private.i; + + + // No Privacy errors - importing public elements + export import im_public_c_public = m_public.c_public; + export import im_public_e_public = m_public.e_public; + export import im_public_f_public = m_public.f_public; + export import im_public_v_public = m_public.v_public; + export import im_public_i_public = m_public.i_public; + export import im_public_mi_public = m_public.mi_public; + export import im_public_mu_public = m_public.mu_public; + + // Usage of above + var privateUse_im_public_c_public = new im_public_c_public(); + export var publicUse_im_public_c_public = new im_public_c_public(); + var privateUse_im_public_e_public = im_public_e_public.Happy; + export var publicUse_im_public_e_public = im_public_e_public.Grumpy; + var privateUse_im_public_f_public = im_public_f_public(); + export var publicUse_im_public_f_public = im_public_f_public(); + var privateUse_im_public_v_public = im_public_v_public; + export var publicUse_im_public_v_public = im_public_v_public; + var privateUse_im_public_i_public: im_public_i_public; + export var publicUse_im_public_i_public: im_public_i_public; + var privateUse_im_public_mi_public = new im_public_mi_public.c(); + export var publicUse_im_public_mi_public = new im_public_mi_public.c(); + var privateUse_im_public_mu_public: im_public_mu_public.i; + export var publicUse_im_public_mu_public: im_public_mu_public.i; +} + +module import_private { + // No Privacy errors - importing private elements + export import im_private_c_private = m_private.c_private; + export import im_private_e_private = m_private.e_private; + export import im_private_f_private = m_private.f_private; + export import im_private_v_private = m_private.v_private; + export import im_private_i_private = m_private.i_private; + export import im_private_mi_private = m_private.mi_private; + export import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + // No privacy Error - importing public elements + export import im_private_c_public = m_public.c_public; + export import im_private_e_public = m_public.e_public; + export import im_private_f_public = m_public.f_public; + export import im_private_v_public = m_public.v_public; + export import im_private_i_public = m_public.i_public; + export import im_private_mi_public = m_public.mi_public; + export import im_private_mu_public = m_public.mu_public; + + // Usage of no privacy error imports + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; +} + +//// [privacyLocalInternalReferenceImportWithExport.js] +var m_private; +(function (m_private) { + var c_private = (function () { + function c_private() { + } + return c_private; + })(); + m_private.c_private = c_private; + (function (e_private) { + e_private[e_private["Happy"] = 0] = "Happy"; + e_private[e_private["Grumpy"] = 1] = "Grumpy"; + })(m_private.e_private || (m_private.e_private = {})); + var e_private = m_private.e_private; + function f_private() { + return new c_private(); + } + m_private.f_private = f_private; + m_private.v_private = new c_private(); + (function (mi_private) { + var c = (function () { + function c() { + } + return c; + })(); + mi_private.c = c; + })(m_private.mi_private || (m_private.mi_private = {})); + var mi_private = m_private.mi_private; +})(m_private || (m_private = {})); +(function (m_public) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + m_public.c_public = c_public; + (function (e_public) { + e_public[e_public["Happy"] = 0] = "Happy"; + e_public[e_public["Grumpy"] = 1] = "Grumpy"; + })(m_public.e_public || (m_public.e_public = {})); + var e_public = m_public.e_public; + function f_public() { + return new c_public(); + } + m_public.f_public = f_public; + m_public.v_public = 10; + (function (mi_public) { + var c = (function () { + function c() { + } + return c; + })(); + mi_public.c = c; + })(m_public.mi_public || (m_public.mi_public = {})); + var mi_public = m_public.mi_public; +})(exports.m_public || (exports.m_public = {})); +var m_public = exports.m_public; +(function (import_public) { + import_public.im_public_c_private = m_private.c_private; + import_public.im_public_e_private = m_private.e_private; + import_public.im_public_f_private = m_private.f_private; + import_public.im_public_v_private = m_private.v_private; + import_public.im_public_mi_private = m_private.mi_private; + var privateUse_im_public_c_private = new import_public.im_public_c_private(); + import_public.publicUse_im_public_c_private = new import_public.im_public_c_private(); + var privateUse_im_public_e_private = 0 /* Happy */; + import_public.publicUse_im_public_e_private = 1 /* Grumpy */; + var privateUse_im_public_f_private = import_public.im_public_f_private(); + import_public.publicUse_im_public_f_private = import_public.im_public_f_private(); + var privateUse_im_public_v_private = import_public.im_public_v_private; + import_public.publicUse_im_public_v_private = import_public.im_public_v_private; + var privateUse_im_public_i_private; + import_public.publicUse_im_public_i_private; + var privateUse_im_public_mi_private = new import_public.im_public_mi_private.c(); + import_public.publicUse_im_public_mi_private = new import_public.im_public_mi_private.c(); + var privateUse_im_public_mu_private; + import_public.publicUse_im_public_mu_private; + import_public.im_public_c_public = m_public.c_public; + import_public.im_public_e_public = m_public.e_public; + import_public.im_public_f_public = m_public.f_public; + import_public.im_public_v_public = m_public.v_public; + import_public.im_public_mi_public = m_public.mi_public; + var privateUse_im_public_c_public = new import_public.im_public_c_public(); + import_public.publicUse_im_public_c_public = new import_public.im_public_c_public(); + var privateUse_im_public_e_public = 0 /* Happy */; + import_public.publicUse_im_public_e_public = 1 /* Grumpy */; + var privateUse_im_public_f_public = import_public.im_public_f_public(); + import_public.publicUse_im_public_f_public = import_public.im_public_f_public(); + var privateUse_im_public_v_public = import_public.im_public_v_public; + import_public.publicUse_im_public_v_public = import_public.im_public_v_public; + var privateUse_im_public_i_public; + import_public.publicUse_im_public_i_public; + var privateUse_im_public_mi_public = new import_public.im_public_mi_public.c(); + import_public.publicUse_im_public_mi_public = new import_public.im_public_mi_public.c(); + var privateUse_im_public_mu_public; + import_public.publicUse_im_public_mu_public; +})(exports.import_public || (exports.import_public = {})); +var import_public = exports.import_public; +var import_private; +(function (import_private) { + import_private.im_private_c_private = m_private.c_private; + import_private.im_private_e_private = m_private.e_private; + import_private.im_private_f_private = m_private.f_private; + import_private.im_private_v_private = m_private.v_private; + import_private.im_private_mi_private = m_private.mi_private; + var privateUse_im_private_c_private = new import_private.im_private_c_private(); + import_private.publicUse_im_private_c_private = new import_private.im_private_c_private(); + var privateUse_im_private_e_private = 0 /* Happy */; + import_private.publicUse_im_private_e_private = 1 /* Grumpy */; + var privateUse_im_private_f_private = import_private.im_private_f_private(); + import_private.publicUse_im_private_f_private = import_private.im_private_f_private(); + var privateUse_im_private_v_private = import_private.im_private_v_private; + import_private.publicUse_im_private_v_private = import_private.im_private_v_private; + var privateUse_im_private_i_private; + import_private.publicUse_im_private_i_private; + var privateUse_im_private_mi_private = new import_private.im_private_mi_private.c(); + import_private.publicUse_im_private_mi_private = new import_private.im_private_mi_private.c(); + var privateUse_im_private_mu_private; + import_private.publicUse_im_private_mu_private; + import_private.im_private_c_public = m_public.c_public; + import_private.im_private_e_public = m_public.e_public; + import_private.im_private_f_public = m_public.f_public; + import_private.im_private_v_public = m_public.v_public; + import_private.im_private_mi_public = m_public.mi_public; + var privateUse_im_private_c_public = new import_private.im_private_c_public(); + import_private.publicUse_im_private_c_public = new import_private.im_private_c_public(); + var privateUse_im_private_e_public = 0 /* Happy */; + import_private.publicUse_im_private_e_public = 1 /* Grumpy */; + var privateUse_im_private_f_public = import_private.im_private_f_public(); + import_private.publicUse_im_private_f_public = import_private.im_private_f_public(); + var privateUse_im_private_v_public = import_private.im_private_v_public; + import_private.publicUse_im_private_v_public = import_private.im_private_v_public; + var privateUse_im_private_i_public; + import_private.publicUse_im_private_i_public; + var privateUse_im_private_mi_public = new import_private.im_private_mi_public.c(); + import_private.publicUse_im_private_mi_public = new import_private.im_private_mi_public.c(); + var privateUse_im_private_mu_public; + import_private.publicUse_im_private_mu_public; +})(import_private || (import_private = {})); diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js new file mode 100644 index 0000000000000..b799a464b623a --- /dev/null +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.js @@ -0,0 +1,295 @@ +//// [privacyLocalInternalReferenceImportWithoutExport.ts] +// private elements +module m_private { + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + export class c { + } + } + export module mu_private { + export interface i { + } + } +} + +// Public elements +export module m_public { + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + export class c { + } + } + export module mu_public { + export interface i { + } + } +} + +export module import_public { + // No Privacy errors - importing private elements + import im_private_c_private = m_private.c_private; + import im_private_e_private = m_private.e_private; + import im_private_f_private = m_private.f_private; + import im_private_v_private = m_private.v_private; + import im_private_i_private = m_private.i_private; + import im_private_mi_private = m_private.mi_private; + import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + + // No Privacy errors - importing public elements + import im_private_c_public = m_public.c_public; + import im_private_e_public = m_public.e_public; + import im_private_f_public = m_public.f_public; + import im_private_v_public = m_public.v_public; + import im_private_i_public = m_public.i_public; + import im_private_mi_public = m_public.mi_public; + import im_private_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; +} + +module import_private { + // No Privacy errors - importing private elements + import im_private_c_private = m_private.c_private; + import im_private_e_private = m_private.e_private; + import im_private_f_private = m_private.f_private; + import im_private_v_private = m_private.v_private; + import im_private_i_private = m_private.i_private; + import im_private_mi_private = m_private.mi_private; + import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + // No privacy Error - importing public elements + import im_private_c_public = m_public.c_public; + import im_private_e_public = m_public.e_public; + import im_private_f_public = m_public.f_public; + import im_private_v_public = m_public.v_public; + import im_private_i_public = m_public.i_public; + import im_private_mi_public = m_public.mi_public; + import im_private_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; +} + +//// [privacyLocalInternalReferenceImportWithoutExport.js] +define(["require", "exports"], function (require, exports) { + var m_private; + (function (m_private) { + var c_private = (function () { + function c_private() { + } + return c_private; + })(); + m_private.c_private = c_private; + (function (e_private) { + e_private[e_private["Happy"] = 0] = "Happy"; + e_private[e_private["Grumpy"] = 1] = "Grumpy"; + })(m_private.e_private || (m_private.e_private = {})); + var e_private = m_private.e_private; + function f_private() { + return new c_private(); + } + m_private.f_private = f_private; + m_private.v_private = new c_private(); + (function (mi_private) { + var c = (function () { + function c() { + } + return c; + })(); + mi_private.c = c; + })(m_private.mi_private || (m_private.mi_private = {})); + var mi_private = m_private.mi_private; + })(m_private || (m_private = {})); + (function (m_public) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + m_public.c_public = c_public; + (function (e_public) { + e_public[e_public["Happy"] = 0] = "Happy"; + e_public[e_public["Grumpy"] = 1] = "Grumpy"; + })(m_public.e_public || (m_public.e_public = {})); + var e_public = m_public.e_public; + function f_public() { + return new c_public(); + } + m_public.f_public = f_public; + m_public.v_public = 10; + (function (mi_public) { + var c = (function () { + function c() { + } + return c; + })(); + mi_public.c = c; + })(m_public.mi_public || (m_public.mi_public = {})); + var mi_public = m_public.mi_public; + })(exports.m_public || (exports.m_public = {})); + var m_public = exports.m_public; + (function (import_public) { + var im_private_c_private = m_private.c_private; + var im_private_e_private = m_private.e_private; + var im_private_f_private = m_private.f_private; + var im_private_v_private = m_private.v_private; + var im_private_mi_private = m_private.mi_private; + var privateUse_im_private_c_private = new im_private_c_private(); + import_public.publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = 0 /* Happy */; + import_public.publicUse_im_private_e_private = 1 /* Grumpy */; + var privateUse_im_private_f_private = im_private_f_private(); + import_public.publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + import_public.publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private; + import_public.publicUse_im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + import_public.publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private; + import_public.publicUse_im_private_mu_private; + var im_private_c_public = m_public.c_public; + var im_private_e_public = m_public.e_public; + var im_private_f_public = m_public.f_public; + var im_private_v_public = m_public.v_public; + var im_private_mi_public = m_public.mi_public; + var privateUse_im_private_c_public = new im_private_c_public(); + import_public.publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = 0 /* Happy */; + import_public.publicUse_im_private_e_public = 1 /* Grumpy */; + var privateUse_im_private_f_public = im_private_f_public(); + import_public.publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + import_public.publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public; + import_public.publicUse_im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + import_public.publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public; + import_public.publicUse_im_private_mu_public; + })(exports.import_public || (exports.import_public = {})); + var import_public = exports.import_public; + var import_private; + (function (import_private) { + var im_private_c_private = m_private.c_private; + var im_private_e_private = m_private.e_private; + var im_private_f_private = m_private.f_private; + var im_private_v_private = m_private.v_private; + var im_private_mi_private = m_private.mi_private; + var privateUse_im_private_c_private = new im_private_c_private(); + import_private.publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = 0 /* Happy */; + import_private.publicUse_im_private_e_private = 1 /* Grumpy */; + var privateUse_im_private_f_private = im_private_f_private(); + import_private.publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + import_private.publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private; + import_private.publicUse_im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + import_private.publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private; + import_private.publicUse_im_private_mu_private; + var im_private_c_public = m_public.c_public; + var im_private_e_public = m_public.e_public; + var im_private_f_public = m_public.f_public; + var im_private_v_public = m_public.v_public; + var im_private_mi_public = m_public.mi_public; + var privateUse_im_private_c_public = new im_private_c_public(); + import_private.publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = 0 /* Happy */; + import_private.publicUse_im_private_e_public = 1 /* Grumpy */; + var privateUse_im_private_f_public = im_private_f_public(); + import_private.publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + import_private.publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public; + import_private.publicUse_im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + import_private.publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public; + import_private.publicUse_im_private_mu_public; + })(import_private || (import_private = {})); +}); diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.errors.txt b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.errors.txt new file mode 100644 index 0000000000000..7a102fce1f209 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_core.ts (6 errors) ==== + // Privacy errors - importing private elements + export import im_public_mi_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require"); + export import im_public_mu_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require1"); + export import im_public_mi_public = require("m"); + ~~~ +!!! Cannot find external module 'm'. + export import im_public_mu_public = require("m2"); + ~~~~ +!!! Cannot find external module 'm2'. + + // Usage of privacy error imports + var privateUse_im_public_mi_private = new im_public_mi_private.c_private(); + ~~~~~~~~~ +!!! Property 'c_private' does not exist on type 'typeof "tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require"'. + export var publicUse_im_public_mi_private = new im_public_mi_private.c_private(); + ~~~~~~~~~ +!!! Property 'c_private' does not exist on type 'typeof "tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require"'. + var privateUse_im_public_mu_private = new im_public_mu_private.c_private(); + ~~~~~~~~~ +!!! Property 'c_private' does not exist on type 'typeof "tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require1"'. + export var publicUse_im_public_mu_private = new im_public_mu_private.c_private(); + ~~~~~~~~~ +!!! Property 'c_private' does not exist on type 'typeof "tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require1"'. + var privateUse_im_public_mi_public = new im_public_mi_public.c_public(); + export var publicUse_im_public_mi_public = new im_public_mi_public.c_public(); + var privateUse_im_public_mi_public = new im_public_mi_public.c_public(); + export var publicUse_im_public_mi_public = new im_public_mi_public.c_public(); + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require.ts (0 errors) ==== + // Public elements + export class c_public { + foo: string; + } + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require1.ts (0 errors) ==== + export class c_public { + bar: string; + } + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require2.ts (0 errors) ==== + // private elements + // Export - Error ambient modules allowed only in global + declare module 'm' { + export class c_private { + baz: string; + } + } + + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport_require3.ts (0 errors) ==== + declare module 'm2' { + export class c_private { + bing: string; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js new file mode 100644 index 0000000000000..af8681e789990 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.js @@ -0,0 +1,74 @@ +//// [tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithExport.ts] //// + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require.ts] +// Public elements +export class c_public { + foo: string; +} + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require1.ts] +export class c_public { + bar: string; +} + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require2.ts] +// private elements +// Export - Error ambient modules allowed only in global +declare module 'm' { + export class c_private { + baz: string; + } +} + + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require3.ts] +declare module 'm2' { + export class c_private { + bing: string; + } +} + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_core.ts] +// Privacy errors - importing private elements +export import im_public_mi_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require"); +export import im_public_mu_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require1"); +export import im_public_mi_public = require("m"); +export import im_public_mu_public = require("m2"); + +// Usage of privacy error imports +var privateUse_im_public_mi_private = new im_public_mi_private.c_private(); +export var publicUse_im_public_mi_private = new im_public_mi_private.c_private(); +var privateUse_im_public_mu_private = new im_public_mu_private.c_private(); +export var publicUse_im_public_mu_private = new im_public_mu_private.c_private(); +var privateUse_im_public_mi_public = new im_public_mi_public.c_public(); +export var publicUse_im_public_mi_public = new im_public_mi_public.c_public(); +var privateUse_im_public_mi_public = new im_public_mi_public.c_public(); +export var publicUse_im_public_mi_public = new im_public_mi_public.c_public(); + + +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require.js] +var c_public = (function () { + function c_public() { + } + return c_public; +})(); +exports.c_public = c_public; +//// [privacyTopLevelAmbientExternalModuleImportWithExport_require1.js] +var c_public = (function () { + function c_public() { + } + return c_public; +})(); +exports.c_public = c_public; +//// [privacyTopLevelAmbientExternalModuleImportWithExport_core.js] +exports.im_public_mi_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require"); +exports.im_public_mu_private = require("privacyTopLevelAmbientExternalModuleImportWithExport_require1"); +exports.im_public_mi_public = require("m"); +var privateUse_im_public_mi_private = new exports.im_public_mi_private.c_private(); +exports.publicUse_im_public_mi_private = new exports.im_public_mi_private.c_private(); +var privateUse_im_public_mu_private = new exports.im_public_mu_private.c_private(); +exports.publicUse_im_public_mu_private = new exports.im_public_mu_private.c_private(); +var privateUse_im_public_mi_public = new exports.im_public_mi_public.c_public(); +exports.publicUse_im_public_mi_public = new exports.im_public_mi_public.c_public(); +var privateUse_im_public_mi_public = new exports.im_public_mi_public.c_public(); +exports.publicUse_im_public_mi_public = new exports.im_public_mi_public.c_public(); diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.errors.txt b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.errors.txt new file mode 100644 index 0000000000000..359ee29c2d749 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport_core.ts (2 errors) ==== + // Privacy errors - importing private elements + import im_private_mi_private = require("m"); + ~~~ +!!! Cannot find external module 'm'. + import im_private_mu_private = require("m2"); + ~~~~ +!!! Cannot find external module 'm2'. + import im_private_mi_public = require("privacyTopLevelAmbientExternalModuleImportWithoutExport_require"); + import im_private_mu_public = require("privacyTopLevelAmbientExternalModuleImportWithoutExport_require1"); + + // Usage of privacy error imports + var privateUse_im_private_mi_private = new im_private_mi_private.c_private(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c_private(); + var privateUse_im_private_mu_private = new im_private_mu_private.c_private(); + export var publicUse_im_private_mu_private = new im_private_mu_private.c_private(); + var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c_public(); + var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c_public(); + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport_require.ts (0 errors) ==== + + // Public elements + export class c_public { + foo: string; + } + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport_require1.ts (0 errors) ==== + export class c_public { + bar: string; + } + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport_require2.ts (0 errors) ==== + // private elements + // Export - Error ambient modules allowed only in global + declare module 'm' { + export class c_private { + baz: string + } + } + +==== tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport_require3.ts (0 errors) ==== + declare module 'm2' { + export class c_private { + bing: string; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js new file mode 100644 index 0000000000000..5aa6b762a0217 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.js @@ -0,0 +1,77 @@ +//// [tests/cases/compiler/privacyTopLevelAmbientExternalModuleImportWithoutExport.ts] //// + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require.ts] + +// Public elements +export class c_public { + foo: string; +} + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require1.ts] +export class c_public { + bar: string; +} + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require2.ts] +// private elements +// Export - Error ambient modules allowed only in global +declare module 'm' { + export class c_private { + baz: string + } +} + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require3.ts] +declare module 'm2' { + export class c_private { + bing: string; + } +} + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_core.ts] +// Privacy errors - importing private elements +import im_private_mi_private = require("m"); +import im_private_mu_private = require("m2"); +import im_private_mi_public = require("privacyTopLevelAmbientExternalModuleImportWithoutExport_require"); +import im_private_mu_public = require("privacyTopLevelAmbientExternalModuleImportWithoutExport_require1"); + +// Usage of privacy error imports +var privateUse_im_private_mi_private = new im_private_mi_private.c_private(); +export var publicUse_im_private_mi_private = new im_private_mi_private.c_private(); +var privateUse_im_private_mu_private = new im_private_mu_private.c_private(); +export var publicUse_im_private_mu_private = new im_private_mu_private.c_private(); +var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); +export var publicUse_im_private_mi_public = new im_private_mi_public.c_public(); +var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); +export var publicUse_im_private_mi_public = new im_private_mi_public.c_public(); + + +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require.js] +define(["require", "exports"], function (require, exports) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + exports.c_public = c_public; +}); +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_require1.js] +define(["require", "exports"], function (require, exports) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + exports.c_public = c_public; +}); +//// [privacyTopLevelAmbientExternalModuleImportWithoutExport_core.js] +define(["require", "exports", "m", "m2", "privacyTopLevelAmbientExternalModuleImportWithoutExport_require"], function (require, exports, im_private_mi_private, im_private_mu_private, im_private_mi_public) { + var privateUse_im_private_mi_private = new im_private_mi_private.c_private(); + exports.publicUse_im_private_mi_private = new im_private_mi_private.c_private(); + var privateUse_im_private_mu_private = new im_private_mu_private.c_private(); + exports.publicUse_im_private_mu_private = new im_private_mu_private.c_private(); + var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); + exports.publicUse_im_private_mi_public = new im_private_mi_public.c_public(); + var privateUse_im_private_mi_public = new im_private_mi_public.c_public(); + exports.publicUse_im_private_mi_public = new im_private_mi_public.c_public(); +}); diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js new file mode 100644 index 0000000000000..5ef31d28d6eae --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.js @@ -0,0 +1,198 @@ +//// [privacyTopLevelInternalReferenceImportWithExport.ts] +// private elements +module m_private { + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + export class c { + } + } + export module mu_private { + export interface i { + } + } +} + +// Public elements +export module m_public { + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + export class c { + } + } + export module mu_public { + export interface i { + } + } +} + +// Privacy errors - importing private elements +export import im_public_c_private = m_private.c_private; +export import im_public_e_private = m_private.e_private; +export import im_public_f_private = m_private.f_private; +export import im_public_v_private = m_private.v_private; +export import im_public_i_private = m_private.i_private; +export import im_public_mi_private = m_private.mi_private; +export import im_public_mu_private = m_private.mu_private; + +// Usage of privacy error imports +var privateUse_im_public_c_private = new im_public_c_private(); +export var publicUse_im_public_c_private = new im_public_c_private(); +var privateUse_im_public_e_private = im_public_e_private.Happy; +export var publicUse_im_public_e_private = im_public_e_private.Grumpy; +var privateUse_im_public_f_private = im_public_f_private(); +export var publicUse_im_public_f_private = im_public_f_private(); +var privateUse_im_public_v_private = im_public_v_private; +export var publicUse_im_public_v_private = im_public_v_private; +var privateUse_im_public_i_private: im_public_i_private; +export var publicUse_im_public_i_private: im_public_i_private; +var privateUse_im_public_mi_private = new im_public_mi_private.c(); +export var publicUse_im_public_mi_private = new im_public_mi_private.c(); +var privateUse_im_public_mu_private: im_public_mu_private.i; +export var publicUse_im_public_mu_private: im_public_mu_private.i; + + +// No Privacy errors - importing public elements +export import im_public_c_public = m_public.c_public; +export import im_public_e_public = m_public.e_public; +export import im_public_f_public = m_public.f_public; +export import im_public_v_public = m_public.v_public; +export import im_public_i_public = m_public.i_public; +export import im_public_mi_public = m_public.mi_public; +export import im_public_mu_public = m_public.mu_public; + +// Usage of above decls +var privateUse_im_public_c_public = new im_public_c_public(); +export var publicUse_im_public_c_public = new im_public_c_public(); +var privateUse_im_public_e_public = im_public_e_public.Happy; +export var publicUse_im_public_e_public = im_public_e_public.Grumpy; +var privateUse_im_public_f_public = im_public_f_public(); +export var publicUse_im_public_f_public = im_public_f_public(); +var privateUse_im_public_v_public = im_public_v_public; +export var publicUse_im_public_v_public = im_public_v_public; +var privateUse_im_public_i_public: im_public_i_public; +export var publicUse_im_public_i_public: im_public_i_public; +var privateUse_im_public_mi_public = new im_public_mi_public.c(); +export var publicUse_im_public_mi_public = new im_public_mi_public.c(); +var privateUse_im_public_mu_public: im_public_mu_public.i; +export var publicUse_im_public_mu_public: im_public_mu_public.i; + + +//// [privacyTopLevelInternalReferenceImportWithExport.js] +define(["require", "exports"], function (require, exports) { + var m_private; + (function (m_private) { + var c_private = (function () { + function c_private() { + } + return c_private; + })(); + m_private.c_private = c_private; + (function (e_private) { + e_private[e_private["Happy"] = 0] = "Happy"; + e_private[e_private["Grumpy"] = 1] = "Grumpy"; + })(m_private.e_private || (m_private.e_private = {})); + var e_private = m_private.e_private; + function f_private() { + return new c_private(); + } + m_private.f_private = f_private; + m_private.v_private = new c_private(); + (function (mi_private) { + var c = (function () { + function c() { + } + return c; + })(); + mi_private.c = c; + })(m_private.mi_private || (m_private.mi_private = {})); + var mi_private = m_private.mi_private; + })(m_private || (m_private = {})); + (function (m_public) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + m_public.c_public = c_public; + (function (e_public) { + e_public[e_public["Happy"] = 0] = "Happy"; + e_public[e_public["Grumpy"] = 1] = "Grumpy"; + })(m_public.e_public || (m_public.e_public = {})); + var e_public = m_public.e_public; + function f_public() { + return new c_public(); + } + m_public.f_public = f_public; + m_public.v_public = 10; + (function (mi_public) { + var c = (function () { + function c() { + } + return c; + })(); + mi_public.c = c; + })(m_public.mi_public || (m_public.mi_public = {})); + var mi_public = m_public.mi_public; + })(exports.m_public || (exports.m_public = {})); + var m_public = exports.m_public; + exports.im_public_c_private = m_private.c_private; + exports.im_public_e_private = m_private.e_private; + exports.im_public_f_private = m_private.f_private; + exports.im_public_v_private = m_private.v_private; + exports.im_public_mi_private = m_private.mi_private; + var privateUse_im_public_c_private = new exports.im_public_c_private(); + exports.publicUse_im_public_c_private = new exports.im_public_c_private(); + var privateUse_im_public_e_private = 0 /* Happy */; + exports.publicUse_im_public_e_private = 1 /* Grumpy */; + var privateUse_im_public_f_private = exports.im_public_f_private(); + exports.publicUse_im_public_f_private = exports.im_public_f_private(); + var privateUse_im_public_v_private = exports.im_public_v_private; + exports.publicUse_im_public_v_private = exports.im_public_v_private; + var privateUse_im_public_i_private; + exports.publicUse_im_public_i_private; + var privateUse_im_public_mi_private = new exports.im_public_mi_private.c(); + exports.publicUse_im_public_mi_private = new exports.im_public_mi_private.c(); + var privateUse_im_public_mu_private; + exports.publicUse_im_public_mu_private; + exports.im_public_c_public = m_public.c_public; + exports.im_public_e_public = m_public.e_public; + exports.im_public_f_public = m_public.f_public; + exports.im_public_v_public = m_public.v_public; + exports.im_public_mi_public = m_public.mi_public; + var privateUse_im_public_c_public = new exports.im_public_c_public(); + exports.publicUse_im_public_c_public = new exports.im_public_c_public(); + var privateUse_im_public_e_public = 0 /* Happy */; + exports.publicUse_im_public_e_public = 1 /* Grumpy */; + var privateUse_im_public_f_public = exports.im_public_f_public(); + exports.publicUse_im_public_f_public = exports.im_public_f_public(); + var privateUse_im_public_v_public = exports.im_public_v_public; + exports.publicUse_im_public_v_public = exports.im_public_v_public; + var privateUse_im_public_i_public; + exports.publicUse_im_public_i_public; + var privateUse_im_public_mi_public = new exports.im_public_mi_public.c(); + exports.publicUse_im_public_mi_public = new exports.im_public_mi_public.c(); + var privateUse_im_public_mu_public; + exports.publicUse_im_public_mu_public; +}); diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js new file mode 100644 index 0000000000000..2f43552243856 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.js @@ -0,0 +1,198 @@ +//// [privacyTopLevelInternalReferenceImportWithoutExport.ts] +// private elements +module m_private { + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + export class c { + } + } + export module mu_private { + export interface i { + } + } +} + +// Public elements +export module m_public { + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + export class c { + } + } + export module mu_public { + export interface i { + } + } +} + +// No Privacy errors - importing private elements +import im_private_c_private = m_private.c_private; +import im_private_e_private = m_private.e_private; +import im_private_f_private = m_private.f_private; +import im_private_v_private = m_private.v_private; +import im_private_i_private = m_private.i_private; +import im_private_mi_private = m_private.mi_private; +import im_private_mu_private = m_private.mu_private; + +// Usage of above decls +var privateUse_im_private_c_private = new im_private_c_private(); +export var publicUse_im_private_c_private = new im_private_c_private(); +var privateUse_im_private_e_private = im_private_e_private.Happy; +export var publicUse_im_private_e_private = im_private_e_private.Grumpy; +var privateUse_im_private_f_private = im_private_f_private(); +export var publicUse_im_private_f_private = im_private_f_private(); +var privateUse_im_private_v_private = im_private_v_private; +export var publicUse_im_private_v_private = im_private_v_private; +var privateUse_im_private_i_private: im_private_i_private; +export var publicUse_im_private_i_private: im_private_i_private; +var privateUse_im_private_mi_private = new im_private_mi_private.c(); +export var publicUse_im_private_mi_private = new im_private_mi_private.c(); +var privateUse_im_private_mu_private: im_private_mu_private.i; +export var publicUse_im_private_mu_private: im_private_mu_private.i; + + +// No Privacy errors - importing public elements +import im_private_c_public = m_public.c_public; +import im_private_e_public = m_public.e_public; +import im_private_f_public = m_public.f_public; +import im_private_v_public = m_public.v_public; +import im_private_i_public = m_public.i_public; +import im_private_mi_public = m_public.mi_public; +import im_private_mu_public = m_public.mu_public; + +// Usage of above decls +var privateUse_im_private_c_public = new im_private_c_public(); +export var publicUse_im_private_c_public = new im_private_c_public(); +var privateUse_im_private_e_public = im_private_e_public.Happy; +export var publicUse_im_private_e_public = im_private_e_public.Grumpy; +var privateUse_im_private_f_public = im_private_f_public(); +export var publicUse_im_private_f_public = im_private_f_public(); +var privateUse_im_private_v_public = im_private_v_public; +export var publicUse_im_private_v_public = im_private_v_public; +var privateUse_im_private_i_public: im_private_i_public; +export var publicUse_im_private_i_public: im_private_i_public; +var privateUse_im_private_mi_public = new im_private_mi_public.c(); +export var publicUse_im_private_mi_public = new im_private_mi_public.c(); +var privateUse_im_private_mu_public: im_private_mu_public.i; +export var publicUse_im_private_mu_public: im_private_mu_public.i; + + +//// [privacyTopLevelInternalReferenceImportWithoutExport.js] +define(["require", "exports"], function (require, exports) { + var m_private; + (function (m_private) { + var c_private = (function () { + function c_private() { + } + return c_private; + })(); + m_private.c_private = c_private; + (function (e_private) { + e_private[e_private["Happy"] = 0] = "Happy"; + e_private[e_private["Grumpy"] = 1] = "Grumpy"; + })(m_private.e_private || (m_private.e_private = {})); + var e_private = m_private.e_private; + function f_private() { + return new c_private(); + } + m_private.f_private = f_private; + m_private.v_private = new c_private(); + (function (mi_private) { + var c = (function () { + function c() { + } + return c; + })(); + mi_private.c = c; + })(m_private.mi_private || (m_private.mi_private = {})); + var mi_private = m_private.mi_private; + })(m_private || (m_private = {})); + (function (m_public) { + var c_public = (function () { + function c_public() { + } + return c_public; + })(); + m_public.c_public = c_public; + (function (e_public) { + e_public[e_public["Happy"] = 0] = "Happy"; + e_public[e_public["Grumpy"] = 1] = "Grumpy"; + })(m_public.e_public || (m_public.e_public = {})); + var e_public = m_public.e_public; + function f_public() { + return new c_public(); + } + m_public.f_public = f_public; + m_public.v_public = 10; + (function (mi_public) { + var c = (function () { + function c() { + } + return c; + })(); + mi_public.c = c; + })(m_public.mi_public || (m_public.mi_public = {})); + var mi_public = m_public.mi_public; + })(exports.m_public || (exports.m_public = {})); + var m_public = exports.m_public; + var im_private_c_private = m_private.c_private; + var im_private_e_private = m_private.e_private; + var im_private_f_private = m_private.f_private; + var im_private_v_private = m_private.v_private; + var im_private_mi_private = m_private.mi_private; + var privateUse_im_private_c_private = new im_private_c_private(); + exports.publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = 0 /* Happy */; + exports.publicUse_im_private_e_private = 1 /* Grumpy */; + var privateUse_im_private_f_private = im_private_f_private(); + exports.publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + exports.publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private; + exports.publicUse_im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + exports.publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private; + exports.publicUse_im_private_mu_private; + var im_private_c_public = m_public.c_public; + var im_private_e_public = m_public.e_public; + var im_private_f_public = m_public.f_public; + var im_private_v_public = m_public.v_public; + var im_private_mi_public = m_public.mi_public; + var privateUse_im_private_c_public = new im_private_c_public(); + exports.publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = 0 /* Happy */; + exports.publicUse_im_private_e_public = 1 /* Grumpy */; + var privateUse_im_private_f_public = im_private_f_public(); + exports.publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + exports.publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public; + exports.publicUse_im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + exports.publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public; + exports.publicUse_im_private_mu_public; +}); diff --git a/tests/baselines/reference/privacyTypeParameterOfFunction.errors.txt b/tests/baselines/reference/privacyTypeParameterOfFunction.errors.txt new file mode 100644 index 0000000000000..a48f291d50703 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParameterOfFunction.errors.txt @@ -0,0 +1,136 @@ +==== tests/cases/compiler/privacyTypeParameterOfFunction.ts (1 errors) ==== + class privateClass { + } + + export class publicClass { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + export interface publicInterfaceWithPrivateTypeParameters { + // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 + new (): privateClass; + + // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 + (): privateClass; + + // TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1 + myMethod(): privateClass; + } + + export interface publicInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateTypeParameters { + // TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1 + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { // No error + } + // TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1 + myPublicMethod() { + } + private myPrivateMethod() { // No error + } + } + + export class publicClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { // No error + } + myPublicMethod() { + } + private myPrivateMethod() { // No error + } + } + + class privateClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + // TypeParameter_0_of_exported_function_has_or_is_using_private_type_1 + export function publicFunctionWithPrivateTypeParameters() { + } + + export function publicFunctionWithPublicTypeParameters() { + } + + function privateFunctionWithPrivateTypeParameters() { + } + + function privateFunctionWithPublicTypeParameters() { + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + class privateClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPublicTypeParametersWithoutExtends() { + } + + function privateFunctionWithPublicTypeParametersWithoutExtends() { + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParameterOfFunction.js b/tests/baselines/reference/privacyTypeParameterOfFunction.js new file mode 100644 index 0000000000000..e3c45eea6a035 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParameterOfFunction.js @@ -0,0 +1,242 @@ +//// [privacyTypeParameterOfFunction.ts] +class privateClass { +} + +export class publicClass { +} + +export interface publicInterfaceWithPrivateTypeParameters { + // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 + new (): privateClass; + + // TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1 + (): privateClass; + + // TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1 + myMethod(): privateClass; +} + +export interface publicInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; +} + +interface privateInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; +} + +interface privateInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; +} + +export class publicClassWithWithPrivateTypeParameters { + // TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1 + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { // No error + } + // TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1 + myPublicMethod() { + } + private myPrivateMethod() { // No error + } +} + +export class publicClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } +} + +class privateClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { // No error + } + myPublicMethod() { + } + private myPrivateMethod() { // No error + } +} + +class privateClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } +} + +// TypeParameter_0_of_exported_function_has_or_is_using_private_type_1 +export function publicFunctionWithPrivateTypeParameters() { +} + +export function publicFunctionWithPublicTypeParameters() { +} + +function privateFunctionWithPrivateTypeParameters() { +} + +function privateFunctionWithPublicTypeParameters() { +} + +export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; +} + +interface privateInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; +} + +export class publicClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } +} +class privateClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } +} + +export function publicFunctionWithPublicTypeParametersWithoutExtends() { +} + +function privateFunctionWithPublicTypeParametersWithoutExtends() { +} + +//// [privacyTypeParameterOfFunction.js] +var privateClass = (function () { + function privateClass() { + } + return privateClass; +})(); +var publicClass = (function () { + function publicClass() { + } + return publicClass; +})(); +exports.publicClass = publicClass; +var publicClassWithWithPrivateTypeParameters = (function () { + function publicClassWithWithPrivateTypeParameters() { + } + publicClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { + }; + publicClassWithWithPrivateTypeParameters.myPrivateStaticMethod = function () { + }; + publicClassWithWithPrivateTypeParameters.prototype.myPublicMethod = function () { + }; + publicClassWithWithPrivateTypeParameters.prototype.myPrivateMethod = function () { + }; + return publicClassWithWithPrivateTypeParameters; +})(); +exports.publicClassWithWithPrivateTypeParameters = publicClassWithWithPrivateTypeParameters; +var publicClassWithWithPublicTypeParameters = (function () { + function publicClassWithWithPublicTypeParameters() { + } + publicClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { + }; + publicClassWithWithPublicTypeParameters.myPrivateStaticMethod = function () { + }; + publicClassWithWithPublicTypeParameters.prototype.myPublicMethod = function () { + }; + publicClassWithWithPublicTypeParameters.prototype.myPrivateMethod = function () { + }; + return publicClassWithWithPublicTypeParameters; +})(); +exports.publicClassWithWithPublicTypeParameters = publicClassWithWithPublicTypeParameters; +var privateClassWithWithPrivateTypeParameters = (function () { + function privateClassWithWithPrivateTypeParameters() { + } + privateClassWithWithPrivateTypeParameters.myPublicStaticMethod = function () { + }; + privateClassWithWithPrivateTypeParameters.myPrivateStaticMethod = function () { + }; + privateClassWithWithPrivateTypeParameters.prototype.myPublicMethod = function () { + }; + privateClassWithWithPrivateTypeParameters.prototype.myPrivateMethod = function () { + }; + return privateClassWithWithPrivateTypeParameters; +})(); +var privateClassWithWithPublicTypeParameters = (function () { + function privateClassWithWithPublicTypeParameters() { + } + privateClassWithWithPublicTypeParameters.myPublicStaticMethod = function () { + }; + privateClassWithWithPublicTypeParameters.myPrivateStaticMethod = function () { + }; + privateClassWithWithPublicTypeParameters.prototype.myPublicMethod = function () { + }; + privateClassWithWithPublicTypeParameters.prototype.myPrivateMethod = function () { + }; + return privateClassWithWithPublicTypeParameters; +})(); +function publicFunctionWithPrivateTypeParameters() { +} +exports.publicFunctionWithPrivateTypeParameters = publicFunctionWithPrivateTypeParameters; +function publicFunctionWithPublicTypeParameters() { +} +exports.publicFunctionWithPublicTypeParameters = publicFunctionWithPublicTypeParameters; +function privateFunctionWithPrivateTypeParameters() { +} +function privateFunctionWithPublicTypeParameters() { +} +var publicClassWithWithPublicTypeParametersWithoutExtends = (function () { + function publicClassWithWithPublicTypeParametersWithoutExtends() { + } + publicClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { + }; + publicClassWithWithPublicTypeParametersWithoutExtends.myPrivateStaticMethod = function () { + }; + publicClassWithWithPublicTypeParametersWithoutExtends.prototype.myPublicMethod = function () { + }; + publicClassWithWithPublicTypeParametersWithoutExtends.prototype.myPrivateMethod = function () { + }; + return publicClassWithWithPublicTypeParametersWithoutExtends; +})(); +exports.publicClassWithWithPublicTypeParametersWithoutExtends = publicClassWithWithPublicTypeParametersWithoutExtends; +var privateClassWithWithPublicTypeParametersWithoutExtends = (function () { + function privateClassWithWithPublicTypeParametersWithoutExtends() { + } + privateClassWithWithPublicTypeParametersWithoutExtends.myPublicStaticMethod = function () { + }; + privateClassWithWithPublicTypeParametersWithoutExtends.myPrivateStaticMethod = function () { + }; + privateClassWithWithPublicTypeParametersWithoutExtends.prototype.myPublicMethod = function () { + }; + privateClassWithWithPublicTypeParametersWithoutExtends.prototype.myPrivateMethod = function () { + }; + return privateClassWithWithPublicTypeParametersWithoutExtends; +})(); +function publicFunctionWithPublicTypeParametersWithoutExtends() { +} +exports.publicFunctionWithPublicTypeParametersWithoutExtends = publicFunctionWithPublicTypeParametersWithoutExtends; +function privateFunctionWithPublicTypeParametersWithoutExtends() { +} diff --git a/tests/baselines/reference/privacyTypeParametersOfClass.errors.txt b/tests/baselines/reference/privacyTypeParametersOfClass.errors.txt new file mode 100644 index 0000000000000..ad9ed70998f29 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfClass.errors.txt @@ -0,0 +1,47 @@ +==== tests/cases/compiler/privacyTypeParametersOfClass.ts (1 errors) ==== + class privateClass { + } + + export class publicClass { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + // TypeParameter_0_of_exported_class_1_has_or_is_using_private_type_2 + export class publicClassWithPrivateTypeParameters { + myMethod(val: T): T { // Error + return val; + } + } + + export class publicClassWithPublicTypeParameters { + myMethod(val: T): T { // No Error + return val; + } + } + + class privateClassWithPrivateTypeParameters { + myMethod(val: T): T { // No Error + return val; + } + } + + class privateClassWithPublicTypeParameters { + myMethod(val: T): T { // No Error + return val; + } + } + + export class publicClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { // No Error + return val; + } + } + + class privateClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { // No Error + return val; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParametersOfClass.js b/tests/baselines/reference/privacyTypeParametersOfClass.js new file mode 100644 index 0000000000000..d2e45557b2d82 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfClass.js @@ -0,0 +1,108 @@ +//// [privacyTypeParametersOfClass.ts] +class privateClass { +} + +export class publicClass { +} + +// TypeParameter_0_of_exported_class_1_has_or_is_using_private_type_2 +export class publicClassWithPrivateTypeParameters { + myMethod(val: T): T { // Error + return val; + } +} + +export class publicClassWithPublicTypeParameters { + myMethod(val: T): T { // No Error + return val; + } +} + +class privateClassWithPrivateTypeParameters { + myMethod(val: T): T { // No Error + return val; + } +} + +class privateClassWithPublicTypeParameters { + myMethod(val: T): T { // No Error + return val; + } +} + +export class publicClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { // No Error + return val; + } +} + +class privateClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { // No Error + return val; + } +} + + +//// [privacyTypeParametersOfClass.js] +var privateClass = (function () { + function privateClass() { + } + return privateClass; +})(); +var publicClass = (function () { + function publicClass() { + } + return publicClass; +})(); +exports.publicClass = publicClass; +var publicClassWithPrivateTypeParameters = (function () { + function publicClassWithPrivateTypeParameters() { + } + publicClassWithPrivateTypeParameters.prototype.myMethod = function (val) { + return val; + }; + return publicClassWithPrivateTypeParameters; +})(); +exports.publicClassWithPrivateTypeParameters = publicClassWithPrivateTypeParameters; +var publicClassWithPublicTypeParameters = (function () { + function publicClassWithPublicTypeParameters() { + } + publicClassWithPublicTypeParameters.prototype.myMethod = function (val) { + return val; + }; + return publicClassWithPublicTypeParameters; +})(); +exports.publicClassWithPublicTypeParameters = publicClassWithPublicTypeParameters; +var privateClassWithPrivateTypeParameters = (function () { + function privateClassWithPrivateTypeParameters() { + } + privateClassWithPrivateTypeParameters.prototype.myMethod = function (val) { + return val; + }; + return privateClassWithPrivateTypeParameters; +})(); +var privateClassWithPublicTypeParameters = (function () { + function privateClassWithPublicTypeParameters() { + } + privateClassWithPublicTypeParameters.prototype.myMethod = function (val) { + return val; + }; + return privateClassWithPublicTypeParameters; +})(); +var publicClassWithPublicTypeParametersWithoutExtends = (function () { + function publicClassWithPublicTypeParametersWithoutExtends() { + } + publicClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { + return val; + }; + return publicClassWithPublicTypeParametersWithoutExtends; +})(); +exports.publicClassWithPublicTypeParametersWithoutExtends = publicClassWithPublicTypeParametersWithoutExtends; +var privateClassWithPublicTypeParametersWithoutExtends = (function () { + function privateClassWithPublicTypeParametersWithoutExtends() { + } + privateClassWithPublicTypeParametersWithoutExtends.prototype.myMethod = function (val) { + return val; + }; + return privateClassWithPublicTypeParametersWithoutExtends; +})(); diff --git a/tests/baselines/reference/privacyTypeParametersOfInterface.errors.txt b/tests/baselines/reference/privacyTypeParametersOfInterface.errors.txt new file mode 100644 index 0000000000000..42eb13995c87e --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfInterface.errors.txt @@ -0,0 +1,62 @@ +==== tests/cases/compiler/privacyTypeParametersOfInterface.ts (1 errors) ==== + class privateClass { + } + + export class publicClass { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + + class privateClassT { + } + + export class publicClassT { + } + + // TypeParameter_0_of_exported_interface_1_has_or_is_using_private_type_2 + export interface publicInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; // Error + myMethod0(): publicClassT; // error + myMethod1(): privateClassT; // error + myMethod2(): privateClassT; // error + myMethod3(): publicClassT; //error + myMethod4(): publicClassT; // no error + } + + export interface publicInterfaceWithPublicTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // error + myMethod2(): privateClassT; // error + myMethod3(): publicClassT; //error + myMethod4(): publicClassT; // no error + } + + interface privateInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // No error + myMethod2(): privateClassT; // No error + myMethod3(): publicClassT; //No error + myMethod4(): publicClassT; // no error + } + + interface privateInterfaceWithPublicTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // No error + myMethod2(): privateClassT; // No error + myMethod3(): publicClassT; //No error + myMethod4(): publicClassT; // no error + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParametersOfInterface.js b/tests/baselines/reference/privacyTypeParametersOfInterface.js new file mode 100644 index 0000000000000..02e63ce70985c --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfInterface.js @@ -0,0 +1,83 @@ +//// [privacyTypeParametersOfInterface.ts] +class privateClass { +} + +export class publicClass { +} + +class privateClassT { +} + +export class publicClassT { +} + +// TypeParameter_0_of_exported_interface_1_has_or_is_using_private_type_2 +export interface publicInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; // Error + myMethod0(): publicClassT; // error + myMethod1(): privateClassT; // error + myMethod2(): privateClassT; // error + myMethod3(): publicClassT; //error + myMethod4(): publicClassT; // no error +} + +export interface publicInterfaceWithPublicTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // error + myMethod2(): privateClassT; // error + myMethod3(): publicClassT; //error + myMethod4(): publicClassT; // no error +} + +interface privateInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // No error + myMethod2(): privateClassT; // No error + myMethod3(): publicClassT; //No error + myMethod4(): publicClassT; // no error +} + +interface privateInterfaceWithPublicTypeParameters { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error + myMethod1(): privateClassT; // No error + myMethod2(): privateClassT; // No error + myMethod3(): publicClassT; //No error + myMethod4(): publicClassT; // no error +} + +export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error +} + +interface privateInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; // No Error + myMethod0(): publicClassT; // No error +} + +//// [privacyTypeParametersOfInterface.js] +var privateClass = (function () { + function privateClass() { + } + return privateClass; +})(); +var publicClass = (function () { + function publicClass() { + } + return publicClass; +})(); +exports.publicClass = publicClass; +var privateClassT = (function () { + function privateClassT() { + } + return privateClassT; +})(); +var publicClassT = (function () { + function publicClassT() { + } + return publicClassT; +})(); +exports.publicClassT = publicClassT; diff --git a/tests/baselines/reference/privacyVar.js b/tests/baselines/reference/privacyVar.js new file mode 100644 index 0000000000000..d4528fb34eb91 --- /dev/null +++ b/tests/baselines/reference/privacyVar.js @@ -0,0 +1,339 @@ +//// [privacyVar.ts] +export module m1 { + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private C3_v1_private: C1_public; + public C3_v2_public: C1_public; + private C3_v3_private: C2_private; + public C3_v4_public: C2_private; // error + + private C3_v11_private = new C1_public(); + public C3_v12_public = new C1_public(); + private C3_v13_private = new C2_private(); + public C3_v14_public = new C2_private(); // error + + private C3_v21_private: C1_public = new C1_public(); + public C3_v22_public: C1_public = new C1_public(); + private C3_v23_private: C2_private = new C2_private(); + public C3_v24_public: C2_private = new C2_private(); // error + } + + class C4_public { + private C4_v1_private: C1_public; + public C4_v2_public: C1_public; + private C4_v3_private: C2_private; + public C4_v4_public: C2_private; + + private C4_v11_private = new C1_public(); + public C4_v12_public = new C1_public(); + private C4_v13_private = new C2_private(); + public C4_v14_public = new C2_private(); + + private C4_v21_private: C1_public = new C1_public(); + public C4_v22_public: C1_public = new C1_public(); + private C4_v23_private: C2_private = new C2_private(); + public C4_v24_public: C2_private = new C2_private(); + } + + var m1_v1_private: C1_public; + export var m1_v2_public: C1_public; + var m1_v3_private: C2_private; + export var m1_v4_public: C2_private; // error + + var m1_v11_private = new C1_public(); + export var m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + export var m1_v14_public = new C2_private(); //error + + var m1_v21_private: C1_public = new C1_public(); + export var m1_v22_public: C1_public = new C1_public(); + var m1_v23_private: C2_private = new C2_private(); + export var m1_v24_public: C2_private = new C2_private(); // error +} + +module m2 { + export class m2_C1_public { + private f1() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + private m2_C3_v1_private: m2_C1_public; + public m2_C3_v2_public: m2_C1_public; + private m2_C3_v3_private: m2_C2_private; + public m2_C3_v4_public: m2_C2_private; + + private m2_C3_v11_private = new m2_C1_public(); + public m2_C3_v12_public = new m2_C1_public(); + private m2_C3_v13_private = new m2_C2_private(); + public m2_C3_v14_public = new m2_C2_private(); + + private m2_C3_v21_private: m2_C1_public = new m2_C1_public(); + public m2_C3_v22_public: m2_C1_public = new m2_C1_public(); + private m2_C3_v23_private: m2_C2_private = new m2_C2_private(); + public m2_C3_v24_public: m2_C2_private = new m2_C2_private(); + } + + class m2_C4_public { + private m2_C4_v1_private: m2_C1_public; + public m2_C4_v2_public: m2_C1_public; + private m2_C4_v3_private: m2_C2_private; + public m2_C4_v4_public: m2_C2_private; + + private m2_C4_v11_private = new m2_C1_public(); + public m2_C4_v12_public = new m2_C1_public(); + private m2_C4_v13_private = new m2_C2_private(); + public m2_C4_v14_public = new m2_C2_private(); + + private m2_C4_v21_private: m2_C1_public = new m2_C1_public(); + public m2_C4_v22_public: m2_C1_public = new m2_C1_public(); + private m2_C4_v23_private: m2_C2_private = new m2_C2_private(); + public m2_C4_v24_public: m2_C2_private = new m2_C2_private(); + } + + var m2_v1_private: m2_C1_public; + export var m2_v2_public: m2_C1_public; + var m2_v3_private: m2_C2_private; + export var m2_v4_public: m2_C2_private; + + var m2_v11_private = new m2_C1_public(); + export var m2_v12_public = new m2_C1_public(); + var m2_v13_private = new m2_C2_private(); + export var m2_v14_public = new m2_C2_private(); + + var m2_v21_private: m2_C1_public = new m2_C1_public(); + export var m2_v22_public: m2_C1_public = new m2_C1_public(); + var m2_v23_private: m2_C2_private = new m2_C2_private(); + export var m2_v24_public: m2_C2_private = new m2_C2_private(); +} + +export class glo_C1_public { + private f1() { + } +} + +class glo_C2_private { +} + +export class glo_C3_public { + private glo_C3_v1_private: glo_C1_public; + public glo_C3_v2_public: glo_C1_public; + private glo_C3_v3_private: glo_C2_private; + public glo_C3_v4_public: glo_C2_private; //error + + private glo_C3_v11_private = new glo_C1_public(); + public glo_C3_v12_public = new glo_C1_public(); + private glo_C3_v13_private = new glo_C2_private(); + public glo_C3_v14_public = new glo_C2_private(); // error + + private glo_C3_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C3_v22_public: glo_C1_public = new glo_C1_public(); + private glo_C3_v23_private: glo_C2_private = new glo_C2_private(); + public glo_C3_v24_public: glo_C2_private = new glo_C2_private(); //error +} + +class glo_C4_public { + private glo_C4_v1_private: glo_C1_public; + public glo_C4_v2_public: glo_C1_public; + private glo_C4_v3_private: glo_C2_private; + public glo_C4_v4_public: glo_C2_private; + + private glo_C4_v11_private = new glo_C1_public(); + public glo_C4_v12_public = new glo_C1_public(); + private glo_C4_v13_private = new glo_C2_private(); + public glo_C4_v14_public = new glo_C2_private(); + + private glo_C4_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C4_v22_public: glo_C1_public = new glo_C1_public(); + private glo_C4_v23_private: glo_C2_private = new glo_C2_private(); + public glo_C4_v24_public: glo_C2_private = new glo_C2_private(); +} + +var glo_v1_private: glo_C1_public; +export var glo_v2_public: glo_C1_public; +var glo_v3_private: glo_C2_private; +export var glo_v4_public: glo_C2_private; // error + +var glo_v11_private = new glo_C1_public(); +export var glo_v12_public = new glo_C1_public(); +var glo_v13_private = new glo_C2_private(); +export var glo_v14_public = new glo_C2_private(); // error + +var glo_v21_private: glo_C1_public = new glo_C1_public(); +export var glo_v22_public: glo_C1_public = new glo_C1_public(); +var glo_v23_private: glo_C2_private = new glo_C2_private(); +export var glo_v24_public: glo_C2_private = new glo_C2_private(); // error + +//// [privacyVar.js] +(function (m1) { + var C1_public = (function () { + function C1_public() { + } + C1_public.prototype.f1 = function () { + }; + return C1_public; + })(); + m1.C1_public = C1_public; + var C2_private = (function () { + function C2_private() { + } + return C2_private; + })(); + var C3_public = (function () { + function C3_public() { + this.C3_v11_private = new C1_public(); + this.C3_v12_public = new C1_public(); + this.C3_v13_private = new C2_private(); + this.C3_v14_public = new C2_private(); + this.C3_v21_private = new C1_public(); + this.C3_v22_public = new C1_public(); + this.C3_v23_private = new C2_private(); + this.C3_v24_public = new C2_private(); + } + return C3_public; + })(); + m1.C3_public = C3_public; + var C4_public = (function () { + function C4_public() { + this.C4_v11_private = new C1_public(); + this.C4_v12_public = new C1_public(); + this.C4_v13_private = new C2_private(); + this.C4_v14_public = new C2_private(); + this.C4_v21_private = new C1_public(); + this.C4_v22_public = new C1_public(); + this.C4_v23_private = new C2_private(); + this.C4_v24_public = new C2_private(); + } + return C4_public; + })(); + var m1_v1_private; + m1.m1_v2_public; + var m1_v3_private; + m1.m1_v4_public; + var m1_v11_private = new C1_public(); + m1.m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + m1.m1_v14_public = new C2_private(); + var m1_v21_private = new C1_public(); + m1.m1_v22_public = new C1_public(); + var m1_v23_private = new C2_private(); + m1.m1_v24_public = new C2_private(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var m2; +(function (m2) { + var m2_C1_public = (function () { + function m2_C1_public() { + } + m2_C1_public.prototype.f1 = function () { + }; + return m2_C1_public; + })(); + m2.m2_C1_public = m2_C1_public; + var m2_C2_private = (function () { + function m2_C2_private() { + } + return m2_C2_private; + })(); + var m2_C3_public = (function () { + function m2_C3_public() { + this.m2_C3_v11_private = new m2_C1_public(); + this.m2_C3_v12_public = new m2_C1_public(); + this.m2_C3_v13_private = new m2_C2_private(); + this.m2_C3_v14_public = new m2_C2_private(); + this.m2_C3_v21_private = new m2_C1_public(); + this.m2_C3_v22_public = new m2_C1_public(); + this.m2_C3_v23_private = new m2_C2_private(); + this.m2_C3_v24_public = new m2_C2_private(); + } + return m2_C3_public; + })(); + m2.m2_C3_public = m2_C3_public; + var m2_C4_public = (function () { + function m2_C4_public() { + this.m2_C4_v11_private = new m2_C1_public(); + this.m2_C4_v12_public = new m2_C1_public(); + this.m2_C4_v13_private = new m2_C2_private(); + this.m2_C4_v14_public = new m2_C2_private(); + this.m2_C4_v21_private = new m2_C1_public(); + this.m2_C4_v22_public = new m2_C1_public(); + this.m2_C4_v23_private = new m2_C2_private(); + this.m2_C4_v24_public = new m2_C2_private(); + } + return m2_C4_public; + })(); + var m2_v1_private; + m2.m2_v2_public; + var m2_v3_private; + m2.m2_v4_public; + var m2_v11_private = new m2_C1_public(); + m2.m2_v12_public = new m2_C1_public(); + var m2_v13_private = new m2_C2_private(); + m2.m2_v14_public = new m2_C2_private(); + var m2_v21_private = new m2_C1_public(); + m2.m2_v22_public = new m2_C1_public(); + var m2_v23_private = new m2_C2_private(); + m2.m2_v24_public = new m2_C2_private(); +})(m2 || (m2 = {})); +var glo_C1_public = (function () { + function glo_C1_public() { + } + glo_C1_public.prototype.f1 = function () { + }; + return glo_C1_public; +})(); +exports.glo_C1_public = glo_C1_public; +var glo_C2_private = (function () { + function glo_C2_private() { + } + return glo_C2_private; +})(); +var glo_C3_public = (function () { + function glo_C3_public() { + this.glo_C3_v11_private = new glo_C1_public(); + this.glo_C3_v12_public = new glo_C1_public(); + this.glo_C3_v13_private = new glo_C2_private(); + this.glo_C3_v14_public = new glo_C2_private(); + this.glo_C3_v21_private = new glo_C1_public(); + this.glo_C3_v22_public = new glo_C1_public(); + this.glo_C3_v23_private = new glo_C2_private(); + this.glo_C3_v24_public = new glo_C2_private(); + } + return glo_C3_public; +})(); +exports.glo_C3_public = glo_C3_public; +var glo_C4_public = (function () { + function glo_C4_public() { + this.glo_C4_v11_private = new glo_C1_public(); + this.glo_C4_v12_public = new glo_C1_public(); + this.glo_C4_v13_private = new glo_C2_private(); + this.glo_C4_v14_public = new glo_C2_private(); + this.glo_C4_v21_private = new glo_C1_public(); + this.glo_C4_v22_public = new glo_C1_public(); + this.glo_C4_v23_private = new glo_C2_private(); + this.glo_C4_v24_public = new glo_C2_private(); + } + return glo_C4_public; +})(); +var glo_v1_private; +exports.glo_v2_public; +var glo_v3_private; +exports.glo_v4_public; +var glo_v11_private = new glo_C1_public(); +exports.glo_v12_public = new glo_C1_public(); +var glo_v13_private = new glo_C2_private(); +exports.glo_v14_public = new glo_C2_private(); +var glo_v21_private = new glo_C1_public(); +exports.glo_v22_public = new glo_C1_public(); +var glo_v23_private = new glo_C2_private(); +exports.glo_v24_public = new glo_C2_private(); diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js new file mode 100644 index 0000000000000..0d56cf415ac50 --- /dev/null +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -0,0 +1,33 @@ +//// [privateAccessInSubclass1.ts] +class Base { + private options: any; +} + +class D extends Base { + myMethod() { + this.options; + } +} + +//// [privateAccessInSubclass1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.myMethod = function () { + this.options; + }; + return D; +})(Base); diff --git a/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.errors.txt b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.errors.txt new file mode 100644 index 0000000000000..d49025763d240 --- /dev/null +++ b/tests/baselines/reference/privateClassPropertyAccessibleWithinClass.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/conformance/classes/members/accessibility/privateClassPropertyAccessibleWithinClass.ts (8 errors) ==== + // no errors + + class C { + private x: string; + private get y() { return this.x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private set y(x) { this.y = this.x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private foo() { return this.foo; } + + private static x: string; + private static get y() { return this.x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static set y(x) { this.y = this.x; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static foo() { return this.foo; } + private static bar() { this.foo(); } + } + + // added level of function nesting + class C2 { + private x: string; + private get y() { () => this.x; return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private set y(x) { () => { this.y = this.x; } } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private foo() { () => this.foo; } + + private static x: string; + private static get y() { () => this.x; return null; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + private static set y(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + () => { this.y = this.x; } + } + private static foo() { () => this.foo; } + private static bar() { () => this.foo(); } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privateIndexer.errors.txt b/tests/baselines/reference/privateIndexer.errors.txt new file mode 100644 index 0000000000000..50e11fea1cdfc --- /dev/null +++ b/tests/baselines/reference/privateIndexer.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer.ts (3 errors) ==== + // private indexers not allowed + + class C { + private [x: string]: string; + ~~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class D { + private [x: number]: string; + ~~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class E { + private [x: string]: T; + ~~~~~~~ +!!! Modifiers not permitted on index signature members. + } \ No newline at end of file diff --git a/tests/baselines/reference/privateIndexer2.errors.txt b/tests/baselines/reference/privateIndexer2.errors.txt new file mode 100644 index 0000000000000..3d55bc9a60f30 --- /dev/null +++ b/tests/baselines/reference/privateIndexer2.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/conformance/classes/indexMemberDeclarations/privateIndexer2.ts (14 errors) ==== + // private indexers not allowed + + var x = { + private [x: string]: string; + ~ +!!! ':' expected. + ~ +!!! ',' expected. + ~ +!!! ',' expected. + ~ +!!! ':' expected. + ~~~~~~ +!!! Cannot find name 'string'. + } + ~ +!!! Declaration or statement expected. + + var y: { + private[x: string]: string; + ~~~~~~~ +!!! Property or signature expected. + ~ +!!! ']' expected. + ~ +!!! ';' expected. + ~ +!!! Declaration or statement expected. + ~~~~~~~ +!!! Cannot find name 'private'. + ~~~~~~ +!!! Cannot find name 'string'. + ~~~~~~ +!!! Cannot find name 'string'. + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.errors.txt b/tests/baselines/reference/privateInstanceMemberAccessibility.errors.txt new file mode 100644 index 0000000000000..e3eddca5b8b4c --- /dev/null +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts (6 errors) ==== + class Base { + private foo: string; + } + + class Derived extends Base { + x = super.foo; // error + ~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + y() { + return super.foo; // error + ~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + } + z: typeof super.foo; // error + ~~~~~ +!!! Identifier expected. + ~~~ +!!! Only public methods of the base class are accessible via the 'super' keyword + + a: this.foo; // error + ~~~~ +!!! Type expected. + ~~~~~~~~ +!!! Property 'Base.foo' is inaccessible. + } \ No newline at end of file diff --git a/tests/baselines/reference/privateInstanceVisibility.js b/tests/baselines/reference/privateInstanceVisibility.js new file mode 100644 index 0000000000000..e1ccb28751582 --- /dev/null +++ b/tests/baselines/reference/privateInstanceVisibility.js @@ -0,0 +1,67 @@ +//// [privateInstanceVisibility.ts] +module Test { + + export class Example { + + private someNumber: number; + + + + public doSomething() { + + var that = this; + + function innerFunction() { + + var num = that.someNumber; + + } + + } + + } + +} + + + +class C { + + private x: number; + + getX() { return this.x; } + + clone(other: C) { + this.x = other.x; + + } +} + + +//// [privateInstanceVisibility.js] +var Test; +(function (Test) { + var Example = (function () { + function Example() { + } + Example.prototype.doSomething = function () { + var that = this; + function innerFunction() { + var num = that.someNumber; + } + }; + return Example; + })(); + Test.Example = Example; +})(Test || (Test = {})); +var C = (function () { + function C() { + } + C.prototype.getX = function () { + return this.x; + }; + C.prototype.clone = function (other) { + this.x = other.x; + }; + return C; +})(); diff --git a/tests/baselines/reference/privateInterfaceProperties.errors.txt b/tests/baselines/reference/privateInterfaceProperties.errors.txt new file mode 100644 index 0000000000000..99d47794c9bde --- /dev/null +++ b/tests/baselines/reference/privateInterfaceProperties.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/privateInterfaceProperties.ts (1 errors) ==== + interface i1 { name:string; } + + // should be an error + class c1 implements i1 { private name:string; } + ~~ +!!! Class 'c1' incorrectly implements interface 'i1': +!!! Private property 'name' cannot be reimplemented. + + // should be ok + class c2 implements i1 { public name:string; } + + \ No newline at end of file diff --git a/tests/baselines/reference/privateInterfaceProperties.js b/tests/baselines/reference/privateInterfaceProperties.js new file mode 100644 index 0000000000000..4220685998f7a --- /dev/null +++ b/tests/baselines/reference/privateInterfaceProperties.js @@ -0,0 +1,22 @@ +//// [privateInterfaceProperties.ts] +interface i1 { name:string; } + +// should be an error +class c1 implements i1 { private name:string; } + +// should be ok +class c2 implements i1 { public name:string; } + + + +//// [privateInterfaceProperties.js] +var c1 = (function () { + function c1() { + } + return c1; +})(); +var c2 = (function () { + function c2() { + } + return c2; +})(); diff --git a/tests/baselines/reference/privatePropertyUsingObjectType.js b/tests/baselines/reference/privatePropertyUsingObjectType.js new file mode 100644 index 0000000000000..078eed7d1f186 --- /dev/null +++ b/tests/baselines/reference/privatePropertyUsingObjectType.js @@ -0,0 +1,20 @@ +//// [privatePropertyUsingObjectType.ts] +export class FilterManager { + private _filterProviders: { index: IFilterProvider; }; + private _filterProviders2: { [index: number]: IFilterProvider; }; + private _filterProviders3: { (index: number): IFilterProvider; }; + private _filterProviders4: (index: number) => IFilterProvider; +} +export interface IFilterProvider { +} + + +//// [privatePropertyUsingObjectType.js] +define(["require", "exports"], function (require, exports) { + var FilterManager = (function () { + function FilterManager() { + } + return FilterManager; + })(); + exports.FilterManager = FilterManager; +}); diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.errors.txt b/tests/baselines/reference/privateStaticMemberAccessibility.errors.txt new file mode 100644 index 0000000000000..9990cb9f57dac --- /dev/null +++ b/tests/baselines/reference/privateStaticMemberAccessibility.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/classes/members/accessibility/privateStaticMemberAccessibility.ts (2 errors) ==== + class Base { + private static foo: string; + } + + class Derived extends Base { + static bar = Base.foo; // error + ~~~~~~~~ +!!! Property 'Base.foo' is inaccessible. + bing = () => Base.foo; // error + ~~~~~~~~ +!!! Property 'Base.foo' is inaccessible. + } \ No newline at end of file diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js new file mode 100644 index 0000000000000..b948139ecad2d --- /dev/null +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -0,0 +1,31 @@ +//// [privateStaticMemberAccessibility.ts] +class Base { + private static foo: string; +} + +class Derived extends Base { + static bar = Base.foo; // error + bing = () => Base.foo; // error +} + +//// [privateStaticMemberAccessibility.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + this.bing = function () { return Base.foo; }; + } + Derived.bar = Base.foo; + return Derived; +})(Base); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt b/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt new file mode 100644 index 0000000000000..f53df90f4780a --- /dev/null +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/conformance/classes/members/accessibility/privateStaticNotAccessibleInClodule.ts (1 errors) ==== + // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. + + class C { + private foo: string; + private static bar: string; + } + + module C { + export var y = C.bar; // error + ~~~~~ +!!! Property 'C.bar' is inaccessible. + } \ No newline at end of file diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js new file mode 100644 index 0000000000000..f06b5e25775fd --- /dev/null +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js @@ -0,0 +1,22 @@ +//// [privateStaticNotAccessibleInClodule.ts] +// Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. + +class C { + private foo: string; + private static bar: string; +} + +module C { + export var y = C.bar; // error +} + +//// [privateStaticNotAccessibleInClodule.js] +var C = (function () { + function C() { + } + return C; +})(); +var C; +(function (C) { + C.y = C.bar; +})(C || (C = {})); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt new file mode 100644 index 0000000000000..a271754ff008b --- /dev/null +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/conformance/classes/members/accessibility/privateStaticNotAccessibleInClodule2.ts (1 errors) ==== + // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. + + class C { + private foo: string; + private static bar: string; + } + + class D extends C { + baz: number; + } + + module D { + export var y = D.bar; // error + ~~~~~ +!!! Property 'C.bar' is inaccessible. + } \ No newline at end of file diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js new file mode 100644 index 0000000000000..b27a6986e53fd --- /dev/null +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -0,0 +1,39 @@ +//// [privateStaticNotAccessibleInClodule2.ts] +// Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. + +class C { + private foo: string; + private static bar: string; +} + +class D extends C { + baz: number; +} + +module D { + export var y = D.bar; // error +} + +//// [privateStaticNotAccessibleInClodule2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +var D; +(function (D) { + D.y = D.bar; +})(D || (D = {})); diff --git a/tests/baselines/reference/privateVisibility.errors.txt b/tests/baselines/reference/privateVisibility.errors.txt new file mode 100644 index 0000000000000..3b7fedfb714f2 --- /dev/null +++ b/tests/baselines/reference/privateVisibility.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/compiler/privateVisibility.ts (3 errors) ==== + class Foo { + public pubMeth() {this.privMeth();} + private privMeth() {} + public pubProp = 0; + private privProp = 0; + } + + var f = new Foo(); + f.privMeth(); // should not work + ~~~~~~~~~~ +!!! Property 'Foo.privMeth' is inaccessible. + f.privProp; // should not work + ~~~~~~~~~~ +!!! Property 'Foo.privProp' is inaccessible. + + f.pubMeth(); // should work + f.pubProp; // should work + + module M { + export class C { public pub = 0; private priv = 1; } + export var V = 0; + } + + + var c = new M.C(); + + c.pub; // should work + c.priv; // should not work + ~~~~~~ +!!! Property 'M.C.priv' is inaccessible. + + \ No newline at end of file diff --git a/tests/baselines/reference/privateVisibility.js b/tests/baselines/reference/privateVisibility.js new file mode 100644 index 0000000000000..9f2a1ffa17901 --- /dev/null +++ b/tests/baselines/reference/privateVisibility.js @@ -0,0 +1,61 @@ +//// [privateVisibility.ts] +class Foo { + public pubMeth() {this.privMeth();} + private privMeth() {} + public pubProp = 0; + private privProp = 0; +} + +var f = new Foo(); +f.privMeth(); // should not work +f.privProp; // should not work + +f.pubMeth(); // should work +f.pubProp; // should work + +module M { + export class C { public pub = 0; private priv = 1; } + export var V = 0; +} + + +var c = new M.C(); + +c.pub; // should work +c.priv; // should not work + + + +//// [privateVisibility.js] +var Foo = (function () { + function Foo() { + this.pubProp = 0; + this.privProp = 0; + } + Foo.prototype.pubMeth = function () { + this.privMeth(); + }; + Foo.prototype.privMeth = function () { + }; + return Foo; +})(); +var f = new Foo(); +f.privMeth(); +f.privProp; +f.pubMeth(); +f.pubProp; +var M; +(function (M) { + var C = (function () { + function C() { + this.pub = 0; + this.priv = 1; + } + return C; + })(); + M.C = C; + M.V = 0; +})(M || (M = {})); +var c = new M.C(); +c.pub; +c.priv; diff --git a/tests/baselines/reference/privateVisibles.js b/tests/baselines/reference/privateVisibles.js new file mode 100644 index 0000000000000..c9206964f8022 --- /dev/null +++ b/tests/baselines/reference/privateVisibles.js @@ -0,0 +1,22 @@ +//// [privateVisibles.ts] +class Foo { + private pvar = 0; + constructor() { + var n = this.pvar; + } + + public meth() { var q = this.pvar;} +} + + +//// [privateVisibles.js] +var Foo = (function () { + function Foo() { + this.pvar = 0; + var n = this.pvar; + } + Foo.prototype.meth = function () { + var q = this.pvar; + }; + return Foo; +})(); diff --git a/tests/baselines/reference/project/baseline/amd/baseline.json b/tests/baselines/reference/project/baseline/amd/baseline.json new file mode 100644 index 0000000000000..18a5cfbebaf1d --- /dev/null +++ b/tests/baselines/reference/project/baseline/amd/baseline.json @@ -0,0 +1,18 @@ +{ + "scenario": "baseline", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "emit.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "emit.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "emit.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline/amd/decl.js b/tests/baselines/reference/project/baseline/amd/decl.js new file mode 100644 index 0000000000000..ed53ca816db39 --- /dev/null +++ b/tests/baselines/reference/project/baseline/amd/decl.js @@ -0,0 +1,7 @@ +define(["require", "exports"], function (require, exports) { + ; + function point(x, y) { + return { x: x, y: y }; + } + exports.point = point; +}); diff --git a/tests/baselines/reference/project/baseline/amd/emit.js b/tests/baselines/reference/project/baseline/amd/emit.js new file mode 100644 index 0000000000000..12560b1cabeed --- /dev/null +++ b/tests/baselines/reference/project/baseline/amd/emit.js @@ -0,0 +1,3 @@ +define(["require", "exports", "./decl"], function (require, exports, g) { + var p = g.point(10, 20); +}); diff --git a/tests/baselines/reference/project/baseline/node/baseline.json b/tests/baselines/reference/project/baseline/node/baseline.json new file mode 100644 index 0000000000000..18a5cfbebaf1d --- /dev/null +++ b/tests/baselines/reference/project/baseline/node/baseline.json @@ -0,0 +1,18 @@ +{ + "scenario": "baseline", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "emit.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "emit.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "emit.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline/node/decl.js b/tests/baselines/reference/project/baseline/node/decl.js new file mode 100644 index 0000000000000..eb0c46dd93e3f --- /dev/null +++ b/tests/baselines/reference/project/baseline/node/decl.js @@ -0,0 +1,5 @@ +; +function point(x, y) { + return { x: x, y: y }; +} +exports.point = point; diff --git a/tests/baselines/reference/project/baseline/node/emit.js b/tests/baselines/reference/project/baseline/node/emit.js new file mode 100644 index 0000000000000..2188cfe391050 --- /dev/null +++ b/tests/baselines/reference/project/baseline/node/emit.js @@ -0,0 +1,2 @@ +var g = require("./decl"); +var p = g.point(10, 20); diff --git a/tests/baselines/reference/project/baseline2/amd/baseline2.json b/tests/baselines/reference/project/baseline2/amd/baseline2.json new file mode 100644 index 0000000000000..4a14da235895e --- /dev/null +++ b/tests/baselines/reference/project/baseline2/amd/baseline2.json @@ -0,0 +1,18 @@ +{ + "scenario": "baseline 2", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "dont_emit.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "dont_emit.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "dont_emit.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline2/amd/decl.js b/tests/baselines/reference/project/baseline2/amd/decl.js new file mode 100644 index 0000000000000..ed53ca816db39 --- /dev/null +++ b/tests/baselines/reference/project/baseline2/amd/decl.js @@ -0,0 +1,7 @@ +define(["require", "exports"], function (require, exports) { + ; + function point(x, y) { + return { x: x, y: y }; + } + exports.point = point; +}); diff --git a/tests/baselines/reference/project/baseline2/amd/dont_emit.js b/tests/baselines/reference/project/baseline2/amd/dont_emit.js new file mode 100644 index 0000000000000..d3e9e871c2d8e --- /dev/null +++ b/tests/baselines/reference/project/baseline2/amd/dont_emit.js @@ -0,0 +1,3 @@ +define(["require", "exports"], function (require, exports) { + var p = { x: 10, y: 20 }; +}); diff --git a/tests/baselines/reference/project/baseline2/node/baseline2.json b/tests/baselines/reference/project/baseline2/node/baseline2.json new file mode 100644 index 0000000000000..4a14da235895e --- /dev/null +++ b/tests/baselines/reference/project/baseline2/node/baseline2.json @@ -0,0 +1,18 @@ +{ + "scenario": "baseline 2", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "dont_emit.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "dont_emit.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "dont_emit.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline2/node/decl.js b/tests/baselines/reference/project/baseline2/node/decl.js new file mode 100644 index 0000000000000..eb0c46dd93e3f --- /dev/null +++ b/tests/baselines/reference/project/baseline2/node/decl.js @@ -0,0 +1,5 @@ +; +function point(x, y) { + return { x: x, y: y }; +} +exports.point = point; diff --git a/tests/baselines/reference/project/baseline2/node/dont_emit.js b/tests/baselines/reference/project/baseline2/node/dont_emit.js new file mode 100644 index 0000000000000..b6239b1295dfa --- /dev/null +++ b/tests/baselines/reference/project/baseline2/node/dont_emit.js @@ -0,0 +1 @@ +var p = { x: 10, y: 20 }; diff --git a/tests/baselines/reference/project/baseline3/amd/baseline3.json b/tests/baselines/reference/project/baseline3/amd/baseline3.json new file mode 100644 index 0000000000000..7c178ee16be72 --- /dev/null +++ b/tests/baselines/reference/project/baseline3/amd/baseline3.json @@ -0,0 +1,16 @@ +{ + "scenario": "baseline 3", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "nestedModule.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "nestedModule.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "nestedModule.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline3/amd/nestedModule.js b/tests/baselines/reference/project/baseline3/amd/nestedModule.js new file mode 100644 index 0000000000000..0cf18a09d58e9 --- /dev/null +++ b/tests/baselines/reference/project/baseline3/amd/nestedModule.js @@ -0,0 +1,10 @@ +define(["require", "exports"], function (require, exports) { + (function (outer) { + (function (inner) { + var local = 1; + inner.a = local; + })(outer.inner || (outer.inner = {})); + var inner = outer.inner; + })(exports.outer || (exports.outer = {})); + var outer = exports.outer; +}); diff --git a/tests/baselines/reference/project/baseline3/node/baseline3.json b/tests/baselines/reference/project/baseline3/node/baseline3.json new file mode 100644 index 0000000000000..7c178ee16be72 --- /dev/null +++ b/tests/baselines/reference/project/baseline3/node/baseline3.json @@ -0,0 +1,16 @@ +{ + "scenario": "baseline 3", + "projectRoot": "tests/cases/projects/baseline", + "inputFiles": [ + "nestedModule.ts" + ], + "baselineCheck": true, + "runTest": true, + "resolvedInputFiles": [ + "nestedModule.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "nestedModule.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline3/node/nestedModule.js b/tests/baselines/reference/project/baseline3/node/nestedModule.js new file mode 100644 index 0000000000000..03682a19b367c --- /dev/null +++ b/tests/baselines/reference/project/baseline3/node/nestedModule.js @@ -0,0 +1,8 @@ +(function (outer) { + (function (inner) { + var local = 1; + inner.a = local; + })(outer.inner || (outer.inner = {})); + var inner = outer.inner; +})(exports.outer || (exports.outer = {})); +var outer = exports.outer; diff --git a/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt new file mode 100644 index 0000000000000..2978ef073b5fd --- /dev/null +++ b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.errors.txt @@ -0,0 +1,3 @@ +decl.ts(1,26): Cannot find external module './foo/bar.js'. +decl.ts(2,26): Cannot find external module 'baz'. +decl.ts(3,26): Cannot find external module './baz'. diff --git a/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.json b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.json new file mode 100644 index 0000000000000..05a85481e7ba2 --- /dev/null +++ b/tests/baselines/reference/project/cantFindTheModule/amd/cantFindTheModule.json @@ -0,0 +1,14 @@ +{ + "scenario": "can't find the module", + "projectRoot": "tests/cases/projects/NoModule", + "inputFiles": [ + "decl.ts" + ], + "resolvedInputFiles": [ + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt new file mode 100644 index 0000000000000..2978ef073b5fd --- /dev/null +++ b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.errors.txt @@ -0,0 +1,3 @@ +decl.ts(1,26): Cannot find external module './foo/bar.js'. +decl.ts(2,26): Cannot find external module 'baz'. +decl.ts(3,26): Cannot find external module './baz'. diff --git a/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.json b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.json new file mode 100644 index 0000000000000..05a85481e7ba2 --- /dev/null +++ b/tests/baselines/reference/project/cantFindTheModule/node/cantFindTheModule.json @@ -0,0 +1,14 @@ +{ + "scenario": "can't find the module", + "projectRoot": "tests/cases/projects/NoModule", + "inputFiles": [ + "decl.ts" + ], + "resolvedInputFiles": [ + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/circularReferencing/amd/circularReferencing.json b/tests/baselines/reference/project/circularReferencing/amd/circularReferencing.json new file mode 100644 index 0000000000000..418891627bac8 --- /dev/null +++ b/tests/baselines/reference/project/circularReferencing/amd/circularReferencing.json @@ -0,0 +1,16 @@ +{ + "scenario": "CircularReferencing", + "projectRoot": "tests/cases/projects/CircularReferencing", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/circularReferencing/node/circularReferencing.json b/tests/baselines/reference/project/circularReferencing/node/circularReferencing.json new file mode 100644 index 0000000000000..418891627bac8 --- /dev/null +++ b/tests/baselines/reference/project/circularReferencing/node/circularReferencing.json @@ -0,0 +1,16 @@ +{ + "scenario": "CircularReferencing", + "projectRoot": "tests/cases/projects/CircularReferencing", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/circularReferencing2/amd/circularReferencing2.json b/tests/baselines/reference/project/circularReferencing2/amd/circularReferencing2.json new file mode 100644 index 0000000000000..162d3d51c0be4 --- /dev/null +++ b/tests/baselines/reference/project/circularReferencing2/amd/circularReferencing2.json @@ -0,0 +1,19 @@ +{ + "scenario": "circular referencing - 2", + "projectRoot": "tests/cases/projects/CircularReferencing-2", + "inputFiles": [ + "a.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "a.ts", + "c.ts", + "b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "b.js", + "c.js", + "a.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/circularReferencing2/node/circularReferencing2.json b/tests/baselines/reference/project/circularReferencing2/node/circularReferencing2.json new file mode 100644 index 0000000000000..162d3d51c0be4 --- /dev/null +++ b/tests/baselines/reference/project/circularReferencing2/node/circularReferencing2.json @@ -0,0 +1,19 @@ +{ + "scenario": "circular referencing - 2", + "projectRoot": "tests/cases/projects/CircularReferencing-2", + "inputFiles": [ + "a.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "a.ts", + "c.ts", + "b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "b.js", + "c.js", + "a.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.json b/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.json new file mode 100644 index 0000000000000..158d3048989d8 --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_CascadingImports", + "projectRoot": "tests/cases/projects/declarations_CascadingImports", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.d.ts b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsCascadingImports/amd/useModule.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/useModule.js b/tests/baselines/reference/project/declarationsCascadingImports/amd/useModule.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.json b/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.json new file mode 100644 index 0000000000000..158d3048989d8 --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_CascadingImports", + "projectRoot": "tests/cases/projects/declarations_CascadingImports", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.d.ts b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/useModule.d.ts b/tests/baselines/reference/project/declarationsCascadingImports/node/useModule.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/useModule.js b/tests/baselines/reference/project/declarationsCascadingImports/node/useModule.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/declarationsGlobalImport.json b/tests/baselines/reference/project/declarationsGlobalImport/amd/declarationsGlobalImport.json new file mode 100644 index 0000000000000..c7f0232f2a43c --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/declarationsGlobalImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_GlobalImport", + "projectRoot": "tests/cases/projects/declarations_GlobalImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "glo_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "glo_m4.js", + "glo_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.d.ts b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/glo_m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.d.ts new file mode 100644 index 0000000000000..aa0f12b4c1ab0 --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.d.ts @@ -0,0 +1,3 @@ +export declare var useGlo_m4_x4; +export declare var useGlo_m4_d4; +export declare var useGlo_m4_f4; diff --git a/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.js b/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.js new file mode 100644 index 0000000000000..8e81cc2d03fbf --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/amd/useModule.js @@ -0,0 +1,5 @@ +define(["require", "exports", "glo_m4"], function (require, exports, glo_m4) { + exports.useGlo_m4_x4 = glo_m4.x; + exports.useGlo_m4_d4 = glo_m4.d; + exports.useGlo_m4_f4 = glo_m4.foo(); +}); diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/declarationsGlobalImport.json b/tests/baselines/reference/project/declarationsGlobalImport/node/declarationsGlobalImport.json new file mode 100644 index 0000000000000..c7f0232f2a43c --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/declarationsGlobalImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_GlobalImport", + "projectRoot": "tests/cases/projects/declarations_GlobalImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "glo_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "glo_m4.js", + "glo_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.d.ts b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/glo_m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.d.ts b/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.d.ts new file mode 100644 index 0000000000000..aa0f12b4c1ab0 --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.d.ts @@ -0,0 +1,3 @@ +export declare var useGlo_m4_x4; +export declare var useGlo_m4_d4; +export declare var useGlo_m4_f4; diff --git a/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.js b/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.js new file mode 100644 index 0000000000000..11b8659fda69f --- /dev/null +++ b/tests/baselines/reference/project/declarationsGlobalImport/node/useModule.js @@ -0,0 +1,4 @@ +var glo_m4 = require("glo_m4"); +exports.useGlo_m4_x4 = glo_m4.x; +exports.useGlo_m4_d4 = glo_m4.d; +exports.useGlo_m4_f4 = glo_m4.foo(); diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.json b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.json new file mode 100644 index 0000000000000..61e3ee739ef63 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_ImportedInPrivate", + "projectRoot": "tests/cases/projects/declarations_ImportedInPrivate", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "private_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "private_m4.js", + "private_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.d.ts b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/private_m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.d.ts new file mode 100644 index 0000000000000..d354e4bfddab0 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.d.ts @@ -0,0 +1,6 @@ +export declare module usePrivate_m4_m1 { + var x3; + var d3; + var f3; + var numberVar; +} diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.js b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.js new file mode 100644 index 0000000000000..67fafa501e4f9 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/useModule.js @@ -0,0 +1,9 @@ +define(["require", "exports", "private_m4"], function (require, exports, private_m4) { + (function (usePrivate_m4_m1) { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + usePrivate_m4_m1.numberVar; + })(exports.usePrivate_m4_m1 || (exports.usePrivate_m4_m1 = {})); + var usePrivate_m4_m1 = exports.usePrivate_m4_m1; +}); diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.json b/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.json new file mode 100644 index 0000000000000..61e3ee739ef63 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_ImportedInPrivate", + "projectRoot": "tests/cases/projects/declarations_ImportedInPrivate", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "private_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "private_m4.js", + "private_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.d.ts b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/private_m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.d.ts b/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.d.ts new file mode 100644 index 0000000000000..d354e4bfddab0 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.d.ts @@ -0,0 +1,6 @@ +export declare module usePrivate_m4_m1 { + var x3; + var d3; + var f3; + var numberVar; +} diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.js b/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.js new file mode 100644 index 0000000000000..9ff12ce92bccb --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/useModule.js @@ -0,0 +1,8 @@ +var private_m4 = require("private_m4"); +(function (usePrivate_m4_m1) { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + usePrivate_m4_m1.numberVar; +})(exports.usePrivate_m4_m1 || (exports.usePrivate_m4_m1 = {})); +var usePrivate_m4_m1 = exports.usePrivate_m4_m1; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/declarationsImportedUseInFunction.json b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/declarationsImportedUseInFunction.json new file mode 100644 index 0000000000000..c695a7c7cfdfc --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/declarationsImportedUseInFunction.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_ImportedUseInFunction", + "projectRoot": "tests/cases/projects/declarations_ImportedUseInFunction", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "fncOnly_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "fncOnly_m4.js", + "fncOnly_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.d.ts b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/fncOnly_m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.d.ts new file mode 100644 index 0000000000000..59e5bef3ae56d --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.d.ts @@ -0,0 +1 @@ +export declare var useFncOnly_m4_f4; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.js new file mode 100644 index 0000000000000..b8bed40b45895 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/amd/useModule.js @@ -0,0 +1,3 @@ +define(["require", "exports", "fncOnly_m4"], function (require, exports, fncOnly_m4) { + exports.useFncOnly_m4_f4 = fncOnly_m4.foo(); +}); diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/declarationsImportedUseInFunction.json b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/declarationsImportedUseInFunction.json new file mode 100644 index 0000000000000..c695a7c7cfdfc --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/declarationsImportedUseInFunction.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_ImportedUseInFunction", + "projectRoot": "tests/cases/projects/declarations_ImportedUseInFunction", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "fncOnly_m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "fncOnly_m4.js", + "fncOnly_m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.d.ts b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/fncOnly_m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.d.ts b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.d.ts new file mode 100644 index 0000000000000..59e5bef3ae56d --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.d.ts @@ -0,0 +1 @@ +export declare var useFncOnly_m4_f4; diff --git a/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.js b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.js new file mode 100644 index 0000000000000..77269ecdb7831 --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedUseInFunction/node/useModule.js @@ -0,0 +1,2 @@ +var fncOnly_m4 = require("fncOnly_m4"); +exports.useFncOnly_m4_f4 = fncOnly_m4.foo(); diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/declarationsIndirectImportShouldResultInError.json b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/declarationsIndirectImportShouldResultInError.json new file mode 100644 index 0000000000000..2662f28161de2 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/declarationsIndirectImportShouldResultInError.json @@ -0,0 +1,19 @@ +{ + "scenario": "declarations_IndirectImport should result in error", + "projectRoot": "tests/cases/projects/declarations_IndirectImport", + "inputFiles": [ + "useModule.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m5.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m5.js", + "useModule.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m5.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m5.js new file mode 100644 index 0000000000000..ef62a311ef337 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/m5.js @@ -0,0 +1,6 @@ +define(["require", "exports", "m4"], function (require, exports, m4) { + function foo2() { + return new m4.d(); + } + exports.foo2 = foo2; +}); diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/useModule.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/useModule.js new file mode 100644 index 0000000000000..dd66dca110af6 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/amd/useModule.js @@ -0,0 +1,8 @@ +define(["require", "exports", "m5"], function (require, exports, m5) { + exports.d = m5.foo2(); + exports.x = m5.foo2; + function n() { + return m5.foo2(); + } + exports.n = n; +}); diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/declarationsIndirectImportShouldResultInError.json b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/declarationsIndirectImportShouldResultInError.json new file mode 100644 index 0000000000000..2662f28161de2 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/declarationsIndirectImportShouldResultInError.json @@ -0,0 +1,19 @@ +{ + "scenario": "declarations_IndirectImport should result in error", + "projectRoot": "tests/cases/projects/declarations_IndirectImport", + "inputFiles": [ + "useModule.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m5.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m5.js", + "useModule.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js new file mode 100644 index 0000000000000..b9856df80d0a9 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js @@ -0,0 +1,5 @@ +var m4 = require("m4"); +function foo2() { + return new m4.d(); +} +exports.foo2 = foo2; diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/useModule.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/useModule.js new file mode 100644 index 0000000000000..2e815be2bd546 --- /dev/null +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/useModule.js @@ -0,0 +1,7 @@ +var m5 = require("m5"); +exports.d = m5.foo2(); +exports.x = m5.foo2; +function n() { + return m5.foo2(); +} +exports.n = n; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.json b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.json new file mode 100644 index 0000000000000..7d52e1fc8b33e --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_MultipleTimesImport", + "projectRoot": "tests/cases/projects/declarations_MultipleTimesImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.d.ts new file mode 100644 index 0000000000000..51056e329ac7a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.d.ts @@ -0,0 +1,14 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} +export declare var useMultiImport_m4_x4; +export declare var useMultiImport_m4_d4; +export declare var useMultiImport_m4_f4; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.js new file mode 100644 index 0000000000000..a9d9d58b84280 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/useModule.js @@ -0,0 +1,17 @@ +define(["require", "exports", "m4", "m4"], function (require, exports, m4, multiImport_m4) { + exports.x4 = m4.x; + exports.d4 = m4.d; + exports.f4 = m4.foo(); + (function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + })(exports.m1 || (exports.m1 = {})); + var m1 = exports.m1; + exports.useMultiImport_m4_x4 = multiImport_m4.x; + exports.useMultiImport_m4_d4 = multiImport_m4.d; + exports.useMultiImport_m4_f4 = multiImport_m4.foo(); +}); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.json b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.json new file mode 100644 index 0000000000000..7d52e1fc8b33e --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_MultipleTimesImport", + "projectRoot": "tests/cases/projects/declarations_MultipleTimesImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.d.ts new file mode 100644 index 0000000000000..51056e329ac7a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.d.ts @@ -0,0 +1,14 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} +export declare var useMultiImport_m4_x4; +export declare var useMultiImport_m4_d4; +export declare var useMultiImport_m4_f4; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js new file mode 100644 index 0000000000000..384226c77f38c --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js @@ -0,0 +1,17 @@ +var m4 = require("m4"); +exports.x4 = m4.x; +exports.d4 = m4.d; +exports.f4 = m4.foo(); +(function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var multiImport_m4 = require("m4"); +exports.useMultiImport_m4_x4 = multiImport_m4.x; +exports.useMultiImport_m4_d4 = multiImport_m4.d; +exports.useMultiImport_m4_f4 = multiImport_m4.foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.json b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.json new file mode 100644 index 0000000000000..7b92f7321cd9b --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.json @@ -0,0 +1,23 @@ +{ + "scenario": "declarations_MultipleTimesMultipleImport", + "projectRoot": "tests/cases/projects/declarations_MultipleTimesMultipleImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "m5.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "m5.js", + "m5.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.d.ts new file mode 100644 index 0000000000000..680e023ca1f57 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.d.ts @@ -0,0 +1 @@ +export declare function foo2(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.js new file mode 100644 index 0000000000000..ef62a311ef337 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/m5.js @@ -0,0 +1,6 @@ +define(["require", "exports", "m4"], function (require, exports, m4) { + function foo2() { + return new m4.d(); + } + exports.foo2 = foo2; +}); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.d.ts new file mode 100644 index 0000000000000..350e7dc20318a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.d.ts @@ -0,0 +1,12 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} +export declare var d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.js new file mode 100644 index 0000000000000..94582ed62085b --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/useModule.js @@ -0,0 +1,15 @@ +define(["require", "exports", "m4", "m5"], function (require, exports, m4, m5) { + exports.x4 = m4.x; + exports.d4 = m4.d; + exports.f4 = m4.foo(); + (function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + })(exports.m1 || (exports.m1 = {})); + var m1 = exports.m1; + exports.d = m5.foo2(); +}); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.json b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.json new file mode 100644 index 0000000000000..7b92f7321cd9b --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.json @@ -0,0 +1,23 @@ +{ + "scenario": "declarations_MultipleTimesMultipleImport", + "projectRoot": "tests/cases/projects/declarations_MultipleTimesMultipleImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "m5.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "m5.js", + "m5.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.d.ts new file mode 100644 index 0000000000000..680e023ca1f57 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.d.ts @@ -0,0 +1 @@ +export declare function foo2(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js new file mode 100644 index 0000000000000..b9856df80d0a9 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js @@ -0,0 +1,5 @@ +var m4 = require("m4"); +function foo2() { + return new m4.d(); +} +exports.foo2 = foo2; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.d.ts b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.d.ts new file mode 100644 index 0000000000000..350e7dc20318a --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.d.ts @@ -0,0 +1,12 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} +export declare var d; diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js new file mode 100644 index 0000000000000..056b8619f3921 --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js @@ -0,0 +1,15 @@ +var m4 = require("m4"); +exports.x4 = m4.x; +exports.d4 = m4.d; +exports.f4 = m4.foo(); +(function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; +var m5 = require("m5"); +exports.d = m5.foo2(); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.json b/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.json new file mode 100644 index 0000000000000..2497ac9b8d0ea --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_SimpleImport", + "projectRoot": "tests/cases/projects/declarations_SimpleImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.d.ts b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js new file mode 100644 index 0000000000000..dcde28794d17a --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/m4.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + var d = (function () { + function d() { + } + return d; + })(); + exports.d = d; + ; + exports.x; + function foo() { + return new d(); + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.d.ts b/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.d.ts new file mode 100644 index 0000000000000..ba62913928547 --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.d.ts @@ -0,0 +1,11 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.js b/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.js new file mode 100644 index 0000000000000..0f3891c021264 --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/useModule.js @@ -0,0 +1,14 @@ +define(["require", "exports", "m4"], function (require, exports, m4) { + exports.x4 = m4.x; + exports.d4 = m4.d; + exports.f4 = m4.foo(); + (function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + })(exports.m1 || (exports.m1 = {})); + var m1 = exports.m1; +}); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.json b/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.json new file mode 100644 index 0000000000000..2497ac9b8d0ea --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.json @@ -0,0 +1,20 @@ +{ + "scenario": "declarations_SimpleImport", + "projectRoot": "tests/cases/projects/declarations_SimpleImport", + "inputFiles": [ + "useModule.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "useModule.ts", + "m4.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m4.js", + "m4.d.ts", + "useModule.js", + "useModule.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.d.ts b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.d.ts new file mode 100644 index 0000000000000..4db8e459b47fa --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.d.ts @@ -0,0 +1,4 @@ +export declare class d { +} +export declare var x; +export declare function foo(); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js new file mode 100644 index 0000000000000..69fc2903493f7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/m4.js @@ -0,0 +1,12 @@ +var d = (function () { + function d() { + } + return d; +})(); +exports.d = d; +; +exports.x; +function foo() { + return new d(); +} +exports.foo = foo; diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.d.ts b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.d.ts new file mode 100644 index 0000000000000..ba62913928547 --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.d.ts @@ -0,0 +1,11 @@ +export declare var x4; +export declare var d4; +export declare var f4; +export declare module m1 { + var x2; + var d2; + var f2; + var x3; + var d3; + var f3; +} diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js new file mode 100644 index 0000000000000..23d0d8c66d5ed --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js @@ -0,0 +1,13 @@ +var m4 = require("m4"); +exports.x4 = m4.x; +exports.d4 = m4.d; +exports.f4 = m4.foo(); +(function (m1) { + m1.x2 = m4.x; + m1.d2 = m4.d; + m1.f2 = m4.foo(); + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); +})(exports.m1 || (exports.m1 = {})); +var m1 = exports.m1; diff --git a/tests/baselines/reference/project/declareExportAdded/amd/consumer.js b/tests/baselines/reference/project/declareExportAdded/amd/consumer.js new file mode 100644 index 0000000000000..d42137754fa98 --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/amd/consumer.js @@ -0,0 +1 @@ +M1.f1(); diff --git a/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.json b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.json new file mode 100644 index 0000000000000..b8657c85b441d --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.json @@ -0,0 +1,16 @@ +{ + "scenario": "declare export added", + "projectRoot": "tests/cases/projects/DeclareExportAdded", + "inputFiles": [ + "consumer.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "consumer.ts", + "ref.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consumer.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declareExportAdded/node/consumer.js b/tests/baselines/reference/project/declareExportAdded/node/consumer.js new file mode 100644 index 0000000000000..d42137754fa98 --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/node/consumer.js @@ -0,0 +1 @@ +M1.f1(); diff --git a/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.json b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.json new file mode 100644 index 0000000000000..b8657c85b441d --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.json @@ -0,0 +1,16 @@ +{ + "scenario": "declare export added", + "projectRoot": "tests/cases/projects/DeclareExportAdded", + "inputFiles": [ + "consumer.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "consumer.ts", + "ref.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consumer.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt new file mode 100644 index 0000000000000..9d595fad4a589 --- /dev/null +++ b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt @@ -0,0 +1 @@ +in2.d.ts(1,8): Duplicate identifier 'a'. diff --git a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.json b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.json new file mode 100644 index 0000000000000..a32841c0b1c45 --- /dev/null +++ b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.json @@ -0,0 +1,16 @@ +{ + "scenario": "declare Variable Collision", + "projectRoot": "tests/cases/projects/declareVariableCollision", + "inputFiles": [ + "decl.d.ts", + "in1.d.ts", + "in2.d.ts" + ], + "resolvedInputFiles": [ + "decl.d.ts", + "in1.d.ts", + "in2.d.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt new file mode 100644 index 0000000000000..9d595fad4a589 --- /dev/null +++ b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt @@ -0,0 +1 @@ +in2.d.ts(1,8): Duplicate identifier 'a'. diff --git a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.json b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.json new file mode 100644 index 0000000000000..a32841c0b1c45 --- /dev/null +++ b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.json @@ -0,0 +1,16 @@ +{ + "scenario": "declare Variable Collision", + "projectRoot": "tests/cases/projects/declareVariableCollision", + "inputFiles": [ + "decl.d.ts", + "in1.d.ts", + "in2.d.ts" + ], + "resolvedInputFiles": [ + "decl.d.ts", + "in1.d.ts", + "in2.d.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.json b/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.json new file mode 100644 index 0000000000000..c3722f9581ef5 --- /dev/null +++ b/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.json @@ -0,0 +1,18 @@ +{ + "scenario": "ext referencing ext and int", + "projectRoot": "tests/cases/projects/ext-int-ext", + "inputFiles": [ + "external.ts" + ], + "resolvedInputFiles": [ + "external.ts", + "internal.ts", + "external2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "internal.js", + "external2.js", + "external.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.json b/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.json new file mode 100644 index 0000000000000..c3722f9581ef5 --- /dev/null +++ b/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.json @@ -0,0 +1,18 @@ +{ + "scenario": "ext referencing ext and int", + "projectRoot": "tests/cases/projects/ext-int-ext", + "inputFiles": [ + "external.ts" + ], + "resolvedInputFiles": [ + "external.ts", + "internal.ts", + "external2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "internal.js", + "external2.js", + "external.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt new file mode 100644 index 0000000000000..d0786cec0a500 --- /dev/null +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt @@ -0,0 +1 @@ +internal2.ts(2,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.json b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.json new file mode 100644 index 0000000000000..5eef712b09ff7 --- /dev/null +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.json @@ -0,0 +1,12 @@ +{ + "scenario": "int referencing ext and int", + "projectRoot": "tests/cases/projects/ext-int-ext", + "inputFiles": [ + "internal2.ts" + ], + "resolvedInputFiles": [ + "internal2.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt new file mode 100644 index 0000000000000..d0786cec0a500 --- /dev/null +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt @@ -0,0 +1 @@ +internal2.ts(2,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.json b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.json new file mode 100644 index 0000000000000..5eef712b09ff7 --- /dev/null +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.json @@ -0,0 +1,12 @@ +{ + "scenario": "int referencing ext and int", + "projectRoot": "tests/cases/projects/ext-int-ext", + "inputFiles": [ + "internal2.ts" + ], + "resolvedInputFiles": [ + "internal2.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..864fffa894ac9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5e77bce62b316 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..80c5ac103c959 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..9dad0db002a05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a2f16483a1e05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..aa651dac74cc5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..16fa0fe78793c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..864fffa894ac9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..0a2a9b139aab8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..80c5ac103c959 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..3eaebd5c1367e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..87101a5b08465 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..aa651dac74cc5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..16fa0fe78793c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..e0540132e7e46 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..f1a9b7bc16a03 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..80c5ac103c959 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..9dad0db002a05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..a2f16483a1e05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..aa651dac74cc5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..16fa0fe78793c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..e0540132e7e46 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..6f0bcf13bd0b9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..80c5ac103c959 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..3eaebd5c1367e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..87101a5b08465 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..aa651dac74cc5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..16fa0fe78793c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..b758f144d5c67 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..cdef85d419d08 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f0348aeee31a2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..5ee16b0dadaa4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..9dad0db002a05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a2f16483a1e05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..b758f144d5c67 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..cdef85d419d08 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f0348aeee31a2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..fa0ec9a7620af --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..3eaebd5c1367e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..87101a5b08465 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..76db561018dc7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..f5684dd19d49f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..06de8fc379f00 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..afeb358b21cca --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..9dad0db002a05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..a2f16483a1e05 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..76db561018dc7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..f5684dd19d49f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..06de8fc379f00 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_mixed_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..5a96a075f1040 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..3eaebd5c1367e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..87101a5b08465 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..89642c2cc6dae --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..8fe95a1506f8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..345abfeadf8f0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..f8e8d8dfcda7f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..52b5e682660ed --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..2de14ea458352 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..a2a29b4dcfc07 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..2fa75cca66829 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..a9c59a766f96d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..589c5838a2c10 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..345abfeadf8f0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..784e7f4633d98 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..b0e6a265bc985 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..d01d6f28db20b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..16422a234c58c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..fca31256992a7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..cba8c8d1b6476 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..db4c232c316ee --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..52b5e682660ed --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..2de14ea458352 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..a2a29b4dcfc07 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..2fa75cca66829 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8fe95a1506f8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..89642c2cc6dae --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..cba8c8d1b6476 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..84cb97409a546 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..b0e6a265bc985 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..d01d6f28db20b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..16422a234c58c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..fca31256992a7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..589c5838a2c10 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..a9c59a766f96d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..18e06e5bc506e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..89642c2cc6dae --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..8fe95a1506f8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4f15a75b8d987 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..4cd682b8c3bf1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..52b5e682660ed --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..2de14ea458352 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..a2a29b4dcfc07 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..2fa75cca66829 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..18e06e5bc506e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..a9c59a766f96d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..589c5838a2c10 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4f15a75b8d987 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6bd3da2ec8da3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..b0e6a265bc985 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..d01d6f28db20b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..16422a234c58c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..fca31256992a7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..86c0ba4123800 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..3f1621538757a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..b7beffd7609dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..a8a5bb2ccd290 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..6e24571a3f270 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..cdcab4fcd0879 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..c8a4f5c91a47b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..edd3870ab63b6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..b7beffd7609dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..23be4fbfdc41e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..080dcf6e8181e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..1d68ca1674815 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..6615ea576e30b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..6c8b73f6c8b4e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..86c0ba4123800 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..3f1621538757a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..6e24571a3f270 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..cdcab4fcd0879 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..6615ea576e30b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b61a3bce9ad17 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..c8a4f5c91a47b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..edd3870ab63b6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..080dcf6e8181e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..1d68ca1674815 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..f6e3eb542f45d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..86c0ba4123800 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..3f1621538757a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..07e886edebaeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..39e2b7f43feab --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..6e24571a3f270 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..cdcab4fcd0879 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..f6e3eb542f45d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..c8a4f5c91a47b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..edd3870ab63b6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..07e886edebaeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..e26fe9d11411c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..080dcf6e8181e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..1d68ca1674815 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..aab45205df52d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..c83cc3c4cd484 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..e819d557c4032 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..cb45000989996 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..3b2cd1a24c424 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..e807575b382f5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..aab45205df52d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..0b9f727913a0b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..a420241c901c3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..5a72780e994d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..f6319258d8f9d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..1952f8c0e7de8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..08d543fdd3304 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d99f6762b89de --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..e819d557c4032 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..cb45000989996 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..3b2cd1a24c424 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..e807575b382f5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..08d543fdd3304 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..284e615b39cae --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..a420241c901c3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..5a72780e994d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..f6319258d8f9d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..1952f8c0e7de8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7ff280253f1b4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..85f503c6b94f3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..ac800e51764fc --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..e819d557c4032 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..cb45000989996 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..3b2cd1a24c424 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..e807575b382f5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7ff280253f1b4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..85f503c6b94f3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_module_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..fe52512fa0a1e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..a420241c901c3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..5a72780e994d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..f6319258d8f9d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..1952f8c0e7de8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..19d51858d767c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..8dc7c506cd6dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..725572edc8951 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..11c1042a75160 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..77245d4717bd4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..d06b5ac3fdd93 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..19d51858d767c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..8dc7c506cd6dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..725572edc8951 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..11c1042a75160 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..77245d4717bd4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..d06b5ac3fdd93 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fe0849476c991 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..382d77cf0e598 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..77245d4717bd4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..d06b5ac3fdd93 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8dc7c506cd6dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..19d51858d767c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fe0849476c991 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..382d77cf0e598 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..77245d4717bd4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..d06b5ac3fdd93 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8dc7c506cd6dd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..19d51858d767c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..f87eb9833a661 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..b48597f838f02 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d0d8958a7212f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2e1fe00298a65 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..f87eb9833a661 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..b48597f838f02 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d0d8958a7212f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_multifolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2e1fe00298a65 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..5139d59fad093 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..b52fecc1d52e6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..30c240dd45e7b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..3a048c5d0349b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..328ca75fc6fc2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..5139d59fad093 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..b52fecc1d52e6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..30c240dd45e7b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..3a048c5d0349b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..328ca75fc6fc2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..42ca7c875d2b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..840efe46cc828 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..5139d59fad093 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..b52fecc1d52e6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..328ca75fc6fc2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..42ca7c875d2b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..840efe46cc828 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map +sourceRoot: +sources: ../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..5139d59fad093 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..b52fecc1d52e6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..328ca75fc6fc2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..b6010105a09fa --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..908a7800f1491 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..03700f4145173 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..455f997059b47 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..b6010105a09fa --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..908a7800f1491 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..03700f4145173 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_simple/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..455f997059b47 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map +sourceRoot: +sources: ../m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..f2c2c11d40eec --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e73d1fdf39b89 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..f2c2c11d40eec --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e73d1fdf39b89 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4cbb9837b4e06 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a7c2ec6a92b71 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4cbb9837b4e06 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a7c2ec6a92b71 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..7adae3efc6ded --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c6d7e2d77eb7d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..c2399b3d0241b --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..7adae3efc6ded --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_singleFile/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c6d7e2d77eb7d --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..2a9e9211d1fdd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..39cacbeef201a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..02f4c47bdc7f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..fd2a763910ef5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..2a9e9211d1fdd --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..39cacbeef201a --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..02f4c47bdc7f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..fd2a763910ef5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..0b7bb40e24659 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..4b27c9d09fca2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..02f4c47bdc7f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..fd2a763910ef5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..0b7bb40e24659 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..4b27c9d09fca2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..02f4c47bdc7f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..16f97c48e68c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..fd2a763910ef5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d2761693aaba5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..395927c02b096 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..eeb60352d26b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..bc2925bf6f59c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..ccea1b28f187c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..395927c02b096 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..eeb60352d26b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..bc2925bf6f59c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-AbsolutePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "tests/cases/projects/outputdir_subfolder/mapFiles", + "resolveMapRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..ccea1b28f187c --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..6e76d83b7f27b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8a041f9d2162a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..1317ac6574e32 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c8bc7a5deadee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..4f0b35f21c7e5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..9697f0008ad0c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..320edbdbdb9a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..6e76d83b7f27b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..fb786efd56aee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1317ac6574e32 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..c8bc7a5deadee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..f13773b3384b3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..5eaf90bb13764 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..320edbdbdb9a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..495a74523ef0a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..91bdef4e6966f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..33cf31f7700ee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c8bc7a5deadee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..e4c8f7b361033 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..9697f0008ad0c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..320edbdbdb9a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..495a74523ef0a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..bd5c801ef6de8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..33cf31f7700ee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c8bc7a5deadee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..d78261fe225e2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..5eaf90bb13764 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..320edbdbdb9a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..03f724cdf7017 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..bb6df8c16925d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..67acb15edbcb3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..4f0b35f21c7e5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..9697f0008ad0c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..03f724cdf7017 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..bb6df8c16925d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..afeacd57cf123 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..f13773b3384b3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..5eaf90bb13764 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..f7b816443ca80 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..480445b607003 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..9411b60b0e8c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..1b111184a4606 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: ../../../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: ../../mapFiles/outAndOutDirFile.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..e4c8f7b361033 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..9697f0008ad0c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..f7b816443ca80 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..480445b607003 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..9411b60b0e8c8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..303e1b1ebd25b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: ../../../../mapFiles/ref/m2.js.map +sourceRoot: +sources: ../../outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: ../../mapFiles/outAndOutDirFile.js.map +sourceRoot: +sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..d78261fe225e2 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..5eaf90bb13764 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..90534df8d8ca1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..ad9b3f686118e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..fa1ee9b3187d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..9986c904a2e0b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..09fbf68994d4d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..458a007af7d1e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..90dee0800c7b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..9e56ebb991d84 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..156d44b336a49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..573ce2ac6c550 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..fa1ee9b3187d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..683855ebe850d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..87f1f3a51b7a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..d88675f1bb687 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..6e2fb8d785198 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..b4e88f8cf4d57 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..d27794184908e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3b46f52c0a3b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..3b74c0f890ef4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..458a007af7d1e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..5224ad7d4fde7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..9e56ebb991d84 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..2f060a4768661 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..90534df8d8ca1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..d27794184908e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e51988fff453a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..ab4a16c55108d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..d88675f1bb687 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..c439bd5a5ef55 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..b4e88f8cf4d57 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..f8a4cd2f22225 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..156d44b336a49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..f359cef4be2f8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..90534df8d8ca1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..ad9b3f686118e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..3d3dfd468208b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..170c86cf98e18 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..09fbf68994d4d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..458a007af7d1e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..90dee0800c7b8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..9e56ebb991d84 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..f359cef4be2f8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..156d44b336a49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..573ce2ac6c550 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..3d3dfd468208b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..48b161591d226 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..87f1f3a51b7a5 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..d88675f1bb687 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..6e2fb8d785198 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..b4e88f8cf4d57 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..1fe3446e4bc00 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..4efa8b1c4e8e9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..01dea65ccdd92 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..d2f77da670899 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..14471b6e983ce --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..f2feb05d139f3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..73a399fe2533e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..5382a2122afb0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..01dea65ccdd92 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..16bd40b29ae79 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..1a2a4fc5e6abd --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..c51a3e0d23df7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4d4614ead256e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..40b415a714124 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..1c7488c76ca50 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..4efa8b1c4e8e9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..5de61a43765a3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f2feb05d139f3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4d4614ead256e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c1f746f76009e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..a39c6a4f1040d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..5382a2122afb0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..acba051a083a7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..c51a3e0d23df7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..58e831a041d8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..1fe3446e4bc00 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..4efa8b1c4e8e9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..4a86f6aed5243 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c96db8869f756 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..14471b6e983ce --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..f2feb05d139f3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..58e831a041d8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..73a399fe2533e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..5382a2122afb0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..4a86f6aed5243 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..a74920582eae3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..1a2a4fc5e6abd --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..c51a3e0d23df7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..cbcb519f6e0e9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..a745692adc0ca --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..3e8406858e243 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c36f481f1b5df --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..84b62ed0fc7af --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..bf794345a000b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..cbcb519f6e0e9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..13576c48bf98b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..2dbac1edb8e92 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..914c886ac878a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..c6dd0639fb74e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..1b507245fc6bb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2ee495e24c424 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..f67ab153f7317 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..60a3a0f5552b6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c36f481f1b5df --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..14791061d04ad --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..bf794345a000b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2ee495e24c424 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..206300e0c3468 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..5f32feb74bdd9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..914c886ac878a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..5c2cb37295456 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..1b507245fc6bb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..58e831a041d8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..77aacc6e0cfab --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..5f6bdc4ae9837 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=../mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..3e8406858e243 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c36f481f1b5df --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..84b62ed0fc7af --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..bf794345a000b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..58e831a041d8a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..77aacc6e0cfab --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..251fcdee70a38 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..2dbac1edb8e92 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..914c886ac878a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..c6dd0639fb74e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..1b507245fc6bb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..b7b0675e73319 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..c257072707f7d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..86d530522ecd8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8b01e21ef01d7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..2b547787de63f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..61da94509c811 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..1c2cc13934e80 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..34a1d5972e247 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..b7b0675e73319 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..c257072707f7d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..86d530522ecd8 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8b01e21ef01d7 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:../../projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../../projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..2b547787de63f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..61da94509c811 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..1c2cc13934e80 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..34a1d5972e247 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..efc5d6f6df289 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b4dbc8d951398 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../../../mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..a135e4b027862 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..61da94509c811 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..05506d3b654d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..34a1d5972e247 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..500879e7bb932 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..b7b0675e73319 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..efc5d6f6df289 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b4dbc8d951398 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: ../../../projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: ../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../../../mapFiles/outputdir_multifolder/test.js.map +sourceRoot: +sources: ../../projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..a135e4b027862 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..61da94509c811 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..05506d3b654d9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..34a1d5972e247 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..500879e7bb932 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..b7b0675e73319 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..cf6a1ab6b3106 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..678b4b07a7731 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..69615f0648aa4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..28b577af41f6d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_multifolder/ref/m1.ts,../outputdir_multifolder_ref/m2.ts,../outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..cf6a1ab6b3106 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..678b4b07a7731 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_multifolder/ref/m1.ts","../outputdir_multifolder_ref/m2.ts","../outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..69615f0648aa4 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..28b577af41f6d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_multifolder/ref/m1.ts,../outputdir_multifolder_ref/m2.ts,../outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..517ed8f64920d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..54e9026a8747f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..d1bd1e717528e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..70e9eeb86507c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..04c9323ca4e8d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..517ed8f64920d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..54e9026a8747f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..d1bd1e717528e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..70e9eeb86507c --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..04c9323ca4e8d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..797faccce7f35 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..0e451ad019fd0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..41150949e29ca --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..54e9026a8747f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..04c9323ca4e8d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..797faccce7f35 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..0e451ad019fd0 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../mapFiles/m1.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..41150949e29ca --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../mapFiles/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..54e9026a8747f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..04c9323ca4e8d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..332f464c1a6f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..065d4a4c01705 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..755acd78bfe1f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts,../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..332f464c1a6f9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..065d4a4c01705 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..755acd78bfe1f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_simple/m1.ts,../outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..b625cc5d15b40 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5a20e2a7c7c3b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..b625cc5d15b40 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5a20e2a7c7c3b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..a5177812b6c8b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d3ed95ca916b3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..a5177812b6c8b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d3ed95ca916b3 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..f57e937148ebb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..ce0125908e94d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..512266b62374b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..f57e937148ebb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..f664b08016132 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..ce0125908e94d --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..512266b62374b --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..32209f1565b26 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..633392459660a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..1317ac6574e32 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..23fb6d33f8aeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..fc6f3410d0f49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..32209f1565b26 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..633392459660a --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:../../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1317ac6574e32 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..23fb6d33f8aeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..39ea4830920a6 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..fc6f3410d0f49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..44c4ec3f00477 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c7ff5d90c3136 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..33cf31f7700ee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..23fb6d33f8aeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..fc6f3410d0f49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..44c4ec3f00477 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c7ff5d90c3136 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: ../../../../mapFiles/ref/m1.js.map +sourceRoot: +sources: ../../outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: ../../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..33cf31f7700ee --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..23fb6d33f8aeb --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ca051a06fbf95 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..fc6f3410d0f49 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..9c66bbc80e8a1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..44b644014a6b9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..4543f196ea189 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/ref/m1.ts,../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..3112a063a43ea --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..9c66bbc80e8a1 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..44b644014a6b9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-RelativePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "../mapFiles", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..4543f196ea189 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: ../../mapFiles/test.js.map +sourceRoot: +sources: ../outputdir_subfolder/ref/m1.ts,../outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..e6f53596e2e85 --- /dev/null +++ b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.errors.txt @@ -0,0 +1,2 @@ +Option mapRoot cannot be specified without specifying sourcemap option. +Option sourceRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.json b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..7d54f007b944b --- /dev/null +++ b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/amd/mapRootSourceRootWithNoSourceMapOption.json @@ -0,0 +1,15 @@ +{ + "scenario": "--mapRoot and --sourceRoot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "mapRoot": "../mapFiles", + "sourceRoot": "../src", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..e6f53596e2e85 --- /dev/null +++ b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.errors.txt @@ -0,0 +1,2 @@ +Option mapRoot cannot be specified without specifying sourcemap option. +Option sourceRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.json b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..7d54f007b944b --- /dev/null +++ b/tests/baselines/reference/project/mapRootSourceRootWithNoSourceMapOption/node/mapRootSourceRootWithNoSourceMapOption.json @@ -0,0 +1,15 @@ +{ + "scenario": "--mapRoot and --sourceRoot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "mapRoot": "../mapFiles", + "sourceRoot": "../src", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..842372fce5d46 --- /dev/null +++ b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.errors.txt @@ -0,0 +1 @@ +Option mapRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.json b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..1f92658ffb5a9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/amd/mapRootWithNoSourceMapOption.json @@ -0,0 +1,14 @@ +{ + "scenario": "Maproot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "mapRoot": "../mapFiles", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..842372fce5d46 --- /dev/null +++ b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.errors.txt @@ -0,0 +1 @@ +Option mapRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.json b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..1f92658ffb5a9 --- /dev/null +++ b/tests/baselines/reference/project/mapRootWithNoSourceMapOption/node/mapRootWithNoSourceMapOption.json @@ -0,0 +1,14 @@ +{ + "scenario": "Maproot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "mapRoot": "../mapFiles", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..1ab3e27d443a9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8d774a44e594d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..1b8646a41af3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a3f3bcc4e8b44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..366c350fa3d95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..1ab3e27d443a9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b82d9a777ed2f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..1b8646a41af3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..8635a7515df26 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..366c350fa3d95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..9edcfc2c208b5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..992984b18f5f5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..1b8646a41af3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..a3f3bcc4e8b44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..366c350fa3d95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..9edcfc2c208b5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c94d152058d41 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..1b8646a41af3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..8635a7515df26 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..366c350fa3d95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..be23341791d02 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..18ba8246750d8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f3eb57d201ea7 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a3f3bcc4e8b44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..be23341791d02 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..18ba8246750d8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..92854c1cd372e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..8635a7515df26 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..3fb10c4abce3e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..cb8d37b30917a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..cb6ad2ef380dc --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c92c4ed0ec240 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..a3f3bcc4e8b44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..3fb10c4abce3e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..cb8d37b30917a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..cb6ad2ef380dc --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c41a6b6ebf9c3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..8635a7515df26 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..4c7df3a9d40cd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..016119a336e7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..a4ce5648e5bee --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..2516d32cb2213 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..aabb245d0366d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..457cf11710d08 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..016119a336e7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..29fa229628c60 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..dec5547158479 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..a8d13feec67d5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..41127aa8f69e9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7ad61dddeeccd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..2516d32cb2213 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..aabb245d0366d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..4c7df3a9d40cd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..41127aa8f69e9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..40f49063f38ae --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..dec5547158479 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..a8d13feec67d5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..457cf11710d08 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..4c7df3a9d40cd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..89d5a87ce135c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..5a4217fe733c4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..2516d32cb2213 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..aabb245d0366d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..457cf11710d08 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..89d5a87ce135c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..4db3d0c70d344 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..dec5547158479 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..a8d13feec67d5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..b83ab295512dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..7521dcd510c9b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..fad4fc1783cfd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..4aca98811da7e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..a00af772e4d44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..7521dcd510c9b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..136894e2adf24 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..a842c47d7fafb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..13a30a3b68119 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c71e97ff503fb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..b83ab295512dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4aca98811da7e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..13a30a3b68119 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..ccc7c6c0ffcc4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..a00af772e4d44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..a842c47d7fafb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..b83ab295512dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..03769a184ff15 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..697df496dfe91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..4aca98811da7e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..a00af772e4d44 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..03769a184ff15 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..248347a869c8c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..a842c47d7fafb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..8df66978336b3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..2d63c4bddac21 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..e31fdeb2b46e9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..243a840423d1b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..8df66978336b3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..83179011b9612 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..949975a6ea1dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..adfae43de8ec6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..dc6fdfdfc0349 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..bcfc5bc3195e7 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..e31fdeb2b46e9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..243a840423d1b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..dc6fdfdfc0349 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c1c33e4a5e75f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..949975a6ea1dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..adfae43de8ec6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..763adf95468d8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..bba66e6cf928f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..e31fdeb2b46e9 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..243a840423d1b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..763adf95468d8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..eae6ea635afef --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..949975a6ea1dd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..adfae43de8ec6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..0b381a365b636 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..c4dca1e740530 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..4e2ac5b01d6ad --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..1429bf14f31d0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..69418ac38a0d6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..0b381a365b636 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..c4dca1e740530 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..4e2ac5b01d6ad --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..1429bf14f31d0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..69418ac38a0d6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2c2405592d54f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..38886b8b052f7 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..1429bf14f31d0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..69418ac38a0d6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..0b381a365b636 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2c2405592d54f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..38886b8b052f7 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..1429bf14f31d0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..69418ac38a0d6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..0b381a365b636 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..8da3a55d9d8e0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..13734ab1b2526 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d3a8f66663c62 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..124b8873a133e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..8da3a55d9d8e0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..13734ab1b2526 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d3a8f66663c62 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..124b8873a133e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..ce927d94c7c3b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..90c096ac3a6a3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..bdf2944dba657 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..06c5dabf1c6c8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..ce927d94c7c3b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..90c096ac3a6a3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..bdf2944dba657 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..06c5dabf1c6c8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fc9cc53431660 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3db990f78039d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..ce927d94c7c3b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..06c5dabf1c6c8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fc9cc53431660 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3db990f78039d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..ce927d94c7c3b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..06c5dabf1c6c8 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..bb6681c480168 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..918c5434e23fa --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..70d905e86c5b0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts,file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..bb6681c480168 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..918c5434e23fa --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..70d905e86c5b0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_simple/m1.ts,file:///tests/cases/projects/outputdir_simple/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..6425dee144e68 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..039a038f947a6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..6425dee144e68 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..039a038f947a6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..71b35945283d3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..f4bc5552ff533 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..71b35945283d3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..f4bc5552ff533 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..5326a8fad1aa6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f952c25a211b5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..781feaa6938fe --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..5326a8fad1aa6 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f952c25a211b5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_singleFile/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..0e04095152bc4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1cd70387dcd4b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..7f27a87d12853 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..b17258aa79629 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..0e04095152bc4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1cd70387dcd4b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..7f27a87d12853 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..b17258aa79629 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2f03d61fa83e3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..fa7118aa58488 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..7f27a87d12853 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..b17258aa79629 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2f03d61fa83e3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..fa7118aa58488 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..7f27a87d12853 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..b17258aa79629 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3a89b9dc65cc --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..3d2bd9aa1b911 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d3a189430ab1e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3a89b9dc65cc --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..3d2bd9aa1b911 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d3a189430ab1e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: +sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_subfolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..c5e3dd755e061 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..fadb9438e7cfa --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..c5e3dd755e061 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..82f4836ae570b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3ad99b40aaf22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..8015060953edb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3ad99b40aaf22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..640f81a841e45 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..4a2c2ebb408c4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d7dcede10a0a4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..0722496aa12cf --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..4a2c2ebb408c4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d7dcede10a0a4 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..88f3e8903fbc5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..3fb10c4abce3e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..4bc829d46fafb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..7e301b423ddff --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..af49f041f1b95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..aa404804b4587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..3fb10c4abce3e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..4bc829d46fafb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..7e301b423ddff --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..310d6dfaa8e25 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..a39f0f50e5f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..41d79f88b6042 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b646b14d46845 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..41d79f88b6042 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..a10ee47618267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..42cc264023d86 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..4cd04fa270ce3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..42cc264023d86 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..5e78521546158 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..e926e95f3c38b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..893995c55db3d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..db54a0d65a605 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..e8004c87aadb5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..01ad8f96e78ea --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..721fdf3827f91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..893995c55db3d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6f7510afb31d5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..7b14808a06713 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..b9191db7d5ffb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..5fad929ea2795 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..c664fca1e1284 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..5fad929ea2795 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..6224a28a43e06 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4847f63c181ed --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7c145eb9597d1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4847f63c181ed --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e5707eaf2e48e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..1a4d200cdcb5c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..73905b3b71587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..017951622a6ca --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..d752d7f8395e1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..02ca4ab81c74b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..73905b3b71587 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..b9e8c452ef027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..1d5a32f0ad5e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b504cf1df6245 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..15ce6f5a43ac3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b504cf1df6245 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..c3f599f9e80e5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..177d546a1714a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..cb5ad88846a53 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..177d546a1714a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..162707b8a9b72 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f4086fd4cd177 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..33014efc6e7fa --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..73309eabe3027 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..270604ea7cbd0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..52f1b82210026 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f4086fd4cd177 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2c64730243e5d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..8f31dc2aaa230 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..9bb4ed0180a31 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..5ce2eb8da3433 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..6fee35ee39fbb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..5ce2eb8da3433 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..6fee35ee39fbb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..76157de568b77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3d87f0b878534 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..76157de568b77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3d87f0b878534 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== +JsFile: m2.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..da8ac1cb063be --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..a2c419cfeb736 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..8c28bf7d9abf3 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..8da3a55d9d8e0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d86a5b966a416 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..5f507666f42ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2dd1f89463c84 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..8da3a55d9d8e0 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d86a5b966a416 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..5f507666f42ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2dd1f89463c84 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..ef4cb8b6c8a0c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..56c6277d3a27b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..ef4cb8b6c8a0c --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..56c6277d3a27b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..939021ac4a94f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..749d68f6d0a9b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..939021ac4a94f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..749d68f6d0a9b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..24b75dc1a7e7a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..86549d3cdf3e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..860db91051886 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f27f617d8a3eb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..86549d3cdf3e2 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..860db91051886 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f27f617d8a3eb --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..7d817b3714d59 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..02f3351ef304f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..7d817b3714d59 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..02f3351ef304f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..9cbaf6d7b1822 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..1d124c986f404 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..9cbaf6d7b1822 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..1d124c986f404 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..38afdad70d420 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6cd13c5c61277 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..38afdad70d420 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6cd13c5c61277 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..3fc979b31bd95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..9c71223befba5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..3fc979b31bd95 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..9c71223befba5 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ff04d621a855a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d3957b2819aab --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ff04d621a855a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d3957b2819aab --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: http://www.typescriptlang.org/ref/m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f01a67c727732 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..bc0f3007e6a77 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..db639624d793d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..5b32b0114ef76 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c3a5a3791db6a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..7a75cd208092b --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..db639624d793d --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..5b32b0114ef76 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Maproot-Url]/[Sourceroot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "mapRoot": "http://www.typescriptlang.org/", + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c3a5a3791db6a --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: http://www.typescriptlang.org/test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleIdentifier/amd/moduleIdentifier.json b/tests/baselines/reference/project/moduleIdentifier/amd/moduleIdentifier.json new file mode 100644 index 0000000000000..faad46b4cc64e --- /dev/null +++ b/tests/baselines/reference/project/moduleIdentifier/amd/moduleIdentifier.json @@ -0,0 +1,17 @@ +{ + "scenario": "module identifier", + "projectRoot": "tests/cases/projects/ModuleIdentifier", + "inputFiles": [ + "consume.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleIdentifier/node/moduleIdentifier.json b/tests/baselines/reference/project/moduleIdentifier/node/moduleIdentifier.json new file mode 100644 index 0000000000000..faad46b4cc64e --- /dev/null +++ b/tests/baselines/reference/project/moduleIdentifier/node/moduleIdentifier.json @@ -0,0 +1,17 @@ +{ + "scenario": "module identifier", + "projectRoot": "tests/cases/projects/ModuleIdentifier", + "inputFiles": [ + "consume.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.json b/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.json new file mode 100644 index 0000000000000..3a9b5abf8b0ba --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.json @@ -0,0 +1,17 @@ +{ + "scenario": "module merging ordering 1", + "projectRoot": "tests/cases/projects/moduleMergeOrder", + "inputFiles": [ + "a.ts", + "b.ts" + ], + "resolvedInputFiles": [ + "a.ts", + "b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "a.js", + "b.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.json b/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.json new file mode 100644 index 0000000000000..3a9b5abf8b0ba --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.json @@ -0,0 +1,17 @@ +{ + "scenario": "module merging ordering 1", + "projectRoot": "tests/cases/projects/moduleMergeOrder", + "inputFiles": [ + "a.ts", + "b.ts" + ], + "resolvedInputFiles": [ + "a.ts", + "b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "a.js", + "b.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.json b/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.json new file mode 100644 index 0000000000000..3b53727310628 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.json @@ -0,0 +1,17 @@ +{ + "scenario": "module merging ordering 2", + "projectRoot": "tests/cases/projects/moduleMergeOrder", + "inputFiles": [ + "b.ts", + "a.ts" + ], + "resolvedInputFiles": [ + "b.ts", + "a.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "b.js", + "a.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.json b/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.json new file mode 100644 index 0000000000000..3b53727310628 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.json @@ -0,0 +1,17 @@ +{ + "scenario": "module merging ordering 2", + "projectRoot": "tests/cases/projects/moduleMergeOrder", + "inputFiles": [ + "b.ts", + "a.ts" + ], + "resolvedInputFiles": [ + "b.ts", + "a.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "b.js", + "a.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/multipleLevelsModuleResolution/amd/multipleLevelsModuleResolution.json b/tests/baselines/reference/project/multipleLevelsModuleResolution/amd/multipleLevelsModuleResolution.json new file mode 100644 index 0000000000000..5d311932ecd4b --- /dev/null +++ b/tests/baselines/reference/project/multipleLevelsModuleResolution/amd/multipleLevelsModuleResolution.json @@ -0,0 +1,20 @@ +{ + "scenario": "MultipleLevel module resolution", + "projectRoot": "tests/cases/projects/MultipleLevels", + "inputFiles": [ + "root.ts" + ], + "resolvedInputFiles": [ + "root.ts", + "B/B.ts", + "A/A.ts", + "A/AA/AA.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "A/A.js", + "A/AA/AA.js", + "B/B.js", + "root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/multipleLevelsModuleResolution/node/multipleLevelsModuleResolution.json b/tests/baselines/reference/project/multipleLevelsModuleResolution/node/multipleLevelsModuleResolution.json new file mode 100644 index 0000000000000..5d311932ecd4b --- /dev/null +++ b/tests/baselines/reference/project/multipleLevelsModuleResolution/node/multipleLevelsModuleResolution.json @@ -0,0 +1,20 @@ +{ + "scenario": "MultipleLevel module resolution", + "projectRoot": "tests/cases/projects/MultipleLevels", + "inputFiles": [ + "root.ts" + ], + "resolvedInputFiles": [ + "root.ts", + "B/B.ts", + "A/A.ts", + "A/AA/AA.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "A/A.js", + "A/AA/AA.js", + "B/B.js", + "root.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.json b/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.json new file mode 100644 index 0000000000000..8b49ec265f704 --- /dev/null +++ b/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.json @@ -0,0 +1,14 @@ +{ + "scenario": "nested declare", + "projectRoot": "tests/cases/projects/NestedDeclare", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.json b/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.json new file mode 100644 index 0000000000000..8b49ec265f704 --- /dev/null +++ b/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.json @@ -0,0 +1,14 @@ +{ + "scenario": "nested declare", + "projectRoot": "tests/cases/projects/NestedDeclare", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt new file mode 100644 index 0000000000000..41a6db7bf0fda --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt @@ -0,0 +1 @@ +test1.ts(2,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.json b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.json new file mode 100644 index 0000000000000..aa4aaa0bec76e --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.json @@ -0,0 +1,12 @@ +{ + "scenario": "nested local module - simple case", + "projectRoot": "tests/cases/projects/NestedLocalModule-SimpleCase", + "inputFiles": [ + "test1.ts" + ], + "resolvedInputFiles": [ + "test1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt new file mode 100644 index 0000000000000..41a6db7bf0fda --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt @@ -0,0 +1 @@ +test1.ts(2,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.json b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.json new file mode 100644 index 0000000000000..aa4aaa0bec76e --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.json @@ -0,0 +1,12 @@ +{ + "scenario": "nested local module - simple case", + "projectRoot": "tests/cases/projects/NestedLocalModule-SimpleCase", + "inputFiles": [ + "test1.ts" + ], + "resolvedInputFiles": [ + "test1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt new file mode 100644 index 0000000000000..872145ccbc3d1 --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -0,0 +1 @@ +test1.ts(3,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.json b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.json new file mode 100644 index 0000000000000..c5cf2740c0745 --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.json @@ -0,0 +1,12 @@ +{ + "scenario": "nested local module - with recursive typecheck", + "projectRoot": "tests/cases/projects/NestedLocalModule-WithRecursiveTypecheck", + "inputFiles": [ + "test1.ts" + ], + "resolvedInputFiles": [ + "test1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt new file mode 100644 index 0000000000000..872145ccbc3d1 --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -0,0 +1 @@ +test1.ts(3,2): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.json b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.json new file mode 100644 index 0000000000000..c5cf2740c0745 --- /dev/null +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.json @@ -0,0 +1,12 @@ +{ + "scenario": "nested local module - with recursive typecheck", + "projectRoot": "tests/cases/projects/NestedLocalModule-WithRecursiveTypecheck", + "inputFiles": [ + "test1.ts" + ], + "resolvedInputFiles": [ + "test1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.json b/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.json new file mode 100644 index 0000000000000..2f8b981ff4de9 --- /dev/null +++ b/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.json @@ -0,0 +1,18 @@ +{ + "scenario": "nested reference tags", + "projectRoot": "tests/cases/projects/reference-1", + "inputFiles": [ + "main.ts" + ], + "resolvedInputFiles": [ + "main.ts", + "lib/classA.ts", + "lib/classB.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "lib/classA.js", + "lib/classB.js", + "main.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.json b/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.json new file mode 100644 index 0000000000000..2f8b981ff4de9 --- /dev/null +++ b/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.json @@ -0,0 +1,18 @@ +{ + "scenario": "nested reference tags", + "projectRoot": "tests/cases/projects/reference-1", + "inputFiles": [ + "main.ts" + ], + "resolvedInputFiles": [ + "main.ts", + "lib/classA.ts", + "lib/classB.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "lib/classA.js", + "lib/classB.js", + "main.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt new file mode 100644 index 0000000000000..658a479621cee --- /dev/null +++ b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.errors.txt @@ -0,0 +1,9 @@ +Cannot find global type 'Array'. +Cannot find global type 'Boolean'. +Cannot find global type 'Function'. +Cannot find global type 'IArguments'. +Cannot find global type 'Number'. +Cannot find global type 'Object'. +Cannot find global type 'RegExp'. +Cannot find global type 'String'. +test.ts(3,8): Cannot find name 'Array'. diff --git a/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.json b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.json new file mode 100644 index 0000000000000..a7e680a4b52e7 --- /dev/null +++ b/tests/baselines/reference/project/noDefaultLib/amd/noDefaultLib.json @@ -0,0 +1,13 @@ +{ + "scenario": "No-default-lib", + "projectRoot": "tests/cases/projects/No-default-lib", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts" + ], + "emittedFiles": [ + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt new file mode 100644 index 0000000000000..658a479621cee --- /dev/null +++ b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.errors.txt @@ -0,0 +1,9 @@ +Cannot find global type 'Array'. +Cannot find global type 'Boolean'. +Cannot find global type 'Function'. +Cannot find global type 'IArguments'. +Cannot find global type 'Number'. +Cannot find global type 'Object'. +Cannot find global type 'RegExp'. +Cannot find global type 'String'. +test.ts(3,8): Cannot find name 'Array'. diff --git a/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.json b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.json new file mode 100644 index 0000000000000..a7e680a4b52e7 --- /dev/null +++ b/tests/baselines/reference/project/noDefaultLib/node/noDefaultLib.json @@ -0,0 +1,13 @@ +{ + "scenario": "No-default-lib", + "projectRoot": "tests/cases/projects/No-default-lib", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts" + ], + "emittedFiles": [ + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nonRelative/amd/consume.js b/tests/baselines/reference/project/nonRelative/amd/consume.js new file mode 100644 index 0000000000000..c10bad1802df2 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/consume.js @@ -0,0 +1,8 @@ +define(["require", "exports", "decl", "lib/foo/a", "lib/bar/a"], function (require, exports, mod, x, y) { + x.hello(); + y.hello(); + var str = mod.call(); + if (str !== "success") { + fail(); + } +}); diff --git a/tests/baselines/reference/project/nonRelative/amd/decl.js b/tests/baselines/reference/project/nonRelative/amd/decl.js new file mode 100644 index 0000000000000..03d7ba46e190f --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/decl.js @@ -0,0 +1,6 @@ +define(["require", "exports"], function (require, exports) { + function call() { + return "success"; + } + exports.call = call; +}); diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js b/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js new file mode 100644 index 0000000000000..5351258111e15 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/lib/bar/a.js @@ -0,0 +1,5 @@ +define(["require", "exports"], function (require, exports) { + function hello() { + } + exports.hello = hello; +}); diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js b/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js new file mode 100644 index 0000000000000..5351258111e15 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/lib/foo/a.js @@ -0,0 +1,5 @@ +define(["require", "exports"], function (require, exports) { + function hello() { + } + exports.hello = hello; +}); diff --git a/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js b/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js new file mode 100644 index 0000000000000..5351258111e15 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/lib/foo/b.js @@ -0,0 +1,5 @@ +define(["require", "exports"], function (require, exports) { + function hello() { + } + exports.hello = hello; +}); diff --git a/tests/baselines/reference/project/nonRelative/amd/nonRelative.json b/tests/baselines/reference/project/nonRelative/amd/nonRelative.json new file mode 100644 index 0000000000000..aea90910be560 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/amd/nonRelative.json @@ -0,0 +1,23 @@ +{ + "scenario": "non-relative", + "projectRoot": "tests/cases/projects/non-relative", + "inputFiles": [ + "consume.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib/foo/a.ts", + "lib/foo/b.ts", + "lib/bar/a.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "lib/foo/b.js", + "lib/foo/a.js", + "lib/bar/a.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/nonRelative/node/consume.js b/tests/baselines/reference/project/nonRelative/node/consume.js new file mode 100644 index 0000000000000..7d1bc0ecace5d --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/consume.js @@ -0,0 +1,9 @@ +var mod = require("decl"); +var x = require("lib/foo/a"); +var y = require("lib/bar/a"); +x.hello(); +y.hello(); +var str = mod.call(); +if (str !== "success") { + fail(); +} diff --git a/tests/baselines/reference/project/nonRelative/node/decl.js b/tests/baselines/reference/project/nonRelative/node/decl.js new file mode 100644 index 0000000000000..a8dc375b1c703 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/decl.js @@ -0,0 +1,4 @@ +function call() { + return "success"; +} +exports.call = call; diff --git a/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js b/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js new file mode 100644 index 0000000000000..3bc8930ed5300 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/lib/bar/a.js @@ -0,0 +1,3 @@ +function hello() { +} +exports.hello = hello; diff --git a/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js b/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js new file mode 100644 index 0000000000000..3bc8930ed5300 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/lib/foo/a.js @@ -0,0 +1,3 @@ +function hello() { +} +exports.hello = hello; diff --git a/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js b/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js new file mode 100644 index 0000000000000..3bc8930ed5300 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/lib/foo/b.js @@ -0,0 +1,3 @@ +function hello() { +} +exports.hello = hello; diff --git a/tests/baselines/reference/project/nonRelative/node/nonRelative.json b/tests/baselines/reference/project/nonRelative/node/nonRelative.json new file mode 100644 index 0000000000000..aea90910be560 --- /dev/null +++ b/tests/baselines/reference/project/nonRelative/node/nonRelative.json @@ -0,0 +1,23 @@ +{ + "scenario": "non-relative", + "projectRoot": "tests/cases/projects/non-relative", + "inputFiles": [ + "consume.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib/foo/a.ts", + "lib/foo/b.ts", + "lib/bar/a.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "lib/foo/b.js", + "lib/foo/a.js", + "lib/bar/a.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/outMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/outMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b817d2281d1e2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/outMixedSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js", + "ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/outMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/outMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b817d2281d1e2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/outMixedSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js", + "ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..bc58b3339049a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..bc58b3339049a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..fc1aebc2df189 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..fc1aebc2df189 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/outMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..704395bd09b9c --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..704395bd09b9c --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile0.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile1.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile1.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/diskFile1.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/outModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/outModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..372b84b2bf81e --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/outModuleMultifolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..f83ccabfd350e --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile0.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile1.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile1.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/diskFile1.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/outModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/outModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..372b84b2bf81e --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/outModuleMultifolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..d1c1b22a85b26 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,16 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..10dcd3db784b1 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..f83ccabfd350e --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..10dcd3db784b1 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..d1c1b22a85b26 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,16 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile0.js new file mode 100644 index 0000000000000..2c61fd1d935db --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile0.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile1.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/diskFile1.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..e536625c43cd6 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "outputdir_module_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..f83ccabfd350e --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js new file mode 100644 index 0000000000000..b7c7f5d81398a --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile0.js @@ -0,0 +1,12 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile1.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/diskFile1.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..e536625c43cd6 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/outModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "outputdir_module_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..d1c1b22a85b26 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,16 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/outModuleSimpleNoOutdir.json b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/outModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..44bdd308933a9 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/outModuleSimpleNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..b6c62f75f3c22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/outModuleSimpleNoOutdir.json b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/outModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..44bdd308933a9 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/outModuleSimpleNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..d016c5ff00a9f --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,14 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..8e5e21179ae35 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..b6c62f75f3c22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..8e5e21179ae35 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..d016c5ff00a9f --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,14 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..d6059283e950d --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..b6c62f75f3c22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..d6059283e950d --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/outModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..d016c5ff00a9f --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,14 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/outModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/outModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..cd7370bcf13f4 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/outModuleSubfolderNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ef183a5773cfc --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/outModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/outModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..cd7370bcf13f4 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/outModuleSubfolderNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..548a35e714c17 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,14 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..5c5da20e23fb3 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ef183a5773cfc --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..5c5da20e23fb3 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..548a35e714c17 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,14 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..ddb82ba580cd5 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..c2a6326846e86 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,14 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..ef183a5773cfc --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,15 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..ddb82ba580cd5 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/outModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_module_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..37f4ec486b23c --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,12 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..548a35e714c17 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,14 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js new file mode 100644 index 0000000000000..d9e010cbef7d8 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile0.js @@ -0,0 +1,10 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile1.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/diskFile1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/outMultifolderNoOutdir.json b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/outMultifolderNoOutdir.json new file mode 100644 index 0000000000000..a538cbb330625 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/outMultifolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/amd/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js new file mode 100644 index 0000000000000..d9e010cbef7d8 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile0.js @@ -0,0 +1,10 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile1.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/node/diskFile1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/outMultifolderNoOutdir.json b/tests/baselines/reference/project/outMultifolderNoOutdir/node/outMultifolderNoOutdir.json new file mode 100644 index 0000000000000..a538cbb330625 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/outMultifolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderNoOutdir/node/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..dd1afacb02fd6 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..d9e010cbef7d8 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,10 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..dd1afacb02fd6 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..d9e010cbef7d8 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,10 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..3b69cd525aee7 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,30 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..1031549074ddf --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/amd/outMultifolderSpecifyOutputFile.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..3b69cd525aee7 --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,30 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..1031549074ddf --- /dev/null +++ b/tests/baselines/reference/project/outMultifolderSpecifyOutputFile/node/outMultifolderSpecifyOutputFile.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/outSimpleNoOutdir.json b/tests/baselines/reference/project/outSimpleNoOutdir/amd/outSimpleNoOutdir.json new file mode 100644 index 0000000000000..4950859f404e3 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/outSimpleNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/amd/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/outSimpleNoOutdir.json b/tests/baselines/reference/project/outSimpleNoOutdir/node/outSimpleNoOutdir.json new file mode 100644 index 0000000000000..4950859f404e3 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/outSimpleNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js", + "m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleNoOutdir/node/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..01dd9a3578d29 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outSimpleSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..01dd9a3578d29 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outSimpleSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..d11bfbcf86045 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/amd/outSimpleSpecifyOutputFile.json @@ -0,0 +1,19 @@ +{ + "scenario": "outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..d11bfbcf86045 --- /dev/null +++ b/tests/baselines/reference/project/outSimpleSpecifyOutputFile/node/outSimpleSpecifyOutputFile.json @@ -0,0 +1,19 @@ +{ + "scenario": "outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/amd/outSingleFileNoOutdir.json b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/outSingleFileNoOutdir.json new file mode 100644 index 0000000000000..1ac2dcd1c8da8 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/outSingleFileNoOutdir.json @@ -0,0 +1,17 @@ +{ + "scenario": "outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/amd/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/node/outSingleFileNoOutdir.json b/tests/baselines/reference/project/outSingleFileNoOutdir/node/outSingleFileNoOutdir.json new file mode 100644 index 0000000000000..1ac2dcd1c8da8 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/node/outSingleFileNoOutdir.json @@ -0,0 +1,17 @@ +{ + "scenario": "outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileNoOutdir/node/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..10436ca502fb7 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,18 @@ +{ + "scenario": "outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..10436ca502fb7 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,18 @@ +{ + "scenario": "outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..0269362518738 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/amd/outSingleFileSpecifyOutputFile.json @@ -0,0 +1,18 @@ +{ + "scenario": "outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..0269362518738 --- /dev/null +++ b/tests/baselines/reference/project/outSingleFileSpecifyOutputFile/node/outSingleFileSpecifyOutputFile.json @@ -0,0 +1,18 @@ +{ + "scenario": "outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/outSubfolderNoOutdir.json b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/outSubfolderNoOutdir.json new file mode 100644 index 0000000000000..5dc96cfb1ce0f --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/outSubfolderNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/amd/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/outSubfolderNoOutdir.json b/tests/baselines/reference/project/outSubfolderNoOutdir/node/outSubfolderNoOutdir.json new file mode 100644 index 0000000000000..5dc96cfb1ce0f --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/outSubfolderNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js", + "ref/m1.d.ts", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderNoOutdir/node/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c827dc4a29135 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c827dc4a29135 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..2a78be9bc0793 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,10 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..ced5641081bc2 --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,10 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..c9dde6e9ec27e --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/amd/outSubfolderSpecifyOutputFile.json @@ -0,0 +1,19 @@ +{ + "scenario": "outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..c1e610b251e8d --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,20 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} diff --git a/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..c9dde6e9ec27e --- /dev/null +++ b/tests/baselines/reference/project/outSubfolderSpecifyOutputFile/node/outSubfolderSpecifyOutputFile.json @@ -0,0 +1,19 @@ +{ + "scenario": "outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt new file mode 100644 index 0000000000000..ff86b0ebeb22d --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -0,0 +1,2 @@ +testGlo.ts(2,5): Import declarations in an internal module cannot reference an external module. +testGlo.ts(21,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.json new file mode 100644 index 0000000000000..446a05ed7a736 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.json @@ -0,0 +1,13 @@ +{ + "scenario": "privacy Check on imported module - declarations inside module", + "projectRoot": "tests/cases/projects/privacyCheck-InsideModule", + "inputFiles": [ + "testGlo.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "testGlo.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt new file mode 100644 index 0000000000000..ff86b0ebeb22d --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -0,0 +1,2 @@ +testGlo.ts(2,5): Import declarations in an internal module cannot reference an external module. +testGlo.ts(21,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.json new file mode 100644 index 0000000000000..446a05ed7a736 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.json @@ -0,0 +1,13 @@ +{ + "scenario": "privacy Check on imported module - declarations inside module", + "projectRoot": "tests/cases/projects/privacyCheck-InsideModule", + "inputFiles": [ + "testGlo.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "testGlo.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt new file mode 100644 index 0000000000000..373aaa946e947 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -0,0 +1,2 @@ +test.ts(5,5): Import declarations in an internal module cannot reference an external module. +test.ts(24,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json new file mode 100644 index 0000000000000..a59350e4f3b83 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json @@ -0,0 +1,12 @@ +{ + "scenario": "privacy Check on imported module - declarations inside non exported module", + "projectRoot": "tests/cases/projects/privacyCheck-InsideModule", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt new file mode 100644 index 0000000000000..373aaa946e947 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -0,0 +1,2 @@ +test.ts(5,5): Import declarations in an internal module cannot reference an external module. +test.ts(24,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json new file mode 100644 index 0000000000000..a59350e4f3b83 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.json @@ -0,0 +1,12 @@ +{ + "scenario": "privacy Check on imported module - declarations inside non exported module", + "projectRoot": "tests/cases/projects/privacyCheck-InsideModule", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt new file mode 100644 index 0000000000000..5a5d142185553 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -0,0 +1,2 @@ +test.ts(2,5): Import declarations in an internal module cannot reference an external module. +test.ts(42,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.json new file mode 100644 index 0000000000000..6b445d2d38194 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.json @@ -0,0 +1,12 @@ +{ + "scenario": "privacy Check on imported module - import statement in parent module", + "projectRoot": "tests/cases/projects/privacyCheck-ImportInParent", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt new file mode 100644 index 0000000000000..5a5d142185553 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -0,0 +1,2 @@ +test.ts(2,5): Import declarations in an internal module cannot reference an external module. +test.ts(42,5): Import declarations in an internal module cannot reference an external module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.json new file mode 100644 index 0000000000000..6b445d2d38194 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.json @@ -0,0 +1,12 @@ +{ + "scenario": "privacy Check on imported module - import statement in parent module", + "projectRoot": "tests/cases/projects/privacyCheck-ImportInParent", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/amd/privacyCheckOnImportedModuleSimpleReference.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/amd/privacyCheckOnImportedModuleSimpleReference.json new file mode 100644 index 0000000000000..473025c416df4 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/amd/privacyCheckOnImportedModuleSimpleReference.json @@ -0,0 +1,18 @@ +{ + "scenario": "privacy Check on imported module - simple reference", + "projectRoot": "tests/cases/projects/privacyCheck-SimpleReference", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "mExported.ts", + "mNonExported.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "mExported.js", + "mNonExported.js", + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/node/privacyCheckOnImportedModuleSimpleReference.json b/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/node/privacyCheckOnImportedModuleSimpleReference.json new file mode 100644 index 0000000000000..473025c416df4 --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleSimpleReference/node/privacyCheckOnImportedModuleSimpleReference.json @@ -0,0 +1,18 @@ +{ + "scenario": "privacy Check on imported module - simple reference", + "projectRoot": "tests/cases/projects/privacyCheck-SimpleReference", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "mExported.ts", + "mNonExported.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "mExported.js", + "mNonExported.js", + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/amd/privacyCheckOnIndirectTypeFromTheExternalType.json b/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/amd/privacyCheckOnIndirectTypeFromTheExternalType.json new file mode 100644 index 0000000000000..cc52060ed50ab --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/amd/privacyCheckOnIndirectTypeFromTheExternalType.json @@ -0,0 +1,18 @@ +{ + "scenario": "privacy Check on indirect type from the external type", + "projectRoot": "tests/cases/projects/privacyCheck-IndirectReference", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "externalModule.ts", + "indirectExternalModule.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "indirectExternalModule.js", + "externalModule.js", + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/node/privacyCheckOnIndirectTypeFromTheExternalType.json b/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/node/privacyCheckOnIndirectTypeFromTheExternalType.json new file mode 100644 index 0000000000000..cc52060ed50ab --- /dev/null +++ b/tests/baselines/reference/project/privacyCheckOnIndirectTypeFromTheExternalType/node/privacyCheckOnIndirectTypeFromTheExternalType.json @@ -0,0 +1,18 @@ +{ + "scenario": "privacy Check on indirect type from the external type", + "projectRoot": "tests/cases/projects/privacyCheck-IndirectReference", + "inputFiles": [ + "test.ts" + ], + "resolvedInputFiles": [ + "test.ts", + "externalModule.ts", + "indirectExternalModule.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "indirectExternalModule.js", + "externalModule.js", + "test.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js new file mode 100644 index 0000000000000..1498ee9297da3 --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -0,0 +1,25 @@ +var _this = this; +(function () { return _this.window; }); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var m; +(function (m) { + var base = (function () { + function base() { + } + return base; + })(); + m.base = base; + var child = (function (_super) { + __extends(child, _super); + function child() { + _super.apply(this, arguments); + } + return child; + })(base); + m.child = child; +})(m || (m = {})); diff --git a/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.json b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.json new file mode 100644 index 0000000000000..f74f4d6681678 --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.json @@ -0,0 +1,18 @@ +{ + "scenario": "Prologue emit", + "projectRoot": "tests/cases/projects/PrologueEmit", + "inputFiles": [ + "globalThisCapture.ts", + "__extends.ts" + ], + "out": "out.js", + "baselineCheck": true, + "resolvedInputFiles": [ + "globalThisCapture.ts", + "__extends.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "out.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js new file mode 100644 index 0000000000000..1498ee9297da3 --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -0,0 +1,25 @@ +var _this = this; +(function () { return _this.window; }); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var m; +(function (m) { + var base = (function () { + function base() { + } + return base; + })(); + m.base = base; + var child = (function (_super) { + __extends(child, _super); + function child() { + _super.apply(this, arguments); + } + return child; + })(base); + m.child = child; +})(m || (m = {})); diff --git a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.json b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.json new file mode 100644 index 0000000000000..f74f4d6681678 --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.json @@ -0,0 +1,18 @@ +{ + "scenario": "Prologue emit", + "projectRoot": "tests/cases/projects/PrologueEmit", + "inputFiles": [ + "globalThisCapture.ts", + "__extends.ts" + ], + "out": "out.js", + "baselineCheck": true, + "resolvedInputFiles": [ + "globalThisCapture.ts", + "__extends.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "out.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js new file mode 100644 index 0000000000000..649db9a606d99 --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/li'b/class'A.js @@ -0,0 +1,11 @@ +var test; +(function (test) { + var ClassA = (function () { + function ClassA() { + } + ClassA.prototype.method = function () { + }; + return ClassA; + })(); + test.ClassA = ClassA; +})(test || (test = {})); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts new file mode 100644 index 0000000000000..1d9ec2138ba2d --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js new file mode 100644 index 0000000000000..317a2c57fe4bd --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -0,0 +1,13 @@ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ClassC = (function (_super) { + __extends(ClassC, _super); + function ClassC() { + _super.apply(this, arguments); + } + return ClassC; +})(test.ClassA); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.json b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.json new file mode 100644 index 0000000000000..333ef78ad74ac --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.json @@ -0,0 +1,20 @@ +{ + "scenario": "Quotes in file and directory names", + "projectRoot": "tests/cases/projects/Quote'InName", + "inputFiles": [ + "m'ain.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "m'ain.ts", + "li'b/class'A.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "li'b/class'A.js", + "li'b/class'A.d.ts", + "m'ain.js", + "m'ain.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js new file mode 100644 index 0000000000000..649db9a606d99 --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/li'b/class'A.js @@ -0,0 +1,11 @@ +var test; +(function (test) { + var ClassA = (function () { + function ClassA() { + } + ClassA.prototype.method = function () { + }; + return ClassA; + })(); + test.ClassA = ClassA; +})(test || (test = {})); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts new file mode 100644 index 0000000000000..1d9ec2138ba2d --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js new file mode 100644 index 0000000000000..317a2c57fe4bd --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -0,0 +1,13 @@ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ClassC = (function (_super) { + __extends(ClassC, _super); + function ClassC() { + _super.apply(this, arguments); + } + return ClassC; +})(test.ClassA); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.json b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.json new file mode 100644 index 0000000000000..333ef78ad74ac --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.json @@ -0,0 +1,20 @@ +{ + "scenario": "Quotes in file and directory names", + "projectRoot": "tests/cases/projects/Quote'InName", + "inputFiles": [ + "m'ain.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "m'ain.ts", + "li'b/class'A.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "li'b/class'A.js", + "li'b/class'A.d.ts", + "m'ain.js", + "m'ain.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobal/amd/relativeGlobal.json b/tests/baselines/reference/project/relativeGlobal/amd/relativeGlobal.json new file mode 100644 index 0000000000000..7a232d5246ece --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobal/amd/relativeGlobal.json @@ -0,0 +1,17 @@ +{ + "scenario": "relative - global", + "projectRoot": "tests/cases/projects/relative-global", + "inputFiles": [ + "consume.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobal/node/relativeGlobal.json b/tests/baselines/reference/project/relativeGlobal/node/relativeGlobal.json new file mode 100644 index 0000000000000..7a232d5246ece --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobal/node/relativeGlobal.json @@ -0,0 +1,17 @@ +{ + "scenario": "relative - global", + "projectRoot": "tests/cases/projects/relative-global", + "inputFiles": [ + "consume.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.json b/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.json new file mode 100644 index 0000000000000..b1b6f19b6c2e1 --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.json @@ -0,0 +1,15 @@ +{ + "scenario": "relative - global - ref", + "projectRoot": "tests/cases/projects/relative-global-ref", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "decl.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.json b/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.json new file mode 100644 index 0000000000000..b1b6f19b6c2e1 --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.json @@ -0,0 +1,15 @@ +{ + "scenario": "relative - global - ref", + "projectRoot": "tests/cases/projects/relative-global-ref", + "inputFiles": [ + "consume.ts" + ], + "resolvedInputFiles": [ + "consume.ts", + "decl.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNested/amd/relativeNested.json b/tests/baselines/reference/project/relativeNested/amd/relativeNested.json new file mode 100644 index 0000000000000..c1cf91e50608d --- /dev/null +++ b/tests/baselines/reference/project/relativeNested/amd/relativeNested.json @@ -0,0 +1,19 @@ +{ + "scenario": "relative - nested", + "projectRoot": "tests/cases/projects/relative-nested", + "inputFiles": [ + "app.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "app.ts", + "main/consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "main/consume.js", + "app.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNested/node/relativeNested.json b/tests/baselines/reference/project/relativeNested/node/relativeNested.json new file mode 100644 index 0000000000000..c1cf91e50608d --- /dev/null +++ b/tests/baselines/reference/project/relativeNested/node/relativeNested.json @@ -0,0 +1,19 @@ +{ + "scenario": "relative - nested", + "projectRoot": "tests/cases/projects/relative-nested", + "inputFiles": [ + "app.ts" + ], + "runTest": true, + "resolvedInputFiles": [ + "app.ts", + "main/consume.ts", + "decl.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "decl.js", + "main/consume.js", + "app.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.json b/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.json new file mode 100644 index 0000000000000..8dfaf3a30928c --- /dev/null +++ b/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.json @@ -0,0 +1,15 @@ +{ + "scenario": "relative - nested - ref", + "projectRoot": "tests/cases/projects/relative-nested-ref", + "inputFiles": [ + "main/consume.ts" + ], + "resolvedInputFiles": [ + "main/consume.ts", + "decl.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "main/consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.json b/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.json new file mode 100644 index 0000000000000..8dfaf3a30928c --- /dev/null +++ b/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.json @@ -0,0 +1,15 @@ +{ + "scenario": "relative - nested - ref", + "projectRoot": "tests/cases/projects/relative-nested-ref", + "inputFiles": [ + "main/consume.ts" + ], + "resolvedInputFiles": [ + "main/consume.ts", + "decl.d.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "main/consume.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativePaths/amd/relativePaths.json b/tests/baselines/reference/project/relativePaths/amd/relativePaths.json new file mode 100644 index 0000000000000..a4036a2163d3c --- /dev/null +++ b/tests/baselines/reference/project/relativePaths/amd/relativePaths.json @@ -0,0 +1,18 @@ +{ + "scenario": "relative paths", + "projectRoot": "tests/cases/projects/RelativePaths", + "inputFiles": [ + "app.ts" + ], + "resolvedInputFiles": [ + "app.ts", + "A/a.ts", + "A/b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "A/b.js", + "A/a.js", + "app.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/relativePaths/node/relativePaths.json b/tests/baselines/reference/project/relativePaths/node/relativePaths.json new file mode 100644 index 0000000000000..a4036a2163d3c --- /dev/null +++ b/tests/baselines/reference/project/relativePaths/node/relativePaths.json @@ -0,0 +1,18 @@ +{ + "scenario": "relative paths", + "projectRoot": "tests/cases/projects/RelativePaths", + "inputFiles": [ + "app.ts" + ], + "resolvedInputFiles": [ + "app.ts", + "A/a.ts", + "A/b.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "A/b.js", + "A/a.js", + "app.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c3cc0d4253f91 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a522f38d9917c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..a987e68b2bade --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..0a485a949773c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..9c3e31a1004cc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..c3cc0d4253f91 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..62ca624e4f3e7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..a987e68b2bade --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..768c77b27f864 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..9c3e31a1004cc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c3cc0d4253f91 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..a522f38d9917c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9c3e31a1004cc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..19af8ccca671b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e2eb6dd47dc04 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c3cc0d4253f91 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..62ca624e4f3e7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9c3e31a1004cc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..19af8ccca671b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..349524dce45ed --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..198353a83a72d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..a522f38d9917c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d4a467aff20ce --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..53ad6a00f3d57 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..198353a83a72d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..62ca624e4f3e7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d4a467aff20ce --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..9e35d35593fa5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..a46c6a164dbac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..a522f38d9917c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..996a50a99f393 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e6454c5c86775 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..a46c6a164dbac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..62ca624e4f3e7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..996a50a99f393 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_mixed_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..baaf24f3f05a6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..3ce4a0ee163af --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..9b1685c84f242 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..0ff48f4e065f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..643298a22259e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..5ee511671dd34 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..39c18fb8d239b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..b95495e9dd11c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..0ff48f4e065f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8d010aa113da0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..e0c8782d730ea --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..9b1685c84f242 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..5ee511671dd34 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..3ce4a0ee163af --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..559c5886be2d8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b7c2f5b766905 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..b95495e9dd11c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..e0c8782d730ea --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..39c18fb8d239b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..559c5886be2d8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..acb0bd34971e5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..e53f2e0a75582 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..3ce4a0ee163af --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..9b1685c84f242 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..825fa0246a460 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..f7eeab0a5fdec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..5ee511671dd34 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..e53f2e0a75582 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..39c18fb8d239b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..b95495e9dd11c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..825fa0246a460 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,33 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..e13d18582ca61 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..e0c8782d730ea --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..29b187f991d6c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..a364062ade478 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..74eb9e3aa2419 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..0066f881f763f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..519ccb90df5db --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..a364062ade478 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..909e92e660601 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..1ec1848e231d2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..29b187f991d6c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..0066f881f763f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ae5126b66e24d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..03d8b18512e6f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..519ccb90df5db --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..1ec1848e231d2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ae5126b66e24d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..75c5572d0046a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..42e5a82e74be6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..29b187f991d6c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..0901591ee7134 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..3f6102f1bb45b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..0066f881f763f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..42e5a82e74be6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..519ccb90df5db --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..0901591ee7134 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d4deb812f0b6a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..1ec1848e231d2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c0a2696f7ec6e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..01c4b70cebdf4 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..7157945599df6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..49e86ea95313a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..a4994dffea109 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..01c4b70cebdf4 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5912d5319af0e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..5a0bc4835486b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..c0a2696f7ec6e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..49e86ea95313a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..84000af31b454 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..396d03885e149 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..a4994dffea109 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..5a0bc4835486b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..84000af31b454 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..09274e0a16c65 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..279042a1a0ff8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..c0a2696f7ec6e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f568adfaacf4a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2394ca431ad45 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..49e86ea95313a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..279042a1a0ff8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..a4994dffea109 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..f568adfaacf4a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_module_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..e6f1a6e5f9c39 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..5a0bc4835486b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..bdf6f4c4907ec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..f9b0b3e8ecb90 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..4f0f4e7e3e5ee --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..bf7a27f7d34bc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..d6c76d041af63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..bdf6f4c4907ec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..f9b0b3e8ecb90 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..4f0f4e7e3e5ee --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..bf7a27f7d34bc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..d6c76d041af63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..f9b0b3e8ecb90 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..d6c76d041af63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..bdf6f4c4907ec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..e22d59562c880 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..06c159cb70b09 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..f9b0b3e8ecb90 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..d6c76d041af63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..bdf6f4c4907ec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..e22d59562c880 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,30 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..06c159cb70b09 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c6cc8a00c8330 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d6823e0eba800 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..364db7cb2e0b6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c6cc8a00c8330 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d6823e0eba800 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_multifolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..364db7cb2e0b6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..2f3480ff8dfe8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..2d211a7180c06 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1c189d89138fc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..85db2988a68f7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..2f3480ff8dfe8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..2d211a7180c06 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1c189d89138fc --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..85db2988a68f7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..2f3480ff8dfe8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..85db2988a68f7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4a5d8436f0104 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3b67392adac0c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..2f3480ff8dfe8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..85db2988a68f7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4a5d8436f0104 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3b67392adac0c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..7be2c0252a1b7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..fd9f5e5446cfe --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..43f969ce6b00a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..7be2c0252a1b7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..fd9f5e5446cfe --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_simple/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..43f969ce6b00a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_simple/src/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..3d063f6527231 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5e508ff8a7841 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..3d063f6527231 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5e508ff8a7841 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..95a16bbc6f30e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..73fd44c82b9a9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..95a16bbc6f30e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..73fd44c82b9a9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..d0c60f2d1abe0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..5fb2ab686c7a8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..e75ae6e92caff --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..d0c60f2d1abe0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_singleFile/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..5fb2ab686c7a8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..cfd4530338c9e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b9982d553900c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..98e3f08068ca3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..f9d4bfb3fff7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..cfd4530338c9e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b9982d553900c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..98e3f08068ca3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..f9d4bfb3fff7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..cfd4530338c9e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f9d4bfb3fff7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..03814b982dbd6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..ac65eb2053dcb --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..cfd4530338c9e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f9d4bfb3fff7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..03814b982dbd6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..ac65eb2053dcb --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..935cf031db8b0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4563bdc2fb341 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6c3de002a42ad --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..935cf031db8b0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4563bdc2fb341 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-AbsolutePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "tests/cases/projects/outputdir_subfolder/src", + "resolveSourceRoot": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6c3de002a42ad --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..0b307d7a3f3a3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..7ed2fefc624c5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..9722f1f1bd56d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..2086277e2fff9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..f5995365dd1ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..7ed2fefc624c5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..7970c4c25ce82 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..2086277e2fff9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..0b307d7a3f3a3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..2086277e2fff9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..0b841e3e450c2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..f766728319dd9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..f5995365dd1ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..2086277e2fff9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..0b841e3e450c2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..ae8f031a373f6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..9e3baf2e49d05 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..0b307d7a3f3a3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..889d00b36ca52 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..1418aef8ce4a1 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..9e3baf2e49d05 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..f5995365dd1ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..889d00b36ca52 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..cf91d197a4783 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..b4f8caea0814d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..0b307d7a3f3a3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..e26e9887a57e3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c5438216f6434 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..b4f8caea0814d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..f5995365dd1ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..e26e9887a57e3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..52848595e943b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..223d33df45e3d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c58e7d101c3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..460728798743e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..06558319aaddd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..706cb7efc9d7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..771da5c5a904c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..b332468413fce --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..460728798743e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e87343210a7c6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..34d8334c90e06 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..3c58e7d101c3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..706cb7efc9d7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..223d33df45e3d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4637b89f1c0ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d523e5cd5b9e0 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..b332468413fce --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..34d8334c90e06 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..771da5c5a904c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4637b89f1c0ab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..4edec10d016c6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..223d33df45e3d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c58e7d101c3f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..b2a57c0e3162d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..c17d9555be6b6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..706cb7efc9d7e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..771da5c5a904c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..b332468413fce --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..b2a57c0e3162d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..e60683226b727 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..34d8334c90e06 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..e4922cbc45054 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..233e03c02adab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..02b225cc851fa --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..439e497e1e646 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..d817acec1bc94 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..233e03c02adab --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8da4686938a15 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..da13a48763062 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..e4922cbc45054 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..439e497e1e646 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3fabf096150d4 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7bc5c6fc31af9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..d817acec1bc94 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..da13a48763062 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3fabf096150d4 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..8ab8c0a604164 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..e4922cbc45054 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..c867f08a27b8f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..03a8fc274e0f3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..439e497e1e646 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..d817acec1bc94 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..c867f08a27b8f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..79fd07b3d6776 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..da13a48763062 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dd0d4674a3837 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..841f8e17deb80 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1f8be506dddec --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..2b2873013f162 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..2b502d41a8f28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..841f8e17deb80 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..9be420cb4f56a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..5f288a1eaacb6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dd0d4674a3837 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..2b2873013f162 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..83035951973bf --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c85d2e8477134 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..2b502d41a8f28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..5f288a1eaacb6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..83035951973bf --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..08d38875be196 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dd0d4674a3837 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..7336b1493f355 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d1a697bc810c4 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..2b2873013f162 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..512eba0e11a92 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..2b502d41a8f28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..7336b1493f355 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..4597d82ebfbd2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..5f288a1eaacb6 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..5a8c5e83fb175 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..31e868764cc65 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..41314d25efe1d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..d8a65f04e88b7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..294e92449a8ac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..5a8c5e83fb175 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..31e868764cc65 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json new file mode 100644 index 0000000000000..41314d25efe1d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..d8a65f04e88b7 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..294e92449a8ac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..31e868764cc65 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..294e92449a8ac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..5a8c5e83fb175 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..56e89b292b3bb --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..86e5ca70fe1b3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..31e868764cc65 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..294e92449a8ac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..5a8c5e83fb175 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..56e89b292b3bb --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..86e5ca70fe1b3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..3cabd208b3f41 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4251bd655c5cf --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..165c28d347cac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..3cabd208b3f41 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4251bd655c5cf --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..165c28d347cac --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..4b5198b3f5063 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..fc56bd98ee5f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e5bcbb33d6c03 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..4b5198b3f5063 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json new file mode 100644 index 0000000000000..fc56bd98ee5f8 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e5bcbb33d6c03 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..4b5198b3f5063 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..a10f853c3156d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..213cbc2cdd61e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..4b5198b3f5063 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..a10f853c3156d --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..213cbc2cdd61e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..46c6976ba9b85 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..270b56acab513 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..643aab720d27a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..46c6976ba9b85 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..270b56acab513 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..643aab720d27a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..828e649209465 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..2019663bd1e2e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json new file mode 100644 index 0000000000000..828e649209465 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..2019663bd1e2e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..5df4278d9d7f9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e9a275d31eeed --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..5df4278d9d7f9 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e9a275d31eeed --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..9869ad50de564 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..536d103e9d8ef --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..3b572c088f678 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..9869ad50de564 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..536d103e9d8ef --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..ffed58e93e12b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..f83a167d8c032 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json new file mode 100644 index 0000000000000..ffed58e93e12b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..f83a167d8c032 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4f273495fc1ee --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a4ffa70476801 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..51d14705f9c5f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..d503eef097b50 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4f273495fc1ee --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a4ffa70476801 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: ../src/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..ffb6245b3a6e2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d231d7bd8d45f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..fdfa1fa494d8c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..ffb6245b3a6e2 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..d231d7bd8d45f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-RelativePath]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "../src", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..fdfa1fa494d8c --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: ../src/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..9fc5aa1bcb138 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.errors.txt @@ -0,0 +1 @@ +Option sourceRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.json b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..427c074ca2661 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/amd/sourceRootWithNoSourceMapOption.json @@ -0,0 +1,14 @@ +{ + "scenario": "--sourceroot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceRoot": "../src", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.errors.txt b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.errors.txt new file mode 100644 index 0000000000000..9fc5aa1bcb138 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.errors.txt @@ -0,0 +1 @@ +Option sourceRoot cannot be specified without specifying sourcemap option. diff --git a/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.json b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.json new file mode 100644 index 0000000000000..427c074ca2661 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootWithNoSourceMapOption/node/sourceRootWithNoSourceMapOption.json @@ -0,0 +1,14 @@ +{ + "scenario": "--sourceroot is specified without specifying --sourcemap", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceRoot": "../src", + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..85a8232bd2824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b7f3a98e32478 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..ca24c56dc4e43 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..a174f13706964 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..65edb170af635 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..b7f3a98e32478 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..42f05603bb9b4 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..a174f13706964 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..02e26dc64434b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2dd919e2e645b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7d2080d78d6ee --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..dc602487a6872 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4a1c9d9421220 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..2dd919e2e645b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b2a63fadf4dc9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:../../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..cdef85d419d08 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..85a8232bd2824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..6b15ed5807824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..1ec1233c2474f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..cdef85d419d08 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..65edb170af635 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..6b15ed5807824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..b772fe34981cd --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..f5684dd19d49f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..02e26dc64434b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..4c044f4b10cb1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap] outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e12b5f5f478ce --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../../ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..f5684dd19d49f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..dc602487a6872 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..4c044f4b10cb1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap] outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..67b48947f4d50 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:../../../ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..85a8232bd2824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..4a10056ed6318 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b0bd2c62d2ca8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..acd0ceb63b8a6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..65edb170af635 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..4a10056ed6318 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..8654bc314a432 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..4f72b9ce65c4e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..cd70f70d5f846 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..816e60641caaa --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..73bffe89c3cff --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3f29686a3ac42 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..bbb66ad46396b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..67a333ddeaec8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..2ca22f610223e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..559ad5c3def2f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3f29686a3ac42 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..ce763f05c3666 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:../../../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../../outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:../../../../outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:../../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..85a8232bd2824 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..567b7a1e78674 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,31 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..7817684a64090 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..acd0ceb63b8a6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..65edb170af635 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..567b7a1e78674 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,31 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..75124d203a987 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..4f72b9ce65c4e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..bd688f16eb676 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..fef556f0ecf38 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..c996a776e0694 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..bd688f16eb676 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..91f071d878344 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..74e129bdef65c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..59a66655c1eb8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..df91d86d73c0e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ec8c618947e2b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..9093c5dbbb53e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../../m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..5e71320d77b36 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..0843e68f0a059 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..ec8c618947e2b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..665b813a7e463 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../../m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..9982ec933605d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6ec11f61b5568 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..c996a776e0694 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..9982ec933605d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..363b01567fab8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..74e129bdef65c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..a04d23e9d2df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..36df051e9c046 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..675e334917978 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..a04d23e9d2df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..81f0dc2577f34 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..44e7dccedd2af --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..2de14ea458352 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..67f8e2d57c50a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c987c06717535 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..e63e012df3bc9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..d01d6f28db20b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..eb9f8205703b8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c987c06717535 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..74b8b4eb99fc4 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3c388273ff445 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..c765d8a704d1f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..fc96410478039 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..675e334917978 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..c1e0281a2ab2d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..6ed9e2e6323fe --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..c765d8a704d1f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..de6475b368d53 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..44e7dccedd2af --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..2ac26aa164845 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.json new file mode 100644 index 0000000000000..1b32429f5b5c5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..3c42146ae7bc1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..a174f13706964 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..2ac26aa164845 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.json new file mode 100644 index 0000000000000..1b32429f5b5c5 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..3c42146ae7bc1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..a174f13706964 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..f06d0fae1d2a7 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..60147d9ff7e1d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..3563010e709fa --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fea0549613f6e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..19f746a59517f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..f06d0fae1d2a7 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..60147d9ff7e1d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..3563010e709fa --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..fea0549613f6e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..19f746a59517f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:../../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: +sources: ../../../../outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:../../../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:../../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..b48597f838f02 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..67b351dbf5c99 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..3e43e84950430 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..b48597f838f02 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..67b351dbf5c99 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..3e43e84950430 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../../outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.json b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.json new file mode 100644 index 0000000000000..0d7ae28a899b8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1994743df4972 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..c6b6358f313fc --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.json b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.json new file mode 100644 index 0000000000000..0d7ae28a899b8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..1994743df4972 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..c6b6358f313fc --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..973e11b0a2b53 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..22e4e6ca87b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c6ab0f21da28a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7dbdb509c7c9b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..973e11b0a2b53 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..22e4e6ca87b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..c6ab0f21da28a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..7dbdb509c7c9b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:../../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..908a7800f1491 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..3bd0b02dac365 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d10c6fdd37265 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..908a7800f1491 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..3bd0b02dac365 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d10c6fdd37265 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.json new file mode 100644 index 0000000000000..611577b136666 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.json @@ -0,0 +1,19 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e4128b4a255e7 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..21ba47bba4010 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.json new file mode 100644 index 0000000000000..611577b136666 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.json @@ -0,0 +1,19 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..e4128b4a255e7 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..21ba47bba4010 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..aab3485a17bad --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..97fd606dd6bef --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..5741483263bd4 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..aab3485a17bad --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..97fd606dd6bef --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..5741483263bd4 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..d032c047394b0 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d42a2d289025d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..4587ff981beb1 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..d032c047394b0 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d42a2d289025d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.json new file mode 100644 index 0000000000000..ca46c684c687a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b58bf1725ff3d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..c6b6358f313fc --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..5ee69838f4df6 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.json new file mode 100644 index 0000000000000..ca46c684c687a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b58bf1725ff3d --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..c6b6358f313fc --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..22e4e6ca87b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..556e78b25ae2f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c8b92ce3df1e0 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..6b66c0c4d64fb --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..22e4e6ca87b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..556e78b25ae2f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c8b92ce3df1e0 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: +sources: ../../../ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:../../../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:../../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..eeb60352d26b8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..ca64767987957 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6a5d7c68b5fb9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..eeb60352d26b8 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..ca64767987957 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..6a5d7c68b5fb9 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: ../ref/m1.ts,../test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:../test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..535efaaf338d1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..0c5b599dc4002 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json new file mode 100644 index 0000000000000..535efaaf338d1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..7f8fa6ce5f2ab --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3a4a85dfc1d4e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..2bcd95ed4303f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,518 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..df5e4d4429b3f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..9e57d9a732f30 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..3a4a85dfc1d4e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/ref/m2.js.map", + "outdir/simple/ref/m2.js", + "outdir/simple/ref/m2.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..aa1e7b139b1c8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,517 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..4a2c2ebb408c4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..38a554a4f16e9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..068a018f931ee --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..7bbc692f2439b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..4a2c2ebb408c4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..38a554a4f16e9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.json @@ -0,0 +1,26 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_mixed_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m2.js.map", + "ref/m2.js", + "ref/m2.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2707a1d81dd17 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..4bc829d46fafb --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..bde211ed7de39 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..de2bb0c94b8bf --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..fde3e4ce94ed5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts new file mode 100644 index 0000000000000..057e5839eb0a5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js new file mode 100644 index 0000000000000..d582d47f405c9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map new file mode 100644 index 0000000000000..4bc829d46fafb --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map new file mode 100644 index 0000000000000..827f4db2a5e9e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/outdir/outAndOutDirFolder/ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json new file mode 100644 index 0000000000000..de2bb0c94b8bf --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.json @@ -0,0 +1,27 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]:outputdir_mixed_subfolder: specify outputFile and outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_mixed_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/outAndOutDirFile.js", + "outDir": "outdir/outAndOutDirFolder", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/outAndOutDirFolder/ref/m2.js.map", + "outdir/outAndOutDirFolder/ref/m2.js", + "outdir/outAndOutDirFolder/ref/m2.d.ts", + "bin/outAndOutDirFile.js.map", + "bin/outAndOutDirFile.js", + "bin/outAndOutDirFile.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..b4151e5e7d456 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt @@ -0,0 +1,511 @@ +=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/outAndOutDirFolder/ref/m2.js +sourceFile:ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: outAndOutDirFile.js +mapUrl: outAndOutDirFile.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/outAndOutDirFile.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(3, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(3, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(3, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(3, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(3, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(4, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(4, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(4, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(4, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(4, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(6, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(6, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(6, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(6, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(6, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(4, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(6, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(8, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(8, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(8, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(8, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(8, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(8, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(8, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(9, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(9, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(9, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(10, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(10, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(10, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(10, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(10, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(11, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(11, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..ea1d9fb4616e8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..7263a0ae15502 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json new file mode 100644 index 0000000000000..ea1d9fb4616e8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..40b76f219395e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..da0435180facc --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..1b74fbd815dc6 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,652 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..da0435180facc --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_module_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_module_multifolder/ref/m1.js", + "outdir/simple/outputdir_module_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_module_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_module_multifolder_ref/m2.js", + "outdir/simple/outputdir_module_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_module_multifolder/test.js.map", + "outdir/simple/outputdir_module_multifolder/test.js", + "outdir/simple/outputdir_module_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..d76b985a334ee --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,683 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_module_multifolder/test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map new file mode 100644 index 0000000000000..a5693661025de --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js new file mode 100644 index 0000000000000..144ad24e2de69 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m2_a1 = 10; + var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; + })(); + exports.m2_c1 = m2_c1; + exports.m2_instance1 = new m2_c1(); + function m2_f1() { + return exports.m2_instance1; + } + exports.m2_f1 = m2_f1; +}); +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..7f3d01c0a85a1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..53b5c2cb21969 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..84bf18ede484b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,658 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m2_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m2_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_c1 = m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m2_instance1 = new m2_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m2_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m2_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>> exports.m2_f1 = m2_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^^ +4 > ^^ +1 >import +2 > m1 +3 > = require("ref/m1"); + > import +4 > m2 +1 >Emitted(1, 112) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 114) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 116) Source(2, 8) + SourceIndex(0) +4 >Emitted(1, 118) Source(2, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("../outputdir_module_multifolder_ref/m2"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(3, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(3, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(3, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(3, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(3, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(4, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(4, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(6, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(4, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(4, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(4, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(6, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(6, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(8, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(8, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(8, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(8, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(8, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(8, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(8, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(9, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(9, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(9, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(9, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(9, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(11, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(13, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(13, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(13, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(13, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(13, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(13, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(13, 26) + SourceIndex(0) +--- +>>> exports.a3 = m2.m2_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + >export var +2 > a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(15, 5) Source(14, 12) + SourceIndex(0) +2 >Emitted(15, 15) Source(14, 14) + SourceIndex(0) +3 >Emitted(15, 18) Source(14, 17) + SourceIndex(0) +4 >Emitted(15, 20) Source(14, 19) + SourceIndex(0) +5 >Emitted(15, 21) Source(14, 20) + SourceIndex(0) +6 >Emitted(15, 26) Source(14, 25) + SourceIndex(0) +7 >Emitted(15, 27) Source(14, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..5cca04a0f2567 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,17 @@ +define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; + exports.a3 = m2.m2_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..c74a9f9eede29 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"+GAAO,EAAE,EACF,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map new file mode 100644 index 0000000000000..5c7f2c8f36a02 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js new file mode 100644 index 0000000000000..ec0a73b5af84d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile1.js @@ -0,0 +1,13 @@ +exports.m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +exports.m2_c1 = m2_c1; +exports.m2_instance1 = new m2_c1(); +function m2_f1() { + return exports.m2_instance1; +} +exports.m2_f1 = m2_f1; +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts new file mode 100644 index 0000000000000..4026dbfa9a267 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/diskFile2.d.ts @@ -0,0 +1,6 @@ +export declare var m2_a1; +export declare class m2_c1 { + m2_c1_p1; +} +export declare var m2_instance1; +export declare function m2_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..695098ebde059 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..53b5c2cb21969 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.json @@ -0,0 +1,32 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_module_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_module_multifolder_ref/m2.js.map", + "../outputdir_module_multifolder_ref/m2.js", + "../outputdir_module_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..d3e0be31ceecb --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,689 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_module_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_module_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>exports.m2_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m2_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_c1 = m2_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m2_c1 +3 > +4 > m2_c1 { + > public m2_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m2_instance1 = new m2_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m2_instance1 +3 > = +4 > new +5 > m2_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m2_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>exports.m2_f1 = m2_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m2_f1 +3 > +4 > m2_f1() { + > return m2_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_module_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_module_multifolder/test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>var m2 = require("../outputdir_module_multifolder_ref/m2"); +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +1-> + > +2 >import +3 > m2 +4 > = require( +5 > "../outputdir_module_multifolder_ref/m2" +6 > ) +7 > ; +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 21) + SourceIndex(0) +5 >Emitted(2, 58) Source(2, 61) + SourceIndex(0) +6 >Emitted(2, 59) Source(2, 62) + SourceIndex(0) +7 >Emitted(2, 60) Source(2, 63) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(3, 1) Source(3, 12) + SourceIndex(0) +2 >Emitted(3, 11) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(3, 17) + SourceIndex(0) +4 >Emitted(3, 16) Source(3, 19) + SourceIndex(0) +5 >Emitted(3, 17) Source(3, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 14) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 14) + SourceIndex(0) name (c1) +3 >Emitted(5, 16) Source(4, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(6, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(9, 1) Source(4, 14) + SourceIndex(0) +2 >Emitted(9, 11) Source(4, 16) + SourceIndex(0) +3 >Emitted(9, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(9, 16) Source(6, 2) + SourceIndex(0) +5 >Emitted(9, 17) Source(6, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(10, 1) Source(8, 12) + SourceIndex(0) +2 >Emitted(10, 18) Source(8, 21) + SourceIndex(0) +3 >Emitted(10, 21) Source(8, 24) + SourceIndex(0) +4 >Emitted(10, 25) Source(8, 28) + SourceIndex(0) +5 >Emitted(10, 27) Source(8, 30) + SourceIndex(0) +6 >Emitted(10, 29) Source(8, 32) + SourceIndex(0) +7 >Emitted(10, 30) Source(8, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 10) Source(9, 17) + SourceIndex(0) +3 >Emitted(11, 12) Source(9, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(12, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(12, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(12, 29) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(12, 30) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(14, 1) Source(9, 17) + SourceIndex(0) +2 >Emitted(14, 11) Source(9, 19) + SourceIndex(0) +3 >Emitted(14, 14) Source(9, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(11, 2) + SourceIndex(0) +5 >Emitted(14, 17) Source(11, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(15, 1) Source(13, 12) + SourceIndex(0) +2 >Emitted(15, 11) Source(13, 14) + SourceIndex(0) +3 >Emitted(15, 14) Source(13, 17) + SourceIndex(0) +4 >Emitted(15, 16) Source(13, 19) + SourceIndex(0) +5 >Emitted(15, 17) Source(13, 20) + SourceIndex(0) +6 >Emitted(15, 22) Source(13, 25) + SourceIndex(0) +7 >Emitted(15, 23) Source(13, 26) + SourceIndex(0) +--- +>>>exports.a3 = m2.m2_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + >export var +2 >a3 +3 > = +4 > m2 +5 > . +6 > m2_c1 +7 > ; +1->Emitted(16, 1) Source(14, 12) + SourceIndex(0) +2 >Emitted(16, 11) Source(14, 14) + SourceIndex(0) +3 >Emitted(16, 14) Source(14, 17) + SourceIndex(0) +4 >Emitted(16, 16) Source(14, 19) + SourceIndex(0) +5 >Emitted(16, 17) Source(14, 20) + SourceIndex(0) +6 >Emitted(16, 22) Source(14, 25) + SourceIndex(0) +7 >Emitted(16, 23) Source(14, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..0c000fe2ed711 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,8 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; +export declare var a3; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..14c09e444a52a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js @@ -0,0 +1,17 @@ +var m1 = require("ref/m1"); +var m2 = require("../outputdir_module_multifolder_ref/m2"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +exports.a3 = m2.m2_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..5590b2868b305 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,wCAAwC,CAAC,CAAC;AACnD,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..84ed0deab9eb5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..2d8655bf2d960 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json new file mode 100644 index 0000000000000..84ed0deab9eb5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..a2cd8b55903a5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4ed540f416ffd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..23ddea644c2e7 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4ed540f416ffd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..3fb8deb4f106f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map new file mode 100644 index 0000000000000..28f51d9cf9f54 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..01d0695729849 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..9704c194922a9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 66) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 68) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..372f1052b89d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..761cf1c132172 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"iEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map new file mode 100644 index 0000000000000..8a497cdfecd6b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..01d0695729849 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..597cf7020bfb6 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 22) Source(1, 25) + SourceIndex(0) +6 >Emitted(1, 23) Source(1, 26) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 27) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..c2e7dfa443bfd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..f48ab4302b1bd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AACf,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..2dd5114c63e66 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..22a1042ad8452 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json new file mode 100644 index 0000000000000..2dd5114c63e66 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..f2fa457dc41ab --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..be3e6d5c38ca8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..120acb4a22c5c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,425 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..be3e6d5c38ca8 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..211d8310054a7 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,439 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js new file mode 100644 index 0000000000000..bbaba444ba29a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js @@ -0,0 +1,15 @@ +define(["require", "exports"], function (require, exports) { + exports.m1_a1 = 10; + var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; + })(); + exports.m1_c1 = m1_c1; + exports.m1_instance1 = new m1_c1(); + function m1_f1() { + return exports.m1_instance1; + } + exports.m1_f1 = m1_f1; +}); +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map new file mode 100644 index 0000000000000..3ce04bc4f21c1 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":";IAAW,aAAK,GAAG,EAAE,CAAC;IACtB,IAAa,KAAK;QAAlBA,SAAaA,KAAKA;QAElBC,CAACA;QAADD,YAACA;IAADA,CAACA,AAFD,IAEC;IAFY,aAAK,GAAL,KAEZ,CAAA;IAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC,SAAgB,KAAK;QACjBE,MAAMA,CAACA,oBAAYA,CAACA;IACxBA,CAACA;IAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4dda0858377f6 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..05c95c9165cde --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,431 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> exports.m1_a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 > m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +3 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 23) Source(1, 22) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 23) + SourceIndex(0) +--- +>>> var m1_c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 14) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(4, 9) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(4, 18) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(4, 23) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(5, 9) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(5, 10) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 21) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(7, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_c1 = m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(8, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(8, 18) Source(2, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(2, 14) + SourceIndex(0) +4 >Emitted(8, 26) Source(4, 2) + SourceIndex(0) +5 >Emitted(8, 27) Source(4, 2) + SourceIndex(0) +--- +>>> exports.m1_instance1 = new m1_c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 25) Source(6, 24) + SourceIndex(0) +3 >Emitted(9, 28) Source(6, 27) + SourceIndex(0) +4 >Emitted(9, 32) Source(6, 31) + SourceIndex(0) +5 >Emitted(9, 37) Source(6, 36) + SourceIndex(0) +6 >Emitted(9, 39) Source(6, 38) + SourceIndex(0) +7 >Emitted(9, 40) Source(6, 39) + SourceIndex(0) +--- +>>> function m1_f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > m1_f1 +1 >Emitted(10, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(7, 17) + SourceIndex(0) +3 >Emitted(10, 19) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(11, 9) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 15) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(11, 16) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(11, 36) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(11, 37) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(12, 6) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>> exports.m1_f1 = m1_f1; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(13, 5) Source(7, 17) + SourceIndex(0) +2 >Emitted(13, 18) Source(7, 22) + SourceIndex(0) +3 >Emitted(13, 21) Source(7, 17) + SourceIndex(0) +4 >Emitted(13, 26) Source(9, 2) + SourceIndex(0) +5 >Emitted(13, 27) Source(9, 2) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { +1 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +1 >import +2 > m1 +1 >Emitted(1, 70) Source(1, 8) + SourceIndex(0) +2 >Emitted(1, 72) Source(1, 10) + SourceIndex(0) +--- +>>> exports.a1 = 10; +1 >^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > = require("ref/m1"); + >export var +2 > a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 5) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 18) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 20) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 21) Source(2, 20) + SourceIndex(0) +--- +>>> var c1 = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 9) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 18) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 20) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 9) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 10) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 18) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 6) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 10) Source(5, 2) + SourceIndex(0) +--- +>>> exports.c1 = c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 > c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 5) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 15) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 20) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 21) Source(5, 2) + SourceIndex(0) +--- +>>> exports.instance1 = new c1(); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 > instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 5) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 22) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 25) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 29) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 31) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 33) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 34) Source(7, 33) + SourceIndex(0) +--- +>>> function f1() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > export function +3 > f1 +1 >Emitted(10, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 14) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 16) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 9) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 15) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 16) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 33) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 34) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 6) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>> exports.f1 = f1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 5) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 15) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 18) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 20) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 21) Source(10, 2) + SourceIndex(0) +--- +>>> exports.a2 = m1.m1_c1; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +1-> + > + >export var +2 > a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 5) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 15) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 18) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 20) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 21) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 26) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 27) Source(12, 26) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js new file mode 100644 index 0000000000000..6c8aeb3190bf9 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js @@ -0,0 +1,16 @@ +define(["require", "exports", "ref/m1"], function (require, exports, m1) { + exports.a1 = 10; + var c1 = (function () { + function c1() { + } + return c1; + })(); + exports.c1 = c1; + exports.instance1 = new c1(); + function f1() { + return exports.instance1; + } + exports.f1 = f1; + exports.a2 = m1.m1_c1; +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map new file mode 100644 index 0000000000000..4fd5727d384e5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"qEAAO,EAAE;IACE,UAAE,GAAG,EAAE,CAAC;IACnB,IAAa,EAAE;QAAfA,SAAaA,EAAEA;QAEfC,CAACA;QAADD,SAACA;IAADA,CAACA,AAFD,IAEC;IAFY,UAAE,GAAF,EAEZ,CAAA;IAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC,SAAgB,EAAE;QACdE,MAAMA,CAACA,iBAASA,CAACA;IACrBA,CAACA;IAFe,UAAE,GAAF,EAEf,CAAA;IAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..6f3fefb949813 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1 @@ +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d3e851981ec91 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts new file mode 100644 index 0000000000000..ee0941649ba22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.d.ts @@ -0,0 +1,6 @@ +export declare var m1_a1; +export declare class m1_c1 { + m1_c1_p1; +} +export declare var m1_instance1; +export declare function m1_f1(); diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js new file mode 100644 index 0000000000000..1b4470e2b3750 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js @@ -0,0 +1,13 @@ +exports.m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +exports.m1_c1 = m1_c1; +exports.m1_instance1 = new m1_c1(); +function m1_f1() { + return exports.m1_instance1; +} +exports.m1_f1 = m1_f1; +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map new file mode 100644 index 0000000000000..e4234c0ce9f0c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAW,aAAK,GAAG,EAAE,CAAC;AACtB,IAAa,KAAK;IAAlBA,SAAaA,KAAKA;IAElBC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAFY,aAAK,GAAL,KAEZ,CAAA;AAEU,oBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC,SAAgB,KAAK;IACjBE,MAAMA,CAACA,oBAAYA,CAACA;AACxBA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..4dda0858377f6 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_module_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_module_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts", + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..0e378aace846c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,445 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>exports.m1_a1 = 10; +1 > +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 >export var +2 >m1_a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(1, 1) Source(1, 12) + SourceIndex(0) +2 >Emitted(1, 14) Source(1, 17) + SourceIndex(0) +3 >Emitted(1, 17) Source(1, 20) + SourceIndex(0) +4 >Emitted(1, 19) Source(1, 22) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 23) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > export class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_c1 = m1_c1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >m1_c1 +3 > +4 > m1_c1 { + > public m1_c1_p1: number; + > } +5 > +1->Emitted(7, 1) Source(2, 14) + SourceIndex(0) +2 >Emitted(7, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(7, 17) Source(2, 14) + SourceIndex(0) +4 >Emitted(7, 22) Source(4, 2) + SourceIndex(0) +5 >Emitted(7, 23) Source(4, 2) + SourceIndex(0) +--- +>>>exports.m1_instance1 = new m1_c1(); +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >m1_instance1 +3 > = +4 > new +5 > m1_c1 +6 > () +7 > ; +1->Emitted(8, 1) Source(6, 12) + SourceIndex(0) +2 >Emitted(8, 21) Source(6, 24) + SourceIndex(0) +3 >Emitted(8, 24) Source(6, 27) + SourceIndex(0) +4 >Emitted(8, 28) Source(6, 31) + SourceIndex(0) +5 >Emitted(8, 33) Source(6, 36) + SourceIndex(0) +6 >Emitted(8, 35) Source(6, 38) + SourceIndex(0) +7 >Emitted(8, 36) Source(6, 39) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > m1_f1 +1 >Emitted(9, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(9, 10) Source(7, 17) + SourceIndex(0) +3 >Emitted(9, 15) Source(7, 22) + SourceIndex(0) +--- +>>> return exports.m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(10, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(10, 32) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(10, 33) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(11, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>exports.m1_f1 = m1_f1; +1-> +2 >^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >m1_f1 +3 > +4 > m1_f1() { + > return m1_instance1; + > } +5 > +1->Emitted(12, 1) Source(7, 17) + SourceIndex(0) +2 >Emitted(12, 14) Source(7, 22) + SourceIndex(0) +3 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +4 >Emitted(12, 22) Source(9, 2) + SourceIndex(0) +5 >Emitted(12, 23) Source(9, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var m1 = require("ref/m1"); +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^ +5 > ^^^^^^^^ +6 > ^ +7 > ^ +1 > +2 >import +3 > m1 +4 > = require( +5 > "ref/m1" +6 > ) +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 21) + SourceIndex(0) +5 >Emitted(1, 26) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 28) Source(1, 31) + SourceIndex(0) +--- +>>>exports.a1 = 10; +1 > +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > + >export var +2 >a1 +3 > = +4 > 10 +5 > ; +1 >Emitted(2, 1) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 11) Source(2, 14) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 17) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 19) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 20) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >export class +3 > c1 +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 7) Source(3, 16) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > export class +3 > c1 +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(4, 14) Source(3, 14) + SourceIndex(0) name (c1) +3 >Emitted(4, 16) Source(3, 16) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > export class c1 { + > public p1: number; + > } +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) +--- +>>>exports.c1 = c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^-> +1-> +2 >c1 +3 > +4 > c1 { + > public p1: number; + > } +5 > +1->Emitted(8, 1) Source(3, 14) + SourceIndex(0) +2 >Emitted(8, 11) Source(3, 16) + SourceIndex(0) +3 >Emitted(8, 14) Source(3, 14) + SourceIndex(0) +4 >Emitted(8, 16) Source(5, 2) + SourceIndex(0) +5 >Emitted(8, 17) Source(5, 2) + SourceIndex(0) +--- +>>>exports.instance1 = new c1(); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > + >export var +2 >instance1 +3 > = +4 > new +5 > c1 +6 > () +7 > ; +1->Emitted(9, 1) Source(7, 12) + SourceIndex(0) +2 >Emitted(9, 18) Source(7, 21) + SourceIndex(0) +3 >Emitted(9, 21) Source(7, 24) + SourceIndex(0) +4 >Emitted(9, 25) Source(7, 28) + SourceIndex(0) +5 >Emitted(9, 27) Source(7, 30) + SourceIndex(0) +6 >Emitted(9, 29) Source(7, 32) + SourceIndex(0) +7 >Emitted(9, 30) Source(7, 33) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >export function +3 > f1 +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 10) Source(8, 17) + SourceIndex(0) +3 >Emitted(10, 12) Source(8, 19) + SourceIndex(0) +--- +>>> return exports.instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(11, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(11, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(11, 29) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(11, 30) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(12, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>exports.f1 = f1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 >f1 +3 > +4 > f1() { + > return instance1; + > } +5 > +1->Emitted(13, 1) Source(8, 17) + SourceIndex(0) +2 >Emitted(13, 11) Source(8, 19) + SourceIndex(0) +3 >Emitted(13, 14) Source(8, 17) + SourceIndex(0) +4 >Emitted(13, 16) Source(10, 2) + SourceIndex(0) +5 >Emitted(13, 17) Source(10, 2) + SourceIndex(0) +--- +>>>exports.a2 = m1.m1_c1; +1-> +2 >^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^-> +1-> + > + >export var +2 >a2 +3 > = +4 > m1 +5 > . +6 > m1_c1 +7 > ; +1->Emitted(14, 1) Source(12, 12) + SourceIndex(0) +2 >Emitted(14, 11) Source(12, 14) + SourceIndex(0) +3 >Emitted(14, 14) Source(12, 17) + SourceIndex(0) +4 >Emitted(14, 16) Source(12, 19) + SourceIndex(0) +5 >Emitted(14, 17) Source(12, 20) + SourceIndex(0) +6 >Emitted(14, 22) Source(12, 25) + SourceIndex(0) +7 >Emitted(14, 23) Source(12, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: +=================================================================== +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts new file mode 100644 index 0000000000000..395a2936b5b28 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.d.ts @@ -0,0 +1,7 @@ +export declare var a1; +export declare class c1 { + p1; +} +export declare var instance1; +export declare function f1(); +export declare var a2; diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js new file mode 100644 index 0000000000000..46c9f29e55a8a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js @@ -0,0 +1,15 @@ +var m1 = require("ref/m1"); +exports.a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +exports.c1 = c1; +exports.instance1 = new c1(); +function f1() { + return exports.instance1; +} +exports.f1 = f1; +exports.a2 = m1.m1_c1; +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map new file mode 100644 index 0000000000000..8726f12b55780 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAO,EAAE,WAAW,QAAQ,CAAC,CAAC;AACnB,UAAE,GAAG,EAAE,CAAC;AACnB,IAAa,EAAE;IAAfA,SAAaA,EAAEA;IAEfC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAFY,UAAE,GAAF,EAEZ,CAAA;AAEU,iBAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC,SAAgB,EAAE;IACdE,MAAMA,CAACA,iBAASA,CAACA;AACrBA,CAACA;AAFe,UAAE,GAAF,EAEf,CAAA;AAEU,UAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..8df6436f2d696 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..ef120717208d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile1.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile2.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json new file mode 100644 index 0000000000000..8df6436f2d696 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.json @@ -0,0 +1,28 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "../outputdir_multifolder_ref/m2.js.map", + "../outputdir_multifolder_ref/m2.js", + "../outputdir_multifolder_ref/m2.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..ef120717208d5 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:diskFile1.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..07f5c5548c5bc --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a055ff01a702c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map new file mode 100644 index 0000000000000..018b71e572c2d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts new file mode 100644 index 0000000000000..4002f03fdad74 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map new file mode 100644 index 0000000000000..3809ffe7b9c50 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAEA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js new file mode 100644 index 0000000000000..9f44db1fad51c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js @@ -0,0 +1,11 @@ +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +//# sourceMappingURL=m2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map new file mode 100644 index 0000000000000..57143a47b4b7f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":["m2_c1","m2_c1.constructor","m2_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..07f5c5548c5bc --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.json @@ -0,0 +1,29 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/outputdir_multifolder/ref/m1.js.map", + "outdir/simple/outputdir_multifolder/ref/m1.js", + "outdir/simple/outputdir_multifolder/ref/m1.d.ts", + "outdir/simple/outputdir_multifolder_ref/m2.js.map", + "outdir/simple/outputdir_multifolder_ref/m2.js", + "outdir/simple/outputdir_multifolder_ref/m2.d.ts", + "outdir/simple/outputdir_multifolder/test.js.map", + "outdir/simple/outputdir_multifolder/test.js", + "outdir/simple/outputdir_multifolder/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a055ff01a702c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,483 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: m2.js +mapUrl: m2.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder_ref/m2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m2_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m2_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m2_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m2_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m2_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m2_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m2_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m2_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m2_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m2_f1) +--- +>>>//# sourceMappingURL=m2.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/outputdir_multifolder/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(3, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(3, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(3, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(4, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(4, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(4, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(6, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(6, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(6, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(8, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(8, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(10, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(10, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(10, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(11, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(11, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..d86a5b966a416 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..314069f83fb1e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..87bf27ca379ff --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..e4439f13d309d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,31 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var m2_a1 = 10; +var m2_c1 = (function () { + function m2_c1() { + } + return m2_c1; +})(); +var m2_instance1 = new m2_c1(); +function m2_f1() { + return m2_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..d86a5b966a416 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","m2_c1","m2_c1.constructor","m2_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXC,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACND,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..314069f83fb1e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.json @@ -0,0 +1,23 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_multifolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_multifolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "../outputdir_multifolder_ref/m2.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..87bf27ca379ff --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,471 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder_ref/m2.ts +------------------------------------------------------------------- +>>>var m2_a1 = 10; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1-> +2 >var +3 > m2_a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) +3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) +4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) +5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) +6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) +--- +>>>var m2_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m2_c1 +1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(2, 7) + SourceIndex(1) +3 >Emitted(12, 10) Source(2, 12) + SourceIndex(1) +--- +>>> function m2_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m2_c1 +1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(13, 14) Source(2, 7) + SourceIndex(1) name (m2_c1) +3 >Emitted(13, 19) Source(2, 12) + SourceIndex(1) name (m2_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m2_c1_p1: number; + > +2 > } +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(1) name (m2_c1.constructor) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) name (m2_c1.constructor) +--- +>>> return m2_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) name (m2_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m2_c1 { + > public m2_c1_p1: number; + > } +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) name (m2_c1) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) name (m2_c1) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) +--- +>>>var m2_instance1 = new m2_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m2_instance1 +4 > = +5 > new +6 > m2_c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) +3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) +4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) +5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) +6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) +7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) +8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) +--- +>>>function m2_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m2_f1 +1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(7, 10) + SourceIndex(1) +3 >Emitted(18, 15) Source(7, 15) + SourceIndex(1) +--- +>>> return m2_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m2_instance1 +5 > ; +1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) name (m2_f1) +2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) name (m2_f1) +3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) name (m2_f1) +4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) name (m2_f1) +5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) name (m2_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) name (m2_f1) +2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) name (m2_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:outputdir_multifolder/test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(21, 1) Source(3, 1) + SourceIndex(2) +2 >Emitted(21, 5) Source(3, 5) + SourceIndex(2) +3 >Emitted(21, 7) Source(3, 7) + SourceIndex(2) +4 >Emitted(21, 10) Source(3, 10) + SourceIndex(2) +5 >Emitted(21, 12) Source(3, 12) + SourceIndex(2) +6 >Emitted(21, 13) Source(3, 13) + SourceIndex(2) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(22, 1) Source(4, 1) + SourceIndex(2) +2 >Emitted(22, 5) Source(4, 7) + SourceIndex(2) +3 >Emitted(22, 7) Source(4, 9) + SourceIndex(2) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(23, 5) Source(4, 1) + SourceIndex(2) name (c1) +2 >Emitted(23, 14) Source(4, 7) + SourceIndex(2) name (c1) +3 >Emitted(23, 16) Source(4, 9) + SourceIndex(2) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(24, 5) Source(6, 1) + SourceIndex(2) name (c1.constructor) +2 >Emitted(24, 6) Source(6, 2) + SourceIndex(2) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(25, 5) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(25, 14) Source(6, 2) + SourceIndex(2) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(26, 1) Source(6, 1) + SourceIndex(2) name (c1) +2 >Emitted(26, 2) Source(6, 2) + SourceIndex(2) name (c1) +3 >Emitted(26, 2) Source(4, 1) + SourceIndex(2) +4 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(27, 1) Source(8, 1) + SourceIndex(2) +2 >Emitted(27, 5) Source(8, 5) + SourceIndex(2) +3 >Emitted(27, 14) Source(8, 14) + SourceIndex(2) +4 >Emitted(27, 17) Source(8, 17) + SourceIndex(2) +5 >Emitted(27, 21) Source(8, 21) + SourceIndex(2) +6 >Emitted(27, 23) Source(8, 23) + SourceIndex(2) +7 >Emitted(27, 25) Source(8, 25) + SourceIndex(2) +8 >Emitted(27, 26) Source(8, 26) + SourceIndex(2) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(28, 1) Source(9, 1) + SourceIndex(2) +2 >Emitted(28, 10) Source(9, 10) + SourceIndex(2) +3 >Emitted(28, 12) Source(9, 12) + SourceIndex(2) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(29, 5) Source(10, 5) + SourceIndex(2) name (f1) +2 >Emitted(29, 11) Source(10, 11) + SourceIndex(2) name (f1) +3 >Emitted(29, 12) Source(10, 12) + SourceIndex(2) name (f1) +4 >Emitted(29, 21) Source(10, 21) + SourceIndex(2) name (f1) +5 >Emitted(29, 22) Source(10, 22) + SourceIndex(2) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(11, 1) + SourceIndex(2) name (f1) +2 >Emitted(30, 2) Source(11, 2) + SourceIndex(2) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..38dc6f368548e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..67378d3b3b0e4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json new file mode 100644 index 0000000000000..38dc6f368548e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: no outdir", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "m1.js.map", + "m1.js", + "m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..67378d3b3b0e4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4dec5466b57d7 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..8840f08823230 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map new file mode 100644 index 0000000000000..c455ec2516d22 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9480f510a38ba --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..4dec5466b57d7 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/m1.js.map", + "outdir/simple/m1.js", + "outdir/simple/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..8840f08823230 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/m1.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..86549d3cdf3e2 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..ccc633991cadb --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2e298e0f200b4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..86549d3cdf3e2 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.json new file mode 100644 index 0000000000000..ccc633991cadb --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_simple: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_simple", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..2e298e0f200b4 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..c6ffec7a0de71 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5f492905cc13e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json new file mode 100644 index 0000000000000..c6ffec7a0de71 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.json @@ -0,0 +1,20 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: no outdir", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..5f492905cc13e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..8d96cfb67297b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c37a154dd9ffd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..8d96cfb67297b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..c37a154dd9ffd --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..30ed2151ff15f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..1dd8da6ea41b2 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..95cbff86f9151 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.json new file mode 100644 index 0000000000000..30ed2151ff15f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.json @@ -0,0 +1,21 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_singleFile: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_singleFile", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..1dd8da6ea41b2 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(2, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(2, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(7, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..aedbf8487428f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b694a733e2c72 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json new file mode 100644 index 0000000000000..aedbf8487428f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.json @@ -0,0 +1,24 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: no outdir", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "ref/m1.js.map", + "ref/m1.js", + "ref/m1.d.ts", + "test.js.map", + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt new file mode 100644 index 0000000000000..b694a733e2c72 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..1ac6f60f7d51d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a47ea8bf3a877 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js new file mode 100644 index 0000000000000..f6b169662c98a --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js @@ -0,0 +1,11 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +//# sourceMappingURL=m1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map new file mode 100644 index 0000000000000..dead527f9b082 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts new file mode 100644 index 0000000000000..9c08e5a85e351 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.d.ts @@ -0,0 +1 @@ +/// diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js new file mode 100644 index 0000000000000..335d79c01c6d3 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js @@ -0,0 +1,11 @@ +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map new file mode 100644 index 0000000000000..12a2e00edee82 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":["c1","c1.constructor","f1"],"mappings":"AACA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARA,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json new file mode 100644 index 0000000000000..1ac6f60f7d51d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.json @@ -0,0 +1,25 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: specify outputDirectory", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "outdir/simple/ref/m1.js.map", + "outdir/simple/ref/m1.js", + "outdir/simple/ref/m1.d.ts", + "outdir/simple/test.js.map", + "outdir/simple/test.js", + "outdir/simple/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt new file mode 100644 index 0000000000000..a47ea8bf3a877 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt @@ -0,0 +1,322 @@ +=================================================================== +JsFile: m1.js +mapUrl: m1.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/ref/m1.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +>>>//# sourceMappingURL=m1.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:outdir/simple/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 >/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 7) Source(2, 7) + SourceIndex(0) +4 >Emitted(1, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(2, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(3, 7) + SourceIndex(0) +3 >Emitted(2, 7) Source(3, 9) + SourceIndex(0) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (c1) +2 >Emitted(3, 14) Source(3, 7) + SourceIndex(0) name (c1) +3 >Emitted(3, 16) Source(3, 9) + SourceIndex(0) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(4, 5) Source(5, 1) + SourceIndex(0) name (c1.constructor) +2 >Emitted(4, 6) Source(5, 2) + SourceIndex(0) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(5, 14) Source(5, 2) + SourceIndex(0) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (c1) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (c1) +3 >Emitted(6, 2) Source(3, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 14) Source(7, 14) + SourceIndex(0) +4 >Emitted(7, 17) Source(7, 17) + SourceIndex(0) +5 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +6 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +7 >Emitted(7, 25) Source(7, 25) + SourceIndex(0) +8 >Emitted(7, 26) Source(7, 26) + SourceIndex(0) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(8, 12) Source(8, 12) + SourceIndex(0) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(9, 5) Source(9, 5) + SourceIndex(0) name (f1) +2 >Emitted(9, 11) Source(9, 11) + SourceIndex(0) name (f1) +3 >Emitted(9, 12) Source(9, 12) + SourceIndex(0) name (f1) +4 >Emitted(9, 21) Source(9, 21) + SourceIndex(0) name (f1) +5 >Emitted(9, 22) Source(9, 22) + SourceIndex(0) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(10, 1) + SourceIndex(0) name (f1) +2 >Emitted(10, 2) Source(10, 2) + SourceIndex(0) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map new file mode 100644 index 0000000000000..db639624d793d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..29d344a480169 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..066553daeb18c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.d.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js new file mode 100644 index 0000000000000..adbcb1ed5e69b --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js @@ -0,0 +1,21 @@ +var m1_a1 = 10; +var m1_c1 = (function () { + function m1_c1() { + } + return m1_c1; +})(); +var m1_instance1 = new m1_c1(); +function m1_f1() { + return m1_instance1; +} +var a1 = 10; +var c1 = (function () { + function c1() { + } + return c1; +})(); +var instance1 = new c1(); +function f1() { + return instance1; +} +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map new file mode 100644 index 0000000000000..db639624d793d --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":["m1_c1","m1_c1.constructor","m1_f1","c1","c1.constructor","f1"],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAM,KAAK;IAAXA,SAAMA,KAAKA;IAEXC,CAACA;IAADD,YAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B,SAAS,KAAK;IACVE,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;ACPD,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ,IAAM,EAAE;IAARC,SAAMA,EAAEA;IAERC,CAACA;IAADD,SAACA;AAADA,CAACA,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB,SAAS,EAAE;IACPE,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.json b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.json new file mode 100644 index 0000000000000..29d344a480169 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.json @@ -0,0 +1,22 @@ +{ + "scenario": "[Sourcemap]/[Sourceroot-Url]: outputdir_subfolder: specify outputFile", + "projectRoot": "tests/cases/projects/outputdir_subfolder", + "inputFiles": [ + "test.ts" + ], + "out": "bin/test.js", + "sourceMap": true, + "sourceRoot": "http://typescript.codeplex.com/", + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "test.ts", + "ref/m1.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "bin/test.js.map", + "bin/test.js", + "bin/test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt new file mode 100644 index 0000000000000..066553daeb18c --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: http://typescript.codeplex.com/ +sources: ref/m1.ts,test.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:ref/m1.ts +------------------------------------------------------------------- +>>>var m1_a1 = 10; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > +2 >var +3 > m1_a1 +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +--- +>>>var m1_c1 = (function () { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > m1_c1 +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 12) + SourceIndex(0) +--- +>>> function m1_c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +1-> +2 > class +3 > m1_c1 +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(3, 14) Source(2, 7) + SourceIndex(0) name (m1_c1) +3 >Emitted(3, 19) Source(2, 12) + SourceIndex(0) name (m1_c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > { + > public m1_c1_p1: number; + > +2 > } +1 >Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (m1_c1.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (m1_c1.constructor) +--- +>>> return m1_c1; +1->^^^^ +2 > ^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) name (m1_c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class m1_c1 { + > public m1_c1_p1: number; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (m1_c1) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (m1_c1) +3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) +--- +>>>var m1_instance1 = new m1_c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > m1_instance1 +4 > = +5 > new +6 > m1_c1 +7 > () +8 > ; +1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) +4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) +5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) +6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) +7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) +8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) +--- +>>>function m1_f1() { +1 > +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > m1_f1 +1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 10) + SourceIndex(0) +3 >Emitted(8, 15) Source(7, 15) + SourceIndex(0) +--- +>>> return m1_instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > m1_instance1 +5 > ; +1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) name (m1_f1) +2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) name (m1_f1) +3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) name (m1_f1) +4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) name (m1_f1) +5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) name (m1_f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) name (m1_f1) +2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) name (m1_f1) +--- +------------------------------------------------------------------- +emittedFile:bin/test.js +sourceFile:test.ts +------------------------------------------------------------------- +>>>var a1 = 10; +1-> +2 >^^^^ +3 > ^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1->/// + > +2 >var +3 > a1 +4 > = +5 > 10 +6 > ; +1->Emitted(11, 1) Source(2, 1) + SourceIndex(1) +2 >Emitted(11, 5) Source(2, 5) + SourceIndex(1) +3 >Emitted(11, 7) Source(2, 7) + SourceIndex(1) +4 >Emitted(11, 10) Source(2, 10) + SourceIndex(1) +5 >Emitted(11, 12) Source(2, 12) + SourceIndex(1) +6 >Emitted(11, 13) Source(2, 13) + SourceIndex(1) +--- +>>>var c1 = (function () { +1-> +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 >class +3 > c1 +1->Emitted(12, 1) Source(3, 1) + SourceIndex(1) +2 >Emitted(12, 5) Source(3, 7) + SourceIndex(1) +3 >Emitted(12, 7) Source(3, 9) + SourceIndex(1) +--- +>>> function c1() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^ +1-> +2 > class +3 > c1 +1->Emitted(13, 5) Source(3, 1) + SourceIndex(1) name (c1) +2 >Emitted(13, 14) Source(3, 7) + SourceIndex(1) name (c1) +3 >Emitted(13, 16) Source(3, 9) + SourceIndex(1) name (c1) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > { + > public p1: number; + > +2 > } +1 >Emitted(14, 5) Source(5, 1) + SourceIndex(1) name (c1.constructor) +2 >Emitted(14, 6) Source(5, 2) + SourceIndex(1) name (c1.constructor) +--- +>>> return c1; +1->^^^^ +2 > ^^^^^^^^^ +1-> +2 > } +1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(15, 14) Source(5, 2) + SourceIndex(1) name (c1) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class c1 { + > public p1: number; + > } +1 >Emitted(16, 1) Source(5, 1) + SourceIndex(1) name (c1) +2 >Emitted(16, 2) Source(5, 2) + SourceIndex(1) name (c1) +3 >Emitted(16, 2) Source(3, 1) + SourceIndex(1) +4 >Emitted(16, 6) Source(5, 2) + SourceIndex(1) +--- +>>>var instance1 = new c1(); +1-> +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^^ +8 > ^ +1-> + > + > +2 >var +3 > instance1 +4 > = +5 > new +6 > c1 +7 > () +8 > ; +1->Emitted(17, 1) Source(7, 1) + SourceIndex(1) +2 >Emitted(17, 5) Source(7, 5) + SourceIndex(1) +3 >Emitted(17, 14) Source(7, 14) + SourceIndex(1) +4 >Emitted(17, 17) Source(7, 17) + SourceIndex(1) +5 >Emitted(17, 21) Source(7, 21) + SourceIndex(1) +6 >Emitted(17, 23) Source(7, 23) + SourceIndex(1) +7 >Emitted(17, 25) Source(7, 25) + SourceIndex(1) +8 >Emitted(17, 26) Source(7, 26) + SourceIndex(1) +--- +>>>function f1() { +1 > +2 >^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >function +3 > f1 +1 >Emitted(18, 1) Source(8, 1) + SourceIndex(1) +2 >Emitted(18, 10) Source(8, 10) + SourceIndex(1) +3 >Emitted(18, 12) Source(8, 12) + SourceIndex(1) +--- +>>> return instance1; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->() { + > +2 > return +3 > +4 > instance1 +5 > ; +1->Emitted(19, 5) Source(9, 5) + SourceIndex(1) name (f1) +2 >Emitted(19, 11) Source(9, 11) + SourceIndex(1) name (f1) +3 >Emitted(19, 12) Source(9, 12) + SourceIndex(1) name (f1) +4 >Emitted(19, 21) Source(9, 21) + SourceIndex(1) name (f1) +5 >Emitted(19, 22) Source(9, 22) + SourceIndex(1) name (f1) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(10, 1) + SourceIndex(1) name (f1) +2 >Emitted(20, 2) Source(10, 2) + SourceIndex(1) name (f1) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/commands.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/commands.js new file mode 100644 index 0000000000000..8b04a1c9092c3 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/commands.js @@ -0,0 +1,2 @@ +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js new file mode 100644 index 0000000000000..d0451fe5a0836 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/fs.js @@ -0,0 +1,17 @@ +define(["require", "exports"], function (require, exports) { + var RM = (function () { + function RM() { + } + RM.prototype.getName = function () { + return 'rm'; + }; + RM.prototype.getDescription = function () { + return "\t\t\tDelete file"; + }; + RM.prototype.run = function (configuration) { + var absoluteWorkspacePath = configuration.workspace.toAbsolutePath(configuration.server); + }; + return RM; + })(); + exports.RM = RM; +}); diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/server.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/server.js new file mode 100644 index 0000000000000..8b04a1c9092c3 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/server.js @@ -0,0 +1,2 @@ +define(["require", "exports"], function (require, exports) { +}); diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/visibilityOfTypeUsedAcrossModules.json b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/visibilityOfTypeUsedAcrossModules.json new file mode 100644 index 0000000000000..5181dc783c0bd --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/amd/visibilityOfTypeUsedAcrossModules.json @@ -0,0 +1,19 @@ +{ + "scenario": "Visibility of type used across modules", + "projectRoot": "tests/cases/projects/VisibilityOfCrosssModuleTypeUsage", + "inputFiles": [ + "commands.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "commands.ts", + "fs.ts", + "server.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "fs.js", + "server.js", + "commands.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/commands.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/commands.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js new file mode 100644 index 0000000000000..8f38a87b72929 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/fs.js @@ -0,0 +1,15 @@ +var RM = (function () { + function RM() { + } + RM.prototype.getName = function () { + return 'rm'; + }; + RM.prototype.getDescription = function () { + return "\t\t\tDelete file"; + }; + RM.prototype.run = function (configuration) { + var absoluteWorkspacePath = configuration.workspace.toAbsolutePath(configuration.server); + }; + return RM; +})(); +exports.RM = RM; diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/server.js b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/server.js new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/visibilityOfTypeUsedAcrossModules.json b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/visibilityOfTypeUsedAcrossModules.json new file mode 100644 index 0000000000000..5181dc783c0bd --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules/node/visibilityOfTypeUsedAcrossModules.json @@ -0,0 +1,19 @@ +{ + "scenario": "Visibility of type used across modules", + "projectRoot": "tests/cases/projects/VisibilityOfCrosssModuleTypeUsage", + "inputFiles": [ + "commands.ts" + ], + "baselineCheck": true, + "resolvedInputFiles": [ + "commands.ts", + "fs.ts", + "server.ts", + "lib.d.ts" + ], + "emittedFiles": [ + "fs.js", + "server.js", + "commands.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.errors.txt b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.errors.txt new file mode 100644 index 0000000000000..3883050bdcac1 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.errors.txt @@ -0,0 +1,2 @@ +main.ts(2,1): File 'nonExistingFile1.ts' not found. +main.ts(3,1): File 'nonExistingFile2.ts' not found. diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.json b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.json new file mode 100644 index 0000000000000..5154724457016 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/amd/visibilityOfTypeUsedAcrossModules2.json @@ -0,0 +1,12 @@ +{ + "scenario": "Visibility of type used across modules - 2", + "projectRoot": "tests/cases/projects/InvalidReferences", + "inputFiles": [ + "main.ts" + ], + "resolvedInputFiles": [ + "main.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.errors.txt b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.errors.txt new file mode 100644 index 0000000000000..3883050bdcac1 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.errors.txt @@ -0,0 +1,2 @@ +main.ts(2,1): File 'nonExistingFile1.ts' not found. +main.ts(3,1): File 'nonExistingFile2.ts' not found. diff --git a/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.json b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.json new file mode 100644 index 0000000000000..5154724457016 --- /dev/null +++ b/tests/baselines/reference/project/visibilityOfTypeUsedAcrossModules2/node/visibilityOfTypeUsedAcrossModules2.json @@ -0,0 +1,12 @@ +{ + "scenario": "Visibility of type used across modules - 2", + "projectRoot": "tests/cases/projects/InvalidReferences", + "inputFiles": [ + "main.ts" + ], + "resolvedInputFiles": [ + "main.ts", + "lib.d.ts" + ], + "emittedFiles": [] +} \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining.js b/tests/baselines/reference/promiseChaining.js new file mode 100644 index 0000000000000..0a12fc70c1721 --- /dev/null +++ b/tests/baselines/reference/promiseChaining.js @@ -0,0 +1,25 @@ +//// [promiseChaining.ts] +class Chain { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain { + var result = cb(this.value); + // should get a fresh type parameter which each then call + var z = this.then(x => result)/*S*/.then(x => "abc")/*string*/.then(x => x.length)/*number*/; // No error + return new Chain(result); + } +} + + + +//// [promiseChaining.js] +var Chain = (function () { + function Chain(value) { + this.value = value; + } + Chain.prototype.then = function (cb) { + var result = cb(this.value); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); + return new Chain(result); + }; + return Chain; +})(); diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt new file mode 100644 index 0000000000000..1ca0a0450f208 --- /dev/null +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== + // same example but with constraints on each type parameter + class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var result = cb(this.value); + // should get a fresh type parameter which each then call + var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + return new Chain2(result); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining1.js b/tests/baselines/reference/promiseChaining1.js new file mode 100644 index 0000000000000..797401a8e3ab1 --- /dev/null +++ b/tests/baselines/reference/promiseChaining1.js @@ -0,0 +1,24 @@ +//// [promiseChaining1.ts] +// same example but with constraints on each type parameter +class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var result = cb(this.value); + // should get a fresh type parameter which each then call + var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function + return new Chain2(result); + } +} + +//// [promiseChaining1.js] +var Chain2 = (function () { + function Chain2(value) { + this.value = value; + } + Chain2.prototype.then = function (cb) { + var result = cb(this.value); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); + return new Chain2(result); + }; + return Chain2; +})(); diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt new file mode 100644 index 0000000000000..c03d09ea3dbad --- /dev/null +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== + // same example but with constraints on each type parameter + class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var result = cb(this.value); + // should get a fresh type parameter which each then call + var z = this.then(x => result).then(x => "abc").then(x => x.length); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + return new Chain2(result); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining2.js b/tests/baselines/reference/promiseChaining2.js new file mode 100644 index 0000000000000..e0ff3f31557b3 --- /dev/null +++ b/tests/baselines/reference/promiseChaining2.js @@ -0,0 +1,24 @@ +//// [promiseChaining2.ts] +// same example but with constraints on each type parameter +class Chain2 { + constructor(public value: T) { } + then(cb: (x: T) => S): Chain2 { + var result = cb(this.value); + // should get a fresh type parameter which each then call + var z = this.then(x => result).then(x => "abc").then(x => x.length); + return new Chain2(result); + } +} + +//// [promiseChaining2.js] +var Chain2 = (function () { + function Chain2(value) { + this.value = value; + } + Chain2.prototype.then = function (cb) { + var result = cb(this.value); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); + return new Chain2(result); + }; + return Chain2; +})(); diff --git a/tests/baselines/reference/promiseIdentity.js b/tests/baselines/reference/promiseIdentity.js new file mode 100644 index 0000000000000..dfeb5f5b0cb37 --- /dev/null +++ b/tests/baselines/reference/promiseIdentity.js @@ -0,0 +1,28 @@ +//// [promiseIdentity.ts] +interface IPromise { + then(callback: (x: T) => IPromise): IPromise; +} +interface Promise { + then(callback: (x: T) => Promise): Promise; +} +var x: IPromise; +var x: Promise; + + +interface IPromise2 { + then(callback: (x: T) => IPromise2): IPromise2; +} +interface Promise2 { + then(callback: (x: V) => Promise2): Promise2; // Uses V instead of T in callback's parameter +} + +// Ok because T in this particular Promise2 is any, as are all the U and W references. +// Also, the V of Promise2 happens to coincide with the T of IPromise2 (they are both string). +var y: IPromise2; +var y: Promise2; + +//// [promiseIdentity.js] +var x; +var x; +var y; +var y; diff --git a/tests/baselines/reference/promiseIdentity2.errors.txt b/tests/baselines/reference/promiseIdentity2.errors.txt new file mode 100644 index 0000000000000..52798ec38e07e --- /dev/null +++ b/tests/baselines/reference/promiseIdentity2.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/promiseIdentity2.ts (1 errors) ==== + interface IPromise { + then(callback: (x: T) => IPromise): IPromise; + } + interface Promise { + then(callback: (x: T) => Promise): Promise; + } + + // error because T is string in the first declaration, and T is boolean in the second + // Return type and callback return type are ok because T is any in this particular Promise + var x: IPromise; + var x: Promise; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseIdentity2.js b/tests/baselines/reference/promiseIdentity2.js new file mode 100644 index 0000000000000..9f821520be6d8 --- /dev/null +++ b/tests/baselines/reference/promiseIdentity2.js @@ -0,0 +1,16 @@ +//// [promiseIdentity2.ts] +interface IPromise { + then(callback: (x: T) => IPromise): IPromise; +} +interface Promise { + then(callback: (x: T) => Promise): Promise; +} + +// error because T is string in the first declaration, and T is boolean in the second +// Return type and callback return type are ok because T is any in this particular Promise +var x: IPromise; +var x: Promise; + +//// [promiseIdentity2.js] +var x; +var x; diff --git a/tests/baselines/reference/promiseIdentityWithAny.js b/tests/baselines/reference/promiseIdentityWithAny.js new file mode 100644 index 0000000000000..d4f053c537052 --- /dev/null +++ b/tests/baselines/reference/promiseIdentityWithAny.js @@ -0,0 +1,15 @@ +//// [promiseIdentityWithAny.ts] +interface IPromise { + then(callback: (x: T) => IPromise): IPromise; +} +interface Promise { + then(callback: (x: T) => Promise): Promise; +} + +// Should be ok because signature type parameters get erased to any +var x: IPromise; +var x: Promise; + +//// [promiseIdentityWithAny.js] +var x; +var x; diff --git a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt new file mode 100644 index 0000000000000..cdf88aafd5e68 --- /dev/null +++ b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/promiseIdentityWithAny2.ts (2 errors) ==== + interface IPromise { + then(callback: (x: T) => IPromise): IPromise; + } + interface Promise { + then(callback: (x: T) => Promise): Promise; + } + + // Error because type parameter arity doesn't match + var x: IPromise; + var x: Promise; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. + + + interface IPromise2 { + then(callback: (x: T) => IPromise2): IPromise2; + } + interface Promise2 { + then(callback: (x: T) => Promise2): Promise2; // Uses string instead of any! + } + + // Error because string and any don't match + var y: IPromise2; + var y: Promise2; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'. \ No newline at end of file diff --git a/tests/baselines/reference/promiseIdentityWithAny2.js b/tests/baselines/reference/promiseIdentityWithAny2.js new file mode 100644 index 0000000000000..9cf4ffe5b2467 --- /dev/null +++ b/tests/baselines/reference/promiseIdentityWithAny2.js @@ -0,0 +1,29 @@ +//// [promiseIdentityWithAny2.ts] +interface IPromise { + then(callback: (x: T) => IPromise): IPromise; +} +interface Promise { + then(callback: (x: T) => Promise): Promise; +} + +// Error because type parameter arity doesn't match +var x: IPromise; +var x: Promise; + + +interface IPromise2 { + then(callback: (x: T) => IPromise2): IPromise2; +} +interface Promise2 { + then(callback: (x: T) => Promise2): Promise2; // Uses string instead of any! +} + +// Error because string and any don't match +var y: IPromise2; +var y: Promise2; + +//// [promiseIdentityWithAny2.js] +var x; +var x; +var y; +var y; diff --git a/tests/baselines/reference/promiseIdentityWithConstraints.js b/tests/baselines/reference/promiseIdentityWithConstraints.js new file mode 100644 index 0000000000000..a1faac100711b --- /dev/null +++ b/tests/baselines/reference/promiseIdentityWithConstraints.js @@ -0,0 +1,15 @@ +//// [promiseIdentityWithConstraints.ts] +interface IPromise { + then(callback: (x: T) => IPromise): IPromise; +} +interface Promise { + then(callback: (x: T) => Promise): Promise; +} + +// Error because constraint V doesn't match +var x: IPromise; +var x: Promise; + +//// [promiseIdentityWithConstraints.js] +var x; +var x; diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt new file mode 100644 index 0000000000000..0247f609f1b34 --- /dev/null +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -0,0 +1,218 @@ +==== tests/cases/compiler/promisePermutations.ts (25 errors) ==== + interface Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + declare function testFunction(): IPromise; + declare function testFunctionP(): Promise; + declare function testFunction2(): IPromise<{ x: number }>; + declare function testFunction2P(): Promise<{ x: number }>; + declare function testFunction3(x: number): IPromise; + declare function testFunction3P(x: number): Promise; + declare function testFunction4(x: number, y?: string): IPromise; + declare function testFunction4P(x: number, y?: string): Promise; + declare function testFunction5(x: number, cb: (a: string) => string): IPromise; + declare function testFunction5P(x: number, cb: (a: string) => string): Promise; + declare function testFunction6(x: number, cb: (a: T) => T): IPromise; + declare function testFunction6P(x: number, cb: (a: T) => T): Promise; + declare function testFunction7(cb: (a: T) => T): IPromise; + declare function testFunction7P(cb: (a: T) => T): Promise; + declare function testFunction8(x: T, cb: (a: T) => T): IPromise; + declare function testFunction8P(x: T, cb: (a: T) => T): Promise; + declare function testFunction9(x: T, cb: (a: U) => U): IPromise; + declare function testFunction9P(x: T, cb: (a: U) => U): Promise; + declare function testFunction10(cb: (a: U) => U): IPromise; + declare function testFunction10P(cb: (a: U) => U): Promise; + + declare function testFunction11(x: number): IPromise; + declare function testFunction11(x: string): IPromise; + declare function testFunction11P(x: number): Promise; + declare function testFunction11P(x: string): Promise; + + declare function testFunction12(x: T): IPromise; + declare function testFunction12(x: T, y: T): IPromise; + declare function testFunction12P(x: T): IPromise; + declare function testFunction12P(x: T, y: T): Promise; + + var r1: IPromise; + var r1a = r1.then(testFunction, testFunction, testFunction); + var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); + var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); + var s1: Promise; + var s1a = s1.then(testFunction, testFunction, testFunction); + var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); + var s1c = s1.then(testFunctionP, testFunction, testFunction); + var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + + var r2: IPromise<{ x: number; }>; + var r2a = r2.then(testFunction2, testFunction2, testFunction2); + var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + var s2: Promise<{ x: number; }>; + var s2a = s2.then(testFunction2, testFunction2, testFunction2); + var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); + var s2c = s2.then(testFunction2P, testFunction2, testFunction2); + var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + + var r3: IPromise; + var r3a = r3.then(testFunction3, testFunction3, testFunction3); + var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + var s3: Promise; + var s3a = s3.then(testFunction3, testFunction3, testFunction3); + var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); + var s3c = s3.then(testFunction3P, testFunction3, testFunction3); + var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + + var r4: IPromise; + var sIPromise: (x: any) => IPromise; + var sPromise: (x: any) => Promise; + var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok + var s4: Promise; + var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + + var r5: IPromise; + var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s5: Promise; + var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r6: IPromise; + var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s6: Promise; + var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r7: IPromise; + var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s7: Promise; + var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + + var r8: IPromise; + var nIPromise: (x: any) => IPromise; + var nPromise: (x: any) => Promise; + var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + var s8: Promise; + var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + + var r9: IPromise; + var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok + var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok + var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok + var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s9: Promise; + var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9d = s9.then(sPromise, sPromise, sPromise); // ok + var s9e = s9.then(nPromise, nPromise, nPromise); // ok + var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok + var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r10 = testFunction10(x => x); + var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok + var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok + var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok + var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok + var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s10 = testFunction10P(x => x); + var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok + var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok + var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok + var s10d = s10.then(sPromise, sPromise, sPromise); // ok + var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok + var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok + var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + + var r11: IPromise; + var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok + var s11: Promise; + var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok + var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + + var r12 = testFunction12(x => x); + var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok + var s12 = testFunction12(x => x); + var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok + var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok + var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.js b/tests/baselines/reference/promisePermutations.js new file mode 100644 index 0000000000000..c143e20bde36e --- /dev/null +++ b/tests/baselines/reference/promisePermutations.js @@ -0,0 +1,279 @@ +//// [promisePermutations.ts] +interface Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +declare function testFunction(): IPromise; +declare function testFunctionP(): Promise; +declare function testFunction2(): IPromise<{ x: number }>; +declare function testFunction2P(): Promise<{ x: number }>; +declare function testFunction3(x: number): IPromise; +declare function testFunction3P(x: number): Promise; +declare function testFunction4(x: number, y?: string): IPromise; +declare function testFunction4P(x: number, y?: string): Promise; +declare function testFunction5(x: number, cb: (a: string) => string): IPromise; +declare function testFunction5P(x: number, cb: (a: string) => string): Promise; +declare function testFunction6(x: number, cb: (a: T) => T): IPromise; +declare function testFunction6P(x: number, cb: (a: T) => T): Promise; +declare function testFunction7(cb: (a: T) => T): IPromise; +declare function testFunction7P(cb: (a: T) => T): Promise; +declare function testFunction8(x: T, cb: (a: T) => T): IPromise; +declare function testFunction8P(x: T, cb: (a: T) => T): Promise; +declare function testFunction9(x: T, cb: (a: U) => U): IPromise; +declare function testFunction9P(x: T, cb: (a: U) => U): Promise; +declare function testFunction10(cb: (a: U) => U): IPromise; +declare function testFunction10P(cb: (a: U) => U): Promise; + +declare function testFunction11(x: number): IPromise; +declare function testFunction11(x: string): IPromise; +declare function testFunction11P(x: number): Promise; +declare function testFunction11P(x: string): Promise; + +declare function testFunction12(x: T): IPromise; +declare function testFunction12(x: T, y: T): IPromise; +declare function testFunction12P(x: T): IPromise; +declare function testFunction12P(x: T, y: T): Promise; + +var r1: IPromise; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1: Promise; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + +var r2: IPromise<{ x: number; }>; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2: Promise<{ x: number; }>; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + +var r3: IPromise; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3: Promise; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + +var r4: IPromise; +var sIPromise: (x: any) => IPromise; +var sPromise: (x: any) => Promise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok +var s4: Promise; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + +var r5: IPromise; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s5: Promise; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r6: IPromise; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s6: Promise; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r7: IPromise; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s7: Promise; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + +var r8: IPromise; +var nIPromise: (x: any) => IPromise; +var nPromise: (x: any) => Promise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok +var s8: Promise; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + +var r9: IPromise; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error +var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok +var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s9: Promise; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error +var s9d = s9.then(sPromise, sPromise, sPromise); // ok +var s9e = s9.then(nPromise, nPromise, nPromise); // ok +var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r10 = testFunction10(x => x); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok +var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s10 = testFunction10P(x => x); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok +var s10d = s10.then(sPromise, sPromise, sPromise); // ok +var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + +var r11: IPromise; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok +var s11: Promise; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + +var r12 = testFunction12(x => x); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok +var s12 = testFunction12(x => x); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok + +//// [promisePermutations.js] +var r1; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r2; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var r3; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var r4; +var sIPromise; +var sPromise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var s4; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); +var r5; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s5; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r6; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s6; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r7; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s7; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var r8; +var nIPromise; +var nPromise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r9; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); +var r9b = r9.then(sIPromise, sIPromise, sIPromise); +var r9c = r9.then(nIPromise, nIPromise, nIPromise); +var r9d = r9.then(testFunction, sIPromise, nIPromise); +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); +var s9d = s9.then(sPromise, sPromise, sPromise); +var s9e = s9.then(nPromise, nPromise, nPromise); +var s9f = s9.then(testFunction, sIPromise, nIPromise); +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10 = testFunction10(function (x) { return x; }); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); +var r10b = r10.then(sIPromise, sIPromise, sIPromise); +var r10c = r10.then(nIPromise, nIPromise, nIPromise); +var r10d = r10.then(testFunction, sIPromise, nIPromise); +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s10 = testFunction10P(function (x) { return x; }); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); +var s10d = s10.then(sPromise, sPromise, sPromise); +var s10e = s10.then(nIPromise, nPromise, nIPromise); +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var r11; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var s11; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var r12 = testFunction12(function (x) { return x; }); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var s12 = testFunction12(function (x) { return x; }); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt new file mode 100644 index 0000000000000..5560711319bf2 --- /dev/null +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -0,0 +1,223 @@ +==== tests/cases/compiler/promisePermutations2.ts (28 errors) ==== + // same as promisePermutations but without the same overloads in Promise + + interface Promise { + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + declare function testFunction(): IPromise; + declare function testFunctionP(): Promise; + declare function testFunction2(): IPromise<{ x: number }>; + declare function testFunction2P(): Promise<{ x: number }>; + declare function testFunction3(x: number): IPromise; + declare function testFunction3P(x: number): Promise; + declare function testFunction4(x: number, y?: string): IPromise; + declare function testFunction4P(x: number, y?: string): Promise; + declare function testFunction5(x: number, cb: (a: string) => string): IPromise; + declare function testFunction5P(x: number, cb: (a: string) => string): Promise; + declare function testFunction6(x: number, cb: (a: T) => T): IPromise; + declare function testFunction6P(x: number, cb: (a: T) => T): Promise; + declare function testFunction7(cb: (a: T) => T): IPromise; + declare function testFunction7P(cb: (a: T) => T): Promise; + declare function testFunction8(x: T, cb: (a: T) => T): IPromise; + declare function testFunction8P(x: T, cb: (a: T) => T): Promise; + declare function testFunction9(x: T, cb: (a: U) => U): IPromise; + declare function testFunction9P(x: T, cb: (a: U) => U): Promise; + declare function testFunction10(cb: (a: U) => U): IPromise; + declare function testFunction10P(cb: (a: U) => U): Promise; + + declare function testFunction11(x: number): IPromise; + declare function testFunction11(x: string): IPromise; + declare function testFunction11P(x: number): Promise; + declare function testFunction11P(x: string): Promise; + + declare function testFunction12(x: T): IPromise; + declare function testFunction12(x: T, y: T): IPromise; + declare function testFunction12P(x: T): IPromise; + declare function testFunction12P(x: T, y: T): Promise; + + var r1: IPromise; + var r1a = r1.then(testFunction, testFunction, testFunction); + var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); + var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); + var s1: Promise; + var s1a = s1.then(testFunction, testFunction, testFunction); + var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); + var s1c = s1.then(testFunctionP, testFunction, testFunction); + var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + + var r2: IPromise<{ x: number; }>; + var r2a = r2.then(testFunction2, testFunction2, testFunction2); + var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + var s2: Promise<{ x: number; }>; + var s2a = s2.then(testFunction2, testFunction2, testFunction2); + var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); + var s2c = s2.then(testFunction2P, testFunction2, testFunction2); + var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + + var r3: IPromise; + var r3a = r3.then(testFunction3, testFunction3, testFunction3); + var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + var s3: Promise; + var s3a = s3.then(testFunction3, testFunction3, testFunction3); + var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); + var s3c = s3.then(testFunction3P, testFunction3, testFunction3); + var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var r4: IPromise; + var sIPromise: (x: any) => IPromise; + var sPromise: (x: any) => Promise; + var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok + var s4: Promise; + var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + + var r5: IPromise; + var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s5: Promise; + var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r6: IPromise; + var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s6: Promise; + var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r7: IPromise; + var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s7: Promise; + var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + + var r8: IPromise; + var nIPromise: (x: any) => IPromise; + var nPromise: (x: any) => Promise; + var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + var s8: Promise; + var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + + var r9: IPromise; + var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok + var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok + var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok + var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s9: Promise; + var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9d = s9.then(sPromise, sPromise, sPromise); // ok + var s9e = s9.then(nPromise, nPromise, nPromise); // ok + var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok + var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r10 = testFunction10(x => x); + var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok + var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok + var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok + var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok + var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s10 = testFunction10P(x => x); + var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok + var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok + var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok + var s10d = s10.then(sPromise, sPromise, sPromise); // ok + var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok + var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok + var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + + var r11: IPromise; + var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok + var s11: Promise; + var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var r12 = testFunction12(x => x); + var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok + var s12 = testFunction12(x => x); + var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok + var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok + var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations2.js b/tests/baselines/reference/promisePermutations2.js new file mode 100644 index 0000000000000..12f90880bc7ac --- /dev/null +++ b/tests/baselines/reference/promisePermutations2.js @@ -0,0 +1,278 @@ +//// [promisePermutations2.ts] +// same as promisePermutations but without the same overloads in Promise + +interface Promise { + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +declare function testFunction(): IPromise; +declare function testFunctionP(): Promise; +declare function testFunction2(): IPromise<{ x: number }>; +declare function testFunction2P(): Promise<{ x: number }>; +declare function testFunction3(x: number): IPromise; +declare function testFunction3P(x: number): Promise; +declare function testFunction4(x: number, y?: string): IPromise; +declare function testFunction4P(x: number, y?: string): Promise; +declare function testFunction5(x: number, cb: (a: string) => string): IPromise; +declare function testFunction5P(x: number, cb: (a: string) => string): Promise; +declare function testFunction6(x: number, cb: (a: T) => T): IPromise; +declare function testFunction6P(x: number, cb: (a: T) => T): Promise; +declare function testFunction7(cb: (a: T) => T): IPromise; +declare function testFunction7P(cb: (a: T) => T): Promise; +declare function testFunction8(x: T, cb: (a: T) => T): IPromise; +declare function testFunction8P(x: T, cb: (a: T) => T): Promise; +declare function testFunction9(x: T, cb: (a: U) => U): IPromise; +declare function testFunction9P(x: T, cb: (a: U) => U): Promise; +declare function testFunction10(cb: (a: U) => U): IPromise; +declare function testFunction10P(cb: (a: U) => U): Promise; + +declare function testFunction11(x: number): IPromise; +declare function testFunction11(x: string): IPromise; +declare function testFunction11P(x: number): Promise; +declare function testFunction11P(x: string): Promise; + +declare function testFunction12(x: T): IPromise; +declare function testFunction12(x: T, y: T): IPromise; +declare function testFunction12P(x: T): IPromise; +declare function testFunction12P(x: T, y: T): Promise; + +var r1: IPromise; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1: Promise; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + +var r2: IPromise<{ x: number; }>; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2: Promise<{ x: number; }>; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + +var r3: IPromise; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3: Promise; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error + +var r4: IPromise; +var sIPromise: (x: any) => IPromise; +var sPromise: (x: any) => Promise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok +var s4: Promise; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + +var r5: IPromise; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s5: Promise; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r6: IPromise; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s6: Promise; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r7: IPromise; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s7: Promise; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + +var r8: IPromise; +var nIPromise: (x: any) => IPromise; +var nPromise: (x: any) => Promise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok +var s8: Promise; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + +var r9: IPromise; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error +var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok +var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s9: Promise; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error +var s9d = s9.then(sPromise, sPromise, sPromise); // ok +var s9e = s9.then(nPromise, nPromise, nPromise); // ok +var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r10 = testFunction10(x => x); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok +var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s10 = testFunction10P(x => x); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok +var s10d = s10.then(sPromise, sPromise, sPromise); // ok +var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + +var r11: IPromise; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok +var s11: Promise; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + +var r12 = testFunction12(x => x); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok +var s12 = testFunction12(x => x); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok + +//// [promisePermutations2.js] +var r1; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r2; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var r3; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var r4; +var sIPromise; +var sPromise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var s4; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); +var r5; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s5; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r6; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s6; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r7; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s7; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var r8; +var nIPromise; +var nPromise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r9; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); +var r9b = r9.then(sIPromise, sIPromise, sIPromise); +var r9c = r9.then(nIPromise, nIPromise, nIPromise); +var r9d = r9.then(testFunction, sIPromise, nIPromise); +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); +var s9d = s9.then(sPromise, sPromise, sPromise); +var s9e = s9.then(nPromise, nPromise, nPromise); +var s9f = s9.then(testFunction, sIPromise, nIPromise); +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10 = testFunction10(function (x) { return x; }); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); +var r10b = r10.then(sIPromise, sIPromise, sIPromise); +var r10c = r10.then(nIPromise, nIPromise, nIPromise); +var r10d = r10.then(testFunction, sIPromise, nIPromise); +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s10 = testFunction10P(function (x) { return x; }); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); +var s10d = s10.then(sPromise, sPromise, sPromise); +var s10e = s10.then(nIPromise, nPromise, nIPromise); +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var r11; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var s11; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var r12 = testFunction12(function (x) { return x; }); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var s12 = testFunction12(function (x) { return x; }); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt new file mode 100644 index 0000000000000..353a8ef71239d --- /dev/null +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -0,0 +1,223 @@ +==== tests/cases/compiler/promisePermutations3.ts (28 errors) ==== + // same as promisePermutations but without the same overloads in IPromise + + interface Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + interface IPromise { + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + } + + declare function testFunction(): IPromise; + declare function testFunctionP(): Promise; + declare function testFunction2(): IPromise<{ x: number }>; + declare function testFunction2P(): Promise<{ x: number }>; + declare function testFunction3(x: number): IPromise; + declare function testFunction3P(x: number): Promise; + declare function testFunction4(x: number, y?: string): IPromise; + declare function testFunction4P(x: number, y?: string): Promise; + declare function testFunction5(x: number, cb: (a: string) => string): IPromise; + declare function testFunction5P(x: number, cb: (a: string) => string): Promise; + declare function testFunction6(x: number, cb: (a: T) => T): IPromise; + declare function testFunction6P(x: number, cb: (a: T) => T): Promise; + declare function testFunction7(cb: (a: T) => T): IPromise; + declare function testFunction7P(cb: (a: T) => T): Promise; + declare function testFunction8(x: T, cb: (a: T) => T): IPromise; + declare function testFunction8P(x: T, cb: (a: T) => T): Promise; + declare function testFunction9(x: T, cb: (a: U) => U): IPromise; + declare function testFunction9P(x: T, cb: (a: U) => U): Promise; + declare function testFunction10(cb: (a: U) => U): IPromise; + declare function testFunction10P(cb: (a: U) => U): Promise; + + declare function testFunction11(x: number): IPromise; + declare function testFunction11(x: string): IPromise; + declare function testFunction11P(x: number): Promise; + declare function testFunction11P(x: string): Promise; + + declare function testFunction12(x: T): IPromise; + declare function testFunction12(x: T, y: T): IPromise; + declare function testFunction12P(x: T): IPromise; + declare function testFunction12P(x: T, y: T): Promise; + + var r1: IPromise; + var r1a = r1.then(testFunction, testFunction, testFunction); + var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); + var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); + var s1: Promise; + var s1a = s1.then(testFunction, testFunction, testFunction); + var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); + var s1c = s1.then(testFunctionP, testFunction, testFunction); + var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + + var r2: IPromise<{ x: number; }>; + var r2a = r2.then(testFunction2, testFunction2, testFunction2); + var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + var s2: Promise<{ x: number; }>; + var s2a = s2.then(testFunction2, testFunction2, testFunction2); + var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); + var s2c = s2.then(testFunction2P, testFunction2, testFunction2); + var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + + var r3: IPromise; + var r3a = r3.then(testFunction3, testFunction3, testFunction3); + var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s3: Promise; + var s3a = s3.then(testFunction3, testFunction3, testFunction3); + var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); + var s3c = s3.then(testFunction3P, testFunction3, testFunction3); + var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + + var r4: IPromise; + var sIPromise: (x: any) => IPromise; + var sPromise: (x: any) => Promise; + var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok + var s4: Promise; + var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + + var r5: IPromise; + var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s5: Promise; + var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r6: IPromise; + var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s6: Promise; + var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r7: IPromise; + var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s7: Promise; + var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + + var r8: IPromise; + var nIPromise: (x: any) => IPromise; + var nPromise: (x: any) => Promise; + var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + var s8: Promise; + var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + + var r9: IPromise; + var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok + var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok + var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok + var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s9: Promise; + var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s9d = s9.then(sPromise, sPromise, sPromise); // ok + var s9e = s9.then(nPromise, nPromise, nPromise); // ok + var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok + var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + + var r10 = testFunction10(x => x); + var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok + var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok + var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok + var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok + var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + var s10 = testFunction10P(x => x); + var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok + var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok + var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok + var s10d = s10.then(sPromise, sPromise, sPromise); // ok + var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok + var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok + var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + + var r11: IPromise; + var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s11: Promise; + var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok + var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + + var r12 = testFunction12(x => x); + var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok + var s12 = testFunction12(x => x); + var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok + var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations3.js b/tests/baselines/reference/promisePermutations3.js new file mode 100644 index 0000000000000..a5aaf91702057 --- /dev/null +++ b/tests/baselines/reference/promisePermutations3.js @@ -0,0 +1,278 @@ +//// [promisePermutations3.ts] +// same as promisePermutations but without the same overloads in IPromise + +interface Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +interface IPromise { + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; +} + +declare function testFunction(): IPromise; +declare function testFunctionP(): Promise; +declare function testFunction2(): IPromise<{ x: number }>; +declare function testFunction2P(): Promise<{ x: number }>; +declare function testFunction3(x: number): IPromise; +declare function testFunction3P(x: number): Promise; +declare function testFunction4(x: number, y?: string): IPromise; +declare function testFunction4P(x: number, y?: string): Promise; +declare function testFunction5(x: number, cb: (a: string) => string): IPromise; +declare function testFunction5P(x: number, cb: (a: string) => string): Promise; +declare function testFunction6(x: number, cb: (a: T) => T): IPromise; +declare function testFunction6P(x: number, cb: (a: T) => T): Promise; +declare function testFunction7(cb: (a: T) => T): IPromise; +declare function testFunction7P(cb: (a: T) => T): Promise; +declare function testFunction8(x: T, cb: (a: T) => T): IPromise; +declare function testFunction8P(x: T, cb: (a: T) => T): Promise; +declare function testFunction9(x: T, cb: (a: U) => U): IPromise; +declare function testFunction9P(x: T, cb: (a: U) => U): Promise; +declare function testFunction10(cb: (a: U) => U): IPromise; +declare function testFunction10P(cb: (a: U) => U): Promise; + +declare function testFunction11(x: number): IPromise; +declare function testFunction11(x: string): IPromise; +declare function testFunction11P(x: number): Promise; +declare function testFunction11P(x: string): Promise; + +declare function testFunction12(x: T): IPromise; +declare function testFunction12(x: T, y: T): IPromise; +declare function testFunction12P(x: T): IPromise; +declare function testFunction12P(x: T, y: T): Promise; + +var r1: IPromise; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1: Promise; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); + +var r2: IPromise<{ x: number; }>; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2: Promise<{ x: number; }>; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); + +var r3: IPromise; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3: Promise; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); + +var r4: IPromise; +var sIPromise: (x: any) => IPromise; +var sPromise: (x: any) => Promise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); // ok +var s4: Promise; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); + +var r5: IPromise; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s5: Promise; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r6: IPromise; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s6: Promise; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r7: IPromise; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s7: Promise; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); // ok? + +var r8: IPromise; +var nIPromise: (x: any) => IPromise; +var nPromise: (x: any) => Promise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok +var s8: Promise; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); // ok + +var r9: IPromise; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error +var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok +var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s9: Promise; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error +var s9d = s9.then(sPromise, sPromise, sPromise); // ok +var s9e = s9.then(nPromise, nPromise, nPromise); // ok +var s9f = s9.then(testFunction, sIPromise, nIPromise); // ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok + +var r10 = testFunction10(x => x); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); // ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok +var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok +var s10 = testFunction10P(x => x); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); // ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); // ok +var s10d = s10.then(sPromise, sPromise, sPromise); // ok +var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok + +var r11: IPromise; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok +var s11: Promise; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok + +var r12 = testFunction12(x => x); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok +var s12 = testFunction12(x => x); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok + +//// [promisePermutations3.js] +var r1; +var r1a = r1.then(testFunction, testFunction, testFunction); +var r1b = r1.then(testFunction, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r1c = r1.then(testFunctionP, testFunctionP, testFunctionP); +var s1; +var s1a = s1.then(testFunction, testFunction, testFunction); +var s1b = s1.then(testFunctionP, testFunctionP, testFunctionP); +var s1c = s1.then(testFunctionP, testFunction, testFunction); +var s1d = s1.then(testFunctionP, testFunction, testFunction).then(testFunction, testFunction, testFunction); +var r2; +var r2a = r2.then(testFunction2, testFunction2, testFunction2); +var r2b = r2.then(testFunction2, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var s2; +var s2a = s2.then(testFunction2, testFunction2, testFunction2); +var s2b = s2.then(testFunction2P, testFunction2P, testFunction2P); +var s2c = s2.then(testFunction2P, testFunction2, testFunction2); +var s2d = s2.then(testFunction2P, testFunction2, testFunction2).then(testFunction2, testFunction2, testFunction2); +var r3; +var r3a = r3.then(testFunction3, testFunction3, testFunction3); +var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3; +var s3a = s3.then(testFunction3, testFunction3, testFunction3); +var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); +var s3c = s3.then(testFunction3P, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var r4; +var sIPromise; +var sPromise; +var r4a = r4.then(testFunction4, testFunction4, testFunction4); +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var s4; +var s4a = s4.then(testFunction4, testFunction4, testFunction4); +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); +var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); +var r5; +var r5a = r5.then(testFunction5, testFunction5, testFunction5); +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s5; +var s5a = s5.then(testFunction5, testFunction5, testFunction5); +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); +var s5c = s5.then(testFunction5P, testFunction5, testFunction5); +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r6; +var r6a = r6.then(testFunction6, testFunction6, testFunction6); +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s6; +var s6a = s6.then(testFunction6, testFunction6, testFunction6); +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); +var s6c = s6.then(testFunction6P, testFunction6, testFunction6); +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var r7; +var r7a = r7.then(testFunction7, testFunction7, testFunction7); +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s7; +var s7a = r7.then(testFunction7, testFunction7, testFunction7); +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); +var s7c = r7.then(testFunction7P, testFunction7, testFunction7); +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var r8; +var nIPromise; +var nPromise; +var r8a = r8.then(testFunction8, testFunction8, testFunction8); +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8; +var s8a = s8.then(testFunction8, testFunction8, testFunction8); +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); +var s8c = s8.then(testFunction8P, testFunction8, testFunction8); +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r9; +var r9a = r9.then(testFunction9, testFunction9, testFunction9); +var r9b = r9.then(sIPromise, sIPromise, sIPromise); +var r9c = r9.then(nIPromise, nIPromise, nIPromise); +var r9d = r9.then(testFunction, sIPromise, nIPromise); +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9; +var s9a = s9.then(testFunction9, testFunction9, testFunction9); +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); +var s9c = s9.then(testFunction9P, testFunction9, testFunction9); +var s9d = s9.then(sPromise, sPromise, sPromise); +var s9e = s9.then(nPromise, nPromise, nPromise); +var s9f = s9.then(testFunction, sIPromise, nIPromise); +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10 = testFunction10(function (x) { return x; }); +var r10a = r10.then(testFunction10, testFunction10, testFunction10); +var r10b = r10.then(sIPromise, sIPromise, sIPromise); +var r10c = r10.then(nIPromise, nIPromise, nIPromise); +var r10d = r10.then(testFunction, sIPromise, nIPromise); +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s10 = testFunction10P(function (x) { return x; }); +var s10a = s10.then(testFunction10, testFunction10, testFunction10); +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); +var s10c = s10.then(testFunction10P, testFunction10, testFunction10); +var s10d = s10.then(sPromise, sPromise, sPromise); +var s10e = s10.then(nIPromise, nPromise, nIPromise); +var s10f = s10.then(testFunctionP, sIPromise, nIPromise); +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var r11; +var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var s11; +var s11a = s11.then(testFunction11, testFunction11, testFunction11); +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); +var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var r12 = testFunction12(function (x) { return x; }); +var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var s12 = testFunction12(function (x) { return x; }); +var s12a = s12.then(testFunction12, testFunction12, testFunction12); +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); +var s12c = s12.then(testFunction12P, testFunction12, testFunction12); diff --git a/tests/baselines/reference/promiseTest.js b/tests/baselines/reference/promiseTest.js new file mode 100644 index 0000000000000..0893770e0ce0f --- /dev/null +++ b/tests/baselines/reference/promiseTest.js @@ -0,0 +1,23 @@ +//// [promiseTest.ts] + +interface Promise { + then(success?: (value: T) => Promise): Promise; + then(success?: (value: T) => B): Promise; + data: T; +} + +var p: Promise = null; +var p2 = p.then(function (x) { + return p; +} ); + +var x = p2.data; // number + + + +//// [promiseTest.js] +var p = null; +var p2 = p.then(function (x) { + return p; +}); +var x = p2.data; diff --git a/tests/baselines/reference/promiseTypeInference.js b/tests/baselines/reference/promiseTypeInference.js new file mode 100644 index 0000000000000..6faf131438ab1 --- /dev/null +++ b/tests/baselines/reference/promiseTypeInference.js @@ -0,0 +1,15 @@ +//// [promiseTypeInference.ts] +declare class Promise { + then(success?: (value: T) => Promise): Promise; +} +interface IPromise { + then(success?: (value: T) => IPromise): IPromise; +} +declare function load(name: string): Promise; +declare function convert(s: string): IPromise; + +var $$x = load("something").then(s => convert(s)); + + +//// [promiseTypeInference.js] +var $$x = load("something").then(function (s) { return convert(s); }); diff --git a/tests/baselines/reference/promises.js b/tests/baselines/reference/promises.js new file mode 100644 index 0000000000000..8ebcc5b5432ee --- /dev/null +++ b/tests/baselines/reference/promises.js @@ -0,0 +1,9 @@ +//// [promises.ts] +interface Promise { + then(success?: (value: T) => U): Promise; + then(success?: (value: T) => Promise): Promise; + value: T; +} + + +//// [promises.js] diff --git a/tests/baselines/reference/promisesWithConstraints.js b/tests/baselines/reference/promisesWithConstraints.js new file mode 100644 index 0000000000000..aa618bf4df372 --- /dev/null +++ b/tests/baselines/reference/promisesWithConstraints.js @@ -0,0 +1,32 @@ +//// [promisesWithConstraints.ts] +interface Promise { + then(cb: (x: T) => Promise): Promise; +} + +interface CPromise { + then(cb: (x: T) => Promise): Promise; +} + +interface Foo { x; } +interface Bar { x; y; } + +var a: Promise; +var b: Promise; +a = b; // ok +b = a; // ok + +var a2: CPromise; +var b2: CPromise; +a2 = b2; // ok +b2 = a2; // was error + + +//// [promisesWithConstraints.js] +var a; +var b; +a = b; +b = a; +var a2; +var b2; +a2 = b2; +b2 = a2; diff --git a/tests/baselines/reference/propagationOfPromiseInitialization.js b/tests/baselines/reference/propagationOfPromiseInitialization.js new file mode 100644 index 0000000000000..c0802b24074ea --- /dev/null +++ b/tests/baselines/reference/propagationOfPromiseInitialization.js @@ -0,0 +1,24 @@ +//// [propagationOfPromiseInitialization.ts] +interface IPromise { + then(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult): IPromise; +} + +var foo: IPromise; +foo.then((x) => { + // x is inferred to be a number + return "asdf"; +}).then((x) => { + // x is inferred to be string + x.length; + return 123; +}); + + +//// [propagationOfPromiseInitialization.js] +var foo; +foo.then(function (x) { + return "asdf"; +}).then(function (x) { + x.length; + return 123; +}); diff --git a/tests/baselines/reference/properties.js b/tests/baselines/reference/properties.js new file mode 100644 index 0000000000000..c3d36ec798fa2 --- /dev/null +++ b/tests/baselines/reference/properties.js @@ -0,0 +1,33 @@ +//// [properties.ts] + +class MyClass +{ + public get Count(): number + { + return 42; + } + + public set Count(value: number) + { + // + } +} + +//// [properties.js] +var MyClass = (function () { + function MyClass() { + } + Object.defineProperty(MyClass.prototype, "Count", { + get: function () { + return 42; + }, + set: function (value) { + }, + enumerable: true, + configurable: true + }); + return MyClass; +})(); +//# sourceMappingURL=properties.js.map + +//// [properties.d.ts] diff --git a/tests/baselines/reference/properties.js.map b/tests/baselines/reference/properties.js.map new file mode 100644 index 0000000000000..3b30578b09f65 --- /dev/null +++ b/tests/baselines/reference/properties.js.map @@ -0,0 +1,2 @@ +//// [properties.js.map] +{"version":3,"file":"properties.js","sourceRoot":"","sources":["properties.ts"],"names":["MyClass","MyClass.constructor","MyClass.Count"],"mappings":"AACA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;IAWbC,CAACA;IATGD,sBAAWA,0BAAKA;aAAhBA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;aAEDF,UAAiBA,KAAaA;QAG9BE,CAACA;;;OALAF;IAMLA,cAACA;AAADA,CAACA,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/properties.sourcemap.txt b/tests/baselines/reference/properties.sourcemap.txt new file mode 100644 index 0000000000000..2094301b4c0c5 --- /dev/null +++ b/tests/baselines/reference/properties.sourcemap.txt @@ -0,0 +1,174 @@ +=================================================================== +JsFile: properties.js +mapUrl: properties.js.map +sourceRoot: +sources: properties.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/properties.js +sourceFile:properties.ts +------------------------------------------------------------------- +>>>var MyClass = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >class +3 > MyClass +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) +3 >Emitted(1, 12) Source(2, 14) + SourceIndex(0) +--- +>>> function MyClass() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +1-> +2 > class +3 > MyClass +1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (MyClass) +3 >Emitted(2, 21) Source(2, 14) + SourceIndex(0) name (MyClass) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >{ + > public get Count(): number + > { + > return 42; + > } + > + > public set Count(value: number) + > { + > // + > } + > +2 > } +1 >Emitted(3, 5) Source(13, 1) + SourceIndex(0) name (MyClass.constructor) +2 >Emitted(3, 6) Source(13, 2) + SourceIndex(0) name (MyClass.constructor) +--- +>>> Object.defineProperty(MyClass.prototype, "Count", { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > public get +3 > Count +1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (MyClass) +2 >Emitted(4, 27) Source(4, 16) + SourceIndex(0) name (MyClass) +3 >Emitted(4, 53) Source(4, 21) + SourceIndex(0) name (MyClass) +--- +>>> get: function () { +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^^-> +1 > +1 >Emitted(5, 14) Source(4, 5) + SourceIndex(0) name (MyClass) +--- +>>> return 42; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1->public get Count(): number + > { + > +2 > return +3 > +4 > 42 +5 > ; +1->Emitted(6, 13) Source(6, 9) + SourceIndex(0) name (MyClass.Count) +2 >Emitted(6, 19) Source(6, 15) + SourceIndex(0) name (MyClass.Count) +3 >Emitted(6, 20) Source(6, 16) + SourceIndex(0) name (MyClass.Count) +4 >Emitted(6, 22) Source(6, 18) + SourceIndex(0) name (MyClass.Count) +5 >Emitted(6, 23) Source(6, 19) + SourceIndex(0) name (MyClass.Count) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(7, 9) Source(7, 5) + SourceIndex(0) name (MyClass.Count) +2 >Emitted(7, 10) Source(7, 6) + SourceIndex(0) name (MyClass.Count) +--- +>>> set: function (value) { +1->^^^^^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^^^ +1-> + > + > +2 > public set Count( +3 > value: number +1->Emitted(8, 14) Source(9, 5) + SourceIndex(0) name (MyClass) +2 >Emitted(8, 24) Source(9, 22) + SourceIndex(0) name (MyClass) +3 >Emitted(8, 29) Source(9, 35) + SourceIndex(0) name (MyClass) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 >) + > { + > // + > +2 > } +1 >Emitted(9, 9) Source(12, 5) + SourceIndex(0) name (MyClass.Count) +2 >Emitted(9, 10) Source(12, 6) + SourceIndex(0) name (MyClass.Count) +--- +>>> enumerable: true, +>>> configurable: true +>>> }); +1->^^^^^^^ +2 > ^^^^^^^^^^^^^-> +1-> +1->Emitted(12, 8) Source(7, 6) + SourceIndex(0) name (MyClass) +--- +>>> return MyClass; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +1-> + > + > public set Count(value: number) + > { + > // + > } + > +2 > } +1->Emitted(13, 5) Source(13, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(13, 19) Source(13, 2) + SourceIndex(0) name (MyClass) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class MyClass + > { + > public get Count(): number + > { + > return 42; + > } + > + > public set Count(value: number) + > { + > // + > } + > } +1 >Emitted(14, 1) Source(13, 1) + SourceIndex(0) name (MyClass) +2 >Emitted(14, 2) Source(13, 2) + SourceIndex(0) name (MyClass) +3 >Emitted(14, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(14, 6) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/tests/baselines/reference/propertiesAndIndexers.errors.txt b/tests/baselines/reference/propertiesAndIndexers.errors.txt new file mode 100644 index 0000000000000..58d4724be9a8e --- /dev/null +++ b/tests/baselines/reference/propertiesAndIndexers.errors.txt @@ -0,0 +1,106 @@ +==== tests/cases/compiler/propertiesAndIndexers.ts (19 errors) ==== + interface X { } + interface Y { + n: number; + } + interface Z { + s: string; + } + + interface A { + a: Y; + b: X; + 1: Z; + } + + interface B extends A { + [n: number]: string; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property '1' of type 'Z' is not assignable to numeric index type 'string'. + c: boolean; + 3: boolean; + ~~~~~~~~~~~ +!!! Property '3' of type 'boolean' is not assignable to numeric index type 'string'. + 6(): string; + ~~~~~~~~~~~~ +!!! Property '6' of type '() => string' is not assignable to numeric index type 'string'. + } + + interface B { + 4: boolean; + ~~~~~~~~~~~ +!!! Property '4' of type 'boolean' is not assignable to numeric index type 'string'. + 5: string; + } + + interface C extends A { + [s: string]: number; + ~~~~~~~~~~~~~~~~~~~~ +!!! Property '1' of type 'Z' is not assignable to string index type 'number'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'a' of type 'Y' is not assignable to string index type 'number'. + ~~~~~~~~~~~~~~~~~~~~ +!!! Property 'b' of type 'X' is not assignable to string index type 'number'. + c: boolean; + ~~~~~~~~~~~ +!!! Property 'c' of type 'boolean' is not assignable to string index type 'number'. + 3: boolean; + ~~~~~~~~~~~ +!!! Property '3' of type 'boolean' is not assignable to string index type 'number'. + } + + interface D extends B, C { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + 2: Z; + ~~~~~~~~~ + ~~~~~~~~~ + ~~~~~~~~~ + ~~~~~~~~~ + ~~~~~ +!!! Property '2' of type 'Z' is not assignable to numeric index type 'string'. + ~~~~~ +!!! Property '2' of type 'Z' is not assignable to string index type 'number'. + Infinity: number; + ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! Property 'Infinity' of type 'number' is not assignable to numeric index type 'string'. + zoo: string; + ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! Property 'zoo' of type 'string' is not assignable to string index type 'number'. + } + ~ +!!! Numeric index type 'string' is not assignable to string index type 'number'. + ~ +!!! Property '4' of type 'boolean' is not assignable to string index type 'number'. + ~ +!!! Property '5' of type 'string' is not assignable to string index type 'number'. + ~ +!!! Property '6' of type '() => string' is not assignable to string index type 'number'. + + class P { + [n: string]: string + } + + class Q extends P { + t: number; + ~~~~~~~~~~ +!!! Property 't' of type 'number' is not assignable to string index type 'string'. + } + + var c: { + [n: number]: string; + c: boolean; + 3: boolean; + ~~~~~~~~~~~ +!!! Property '3' of type 'boolean' is not assignable to numeric index type 'string'. + }; \ No newline at end of file diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js new file mode 100644 index 0000000000000..23673dbcfad39 --- /dev/null +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -0,0 +1,73 @@ +//// [propertiesAndIndexers.ts] +interface X { } +interface Y { + n: number; +} +interface Z { + s: string; +} + +interface A { + a: Y; + b: X; + 1: Z; +} + +interface B extends A { + [n: number]: string; + c: boolean; + 3: boolean; + 6(): string; +} + +interface B { + 4: boolean; + 5: string; +} + +interface C extends A { + [s: string]: number; + c: boolean; + 3: boolean; +} + +interface D extends B, C { + 2: Z; + Infinity: number; + zoo: string; +} + +class P { + [n: string]: string +} + +class Q extends P { + t: number; +} + +var c: { + [n: number]: string; + c: boolean; + 3: boolean; +}; + +//// [propertiesAndIndexers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var P = (function () { + function P() { + } + return P; +})(); +var Q = (function (_super) { + __extends(Q, _super); + function Q() { + _super.apply(this, arguments); + } + return Q; +})(P); +var c; diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt new file mode 100644 index 0000000000000..acb32459571af --- /dev/null +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -0,0 +1,153 @@ +==== tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts (10 errors) ==== + enum Compass { + North, South, East, West + } + + var numIndex: { [n: number]: string } = { 3: 'three', 'three': 'three' }; + var strIndex: { [n: string]: Compass } = { 'N': Compass.North, 'E': Compass.East }; + var bothIndex: + { + [n: string]: HTMLElement; + ~~~~~~~~~~~ +!!! Cannot find name 'HTMLElement'. + [m: number]: HTMLDivElement; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'HTMLDivElement'. + }; + + function noIndex() { } + + var obj = { + 10: 'ten', + x: 'hello', + y: 32, + z: { n: 'world', m: 15, o: () => false }, + 'literal property': 100 + }; + var anyVar: any = {}; + + // Assign to a property access + obj.y = 4; + + // Property access on value of type 'any' + anyVar.x = anyVar.y = obj.x = anyVar.z; + + // Dotted property access of property that exists + var aa = obj.x; + + // Dotted property access of property that exists on value's apparent type + var bb = obj.hasOwnProperty; + + // Dotted property access of property that doesn't exist on value's apparent type + var cc = obj.qqq; // error + ~~~ +!!! Property 'qqq' does not exist on type '{ 10: string; x: string; y: number; z: { n: string; m: number; o: () => boolean; }; 'literal property': number; }'. + + // Bracket notation property access using string literal value on type with property of that literal name + var dd = obj['literal property']; + var dd: number; + + // Bracket notation property access using string literal value on type without property of that literal name + var ee = obj['wa wa wa wa wa']; + var ee: any; + + // Bracket notation property access using numeric string literal value on type with property of that literal name + var ff = obj['10']; + var ff: string; + + // Bracket notation property access using numeric string literal value on type without property of that literal name + var gg = obj['1']; + var gg: any; + + // Bracket notation property access using numeric value on type with numeric index signature + var hh = numIndex[3.0]; + var hh: string; + + // Bracket notation property access using enum value on type with numeric index signature + var ii = numIndex[Compass.South]; + var ii: string; + + // Bracket notation property access using value of type 'any' on type with numeric index signature + var jj = numIndex[anyVar]; + var jj: string; + + // Bracket notation property access using string value on type with numeric index signature + var kk = numIndex['what']; + var kk: any; + + // Bracket notation property access using value of other type on type with numeric index signature and no string index signature + var ll = numIndex[window]; // Error + ~~~~~~ +!!! Cannot find name 'window'. + + // Bracket notation property access using string value on type with string index signature and no numeric index signature + var mm = strIndex['N']; + var mm: Compass; + var mm2 = strIndex['zzz']; + var mm2: Compass; + + // Bracket notation property access using numeric value on type with string index signature and no numeric index signature + var nn = strIndex[10]; + var nn: Compass; + + // Bracket notation property access using enum value on type with string index signature and no numeric index signature + var oo = strIndex[Compass.East]; + var oo: Compass; + + // Bracket notation property access using value of type 'any' on type with string index signature and no numeric index signature + var pp = strIndex[null]; + var pp: Compass; + + // Bracket notation property access using numeric value on type with no index signatures + var qq = noIndex[123]; + var qq: any; + + // Bracket notation property access using string value on type with no index signatures + var rr = noIndex['zzzz']; + var rr: any; + + // Bracket notation property access using enum value on type with no index signatures + var ss = noIndex[Compass.South]; + var ss: any; + + // Bracket notation property access using value of type 'any' on type with no index signatures + var tt = noIndex[null]; + var tt: any; + + // Bracket notation property access using values of other types on type with no index signatures + var uu = noIndex[window]; // Error + ~~~~~~ +!!! Cannot find name 'window'. + + // Bracket notation property access using numeric value on type with numeric index signature and string index signature + var vv = noIndex[32]; + var vv: any; + + // Bracket notation property access using enum value on type with numeric index signature and string index signature + var ww = bothIndex[Compass.East]; + var ww: HTMLDivElement; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'HTMLDivElement'. + + // Bracket notation property access using value of type 'any' on type with numeric index signature and string index signature + var xx = bothIndex[null]; + var xx: HTMLDivElement; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'HTMLDivElement'. + + // Bracket notation property access using string value on type with numeric index signature and string index signature + var yy = bothIndex['foo']; + var yy: HTMLElement; + ~~~~~~~~~~~ +!!! Cannot find name 'HTMLElement'. + + // Bracket notation property access using numeric string value on type with numeric index signature and string index signature + var zz = bothIndex['1.0']; + var zz: HTMLElement; + ~~~~~~~~~~~ +!!! Cannot find name 'HTMLElement'. + + // Bracket notation property access using value of other type on type with numeric index signature and no string index signature and string index signature + var zzzz = bothIndex[window]; // Error + ~~~~~~ +!!! Cannot find name 'window'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js new file mode 100644 index 0000000000000..c560318566b0b --- /dev/null +++ b/tests/baselines/reference/propertyAccess.js @@ -0,0 +1,207 @@ +//// [propertyAccess.ts] +enum Compass { + North, South, East, West +} + +var numIndex: { [n: number]: string } = { 3: 'three', 'three': 'three' }; +var strIndex: { [n: string]: Compass } = { 'N': Compass.North, 'E': Compass.East }; +var bothIndex: + { + [n: string]: HTMLElement; + [m: number]: HTMLDivElement; + }; + +function noIndex() { } + +var obj = { + 10: 'ten', + x: 'hello', + y: 32, + z: { n: 'world', m: 15, o: () => false }, + 'literal property': 100 +}; +var anyVar: any = {}; + +// Assign to a property access +obj.y = 4; + +// Property access on value of type 'any' +anyVar.x = anyVar.y = obj.x = anyVar.z; + +// Dotted property access of property that exists +var aa = obj.x; + +// Dotted property access of property that exists on value's apparent type +var bb = obj.hasOwnProperty; + +// Dotted property access of property that doesn't exist on value's apparent type +var cc = obj.qqq; // error + +// Bracket notation property access using string literal value on type with property of that literal name +var dd = obj['literal property']; +var dd: number; + +// Bracket notation property access using string literal value on type without property of that literal name +var ee = obj['wa wa wa wa wa']; +var ee: any; + +// Bracket notation property access using numeric string literal value on type with property of that literal name +var ff = obj['10']; +var ff: string; + +// Bracket notation property access using numeric string literal value on type without property of that literal name +var gg = obj['1']; +var gg: any; + +// Bracket notation property access using numeric value on type with numeric index signature +var hh = numIndex[3.0]; +var hh: string; + +// Bracket notation property access using enum value on type with numeric index signature +var ii = numIndex[Compass.South]; +var ii: string; + +// Bracket notation property access using value of type 'any' on type with numeric index signature +var jj = numIndex[anyVar]; +var jj: string; + +// Bracket notation property access using string value on type with numeric index signature +var kk = numIndex['what']; +var kk: any; + +// Bracket notation property access using value of other type on type with numeric index signature and no string index signature +var ll = numIndex[window]; // Error + +// Bracket notation property access using string value on type with string index signature and no numeric index signature +var mm = strIndex['N']; +var mm: Compass; +var mm2 = strIndex['zzz']; +var mm2: Compass; + +// Bracket notation property access using numeric value on type with string index signature and no numeric index signature +var nn = strIndex[10]; +var nn: Compass; + +// Bracket notation property access using enum value on type with string index signature and no numeric index signature +var oo = strIndex[Compass.East]; +var oo: Compass; + +// Bracket notation property access using value of type 'any' on type with string index signature and no numeric index signature +var pp = strIndex[null]; +var pp: Compass; + +// Bracket notation property access using numeric value on type with no index signatures +var qq = noIndex[123]; +var qq: any; + +// Bracket notation property access using string value on type with no index signatures +var rr = noIndex['zzzz']; +var rr: any; + +// Bracket notation property access using enum value on type with no index signatures +var ss = noIndex[Compass.South]; +var ss: any; + +// Bracket notation property access using value of type 'any' on type with no index signatures +var tt = noIndex[null]; +var tt: any; + +// Bracket notation property access using values of other types on type with no index signatures +var uu = noIndex[window]; // Error + +// Bracket notation property access using numeric value on type with numeric index signature and string index signature +var vv = noIndex[32]; +var vv: any; + +// Bracket notation property access using enum value on type with numeric index signature and string index signature +var ww = bothIndex[Compass.East]; +var ww: HTMLDivElement; + +// Bracket notation property access using value of type 'any' on type with numeric index signature and string index signature +var xx = bothIndex[null]; +var xx: HTMLDivElement; + +// Bracket notation property access using string value on type with numeric index signature and string index signature +var yy = bothIndex['foo']; +var yy: HTMLElement; + +// Bracket notation property access using numeric string value on type with numeric index signature and string index signature +var zz = bothIndex['1.0']; +var zz: HTMLElement; + +// Bracket notation property access using value of other type on type with numeric index signature and no string index signature and string index signature +var zzzz = bothIndex[window]; // Error + +//// [propertyAccess.js] +var Compass; +(function (Compass) { + Compass[Compass["North"] = 0] = "North"; + Compass[Compass["South"] = 1] = "South"; + Compass[Compass["East"] = 2] = "East"; + Compass[Compass["West"] = 3] = "West"; +})(Compass || (Compass = {})); +var numIndex = { 3: 'three', 'three': 'three' }; +var strIndex = { 'N': 0 /* North */, 'E': 2 /* East */ }; +var bothIndex; +function noIndex() { +} +var obj = { + 10: 'ten', + x: 'hello', + y: 32, + z: { n: 'world', m: 15, o: function () { return false; } }, + 'literal property': 100 +}; +var anyVar = {}; +obj.y = 4; +anyVar.x = anyVar.y = obj.x = anyVar.z; +var aa = obj.x; +var bb = obj.hasOwnProperty; +var cc = obj.qqq; +var dd = obj['literal property']; +var dd; +var ee = obj['wa wa wa wa wa']; +var ee; +var ff = obj['10']; +var ff; +var gg = obj['1']; +var gg; +var hh = numIndex[3.0]; +var hh; +var ii = numIndex[1 /* South */]; +var ii; +var jj = numIndex[anyVar]; +var jj; +var kk = numIndex['what']; +var kk; +var ll = numIndex[window]; +var mm = strIndex['N']; +var mm; +var mm2 = strIndex['zzz']; +var mm2; +var nn = strIndex[10]; +var nn; +var oo = strIndex[2 /* East */]; +var oo; +var pp = strIndex[null]; +var pp; +var qq = noIndex[123]; +var qq; +var rr = noIndex['zzzz']; +var rr; +var ss = noIndex[1 /* South */]; +var ss; +var tt = noIndex[null]; +var tt; +var uu = noIndex[window]; +var vv = noIndex[32]; +var vv; +var ww = bothIndex[2 /* East */]; +var ww; +var xx = bothIndex[null]; +var xx; +var yy = bothIndex['foo']; +var yy; +var zz = bothIndex['1.0']; +var zz; +var zzzz = bothIndex[window]; diff --git a/tests/baselines/reference/propertyAccess1.errors.txt b/tests/baselines/reference/propertyAccess1.errors.txt new file mode 100644 index 0000000000000..d40640056c61c --- /dev/null +++ b/tests/baselines/reference/propertyAccess1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/propertyAccess1.ts (1 errors) ==== + var foo: { a: number; }; + foo.a = 4; + foo.b = 5; + ~ +!!! Property 'b' does not exist on type '{ a: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess1.js b/tests/baselines/reference/propertyAccess1.js new file mode 100644 index 0000000000000..698f0d020b5bc --- /dev/null +++ b/tests/baselines/reference/propertyAccess1.js @@ -0,0 +1,9 @@ +//// [propertyAccess1.ts] +var foo: { a: number; }; +foo.a = 4; +foo.b = 5; + +//// [propertyAccess1.js] +var foo; +foo.a = 4; +foo.b = 5; diff --git a/tests/baselines/reference/propertyAccess2.errors.txt b/tests/baselines/reference/propertyAccess2.errors.txt new file mode 100644 index 0000000000000..d8feabdc3aee2 --- /dev/null +++ b/tests/baselines/reference/propertyAccess2.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/propertyAccess2.ts (1 errors) ==== + var foo: number; + foo.toBAZ(); + ~~~~~ +!!! Property 'toBAZ' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess2.js b/tests/baselines/reference/propertyAccess2.js new file mode 100644 index 0000000000000..819c7476621be --- /dev/null +++ b/tests/baselines/reference/propertyAccess2.js @@ -0,0 +1,7 @@ +//// [propertyAccess2.ts] +var foo: number; +foo.toBAZ(); + +//// [propertyAccess2.js] +var foo; +foo.toBAZ(); diff --git a/tests/baselines/reference/propertyAccess3.errors.txt b/tests/baselines/reference/propertyAccess3.errors.txt new file mode 100644 index 0000000000000..658053d69a83d --- /dev/null +++ b/tests/baselines/reference/propertyAccess3.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/propertyAccess3.ts (1 errors) ==== + var foo: boolean; + foo.toBAZ(); + ~~~~~ +!!! Property 'toBAZ' does not exist on type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess3.js b/tests/baselines/reference/propertyAccess3.js new file mode 100644 index 0000000000000..f4b98f1a46d50 --- /dev/null +++ b/tests/baselines/reference/propertyAccess3.js @@ -0,0 +1,7 @@ +//// [propertyAccess3.ts] +var foo: boolean; +foo.toBAZ(); + +//// [propertyAccess3.js] +var foo; +foo.toBAZ(); diff --git a/tests/baselines/reference/propertyAccess4.errors.txt b/tests/baselines/reference/propertyAccess4.errors.txt new file mode 100644 index 0000000000000..a3edcd2643bc6 --- /dev/null +++ b/tests/baselines/reference/propertyAccess4.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/propertyAccess4.ts (1 errors) ==== + null.toBAZ(); + ~~~~~ +!!! Property 'toBAZ' does not exist on type 'null'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess4.js b/tests/baselines/reference/propertyAccess4.js new file mode 100644 index 0000000000000..886c19979ca99 --- /dev/null +++ b/tests/baselines/reference/propertyAccess4.js @@ -0,0 +1,5 @@ +//// [propertyAccess4.ts] +null.toBAZ(); + +//// [propertyAccess4.js] +null.toBAZ(); diff --git a/tests/baselines/reference/propertyAccess5.errors.txt b/tests/baselines/reference/propertyAccess5.errors.txt new file mode 100644 index 0000000000000..a79cbc8ce3cf3 --- /dev/null +++ b/tests/baselines/reference/propertyAccess5.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/propertyAccess5.ts (1 errors) ==== + undefined.toBAZ(); + ~~~~~ +!!! Property 'toBAZ' does not exist on type 'undefined'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess5.js b/tests/baselines/reference/propertyAccess5.js new file mode 100644 index 0000000000000..8d50f342364b8 --- /dev/null +++ b/tests/baselines/reference/propertyAccess5.js @@ -0,0 +1,5 @@ +//// [propertyAccess5.ts] +undefined.toBAZ(); + +//// [propertyAccess5.js] +undefined.toBAZ(); diff --git a/tests/baselines/reference/propertyAccess6.js b/tests/baselines/reference/propertyAccess6.js new file mode 100644 index 0000000000000..e6361dfcc9ee4 --- /dev/null +++ b/tests/baselines/reference/propertyAccess6.js @@ -0,0 +1,7 @@ +//// [propertyAccess6.ts] +var foo: any; +foo.bar = 4; + +//// [propertyAccess6.js] +var foo; +foo.bar = 4; diff --git a/tests/baselines/reference/propertyAccess7.js b/tests/baselines/reference/propertyAccess7.js new file mode 100644 index 0000000000000..47899bdf07160 --- /dev/null +++ b/tests/baselines/reference/propertyAccess7.js @@ -0,0 +1,7 @@ +//// [propertyAccess7.ts] +var foo: string; +foo.toUpperCase(); + +//// [propertyAccess7.js] +var foo; +foo.toUpperCase(); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js new file mode 100644 index 0000000000000..d3c358358e901 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js @@ -0,0 +1,61 @@ +//// [propertyAccessOnTypeParameterWithConstraints.ts] +// generic types should behave as if they have properties of their constraint type +// no errors expected + +class C { + f() { + var x: T; + var a = x['getDate'](); // number + return a + x.getDate(); + } +} + +var r = (new C()).f(); + +interface I { + foo: T; +} +var i: I; +var r2 = i.foo.getDate(); +var r2b = i.foo['getDate'](); + +var a: { + (): T; +} +var r3 = a().getDate(); +var r3b = a()['getDate'](); + +var b = { + foo: (x: T) => { + var a = x['getDate'](); // number + return a + x.getDate(); + } +} + +var r4 = b.foo(new Date()); + +//// [propertyAccessOnTypeParameterWithConstraints.js] +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['getDate'](); + return a + x.getDate(); + }; + return C; +})(); +var r = (new C()).f(); +var i; +var r2 = i.foo.getDate(); +var r2b = i.foo['getDate'](); +var a; +var r3 = a().getDate(); +var r3b = a()['getDate'](); +var b = { + foo: function (x) { + var a = x['getDate'](); + return a + x.getDate(); + } +}; +var r4 = b.foo(new Date()); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js new file mode 100644 index 0000000000000..a9cc407cae9f8 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -0,0 +1,140 @@ +//// [propertyAccessOnTypeParameterWithConstraints2.ts] +// generic types should behave as if they have properties of their constraint type + +class A { + foo(): string { return ''; } +} + +class B extends A { + bar(): string { + return ''; + } +} + +class C { + f() { + var x: U; + var a = x['foo'](); // should be string + return a + x.foo(); + } + + g(x: U) { + var a = x['foo'](); // should be string + return a + x.foo(); + } +} +//class C { +// f() { +// var x: U; +// var a = x['foo'](); // should be string +// return a + x.foo(); +// } + +// g(x: U) { +// var a = x['foo'](); // should be string +// return a + x.foo(); +// } +//} + +var r1 = (new C()).f(); +var r1b = (new C()).g(new B()); + +interface I { + foo: U; +} +//interface I { +// foo: U; +//} +var i: I; +var r2 = i.foo.foo(); +var r2b = i.foo['foo'](); + +var a: { + (): U; + (x: U): U; + (x: U, y: T): U; +} +//var a: { +// (): U; +// (x: U): U; +// (x: U, y: T): U; +//} +var r3 = a().foo(); +var r3b = a()['foo'](); +// parameter supplied for type argument inference to succeed +var aB = new B(); +var r3c = a(aB, aB).foo(); +var r3d = a(aB, aB)['foo'](); + +var b = { + foo: (x: U, y: T) => { + var a = x['foo'](); // should be string + return a + x.foo(); + } +} +//var b = { +// foo: (x: U, y: T) => { +// var a = x['foo'](); // should be string +// return a + x.foo(); +// } +//} + +var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, error + +//// [propertyAccessOnTypeParameterWithConstraints2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ''; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return ''; + }; + return B; +})(A); +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['foo'](); + return a + x.foo(); + }; + C.prototype.g = function (x) { + var a = x['foo'](); + return a + x.foo(); + }; + return C; +})(); +var r1 = (new C()).f(); +var r1b = (new C()).g(new B()); +var i; +var r2 = i.foo.foo(); +var r2b = i.foo['foo'](); +var a; +var r3 = a().foo(); +var r3b = a()['foo'](); +var aB = new B(); +var r3c = a(aB, aB).foo(); +var r3d = a(aB, aB)['foo'](); +var b = { + foo: function (x, y) { + var a = x['foo'](); + return a + x.foo(); + } +}; +var r4 = b.foo(aB, aB); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt new file mode 100644 index 0000000000000..e2218f6b60332 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt @@ -0,0 +1,69 @@ +==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts (6 errors) ==== + // generic types should behave as if they have properties of their constraint type + + class A { + foo(): string { return ''; } + } + + class B extends A { + bar(): string { + return ''; + } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + f() { + var x: T; + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } + + g(x: U) { + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } + } + + var r1a = (new C()).f(); + var r1b = (new C()).g(new B()); + + interface I { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo: T; + } + var i: I; + var r2 = i.foo.foo(); + var r2b = i.foo['foo'](); + + var a: { + (): T; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + (x: U): U; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint + ~~~ +!!! Property 'foo' does not exist on type '{}'. + var r3b = a()['foo'](); + // parameter supplied for type argument inference for U + var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo + var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo + + var b = { + foo: (x: T) => { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } + } + + var r4 = b.foo(new B()); // valid call to an invalid function \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js new file mode 100644 index 0000000000000..e3d28c5237684 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -0,0 +1,114 @@ +//// [propertyAccessOnTypeParameterWithConstraints3.ts] +// generic types should behave as if they have properties of their constraint type + +class A { + foo(): string { return ''; } +} + +class B extends A { + bar(): string { + return ''; + } +} + +class C { + f() { + var x: T; + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } + + g(x: U) { + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } +} + +var r1a = (new C()).f(); +var r1b = (new C()).g(new B()); + +interface I { + foo: T; +} +var i: I; +var r2 = i.foo.foo(); +var r2b = i.foo['foo'](); + +var a: { + (): T; + (x: U): U; +} +var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint +var r3b = a()['foo'](); +// parameter supplied for type argument inference for U +var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo +var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo + +var b = { + foo: (x: T) => { + // BUG 823818 + var a = x['foo'](); // should be string + return a + x.foo(); + } +} + +var r4 = b.foo(new B()); // valid call to an invalid function + +//// [propertyAccessOnTypeParameterWithConstraints3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ''; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return ''; + }; + return B; +})(A); +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['foo'](); + return a + x.foo(); + }; + C.prototype.g = function (x) { + var a = x['foo'](); + return a + x.foo(); + }; + return C; +})(); +var r1a = (new C()).f(); +var r1b = (new C()).g(new B()); +var i; +var r2 = i.foo.foo(); +var r2b = i.foo['foo'](); +var a; +var r3 = a().foo(); +var r3b = a()['foo'](); +var r3c = a(new B()).foo(); +var r3d = a(new B())['foo'](); +var b = { + foo: function (x) { + var a = x['foo'](); + return a + x.foo(); + } +}; +var r4 = b.foo(new B()); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.errors.txt new file mode 100644 index 0000000000000..b60bdc2717dd3 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints4.ts (4 errors) ==== + class C { + f() { + var x: T; + var a = x['notHere'](); // should be string + return a + x.notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type 'T'. + } + } + + var r = (new C()).f(); + + interface I { + foo: T; + } + var i: I; + var r2 = i.foo.notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type 'Date'. + var r2b = i.foo['notHere'](); + + var a: { + (): T; + } + var r3: string = a().notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type 'Date'. + var r3b: string = a()['notHere'](); + + var b = { + foo: (x: T): T => { + var a = x['notHere'](); // should be string + return a + x.notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type 'T'. + }, + bar: b.foo().notHere() + } + + var r4 = b.foo(new Date()); \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js new file mode 100644 index 0000000000000..05a0b9203b921 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js @@ -0,0 +1,60 @@ +//// [propertyAccessOnTypeParameterWithConstraints4.ts] +class C { + f() { + var x: T; + var a = x['notHere'](); // should be string + return a + x.notHere(); + } +} + +var r = (new C()).f(); + +interface I { + foo: T; +} +var i: I; +var r2 = i.foo.notHere(); +var r2b = i.foo['notHere'](); + +var a: { + (): T; +} +var r3: string = a().notHere(); +var r3b: string = a()['notHere'](); + +var b = { + foo: (x: T): T => { + var a = x['notHere'](); // should be string + return a + x.notHere(); + }, + bar: b.foo().notHere() +} + +var r4 = b.foo(new Date()); + +//// [propertyAccessOnTypeParameterWithConstraints4.js] +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['notHere'](); + return a + x.notHere(); + }; + return C; +})(); +var r = (new C()).f(); +var i; +var r2 = i.foo.notHere(); +var r2b = i.foo['notHere'](); +var a; +var r3 = a().notHere(); +var r3b = a()['notHere'](); +var b = { + foo: function (x) { + var a = x['notHere'](); + return a + x.notHere(); + }, + bar: b.foo().notHere() +}; +var r4 = b.foo(new Date()); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt new file mode 100644 index 0000000000000..87e22a267e5c4 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts (6 errors) ==== + class A { + foo(): string { return ''; } + } + + class B extends A { + bar(): string { + return ''; + } + } + + class C { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + f() { + var x: U; + var a = x['foo'](); // should be string + return a + x.foo() + x.notHere(); + } + } + + var r = (new C()).f(); + + interface I { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + foo: U; + } + var i: I; + var r2 = i.foo.notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type 'B'. + var r2b = i.foo['foo'](); + + var a: { + (): U; + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + } + // BUG 794164 + var r3: string = a().notHere(); + ~~~~~~~ +!!! Property 'notHere' does not exist on type '{}'. + var r3b: string = a()['foo'](); + + var b = { + foo: (x: U): U => { + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + var a = x['foo'](); // should be string + return a + x.notHere(); + }, + // BUG 794164 + bar: b.foo(1).notHere() + } + + var r4 = b.foo(new B()); // error after constraints above made illegal, doesn't matter \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js new file mode 100644 index 0000000000000..22d5af5071924 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -0,0 +1,96 @@ +//// [propertyAccessOnTypeParameterWithConstraints5.ts] +class A { + foo(): string { return ''; } +} + +class B extends A { + bar(): string { + return ''; + } +} + +class C { + f() { + var x: U; + var a = x['foo'](); // should be string + return a + x.foo() + x.notHere(); + } +} + +var r = (new C()).f(); + +interface I { + foo: U; +} +var i: I; +var r2 = i.foo.notHere(); +var r2b = i.foo['foo'](); + +var a: { + (): U; +} +// BUG 794164 +var r3: string = a().notHere(); +var r3b: string = a()['foo'](); + +var b = { + foo: (x: U): U => { + var a = x['foo'](); // should be string + return a + x.notHere(); + }, + // BUG 794164 + bar: b.foo(1).notHere() +} + +var r4 = b.foo(new B()); // error after constraints above made illegal, doesn't matter + +//// [propertyAccessOnTypeParameterWithConstraints5.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ''; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return ''; + }; + return B; +})(A); +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['foo'](); + return a + x.foo() + x.notHere(); + }; + return C; +})(); +var r = (new C()).f(); +var i; +var r2 = i.foo.notHere(); +var r2b = i.foo['foo'](); +var a; +var r3 = a().notHere(); +var r3b = a()['foo'](); +var b = { + foo: function (x) { + var a = x['foo'](); + return a + x.notHere(); + }, + bar: b.foo(1).notHere() +}; +var r4 = b.foo(new B()); diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js new file mode 100644 index 0000000000000..812186a24ba40 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js @@ -0,0 +1,58 @@ +//// [propertyAccessOnTypeParameterWithoutConstraints.ts] +class C { + f() { + var x: T; + var a = x['toString'](); // should be string + return a + x.toString(); + } +} + +var r = (new C()).f(); + +interface I { + foo: T; +} +var i: I; +var r2 = i.foo.toString(); +var r2b = i.foo['toString'](); + +var a: { + (): T; +} +var r3: string = a().toString(); +var r3b: string = a()['toString'](); + +var b = { + foo: (x: T) => { + var a = x['toString'](); // should be string + return a + x.toString(); + } +} + +var r4 = b.foo(1); + +//// [propertyAccessOnTypeParameterWithoutConstraints.js] +var C = (function () { + function C() { + } + C.prototype.f = function () { + var x; + var a = x['toString'](); + return a + x.toString(); + }; + return C; +})(); +var r = (new C()).f(); +var i; +var r2 = i.foo.toString(); +var r2b = i.foo['toString'](); +var a; +var r3 = a().toString(); +var r3b = a()['toString'](); +var b = { + foo: function (x) { + var a = x['toString'](); + return a + x.toString(); + } +}; +var r4 = b.foo(1); diff --git a/tests/baselines/reference/propertyAccessibility1.errors.txt b/tests/baselines/reference/propertyAccessibility1.errors.txt new file mode 100644 index 0000000000000..955a951b17c16 --- /dev/null +++ b/tests/baselines/reference/propertyAccessibility1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/propertyAccessibility1.ts (1 errors) ==== + class Foo { + private privProp = 0; + } + var f = new Foo(); + f.privProp; + ~~~~~~~~~~ +!!! Property 'Foo.privProp' is inaccessible. + \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessibility1.js b/tests/baselines/reference/propertyAccessibility1.js new file mode 100644 index 0000000000000..9c4d0eb05827a --- /dev/null +++ b/tests/baselines/reference/propertyAccessibility1.js @@ -0,0 +1,17 @@ +//// [propertyAccessibility1.ts] +class Foo { + private privProp = 0; +} +var f = new Foo(); +f.privProp; + + +//// [propertyAccessibility1.js] +var Foo = (function () { + function Foo() { + this.privProp = 0; + } + return Foo; +})(); +var f = new Foo(); +f.privProp; diff --git a/tests/baselines/reference/propertyAccessibility2.js b/tests/baselines/reference/propertyAccessibility2.js new file mode 100644 index 0000000000000..3009a984186b6 --- /dev/null +++ b/tests/baselines/reference/propertyAccessibility2.js @@ -0,0 +1,15 @@ +//// [propertyAccessibility2.ts] +class C { + private static x = 1; +} +var c = C.x; + + +//// [propertyAccessibility2.js] +var C = (function () { + function C() { + } + C.x = 1; + return C; +})(); +var c = C.x; diff --git a/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt b/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt new file mode 100644 index 0000000000000..95c9b7148535e --- /dev/null +++ b/tests/baselines/reference/propertyAndAccessorWithSameName.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndAccessorWithSameName.ts (8 errors) ==== + class C { + x: number; + get x() { // error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + return 1; + } + } + + class D { + x: number; + set x(v) { } // error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + } + + class E { + private x: number; + get x() { // error + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + return 1; + } + set x(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/propertyAndFunctionWithSameName.errors.txt b/tests/baselines/reference/propertyAndFunctionWithSameName.errors.txt new file mode 100644 index 0000000000000..3e181aadc53a2 --- /dev/null +++ b/tests/baselines/reference/propertyAndFunctionWithSameName.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyAndFunctionWithSameName.ts (2 errors) ==== + class C { + x: number; + x() { // error + ~ +!!! Duplicate identifier 'x'. + return 1; + } + } + + class D { + x: number; + x(v) { } // error + ~ +!!! Duplicate identifier 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/propertyAndFunctionWithSameName.js b/tests/baselines/reference/propertyAndFunctionWithSameName.js new file mode 100644 index 0000000000000..5b9d159339ef1 --- /dev/null +++ b/tests/baselines/reference/propertyAndFunctionWithSameName.js @@ -0,0 +1,29 @@ +//// [propertyAndFunctionWithSameName.ts] +class C { + x: number; + x() { // error + return 1; + } +} + +class D { + x: number; + x(v) { } // error +} + +//// [propertyAndFunctionWithSameName.js] +var C = (function () { + function C() { + } + C.prototype.x = function () { + return 1; + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.x = function (v) { + }; + return D; +})(); diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt new file mode 100644 index 0000000000000..66f3e5037bc1b --- /dev/null +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/propertyAssignment.ts (3 errors) ==== + + + var foo1: { new ():any; } + var bar1: { x : number; } + + var foo2: { [index]; } // should be an error + ~~~~~ +!!! An index signature parameter must have a type annotation. + var bar2: { x : number; } + + var foo3: { ():void; } + var bar3: { x : number; } + + + + foo1 = bar1; // should be an error + ~~~~ +!!! Type '{ x: number; }' is not assignable to type 'new () => any'. + foo2 = bar2; + foo3 = bar3; // should be an error + ~~~~ +!!! Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt new file mode 100644 index 0000000000000..c4ff269802dfe --- /dev/null +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts (2 errors) ==== + /// + import m1 = require('mod1'); + import m2 = require('mod2'); + var x: m1.Foo; + var x: m2.Foo; // Should be error (mod1.Foo !== mod2.Foo) + ~ +!!! Subsequent variable declarations must have the same type. Variable 'x' must be of type 'Foo', but here has type 'Foo'. + class Foo1 { + private n; + } + class Foo2 { + private n; + } + var y: Foo1; + var y: Foo2; + ~ +!!! Subsequent variable declarations must have the same type. Variable 'y' must be of type 'Foo1', but here has type 'Foo2'. +==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_0.ts (0 errors) ==== + declare module 'mod1' { + class Foo { + private n; + } + } + declare module 'mod2' { + class Foo { + private n; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js new file mode 100644 index 0000000000000..84c13dd1416ee --- /dev/null +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/propertyIdentityWithPrivacyMismatch.ts] //// + +//// [propertyIdentityWithPrivacyMismatch_0.ts] +declare module 'mod1' { + class Foo { + private n; + } +} +declare module 'mod2' { + class Foo { + private n; + } +} + +//// [propertyIdentityWithPrivacyMismatch_1.ts] +/// +import m1 = require('mod1'); +import m2 = require('mod2'); +var x: m1.Foo; +var x: m2.Foo; // Should be error (mod1.Foo !== mod2.Foo) +class Foo1 { + private n; +} +class Foo2 { + private n; +} +var y: Foo1; +var y: Foo2; + +//// [propertyIdentityWithPrivacyMismatch_0.js] +//// [propertyIdentityWithPrivacyMismatch_1.js] +define(["require", "exports"], function (require, exports) { + var x; + var x; + var Foo1 = (function () { + function Foo1() { + } + return Foo1; + })(); + var Foo2 = (function () { + function Foo2() { + } + return Foo2; + })(); + var y; + var y; +}); diff --git a/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js b/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js new file mode 100644 index 0000000000000..f0d77deb18596 --- /dev/null +++ b/tests/baselines/reference/propertyNameWithoutTypeAnnotation.js @@ -0,0 +1,37 @@ +//// [propertyNameWithoutTypeAnnotation.ts] +class C { + foo; +} + +interface I { + foo; +} + +var a: { + foo; +} + +var b = { + foo: null +} + +// These should all be of type 'any' +var r1 = (new C()).foo; +var r2 = (null).foo; +var r3 = a.foo; +var r4 = b.foo; + +//// [propertyNameWithoutTypeAnnotation.js] +var C = (function () { + function C() { + } + return C; +})(); +var a; +var b = { + foo: null +}; +var r1 = (new C()).foo; +var r2 = null.foo; +var r3 = a.foo; +var r4 = b.foo; diff --git a/tests/baselines/reference/propertyNamedPrototype.errors.txt b/tests/baselines/reference/propertyNamedPrototype.errors.txt new file mode 100644 index 0000000000000..0944c2454ff2e --- /dev/null +++ b/tests/baselines/reference/propertyNamedPrototype.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/propertyNamedPrototype.ts (1 errors) ==== + class C { + prototype: number; // ok + static prototype: C; // error + ~~~~~~~~~ +!!! Duplicate identifier 'prototype'. + } \ No newline at end of file diff --git a/tests/baselines/reference/propertyNamedPrototype.js b/tests/baselines/reference/propertyNamedPrototype.js new file mode 100644 index 0000000000000..2af5e01de193d --- /dev/null +++ b/tests/baselines/reference/propertyNamedPrototype.js @@ -0,0 +1,12 @@ +//// [propertyNamedPrototype.ts] +class C { + prototype: number; // ok + static prototype: C; // error +} + +//// [propertyNamedPrototype.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/propertyNamesOfReservedWords.js b/tests/baselines/reference/propertyNamesOfReservedWords.js new file mode 100644 index 0000000000000..471787f43ee13 --- /dev/null +++ b/tests/baselines/reference/propertyNamesOfReservedWords.js @@ -0,0 +1,361 @@ +//// [propertyNamesOfReservedWords.ts] +class C { + abstract; + as; + boolean; + break; + byte; + case; + catch; + char; + class; + continue; + const; + debugger; + default; + delete; + do; + double; + else; + enum; + export; + extends; + false; + final; + finally; + float; + for; + function; + goto; + if; + implements; + import; + in; + instanceof; + int; + interface; + is; + long; + namespace; + native; + new; + null; + package; + private; + protected; + public; + return; + short; + static; + super; + switch; + synchronized; + this; + throw; + throws; + transient; + true; + try; + typeof; + use; + var; + void; + volatile; + while; + with; +} +var c: C; +var r1 = c.abstract; +var r2 = c.as; + +interface I { + abstract; + as; + boolean; + break; + byte; + case; + catch; + char; + class; + continue; + const; + debugger; + default; + delete; + do; + double; + else; + enum; + export; + extends; + false; + final; + finally; + float; + for; + function; + goto; + if; + implements; + import; + in; + instanceof; + int; + interface; + is; + long; + namespace; + native; + new; + null; + package; + private; + protected; + public; + return; + short; + static; + super; + switch; + synchronized; + this; + throw; + throws; + transient; + true; + try; + typeof; + use; + var; + void; + volatile; + while; + with; +} + +var i: I; +var r3 = i.abstract; +var r4 = i.as; + +var a: { + abstract; + as; + boolean; + break; + byte; + case; + catch; + char; + class; + continue; + const; + debugger; + default; + delete; + do; + double; + else; + enum; + export; + extends; + false; + final; + finally; + float; + for; + function; + goto; + if; + implements; + import; + in; + instanceof; + int; + interface; + is; + long; + namespace; + native; + new; + null; + package; + private; + protected; + public; + return; + short; + static; + super; + switch; + synchronized; + this; + throw; + throws; + transient; + true; + try; + typeof; + use; + var; + void; + volatile; + while; + with; +} + +var r5 = a.abstract; +var r6 = a.as; + +enum E { + abstract, + as, + boolean, + break, + byte, + case, + catch, + char, + class, + continue, + const, + debugger, + default, + delete, + do, + double, + else, + enum, + export, + extends, + false, + final, + finally, + float, + for, + function, + goto, + if, + implements, + import, + in, + instanceof, + int, + interface, + is, + long, + namespace, + native, + new, + null, + package, + private, + protected, + public, + return, + short, + static, + super, + switch, + synchronized, + this, + throw, + throws, + transient, + true, + try, + typeof, + use, + var, + void, + volatile, + while, + with, +} + +var r7 = E.abstract; +var r8 = E.as; + +//// [propertyNamesOfReservedWords.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r1 = c.abstract; +var r2 = c.as; +var i; +var r3 = i.abstract; +var r4 = i.as; +var a; +var r5 = a.abstract; +var r6 = a.as; +var E; +(function (E) { + E[E["abstract"] = 0] = "abstract"; + E[E["as"] = 1] = "as"; + E[E["boolean"] = 2] = "boolean"; + E[E["break"] = 3] = "break"; + E[E["byte"] = 4] = "byte"; + E[E["case"] = 5] = "case"; + E[E["catch"] = 6] = "catch"; + E[E["char"] = 7] = "char"; + E[E["class"] = 8] = "class"; + E[E["continue"] = 9] = "continue"; + E[E["const"] = 10] = "const"; + E[E["debugger"] = 11] = "debugger"; + E[E["default"] = 12] = "default"; + E[E["delete"] = 13] = "delete"; + E[E["do"] = 14] = "do"; + E[E["double"] = 15] = "double"; + E[E["else"] = 16] = "else"; + E[E["enum"] = 17] = "enum"; + E[E["export"] = 18] = "export"; + E[E["extends"] = 19] = "extends"; + E[E["false"] = 20] = "false"; + E[E["final"] = 21] = "final"; + E[E["finally"] = 22] = "finally"; + E[E["float"] = 23] = "float"; + E[E["for"] = 24] = "for"; + E[E["function"] = 25] = "function"; + E[E["goto"] = 26] = "goto"; + E[E["if"] = 27] = "if"; + E[E["implements"] = 28] = "implements"; + E[E["import"] = 29] = "import"; + E[E["in"] = 30] = "in"; + E[E["instanceof"] = 31] = "instanceof"; + E[E["int"] = 32] = "int"; + E[E["interface"] = 33] = "interface"; + E[E["is"] = 34] = "is"; + E[E["long"] = 35] = "long"; + E[E["namespace"] = 36] = "namespace"; + E[E["native"] = 37] = "native"; + E[E["new"] = 38] = "new"; + E[E["null"] = 39] = "null"; + E[E["package"] = 40] = "package"; + E[E["private"] = 41] = "private"; + E[E["protected"] = 42] = "protected"; + E[E["public"] = 43] = "public"; + E[E["return"] = 44] = "return"; + E[E["short"] = 45] = "short"; + E[E["static"] = 46] = "static"; + E[E["super"] = 47] = "super"; + E[E["switch"] = 48] = "switch"; + E[E["synchronized"] = 49] = "synchronized"; + E[E["this"] = 50] = "this"; + E[E["throw"] = 51] = "throw"; + E[E["throws"] = 52] = "throws"; + E[E["transient"] = 53] = "transient"; + E[E["true"] = 54] = "true"; + E[E["try"] = 55] = "try"; + E[E["typeof"] = 56] = "typeof"; + E[E["use"] = 57] = "use"; + E[E["var"] = 58] = "var"; + E[E["void"] = 59] = "void"; + E[E["volatile"] = 60] = "volatile"; + E[E["while"] = 61] = "while"; + E[E["with"] = 62] = "with"; +})(E || (E = {})); +var r7 = 0 /* abstract */; +var r8 = 1 /* as */; diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.js b/tests/baselines/reference/propertyNamesWithStringLiteral.js new file mode 100644 index 0000000000000..3b22a44eddb9c --- /dev/null +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.js @@ -0,0 +1,31 @@ +//// [propertyNamesWithStringLiteral.ts] +class _Color { + a: number; r: number; g: number; b: number; +} + +interface NamedColors { + azure: _Color; + "blue": _Color; + "pale blue": _Color; +} +module Color { + export var namedColors: NamedColors; +} +var a = Color.namedColors["azure"]; +var a = Color.namedColors.blue; // Should not error +var a = Color.namedColors["pale blue"]; // should not error + + +//// [propertyNamesWithStringLiteral.js] +var _Color = (function () { + function _Color() { + } + return _Color; +})(); +var Color; +(function (Color) { + Color.namedColors; +})(Color || (Color = {})); +var a = Color.namedColors["azure"]; +var a = Color.namedColors.blue; +var a = Color.namedColors["pale blue"]; diff --git a/tests/baselines/reference/propertyOrdering.errors.txt b/tests/baselines/reference/propertyOrdering.errors.txt new file mode 100644 index 0000000000000..186510d3e2a5c --- /dev/null +++ b/tests/baselines/reference/propertyOrdering.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/compiler/propertyOrdering.ts (4 errors) ==== + class Foo { + constructor(store: string) { } + public foo() { + return this._store.length; // shouldn't be an error + } + public _store = store; // no repro if this is first line in class body + ~~~~~ +!!! Cannot find name 'store'. + + + public bar() { return this.store; } // should be an error + ~~~~~ +!!! Property 'store' does not exist on type 'Foo'. + + } + + class Bar { + public foo() { + + return this._store.length; // shouldn't be an error + ~~~~~~ +!!! Property '_store' does not exist on type 'Bar'. + + } + constructor(store: string) { + this._store = store; + ~~~~~~ +!!! Property '_store' does not exist on type 'Bar'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/propertyOrdering.js b/tests/baselines/reference/propertyOrdering.js new file mode 100644 index 0000000000000..0bd713063829b --- /dev/null +++ b/tests/baselines/reference/propertyOrdering.js @@ -0,0 +1,47 @@ +//// [propertyOrdering.ts] +class Foo { + constructor(store: string) { } + public foo() { + return this._store.length; // shouldn't be an error + } + public _store = store; // no repro if this is first line in class body + + + public bar() { return this.store; } // should be an error + +} + +class Bar { + public foo() { + + return this._store.length; // shouldn't be an error + + } + constructor(store: string) { + this._store = store; + } +} + + +//// [propertyOrdering.js] +var Foo = (function () { + function Foo(store) { + this._store = store; + } + Foo.prototype.foo = function () { + return this._store.length; + }; + Foo.prototype.bar = function () { + return this.store; + }; + return Foo; +})(); +var Bar = (function () { + function Bar(store) { + this._store = store; + } + Bar.prototype.foo = function () { + return this._store.length; + }; + return Bar; +})(); diff --git a/tests/baselines/reference/propertyOrdering2.errors.txt b/tests/baselines/reference/propertyOrdering2.errors.txt new file mode 100644 index 0000000000000..b3db954194bfc --- /dev/null +++ b/tests/baselines/reference/propertyOrdering2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/propertyOrdering2.ts (1 errors) ==== + class Foo { + constructor(public x, y) { } + foo() { + var a = this.x; + return this.y; + ~ +!!! Property 'y' does not exist on type 'Foo'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/propertyOrdering2.js b/tests/baselines/reference/propertyOrdering2.js new file mode 100644 index 0000000000000..4c1cfc63d5c36 --- /dev/null +++ b/tests/baselines/reference/propertyOrdering2.js @@ -0,0 +1,21 @@ +//// [propertyOrdering2.ts] +class Foo { + constructor(public x, y) { } + foo() { + var a = this.x; + return this.y; + } +} + + +//// [propertyOrdering2.js] +var Foo = (function () { + function Foo(x, y) { + this.x = x; + } + Foo.prototype.foo = function () { + var a = this.x; + return this.y; + }; + return Foo; +})(); diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt new file mode 100644 index 0000000000000..35d6c5dcc941d --- /dev/null +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/propertyParameterWithQuestionMark.ts (2 errors) ==== + class C { + constructor(public x?) { } + } + + // x should not be an optional property + var v: C = {}; // Should fail + ~~~~~~~~~ +!!! Type '{}' is not assignable to type 'C': +!!! Property 'x' is missing in type '{}'. + var v2: { x? } + v = v2; // Should fail + ~ +!!! Type '{ x?: any; }' is not assignable to type 'C': +!!! Required property 'x' cannot be reimplemented with optional property in '{ x?: any; }'. + var v3: { x } = new C; // Should succeed \ No newline at end of file diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.js b/tests/baselines/reference/propertyParameterWithQuestionMark.js new file mode 100644 index 0000000000000..754fe05adea29 --- /dev/null +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.js @@ -0,0 +1,22 @@ +//// [propertyParameterWithQuestionMark.ts] +class C { + constructor(public x?) { } +} + +// x should not be an optional property +var v: C = {}; // Should fail +var v2: { x? } +v = v2; // Should fail +var v3: { x } = new C; // Should succeed + +//// [propertyParameterWithQuestionMark.js] +var C = (function () { + function C(x) { + this.x = x; + } + return C; +})(); +var v = {}; +var v2; +v = v2; +var v3 = new C; diff --git a/tests/baselines/reference/propertySignatures.errors.txt b/tests/baselines/reference/propertySignatures.errors.txt new file mode 100644 index 0000000000000..66699c610f157 --- /dev/null +++ b/tests/baselines/reference/propertySignatures.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/propertySignatures.ts (2 errors) ==== + // Should be error - duplicate identifiers + var foo1: { a:string; a: string; }; + ~ +!!! Duplicate identifier 'a'. + + // Should be OK + var foo2: { a; }; + foo2.a = 2; + foo2.a = "0"; + + // Should be error + var foo3: { (): string; (): string; }; + + // Should be OK + var foo4: { (): void; }; + var test = foo(); + ~~~ +!!! Cannot find name 'foo'. + + // Should be OK + var foo5: {();}; + var test = foo5(); + test.bar = 2; + \ No newline at end of file diff --git a/tests/baselines/reference/propertySignatures.js b/tests/baselines/reference/propertySignatures.js new file mode 100644 index 0000000000000..23cfb04085881 --- /dev/null +++ b/tests/baselines/reference/propertySignatures.js @@ -0,0 +1,33 @@ +//// [propertySignatures.ts] +// Should be error - duplicate identifiers +var foo1: { a:string; a: string; }; + +// Should be OK +var foo2: { a; }; +foo2.a = 2; +foo2.a = "0"; + +// Should be error +var foo3: { (): string; (): string; }; + +// Should be OK +var foo4: { (): void; }; +var test = foo(); + +// Should be OK +var foo5: {();}; +var test = foo5(); +test.bar = 2; + + +//// [propertySignatures.js] +var foo1; +var foo2; +foo2.a = 2; +foo2.a = "0"; +var foo3; +var foo4; +var test = foo(); +var foo5; +var test = foo5(); +test.bar = 2; diff --git a/tests/baselines/reference/propertyWrappedInTry.errors.txt b/tests/baselines/reference/propertyWrappedInTry.errors.txt new file mode 100644 index 0000000000000..f3a4c14f538b4 --- /dev/null +++ b/tests/baselines/reference/propertyWrappedInTry.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ==== + class Foo { + + try { + ~~~ +!!! Unexpected token. A constructor, method, accessor, or property was expected. + + public bar = someInitThatMightFail(); + ~~~~~~ +!!! Statement expected. + ~~~ +!!! Cannot find name 'bar'. + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'someInitThatMightFail'. + + } catch(e) {} + + + + public baz() { + ~~~~~~ +!!! Declaration or statement expected. + ~ +!!! ';' expected. + ~~~ +!!! Cannot find name 'baz'. + + return this.bar; // doesn't get rewritten to Foo.bar. + ~~~~~~~~~~~~~~~~ +!!! 'return' statement has no containing function. + + } + + } + ~ +!!! Declaration or statement expected. + + \ No newline at end of file diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.js b/tests/baselines/reference/protoAsIndexInIndexExpression.js new file mode 100644 index 0000000000000..76e30a2b7f954 --- /dev/null +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.js @@ -0,0 +1,39 @@ +//// [tests/cases/compiler/protoAsIndexInIndexExpression.ts] //// + +//// [protoAsIndexInIndexExpression_0.ts] +export var x; + +//// [protoAsIndexInIndexExpression_1.ts] +/// +var EntityPrototype = undefined; +var WorkspacePrototype = { + serialize: function (): any { + } +}; +WorkspacePrototype['__proto__'] = EntityPrototype; + +var o = { + "__proto__": 0 +}; +class C { + "__proto__" = 0; +} + +//// [protoAsIndexInIndexExpression_0.js] +exports.x; +//// [protoAsIndexInIndexExpression_1.js] +var EntityPrototype = undefined; +var WorkspacePrototype = { + serialize: function () { + } +}; +WorkspacePrototype['__proto__'] = EntityPrototype; +var o = { + "__proto__": 0 +}; +var C = (function () { + function C() { + this["__proto__"] = 0; + } + return C; +})(); diff --git a/tests/baselines/reference/protoAssignment.errors.txt b/tests/baselines/reference/protoAssignment.errors.txt new file mode 100644 index 0000000000000..42d9775b598ec --- /dev/null +++ b/tests/baselines/reference/protoAssignment.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/protoAssignment.ts (1 errors) ==== + + interface Number extends Comparable { + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'Comparable'. + + compareTo(other: number); + + } + + Number.prototype.compareTo = function (other: number) { + + return this.valueOf() == other; + + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/protoAssignment.js b/tests/baselines/reference/protoAssignment.js new file mode 100644 index 0000000000000..a1fe983d29604 --- /dev/null +++ b/tests/baselines/reference/protoAssignment.js @@ -0,0 +1,21 @@ +//// [protoAssignment.ts] + +interface Number extends Comparable { + + compareTo(other: number); + +} + +Number.prototype.compareTo = function (other: number) { + + return this.valueOf() == other; + +} + + + + +//// [protoAssignment.js] +Number.prototype.compareTo = function (other) { + return this.valueOf() == other; +}; diff --git a/tests/baselines/reference/protoInIndexer.js b/tests/baselines/reference/protoInIndexer.js new file mode 100644 index 0000000000000..e36a0c769bcab --- /dev/null +++ b/tests/baselines/reference/protoInIndexer.js @@ -0,0 +1,14 @@ +//// [protoInIndexer.ts] +class X { + constructor() { + this['__proto__'] = null; // used to cause ICE + } +} + +//// [protoInIndexer.js] +var X = (function () { + function X() { + this['__proto__'] = null; + } + return X; +})(); diff --git a/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js b/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js new file mode 100644 index 0000000000000..34681e76f8744 --- /dev/null +++ b/tests/baselines/reference/prototypeInstantiatedWithBaseConstraint.js @@ -0,0 +1,14 @@ +//// [prototypeInstantiatedWithBaseConstraint.ts] +class C { + x: T; +} + +C.prototype.x.boo; // No error, prototype is instantiated to any + +//// [prototypeInstantiatedWithBaseConstraint.js] +var C = (function () { + function C() { + } + return C; +})(); +C.prototype.x.boo; diff --git a/tests/baselines/reference/prototypeOnConstructorFunctions.js b/tests/baselines/reference/prototypeOnConstructorFunctions.js new file mode 100644 index 0000000000000..d2e5ddde9251f --- /dev/null +++ b/tests/baselines/reference/prototypeOnConstructorFunctions.js @@ -0,0 +1,15 @@ +//// [prototypeOnConstructorFunctions.ts] +interface I1 { + const: new (options?, element?) => any; +} + + +var i: I1; + + +i.const.prototype.prop = "yo"; + + +//// [prototypeOnConstructorFunctions.js] +var i; +i.const.prototype.prop = "yo"; diff --git a/tests/baselines/reference/prototypes.errors.txt b/tests/baselines/reference/prototypes.errors.txt new file mode 100644 index 0000000000000..35d0accddd345 --- /dev/null +++ b/tests/baselines/reference/prototypes.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/prototypes.ts (1 errors) ==== + Object.prototype; // ok + new Object().prototype; // error + ~~~~~~~~~ +!!! Property 'prototype' does not exist on type 'Object'. + function f() {} + f.prototype; \ No newline at end of file diff --git a/tests/baselines/reference/prototypes.js b/tests/baselines/reference/prototypes.js new file mode 100644 index 0000000000000..423c6bbfabd47 --- /dev/null +++ b/tests/baselines/reference/prototypes.js @@ -0,0 +1,12 @@ +//// [prototypes.ts] +Object.prototype; // ok +new Object().prototype; // error +function f() {} +f.prototype; + +//// [prototypes.js] +Object.prototype; +new Object().prototype; +function f() { +} +f.prototype; diff --git a/tests/baselines/reference/publicIndexer.errors.txt b/tests/baselines/reference/publicIndexer.errors.txt new file mode 100644 index 0000000000000..eda261440c6fb --- /dev/null +++ b/tests/baselines/reference/publicIndexer.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/classes/indexMemberDeclarations/publicIndexer.ts (3 errors) ==== + // public indexers not allowed + + class C { + public [x: string]: string; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class D { + public [x: number]: string; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class E { + public [x: string]: T; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } \ No newline at end of file diff --git a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt new file mode 100644 index 0000000000000..17771c365c5fe --- /dev/null +++ b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts (1 errors) ==== + interface Qux { + Bar: number; + } + class Foo implements Qux { + ~~~ +!!! Class 'Foo' incorrectly implements interface 'Qux': +!!! Private property 'Bar' cannot be reimplemented. + private Bar: number; + } + \ No newline at end of file diff --git a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js new file mode 100644 index 0000000000000..7c6202eec30e9 --- /dev/null +++ b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.js @@ -0,0 +1,15 @@ +//// [publicMemberImplementedAsPrivateInDerivedClass.ts] +interface Qux { + Bar: number; +} +class Foo implements Qux { + private Bar: number; +} + + +//// [publicMemberImplementedAsPrivateInDerivedClass.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); diff --git a/tests/baselines/reference/qualifiedModuleLocals.errors.txt b/tests/baselines/reference/qualifiedModuleLocals.errors.txt new file mode 100644 index 0000000000000..2f16c8c771569 --- /dev/null +++ b/tests/baselines/reference/qualifiedModuleLocals.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/qualifiedModuleLocals.ts (1 errors) ==== + module A { + + function b() {} + + export function a(){ A.b(); } // A.b should be an unresolved symbol error + ~ +!!! Property 'b' does not exist on type 'typeof A'. + + } + + A.a(); + \ No newline at end of file diff --git a/tests/baselines/reference/qualifiedModuleLocals.js b/tests/baselines/reference/qualifiedModuleLocals.js new file mode 100644 index 0000000000000..9bdfe20d53a75 --- /dev/null +++ b/tests/baselines/reference/qualifiedModuleLocals.js @@ -0,0 +1,23 @@ +//// [qualifiedModuleLocals.ts] +module A { + + function b() {} + + export function a(){ A.b(); } // A.b should be an unresolved symbol error + +} + +A.a(); + + +//// [qualifiedModuleLocals.js] +var A; +(function (A) { + function b() { + } + function a() { + A.b(); + } + A.a = a; +})(A || (A = {})); +A.a(); diff --git a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.js b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.js new file mode 100644 index 0000000000000..5bb8ba36751a2 --- /dev/null +++ b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.js @@ -0,0 +1,18 @@ +//// [qualifiedName_ImportDeclarations-entity-names-referencing-a-var.ts] +module Alpha { + export var x = 100; +} + +module Beta { + import p = Alpha.x; +} + + +var x = Alpha.x + +//// [qualifiedName_ImportDeclarations-entity-names-referencing-a-var.js] +var Alpha; +(function (Alpha) { + Alpha.x = 100; +})(Alpha || (Alpha = {})); +var x = Alpha.x; diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt new file mode 100644 index 0000000000000..16a726f7be24a --- /dev/null +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts (1 errors) ==== + module Alpha { + export var x = 100; + } + + class Beta extends Alpha.x { + ~~~~~~~ +!!! Module 'Alpha' has no exported member 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js new file mode 100644 index 0000000000000..a8dc4ebba2160 --- /dev/null +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js @@ -0,0 +1,26 @@ +//// [qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts] +module Alpha { + export var x = 100; +} + +class Beta extends Alpha.x { +} + +//// [qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Alpha; +(function (Alpha) { + Alpha.x = 100; +})(Alpha || (Alpha = {})); +var Beta = (function (_super) { + __extends(Beta, _super); + function Beta() { + _super.apply(this, arguments); + } + return Beta; +})(Alpha.x); diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt new file mode 100644 index 0000000000000..2228368a5b742 --- /dev/null +++ b/tests/baselines/reference/qualify.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/compiler/qualify.ts (8 errors) ==== + module M { + export var m=0; + export module N { + export var n=1; + } + } + + module M { + export module N { + var y=m; + var x=n+y; + } + } + + + module T { + export interface I { + p; + } + export module U { + var z:I=3; + ~~~~~ +!!! Type 'number' is not assignable to type 'I': +!!! Property 'p' is missing in type 'Number'. + export interface I2 { + q; + } + } + } + + module Peer { + export module U2 { + var z:T.U.I2=3; + ~~~~~~~~~~ +!!! Type 'number' is not assignable to type 'I2': +!!! Property 'q' is missing in type 'Number'. + } + } + + module Everest { + export module K1 { + export interface I3 { + zeep; + } + } + export module K2 { + export interface I4 { + z; + } + var v1:I4; + var v2:K1.I3=v1; + ~~~~~~~~~~~ +!!! Type 'I4' is not assignable to type 'I3': +!!! Property 'zeep' is missing in type 'I4'. + var v3:K1.I3[]=v1; + ~~~~~~~~~~~~~ +!!! Type 'I4' is not assignable to type 'I3[]': +!!! Property 'concat' is missing in type 'I4'. + var v4:()=>K1.I3=v1; + ~~~~~~~~~~~~~~~ +!!! Type 'I4' is not assignable to type '() => I3'. + var v5:(k:K1.I3)=>void=v1; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'I4' is not assignable to type '(k: I3) => void'. + var v6:{k:K1.I3;}=v1; + ~~~~~~~~~~~~~~~~ +!!! Type 'I4' is not assignable to type '{ k: I3; }': +!!! Property 'k' is missing in type 'I4'. + } + } + + interface I { + k; + } + + var y:I; + var x:T.I=y; + ~~~~~~~ +!!! Type 'I' is not assignable to type 'I': +!!! Property 'p' is missing in type 'I'. + + \ No newline at end of file diff --git a/tests/baselines/reference/qualify.js b/tests/baselines/reference/qualify.js new file mode 100644 index 0000000000000..93cd15af3401e --- /dev/null +++ b/tests/baselines/reference/qualify.js @@ -0,0 +1,107 @@ +//// [qualify.ts] +module M { + export var m=0; + export module N { + export var n=1; + } +} + +module M { + export module N { + var y=m; + var x=n+y; + } +} + + +module T { + export interface I { + p; + } + export module U { + var z:I=3; + export interface I2 { + q; + } + } +} + +module Peer { + export module U2 { + var z:T.U.I2=3; + } +} + +module Everest { + export module K1 { + export interface I3 { + zeep; + } + } + export module K2 { + export interface I4 { + z; + } + var v1:I4; + var v2:K1.I3=v1; + var v3:K1.I3[]=v1; + var v4:()=>K1.I3=v1; + var v5:(k:K1.I3)=>void=v1; + var v6:{k:K1.I3;}=v1; + } +} + +interface I { + k; +} + +var y:I; +var x:T.I=y; + + + +//// [qualify.js] +var M; +(function (M) { + M.m = 0; + (function (N) { + N.n = 1; + })(M.N || (M.N = {})); + var N = M.N; +})(M || (M = {})); +var M; +(function (M) { + (function (N) { + var y = M.m; + var x = N.n + y; + })(M.N || (M.N = {})); + var N = M.N; +})(M || (M = {})); +var T; +(function (T) { + (function (U) { + var z = 3; + })(T.U || (T.U = {})); + var U = T.U; +})(T || (T = {})); +var Peer; +(function (Peer) { + (function (U2) { + var z = 3; + })(Peer.U2 || (Peer.U2 = {})); + var U2 = Peer.U2; +})(Peer || (Peer = {})); +var Everest; +(function (Everest) { + (function (K2) { + var v1; + var v2 = v1; + var v3 = v1; + var v4 = v1; + var v5 = v1; + var v6 = v1; + })(Everest.K2 || (Everest.K2 = {})); + var K2 = Everest.K2; +})(Everest || (Everest = {})); +var y; +var x = y; diff --git a/tests/baselines/reference/quotedAccessorName1.errors.txt b/tests/baselines/reference/quotedAccessorName1.errors.txt new file mode 100644 index 0000000000000..e86d94403e776 --- /dev/null +++ b/tests/baselines/reference/quotedAccessorName1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/quotedAccessorName1.ts (1 errors) ==== + class C { + get "foo"() { return 0; } + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/quotedAccessorName2.errors.txt b/tests/baselines/reference/quotedAccessorName2.errors.txt new file mode 100644 index 0000000000000..031494a4f0798 --- /dev/null +++ b/tests/baselines/reference/quotedAccessorName2.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/quotedAccessorName2.ts (1 errors) ==== + class C { + static get "foo"() { return 0; } + ~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/quotedFunctionName1.js b/tests/baselines/reference/quotedFunctionName1.js new file mode 100644 index 0000000000000..28d7518647448 --- /dev/null +++ b/tests/baselines/reference/quotedFunctionName1.js @@ -0,0 +1,13 @@ +//// [quotedFunctionName1.ts] +class Test1 { + "prop1"() { } +} + +//// [quotedFunctionName1.js] +var Test1 = (function () { + function Test1() { + } + Test1.prototype["prop1"] = function () { + }; + return Test1; +})(); diff --git a/tests/baselines/reference/quotedFunctionName2.js b/tests/baselines/reference/quotedFunctionName2.js new file mode 100644 index 0000000000000..46d8d9bae9da1 --- /dev/null +++ b/tests/baselines/reference/quotedFunctionName2.js @@ -0,0 +1,13 @@ +//// [quotedFunctionName2.ts] +class Test1 { + static "prop1"() { } +} + +//// [quotedFunctionName2.js] +var Test1 = (function () { + function Test1() { + } + Test1["prop1"] = function () { + }; + return Test1; +})(); diff --git a/tests/baselines/reference/quotedModuleNameMustBeAmbient.errors.txt b/tests/baselines/reference/quotedModuleNameMustBeAmbient.errors.txt new file mode 100644 index 0000000000000..d6264fe2b28ee --- /dev/null +++ b/tests/baselines/reference/quotedModuleNameMustBeAmbient.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/quotedModuleNameMustBeAmbient.ts (1 errors) ==== + module 'M' {} + ~~~~~~~~~~~~~ +!!! Ambient external modules require a 'declare' modifier. + + declare module 'M2' {} \ No newline at end of file diff --git a/tests/baselines/reference/quotedModuleNameMustBeAmbient.js b/tests/baselines/reference/quotedModuleNameMustBeAmbient.js new file mode 100644 index 0000000000000..03973bb64a2bf --- /dev/null +++ b/tests/baselines/reference/quotedModuleNameMustBeAmbient.js @@ -0,0 +1,6 @@ +//// [quotedModuleNameMustBeAmbient.ts] +module 'M' {} + +declare module 'M2' {} + +//// [quotedModuleNameMustBeAmbient.js] diff --git a/tests/baselines/reference/quotedPropertyName1.js b/tests/baselines/reference/quotedPropertyName1.js new file mode 100644 index 0000000000000..2b4176fc49229 --- /dev/null +++ b/tests/baselines/reference/quotedPropertyName1.js @@ -0,0 +1,12 @@ +//// [quotedPropertyName1.ts] +class Test1 { + "prop1" = 0; +} + +//// [quotedPropertyName1.js] +var Test1 = (function () { + function Test1() { + this["prop1"] = 0; + } + return Test1; +})(); diff --git a/tests/baselines/reference/quotedPropertyName2.js b/tests/baselines/reference/quotedPropertyName2.js new file mode 100644 index 0000000000000..ebff9f5fca045 --- /dev/null +++ b/tests/baselines/reference/quotedPropertyName2.js @@ -0,0 +1,12 @@ +//// [quotedPropertyName2.ts] +class Test1 { + static "prop1" = 0; +} + +//// [quotedPropertyName2.js] +var Test1 = (function () { + function Test1() { + } + Test1["prop1"] = 0; + return Test1; +})(); diff --git a/tests/baselines/reference/quotedPropertyName3.js b/tests/baselines/reference/quotedPropertyName3.js new file mode 100644 index 0000000000000..4191418e42a3d --- /dev/null +++ b/tests/baselines/reference/quotedPropertyName3.js @@ -0,0 +1,20 @@ +//// [quotedPropertyName3.ts] +class Test { + "prop1": number; + foo() { + var x = () => this["prop1"]; + var y: number = x(); + } +} + +//// [quotedPropertyName3.js] +var Test = (function () { + function Test() { + } + Test.prototype.foo = function () { + var _this = this; + var x = function () { return _this["prop1"]; }; + var y = x(); + }; + return Test; +})(); diff --git a/tests/baselines/reference/raiseErrorOnParameterProperty.errors.txt b/tests/baselines/reference/raiseErrorOnParameterProperty.errors.txt new file mode 100644 index 0000000000000..d96df495d439e --- /dev/null +++ b/tests/baselines/reference/raiseErrorOnParameterProperty.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/raiseErrorOnParameterProperty.ts (1 errors) ==== + class C1 { + constructor(public x: X) { + ~ +!!! Cannot find name 'X'. + } + } + var c1 = new C1(0); + + \ No newline at end of file diff --git a/tests/baselines/reference/raiseErrorOnParameterProperty.js b/tests/baselines/reference/raiseErrorOnParameterProperty.js new file mode 100644 index 0000000000000..600e1916231b0 --- /dev/null +++ b/tests/baselines/reference/raiseErrorOnParameterProperty.js @@ -0,0 +1,17 @@ +//// [raiseErrorOnParameterProperty.ts] +class C1 { + constructor(public x: X) { + } +} +var c1 = new C1(0); + + + +//// [raiseErrorOnParameterProperty.js] +var C1 = (function () { + function C1(x) { + this.x = x; + } + return C1; +})(); +var c1 = new C1(0); diff --git a/tests/baselines/reference/randomSemicolons1.js b/tests/baselines/reference/randomSemicolons1.js new file mode 100644 index 0000000000000..9b82a3851c58e --- /dev/null +++ b/tests/baselines/reference/randomSemicolons1.js @@ -0,0 +1,11 @@ +//// [randomSemicolons1.ts] +; ; +var a = 1; +; + + +//// [randomSemicolons1.js] +; +; +var a = 1; +; diff --git a/tests/baselines/reference/reassignStaticProp.errors.txt b/tests/baselines/reference/reassignStaticProp.errors.txt new file mode 100644 index 0000000000000..d8a5584d0d8de --- /dev/null +++ b/tests/baselines/reference/reassignStaticProp.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/reassignStaticProp.ts (1 errors) ==== + class foo { + + static bar = 1; + + static bar:string; // errror - duplicate id + ~~~ +!!! Duplicate identifier 'bar'. + + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/reassignStaticProp.js b/tests/baselines/reference/reassignStaticProp.js new file mode 100644 index 0000000000000..4c8d117885575 --- /dev/null +++ b/tests/baselines/reference/reassignStaticProp.js @@ -0,0 +1,20 @@ +//// [reassignStaticProp.ts] +class foo { + + static bar = 1; + + static bar:string; // errror - duplicate id + +} + + + + + +//// [reassignStaticProp.js] +var foo = (function () { + function foo() { + } + foo.bar = 1; + return foo; +})(); diff --git a/tests/baselines/reference/reboundBaseClassSymbol.js b/tests/baselines/reference/reboundBaseClassSymbol.js new file mode 100644 index 0000000000000..8c2f21602afb7 --- /dev/null +++ b/tests/baselines/reference/reboundBaseClassSymbol.js @@ -0,0 +1,12 @@ +//// [reboundBaseClassSymbol.ts] +interface A { a: number; } +module Foo { + var A = 1; + interface B extends A { b: string; } +} + +//// [reboundBaseClassSymbol.js] +var Foo; +(function (Foo) { + var A = 1; +})(Foo || (Foo = {})); diff --git a/tests/baselines/reference/reboundIdentifierOnImportAlias.js b/tests/baselines/reference/reboundIdentifierOnImportAlias.js new file mode 100644 index 0000000000000..82e892236c0da --- /dev/null +++ b/tests/baselines/reference/reboundIdentifierOnImportAlias.js @@ -0,0 +1,18 @@ +//// [reboundIdentifierOnImportAlias.ts] +module Foo { + export var x = "hello"; +} +module Bar { + var Foo = 1; + import F = Foo; +} + +//// [reboundIdentifierOnImportAlias.js] +var Foo; +(function (Foo) { + Foo.x = "hello"; +})(Foo || (Foo = {})); +var Bar; +(function (Bar) { + var Foo = 1; +})(Bar || (Bar = {})); diff --git a/tests/baselines/reference/rectype.js b/tests/baselines/reference/rectype.js new file mode 100644 index 0000000000000..ed303b6b26ef6 --- /dev/null +++ b/tests/baselines/reference/rectype.js @@ -0,0 +1,28 @@ +//// [rectype.ts] +module M { + interface I { (i:I):I; } + + export function f(p: I) { return f }; + + var i:I; + + f(i); + f(f(i)); + f((f(f(i)))); +} + + + +//// [rectype.js] +var M; +(function (M) { + function f(p) { + return f; + } + M.f = f; + ; + var i; + f(i); + f(f(i)); + f((f(f(i)))); +})(M || (M = {})); diff --git a/tests/baselines/reference/recur1.js b/tests/baselines/reference/recur1.js new file mode 100644 index 0000000000000..3dd0e14ad97a1 --- /dev/null +++ b/tests/baselines/reference/recur1.js @@ -0,0 +1,16 @@ +//// [recur1.ts] +var salt:any = new salt.pepper(); +salt.pepper = function() {} + +var cobalt = new cobalt.pitch(); +cobalt.pitch = function() {} + + + +//// [recur1.js] +var salt = new salt.pepper(); +salt.pepper = function () { +}; +var cobalt = new cobalt.pitch(); +cobalt.pitch = function () { +}; diff --git a/tests/baselines/reference/recursiveBaseCheck.errors.txt b/tests/baselines/reference/recursiveBaseCheck.errors.txt new file mode 100644 index 0000000000000..5e5b0280e669d --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/recursiveBaseCheck.ts (1 errors) ==== + declare module Module { + class C extends D { + ~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Type 'C' recursively references itself as a base type. + export class B extends Module.C { + } + export class A extends Module.B { + } + export class AmChart extends Module.A { + } + export class D extends AmChart { + } + export class E extends Module.D { + } + export class F extends Module.E { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck.js b/tests/baselines/reference/recursiveBaseCheck.js new file mode 100644 index 0000000000000..c49d5d57a89bb --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck.js @@ -0,0 +1,20 @@ +//// [recursiveBaseCheck.ts] +declare module Module { + class C extends D { + } + export class B extends Module.C { + } + export class A extends Module.B { + } + export class AmChart extends Module.A { + } + export class D extends AmChart { + } + export class E extends Module.D { + } + export class F extends Module.E { + } +} + + +//// [recursiveBaseCheck.js] diff --git a/tests/baselines/reference/recursiveBaseCheck2.errors.txt b/tests/baselines/reference/recursiveBaseCheck2.errors.txt new file mode 100644 index 0000000000000..8757693704ca5 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck2.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/recursiveBaseCheck2.ts (1 errors) ==== + declare module Box2D.Collision.Shapes { + export class b2CircleShape extends b2Shape { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Type 'b2CircleShape' recursively references itself as a base type. + export class b2Shape extends Box2D.Collision.Shapes.b2CircleShape { + } + } + declare module Box2D.Dynamics { + export class b2ContactListener extends Box2D.Collision.Shapes.b2Shape { + } + export class b2FixtureDef extends Box2D.Dynamics.b2ContactListener { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck2.js b/tests/baselines/reference/recursiveBaseCheck2.js new file mode 100644 index 0000000000000..f1dededcfbb71 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck2.js @@ -0,0 +1,16 @@ +//// [recursiveBaseCheck2.ts] +declare module Box2D.Collision.Shapes { + export class b2CircleShape extends b2Shape { + } + export class b2Shape extends Box2D.Collision.Shapes.b2CircleShape { + } +} +declare module Box2D.Dynamics { + export class b2ContactListener extends Box2D.Collision.Shapes.b2Shape { + } + export class b2FixtureDef extends Box2D.Dynamics.b2ContactListener { + } +} + + +//// [recursiveBaseCheck2.js] diff --git a/tests/baselines/reference/recursiveBaseCheck3.errors.txt b/tests/baselines/reference/recursiveBaseCheck3.errors.txt new file mode 100644 index 0000000000000..3b15067d50dd7 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck3.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/recursiveBaseCheck3.ts (2 errors) ==== + class A extends C { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'A' recursively references itself as a base type. + class C extends A { } + + (new C).blah; + ~~~~ +!!! Property 'blah' does not exist on type 'C<{}>'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js new file mode 100644 index 0000000000000..d79aaa30d9a3c --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -0,0 +1,28 @@ +//// [recursiveBaseCheck3.ts] +class A extends C { } +class C extends A { } + +(new C).blah; + +//// [recursiveBaseCheck3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function (_super) { + __extends(A, _super); + function A() { + _super.apply(this, arguments); + } + return A; +})(C); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.apply(this, arguments); + } + return C; +})(A); +(new C).blah; diff --git a/tests/baselines/reference/recursiveBaseCheck4.errors.txt b/tests/baselines/reference/recursiveBaseCheck4.errors.txt new file mode 100644 index 0000000000000..a177fbbc724fd --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck4.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/recursiveBaseCheck4.ts (2 errors) ==== + class M extends M { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'M' recursively references itself as a base type. + (new M).blah; + ~~~~ +!!! Property 'blah' does not exist on type 'M<{}>'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js new file mode 100644 index 0000000000000..e6779fc74e91d --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -0,0 +1,19 @@ +//// [recursiveBaseCheck4.ts] +class M extends M { } +(new M).blah; + +//// [recursiveBaseCheck4.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var M = (function (_super) { + __extends(M, _super); + function M() { + _super.apply(this, arguments); + } + return M; +})(M); +(new M).blah; diff --git a/tests/baselines/reference/recursiveBaseCheck5.errors.txt b/tests/baselines/reference/recursiveBaseCheck5.errors.txt new file mode 100644 index 0000000000000..2bf59a353f3af --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck5.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/recursiveBaseCheck5.ts (2 errors) ==== + interface I1 extends I2 { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'I1' recursively references itself as a base type. + interface I2 extends I1 { } + class X implements I2 { } + (new X).blah; + ~~~~ +!!! Property 'blah' does not exist on type 'X<{}, {}>'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck5.js b/tests/baselines/reference/recursiveBaseCheck5.js new file mode 100644 index 0000000000000..a27e8403e2abc --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck5.js @@ -0,0 +1,13 @@ +//// [recursiveBaseCheck5.ts] +interface I1 extends I2 { } +interface I2 extends I1 { } +class X implements I2 { } +(new X).blah; + +//// [recursiveBaseCheck5.js] +var X = (function () { + function X() { + } + return X; +})(); +(new X).blah; diff --git a/tests/baselines/reference/recursiveBaseCheck6.errors.txt b/tests/baselines/reference/recursiveBaseCheck6.errors.txt new file mode 100644 index 0000000000000..ab1bed301f8c6 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck6.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/recursiveBaseCheck6.ts (2 errors) ==== + class S18 extends S18<{ S19: A; }>{ } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'S18' recursively references itself as a base type. + (new S18()).blah; + ~~~~ +!!! Property 'blah' does not exist on type 'S18<{}>'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js new file mode 100644 index 0000000000000..ee97b3ec43664 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -0,0 +1,19 @@ +//// [recursiveBaseCheck6.ts] +class S18 extends S18<{ S19: A; }>{ } +(new S18()).blah; + +//// [recursiveBaseCheck6.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var S18 = (function (_super) { + __extends(S18, _super); + function S18() { + _super.apply(this, arguments); + } + return S18; +})(S18); +(new S18()).blah; diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js new file mode 100644 index 0000000000000..808d876d0192f --- /dev/null +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -0,0 +1,30 @@ +//// [recursiveBaseConstructorCreation1.ts] +class C1 { +public func(param: C2): any { } +} +class C2 extends C1 { } +var x = new C2(); // Valid + + +//// [recursiveBaseConstructorCreation1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + C1.prototype.func = function (param) { + }; + return C1; +})(); +var C2 = (function (_super) { + __extends(C2, _super); + function C2() { + _super.apply(this, arguments); + } + return C2; +})(C1); +var x = new C2(); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation2.js b/tests/baselines/reference/recursiveBaseConstructorCreation2.js new file mode 100644 index 0000000000000..465b87d80e541 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseConstructorCreation2.js @@ -0,0 +1,18 @@ +//// [recursiveBaseConstructorCreation2.ts] +declare class base +{ +} +declare class abc extends base +{ + foo: xyz; +} +declare class xyz extends abc +{ +} + +var bar = new xyz(); // Error: Invalid 'new' expression. + + + +//// [recursiveBaseConstructorCreation2.js] +var bar = new xyz(); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt b/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt new file mode 100644 index 0000000000000..747f66ad5a1c1 --- /dev/null +++ b/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/recursiveBaseConstructorCreation3.ts (2 errors) ==== + declare class base { + } + declare class abc extends base { + foo: xyz; + } + declare class xyz extends abc { + ~~~ +!!! Generic type 'abc' requires 1 type argument(s). + } + + var bar = new xyz(); // Error: Invalid 'new' expression. + var r: xyz = bar.foo; + ~~~ +!!! Property 'foo' does not exist on type 'xyz'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation3.js b/tests/baselines/reference/recursiveBaseConstructorCreation3.js new file mode 100644 index 0000000000000..11f03fa7f120b --- /dev/null +++ b/tests/baselines/reference/recursiveBaseConstructorCreation3.js @@ -0,0 +1,15 @@ +//// [recursiveBaseConstructorCreation3.ts] +declare class base { +} +declare class abc extends base { + foo: xyz; +} +declare class xyz extends abc { +} + +var bar = new xyz(); // Error: Invalid 'new' expression. +var r: xyz = bar.foo; + +//// [recursiveBaseConstructorCreation3.js] +var bar = new xyz(); +var r = bar.foo; diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js new file mode 100644 index 0000000000000..403eb330cd7ca --- /dev/null +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -0,0 +1,37 @@ +//// [recursiveClassInstantiationsWithDefaultConstructors.ts] +var a = new TypeScript2.MemberNameArray() +module TypeScript2 { +export class MemberName { +public prefix: string = ""; +} +export class MemberNameArray extends MemberName { +} +} + + +//// [recursiveClassInstantiationsWithDefaultConstructors.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var a = new TypeScript2.MemberNameArray(); +var TypeScript2; +(function (TypeScript2) { + var MemberName = (function () { + function MemberName() { + this.prefix = ""; + } + return MemberName; + })(); + TypeScript2.MemberName = MemberName; + var MemberNameArray = (function (_super) { + __extends(MemberNameArray, _super); + function MemberNameArray() { + _super.apply(this, arguments); + } + return MemberNameArray; + })(MemberName); + TypeScript2.MemberNameArray = MemberNameArray; +})(TypeScript2 || (TypeScript2 = {})); diff --git a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt new file mode 100644 index 0000000000000..c13c7b426055a --- /dev/null +++ b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt @@ -0,0 +1,111 @@ +==== tests/cases/compiler/recursiveClassReferenceTest.ts (4 errors) ==== + // Scenario 1: Test reqursive function call with "this" parameter + // Scenario 2: Test recursive function call with cast and "this" parameter + + + + declare module Sample.Thing { + + export interface IWidget { + getDomNode(): any; + destroy(); + gar(runner:(widget:Sample.Thing.IWidget)=>any):any; + } + + export interface ICodeThing { + + getDomNode(): Element; + ~~~~~~~ +!!! Cannot find name 'Element'. + + addWidget(widgetId:string, widget:IWidget); + + + focus(); + + //addWidget(widget: Sample.Thing.Widgets.IWidget); + } + + export interface IAction { + run(Thing:ICodeThing):boolean; + getId():string; + } + } + + module Sample.Actions.Thing.Find { + export class StartFindAction implements Sample.Thing.IAction { + + public getId() { return "yo"; } + + public run(Thing:Sample.Thing.ICodeThing):boolean { + + return true; + } + } + } + + module Sample.Thing.Widgets { + export class FindWidget implements Sample.Thing.IWidget { + + public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + + private domNode:any = null; + constructor(private codeThing: Sample.Thing.ICodeThing) { + // scenario 1 + codeThing.addWidget("addWidget", this); + } + + public getDomNode() { + return domNode; + ~~~~~~~ +!!! Cannot find name 'domNode'. + } + + public destroy() { + + } + + } + } + + interface IMode { getInitialState(): IState;} + class AbstractMode implements IMode { public getInitialState(): IState { return null;} } + + interface IState {} + + interface Window { + opener: Window; + } + declare var self: Window; + + module Sample.Thing.Languages.PlainText { + + export class State implements IState { + constructor(private mode: IMode) { } + public clone():IState { + return this; + } + + public equals(other:IState):boolean { + return this === other; + } + + public getMode(): IMode { return mode; } + ~~~~ +!!! Cannot find name 'mode'. + } + + export class Mode extends AbstractMode { + + // scenario 2 + public getInitialState(): IState { + return new State(self); + ~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + } + + + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js new file mode 100644 index 0000000000000..59bfdf5d19329 --- /dev/null +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -0,0 +1,211 @@ +//// [recursiveClassReferenceTest.ts] +// Scenario 1: Test reqursive function call with "this" parameter +// Scenario 2: Test recursive function call with cast and "this" parameter + + + +declare module Sample.Thing { + + export interface IWidget { + getDomNode(): any; + destroy(); + gar(runner:(widget:Sample.Thing.IWidget)=>any):any; + } + + export interface ICodeThing { + + getDomNode(): Element; + + addWidget(widgetId:string, widget:IWidget); + + + focus(); + + //addWidget(widget: Sample.Thing.Widgets.IWidget); + } + + export interface IAction { + run(Thing:ICodeThing):boolean; + getId():string; + } +} + +module Sample.Actions.Thing.Find { + export class StartFindAction implements Sample.Thing.IAction { + + public getId() { return "yo"; } + + public run(Thing:Sample.Thing.ICodeThing):boolean { + + return true; + } + } +} + +module Sample.Thing.Widgets { + export class FindWidget implements Sample.Thing.IWidget { + + public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + + private domNode:any = null; + constructor(private codeThing: Sample.Thing.ICodeThing) { + // scenario 1 + codeThing.addWidget("addWidget", this); + } + + public getDomNode() { + return domNode; + } + + public destroy() { + + } + + } +} + +interface IMode { getInitialState(): IState;} +class AbstractMode implements IMode { public getInitialState(): IState { return null;} } + +interface IState {} + +interface Window { + opener: Window; +} +declare var self: Window; + +module Sample.Thing.Languages.PlainText { + + export class State implements IState { + constructor(private mode: IMode) { } + public clone():IState { + return this; + } + + public equals(other:IState):boolean { + return this === other; + } + + public getMode(): IMode { return mode; } + } + + export class Mode extends AbstractMode { + + // scenario 2 + public getInitialState(): IState { + return new State(self); + } + + + } +} + + + +//// [recursiveClassReferenceTest.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Sample; +(function (Sample) { + (function (Actions) { + (function (Thing) { + (function (Find) { + var StartFindAction = (function () { + function StartFindAction() { + } + StartFindAction.prototype.getId = function () { + return "yo"; + }; + StartFindAction.prototype.run = function (Thing) { + return true; + }; + return StartFindAction; + })(); + Find.StartFindAction = StartFindAction; + })(Thing.Find || (Thing.Find = {})); + var Find = Thing.Find; + })(Actions.Thing || (Actions.Thing = {})); + var Thing = Actions.Thing; + })(Sample.Actions || (Sample.Actions = {})); + var Actions = Sample.Actions; +})(Sample || (Sample = {})); +var Sample; +(function (Sample) { + (function (Thing) { + (function (Widgets) { + var FindWidget = (function () { + function FindWidget(codeThing) { + this.codeThing = codeThing; + this.domNode = null; + codeThing.addWidget("addWidget", this); + } + FindWidget.prototype.gar = function (runner) { + if (true) { + return runner(this); + } + }; + FindWidget.prototype.getDomNode = function () { + return domNode; + }; + FindWidget.prototype.destroy = function () { + }; + return FindWidget; + })(); + Widgets.FindWidget = FindWidget; + })(Thing.Widgets || (Thing.Widgets = {})); + var Widgets = Thing.Widgets; + })(Sample.Thing || (Sample.Thing = {})); + var Thing = Sample.Thing; +})(Sample || (Sample = {})); +var AbstractMode = (function () { + function AbstractMode() { + } + AbstractMode.prototype.getInitialState = function () { + return null; + }; + return AbstractMode; +})(); +var Sample; +(function (Sample) { + (function (Thing) { + (function (Languages) { + (function (PlainText) { + var State = (function () { + function State(mode) { + this.mode = mode; + } + State.prototype.clone = function () { + return this; + }; + State.prototype.equals = function (other) { + return this === other; + }; + State.prototype.getMode = function () { + return mode; + }; + return State; + })(); + PlainText.State = State; + var Mode = (function (_super) { + __extends(Mode, _super); + function Mode() { + _super.apply(this, arguments); + } + Mode.prototype.getInitialState = function () { + return new State(self); + }; + return Mode; + })(AbstractMode); + PlainText.Mode = Mode; + })(Languages.PlainText || (Languages.PlainText = {})); + var PlainText = Languages.PlainText; + })(Thing.Languages || (Thing.Languages = {})); + var Languages = Thing.Languages; + })(Sample.Thing || (Sample.Thing = {})); + var Thing = Sample.Thing; +})(Sample || (Sample = {})); +//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map new file mode 100644 index 0000000000000..bedb4f543e324 --- /dev/null +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -0,0 +1,2 @@ +//// [recursiveClassReferenceTest.js.map] +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":["Sample","Sample.Actions","Sample.Actions.Thing","Sample.Actions.Thing.Find","Sample.Actions.Thing.Find.StartFindAction","Sample.Actions.Thing.Find.StartFindAction.constructor","Sample.Actions.Thing.Find.StartFindAction.getId","Sample.Actions.Thing.Find.StartFindAction.run","Sample.Thing","Sample.Thing.Widgets","Sample.Thing.Widgets.FindWidget","Sample.Thing.Widgets.FindWidget.constructor","Sample.Thing.Widgets.FindWidget.gar","Sample.Thing.Widgets.FindWidget.getDomNode","Sample.Thing.Widgets.FindWidget.destroy","AbstractMode","AbstractMode.constructor","AbstractMode.getInitialState","Sample.Thing.Languages","Sample.Thing.Languages.PlainText","Sample.Thing.Languages.PlainText.State","Sample.Thing.Languages.PlainText.State.constructor","Sample.Thing.Languages.PlainText.State.clone","Sample.Thing.Languages.PlainText.State.equals","Sample.Thing.Languages.PlainText.State.getMode","Sample.Thing.Languages.PlainText.Mode","Sample.Thing.Languages.PlainText.Mode.constructor","Sample.Thing.Languages.PlainText.Mode.getInitialState"],"mappings":";;;;;;AA+BA,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,WAAAA,OAAOA;QAACC,WAAAA,KAAKA;YAACC,WAAAA,IAAIA,EAACA,CAACA;gBACjCC,IAAaA,eAAeA;oBAA5BC,SAAaA,eAAeA;oBAQ5BC,CAACA;oBANOD,+BAAKA,GAAZA;wBAAiBE,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBAExBF,6BAAGA,GAAVA,UAAWA,KAA6BA;wBAEvCG,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBACFH,sBAACA;gBAADA,CAACA,AARDD,IAQCA;gBARYA,oBAAeA,GAAfA,eAQZA,CAAAA;YACFA,CAACA,EAV2BD,UAAIA,KAAJA,UAAIA,QAU/BA;YAV2BA,IAAAA,IAAIA,GAAJA,UAU3BA,CAAAA;QAADA,CAACA,EAVqBD,aAAKA,KAALA,aAAKA,QAU1BA;QAVqBA,IAAAA,KAAKA,GAALA,aAUrBA,CAAAA;IAADA,CAACA,EAVaD,cAAOA,KAAPA,cAAOA,QAUpBA;IAVaA,IAAAA,OAAOA,GAAPA,cAUbA,CAAAA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,WAAAA,KAAKA;QAACQ,WAAAA,OAAOA,EAACA,CAACA;YAC5BC,IAAaA,UAAUA;gBAKtBC,SALYA,UAAUA,CAKFA,SAAkCA;oBAAlCC,cAASA,GAATA,SAASA,CAAyBA;oBAD9CA,YAAOA,GAAOA,IAAIA,CAACA;oBAGvBA,SAASA,CAACA,SAASA,CAACA,WAAWA,EAAEA,IAAIA,CAACA,CAACA;gBAC3CA,CAACA;gBANMD,wBAAGA,GAAVA,UAAWA,MAAyCA;oBAAIE,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;wBAAAA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;oBAAAA,CAACA;gBAAAA,CAACA;gBAQlFF,+BAAUA,GAAjBA;oBACCG,MAAMA,CAACA,OAAOA,CAACA;gBAChBA,CAACA;gBAEMH,4BAAOA,GAAdA;gBAEAI,CAACA;gBAEFJ,iBAACA;YAADA,CAACA,AAlBDD,IAkBCA;YAlBYA,kBAAUA,GAAVA,UAkBZA,CAAAA;QACFA,CAACA,EApBmBD,aAAOA,KAAPA,aAAOA,QAoB1BA;QApBmBA,IAAAA,OAAOA,GAAPA,aAoBnBA,CAAAA;IAADA,CAACA,EApBaR,YAAKA,KAALA,YAAKA,QAoBlBA;IApBaA,IAAAA,KAAKA,GAALA,YAoBbA,CAAAA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD,IAAM,YAAY;IAAlBe,SAAMA,YAAYA;IAAqEC,CAACA;IAA3CD,sCAAeA,GAAtBA;QAAmCE,MAAMA,CAACA,IAAIA,CAACA;IAAAA,CAACA;IAACF,mBAACA;AAADA,CAACA,AAAxF,IAAwF;AASxF,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAACf,WAAAA,KAAKA;QAACQ,WAAAA,SAASA;YAACU,WAAAA,SAASA,EAACA,CAACA;gBAExCC,IAAaA,KAAKA;oBACXC,SADMA,KAAKA,CACSA,IAAWA;wBAAXC,SAAIA,GAAJA,IAAIA,CAAOA;oBAAIA,CAACA;oBACnCD,qBAAKA,GAAZA;wBACCE,MAAMA,CAACA,IAAIA,CAACA;oBACbA,CAACA;oBAEMF,sBAAMA,GAAbA,UAAcA,KAAYA;wBACzBG,MAAMA,CAACA,IAAIA,KAAKA,KAAKA,CAACA;oBACvBA,CAACA;oBAEMH,uBAAOA,GAAdA;wBAA0BI,MAAMA,CAACA,IAAIA,CAACA;oBAACA,CAACA;oBACzCJ,YAACA;gBAADA,CAACA,AAXDD,IAWCA;gBAXYA,eAAKA,GAALA,KAWZA,CAAAA;gBAEDA,IAAaA,IAAIA;oBAASM,UAAbA,IAAIA,UAAqBA;oBAAtCA,SAAaA,IAAIA;wBAASC,8BAAYA;oBAQtCA,CAACA;oBALOD,8BAAeA,GAAtBA;wBACCE,MAAMA,CAACA,IAAIA,KAAKA,CAACA,IAAIA,CAACA,CAACA;oBACxBA,CAACA;oBAGFF,WAACA;gBAADA,CAACA,AARDN,EAA0BA,YAAYA,EAQrCA;gBARYA,cAAIA,GAAJA,IAQZA,CAAAA;YACFA,CAACA,EAxB6BD,mBAASA,KAATA,mBAASA,QAwBtCA;YAxB6BA,IAAAA,SAASA,GAATA,mBAwB7BA,CAAAA;QAADA,CAACA,EAxBmBV,eAASA,KAATA,eAASA,QAwB5BA;QAxBmBA,IAAAA,SAASA,GAATA,eAwBnBA,CAAAA;IAADA,CAACA,EAxBaR,YAAKA,KAALA,YAAKA,QAwBlBA;IAxBaA,IAAAA,KAAKA,GAALA,YAwBbA,CAAAA;AAADA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt new file mode 100644 index 0000000000000..a6b7d6db479dc --- /dev/null +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -0,0 +1,2144 @@ +=================================================================== +JsFile: recursiveClassReferenceTest.js +mapUrl: recursiveClassReferenceTest.js.map +sourceRoot: +sources: recursiveClassReferenceTest.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/recursiveClassReferenceTest.js +sourceFile:recursiveClassReferenceTest.ts +------------------------------------------------------------------- +>>>var __extends = this.__extends || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> __.prototype = b.prototype; +>>> d.prototype = new __(); +>>>}; +>>>var Sample; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 >// Scenario 1: Test reqursive function call with "this" parameter + >// Scenario 2: Test recursive function call with cast and "this" parameter + > + > + > + >declare module Sample.Thing { + > + > export interface IWidget { + > getDomNode(): any; + > destroy(); + > gar(runner:(widget:Sample.Thing.IWidget)=>any):any; + > } + > + > export interface ICodeThing { + > + > getDomNode(): Element; + > + > addWidget(widgetId:string, widget:IWidget); + > + > + > focus(); + > + > //addWidget(widget: Sample.Thing.Widgets.IWidget); + > } + > + > export interface IAction { + > run(Thing:ICodeThing):boolean; + > getId():string; + > } + >} + > + > +2 >module +3 > Sample +4 > .Actions.Thing.Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +1 >Emitted(7, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(32, 8) + SourceIndex(0) +3 >Emitted(7, 11) Source(32, 14) + SourceIndex(0) +4 >Emitted(7, 12) Source(42, 2) + SourceIndex(0) +--- +>>>(function (Sample) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^^^^^^^^-> +1-> +2 >module +3 > Sample +1->Emitted(8, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(8, 12) Source(32, 8) + SourceIndex(0) +3 >Emitted(8, 18) Source(32, 14) + SourceIndex(0) +--- +>>> (function (Actions) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^-> +1->. +2 > +3 > Actions +1->Emitted(9, 5) Source(32, 15) + SourceIndex(0) name (Sample) +2 >Emitted(9, 16) Source(32, 15) + SourceIndex(0) name (Sample) +3 >Emitted(9, 23) Source(32, 22) + SourceIndex(0) name (Sample) +--- +>>> (function (Thing) { +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^-> +1->. +2 > +3 > Thing +1->Emitted(10, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(10, 20) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(10, 25) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +--- +>>> (function (Find) { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1->. +2 > +3 > Find +4 > +5 > { +1->Emitted(11, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(11, 24) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(11, 28) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(11, 30) Source(32, 34) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(11, 31) Source(32, 35) + SourceIndex(0) name (Sample.Actions.Thing) +--- +>>> var StartFindAction = (function () { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > StartFindAction +1->Emitted(12, 17) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(12, 21) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(12, 36) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) +--- +>>> function StartFindAction() { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^ +1-> +2 > export class +3 > StartFindAction +1->Emitted(13, 21) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(13, 30) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(13, 45) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +--- +>>> } +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > +2 > } +1 >Emitted(14, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) +2 >Emitted(14, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.constructor) +--- +>>> StartFindAction.prototype.getId = function () { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> +2 > getId +3 > +1->Emitted(15, 21) Source(35, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(15, 52) Source(35, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(15, 55) Source(35, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +--- +>>> return "yo"; +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1 >public getId() { +2 > return +3 > +4 > "yo" +5 > ; +1 >Emitted(16, 25) Source(35, 20) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +2 >Emitted(16, 31) Source(35, 26) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +3 >Emitted(16, 32) Source(35, 27) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +4 >Emitted(16, 36) Source(35, 31) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +5 >Emitted(16, 37) Source(35, 32) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(17, 21) Source(35, 33) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +2 >Emitted(17, 22) Source(35, 34) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.getId) +--- +>>> StartFindAction.prototype.run = function (Thing) { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^^^^^ +1-> + > + > public +2 > run +3 > +4 > public run( +5 > Thing:Sample.Thing.ICodeThing +1->Emitted(18, 21) Source(37, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(18, 50) Source(37, 13) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(18, 53) Source(37, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +4 >Emitted(18, 63) Source(37, 14) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +5 >Emitted(18, 68) Source(37, 43) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +--- +>>> return true; +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1 >):boolean { + > + > +2 > return +3 > +4 > true +5 > ; +1 >Emitted(19, 25) Source(39, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(19, 31) Source(39, 10) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +3 >Emitted(19, 32) Source(39, 11) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +4 >Emitted(19, 36) Source(39, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +5 >Emitted(19, 37) Source(39, 16) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(20, 21) Source(40, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +2 >Emitted(20, 22) Source(40, 4) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction.run) +--- +>>> return StartFindAction; +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(21, 21) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(21, 43) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +--- +>>> })(); +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } +1 >Emitted(22, 17) Source(41, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +2 >Emitted(22, 18) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find.StartFindAction) +3 >Emitted(22, 18) Source(33, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(22, 22) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +--- +>>> Find.StartFindAction = StartFindAction; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^ +1-> +2 > StartFindAction +3 > +4 > StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } +5 > +1->Emitted(23, 17) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(23, 37) Source(33, 30) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(23, 40) Source(33, 15) + SourceIndex(0) name (Sample.Actions.Thing.Find) +4 >Emitted(23, 55) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +5 >Emitted(23, 56) Source(41, 3) + SourceIndex(0) name (Sample.Actions.Thing.Find) +--- +>>> })(Thing.Find || (Thing.Find = {})); +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^ +7 > ^^^^^^^^ +1 > + > +2 > } +3 > +4 > Find +5 > +6 > Find +7 > { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +1 >Emitted(24, 13) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing.Find) +2 >Emitted(24, 14) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing.Find) +3 >Emitted(24, 16) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(24, 26) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(24, 31) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +6 >Emitted(24, 41) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +7 >Emitted(24, 49) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +--- +>>> var Find = Thing.Find; +1 >^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^-> +1 > +2 > +3 > Find +4 > +5 > Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +6 > +1 >Emitted(25, 13) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(25, 17) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(25, 21) Source(32, 33) + SourceIndex(0) name (Sample.Actions.Thing) +4 >Emitted(25, 24) Source(32, 29) + SourceIndex(0) name (Sample.Actions.Thing) +5 >Emitted(25, 34) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +6 >Emitted(25, 35) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +--- +>>> })(Actions.Thing || (Actions.Thing = {})); +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> +2 > } +3 > +4 > Thing +5 > +6 > Thing +7 > .Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +1->Emitted(26, 9) Source(42, 1) + SourceIndex(0) name (Sample.Actions.Thing) +2 >Emitted(26, 10) Source(42, 2) + SourceIndex(0) name (Sample.Actions.Thing) +3 >Emitted(26, 12) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +4 >Emitted(26, 25) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +5 >Emitted(26, 30) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +6 >Emitted(26, 43) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +7 >Emitted(26, 51) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +--- +>>> var Thing = Actions.Thing; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^-> +1 > +2 > +3 > Thing +4 > +5 > Thing.Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +6 > +1 >Emitted(27, 9) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(27, 13) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(27, 18) Source(32, 28) + SourceIndex(0) name (Sample.Actions) +4 >Emitted(27, 21) Source(32, 23) + SourceIndex(0) name (Sample.Actions) +5 >Emitted(27, 34) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +6 >Emitted(27, 35) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +--- +>>> })(Sample.Actions || (Sample.Actions = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> +2 > } +3 > +4 > Actions +5 > +6 > Actions +7 > .Thing.Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +1->Emitted(28, 5) Source(42, 1) + SourceIndex(0) name (Sample.Actions) +2 >Emitted(28, 6) Source(42, 2) + SourceIndex(0) name (Sample.Actions) +3 >Emitted(28, 8) Source(32, 15) + SourceIndex(0) name (Sample) +4 >Emitted(28, 22) Source(32, 22) + SourceIndex(0) name (Sample) +5 >Emitted(28, 27) Source(32, 15) + SourceIndex(0) name (Sample) +6 >Emitted(28, 41) Source(32, 22) + SourceIndex(0) name (Sample) +7 >Emitted(28, 49) Source(42, 2) + SourceIndex(0) name (Sample) +--- +>>> var Actions = Sample.Actions; +1 >^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^ +6 > ^ +1 > +2 > +3 > Actions +4 > +5 > Actions.Thing.Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +6 > +1 >Emitted(29, 5) Source(32, 15) + SourceIndex(0) name (Sample) +2 >Emitted(29, 9) Source(32, 15) + SourceIndex(0) name (Sample) +3 >Emitted(29, 16) Source(32, 22) + SourceIndex(0) name (Sample) +4 >Emitted(29, 19) Source(32, 15) + SourceIndex(0) name (Sample) +5 >Emitted(29, 33) Source(42, 2) + SourceIndex(0) name (Sample) +6 >Emitted(29, 34) Source(42, 2) + SourceIndex(0) name (Sample) +--- +>>>})(Sample || (Sample = {})); +1 > +2 >^ +3 > ^^ +4 > ^^^^^^ +5 > ^^^^^ +6 > ^^^^^^ +7 > ^^^^^^^^ +1 > +2 >} +3 > +4 > Sample +5 > +6 > Sample +7 > .Actions.Thing.Find { + > export class StartFindAction implements Sample.Thing.IAction { + > + > public getId() { return "yo"; } + > + > public run(Thing:Sample.Thing.ICodeThing):boolean { + > + > return true; + > } + > } + > } +1 >Emitted(30, 1) Source(42, 1) + SourceIndex(0) name (Sample) +2 >Emitted(30, 2) Source(42, 2) + SourceIndex(0) name (Sample) +3 >Emitted(30, 4) Source(32, 8) + SourceIndex(0) +4 >Emitted(30, 10) Source(32, 14) + SourceIndex(0) +5 >Emitted(30, 15) Source(32, 8) + SourceIndex(0) +6 >Emitted(30, 21) Source(32, 14) + SourceIndex(0) +7 >Emitted(30, 29) Source(42, 2) + SourceIndex(0) +--- +>>>var Sample; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + > + > +2 >module +3 > Sample +4 > .Thing.Widgets { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +1 >Emitted(31, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(31, 5) Source(44, 8) + SourceIndex(0) +3 >Emitted(31, 11) Source(44, 14) + SourceIndex(0) +4 >Emitted(31, 12) Source(64, 2) + SourceIndex(0) +--- +>>>(function (Sample) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^^^^^^-> +1-> +2 >module +3 > Sample +1->Emitted(32, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(32, 12) Source(44, 8) + SourceIndex(0) +3 >Emitted(32, 18) Source(44, 14) + SourceIndex(0) +--- +>>> (function (Thing) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^-> +1->. +2 > +3 > Thing +1->Emitted(33, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(33, 16) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(33, 21) Source(44, 20) + SourceIndex(0) name (Sample) +--- +>>> (function (Widgets) { +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> +1->. +2 > +3 > Widgets +4 > +5 > { +1->Emitted(34, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(34, 20) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(34, 27) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(34, 29) Source(44, 29) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(34, 30) Source(44, 30) + SourceIndex(0) name (Sample.Thing) +--- +>>> var FindWidget = (function () { +1->^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > FindWidget +1->Emitted(35, 13) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(35, 17) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(35, 27) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) +--- +>>> function FindWidget(codeThing) { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^ +6 > ^^^-> +1-> implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > +2 > +3 > FindWidget +4 > implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private +5 > codeThing: Sample.Thing.ICodeThing +1->Emitted(36, 17) Source(50, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(36, 26) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(36, 36) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +4 >Emitted(36, 37) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +5 >Emitted(36, 46) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +--- +>>> this.codeThing = codeThing; +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^ +5 > ^ +1-> +2 > codeThing +3 > +4 > codeThing +5 > : Sample.Thing.ICodeThing +1->Emitted(37, 21) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(37, 35) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(37, 38) Source(50, 23) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(37, 47) Source(50, 32) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(37, 48) Source(50, 57) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +--- +>>> this.domNode = null; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > domNode +3 > :any = +4 > null +5 > ; +1 >Emitted(38, 21) Source(49, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(38, 33) Source(49, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(38, 36) Source(49, 25) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(38, 40) Source(49, 29) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(38, 41) Source(49, 30) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +--- +>>> codeThing.addWidget("addWidget", this); +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^ +9 > ^ +10> ^ +1-> + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > +2 > codeThing +3 > . +4 > addWidget +5 > ( +6 > "addWidget" +7 > , +8 > this +9 > ) +10> ; +1->Emitted(39, 21) Source(52, 7) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(39, 30) Source(52, 16) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +3 >Emitted(39, 31) Source(52, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +4 >Emitted(39, 40) Source(52, 26) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +5 >Emitted(39, 41) Source(52, 27) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +6 >Emitted(39, 52) Source(52, 38) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +7 >Emitted(39, 54) Source(52, 40) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +8 >Emitted(39, 58) Source(52, 44) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +9 >Emitted(39, 59) Source(52, 45) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +10>Emitted(39, 60) Source(52, 46) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +--- +>>> } +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(40, 17) Source(53, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +2 >Emitted(40, 18) Source(53, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.constructor) +--- +>>> FindWidget.prototype.gar = function (runner) { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^^^^^^ +1-> +2 > gar +3 > +4 > public gar( +5 > runner:(widget:Sample.Thing.IWidget)=>any +1->Emitted(41, 17) Source(47, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(41, 41) Source(47, 13) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(41, 44) Source(47, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +4 >Emitted(41, 54) Source(47, 14) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +5 >Emitted(41, 60) Source(47, 55) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +--- +>>> if (true) { +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^^^^-> +1 >) { +2 > if +3 > +4 > ( +5 > true +6 > ) +7 > +8 > { +1 >Emitted(42, 21) Source(47, 59) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(42, 23) Source(47, 61) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(42, 24) Source(47, 62) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(42, 25) Source(47, 63) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +5 >Emitted(42, 29) Source(47, 67) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +6 >Emitted(42, 30) Source(47, 68) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(42, 31) Source(47, 69) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(42, 32) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +--- +>>> return runner(this); +1->^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1-> +2 > return +3 > +4 > runner +5 > ( +6 > this +7 > ) +8 > ; +1->Emitted(43, 25) Source(47, 70) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(43, 31) Source(47, 76) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +3 >Emitted(43, 32) Source(47, 77) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +4 >Emitted(43, 38) Source(47, 83) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +5 >Emitted(43, 39) Source(47, 84) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +6 >Emitted(43, 43) Source(47, 88) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +7 >Emitted(43, 44) Source(47, 89) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +8 >Emitted(43, 45) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +--- +>>> } +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +1 > +2 > } +1 >Emitted(44, 21) Source(47, 90) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(44, 22) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(45, 17) Source(47, 91) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +2 >Emitted(45, 18) Source(47, 92) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.gar) +--- +>>> FindWidget.prototype.getDomNode = function () { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public +2 > getDomNode +3 > +1->Emitted(46, 17) Source(55, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(46, 48) Source(55, 20) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(46, 51) Source(55, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +--- +>>> return domNode; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^ +5 > ^ +1 >public getDomNode() { + > +2 > return +3 > +4 > domNode +5 > ; +1 >Emitted(47, 21) Source(56, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(47, 27) Source(56, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +3 >Emitted(47, 28) Source(56, 11) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +4 >Emitted(47, 35) Source(56, 18) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +5 >Emitted(47, 36) Source(56, 19) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(48, 17) Source(57, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +2 >Emitted(48, 18) Source(57, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.getDomNode) +--- +>>> FindWidget.prototype.destroy = function () { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > destroy +3 > +1->Emitted(49, 17) Source(59, 10) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(49, 45) Source(59, 17) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(49, 48) Source(59, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^-> +1 >public destroy() { + > + > +2 > } +1 >Emitted(50, 17) Source(61, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +2 >Emitted(50, 18) Source(61, 4) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget.destroy) +--- +>>> return FindWidget; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^ +1-> + > + > +2 > } +1->Emitted(51, 17) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(51, 34) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +--- +>>> })(); +1 >^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } +1 >Emitted(52, 13) Source(63, 2) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +2 >Emitted(52, 14) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets.FindWidget) +3 >Emitted(52, 14) Source(45, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(52, 18) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +--- +>>> Widgets.FindWidget = FindWidget; +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^-> +1-> +2 > FindWidget +3 > +4 > FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } +5 > +1->Emitted(53, 13) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(53, 31) Source(45, 25) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(53, 34) Source(45, 15) + SourceIndex(0) name (Sample.Thing.Widgets) +4 >Emitted(53, 44) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +5 >Emitted(53, 45) Source(63, 3) + SourceIndex(0) name (Sample.Thing.Widgets) +--- +>>> })(Thing.Widgets || (Thing.Widgets = {})); +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> + > +2 > } +3 > +4 > Widgets +5 > +6 > Widgets +7 > { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +1->Emitted(54, 9) Source(64, 1) + SourceIndex(0) name (Sample.Thing.Widgets) +2 >Emitted(54, 10) Source(64, 2) + SourceIndex(0) name (Sample.Thing.Widgets) +3 >Emitted(54, 12) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(54, 25) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(54, 30) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(54, 43) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(54, 51) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +--- +>>> var Widgets = Thing.Widgets; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^-> +1 > +2 > +3 > Widgets +4 > +5 > Widgets { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +6 > +1 >Emitted(55, 9) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(55, 13) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(55, 20) Source(44, 28) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(55, 23) Source(44, 21) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(55, 36) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(55, 37) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +--- +>>> })(Sample.Thing || (Sample.Thing = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> +2 > } +3 > +4 > Thing +5 > +6 > Thing +7 > .Widgets { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +1->Emitted(56, 5) Source(64, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(56, 6) Source(64, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(56, 8) Source(44, 15) + SourceIndex(0) name (Sample) +4 >Emitted(56, 20) Source(44, 20) + SourceIndex(0) name (Sample) +5 >Emitted(56, 25) Source(44, 15) + SourceIndex(0) name (Sample) +6 >Emitted(56, 37) Source(44, 20) + SourceIndex(0) name (Sample) +7 >Emitted(56, 45) Source(64, 2) + SourceIndex(0) name (Sample) +--- +>>> var Thing = Sample.Thing; +1 >^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^ +6 > ^ +1 > +2 > +3 > Thing +4 > +5 > Thing.Widgets { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +6 > +1 >Emitted(57, 5) Source(44, 15) + SourceIndex(0) name (Sample) +2 >Emitted(57, 9) Source(44, 15) + SourceIndex(0) name (Sample) +3 >Emitted(57, 14) Source(44, 20) + SourceIndex(0) name (Sample) +4 >Emitted(57, 17) Source(44, 15) + SourceIndex(0) name (Sample) +5 >Emitted(57, 29) Source(64, 2) + SourceIndex(0) name (Sample) +6 >Emitted(57, 30) Source(64, 2) + SourceIndex(0) name (Sample) +--- +>>>})(Sample || (Sample = {})); +1 > +2 >^ +3 > ^^ +4 > ^^^^^^ +5 > ^^^^^ +6 > ^^^^^^ +7 > ^^^^^^^^ +8 > ^^^^^^-> +1 > +2 >} +3 > +4 > Sample +5 > +6 > Sample +7 > .Thing.Widgets { + > export class FindWidget implements Sample.Thing.IWidget { + > + > public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} + > + > private domNode:any = null; + > constructor(private codeThing: Sample.Thing.ICodeThing) { + > // scenario 1 + > codeThing.addWidget("addWidget", this); + > } + > + > public getDomNode() { + > return domNode; + > } + > + > public destroy() { + > + > } + > + > } + > } +1 >Emitted(58, 1) Source(64, 1) + SourceIndex(0) name (Sample) +2 >Emitted(58, 2) Source(64, 2) + SourceIndex(0) name (Sample) +3 >Emitted(58, 4) Source(44, 8) + SourceIndex(0) +4 >Emitted(58, 10) Source(44, 14) + SourceIndex(0) +5 >Emitted(58, 15) Source(44, 8) + SourceIndex(0) +6 >Emitted(58, 21) Source(44, 14) + SourceIndex(0) +7 >Emitted(58, 29) Source(64, 2) + SourceIndex(0) +--- +>>>var AbstractMode = (function () { +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1-> + > + >interface IMode { getInitialState(): IState;} + > +2 >class +3 > AbstractMode +1->Emitted(59, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(59, 5) Source(67, 7) + SourceIndex(0) +3 >Emitted(59, 17) Source(67, 19) + SourceIndex(0) +--- +>>> function AbstractMode() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^^^^^^ +1-> +2 > class +3 > AbstractMode +1->Emitted(60, 5) Source(67, 1) + SourceIndex(0) name (AbstractMode) +2 >Emitted(60, 14) Source(67, 7) + SourceIndex(0) name (AbstractMode) +3 >Emitted(60, 26) Source(67, 19) + SourceIndex(0) name (AbstractMode) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > implements IMode { public getInitialState(): IState { return null;} +2 > } +1 >Emitted(61, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode.constructor) +2 >Emitted(61, 6) Source(67, 89) + SourceIndex(0) name (AbstractMode.constructor) +--- +>>> AbstractMode.prototype.getInitialState = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> +2 > getInitialState +3 > +1->Emitted(62, 5) Source(67, 46) + SourceIndex(0) name (AbstractMode) +2 >Emitted(62, 43) Source(67, 61) + SourceIndex(0) name (AbstractMode) +3 >Emitted(62, 46) Source(67, 39) + SourceIndex(0) name (AbstractMode) +--- +>>> return null; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1 >public getInitialState(): IState { +2 > return +3 > +4 > null +5 > ; +1 >Emitted(63, 9) Source(67, 74) + SourceIndex(0) name (AbstractMode.getInitialState) +2 >Emitted(63, 15) Source(67, 80) + SourceIndex(0) name (AbstractMode.getInitialState) +3 >Emitted(63, 16) Source(67, 81) + SourceIndex(0) name (AbstractMode.getInitialState) +4 >Emitted(63, 20) Source(67, 85) + SourceIndex(0) name (AbstractMode.getInitialState) +5 >Emitted(63, 21) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(64, 5) Source(67, 86) + SourceIndex(0) name (AbstractMode.getInitialState) +2 >Emitted(64, 6) Source(67, 87) + SourceIndex(0) name (AbstractMode.getInitialState) +--- +>>> return AbstractMode; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(65, 5) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(65, 24) Source(67, 89) + SourceIndex(0) name (AbstractMode) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^-> +1 > +2 >} +3 > +4 > class AbstractMode implements IMode { public getInitialState(): IState { return null;} } +1 >Emitted(66, 1) Source(67, 88) + SourceIndex(0) name (AbstractMode) +2 >Emitted(66, 2) Source(67, 89) + SourceIndex(0) name (AbstractMode) +3 >Emitted(66, 2) Source(67, 1) + SourceIndex(0) +4 >Emitted(66, 6) Source(67, 89) + SourceIndex(0) +--- +>>>var Sample; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1-> + > + >interface IState {} + > + >interface Window { + > opener: Window; + >} + >declare var self: Window; + > + > +2 >module +3 > Sample +4 > .Thing.Languages.PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +1->Emitted(67, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(67, 5) Source(76, 8) + SourceIndex(0) +3 >Emitted(67, 11) Source(76, 14) + SourceIndex(0) +4 >Emitted(67, 12) Source(100, 2) + SourceIndex(0) +--- +>>>(function (Sample) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^^^^^^-> +1-> +2 >module +3 > Sample +1->Emitted(68, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(68, 12) Source(76, 8) + SourceIndex(0) +3 >Emitted(68, 18) Source(76, 14) + SourceIndex(0) +--- +>>> (function (Thing) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^-> +1->. +2 > +3 > Thing +1->Emitted(69, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(69, 16) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(69, 21) Source(76, 20) + SourceIndex(0) name (Sample) +--- +>>> (function (Languages) { +1->^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^ +4 > ^^^^^^^^-> +1->. +2 > +3 > Languages +1->Emitted(70, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(70, 20) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(70, 29) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +--- +>>> (function (PlainText) { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1->. +2 > +3 > PlainText +4 > +5 > { +1->Emitted(71, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(71, 24) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(71, 33) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(71, 35) Source(76, 41) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(71, 36) Source(76, 42) + SourceIndex(0) name (Sample.Thing.Languages) +--- +>>> var State = (function () { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > export class +3 > State +1->Emitted(72, 17) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(72, 21) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(72, 26) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> function State(mode) { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^ +5 > ^^^^ +6 > ^^^-> +1-> implements IState { + > +2 > +3 > State +4 > implements IState { + > constructor(private +5 > mode: IMode +1->Emitted(73, 21) Source(79, 9) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(73, 30) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(73, 35) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(73, 36) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +5 >Emitted(73, 40) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +--- +>>> this.mode = mode; +1->^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^ +1-> +2 > mode +3 > +4 > mode +5 > : IMode +1->Emitted(74, 25) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(74, 34) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +3 >Emitted(74, 37) Source(79, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +4 >Emitted(74, 41) Source(79, 33) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +5 >Emitted(74, 42) Source(79, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +--- +>>> } +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { +2 > } +1 >Emitted(75, 21) Source(79, 44) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +2 >Emitted(75, 22) Source(79, 45) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.constructor) +--- +>>> State.prototype.clone = function () { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> + > public +2 > clone +3 > +1->Emitted(76, 21) Source(80, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(76, 42) Source(80, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(76, 45) Source(80, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +--- +>>> return this; +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1 >public clone():IState { + > +2 > return +3 > +4 > this +5 > ; +1 >Emitted(77, 25) Source(81, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(77, 31) Source(81, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +3 >Emitted(77, 32) Source(81, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +4 >Emitted(77, 36) Source(81, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +5 >Emitted(77, 37) Source(81, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(78, 21) Source(82, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +2 >Emitted(78, 22) Source(82, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.clone) +--- +>>> State.prototype.equals = function (other) { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^ +5 > ^^^^^ +1-> + > + > public +2 > equals +3 > +4 > public equals( +5 > other:IState +1->Emitted(79, 21) Source(84, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(79, 43) Source(84, 16) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(79, 46) Source(84, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +4 >Emitted(79, 56) Source(84, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +5 >Emitted(79, 61) Source(84, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +--- +>>> return this === other; +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^^^^ +7 > ^ +1 >):boolean { + > +2 > return +3 > +4 > this +5 > === +6 > other +7 > ; +1 >Emitted(80, 25) Source(85, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(80, 31) Source(85, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +3 >Emitted(80, 32) Source(85, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +4 >Emitted(80, 36) Source(85, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +5 >Emitted(80, 41) Source(85, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +6 >Emitted(80, 46) Source(85, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +7 >Emitted(80, 47) Source(85, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(81, 21) Source(86, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +2 >Emitted(81, 22) Source(86, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.equals) +--- +>>> State.prototype.getMode = function () { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> + > + > public +2 > getMode +3 > +1->Emitted(82, 21) Source(88, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(82, 44) Source(88, 17) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(82, 47) Source(88, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +--- +>>> return mode; +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1 >public getMode(): IMode { +2 > return +3 > +4 > mode +5 > ; +1 >Emitted(83, 25) Source(88, 29) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +2 >Emitted(83, 31) Source(88, 35) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +3 >Emitted(83, 32) Source(88, 36) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +4 >Emitted(83, 36) Source(88, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +5 >Emitted(83, 37) Source(88, 41) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(84, 21) Source(88, 42) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +2 >Emitted(84, 22) Source(88, 43) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State.getMode) +--- +>>> return State; +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(85, 21) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(85, 33) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +--- +>>> })(); +1 >^^^^^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } +1 >Emitted(86, 17) Source(89, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +2 >Emitted(86, 18) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.State) +3 >Emitted(86, 18) Source(78, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(86, 22) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> PlainText.State = State; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^^^^^-> +1-> +2 > State +3 > +4 > State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } +5 > +1->Emitted(87, 17) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(87, 32) Source(78, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(87, 35) Source(78, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(87, 40) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +5 >Emitted(87, 41) Source(89, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> var Mode = (function (_super) { +1->^^^^^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > export class +3 > Mode +1->Emitted(88, 17) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(88, 21) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(88, 25) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> __extends(Mode, _super); +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^ +1-> extends +2 > +3 > Mode +4 > extends AbstractMode +1->Emitted(89, 21) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(89, 31) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(89, 35) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +4 >Emitted(89, 45) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +--- +>>> function Mode() { +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > export class +3 > Mode +1 >Emitted(90, 21) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(90, 30) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(90, 34) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +--- +>>> _super.apply(this, arguments); +1->^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> extends +2 > AbstractMode +1->Emitted(91, 25) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(91, 55) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +--- +>>> } +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > +2 > } +1 >Emitted(92, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +2 >Emitted(92, 22) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.constructor) +--- +>>> Mode.prototype.getInitialState = function () { +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> +2 > getInitialState +3 > +1->Emitted(93, 21) Source(94, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(93, 51) Source(94, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(93, 54) Source(94, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +--- +>>> return new State(self); +1 >^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +1 >public getInitialState(): IState { + > +2 > return +3 > +4 > new +5 > State +6 > ( +7 > self +8 > ) +9 > ; +1 >Emitted(94, 25) Source(95, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(94, 31) Source(95, 10) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +3 >Emitted(94, 32) Source(95, 11) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +4 >Emitted(94, 36) Source(95, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +5 >Emitted(94, 41) Source(95, 20) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +6 >Emitted(94, 42) Source(95, 21) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +7 >Emitted(94, 46) Source(95, 25) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +8 >Emitted(94, 47) Source(95, 26) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +9 >Emitted(94, 48) Source(95, 27) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +--- +>>> }; +1 >^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(95, 21) Source(96, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +2 >Emitted(95, 22) Source(96, 4) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode.getInitialState) +--- +>>> return Mode; +1->^^^^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^-> +1-> + > + > + > +2 > } +1->Emitted(96, 21) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(96, 32) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +--- +>>> })(AbstractMode); +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^-> +1-> +2 > } +3 > +4 > export class Mode extends +5 > AbstractMode +6 > { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } +1->Emitted(97, 17) Source(99, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +2 >Emitted(97, 18) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText.Mode) +3 >Emitted(97, 18) Source(91, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(97, 20) Source(91, 28) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +5 >Emitted(97, 32) Source(91, 40) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +6 >Emitted(97, 34) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> PlainText.Mode = Mode; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 > Mode +3 > +4 > Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } +5 > +1->Emitted(98, 17) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(98, 31) Source(91, 19) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(98, 34) Source(91, 15) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +4 >Emitted(98, 38) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +5 >Emitted(98, 39) Source(99, 3) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +--- +>>> })(Languages.PlainText || (Languages.PlainText = {})); +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> + > +2 > } +3 > +4 > PlainText +5 > +6 > PlainText +7 > { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +1->Emitted(99, 13) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +2 >Emitted(99, 14) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages.PlainText) +3 >Emitted(99, 16) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(99, 35) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(99, 40) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +6 >Emitted(99, 59) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +7 >Emitted(99, 67) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +--- +>>> var PlainText = Languages.PlainText; +1 >^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^-> +1 > +2 > +3 > PlainText +4 > +5 > PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +6 > +1 >Emitted(100, 13) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(100, 17) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(100, 26) Source(76, 40) + SourceIndex(0) name (Sample.Thing.Languages) +4 >Emitted(100, 29) Source(76, 31) + SourceIndex(0) name (Sample.Thing.Languages) +5 >Emitted(100, 48) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +6 >Emitted(100, 49) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +--- +>>> })(Thing.Languages || (Thing.Languages = {})); +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> +2 > } +3 > +4 > Languages +5 > +6 > Languages +7 > .PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +1->Emitted(101, 9) Source(100, 1) + SourceIndex(0) name (Sample.Thing.Languages) +2 >Emitted(101, 10) Source(100, 2) + SourceIndex(0) name (Sample.Thing.Languages) +3 >Emitted(101, 12) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(101, 27) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(101, 32) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(101, 47) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +7 >Emitted(101, 55) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +--- +>>> var Languages = Thing.Languages; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^-> +1 > +2 > +3 > Languages +4 > +5 > Languages.PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +6 > +1 >Emitted(102, 9) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(102, 13) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(102, 22) Source(76, 30) + SourceIndex(0) name (Sample.Thing) +4 >Emitted(102, 25) Source(76, 21) + SourceIndex(0) name (Sample.Thing) +5 >Emitted(102, 40) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +6 >Emitted(102, 41) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +--- +>>> })(Sample.Thing || (Sample.Thing = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^ +7 > ^^^^^^^^ +1-> +2 > } +3 > +4 > Thing +5 > +6 > Thing +7 > .Languages.PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +1->Emitted(103, 5) Source(100, 1) + SourceIndex(0) name (Sample.Thing) +2 >Emitted(103, 6) Source(100, 2) + SourceIndex(0) name (Sample.Thing) +3 >Emitted(103, 8) Source(76, 15) + SourceIndex(0) name (Sample) +4 >Emitted(103, 20) Source(76, 20) + SourceIndex(0) name (Sample) +5 >Emitted(103, 25) Source(76, 15) + SourceIndex(0) name (Sample) +6 >Emitted(103, 37) Source(76, 20) + SourceIndex(0) name (Sample) +7 >Emitted(103, 45) Source(100, 2) + SourceIndex(0) name (Sample) +--- +>>> var Thing = Sample.Thing; +1 >^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^ +6 > ^ +1 > +2 > +3 > Thing +4 > +5 > Thing.Languages.PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +6 > +1 >Emitted(104, 5) Source(76, 15) + SourceIndex(0) name (Sample) +2 >Emitted(104, 9) Source(76, 15) + SourceIndex(0) name (Sample) +3 >Emitted(104, 14) Source(76, 20) + SourceIndex(0) name (Sample) +4 >Emitted(104, 17) Source(76, 15) + SourceIndex(0) name (Sample) +5 >Emitted(104, 29) Source(100, 2) + SourceIndex(0) name (Sample) +6 >Emitted(104, 30) Source(100, 2) + SourceIndex(0) name (Sample) +--- +>>>})(Sample || (Sample = {})); +1 > +2 >^ +3 > ^^ +4 > ^^^^^^ +5 > ^^^^^ +6 > ^^^^^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > Sample +5 > +6 > Sample +7 > .Thing.Languages.PlainText { + > + > export class State implements IState { + > constructor(private mode: IMode) { } + > public clone():IState { + > return this; + > } + > + > public equals(other:IState):boolean { + > return this === other; + > } + > + > public getMode(): IMode { return mode; } + > } + > + > export class Mode extends AbstractMode { + > + > // scenario 2 + > public getInitialState(): IState { + > return new State(self); + > } + > + > + > } + > } +1 >Emitted(105, 1) Source(100, 1) + SourceIndex(0) name (Sample) +2 >Emitted(105, 2) Source(100, 2) + SourceIndex(0) name (Sample) +3 >Emitted(105, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(105, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(105, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(105, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(105, 29) Source(100, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveCloduleReference.js b/tests/baselines/reference/recursiveCloduleReference.js new file mode 100644 index 0000000000000..804310e790540 --- /dev/null +++ b/tests/baselines/reference/recursiveCloduleReference.js @@ -0,0 +1,28 @@ +//// [recursiveCloduleReference.ts] +module M +{ + export class C { + } + export module C { + export var C = M.C + }; +}; + + + +//// [recursiveCloduleReference.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; + (function (C) { + C.C = M.C; + })(M.C || (M.C = {})); + var C = M.C; + ; +})(M || (M = {})); +; diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js new file mode 100644 index 0000000000000..25f20f57d233d --- /dev/null +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -0,0 +1,72 @@ +//// [recursiveComplicatedClasses.ts] +class Signature { + public parameters: ParameterSymbol[] = null; +} + +function aEnclosesB(a: Symbol) { + return true; +} + +class Symbol { + public bound: boolean; + public visible() { + var b: TypeSymbol; + return aEnclosesB(b); + } + +} +class InferenceSymbol extends Symbol { +} + +class ParameterSymbol extends InferenceSymbol { +} + +class TypeSymbol extends InferenceSymbol { +} + +//// [recursiveComplicatedClasses.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Signature = (function () { + function Signature() { + this.parameters = null; + } + return Signature; +})(); +function aEnclosesB(a) { + return true; +} +var Symbol = (function () { + function Symbol() { + } + Symbol.prototype.visible = function () { + var b; + return aEnclosesB(b); + }; + return Symbol; +})(); +var InferenceSymbol = (function (_super) { + __extends(InferenceSymbol, _super); + function InferenceSymbol() { + _super.apply(this, arguments); + } + return InferenceSymbol; +})(Symbol); +var ParameterSymbol = (function (_super) { + __extends(ParameterSymbol, _super); + function ParameterSymbol() { + _super.apply(this, arguments); + } + return ParameterSymbol; +})(InferenceSymbol); +var TypeSymbol = (function (_super) { + __extends(TypeSymbol, _super); + function TypeSymbol() { + _super.apply(this, arguments); + } + return TypeSymbol; +})(InferenceSymbol); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.errors.txt new file mode 100644 index 0000000000000..d3c0dd7660f10 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType1_moduleA.ts (0 errors) ==== + /// + import moduleC = require("moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType1_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType1_moduleDef.d.ts (1 errors) ==== + declare module "moduleC" { + import self = require("moduleC"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + } + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType1_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js new file mode 100644 index 0000000000000..9266faa397990 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType1.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType1_moduleDef.d.ts] +declare module "moduleC" { + import self = require("moduleC"); + export = self; +} + +//// [recursiveExportAssignmentAndFindAliasedType1_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType1_moduleA.ts] +/// +import moduleC = require("moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType1_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType1_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType1_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.errors.txt new file mode 100644 index 0000000000000..62da53a67ff37 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType2_moduleA.ts (0 errors) ==== + /// + import moduleC = require("moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType2_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType2_moduleDef.d.ts (1 errors) ==== + declare module "moduleC" { + import self = require("moduleD"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + } + declare module "moduleD" { + import self = require("moduleC"); + export = self; + } + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType2_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js new file mode 100644 index 0000000000000..644c592497055 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js @@ -0,0 +1,35 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType2.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType2_moduleDef.d.ts] +declare module "moduleC" { + import self = require("moduleD"); + export = self; +} +declare module "moduleD" { + import self = require("moduleC"); + export = self; +} + +//// [recursiveExportAssignmentAndFindAliasedType2_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType2_moduleA.ts] +/// +import moduleC = require("moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType2_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType2_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType2_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.errors.txt new file mode 100644 index 0000000000000..c60f66f744a8b --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.errors.txt @@ -0,0 +1,25 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType3_moduleA.ts (0 errors) ==== + /// + import moduleC = require("moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType3_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType3_moduleDef.d.ts (1 errors) ==== + declare module "moduleC" { + import self = require("moduleD"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + } + declare module "moduleD" { + import self = require("moduleE"); + export = self; + } + declare module "moduleE" { + import self = require("moduleC"); + export = self; + } + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType3_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js new file mode 100644 index 0000000000000..61a68e8321a25 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js @@ -0,0 +1,39 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType3.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType3_moduleDef.d.ts] +declare module "moduleC" { + import self = require("moduleD"); + export = self; +} +declare module "moduleD" { + import self = require("moduleE"); + export = self; +} +declare module "moduleE" { + import self = require("moduleC"); + export = self; +} + +//// [recursiveExportAssignmentAndFindAliasedType3_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType3_moduleA.ts] +/// +import moduleC = require("moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType3_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType3_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType3_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.errors.txt new file mode 100644 index 0000000000000..c722a8ef97734 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType4_moduleA.ts (0 errors) ==== + import moduleC = require("recursiveExportAssignmentAndFindAliasedType4_moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType4_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType4_moduleC.ts (1 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType4_moduleC"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType4_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js new file mode 100644 index 0000000000000..3c600641d0fa5 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js @@ -0,0 +1,32 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType4.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType4_moduleC.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType4_moduleC"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType4_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType4_moduleA.ts] +import moduleC = require("recursiveExportAssignmentAndFindAliasedType4_moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType4_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType4_moduleC.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType4_moduleC"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType4_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType4_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.errors.txt new file mode 100644 index 0000000000000..f78f3dd17f910 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType5_moduleA.ts (0 errors) ==== + import moduleC = require("recursiveExportAssignmentAndFindAliasedType5_moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType5_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType5_moduleC.ts (0 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType5_moduleD"); + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType5_moduleD.ts (1 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType5_moduleC"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType5_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js new file mode 100644 index 0000000000000..9d40dfc38e81c --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js @@ -0,0 +1,40 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType5.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType5_moduleC.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType5_moduleD"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType5_moduleD.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType5_moduleC"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType5_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType5_moduleA.ts] +import moduleC = require("recursiveExportAssignmentAndFindAliasedType5_moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType5_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType5_moduleD.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType5_moduleC"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType5_moduleC.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType5_moduleD"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType5_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType5_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.errors.txt b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.errors.txt new file mode 100644 index 0000000000000..bd2fdc05dfe47 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6_moduleA.ts (0 errors) ==== + import moduleC = require("recursiveExportAssignmentAndFindAliasedType6_moduleC"); + import ClassB = require("recursiveExportAssignmentAndFindAliasedType6_moduleB"); + export var b: ClassB; // This should result in type ClassB +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6_moduleC.ts (0 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleD"); + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6_moduleD.ts (0 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleE"); + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6_moduleE.ts (1 errors) ==== + import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleC"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Circular definition of import alias 'self'. + export = self; + +==== tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6_moduleB.ts (0 errors) ==== + class ClassB { } + export = ClassB; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js new file mode 100644 index 0000000000000..302c331c7e228 --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType6.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleC.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleD"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleD.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleE"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleE.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType6_moduleC"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleA.ts] +import moduleC = require("recursiveExportAssignmentAndFindAliasedType6_moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType6_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType6_moduleE.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType6_moduleC"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType6_moduleD.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType6_moduleE"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType6_moduleC.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType6_moduleD"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType6_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType6_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js new file mode 100644 index 0000000000000..a14aebe032e9f --- /dev/null +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js @@ -0,0 +1,50 @@ +//// [tests/cases/compiler/recursiveExportAssignmentAndFindAliasedType7.ts] //// + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleC.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType7_moduleD"); +var selfVar = self; +export = selfVar; + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleD.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType7_moduleE"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleE.ts] +import self = require("recursiveExportAssignmentAndFindAliasedType7_moduleC"); +export = self; + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleB.ts] +class ClassB { } +export = ClassB; + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleA.ts] +import moduleC = require("recursiveExportAssignmentAndFindAliasedType7_moduleC"); +import ClassB = require("recursiveExportAssignmentAndFindAliasedType7_moduleB"); +export var b: ClassB; // This should result in type ClassB + +//// [recursiveExportAssignmentAndFindAliasedType7_moduleE.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType7_moduleC"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType7_moduleD.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType7_moduleE"], function (require, exports, self) { + return self; +}); +//// [recursiveExportAssignmentAndFindAliasedType7_moduleC.js] +define(["require", "exports", "recursiveExportAssignmentAndFindAliasedType7_moduleD"], function (require, exports, self) { + var selfVar = self; + return selfVar; +}); +//// [recursiveExportAssignmentAndFindAliasedType7_moduleB.js] +define(["require", "exports"], function (require, exports) { + var ClassB = (function () { + function ClassB() { + } + return ClassB; + })(); + return ClassB; +}); +//// [recursiveExportAssignmentAndFindAliasedType7_moduleA.js] +define(["require", "exports"], function (require, exports) { + exports.b; +}); diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt new file mode 100644 index 0000000000000..b27cd423f7297 --- /dev/null +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -0,0 +1,66 @@ +==== tests/cases/compiler/recursiveFunctionTypes.ts (10 errors) ==== + function fn(): typeof fn { return 1; } + ~ +!!! Type 'number' is not assignable to type '() => typeof fn'. + + var x: number = fn; // error + ~~~~~~~~~~~~~~ +!!! Type '() => typeof fn' is not assignable to type 'number'. + var y: () => number = fn; // ok + ~~~~~~~~~~~~~~~~~~~~ +!!! Type '() => typeof fn' is not assignable to type '() => number': +!!! Type '() => typeof fn' is not assignable to type 'number'. + + var f: () => typeof g; + var g: () => typeof f; + + function f1(d: typeof f1) { } + + function f2(): typeof g2 { } + function g2(): typeof f2 { } + + interface I { } + function f3(): I { return f3; } + + var a: number = f3; // error + ~~~~~~~~~~~~~~ +!!! Type '() => I' is not assignable to type 'number'. + + class C { + static g(t: typeof C.g){ } + } + C.g(3); // error + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + + var f4: () => typeof f4; + f4 = 3; // error + + function f5() { return f5; } + + function f6(): typeof f6; + function f6(a: typeof f6): () => number; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Overload signature is not compatible with function implementation. + function f6(a?: any) { return f6; } + + f6("", 3); // error (arity mismatch) + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f6(""); // ok (function takes an any param) + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f6(); // ok + + declare function f7(): typeof f7; + declare function f7(a: typeof f7): () => number; + declare function f7(a: number): number; + declare function f7(a?: typeof f7): typeof f7; + + f7("", 3); // error (arity mismatch) + ~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f7(""); // ok (function takes an any param) + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.js b/tests/baselines/reference/recursiveFunctionTypes.js new file mode 100644 index 0000000000000..5c3fbeb557998 --- /dev/null +++ b/tests/baselines/reference/recursiveFunctionTypes.js @@ -0,0 +1,86 @@ +//// [recursiveFunctionTypes.ts] +function fn(): typeof fn { return 1; } + +var x: number = fn; // error +var y: () => number = fn; // ok + +var f: () => typeof g; +var g: () => typeof f; + +function f1(d: typeof f1) { } + +function f2(): typeof g2 { } +function g2(): typeof f2 { } + +interface I { } +function f3(): I { return f3; } + +var a: number = f3; // error + +class C { + static g(t: typeof C.g){ } +} +C.g(3); // error + +var f4: () => typeof f4; +f4 = 3; // error + +function f5() { return f5; } + +function f6(): typeof f6; +function f6(a: typeof f6): () => number; +function f6(a?: any) { return f6; } + +f6("", 3); // error (arity mismatch) +f6(""); // ok (function takes an any param) +f6(); // ok + +declare function f7(): typeof f7; +declare function f7(a: typeof f7): () => number; +declare function f7(a: number): number; +declare function f7(a?: typeof f7): typeof f7; + +f7("", 3); // error (arity mismatch) +f7(""); // ok (function takes an any param) +f7(); // ok + +//// [recursiveFunctionTypes.js] +function fn() { + return 1; +} +var x = fn; +var y = fn; +var f; +var g; +function f1(d) { +} +function f2() { +} +function g2() { +} +function f3() { + return f3; +} +var a = f3; +var C = (function () { + function C() { + } + C.g = function (t) { + }; + return C; +})(); +C.g(3); +var f4; +f4 = 3; +function f5() { + return f5; +} +function f6(a) { + return f6; +} +f6("", 3); +f6(""); +f6(); +f7("", 3); +f7(""); +f7(); diff --git a/tests/baselines/reference/recursiveFunctionTypes1.js b/tests/baselines/reference/recursiveFunctionTypes1.js new file mode 100644 index 0000000000000..2f2d072cb6b44 --- /dev/null +++ b/tests/baselines/reference/recursiveFunctionTypes1.js @@ -0,0 +1,13 @@ +//// [recursiveFunctionTypes1.ts] +class C { + static g(t: typeof C.g){ } +} + +//// [recursiveFunctionTypes1.js] +var C = (function () { + function C() { + } + C.g = function (t) { + }; + return C; +})(); diff --git a/tests/baselines/reference/recursiveGenericMethodcall.js b/tests/baselines/reference/recursiveGenericMethodcall.js new file mode 100644 index 0000000000000..915d8f2b0e3ba --- /dev/null +++ b/tests/baselines/reference/recursiveGenericMethodcall.js @@ -0,0 +1,12 @@ +//// [recursiveGenericMethodCall.ts] +interface Generator { (): T; } + +function Generate(func: Generator): T { + return Generate(func); +} + + +//// [recursiveGenericMethodCall.js] +function Generate(func) { + return Generate(func); +} diff --git a/tests/baselines/reference/recursiveGenericSignatureInstantiation.js b/tests/baselines/reference/recursiveGenericSignatureInstantiation.js new file mode 100644 index 0000000000000..2d3c73895e962 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericSignatureInstantiation.js @@ -0,0 +1,10 @@ +//// [recursiveGenericSignatureInstantiation.ts] +function f6(x: T) { + return f6(x); +} + + +//// [recursiveGenericSignatureInstantiation.js] +function f6(x) { + return f6(x); +} diff --git a/tests/baselines/reference/recursiveGenericSignatureInstantiation2.js b/tests/baselines/reference/recursiveGenericSignatureInstantiation2.js new file mode 100644 index 0000000000000..66c4f6b3f634a --- /dev/null +++ b/tests/baselines/reference/recursiveGenericSignatureInstantiation2.js @@ -0,0 +1,4 @@ +//// [recursiveGenericSignatureInstantiation2.ts] + + +//// [recursiveGenericSignatureInstantiation2.js] diff --git a/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt b/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt new file mode 100644 index 0000000000000..90334d7c8cf54 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/recursiveGenericTypeHierarchy.ts (4 errors) ==== + // used to ICE + interface A, S extends A> { } + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + interface B, S extends B> extends A, B> { } + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveGenericTypeHierarchy.js b/tests/baselines/reference/recursiveGenericTypeHierarchy.js new file mode 100644 index 0000000000000..722d28bc24909 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericTypeHierarchy.js @@ -0,0 +1,6 @@ +//// [recursiveGenericTypeHierarchy.ts] +// used to ICE +interface A, S extends A> { } +interface B, S extends B> extends A, B> { } + +//// [recursiveGenericTypeHierarchy.js] diff --git a/tests/baselines/reference/recursiveGetterAccess.errors.txt b/tests/baselines/reference/recursiveGetterAccess.errors.txt new file mode 100644 index 0000000000000..5100311c8741b --- /dev/null +++ b/tests/baselines/reference/recursiveGetterAccess.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/recursiveGetterAccess.ts (1 errors) ==== + class MyClass { + get testProp() { return this.testProp; } + ~~~~~~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt b/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt new file mode 100644 index 0000000000000..f5dc6300a8536 --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/recursiveIdenticalAssignment.ts (1 errors) ==== + interface A { + x: A + } + + interface B>> { // error, constraint referencing itself + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + x: B + } + + var a: A> + var b: B> = a // Error, any does not satisfy constraint B> + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.js b/tests/baselines/reference/recursiveIdenticalAssignment.js new file mode 100644 index 0000000000000..31987aa786657 --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalAssignment.js @@ -0,0 +1,16 @@ +//// [recursiveIdenticalAssignment.ts] +interface A { + x: A +} + +interface B>> { // error, constraint referencing itself + x: B +} + +var a: A> +var b: B> = a // Error, any does not satisfy constraint B> + + +//// [recursiveIdenticalAssignment.js] +var a; +var b = a; diff --git a/tests/baselines/reference/recursiveIdenticalOverloadResolution.js b/tests/baselines/reference/recursiveIdenticalOverloadResolution.js new file mode 100644 index 0000000000000..e1ea203ac5bcd --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalOverloadResolution.js @@ -0,0 +1,31 @@ +//// [recursiveIdenticalOverloadResolution.ts] + +module M { + + interface I { (i: I): I; } + + function f(p: I) { return f }; + + var i: I; + + f(i); + + f(f(i)); + + f((f(f(i)))); + +} + + +//// [recursiveIdenticalOverloadResolution.js] +var M; +(function (M) { + function f(p) { + return f; + } + ; + var i; + f(i); + f(f(i)); + f((f(f(i)))); +})(M || (M = {})); diff --git a/tests/baselines/reference/recursiveInference1.js b/tests/baselines/reference/recursiveInference1.js new file mode 100644 index 0000000000000..839e13130f230 --- /dev/null +++ b/tests/baselines/reference/recursiveInference1.js @@ -0,0 +1,9 @@ +//// [recursiveInference1.ts] +function fib(x:number) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); } +var result = fib(5); + +//// [recursiveInference1.js] +function fib(x) { + return x <= 1 ? x : fib(x - 1) + fib(x - 2); +} +var result = fib(5); diff --git a/tests/baselines/reference/recursiveInferenceBug.errors.txt b/tests/baselines/reference/recursiveInferenceBug.errors.txt new file mode 100644 index 0000000000000..d331520ef9535 --- /dev/null +++ b/tests/baselines/reference/recursiveInferenceBug.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/recursiveInferenceBug.ts (1 errors) ==== + function f(x: number) { + var z = f(x); + return x; + } + + + var zz = { + g: () =>{ }, + get f() { return "abc"; }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + }; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInheritance.errors.txt b/tests/baselines/reference/recursiveInheritance.errors.txt new file mode 100644 index 0000000000000..1447942bd68bb --- /dev/null +++ b/tests/baselines/reference/recursiveInheritance.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/recursiveInheritance.ts (2 errors) ==== + + interface I5 extends I5 { // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + foo():void; + ~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'I5' recursively references itself as a base type. + + interface i8 extends i9 { } // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Type 'i8' recursively references itself as a base type. + interface i9 extends i8 { } // error + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInheritance.js b/tests/baselines/reference/recursiveInheritance.js new file mode 100644 index 0000000000000..820bee28bcdaa --- /dev/null +++ b/tests/baselines/reference/recursiveInheritance.js @@ -0,0 +1,11 @@ +//// [recursiveInheritance.ts] + +interface I5 extends I5 { // error + foo():void; +} + +interface i8 extends i9 { } // error +interface i9 extends i8 { } // error + + +//// [recursiveInheritance.js] diff --git a/tests/baselines/reference/recursiveInheritance2.js b/tests/baselines/reference/recursiveInheritance2.js new file mode 100644 index 0000000000000..6773165b60361 --- /dev/null +++ b/tests/baselines/reference/recursiveInheritance2.js @@ -0,0 +1,24 @@ +//// [recursiveInheritance2.ts] +interface A { (): B; }; +declare var a: A; +var x = a(); + +interface B { (): C; }; +declare var b: B; +var y = b(); + +interface C { (): A; }; +declare var c: C; +var z = c(); + +x = y; + + +//// [recursiveInheritance2.js] +; +var x = a(); +; +var y = b(); +; +var z = c(); +x = y; diff --git a/tests/baselines/reference/recursiveInheritance3.errors.txt b/tests/baselines/reference/recursiveInheritance3.errors.txt new file mode 100644 index 0000000000000..5c0e34fabac76 --- /dev/null +++ b/tests/baselines/reference/recursiveInheritance3.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/recursiveInheritance3.ts (1 errors) ==== + class C implements I { + ~ +!!! Class 'C' incorrectly implements interface 'I': +!!! Property 'other' is missing in type 'C'. + public foo(x: any) { return x; } + private x = 1; + } + + interface I extends C { + other(x: any): any; + } \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInheritance3.js b/tests/baselines/reference/recursiveInheritance3.js new file mode 100644 index 0000000000000..710b691fa9406 --- /dev/null +++ b/tests/baselines/reference/recursiveInheritance3.js @@ -0,0 +1,20 @@ +//// [recursiveInheritance3.ts] +class C implements I { + public foo(x: any) { return x; } + private x = 1; +} + +interface I extends C { + other(x: any): any; +} + +//// [recursiveInheritance3.js] +var C = (function () { + function C() { + this.x = 1; + } + C.prototype.foo = function (x) { + return x; + }; + return C; +})(); diff --git a/tests/baselines/reference/recursiveInheritanceGeneric.errors.txt b/tests/baselines/reference/recursiveInheritanceGeneric.errors.txt new file mode 100644 index 0000000000000..cab1067807ab1 --- /dev/null +++ b/tests/baselines/reference/recursiveInheritanceGeneric.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/recursiveInheritanceGeneric.ts (1 errors) ==== + interface I5 extends I5 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + foo():void; + ~~~~~~~~~~~~~~~ + } + ~ +!!! Type 'I5' recursively references itself as a base type. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInheritanceGeneric.js b/tests/baselines/reference/recursiveInheritanceGeneric.js new file mode 100644 index 0000000000000..be1907908b0c4 --- /dev/null +++ b/tests/baselines/reference/recursiveInheritanceGeneric.js @@ -0,0 +1,6 @@ +//// [recursiveInheritanceGeneric.ts] +interface I5 extends I5 { + foo():void; +} + +//// [recursiveInheritanceGeneric.js] diff --git a/tests/baselines/reference/recursiveInitializer.js b/tests/baselines/reference/recursiveInitializer.js new file mode 100644 index 0000000000000..f8a06fc4feaa8 --- /dev/null +++ b/tests/baselines/reference/recursiveInitializer.js @@ -0,0 +1,34 @@ +//// [recursiveInitializer.ts] +// number unless otherwise specified +var n1 = n1++; +var n2: number = n2 + n2; +var n3 /* any */ = n3 + n3; + +// string unless otherwise specified +var s1 = s1 + ''; +var s2 /* any */ = s2 + s2; +var s3 : string = s3 + s3; +var s4 = '' + s4; + +// boolean unless otherwise specified +var b1 = !b1; +var b2 = !!b2; +var b3 = !b3 || b3; // expected boolean here. actually 'any' +var b4 = (!b4) && b4; // expected boolean here. actually 'any' + +// (x:string) => any +var f = (x: string) => f(x); + +//// [recursiveInitializer.js] +var n1 = n1++; +var n2 = n2 + n2; +var n3 = n3 + n3; +var s1 = s1 + ''; +var s2 = s2 + s2; +var s3 = s3 + s3; +var s4 = '' + s4; +var b1 = !b1; +var b2 = !!b2; +var b3 = !b3 || b3; +var b4 = (!b4) && b4; +var f = function (x) { return f(x); }; diff --git a/tests/baselines/reference/recursiveMods.js b/tests/baselines/reference/recursiveMods.js new file mode 100644 index 0000000000000..d897224166eeb --- /dev/null +++ b/tests/baselines/reference/recursiveMods.js @@ -0,0 +1,52 @@ +//// [recursiveMods.ts] +export module Foo { + export class C {} +} + +export module Foo { + + function Bar() : C { + if (true) { return Bar();} + return new C(); + } + + function Baz() : C { + var c = Baz(); + return Bar(); + } + + function Gar() { + var c : C = Baz(); + return; + } + +} + + +//// [recursiveMods.js] +(function (Foo) { + var C = (function () { + function C() { + } + return C; + })(); + Foo.C = C; +})(exports.Foo || (exports.Foo = {})); +var Foo = exports.Foo; +(function (Foo) { + function Bar() { + if (true) { + return Bar(); + } + return new Foo.C(); + } + function Baz() { + var c = Baz(); + return Bar(); + } + function Gar() { + var c = Baz(); + return; + } +})(exports.Foo || (exports.Foo = {})); +var Foo = exports.Foo; diff --git a/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt b/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt new file mode 100644 index 0000000000000..f193b592fc9df --- /dev/null +++ b/tests/baselines/reference/recursiveNamedLambdaCall.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/recursiveNamedLambdaCall.ts (5 errors) ==== + var promise = function( obj ) { + + if ( top && top.doScroll ) { + ~~~ +!!! Cannot find name 'top'. + ~~~ +!!! Cannot find name 'top'. + (function doScrollCheck() { + if ( false ) { + + try { + top.doScroll("left"); + ~~~ +!!! Cannot find name 'top'. + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + ~~~~~~~~~~ +!!! Cannot find name 'setTimeout'. + } + + // detach all dom ready events + detach(); + ~~~~~~ +!!! Cannot find name 'detach'. + + } + })(); + } + }; \ No newline at end of file diff --git a/tests/baselines/reference/recursiveNamedLambdaCall.js b/tests/baselines/reference/recursiveNamedLambdaCall.js new file mode 100644 index 0000000000000..e44312aec8642 --- /dev/null +++ b/tests/baselines/reference/recursiveNamedLambdaCall.js @@ -0,0 +1,37 @@ +//// [recursiveNamedLambdaCall.ts] +var promise = function( obj ) { + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( false ) { + + try { + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + } + })(); + } +}; + +//// [recursiveNamedLambdaCall.js] +var promise = function (obj) { + if (top && top.doScroll) { + (function doScrollCheck() { + if (false) { + try { + top.doScroll("left"); + } + catch (e) { + return setTimeout(doScrollCheck, 50); + } + detach(); + } + })(); + } +}; diff --git a/tests/baselines/reference/recursiveObjectLiteral.js b/tests/baselines/reference/recursiveObjectLiteral.js new file mode 100644 index 0000000000000..70de48d249943 --- /dev/null +++ b/tests/baselines/reference/recursiveObjectLiteral.js @@ -0,0 +1,5 @@ +//// [recursiveObjectLiteral.ts] +var a = { f: a }; + +//// [recursiveObjectLiteral.js] +var a = { f: a }; diff --git a/tests/baselines/reference/recursiveProperties.js b/tests/baselines/reference/recursiveProperties.js new file mode 100644 index 0000000000000..63644484956bb --- /dev/null +++ b/tests/baselines/reference/recursiveProperties.js @@ -0,0 +1,34 @@ +//// [recursiveProperties.ts] +class A { + get testProp() { return this.testProp; } +} + +class B { + set testProp(value:string) { this.testProp = value; } +} + +//// [recursiveProperties.js] +var A = (function () { + function A() { + } + Object.defineProperty(A.prototype, "testProp", { + get: function () { + return this.testProp; + }, + enumerable: true, + configurable: true + }); + return A; +})(); +var B = (function () { + function B() { + } + Object.defineProperty(B.prototype, "testProp", { + set: function (value) { + this.testProp = value; + }, + enumerable: true, + configurable: true + }); + return B; +})(); diff --git a/tests/baselines/reference/recursiveReturns.js b/tests/baselines/reference/recursiveReturns.js new file mode 100644 index 0000000000000..d01825f8cbf18 --- /dev/null +++ b/tests/baselines/reference/recursiveReturns.js @@ -0,0 +1,32 @@ +//// [recursiveReturns.ts] +function R1() { + R1(); + return; +} + +function R2() { R2(); } + +function R3(n:number) { + if (n == 0) { + //return; + } + else { + R3(n--); + } +} + +//// [recursiveReturns.js] +function R1() { + R1(); + return; +} +function R2() { + R2(); +} +function R3(n) { + if (n == 0) { + } + else { + R3(n--); + } +} diff --git a/tests/baselines/reference/recursiveSpecializationOfExtendedTypeWithError.js b/tests/baselines/reference/recursiveSpecializationOfExtendedTypeWithError.js new file mode 100644 index 0000000000000..c2bffb4bf21b9 --- /dev/null +++ b/tests/baselines/reference/recursiveSpecializationOfExtendedTypeWithError.js @@ -0,0 +1,9 @@ +//// [recursiveSpecializationOfExtendedTypeWithError.ts] +interface HTMLSelectElement { + options: HTMLSelectElement; + (name: A): any; +} + + + +//// [recursiveSpecializationOfExtendedTypeWithError.js] diff --git a/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt b/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt new file mode 100644 index 0000000000000..0541b26364e18 --- /dev/null +++ b/tests/baselines/reference/recursiveSpecializationOfSignatures.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/recursiveSpecializationOfSignatures.ts (1 errors) ==== + class S0 { + set S1(S2: S0) { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + constructor(public S17: S0 A>) { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeIdentity.js b/tests/baselines/reference/recursiveTypeIdentity.js new file mode 100644 index 0000000000000..f0f47c787a5e2 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeIdentity.js @@ -0,0 +1,15 @@ +//// [recursiveTypeIdentity.ts] +interface A { + (x: T): void; +} + +interface B { + (x: T): void; +} + +interface C { + (x: A): void; + (x: B): void; +} + +//// [recursiveTypeIdentity.js] diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt b/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt new file mode 100644 index 0000000000000..a9002001d260f --- /dev/null +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts (1 errors) ==== + class G { + x: G>; // infinitely expanding type reference + } + + class Foo> { // error, constraint referencing itself + ~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + bar: T; + } + + class D { + x: G>; + } + + var c1 = new Foo>(); // ok, circularity in assignment compat check causes success \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.js b/tests/baselines/reference/recursiveTypeInGenericConstraint.js new file mode 100644 index 0000000000000..7f4e9845b95df --- /dev/null +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.js @@ -0,0 +1,32 @@ +//// [recursiveTypeInGenericConstraint.ts] +class G { + x: G>; // infinitely expanding type reference +} + +class Foo> { // error, constraint referencing itself + bar: T; +} + +class D { + x: G>; +} + +var c1 = new Foo>(); // ok, circularity in assignment compat check causes success + +//// [recursiveTypeInGenericConstraint.js] +var G = (function () { + function G() { + } + return G; +})(); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var D = (function () { + function D() { + } + return D; +})(); +var c1 = new Foo(); diff --git a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt new file mode 100644 index 0000000000000..3e4e454656d2e --- /dev/null +++ b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts (1 errors) ==== + class A { } + ~ +!!! Generic type 'A' requires 1 type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js new file mode 100644 index 0000000000000..45761b9bc284f --- /dev/null +++ b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.js @@ -0,0 +1,9 @@ +//// [recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts] +class A { } + +//// [recursiveTypeParameterConstraintReferenceLacksTypeArgs.js] +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/recursiveTypeParameterReferenceError1.js b/tests/baselines/reference/recursiveTypeParameterReferenceError1.js new file mode 100644 index 0000000000000..4bc466bc6cf7d --- /dev/null +++ b/tests/baselines/reference/recursiveTypeParameterReferenceError1.js @@ -0,0 +1,34 @@ +//// [recursiveTypeParameterReferenceError1.ts] +class X { } +interface Foo { + z: Foo>; // error +} +var f: Foo; +var r = f.z; + + +class C2 { + x: T; +} +interface Foo2 { + ofC4: C2<{ x: T }> // ok +} +var f2: Foo2; +var r2 = f2.ofC4; + + +//// [recursiveTypeParameterReferenceError1.js] +var X = (function () { + function X() { + } + return X; +})(); +var f; +var r = f.z; +var C2 = (function () { + function C2() { + } + return C2; +})(); +var f2; +var r2 = f2.ofC4; diff --git a/tests/baselines/reference/recursiveTypeParameterReferenceError2.js b/tests/baselines/reference/recursiveTypeParameterReferenceError2.js new file mode 100644 index 0000000000000..cfa1a84a60664 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeParameterReferenceError2.js @@ -0,0 +1,15 @@ +//// [recursiveTypeParameterReferenceError2.ts] +interface List { + data: T; + next: List; + owner: List>; // Error, recursive reference with wrapped T +} + +interface List2 { + data: T; + next: List2; + owner: List2>; // Ok +} + + +//// [recursiveTypeParameterReferenceError2.js] diff --git a/tests/baselines/reference/recursiveTypes1.errors.txt b/tests/baselines/reference/recursiveTypes1.errors.txt new file mode 100644 index 0000000000000..0780a8b4b4306 --- /dev/null +++ b/tests/baselines/reference/recursiveTypes1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/recursiveTypes1.ts (2 errors) ==== + interface Entity> { + ~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + X: T; + Y: T; + } + + interface Person> extends Entity { + ~~~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + n: number; + } + + interface Customer extends Person { + s: string; + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypes1.js b/tests/baselines/reference/recursiveTypes1.js new file mode 100644 index 0000000000000..323fda5d88fd8 --- /dev/null +++ b/tests/baselines/reference/recursiveTypes1.js @@ -0,0 +1,16 @@ +//// [recursiveTypes1.ts] +interface Entity> { + X: T; + Y: T; +} + +interface Person> extends Entity { + n: number; +} + +interface Customer extends Person { + s: string; +} + + +//// [recursiveTypes1.js] diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt new file mode 100644 index 0000000000000..5d7610bf256a7 --- /dev/null +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt @@ -0,0 +1,46 @@ +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts (1 errors) ==== + class List { + data: T; + next: List>; + } + + class MyList { + data: T; + next: MyList>; + } + + function foo(x: List); + function foo(x: List); // error, duplicate + function foo(x: List) { + } + + function foo2(x: List); + function foo2(x: MyList); // ok, nominally compared with first overload + function foo2(x: any) { + } + + function other, U>() { + ~~~~~~~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + // error but wrong error + // BUG 838247 + function foo3(x: T); + function foo3(x: MyList) { } + + // should be error + // BUG 838247 + function foo4(x: T); + function foo4(x: List) { } + + // ok + function foo5(x: T): string; + function foo5(x: List): number; + function foo5(x: MyList): boolean; + function foo5(x: any): any { return null; } + + var list: List; + var myList: MyList; + + var r = foo5(list); + var r2 = foo5(myList); + } \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js new file mode 100644 index 0000000000000..b056e90e909b6 --- /dev/null +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.js @@ -0,0 +1,73 @@ +//// [recursiveTypesUsedAsFunctionParameters.ts] +class List { + data: T; + next: List>; +} + +class MyList { + data: T; + next: MyList>; +} + +function foo(x: List); +function foo(x: List); // error, duplicate +function foo(x: List) { +} + +function foo2(x: List); +function foo2(x: MyList); // ok, nominally compared with first overload +function foo2(x: any) { +} + +function other, U>() { + // error but wrong error + // BUG 838247 + function foo3(x: T); + function foo3(x: MyList) { } + + // should be error + // BUG 838247 + function foo4(x: T); + function foo4(x: List) { } + + // ok + function foo5(x: T): string; + function foo5(x: List): number; + function foo5(x: MyList): boolean; + function foo5(x: any): any { return null; } + + var list: List; + var myList: MyList; + + var r = foo5(list); + var r2 = foo5(myList); +} + +//// [recursiveTypesUsedAsFunctionParameters.js] +var List = (function () { + function List() { + } + return List; +})(); +var MyList = (function () { + function MyList() { + } + return MyList; +})(); +function foo(x) { +} +function foo2(x) { +} +function other() { + function foo3(x) { + } + function foo4(x) { + } + function foo5(x) { + return null; + } + var list; + var myList; + var r = foo5(list); + var r2 = foo5(myList); +} diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js new file mode 100644 index 0000000000000..e7b6c30059e8d --- /dev/null +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -0,0 +1,64 @@ +//// [recursivelySpecializedConstructorDeclaration.ts] +module MsPortal.Controls.Base.ItemList { + + export interface Interface { + // Removing this line fixes the constructor of ItemValue + options: ViewModel; + } + + export class ItemValue { + constructor(value: T) { + } + } + + export class ViewModel extends ItemValue { + } +} + +// Generates: +/* +declare module MsPortal.Controls.Base.ItemList { + interface Interface { + options: ViewModel; + } + class ItemValue { + constructor(value: T); + } + class ViewModel extends ItemValue { + } +} +*/ + +//// [recursivelySpecializedConstructorDeclaration.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var MsPortal; +(function (MsPortal) { + (function (Controls) { + (function (Base) { + (function (ItemList) { + var ItemValue = (function () { + function ItemValue(value) { + } + return ItemValue; + })(); + ItemList.ItemValue = ItemValue; + var ViewModel = (function (_super) { + __extends(ViewModel, _super); + function ViewModel() { + _super.apply(this, arguments); + } + return ViewModel; + })(ItemValue); + ItemList.ViewModel = ViewModel; + })(Base.ItemList || (Base.ItemList = {})); + var ItemList = Base.ItemList; + })(Controls.Base || (Controls.Base = {})); + var Base = Controls.Base; + })(MsPortal.Controls || (MsPortal.Controls = {})); + var Controls = MsPortal.Controls; +})(MsPortal || (MsPortal = {})); diff --git a/tests/baselines/reference/redeclarationOfVarWithGenericType.js b/tests/baselines/reference/redeclarationOfVarWithGenericType.js new file mode 100644 index 0000000000000..94f64521fab87 --- /dev/null +++ b/tests/baselines/reference/redeclarationOfVarWithGenericType.js @@ -0,0 +1,7 @@ +//// [redeclarationOfVarWithGenericType.ts] +var a1: { fn(x: T): T }; +var a1: { fn(x: T): T }; + +//// [redeclarationOfVarWithGenericType.js] +var a1; +var a1; diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt new file mode 100644 index 0000000000000..5ac77d01f630a --- /dev/null +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/redefineArray.ts (1 errors) ==== + Array = function (n:number, s:string) {return n;}; + ~~~~~ +!!! Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +!!! Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/redefineArray.js b/tests/baselines/reference/redefineArray.js new file mode 100644 index 0000000000000..9349423243628 --- /dev/null +++ b/tests/baselines/reference/redefineArray.js @@ -0,0 +1,7 @@ +//// [redefineArray.ts] +Array = function (n:number, s:string) {return n;}; + +//// [redefineArray.js] +Array = function (n, s) { + return n; +}; diff --git a/tests/baselines/reference/relativePathMustResolve.errors.txt b/tests/baselines/reference/relativePathMustResolve.errors.txt new file mode 100644 index 0000000000000..6f1d6705d0f7e --- /dev/null +++ b/tests/baselines/reference/relativePathMustResolve.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== + import foo = require('./test/foo'); + ~~~~~~~~~~~~ +!!! Cannot find external module './test/foo'. + var z = foo.x + 10; + +==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== + export var x = 42; + \ No newline at end of file diff --git a/tests/baselines/reference/relativePathMustResolve.js b/tests/baselines/reference/relativePathMustResolve.js new file mode 100644 index 0000000000000..e149d382df665 --- /dev/null +++ b/tests/baselines/reference/relativePathMustResolve.js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/externalModules/relativePathMustResolve.ts] //// + +//// [foo_0.ts] +export var x = 42; + +//// [foo_1.ts] +import foo = require('./test/foo'); +var z = foo.x + 10; + + +//// [foo_1.js] +var foo = require('./test/foo'); +var z = foo.x + 10; diff --git a/tests/baselines/reference/relativePathToDeclarationFile.errors.txt b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt new file mode 100644 index 0000000000000..276e79d7fdf46 --- /dev/null +++ b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/externalModules/test/file1.ts (0 errors) ==== + import foo = require('foo'); + import other = require('./other'); + import relMod = require('./sub/relMod'); + + if(foo.M2.x){ + var x = new relMod(other.M2.x.charCodeAt(0)); + } + +==== tests/cases/conformance/externalModules/test/foo.d.ts (1 errors) ==== + export declare module M2 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + export var x: boolean; + ~~~~~~~~~~~~~~~~~~~~~~~ + } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + +==== tests/cases/conformance/externalModules/test/other.d.ts (0 errors) ==== + export declare module M2 { + export var x: string; + } + +==== tests/cases/conformance/externalModules/test/sub/relMod.d.ts (0 errors) ==== + declare class Test { + constructor(x: number); + } + export = Test; + \ No newline at end of file diff --git a/tests/baselines/reference/relativePathToDeclarationFile.js b/tests/baselines/reference/relativePathToDeclarationFile.js new file mode 100644 index 0000000000000..e50db2be92685 --- /dev/null +++ b/tests/baselines/reference/relativePathToDeclarationFile.js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts] //// + +//// [foo.d.ts] +export declare module M2 { + export var x: boolean; +} + +//// [other.d.ts] +export declare module M2 { + export var x: string; +} + +//// [relMod.d.ts] +declare class Test { + constructor(x: number); +} +export = Test; + +//// [file1.ts] +import foo = require('foo'); +import other = require('./other'); +import relMod = require('./sub/relMod'); + +if(foo.M2.x){ + var x = new relMod(other.M2.x.charCodeAt(0)); +} + + +//// [file1.js] +var foo = require('foo'); +var other = require('./other'); +var relMod = require('./sub/relMod'); +if (foo.M2.x) { + var x = new relMod(other.M2.x.charCodeAt(0)); +} diff --git a/tests/baselines/reference/reorderProperties.js b/tests/baselines/reference/reorderProperties.js new file mode 100644 index 0000000000000..a6cab23dbc4b6 --- /dev/null +++ b/tests/baselines/reference/reorderProperties.js @@ -0,0 +1,24 @@ +//// [reorderProperties.ts] +interface A { + x: T +} + +interface B { + x: T +} + +interface C extends A> { + y: S +} + +interface D extends B> { + y: S +} + +var c: C<{ s: string; n: number }> +var d: D<{ n: number; s: string }> = c + + +//// [reorderProperties.js] +var c; +var d = c; diff --git a/tests/baselines/reference/requireEmitSemicolon.js b/tests/baselines/reference/requireEmitSemicolon.js new file mode 100644 index 0000000000000..88be6b03d8675 --- /dev/null +++ b/tests/baselines/reference/requireEmitSemicolon.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/requireEmitSemicolon.ts] //// + +//// [requireEmitSemicolon_0.ts] +export module Models { + export class Person { + constructor(name: string) { } + } +} + +//// [requireEmitSemicolon_1.ts] +/// +import P = require("requireEmitSemicolon_0"); // bug was we were not emitting a ; here and causing runtime failures in node + +export module Database { + export class DB { + public findPerson(id: number): P.Models.Person { + return new P.Models.Person("Rock"); + } + } +} + +//// [requireEmitSemicolon_0.js] +define(["require", "exports"], function (require, exports) { + (function (Models) { + var Person = (function () { + function Person(name) { + } + return Person; + })(); + Models.Person = Person; + })(exports.Models || (exports.Models = {})); + var Models = exports.Models; +}); +//// [requireEmitSemicolon_1.js] +define(["require", "exports", "requireEmitSemicolon_0"], function (require, exports, P) { + (function (Database) { + var DB = (function () { + function DB() { + } + DB.prototype.findPerson = function (id) { + return new P.Models.Person("Rock"); + }; + return DB; + })(); + Database.DB = DB; + })(exports.Database || (exports.Database = {})); + var Database = exports.Database; +}); diff --git a/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt new file mode 100644 index 0000000000000..50f57d80947f2 --- /dev/null +++ b/tests/baselines/reference/requireOfAnEmptyFile1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/requireOfAnEmptyFile1_a.ts (1 errors) ==== + //requireOfAnEmptyFile1 + + import fs = require('requireOfAnEmptyFile1_b'); + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! File 'requireOfAnEmptyFile1_b.ts' is not an external module. + +==== tests/cases/compiler/requireOfAnEmptyFile1_b.ts (0 errors) ==== + \ No newline at end of file diff --git a/tests/baselines/reference/requireOfAnEmptyFile1.js b/tests/baselines/reference/requireOfAnEmptyFile1.js new file mode 100644 index 0000000000000..3f4d256490106 --- /dev/null +++ b/tests/baselines/reference/requireOfAnEmptyFile1.js @@ -0,0 +1,12 @@ +//// [tests/cases/compiler/requireOfAnEmptyFile1.ts] //// + +//// [requireOfAnEmptyFile1_a.ts] +//requireOfAnEmptyFile1 + +import fs = require('requireOfAnEmptyFile1_b'); + +//// [requireOfAnEmptyFile1_b.ts] + + +//// [requireOfAnEmptyFile1_b.js] +//// [requireOfAnEmptyFile1_a.js] diff --git a/tests/baselines/reference/reservedWords.js b/tests/baselines/reference/reservedWords.js new file mode 100644 index 0000000000000..173a987acc001 --- /dev/null +++ b/tests/baselines/reference/reservedWords.js @@ -0,0 +1,33 @@ +//// [reservedWords.ts] +var obj = { + if: 0, + debugger: 2, + break: 3, + function: 4 +} + +//This compiles. + +var obj2 = { + if: 0, + while: 1, + debugger: 2, + break: 3, + function: 4 +} + + +//// [reservedWords.js] +var obj = { + if: 0, + debugger: 2, + break: 3, + function: 4 +}; +var obj2 = { + if: 0, + while: 1, + debugger: 2, + break: 3, + function: 4 +}; diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js new file mode 100644 index 0000000000000..9dbf0160d9745 --- /dev/null +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -0,0 +1,7408 @@ +//// [resolvingClassDeclarationWhenInBaseTypeResolution.ts] +module rionegrensis { + export class caniventer extends Lanthanum.nitidus { + salomonseni() : caniventer { var x : caniventer; () => { var y = this; }; return x; } + uchidai() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } + raffrayana() : lavali.otion { var x : lavali.otion; () => { var y = this; }; return x; } + Uranium() : minutus.inez, trivirgatus.falconeri> { var x : minutus.inez, trivirgatus.falconeri>; () => { var y = this; }; return x; } + nayaur() : gabriellae.amicus { var x : gabriellae.amicus; () => { var y = this; }; return x; } + } + export class veraecrucis extends trivirgatus.mixtus { + naso() : panamensis.setulosus> { var x : panamensis.setulosus>; () => { var y = this; }; return x; } + vancouverensis() : imperfecta.ciliolabrum { var x : imperfecta.ciliolabrum; () => { var y = this; }; return x; } + africana() : argurus.gilbertii, sagitta.cinereus> { var x : argurus.gilbertii, sagitta.cinereus>; () => { var y = this; }; return x; } + palliolata() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } + nivicola() : samarensis.pallidus { var x : samarensis.pallidus; () => { var y = this; }; return x; } + } +} +module julianae { + export class steerii { + } + export class nudicaudus { + brandtii() : argurus.germaini { var x : argurus.germaini; () => { var y = this; }; return x; } + maxwellii() : ruatanica.Praseodymium { var x : ruatanica.Praseodymium; () => { var y = this; }; return x; } + endoi() : panglima.abidi { var x : panglima.abidi; () => { var y = this; }; return x; } + venezuelae() : howi.marcanoi { var x : howi.marcanoi; () => { var y = this; }; return x; } + zamicrus() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + } + export class galapagoensis { + isabellae() : panglima.amphibius { var x : panglima.amphibius; () => { var y = this; }; return x; } + rueppellii() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + peregusna() : dogramacii.kaiseri { var x : dogramacii.kaiseri; () => { var y = this; }; return x; } + gliroides() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } + banakrisi() : macrorhinos.daphaenodon { var x : macrorhinos.daphaenodon; () => { var y = this; }; return x; } + rozendaali() : lutreolus.foina { var x : lutreolus.foina; () => { var y = this; }; return x; } + stuhlmanni() : panamensis.linulus { var x : panamensis.linulus; () => { var y = this; }; return x; } + } + export class albidens { + mattheyi() : samarensis.fuscus> { var x : samarensis.fuscus>; () => { var y = this; }; return x; } + Astatine() : steerii { var x : steerii; () => { var y = this; }; return x; } + vincenti() : argurus.dauricus { var x : argurus.dauricus; () => { var y = this; }; return x; } + hirta() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } + virginianus() : durangae { var x : durangae; () => { var y = this; }; return x; } + macrophyllum() : howi.marcanoi { var x : howi.marcanoi; () => { var y = this; }; return x; } + porcellus() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + } + export class oralis extends caurinus.psilurus { + cepapi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } + porteri() : lavali.thaeleri { var x : lavali.thaeleri; () => { var y = this; }; return x; } + bindi() : caurinus.mahaganus> { var x : caurinus.mahaganus>; () => { var y = this; }; return x; } + puda() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } + mindorensis() : trivirgatus.falconeri { var x : trivirgatus.falconeri; () => { var y = this; }; return x; } + ignitus() : petrophilus.rosalia, lavali.wilsoni> { var x : petrophilus.rosalia, lavali.wilsoni>; () => { var y = this; }; return x; } + rufus() : nudicaudus { var x : nudicaudus; () => { var y = this; }; return x; } + monax() : imperfecta.subspinosus { var x : imperfecta.subspinosus; () => { var y = this; }; return x; } + unalascensis() : minutus.inez, gabriellae.echinatus>, dogramacii.aurata> { var x : minutus.inez, gabriellae.echinatus>, dogramacii.aurata>; () => { var y = this; }; return x; } + wuchihensis() : howi.angulatus, petrophilus.minutilla> { var x : howi.angulatus, petrophilus.minutilla>; () => { var y = this; }; return x; } + leucippe() : lavali.otion { var x : lavali.otion; () => { var y = this; }; return x; } + ordii() : daubentonii.arboreus { var x : daubentonii.arboreus; () => { var y = this; }; return x; } + eisentrauti() : rendalli.zuluensis { var x : rendalli.zuluensis; () => { var y = this; }; return x; } + } + export class sumatrana extends Lanthanum.jugularis { + wolffsohni() : Lanthanum.suillus { var x : Lanthanum.suillus; () => { var y = this; }; return x; } + geata() : ruatanica.hector { var x : ruatanica.hector; () => { var y = this; }; return x; } + awashensis() : petrophilus.minutilla { var x : petrophilus.minutilla; () => { var y = this; }; return x; } + sturdeei() : lutreolus.cor { var x : lutreolus.cor; () => { var y = this; }; return x; } + pachyurus() : howi.angulatus> { var x : howi.angulatus>; () => { var y = this; }; return x; } + lyelli() : provocax.melanoleuca { var x : provocax.melanoleuca; () => { var y = this; }; return x; } + neohibernicus() : dammermani.siberu { var x : dammermani.siberu; () => { var y = this; }; return x; } + } + export class gerbillus { + pundti() : sagitta.sicarius { var x : sagitta.sicarius; () => { var y = this; }; return x; } + tristrami() : petrophilus.minutilla { var x : petrophilus.minutilla; () => { var y = this; }; return x; } + swarthi() : lutreolus.foina { var x : lutreolus.foina; () => { var y = this; }; return x; } + horsfieldii() : trivirgatus.falconeri { var x : trivirgatus.falconeri; () => { var y = this; }; return x; } + diazi() : imperfecta.lasiurus { var x : imperfecta.lasiurus; () => { var y = this; }; return x; } + rennelli() : argurus.luctuosa { var x : argurus.luctuosa; () => { var y = this; }; return x; } + maulinus() : lavali.lepturus { var x : lavali.lepturus; () => { var y = this; }; return x; } + muscina() : daubentonii.arboreus { var x : daubentonii.arboreus; () => { var y = this; }; return x; } + pelengensis() : sagitta.leptoceros { var x : sagitta.leptoceros; () => { var y = this; }; return x; } + abramus() : lavali.thaeleri { var x : lavali.thaeleri; () => { var y = this; }; return x; } + reevesi() : provocax.melanoleuca { var x : provocax.melanoleuca; () => { var y = this; }; return x; } + } + export class acariensis { + levicula() : lavali.lepturus { var x : lavali.lepturus; () => { var y = this; }; return x; } + minous() : argurus.dauricus { var x : argurus.dauricus; () => { var y = this; }; return x; } + cinereiventer() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } + longicaudatus() : macrorhinos.marmosurus> { var x : macrorhinos.marmosurus>; () => { var y = this; }; return x; } + baeodon() : argurus.netscheri, argurus.luctuosa> { var x : argurus.netscheri, argurus.luctuosa>; () => { var y = this; }; return x; } + soricoides() : argurus.luctuosa { var x : argurus.luctuosa; () => { var y = this; }; return x; } + datae() : daubentonii.arboreus> { var x : daubentonii.arboreus>; () => { var y = this; }; return x; } + spixii() : imperfecta.subspinosus { var x : imperfecta.subspinosus; () => { var y = this; }; return x; } + anakuma() : lavali.wilsoni { var x : lavali.wilsoni; () => { var y = this; }; return x; } + kihaulei() : panglima.amphibius { var x : panglima.amphibius; () => { var y = this; }; return x; } + gymnura() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + olchonensis() : rendalli.crenulata { var x : rendalli.crenulata; () => { var y = this; }; return x; } + } + export class durangae extends dogramacii.aurata { + Californium() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } + Flerovium() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } + phrudus() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } + } +} +module ruatanica { + export class hector { + humulis() : julianae.steerii { var x : julianae.steerii; () => { var y = this; }; return x; } + eurycerus() : panamensis.linulus, lavali.wilsoni> { var x : panamensis.linulus, lavali.wilsoni>; () => { var y = this; }; return x; } + } +} +module Lanthanum { + export class suillus { + spilosoma() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + tumbalensis() : caurinus.megaphyllus { var x : caurinus.megaphyllus; () => { var y = this; }; return x; } + anatolicus() : julianae.steerii { var x : julianae.steerii; () => { var y = this; }; return x; } + } + export class nitidus extends argurus.gilbertii { + granatensis() : quasiater.bobrinskoi { var x : quasiater.bobrinskoi; () => { var y = this; }; return x; } + negligens() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } + lewisi() : julianae.oralis { var x : julianae.oralis; () => { var y = this; }; return x; } + arge() : chrysaeolus.sarasinorum { var x : chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + dominicensis() : dammermani.melanops { var x : dammermani.melanops; () => { var y = this; }; return x; } + taurus() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } + tonganus() : argurus.netscheri { var x : argurus.netscheri; () => { var y = this; }; return x; } + silvatica() : rendalli.moojeni { var x : rendalli.moojeni; () => { var y = this; }; return x; } + midas() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } + bicornis() : dogramacii.kaiseri { var x : dogramacii.kaiseri; () => { var y = this; }; return x; } + } + export class megalonyx extends caurinus.johorensis { + phillipsii() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } + melanogaster() : rionegrensis.veraecrucis { var x : rionegrensis.veraecrucis; () => { var y = this; }; return x; } + elaphus() : nitidus { var x : nitidus; () => { var y = this; }; return x; } + elater() : lavali.lepturus { var x : lavali.lepturus; () => { var y = this; }; return x; } + ourebi() : provocax.melanoleuca { var x : provocax.melanoleuca; () => { var y = this; }; return x; } + caraccioli() : imperfecta.ciliolabrum> { var x : imperfecta.ciliolabrum>; () => { var y = this; }; return x; } + parva() : gabriellae.echinatus { var x : gabriellae.echinatus; () => { var y = this; }; return x; } + albipes() : quasiater.wattsi { var x : quasiater.wattsi; () => { var y = this; }; return x; } + } + export class jugularis { + torrei() : petrophilus.sodyi { var x : petrophilus.sodyi; () => { var y = this; }; return x; } + revoili() : lavali.wilsoni { var x : lavali.wilsoni; () => { var y = this; }; return x; } + macrobullatus() : macrorhinos.daphaenodon { var x : macrorhinos.daphaenodon; () => { var y = this; }; return x; } + compactus() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } + talpinus() : nitidus { var x : nitidus; () => { var y = this; }; return x; } + stramineus() : gabriellae.amicus { var x : gabriellae.amicus; () => { var y = this; }; return x; } + dartmouthi() : trivirgatus.mixtus { var x : trivirgatus.mixtus; () => { var y = this; }; return x; } + ogilbyi() : argurus.dauricus { var x : argurus.dauricus; () => { var y = this; }; return x; } + incomtus() : daubentonii.nesiotes { var x : daubentonii.nesiotes; () => { var y = this; }; return x; } + surdaster() : ruatanica.Praseodymium { var x : ruatanica.Praseodymium; () => { var y = this; }; return x; } + melanorhinus() : samarensis.pelurus { var x : samarensis.pelurus; () => { var y = this; }; return x; } + picticaudata() : minutus.inez, dogramacii.kaiseri> { var x : minutus.inez, dogramacii.kaiseri>; () => { var y = this; }; return x; } + pomona() : julianae.steerii { var x : julianae.steerii; () => { var y = this; }; return x; } + ileile() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + } +} +module rendalli { + export class zuluensis extends julianae.steerii { + telfairi() : argurus.wetmorei { var x : argurus.wetmorei; () => { var y = this; }; return x; } + keyensis() : quasiater.wattsi { var x : quasiater.wattsi; () => { var y = this; }; return x; } + occasius() : argurus.gilbertii { var x : argurus.gilbertii; () => { var y = this; }; return x; } + damarensis() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; } + Neptunium() : panglima.abidi { var x : panglima.abidi; () => { var y = this; }; return x; } + griseoflavus() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + thar() : argurus.oreas { var x : argurus.oreas; () => { var y = this; }; return x; } + alborufus() : panamensis.linulus { var x : panamensis.linulus; () => { var y = this; }; return x; } + fusicaudus() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } + gordonorum() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } + ruber() : dammermani.siberu { var x : dammermani.siberu; () => { var y = this; }; return x; } + desmarestianus() : julianae.steerii { var x : julianae.steerii; () => { var y = this; }; return x; } + lutillus() : nigra.dolichurus { var x : nigra.dolichurus; () => { var y = this; }; return x; } + salocco() : argurus.peninsulae { var x : argurus.peninsulae; () => { var y = this; }; return x; } + } + export class moojeni { + floweri() : lavali.otion { var x : lavali.otion; () => { var y = this; }; return x; } + montosa() : imperfecta.ciliolabrum { var x : imperfecta.ciliolabrum; () => { var y = this; }; return x; } + miletus() : julianae.sumatrana { var x : julianae.sumatrana; () => { var y = this; }; return x; } + heaneyi() : zuluensis { var x : zuluensis; () => { var y = this; }; return x; } + marchei() : panglima.amphibius> { var x : panglima.amphibius>; () => { var y = this; }; return x; } + budini() : julianae.durangae { var x : julianae.durangae; () => { var y = this; }; return x; } + maggietaylorae() : trivirgatus.mixtus, imperfecta.subspinosus>, sagitta.stolzmanni> { var x : trivirgatus.mixtus, imperfecta.subspinosus>, sagitta.stolzmanni>; () => { var y = this; }; return x; } + poliocephalus() : julianae.gerbillus { var x : julianae.gerbillus; () => { var y = this; }; return x; } + zibethicus() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } + biacensis() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } + } + export class crenulata extends trivirgatus.falconeri { + salvanius() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } + maritimus() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + edax() : lutreolus.cor>, rionegrensis.caniventer> { var x : lutreolus.cor>, rionegrensis.caniventer>; () => { var y = this; }; return x; } + } +} +module trivirgatus { + export class tumidifrons { + nivalis() : dogramacii.kaiseri { var x : dogramacii.kaiseri; () => { var y = this; }; return x; } + vestitus() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } + aequatorius() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + scherman() : oconnelli { var x : oconnelli; () => { var y = this; }; return x; } + improvisum() : argurus.peninsulae { var x : argurus.peninsulae; () => { var y = this; }; return x; } + cervinipes() : panglima.abidi { var x : panglima.abidi; () => { var y = this; }; return x; } + audax() : dogramacii.robustulus { var x : dogramacii.robustulus; () => { var y = this; }; return x; } + vallinus() : sagitta.sicarius { var x : sagitta.sicarius; () => { var y = this; }; return x; } + } + export class mixtus extends argurus.pygmaea> { + ochrogaster() : dogramacii.aurata { var x : dogramacii.aurata; () => { var y = this; }; return x; } + bryophilus() : macrorhinos.marmosurus>> { var x : macrorhinos.marmosurus>>; () => { var y = this; }; return x; } + liechtensteini() : rendalli.zuluensis { var x : rendalli.zuluensis; () => { var y = this; }; return x; } + crawfordi() : howi.coludo> { var x : howi.coludo>; () => { var y = this; }; return x; } + hypsibia() : lavali.thaeleri { var x : lavali.thaeleri; () => { var y = this; }; return x; } + matacus() : panglima.fundatus, lavali.beisa>, dammermani.melanops> { var x : panglima.fundatus, lavali.beisa>, dammermani.melanops>; () => { var y = this; }; return x; } + demidoff() : caurinus.johorensis { var x : caurinus.johorensis; () => { var y = this; }; return x; } + } + export class lotor { + balensis() : samarensis.pallidus { var x : samarensis.pallidus; () => { var y = this; }; return x; } + pullata() : rionegrensis.veraecrucis { var x : rionegrensis.veraecrucis; () => { var y = this; }; return x; } + } + export class falconeri { + cabrali() : rendalli.moojeni>, daubentonii.arboreus> { var x : rendalli.moojeni>, daubentonii.arboreus>; () => { var y = this; }; return x; } + gouldi() : nigra.dolichurus>, patas.uralensis> { var x : nigra.dolichurus>, patas.uralensis>; () => { var y = this; }; return x; } + fuscicollis() : samarensis.pelurus> { var x : samarensis.pelurus>; () => { var y = this; }; return x; } + martiensseni() : sagitta.cinereus>, dogramacii.koepckeae> { var x : sagitta.cinereus>, dogramacii.koepckeae>; () => { var y = this; }; return x; } + gaoligongensis() : dogramacii.koepckeae { var x : dogramacii.koepckeae; () => { var y = this; }; return x; } + shawi() : minutus.inez> { var x : minutus.inez>; () => { var y = this; }; return x; } + gmelini() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + } + export class oconnelli { + youngsoni() : nigra.thalia { var x : nigra.thalia; () => { var y = this; }; return x; } + terrestris() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } + chrysopus() : sagitta.sicarius> { var x : sagitta.sicarius>; () => { var y = this; }; return x; } + fuscomurina() : argurus.peninsulae { var x : argurus.peninsulae; () => { var y = this; }; return x; } + hellwaldii() : nigra.gracilis, petrophilus.sodyi> { var x : nigra.gracilis, petrophilus.sodyi>; () => { var y = this; }; return x; } + aenea() : argurus.luctuosa { var x : argurus.luctuosa; () => { var y = this; }; return x; } + perrini() : quasiater.bobrinskoi { var x : quasiater.bobrinskoi; () => { var y = this; }; return x; } + entellus() : dammermani.melanops { var x : dammermani.melanops; () => { var y = this; }; return x; } + krebsii() : rionegrensis.veraecrucis { var x : rionegrensis.veraecrucis; () => { var y = this; }; return x; } + cephalotes() : lutreolus.schlegeli { var x : lutreolus.schlegeli; () => { var y = this; }; return x; } + molossinus() : daubentonii.nigricans> { var x : daubentonii.nigricans>; () => { var y = this; }; return x; } + luisi() : dogramacii.robustulus { var x : dogramacii.robustulus; () => { var y = this; }; return x; } + ceylonicus() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + ralli() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } + } +} +module quasiater { + export class bobrinskoi { + crassicaudatus() : samarensis.cahirinus { var x : samarensis.cahirinus; () => { var y = this; }; return x; } + mulatta() : argurus.oreas { var x : argurus.oreas; () => { var y = this; }; return x; } + ansorgei() : rendalli.moojeni, gabriellae.echinatus> { var x : rendalli.moojeni, gabriellae.echinatus>; () => { var y = this; }; return x; } + Copper() : argurus.netscheri { var x : argurus.netscheri; () => { var y = this; }; return x; } + } +} +module ruatanica { + export class americanus extends imperfecta.ciliolabrum { + nasoloi() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } + mystacalis() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } + fardoulisi() : trivirgatus.oconnelli { var x : trivirgatus.oconnelli; () => { var y = this; }; return x; } + tumidus() : gabriellae.amicus { var x : gabriellae.amicus; () => { var y = this; }; return x; } + } +} +module lavali { + export class wilsoni extends Lanthanum.nitidus { + setiger() : nigra.thalia { var x : nigra.thalia; () => { var y = this; }; return x; } + lorentzii() : imperfecta.subspinosus { var x : imperfecta.subspinosus; () => { var y = this; }; return x; } + antisensis() : lutreolus.foina { var x : lutreolus.foina; () => { var y = this; }; return x; } + blossevillii() : dammermani.siberu { var x : dammermani.siberu; () => { var y = this; }; return x; } + bontanus() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + caligata() : argurus.oreas { var x : argurus.oreas; () => { var y = this; }; return x; } + franqueti() : panglima.amphibius, imperfecta.subspinosus> { var x : panglima.amphibius, imperfecta.subspinosus>; () => { var y = this; }; return x; } + roberti() : julianae.acariensis { var x : julianae.acariensis; () => { var y = this; }; return x; } + degelidus() : chrysaeolus.sarasinorum { var x : chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + amoenus() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + kob() : trivirgatus.lotor { var x : trivirgatus.lotor; () => { var y = this; }; return x; } + csorbai() : caurinus.johorensis { var x : caurinus.johorensis; () => { var y = this; }; return x; } + dorsata() : gabriellae.echinatus { var x : gabriellae.echinatus; () => { var y = this; }; return x; } + } + export class beisa { + } + export class otion extends howi.coludo { + bonaerensis() : provocax.melanoleuca { var x : provocax.melanoleuca; () => { var y = this; }; return x; } + dussumieri() : nigra.gracilis { var x : nigra.gracilis; () => { var y = this; }; return x; } + osvaldoreigi() : julianae.albidens { var x : julianae.albidens; () => { var y = this; }; return x; } + grevyi() : samarensis.pallidus { var x : samarensis.pallidus; () => { var y = this; }; return x; } + hirtula() : lepturus { var x : lepturus; () => { var y = this; }; return x; } + cristatus() : argurus.luctuosa { var x : argurus.luctuosa; () => { var y = this; }; return x; } + darlingtoni() : sagitta.leptoceros { var x : sagitta.leptoceros; () => { var y = this; }; return x; } + fontanierii() : panamensis.setulosus>, lutreolus.foina> { var x : panamensis.setulosus>, lutreolus.foina>; () => { var y = this; }; return x; } + umbrosus() : howi.marcanoi { var x : howi.marcanoi; () => { var y = this; }; return x; } + chiriquinus() : imperfecta.lasiurus { var x : imperfecta.lasiurus; () => { var y = this; }; return x; } + orarius() : lutreolus.schlegeli { var x : lutreolus.schlegeli; () => { var y = this; }; return x; } + ilaeus() : caurinus.mahaganus { var x : caurinus.mahaganus; () => { var y = this; }; return x; } + musschenbroekii() : trivirgatus.falconeri { var x : trivirgatus.falconeri; () => { var y = this; }; return x; } + } + export class xanthognathus { + nanulus() : daubentonii.nigricans { var x : daubentonii.nigricans; () => { var y = this; }; return x; } + albigena() : chrysaeolus.sarasinorum { var x : chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + onca() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } + gunnii() : minutus.himalayana, nigra.thalia> { var x : minutus.himalayana, nigra.thalia>; () => { var y = this; }; return x; } + apeco() : lutreolus.foina { var x : lutreolus.foina; () => { var y = this; }; return x; } + variegates() : gabriellae.klossii { var x : gabriellae.klossii; () => { var y = this; }; return x; } + goudotii() : trivirgatus.falconeri { var x : trivirgatus.falconeri; () => { var y = this; }; return x; } + pohlei() : Lanthanum.megalonyx { var x : Lanthanum.megalonyx; () => { var y = this; }; return x; } + ineptus() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } + euryotis() : rendalli.moojeni> { var x : rendalli.moojeni>; () => { var y = this; }; return x; } + maurisca() : Lanthanum.suillus { var x : Lanthanum.suillus; () => { var y = this; }; return x; } + coyhaiquensis() : caurinus.mahaganus, panglima.abidi>, lutreolus.punicus> { var x : caurinus.mahaganus, panglima.abidi>, lutreolus.punicus>; () => { var y = this; }; return x; } + } + export class thaeleri extends argurus.oreas { + coromandra() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; } + parvipes() : nigra.dolichurus { var x : nigra.dolichurus; () => { var y = this; }; return x; } + sponsorius() : rionegrensis.veraecrucis, julianae.steerii> { var x : rionegrensis.veraecrucis, julianae.steerii>; () => { var y = this; }; return x; } + vates() : dogramacii.robustulus { var x : dogramacii.robustulus; () => { var y = this; }; return x; } + roosmalenorum() : dogramacii.koepckeae { var x : dogramacii.koepckeae; () => { var y = this; }; return x; } + rubicola() : rendalli.moojeni, gabriellae.echinatus>> { var x : rendalli.moojeni, gabriellae.echinatus>>; () => { var y = this; }; return x; } + ikonnikovi() : argurus.luctuosa { var x : argurus.luctuosa; () => { var y = this; }; return x; } + paramicrus() : imperfecta.ciliolabrum> { var x : imperfecta.ciliolabrum>; () => { var y = this; }; return x; } + } + export class lepturus extends Lanthanum.suillus { + ferrumequinum() : argurus.netscheri { var x : argurus.netscheri; () => { var y = this; }; return x; } + aequalis() : sagitta.cinereus>, petrophilus.minutilla>, Lanthanum.jugularis> { var x : sagitta.cinereus>, petrophilus.minutilla>, Lanthanum.jugularis>; () => { var y = this; }; return x; } + } +} +module dogramacii { + export class robustulus extends lavali.wilsoni { + fossor() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } + humboldti() : sagitta.cinereus { var x : sagitta.cinereus; () => { var y = this; }; return x; } + mexicana() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } + martini() : julianae.oralis { var x : julianae.oralis; () => { var y = this; }; return x; } + beatus() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } + leporina() : trivirgatus.falconeri { var x : trivirgatus.falconeri; () => { var y = this; }; return x; } + pearsonii() : dammermani.melanops { var x : dammermani.melanops; () => { var y = this; }; return x; } + keaysi() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } + hindei() : imperfecta.lasiurus { var x : imperfecta.lasiurus; () => { var y = this; }; return x; } + } + export class koepckeae { + culturatus() : samarensis.pelurus, julianae.sumatrana> { var x : samarensis.pelurus, julianae.sumatrana>; () => { var y = this; }; return x; } + } + export class kaiseri { + bedfordiae() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + paramorum() : Lanthanum.megalonyx { var x : Lanthanum.megalonyx; () => { var y = this; }; return x; } + rubidus() : trivirgatus.lotor { var x : trivirgatus.lotor; () => { var y = this; }; return x; } + juninensis() : quasiater.bobrinskoi { var x : quasiater.bobrinskoi; () => { var y = this; }; return x; } + marginata() : argurus.wetmorei>> { var x : argurus.wetmorei>>; () => { var y = this; }; return x; } + Meitnerium() : ruatanica.Praseodymium> { var x : ruatanica.Praseodymium>; () => { var y = this; }; return x; } + pinetorum() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + hoolock() : samarensis.pelurus { var x : samarensis.pelurus; () => { var y = this; }; return x; } + poeyi() : gabriellae.echinatus { var x : gabriellae.echinatus; () => { var y = this; }; return x; } + Thulium() : julianae.durangae { var x : julianae.durangae; () => { var y = this; }; return x; } + patrius() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } + quadraticauda() : julianae.nudicaudus { var x : julianae.nudicaudus; () => { var y = this; }; return x; } + ater() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + } + export class aurata { + grunniens() : nigra.gracilis, julianae.sumatrana>, ruatanica.americanus> { var x : nigra.gracilis, julianae.sumatrana>, ruatanica.americanus>; () => { var y = this; }; return x; } + howensis() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } + karlkoopmani() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } + mirapitanga() : julianae.albidens { var x : julianae.albidens; () => { var y = this; }; return x; } + ophiodon() : aurata { var x : aurata; () => { var y = this; }; return x; } + landeri() : samarensis.pelurus { var x : samarensis.pelurus; () => { var y = this; }; return x; } + sonomae() : trivirgatus.lotor, koepckeae> { var x : trivirgatus.lotor, koepckeae>; () => { var y = this; }; return x; } + erythromos() : caurinus.johorensis, nigra.dolichurus> { var x : caurinus.johorensis, nigra.dolichurus>; () => { var y = this; }; return x; } + } +} +module lutreolus { + export class schlegeli extends lavali.beisa { + mittendorfi() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } + blicki() : dogramacii.robustulus { var x : dogramacii.robustulus; () => { var y = this; }; return x; } + culionensis() : argurus.dauricus { var x : argurus.dauricus; () => { var y = this; }; return x; } + scrofa() : petrophilus.sodyi { var x : petrophilus.sodyi; () => { var y = this; }; return x; } + fernandoni() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } + Tin() : sagitta.leptoceros> { var x : sagitta.leptoceros>; () => { var y = this; }; return x; } + marmorata() : panamensis.setulosus> { var x : panamensis.setulosus>; () => { var y = this; }; return x; } + tavaratra() : Lanthanum.nitidus { var x : Lanthanum.nitidus; () => { var y = this; }; return x; } + peregrina() : daubentonii.nesiotes { var x : daubentonii.nesiotes; () => { var y = this; }; return x; } + frontalis() : macrorhinos.marmosurus>, samarensis.pallidus> { var x : macrorhinos.marmosurus>, samarensis.pallidus>; () => { var y = this; }; return x; } + cuniculus() : patas.uralensis { var x : patas.uralensis; () => { var y = this; }; return x; } + magdalenae() : julianae.gerbillus> { var x : julianae.gerbillus>; () => { var y = this; }; return x; } + andamanensis() : julianae.oralis { var x : julianae.oralis; () => { var y = this; }; return x; } + dispar() : panamensis.linulus { var x : panamensis.linulus; () => { var y = this; }; return x; } + } +} +module argurus { + export class dauricus { + chinensis() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } + duodecimcostatus() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } + foxi() : daubentonii.nesiotes { var x : daubentonii.nesiotes; () => { var y = this; }; return x; } + macleayii() : petrophilus.sodyi>, petrophilus.minutilla> { var x : petrophilus.sodyi>, petrophilus.minutilla>; () => { var y = this; }; return x; } + darienensis() : trivirgatus.oconnelli { var x : trivirgatus.oconnelli; () => { var y = this; }; return x; } + hardwickii() : macrorhinos.daphaenodon { var x : macrorhinos.daphaenodon; () => { var y = this; }; return x; } + albifrons() : rionegrensis.veraecrucis { var x : rionegrensis.veraecrucis; () => { var y = this; }; return x; } + jacobitus() : caurinus.johorensis>> { var x : caurinus.johorensis>>; () => { var y = this; }; return x; } + guentheri() : rendalli.moojeni { var x : rendalli.moojeni; () => { var y = this; }; return x; } + mahomet() : imperfecta.ciliolabrum { var x : imperfecta.ciliolabrum; () => { var y = this; }; return x; } + misionensis() : macrorhinos.marmosurus, gabriellae.echinatus> { var x : macrorhinos.marmosurus, gabriellae.echinatus>; () => { var y = this; }; return x; } + } +} +module nigra { + export class dolichurus { + solomonis() : panglima.abidi, argurus.netscheri, julianae.oralis>>> { var x : panglima.abidi, argurus.netscheri, julianae.oralis>>>; () => { var y = this; }; return x; } + alfredi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } + morrisi() : ruatanica.hector, quasiater.wattsi>>> { var x : ruatanica.hector, quasiater.wattsi>>>; () => { var y = this; }; return x; } + lekaguli() : Lanthanum.nitidus { var x : Lanthanum.nitidus; () => { var y = this; }; return x; } + dimissus() : imperfecta.subspinosus { var x : imperfecta.subspinosus; () => { var y = this; }; return x; } + phaeotis() : julianae.sumatrana { var x : julianae.sumatrana; () => { var y = this; }; return x; } + ustus() : julianae.acariensis { var x : julianae.acariensis; () => { var y = this; }; return x; } + sagei() : howi.marcanoi { var x : howi.marcanoi; () => { var y = this; }; return x; } + } +} +module panglima { + export class amphibius extends caurinus.johorensis, Lanthanum.jugularis> { + bottegi(): macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni> { var x: macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>; () => { var y = this; }; return x; } + jerdoni(): macrorhinos.daphaenodon { var x: macrorhinos.daphaenodon; () => { var y = this; }; return x; } + camtschatica(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } + spadix(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + luismanueli(): rendalli.moojeni { var x: rendalli.moojeni; () => { var y = this; }; return x; } + aceramarcae(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + } + export class fundatus extends lutreolus.schlegeli { + crassulus(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + flamarioni(): imperfecta.lasiurus>, sagitta.leptoceros>> { var x: imperfecta.lasiurus>, sagitta.leptoceros>>; () => { var y = this; }; return x; } + mirabilis(): macrorhinos.marmosurus, lavali.lepturus> { var x: macrorhinos.marmosurus, lavali.lepturus>; () => { var y = this; }; return x; } + } + export class abidi extends argurus.dauricus { + greyii(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + macedonicus(): petrophilus.minutilla { var x: petrophilus.minutilla; () => { var y = this; }; return x; } + galili(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + thierryi(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } + ega(): imperfecta.lasiurus> { var x: imperfecta.lasiurus>; () => { var y = this; }; return x; } + } +} +module quasiater { + export class carolinensis { + concinna(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } + aeneus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } + aloysiisabaudiae(): argurus.netscheri, lavali.lepturus> { var x: argurus.netscheri, lavali.lepturus>; () => { var y = this; }; return x; } + tenellus(): julianae.nudicaudus { var x: julianae.nudicaudus; () => { var y = this; }; return x; } + andium(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } + persephone(): panglima.fundatus { var x: panglima.fundatus; () => { var y = this; }; return x; } + patrizii(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } + } +} +module minutus { + export class himalayana extends lutreolus.punicus { + simoni(): argurus.netscheri> { var x: argurus.netscheri>; () => { var y = this; }; return x; } + lobata(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } + rusticus(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } + latona(): daubentonii.nesiotes { var x: daubentonii.nesiotes; () => { var y = this; }; return x; } + famulus(): patas.uralensis { var x: patas.uralensis; () => { var y = this; }; return x; } + flaviceps(): minutus.inez> { var x: minutus.inez>; () => { var y = this; }; return x; } + paradoxolophus(): nigra.dolichurus> { var x: nigra.dolichurus>; () => { var y = this; }; return x; } + Osmium(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + vulgaris(): Lanthanum.nitidus { var x: Lanthanum.nitidus; () => { var y = this; }; return x; } + betsileoensis(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } + vespuccii(): argurus.gilbertii, provocax.melanoleuca> { var x: argurus.gilbertii, provocax.melanoleuca>; () => { var y = this; }; return x; } + olympus(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } + } +} +module caurinus { + export class mahaganus extends panglima.fundatus { + martiniquensis(): ruatanica.hector>> { var x: ruatanica.hector>>; () => { var y = this; }; return x; } + devius(): samarensis.pelurus, trivirgatus.falconeri>> { var x: samarensis.pelurus, trivirgatus.falconeri>>; () => { var y = this; }; return x; } + masalai(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + kathleenae(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } + simulus(): gabriellae.echinatus { var x: gabriellae.echinatus; () => { var y = this; }; return x; } + nigrovittatus(): caurinus.mahaganus>> { var x: caurinus.mahaganus>>; () => { var y = this; }; return x; } + senegalensis(): gabriellae.klossii, dammermani.melanops> { var x: gabriellae.klossii, dammermani.melanops>; () => { var y = this; }; return x; } + acticola(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } + } +} +module macrorhinos { + export class marmosurus { + tansaniana(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + } +} +module howi { + export class angulatus extends sagitta.stolzmanni { + pennatus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } + } +} +module daubentonii { + export class nesiotes { + } +} +module nigra { + export class thalia { + dichotomus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + arnuxii(): panamensis.linulus, lavali.beisa> { var x: panamensis.linulus, lavali.beisa>; () => { var y = this; }; return x; } + verheyeni(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } + dauuricus(): gabriellae.amicus { var x: gabriellae.amicus; () => { var y = this; }; return x; } + tristriatus(): rionegrensis.veraecrucis> { var x: rionegrensis.veraecrucis>; () => { var y = this; }; return x; } + lasiura(): panglima.abidi>, Lanthanum.nitidus> { var x: panglima.abidi>, Lanthanum.nitidus>; () => { var y = this; }; return x; } + gangetica(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } + brucei(): chrysaeolus.sarasinorum { var x: chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + } +} +module sagitta { + export class walkeri extends minutus.portoricensis { + maracajuensis(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + } +} +module minutus { + export class inez extends samarensis.pelurus { + vexillaris(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + } +} +module macrorhinos { + export class konganensis extends imperfecta.lasiurus { + } +} +module panamensis { + export class linulus extends ruatanica.hector> { + goslingi(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + taki(): patas.uralensis { var x: patas.uralensis; () => { var y = this; }; return x; } + fumosus(): rendalli.moojeni, lavali.beisa> { var x: rendalli.moojeni, lavali.beisa>; () => { var y = this; }; return x; } + rufinus(): macrorhinos.konganensis { var x: macrorhinos.konganensis; () => { var y = this; }; return x; } + lami(): nigra.thalia { var x: nigra.thalia; () => { var y = this; }; return x; } + regina(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + nanilla(): dammermani.siberu { var x: dammermani.siberu; () => { var y = this; }; return x; } + enganus(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + gomantongensis(): rionegrensis.veraecrucis> { var x: rionegrensis.veraecrucis>; () => { var y = this; }; return x; } + } +} +module nigra { + export class gracilis { + weddellii(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } + echinothrix(): Lanthanum.nitidus, argurus.oreas> { var x: Lanthanum.nitidus, argurus.oreas>; () => { var y = this; }; return x; } + garridoi(): dogramacii.koepckeae { var x: dogramacii.koepckeae; () => { var y = this; }; return x; } + rouxii(): nigra.gracilis, nigra.thalia> { var x: nigra.gracilis, nigra.thalia>; () => { var y = this; }; return x; } + aurita(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + geoffrensis(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } + theresa(): macrorhinos.marmosurus, argurus.luctuosa>, nigra.dolichurus> { var x: macrorhinos.marmosurus, argurus.luctuosa>, nigra.dolichurus>; () => { var y = this; }; return x; } + melanocarpus(): julianae.albidens, julianae.sumatrana> { var x: julianae.albidens, julianae.sumatrana>; () => { var y = this; }; return x; } + dubiaquercus(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } + pectoralis(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } + apoensis(): caurinus.megaphyllus { var x: caurinus.megaphyllus; () => { var y = this; }; return x; } + grisescens(): Lanthanum.jugularis { var x: Lanthanum.jugularis; () => { var y = this; }; return x; } + ramirohitra(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } + } +} +module samarensis { + export class pelurus extends sagitta.stolzmanni { + Palladium(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } + castanea(): argurus.netscheri, julianae.oralis> { var x: argurus.netscheri, julianae.oralis>; () => { var y = this; }; return x; } + chamek(): argurus.pygmaea { var x: argurus.pygmaea; () => { var y = this; }; return x; } + nigriceps(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + lunatus(): pelurus { var x: pelurus; () => { var y = this; }; return x; } + madurae(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } + chinchilla(): macrorhinos.daphaenodon { var x: macrorhinos.daphaenodon; () => { var y = this; }; return x; } + eliasi(): petrophilus.rosalia { var x: petrophilus.rosalia; () => { var y = this; }; return x; } + proditor(): panamensis.setulosus { var x: panamensis.setulosus; () => { var y = this; }; return x; } + gambianus(): quasiater.wattsi> { var x: quasiater.wattsi>; () => { var y = this; }; return x; } + petteri(): dogramacii.kaiseri { var x: dogramacii.kaiseri; () => { var y = this; }; return x; } + nusatenggara(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } + olitor(): rionegrensis.veraecrucis { var x: rionegrensis.veraecrucis; () => { var y = this; }; return x; } + } + export class fuscus extends macrorhinos.daphaenodon { + planifrons(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + badia(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } + prymnolopha(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } + natalensis(): trivirgatus.falconeri { var x: trivirgatus.falconeri; () => { var y = this; }; return x; } + hunteri(): julianae.durangae { var x: julianae.durangae; () => { var y = this; }; return x; } + sapiens(): pallidus { var x: pallidus; () => { var y = this; }; return x; } + macrocercus(): panamensis.setulosus { var x: panamensis.setulosus; () => { var y = this; }; return x; } + nimbae(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + suricatta(): daubentonii.nigricans { var x: daubentonii.nigricans; () => { var y = this; }; return x; } + jagorii(): julianae.galapagoensis { var x: julianae.galapagoensis; () => { var y = this; }; return x; } + beecrofti(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + imaizumii(): minutus.inez, gabriellae.echinatus>, dogramacii.aurata>, lavali.otion>, macrorhinos.konganensis> { var x: minutus.inez, gabriellae.echinatus>, dogramacii.aurata>, lavali.otion>, macrorhinos.konganensis>; () => { var y = this; }; return x; } + colocolo(): quasiater.bobrinskoi { var x: quasiater.bobrinskoi; () => { var y = this; }; return x; } + wolfi(): petrophilus.rosalia> { var x: petrophilus.rosalia>; () => { var y = this; }; return x; } + } + export class pallidus { + oblativa(): trivirgatus.falconeri { var x: trivirgatus.falconeri; () => { var y = this; }; return x; } + watersi(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + glacialis(): sagitta.cinereus, quasiater.wattsi>> { var x: sagitta.cinereus, quasiater.wattsi>>; () => { var y = this; }; return x; } + viaria(): chrysaeolus.sarasinorum { var x: chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + } + export class cahirinus { + alashanicus(): nigra.caucasica { var x: nigra.caucasica; () => { var y = this; }; return x; } + flaviventer(): trivirgatus.tumidifrons> { var x: trivirgatus.tumidifrons>; () => { var y = this; }; return x; } + bottai(): lutreolus.schlegeli { var x: lutreolus.schlegeli; () => { var y = this; }; return x; } + pinetis(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + saussurei(): rendalli.crenulata, argurus.netscheri, julianae.oralis>> { var x: rendalli.crenulata, argurus.netscheri, julianae.oralis>>; () => { var y = this; }; return x; } + } +} +module sagitta { + export class leptoceros extends caurinus.johorensis> { + victus(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } + hoplomyoides(): panglima.fundatus, nigra.gracilis> { var x: panglima.fundatus, nigra.gracilis>; () => { var y = this; }; return x; } + gratiosus(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } + rex(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + bolami(): trivirgatus.tumidifrons { var x: trivirgatus.tumidifrons; () => { var y = this; }; return x; } + } +} +module daubentonii { + export class nigricans extends sagitta.stolzmanni { + woosnami(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } + } +} +module dammermani { + export class siberu { + } +} +module argurus { + export class pygmaea extends rendalli.moojeni { + pajeros(): gabriellae.echinatus { var x: gabriellae.echinatus; () => { var y = this; }; return x; } + capucinus(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } + cuvieri(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } + } +} +module chrysaeolus { + export class sarasinorum extends caurinus.psilurus { + belzebul(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } + hinpoon(): nigra.caucasica { var x: nigra.caucasica; () => { var y = this; }; return x; } + kandti(): quasiater.wattsi { var x: quasiater.wattsi; () => { var y = this; }; return x; } + cynosuros(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } + Germanium(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } + Ununoctium(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + princeps(): minutus.portoricensis { var x: minutus.portoricensis; () => { var y = this; }; return x; } + } +} +module argurus { + export class wetmorei { + leucoptera(): petrophilus.rosalia { var x: petrophilus.rosalia; () => { var y = this; }; return x; } + ochraventer(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } + tephromelas(): Lanthanum.jugularis { var x: Lanthanum.jugularis; () => { var y = this; }; return x; } + cracens(): argurus.gilbertii { var x: argurus.gilbertii; () => { var y = this; }; return x; } + jamaicensis(): nigra.thalia> { var x: nigra.thalia>; () => { var y = this; }; return x; } + gymnocaudus(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } + mayori(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + } +} +module argurus { + export class oreas extends lavali.wilsoni { + salamonis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } + paniscus(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } + fagani(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + papuanus(): panglima.fundatus { var x: panglima.fundatus; () => { var y = this; }; return x; } + timidus(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } + nghetinhensis(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } + barbei(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + univittatus(): argurus.peninsulae { var x: argurus.peninsulae; () => { var y = this; }; return x; } + } +} +module daubentonii { + export class arboreus { + capreolus(): rendalli.crenulata, lavali.wilsoni> { var x: rendalli.crenulata, lavali.wilsoni>; () => { var y = this; }; return x; } + moreni(): panglima.abidi { var x: panglima.abidi; () => { var y = this; }; return x; } + hypoleucos(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + paedulcus(): minutus.portoricensis { var x: minutus.portoricensis; () => { var y = this; }; return x; } + pucheranii(): samarensis.fuscus { var x: samarensis.fuscus; () => { var y = this; }; return x; } + stella(): julianae.oralis { var x: julianae.oralis; () => { var y = this; }; return x; } + brasiliensis(): imperfecta.subspinosus { var x: imperfecta.subspinosus; () => { var y = this; }; return x; } + brevicaudata(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + vitticollis(): dogramacii.koepckeae { var x: dogramacii.koepckeae; () => { var y = this; }; return x; } + huangensis(): caurinus.psilurus { var x: caurinus.psilurus; () => { var y = this; }; return x; } + cameroni(): petrophilus.rosalia, imperfecta.ciliolabrum>, caurinus.psilurus> { var x: petrophilus.rosalia, imperfecta.ciliolabrum>, caurinus.psilurus>; () => { var y = this; }; return x; } + tianshanica(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } + } +} +module patas { + export class uralensis { + cartilagonodus(): Lanthanum.nitidus { var x: Lanthanum.nitidus; () => { var y = this; }; return x; } + pyrrhinus(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } + insulans(): Lanthanum.jugularis { var x: Lanthanum.jugularis; () => { var y = this; }; return x; } + nigricauda(): caurinus.johorensis, Lanthanum.jugularis> { var x: caurinus.johorensis, Lanthanum.jugularis>; () => { var y = this; }; return x; } + muricauda(): panglima.fundatus> { var x: panglima.fundatus>; () => { var y = this; }; return x; } + albicaudus(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + fallax(): ruatanica.hector { var x: ruatanica.hector; () => { var y = this; }; return x; } + attenuata(): macrorhinos.marmosurus> { var x: macrorhinos.marmosurus>; () => { var y = this; }; return x; } + megalura(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } + neblina(): samarensis.pelurus { var x: samarensis.pelurus; () => { var y = this; }; return x; } + citellus(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + tanezumi(): imperfecta.lasiurus { var x: imperfecta.lasiurus; () => { var y = this; }; return x; } + albiventer(): rendalli.crenulata { var x: rendalli.crenulata; () => { var y = this; }; return x; } + } +} +module provocax { + export class melanoleuca extends lavali.wilsoni { + Neodymium(): macrorhinos.marmosurus, lutreolus.foina> { var x: macrorhinos.marmosurus, lutreolus.foina>; () => { var y = this; }; return x; } + baeri(): imperfecta.lasiurus { var x: imperfecta.lasiurus; () => { var y = this; }; return x; } + } +} +module sagitta { + export class sicarius { + Chlorine(): samarensis.cahirinus, dogramacii.robustulus> { var x: samarensis.cahirinus, dogramacii.robustulus>; () => { var y = this; }; return x; } + simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>> { var x: macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>>; () => { var y = this; }; return x; } + } +} +module howi { + export class marcanoi extends Lanthanum.megalonyx { + formosae(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } + dudui(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + leander(): daubentonii.nesiotes { var x: daubentonii.nesiotes; () => { var y = this; }; return x; } + martinsi(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } + beatrix(): imperfecta.ciliolabrum, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>> { var x: imperfecta.ciliolabrum, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>>; () => { var y = this; }; return x; } + griseoventer(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + zerda(): quasiater.wattsi, howi.coludo>> { var x: quasiater.wattsi, howi.coludo>>; () => { var y = this; }; return x; } + yucatanicus(): julianae.nudicaudus { var x: julianae.nudicaudus; () => { var y = this; }; return x; } + nigrita(): argurus.peninsulae { var x: argurus.peninsulae; () => { var y = this; }; return x; } + jouvenetae(): argurus.dauricus { var x: argurus.dauricus; () => { var y = this; }; return x; } + indefessus(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } + vuquangensis(): macrorhinos.daphaenodon { var x: macrorhinos.daphaenodon; () => { var y = this; }; return x; } + Zirconium(): lavali.thaeleri { var x: lavali.thaeleri; () => { var y = this; }; return x; } + hyaena(): julianae.oralis { var x: julianae.oralis; () => { var y = this; }; return x; } + } +} +module argurus { + export class gilbertii { + nasutus(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } + poecilops(): julianae.steerii { var x: julianae.steerii; () => { var y = this; }; return x; } + sondaicus(): samarensis.fuscus { var x: samarensis.fuscus; () => { var y = this; }; return x; } + auriventer(): petrophilus.rosalia { var x: petrophilus.rosalia; () => { var y = this; }; return x; } + cherriei(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } + lindberghi(): minutus.inez { var x: minutus.inez; () => { var y = this; }; return x; } + pipistrellus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + paranus(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + dubosti(): nigra.thalia { var x: nigra.thalia; () => { var y = this; }; return x; } + opossum(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } + oreopolus(): minutus.portoricensis { var x: minutus.portoricensis; () => { var y = this; }; return x; } + amurensis(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + } +} +module petrophilus { + export class minutilla { + } +} +module lutreolus { + export class punicus { + strandi(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } + lar(): caurinus.mahaganus { var x: caurinus.mahaganus; () => { var y = this; }; return x; } + erica(): dogramacii.koepckeae { var x: dogramacii.koepckeae; () => { var y = this; }; return x; } + trichura(): macrorhinos.konganensis { var x: macrorhinos.konganensis; () => { var y = this; }; return x; } + lemniscatus(): panglima.fundatus { var x: panglima.fundatus; () => { var y = this; }; return x; } + aspalax(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } + marshalli(): julianae.nudicaudus { var x: julianae.nudicaudus; () => { var y = this; }; return x; } + Zinc(): julianae.galapagoensis { var x: julianae.galapagoensis; () => { var y = this; }; return x; } + monochromos(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } + purinus(): ruatanica.hector { var x: ruatanica.hector; () => { var y = this; }; return x; } + ischyrus(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } + tenuis(): macrorhinos.daphaenodon { var x: macrorhinos.daphaenodon; () => { var y = this; }; return x; } + Helium(): julianae.acariensis { var x: julianae.acariensis; () => { var y = this; }; return x; } + } +} +module macrorhinos { + export class daphaenodon { + bredanensis(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } + othus(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } + hammondi(): julianae.gerbillus, gabriellae.echinatus>, dogramacii.aurata>, lavali.otion> { var x: julianae.gerbillus, gabriellae.echinatus>, dogramacii.aurata>, lavali.otion>; () => { var y = this; }; return x; } + aureocollaris(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + flavipes(): petrophilus.minutilla { var x: petrophilus.minutilla; () => { var y = this; }; return x; } + callosus(): trivirgatus.lotor { var x: trivirgatus.lotor; () => { var y = this; }; return x; } + } +} +module sagitta { + export class cinereus { + zunigae(): rendalli.crenulata> { var x: rendalli.crenulata>; () => { var y = this; }; return x; } + microps(): daubentonii.nigricans> { var x: daubentonii.nigricans>; () => { var y = this; }; return x; } + guaporensis(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + tonkeana(): panglima.fundatus { var x: panglima.fundatus; () => { var y = this; }; return x; } + montensis(): dammermani.siberu { var x: dammermani.siberu; () => { var y = this; }; return x; } + sphinx(): minutus.portoricensis { var x: minutus.portoricensis; () => { var y = this; }; return x; } + glis(): argurus.wetmorei { var x: argurus.wetmorei; () => { var y = this; }; return x; } + dorsalis(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + fimbriatus(): provocax.melanoleuca { var x: provocax.melanoleuca; () => { var y = this; }; return x; } + sara(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + epimelas(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + pittieri(): samarensis.fuscus { var x: samarensis.fuscus; () => { var y = this; }; return x; } + } +} +module nigra { + export class caucasica { + } +} +module gabriellae { + export class klossii extends imperfecta.lasiurus { + } + export class amicus { + pirrensis(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } + phaeura(): panglima.abidi { var x: panglima.abidi; () => { var y = this; }; return x; } + voratus(): lavali.thaeleri { var x: lavali.thaeleri; () => { var y = this; }; return x; } + satarae(): trivirgatus.lotor { var x: trivirgatus.lotor; () => { var y = this; }; return x; } + hooperi(): caurinus.psilurus { var x: caurinus.psilurus; () => { var y = this; }; return x; } + perrensi(): rendalli.crenulata { var x: rendalli.crenulata; () => { var y = this; }; return x; } + ridei(): ruatanica.hector> { var x: ruatanica.hector>; () => { var y = this; }; return x; } + audeberti(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } + Lutetium(): macrorhinos.marmosurus { var x: macrorhinos.marmosurus; () => { var y = this; }; return x; } + atrox(): samarensis.fuscus, dogramacii.koepckeae> { var x: samarensis.fuscus, dogramacii.koepckeae>; () => { var y = this; }; return x; } + } + export class echinatus { + tenuipes(): howi.coludo> { var x: howi.coludo>; () => { var y = this; }; return x; } + } +} +module imperfecta { + export class lasiurus { + marisae(): lavali.thaeleri { var x: lavali.thaeleri; () => { var y = this; }; return x; } + fulvus(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } + paranaensis(): dogramacii.koepckeae { var x: dogramacii.koepckeae; () => { var y = this; }; return x; } + didactylus(): panglima.abidi> { var x: panglima.abidi>; () => { var y = this; }; return x; } + schreibersii(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + orii(): dogramacii.kaiseri { var x: dogramacii.kaiseri; () => { var y = this; }; return x; } + } + export class subspinosus { + monticularis(): macrorhinos.konganensis { var x: macrorhinos.konganensis; () => { var y = this; }; return x; } + Gadolinium(): nigra.caucasica { var x: nigra.caucasica; () => { var y = this; }; return x; } + oasicus(): caurinus.johorensis> { var x: caurinus.johorensis>; () => { var y = this; }; return x; } + paterculus(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + punctata(): lavali.thaeleri { var x: lavali.thaeleri; () => { var y = this; }; return x; } + invictus(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + stangeri(): petrophilus.minutilla { var x: petrophilus.minutilla; () => { var y = this; }; return x; } + siskiyou(): minutus.inez { var x: minutus.inez; () => { var y = this; }; return x; } + welwitschii(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } + Polonium(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + harpia(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } + } + export class ciliolabrum extends dogramacii.robustulus { + leschenaultii(): argurus.dauricus> { var x: argurus.dauricus>; () => { var y = this; }; return x; } + ludia(): caurinus.johorensis { var x: caurinus.johorensis; () => { var y = this; }; return x; } + sinicus(): macrorhinos.marmosurus { var x: macrorhinos.marmosurus; () => { var y = this; }; return x; } + } +} +module quasiater { + export class wattsi { + lagotis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } + hussoni(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + bilarni(): samarensis.cahirinus>, dogramacii.koepckeae> { var x: samarensis.cahirinus>, dogramacii.koepckeae>; () => { var y = this; }; return x; } + cabrerae(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } + } +} +module butleri { +} +module petrophilus { + export class sodyi extends quasiater.bobrinskoi { + saundersiae(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } + imberbis(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + cansdalei(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } + Lawrencium(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } + catta(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + breviceps(): argurus.dauricus { var x: argurus.dauricus; () => { var y = this; }; return x; } + transitionalis(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } + heptneri(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } + bairdii(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } + } +} +module caurinus { + export class megaphyllus extends imperfecta.lasiurus> { + montana(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + amatus(): lutreolus.schlegeli { var x: lutreolus.schlegeli; () => { var y = this; }; return x; } + bucculentus(): gabriellae.echinatus { var x: gabriellae.echinatus; () => { var y = this; }; return x; } + lepida(): rendalli.crenulata> { var x: rendalli.crenulata>; () => { var y = this; }; return x; } + graecus(): dogramacii.kaiseri { var x: dogramacii.kaiseri; () => { var y = this; }; return x; } + forsteri(): petrophilus.minutilla { var x: petrophilus.minutilla; () => { var y = this; }; return x; } + perotensis(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + cirrhosus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + } +} +module minutus { + export class portoricensis { + relictus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + aequatorianus(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } + rhinogradoides(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } + } +} +module lutreolus { + export class foina { + tarfayensis(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + Promethium(): samarensis.pelurus { var x: samarensis.pelurus; () => { var y = this; }; return x; } + salinae(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } + kerri(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } + scotti(): quasiater.wattsi { var x: quasiater.wattsi; () => { var y = this; }; return x; } + camerunensis(): julianae.gerbillus { var x: julianae.gerbillus; () => { var y = this; }; return x; } + affinis(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } + siebersi(): trivirgatus.lotor> { var x: trivirgatus.lotor>; () => { var y = this; }; return x; } + maquassiensis(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + layardi(): julianae.albidens { var x: julianae.albidens; () => { var y = this; }; return x; } + bishopi(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } + apodemoides(): caurinus.psilurus { var x: caurinus.psilurus; () => { var y = this; }; return x; } + argentiventer(): trivirgatus.mixtus { var x: trivirgatus.mixtus; () => { var y = this; }; return x; } + } +} +module lutreolus { + export class cor extends panglima.fundatus, lavali.beisa>, dammermani.melanops> { + antinorii(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + voi(): caurinus.johorensis { var x: caurinus.johorensis; () => { var y = this; }; return x; } + mussoi(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + truncatus(): trivirgatus.lotor { var x: trivirgatus.lotor; () => { var y = this; }; return x; } + achates(): provocax.melanoleuca { var x: provocax.melanoleuca; () => { var y = this; }; return x; } + praedatrix(): howi.angulatus { var x: howi.angulatus; () => { var y = this; }; return x; } + mzabi(): quasiater.wattsi, minutus.inez> { var x: quasiater.wattsi, minutus.inez>; () => { var y = this; }; return x; } + xanthinus(): nigra.gracilis, howi.marcanoi> { var x: nigra.gracilis, howi.marcanoi>; () => { var y = this; }; return x; } + tapoatafa(): caurinus.megaphyllus { var x: caurinus.megaphyllus; () => { var y = this; }; return x; } + castroviejoi(): Lanthanum.jugularis { var x: Lanthanum.jugularis; () => { var y = this; }; return x; } + } +} +module howi { + export class coludo { + bernhardi(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } + isseli(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } + } +} +module argurus { + export class germaini extends gabriellae.amicus { + sharpei(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + palmarum(): macrorhinos.marmosurus { var x: macrorhinos.marmosurus; () => { var y = this; }; return x; } + } +} +module sagitta { + export class stolzmanni { + riparius(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } + dhofarensis(): lutreolus.foina { var x: lutreolus.foina; () => { var y = this; }; return x; } + tricolor(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } + gardneri(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } + walleri(): rendalli.moojeni, gabriellae.echinatus> { var x: rendalli.moojeni, gabriellae.echinatus>; () => { var y = this; }; return x; } + talpoides(): gabriellae.echinatus { var x: gabriellae.echinatus; () => { var y = this; }; return x; } + pallipes(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } + lagurus(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } + hipposideros(): julianae.albidens { var x: julianae.albidens; () => { var y = this; }; return x; } + griselda(): caurinus.psilurus { var x: caurinus.psilurus; () => { var y = this; }; return x; } + florium(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } + } +} +module dammermani { + export class melanops extends minutus.inez { + blarina(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } + harwoodi(): rionegrensis.veraecrucis, lavali.wilsoni> { var x: rionegrensis.veraecrucis, lavali.wilsoni>; () => { var y = this; }; return x; } + ashaninka(): julianae.nudicaudus { var x: julianae.nudicaudus; () => { var y = this; }; return x; } + wiedii(): julianae.steerii { var x: julianae.steerii; () => { var y = this; }; return x; } + godmani(): imperfecta.subspinosus { var x: imperfecta.subspinosus; () => { var y = this; }; return x; } + condorensis(): imperfecta.ciliolabrum { var x: imperfecta.ciliolabrum; () => { var y = this; }; return x; } + xerophila(): panglima.abidi { var x: panglima.abidi; () => { var y = this; }; return x; } + laminatus(): panglima.fundatus>> { var x: panglima.fundatus>>; () => { var y = this; }; return x; } + archeri(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } + hidalgo(): minutus.inez { var x: minutus.inez; () => { var y = this; }; return x; } + unicolor(): lutreolus.schlegeli { var x: lutreolus.schlegeli; () => { var y = this; }; return x; } + philippii(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } + bocagei(): julianae.albidens { var x: julianae.albidens; () => { var y = this; }; return x; } + } +} +module argurus { + export class peninsulae extends patas.uralensis { + aitkeni(): trivirgatus.mixtus, panglima.amphibius> { var x: trivirgatus.mixtus, panglima.amphibius>; () => { var y = this; }; return x; } + novaeangliae(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } + olallae(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } + anselli(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } + timminsi(): macrorhinos.konganensis { var x: macrorhinos.konganensis; () => { var y = this; }; return x; } + sordidus(): rendalli.moojeni { var x: rendalli.moojeni; () => { var y = this; }; return x; } + telfordi(): trivirgatus.oconnelli { var x: trivirgatus.oconnelli; () => { var y = this; }; return x; } + cavernarum(): minutus.inez { var x: minutus.inez; () => { var y = this; }; return x; } + } +} +module argurus { + export class netscheri { + gravis(): nigra.caucasica, dogramacii.kaiseri> { var x: nigra.caucasica, dogramacii.kaiseri>; () => { var y = this; }; return x; } + ruschii(): imperfecta.lasiurus> { var x: imperfecta.lasiurus>; () => { var y = this; }; return x; } + tricuspidatus(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } + fernandezi(): dammermani.siberu, panglima.abidi> { var x: dammermani.siberu, panglima.abidi>; () => { var y = this; }; return x; } + colletti(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } + microbullatus(): lutreolus.schlegeli { var x: lutreolus.schlegeli; () => { var y = this; }; return x; } + eburneae(): chrysaeolus.sarasinorum { var x: chrysaeolus.sarasinorum; () => { var y = this; }; return x; } + tatei(): argurus.pygmaea> { var x: argurus.pygmaea>; () => { var y = this; }; return x; } + millardi(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } + pruinosus(): trivirgatus.falconeri { var x: trivirgatus.falconeri; () => { var y = this; }; return x; } + delator(): argurus.netscheri { var x: argurus.netscheri; () => { var y = this; }; return x; } + nyikae(): trivirgatus.tumidifrons, petrophilus.minutilla>, julianae.acariensis> { var x: trivirgatus.tumidifrons, petrophilus.minutilla>, julianae.acariensis>; () => { var y = this; }; return x; } + ruemmleri(): panglima.amphibius, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum> { var x: panglima.amphibius, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>; () => { var y = this; }; return x; } + } +} +module ruatanica { + export class Praseodymium extends ruatanica.hector { + clara(): panglima.amphibius, argurus.dauricus> { var x: panglima.amphibius, argurus.dauricus>; () => { var y = this; }; return x; } + spectabilis(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + kamensis(): trivirgatus.lotor, lavali.lepturus> { var x: trivirgatus.lotor, lavali.lepturus>; () => { var y = this; }; return x; } + ruddi(): lutreolus.foina { var x: lutreolus.foina; () => { var y = this; }; return x; } + bartelsii(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } + yerbabuenae(): dammermani.siberu, imperfecta.ciliolabrum> { var x: dammermani.siberu, imperfecta.ciliolabrum>; () => { var y = this; }; return x; } + davidi(): trivirgatus.mixtus { var x: trivirgatus.mixtus; () => { var y = this; }; return x; } + pilirostris(): argurus.wetmorei>, sagitta.leptoceros>>, macrorhinos.konganensis> { var x: argurus.wetmorei>, sagitta.leptoceros>>, macrorhinos.konganensis>; () => { var y = this; }; return x; } + catherinae(): imperfecta.lasiurus, petrophilus.sodyi> { var x: imperfecta.lasiurus, petrophilus.sodyi>; () => { var y = this; }; return x; } + frontata(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } + Terbium(): caurinus.mahaganus { var x: caurinus.mahaganus; () => { var y = this; }; return x; } + thomensis(): minutus.inez> { var x: minutus.inez>; () => { var y = this; }; return x; } + soricinus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } + } +} +module caurinus { + export class johorensis extends lutreolus.punicus { + maini(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } + } +} +module argurus { + export class luctuosa { + loriae(): rendalli.moojeni, gabriellae.echinatus>, sagitta.stolzmanni>, lutreolus.punicus> { var x: rendalli.moojeni, gabriellae.echinatus>, sagitta.stolzmanni>, lutreolus.punicus>; () => { var y = this; }; return x; } + } +} +module panamensis { + export class setulosus { + duthieae(): caurinus.mahaganus, dogramacii.aurata> { var x: caurinus.mahaganus, dogramacii.aurata>; () => { var y = this; }; return x; } + guereza(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } + buselaphus(): daubentonii.nesiotes, dogramacii.koepckeae>, trivirgatus.mixtus> { var x: daubentonii.nesiotes, dogramacii.koepckeae>, trivirgatus.mixtus>; () => { var y = this; }; return x; } + nuttalli(): sagitta.cinereus, chrysaeolus.sarasinorum> { var x: sagitta.cinereus, chrysaeolus.sarasinorum>; () => { var y = this; }; return x; } + pelii(): rendalli.crenulata, julianae.steerii> { var x: rendalli.crenulata, julianae.steerii>; () => { var y = this; }; return x; } + tunneyi(): sagitta.stolzmanni { var x: sagitta.stolzmanni; () => { var y = this; }; return x; } + lamula(): patas.uralensis { var x: patas.uralensis; () => { var y = this; }; return x; } + vampyrus(): julianae.oralis { var x: julianae.oralis; () => { var y = this; }; return x; } + } +} +module petrophilus { + export class rosalia { + palmeri(): panglima.amphibius>, trivirgatus.mixtus, panglima.amphibius>> { var x: panglima.amphibius>, trivirgatus.mixtus, panglima.amphibius>>; () => { var y = this; }; return x; } + baeops(): Lanthanum.nitidus { var x: Lanthanum.nitidus; () => { var y = this; }; return x; } + ozensis(): imperfecta.lasiurus, lutreolus.foina> { var x: imperfecta.lasiurus, lutreolus.foina>; () => { var y = this; }; return x; } + creaghi(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } + montivaga(): panamensis.setulosus> { var x: panamensis.setulosus>; () => { var y = this; }; return x; } + } +} +module caurinus { + export class psilurus extends lutreolus.punicus { + socialis(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } + lundi(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } + araeum(): imperfecta.ciliolabrum { var x: imperfecta.ciliolabrum; () => { var y = this; }; return x; } + calamianensis(): julianae.gerbillus { var x: julianae.gerbillus; () => { var y = this; }; return x; } + petersoni(): panamensis.setulosus { var x: panamensis.setulosus; () => { var y = this; }; return x; } + nitela(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } + } +} + + +//// [resolvingClassDeclarationWhenInBaseTypeResolution.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var rionegrensis; +(function (rionegrensis) { + var caniventer = (function (_super) { + __extends(caniventer, _super); + function caniventer() { + _super.apply(this, arguments); + } + caniventer.prototype.salomonseni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + caniventer.prototype.uchidai = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + caniventer.prototype.raffrayana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + caniventer.prototype.Uranium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + caniventer.prototype.nayaur = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return caniventer; + })(Lanthanum.nitidus); + rionegrensis.caniventer = caniventer; + var veraecrucis = (function (_super) { + __extends(veraecrucis, _super); + function veraecrucis() { + _super.apply(this, arguments); + } + veraecrucis.prototype.naso = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + veraecrucis.prototype.vancouverensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + veraecrucis.prototype.africana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + veraecrucis.prototype.palliolata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + veraecrucis.prototype.nivicola = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return veraecrucis; + })(trivirgatus.mixtus); + rionegrensis.veraecrucis = veraecrucis; +})(rionegrensis || (rionegrensis = {})); +var julianae; +(function (julianae) { + var steerii = (function () { + function steerii() { + } + return steerii; + })(); + julianae.steerii = steerii; + var nudicaudus = (function () { + function nudicaudus() { + } + nudicaudus.prototype.brandtii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nudicaudus.prototype.maxwellii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nudicaudus.prototype.endoi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nudicaudus.prototype.venezuelae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nudicaudus.prototype.zamicrus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return nudicaudus; + })(); + julianae.nudicaudus = nudicaudus; + var galapagoensis = (function () { + function galapagoensis() { + } + galapagoensis.prototype.isabellae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.rueppellii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.peregusna = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.gliroides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.banakrisi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.rozendaali = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + galapagoensis.prototype.stuhlmanni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return galapagoensis; + })(); + julianae.galapagoensis = galapagoensis; + var albidens = (function () { + function albidens() { + } + albidens.prototype.mattheyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.Astatine = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.vincenti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.hirta = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.virginianus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.macrophyllum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + albidens.prototype.porcellus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return albidens; + })(); + julianae.albidens = albidens; + var oralis = (function (_super) { + __extends(oralis, _super); + function oralis() { + _super.apply(this, arguments); + } + oralis.prototype.cepapi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.porteri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.bindi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.puda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.mindorensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.ignitus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.rufus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.monax = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.unalascensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.wuchihensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.leucippe = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.ordii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oralis.prototype.eisentrauti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return oralis; + })(caurinus.psilurus); + julianae.oralis = oralis; + var sumatrana = (function (_super) { + __extends(sumatrana, _super); + function sumatrana() { + _super.apply(this, arguments); + } + sumatrana.prototype.wolffsohni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.geata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.awashensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.sturdeei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.pachyurus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.lyelli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sumatrana.prototype.neohibernicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return sumatrana; + })(Lanthanum.jugularis); + julianae.sumatrana = sumatrana; + var gerbillus = (function () { + function gerbillus() { + } + gerbillus.prototype.pundti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.tristrami = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.swarthi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.horsfieldii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.diazi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.rennelli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.maulinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.muscina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.pelengensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.abramus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gerbillus.prototype.reevesi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return gerbillus; + })(); + julianae.gerbillus = gerbillus; + var acariensis = (function () { + function acariensis() { + } + acariensis.prototype.levicula = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.minous = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.cinereiventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.longicaudatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.baeodon = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.soricoides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.datae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.spixii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.anakuma = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.kihaulei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.gymnura = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + acariensis.prototype.olchonensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return acariensis; + })(); + julianae.acariensis = acariensis; + var durangae = (function (_super) { + __extends(durangae, _super); + function durangae() { + _super.apply(this, arguments); + } + durangae.prototype.Californium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + durangae.prototype.Flerovium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + durangae.prototype.phrudus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return durangae; + })(dogramacii.aurata); + julianae.durangae = durangae; +})(julianae || (julianae = {})); +var ruatanica; +(function (ruatanica) { + var hector = (function () { + function hector() { + } + hector.prototype.humulis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + hector.prototype.eurycerus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return hector; + })(); + ruatanica.hector = hector; +})(ruatanica || (ruatanica = {})); +var Lanthanum; +(function (Lanthanum) { + var suillus = (function () { + function suillus() { + } + suillus.prototype.spilosoma = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + suillus.prototype.tumbalensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + suillus.prototype.anatolicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return suillus; + })(); + Lanthanum.suillus = suillus; + var nitidus = (function (_super) { + __extends(nitidus, _super); + function nitidus() { + _super.apply(this, arguments); + } + nitidus.prototype.granatensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.negligens = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.lewisi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.arge = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.dominicensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.taurus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.tonganus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.silvatica = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.midas = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + nitidus.prototype.bicornis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return nitidus; + })(argurus.gilbertii); + Lanthanum.nitidus = nitidus; + var megalonyx = (function (_super) { + __extends(megalonyx, _super); + function megalonyx() { + _super.apply(this, arguments); + } + megalonyx.prototype.phillipsii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.melanogaster = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.elaphus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.elater = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.ourebi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.caraccioli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.parva = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megalonyx.prototype.albipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return megalonyx; + })(caurinus.johorensis); + Lanthanum.megalonyx = megalonyx; + var jugularis = (function () { + function jugularis() { + } + jugularis.prototype.torrei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.revoili = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.macrobullatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.compactus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.talpinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.stramineus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.dartmouthi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.ogilbyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.incomtus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.surdaster = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.melanorhinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.picticaudata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.pomona = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + jugularis.prototype.ileile = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return jugularis; + })(); + Lanthanum.jugularis = jugularis; +})(Lanthanum || (Lanthanum = {})); +var rendalli; +(function (rendalli) { + var zuluensis = (function (_super) { + __extends(zuluensis, _super); + function zuluensis() { + _super.apply(this, arguments); + } + zuluensis.prototype.telfairi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.keyensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.occasius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.damarensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.Neptunium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.griseoflavus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.thar = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.alborufus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.fusicaudus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.gordonorum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.ruber = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.desmarestianus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.lutillus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + zuluensis.prototype.salocco = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return zuluensis; + })(julianae.steerii); + rendalli.zuluensis = zuluensis; + var moojeni = (function () { + function moojeni() { + } + moojeni.prototype.floweri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.montosa = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.miletus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.heaneyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.marchei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.budini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.maggietaylorae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.poliocephalus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.zibethicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + moojeni.prototype.biacensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return moojeni; + })(); + rendalli.moojeni = moojeni; + var crenulata = (function (_super) { + __extends(crenulata, _super); + function crenulata() { + _super.apply(this, arguments); + } + crenulata.prototype.salvanius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + crenulata.prototype.maritimus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + crenulata.prototype.edax = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return crenulata; + })(trivirgatus.falconeri); + rendalli.crenulata = crenulata; +})(rendalli || (rendalli = {})); +var trivirgatus; +(function (trivirgatus) { + var tumidifrons = (function () { + function tumidifrons() { + } + tumidifrons.prototype.nivalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.vestitus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.aequatorius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.scherman = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.improvisum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.cervinipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.audax = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + tumidifrons.prototype.vallinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return tumidifrons; + })(); + trivirgatus.tumidifrons = tumidifrons; + var mixtus = (function (_super) { + __extends(mixtus, _super); + function mixtus() { + _super.apply(this, arguments); + } + mixtus.prototype.ochrogaster = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.bryophilus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.liechtensteini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.crawfordi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.hypsibia = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.matacus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mixtus.prototype.demidoff = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return mixtus; + })(argurus.pygmaea); + trivirgatus.mixtus = mixtus; + var lotor = (function () { + function lotor() { + } + lotor.prototype.balensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lotor.prototype.pullata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return lotor; + })(); + trivirgatus.lotor = lotor; + var falconeri = (function () { + function falconeri() { + } + falconeri.prototype.cabrali = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.gouldi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.fuscicollis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.martiensseni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.gaoligongensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.shawi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + falconeri.prototype.gmelini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return falconeri; + })(); + trivirgatus.falconeri = falconeri; + var oconnelli = (function () { + function oconnelli() { + } + oconnelli.prototype.youngsoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.terrestris = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.chrysopus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.fuscomurina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.hellwaldii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.aenea = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.perrini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.entellus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.krebsii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.cephalotes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.molossinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.luisi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.ceylonicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oconnelli.prototype.ralli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return oconnelli; + })(); + trivirgatus.oconnelli = oconnelli; +})(trivirgatus || (trivirgatus = {})); +var quasiater; +(function (quasiater) { + var bobrinskoi = (function () { + function bobrinskoi() { + } + bobrinskoi.prototype.crassicaudatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + bobrinskoi.prototype.mulatta = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + bobrinskoi.prototype.ansorgei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + bobrinskoi.prototype.Copper = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return bobrinskoi; + })(); + quasiater.bobrinskoi = bobrinskoi; +})(quasiater || (quasiater = {})); +var ruatanica; +(function (ruatanica) { + var americanus = (function (_super) { + __extends(americanus, _super); + function americanus() { + _super.apply(this, arguments); + } + americanus.prototype.nasoloi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + americanus.prototype.mystacalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + americanus.prototype.fardoulisi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + americanus.prototype.tumidus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return americanus; + })(imperfecta.ciliolabrum); + ruatanica.americanus = americanus; +})(ruatanica || (ruatanica = {})); +var lavali; +(function (lavali) { + var wilsoni = (function (_super) { + __extends(wilsoni, _super); + function wilsoni() { + _super.apply(this, arguments); + } + wilsoni.prototype.setiger = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.lorentzii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.antisensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.blossevillii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.bontanus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.caligata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.franqueti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.roberti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.degelidus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.amoenus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.kob = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.csorbai = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wilsoni.prototype.dorsata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return wilsoni; + })(Lanthanum.nitidus); + lavali.wilsoni = wilsoni; + var beisa = (function () { + function beisa() { + } + return beisa; + })(); + lavali.beisa = beisa; + var otion = (function (_super) { + __extends(otion, _super); + function otion() { + _super.apply(this, arguments); + } + otion.prototype.bonaerensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.dussumieri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.osvaldoreigi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.grevyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.hirtula = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.cristatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.darlingtoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.fontanierii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.umbrosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.chiriquinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.orarius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.ilaeus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + otion.prototype.musschenbroekii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return otion; + })(howi.coludo); + lavali.otion = otion; + var xanthognathus = (function () { + function xanthognathus() { + } + xanthognathus.prototype.nanulus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.albigena = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.onca = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.gunnii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.apeco = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.variegates = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.goudotii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.pohlei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.ineptus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.euryotis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.maurisca = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + xanthognathus.prototype.coyhaiquensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return xanthognathus; + })(); + lavali.xanthognathus = xanthognathus; + var thaeleri = (function (_super) { + __extends(thaeleri, _super); + function thaeleri() { + _super.apply(this, arguments); + } + thaeleri.prototype.coromandra = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.parvipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.sponsorius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.vates = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.roosmalenorum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.rubicola = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.ikonnikovi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thaeleri.prototype.paramicrus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return thaeleri; + })(argurus.oreas); + lavali.thaeleri = thaeleri; + var lepturus = (function (_super) { + __extends(lepturus, _super); + function lepturus() { + _super.apply(this, arguments); + } + lepturus.prototype.ferrumequinum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lepturus.prototype.aequalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return lepturus; + })(Lanthanum.suillus); + lavali.lepturus = lepturus; +})(lavali || (lavali = {})); +var dogramacii; +(function (dogramacii) { + var robustulus = (function (_super) { + __extends(robustulus, _super); + function robustulus() { + _super.apply(this, arguments); + } + robustulus.prototype.fossor = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.humboldti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.mexicana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.martini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.beatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.leporina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.pearsonii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.keaysi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + robustulus.prototype.hindei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return robustulus; + })(lavali.wilsoni); + dogramacii.robustulus = robustulus; + var koepckeae = (function () { + function koepckeae() { + } + koepckeae.prototype.culturatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return koepckeae; + })(); + dogramacii.koepckeae = koepckeae; + var kaiseri = (function () { + function kaiseri() { + } + kaiseri.prototype.bedfordiae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.paramorum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.rubidus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.juninensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.marginata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.Meitnerium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.pinetorum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.hoolock = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.poeyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.Thulium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.patrius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.quadraticauda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + kaiseri.prototype.ater = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return kaiseri; + })(); + dogramacii.kaiseri = kaiseri; + var aurata = (function () { + function aurata() { + } + aurata.prototype.grunniens = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.howensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.karlkoopmani = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.mirapitanga = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.ophiodon = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.landeri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.sonomae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + aurata.prototype.erythromos = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return aurata; + })(); + dogramacii.aurata = aurata; +})(dogramacii || (dogramacii = {})); +var lutreolus; +(function (lutreolus) { + var schlegeli = (function (_super) { + __extends(schlegeli, _super); + function schlegeli() { + _super.apply(this, arguments); + } + schlegeli.prototype.mittendorfi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.blicki = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.culionensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.scrofa = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.fernandoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.Tin = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.marmorata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.tavaratra = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.peregrina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.frontalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.cuniculus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.magdalenae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.andamanensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + schlegeli.prototype.dispar = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return schlegeli; + })(lavali.beisa); + lutreolus.schlegeli = schlegeli; +})(lutreolus || (lutreolus = {})); +var argurus; +(function (argurus) { + var dauricus = (function () { + function dauricus() { + } + dauricus.prototype.chinensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.duodecimcostatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.foxi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.macleayii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.darienensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.hardwickii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.albifrons = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.jacobitus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.guentheri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.mahomet = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dauricus.prototype.misionensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return dauricus; + })(); + argurus.dauricus = dauricus; +})(argurus || (argurus = {})); +var nigra; +(function (nigra) { + var dolichurus = (function () { + function dolichurus() { + } + dolichurus.prototype.solomonis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.alfredi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.morrisi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.lekaguli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.dimissus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.phaeotis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.ustus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + dolichurus.prototype.sagei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return dolichurus; + })(); + nigra.dolichurus = dolichurus; +})(nigra || (nigra = {})); +var panglima; +(function (panglima) { + var amphibius = (function (_super) { + __extends(amphibius, _super); + function amphibius() { + _super.apply(this, arguments); + } + amphibius.prototype.bottegi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amphibius.prototype.jerdoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amphibius.prototype.camtschatica = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amphibius.prototype.spadix = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amphibius.prototype.luismanueli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amphibius.prototype.aceramarcae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return amphibius; + })(caurinus.johorensis); + panglima.amphibius = amphibius; + var fundatus = (function (_super) { + __extends(fundatus, _super); + function fundatus() { + _super.apply(this, arguments); + } + fundatus.prototype.crassulus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fundatus.prototype.flamarioni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fundatus.prototype.mirabilis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return fundatus; + })(lutreolus.schlegeli); + panglima.fundatus = fundatus; + var abidi = (function (_super) { + __extends(abidi, _super); + function abidi() { + _super.apply(this, arguments); + } + abidi.prototype.greyii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + abidi.prototype.macedonicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + abidi.prototype.galili = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + abidi.prototype.thierryi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + abidi.prototype.ega = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return abidi; + })(argurus.dauricus); + panglima.abidi = abidi; +})(panglima || (panglima = {})); +var quasiater; +(function (quasiater) { + var carolinensis = (function () { + function carolinensis() { + } + carolinensis.prototype.concinna = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.aeneus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.aloysiisabaudiae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.tenellus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.andium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.persephone = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + carolinensis.prototype.patrizii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return carolinensis; + })(); + quasiater.carolinensis = carolinensis; +})(quasiater || (quasiater = {})); +var minutus; +(function (minutus) { + var himalayana = (function (_super) { + __extends(himalayana, _super); + function himalayana() { + _super.apply(this, arguments); + } + himalayana.prototype.simoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.lobata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.rusticus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.latona = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.famulus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.flaviceps = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.paradoxolophus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.Osmium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.vulgaris = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.betsileoensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.vespuccii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + himalayana.prototype.olympus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return himalayana; + })(lutreolus.punicus); + minutus.himalayana = himalayana; +})(minutus || (minutus = {})); +var caurinus; +(function (caurinus) { + var mahaganus = (function (_super) { + __extends(mahaganus, _super); + function mahaganus() { + _super.apply(this, arguments); + } + mahaganus.prototype.martiniquensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.devius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.masalai = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.kathleenae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.simulus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.nigrovittatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.senegalensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + mahaganus.prototype.acticola = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return mahaganus; + })(panglima.fundatus); + caurinus.mahaganus = mahaganus; +})(caurinus || (caurinus = {})); +var macrorhinos; +(function (macrorhinos) { + var marmosurus = (function () { + function marmosurus() { + } + marmosurus.prototype.tansaniana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return marmosurus; + })(); + macrorhinos.marmosurus = marmosurus; +})(macrorhinos || (macrorhinos = {})); +var howi; +(function (howi) { + var angulatus = (function (_super) { + __extends(angulatus, _super); + function angulatus() { + _super.apply(this, arguments); + } + angulatus.prototype.pennatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return angulatus; + })(sagitta.stolzmanni); + howi.angulatus = angulatus; +})(howi || (howi = {})); +var daubentonii; +(function (daubentonii) { + var nesiotes = (function () { + function nesiotes() { + } + return nesiotes; + })(); + daubentonii.nesiotes = nesiotes; +})(daubentonii || (daubentonii = {})); +var nigra; +(function (nigra) { + var thalia = (function () { + function thalia() { + } + thalia.prototype.dichotomus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.arnuxii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.verheyeni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.dauuricus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.tristriatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.lasiura = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.gangetica = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + thalia.prototype.brucei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return thalia; + })(); + nigra.thalia = thalia; +})(nigra || (nigra = {})); +var sagitta; +(function (sagitta) { + var walkeri = (function (_super) { + __extends(walkeri, _super); + function walkeri() { + _super.apply(this, arguments); + } + walkeri.prototype.maracajuensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return walkeri; + })(minutus.portoricensis); + sagitta.walkeri = walkeri; +})(sagitta || (sagitta = {})); +var minutus; +(function (minutus) { + var inez = (function (_super) { + __extends(inez, _super); + function inez() { + _super.apply(this, arguments); + } + inez.prototype.vexillaris = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return inez; + })(samarensis.pelurus); + minutus.inez = inez; +})(minutus || (minutus = {})); +var macrorhinos; +(function (macrorhinos) { + var konganensis = (function (_super) { + __extends(konganensis, _super); + function konganensis() { + _super.apply(this, arguments); + } + return konganensis; + })(imperfecta.lasiurus); + macrorhinos.konganensis = konganensis; +})(macrorhinos || (macrorhinos = {})); +var panamensis; +(function (panamensis) { + var linulus = (function (_super) { + __extends(linulus, _super); + function linulus() { + _super.apply(this, arguments); + } + linulus.prototype.goslingi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.taki = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.fumosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.rufinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.lami = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.regina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.nanilla = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.enganus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + linulus.prototype.gomantongensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return linulus; + })(ruatanica.hector); + panamensis.linulus = linulus; +})(panamensis || (panamensis = {})); +var nigra; +(function (nigra) { + var gracilis = (function () { + function gracilis() { + } + gracilis.prototype.weddellii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.echinothrix = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.garridoi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.rouxii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.aurita = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.geoffrensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.theresa = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.melanocarpus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.dubiaquercus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.pectoralis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.apoensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.grisescens = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gracilis.prototype.ramirohitra = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return gracilis; + })(); + nigra.gracilis = gracilis; +})(nigra || (nigra = {})); +var samarensis; +(function (samarensis) { + var pelurus = (function (_super) { + __extends(pelurus, _super); + function pelurus() { + _super.apply(this, arguments); + } + pelurus.prototype.Palladium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.castanea = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.chamek = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.nigriceps = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.lunatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.madurae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.chinchilla = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.eliasi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.proditor = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.gambianus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.petteri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.nusatenggara = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pelurus.prototype.olitor = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return pelurus; + })(sagitta.stolzmanni); + samarensis.pelurus = pelurus; + var fuscus = (function (_super) { + __extends(fuscus, _super); + function fuscus() { + _super.apply(this, arguments); + } + fuscus.prototype.planifrons = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.badia = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.prymnolopha = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.natalensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.hunteri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.sapiens = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.macrocercus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.nimbae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.suricatta = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.jagorii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.beecrofti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.imaizumii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.colocolo = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + fuscus.prototype.wolfi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return fuscus; + })(macrorhinos.daphaenodon); + samarensis.fuscus = fuscus; + var pallidus = (function () { + function pallidus() { + } + pallidus.prototype.oblativa = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pallidus.prototype.watersi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pallidus.prototype.glacialis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pallidus.prototype.viaria = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return pallidus; + })(); + samarensis.pallidus = pallidus; + var cahirinus = (function () { + function cahirinus() { + } + cahirinus.prototype.alashanicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cahirinus.prototype.flaviventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cahirinus.prototype.bottai = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cahirinus.prototype.pinetis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cahirinus.prototype.saussurei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return cahirinus; + })(); + samarensis.cahirinus = cahirinus; +})(samarensis || (samarensis = {})); +var sagitta; +(function (sagitta) { + var leptoceros = (function (_super) { + __extends(leptoceros, _super); + function leptoceros() { + _super.apply(this, arguments); + } + leptoceros.prototype.victus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + leptoceros.prototype.hoplomyoides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + leptoceros.prototype.gratiosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + leptoceros.prototype.rex = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + leptoceros.prototype.bolami = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return leptoceros; + })(caurinus.johorensis); + sagitta.leptoceros = leptoceros; +})(sagitta || (sagitta = {})); +var daubentonii; +(function (daubentonii) { + var nigricans = (function (_super) { + __extends(nigricans, _super); + function nigricans() { + _super.apply(this, arguments); + } + nigricans.prototype.woosnami = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return nigricans; + })(sagitta.stolzmanni); + daubentonii.nigricans = nigricans; +})(daubentonii || (daubentonii = {})); +var dammermani; +(function (dammermani) { + var siberu = (function () { + function siberu() { + } + return siberu; + })(); + dammermani.siberu = siberu; +})(dammermani || (dammermani = {})); +var argurus; +(function (argurus) { + var pygmaea = (function (_super) { + __extends(pygmaea, _super); + function pygmaea() { + _super.apply(this, arguments); + } + pygmaea.prototype.pajeros = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pygmaea.prototype.capucinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + pygmaea.prototype.cuvieri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return pygmaea; + })(rendalli.moojeni); + argurus.pygmaea = pygmaea; +})(argurus || (argurus = {})); +var chrysaeolus; +(function (chrysaeolus) { + var sarasinorum = (function (_super) { + __extends(sarasinorum, _super); + function sarasinorum() { + _super.apply(this, arguments); + } + sarasinorum.prototype.belzebul = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.hinpoon = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.kandti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.cynosuros = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.Germanium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.Ununoctium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sarasinorum.prototype.princeps = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return sarasinorum; + })(caurinus.psilurus); + chrysaeolus.sarasinorum = sarasinorum; +})(chrysaeolus || (chrysaeolus = {})); +var argurus; +(function (argurus) { + var wetmorei = (function () { + function wetmorei() { + } + wetmorei.prototype.leucoptera = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.ochraventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.tephromelas = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.cracens = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.jamaicensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.gymnocaudus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wetmorei.prototype.mayori = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return wetmorei; + })(); + argurus.wetmorei = wetmorei; +})(argurus || (argurus = {})); +var argurus; +(function (argurus) { + var oreas = (function (_super) { + __extends(oreas, _super); + function oreas() { + _super.apply(this, arguments); + } + oreas.prototype.salamonis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.paniscus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.fagani = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.papuanus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.timidus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.nghetinhensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.barbei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + oreas.prototype.univittatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return oreas; + })(lavali.wilsoni); + argurus.oreas = oreas; +})(argurus || (argurus = {})); +var daubentonii; +(function (daubentonii) { + var arboreus = (function () { + function arboreus() { + } + arboreus.prototype.capreolus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.moreni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.hypoleucos = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.paedulcus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.pucheranii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.stella = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.brasiliensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.brevicaudata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.vitticollis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.huangensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.cameroni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + arboreus.prototype.tianshanica = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return arboreus; + })(); + daubentonii.arboreus = arboreus; +})(daubentonii || (daubentonii = {})); +var patas; +(function (patas) { + var uralensis = (function () { + function uralensis() { + } + uralensis.prototype.cartilagonodus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.pyrrhinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.insulans = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.nigricauda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.muricauda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.albicaudus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.fallax = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.attenuata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.megalura = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.neblina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.citellus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.tanezumi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + uralensis.prototype.albiventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return uralensis; + })(); + patas.uralensis = uralensis; +})(patas || (patas = {})); +var provocax; +(function (provocax) { + var melanoleuca = (function (_super) { + __extends(melanoleuca, _super); + function melanoleuca() { + _super.apply(this, arguments); + } + melanoleuca.prototype.Neodymium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanoleuca.prototype.baeri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return melanoleuca; + })(lavali.wilsoni); + provocax.melanoleuca = melanoleuca; +})(provocax || (provocax = {})); +var sagitta; +(function (sagitta) { + var sicarius = (function () { + function sicarius() { + } + sicarius.prototype.Chlorine = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sicarius.prototype.simulator = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return sicarius; + })(); + sagitta.sicarius = sicarius; +})(sagitta || (sagitta = {})); +var howi; +(function (howi) { + var marcanoi = (function (_super) { + __extends(marcanoi, _super); + function marcanoi() { + _super.apply(this, arguments); + } + marcanoi.prototype.formosae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.dudui = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.leander = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.martinsi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.beatrix = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.griseoventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.zerda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.yucatanicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.nigrita = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.jouvenetae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.indefessus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.vuquangensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.Zirconium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + marcanoi.prototype.hyaena = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return marcanoi; + })(Lanthanum.megalonyx); + howi.marcanoi = marcanoi; +})(howi || (howi = {})); +var argurus; +(function (argurus) { + var gilbertii = (function () { + function gilbertii() { + } + gilbertii.prototype.nasutus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.poecilops = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.sondaicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.auriventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.cherriei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.lindberghi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.pipistrellus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.paranus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.dubosti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.opossum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.oreopolus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + gilbertii.prototype.amurensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return gilbertii; + })(); + argurus.gilbertii = gilbertii; +})(argurus || (argurus = {})); +var petrophilus; +(function (petrophilus) { + var minutilla = (function () { + function minutilla() { + } + return minutilla; + })(); + petrophilus.minutilla = minutilla; +})(petrophilus || (petrophilus = {})); +var lutreolus; +(function (lutreolus) { + var punicus = (function () { + function punicus() { + } + punicus.prototype.strandi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.lar = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.erica = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.trichura = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.lemniscatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.aspalax = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.marshalli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.Zinc = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.monochromos = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.purinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.ischyrus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.tenuis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + punicus.prototype.Helium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return punicus; + })(); + lutreolus.punicus = punicus; +})(lutreolus || (lutreolus = {})); +var macrorhinos; +(function (macrorhinos) { + var daphaenodon = (function () { + function daphaenodon() { + } + daphaenodon.prototype.bredanensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + daphaenodon.prototype.othus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + daphaenodon.prototype.hammondi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + daphaenodon.prototype.aureocollaris = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + daphaenodon.prototype.flavipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + daphaenodon.prototype.callosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return daphaenodon; + })(); + macrorhinos.daphaenodon = daphaenodon; +})(macrorhinos || (macrorhinos = {})); +var sagitta; +(function (sagitta) { + var cinereus = (function () { + function cinereus() { + } + cinereus.prototype.zunigae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.microps = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.guaporensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.tonkeana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.montensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.sphinx = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.glis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.dorsalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.fimbriatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.sara = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.epimelas = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cinereus.prototype.pittieri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return cinereus; + })(); + sagitta.cinereus = cinereus; +})(sagitta || (sagitta = {})); +var nigra; +(function (nigra) { + var caucasica = (function () { + function caucasica() { + } + return caucasica; + })(); + nigra.caucasica = caucasica; +})(nigra || (nigra = {})); +var gabriellae; +(function (gabriellae) { + var klossii = (function (_super) { + __extends(klossii, _super); + function klossii() { + _super.apply(this, arguments); + } + return klossii; + })(imperfecta.lasiurus); + gabriellae.klossii = klossii; + var amicus = (function () { + function amicus() { + } + amicus.prototype.pirrensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.phaeura = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.voratus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.satarae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.hooperi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.perrensi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.ridei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.audeberti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.Lutetium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + amicus.prototype.atrox = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return amicus; + })(); + gabriellae.amicus = amicus; + var echinatus = (function () { + function echinatus() { + } + echinatus.prototype.tenuipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return echinatus; + })(); + gabriellae.echinatus = echinatus; +})(gabriellae || (gabriellae = {})); +var imperfecta; +(function (imperfecta) { + var lasiurus = (function () { + function lasiurus() { + } + lasiurus.prototype.marisae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lasiurus.prototype.fulvus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lasiurus.prototype.paranaensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lasiurus.prototype.didactylus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lasiurus.prototype.schreibersii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + lasiurus.prototype.orii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return lasiurus; + })(); + imperfecta.lasiurus = lasiurus; + var subspinosus = (function () { + function subspinosus() { + } + subspinosus.prototype.monticularis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.Gadolinium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.oasicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.paterculus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.punctata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.invictus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.stangeri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.siskiyou = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.welwitschii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.Polonium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + subspinosus.prototype.harpia = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return subspinosus; + })(); + imperfecta.subspinosus = subspinosus; + var ciliolabrum = (function (_super) { + __extends(ciliolabrum, _super); + function ciliolabrum() { + _super.apply(this, arguments); + } + ciliolabrum.prototype.leschenaultii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + ciliolabrum.prototype.ludia = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + ciliolabrum.prototype.sinicus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return ciliolabrum; + })(dogramacii.robustulus); + imperfecta.ciliolabrum = ciliolabrum; +})(imperfecta || (imperfecta = {})); +var quasiater; +(function (quasiater) { + var wattsi = (function () { + function wattsi() { + } + wattsi.prototype.lagotis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wattsi.prototype.hussoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wattsi.prototype.bilarni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + wattsi.prototype.cabrerae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return wattsi; + })(); + quasiater.wattsi = wattsi; +})(quasiater || (quasiater = {})); +var petrophilus; +(function (petrophilus) { + var sodyi = (function (_super) { + __extends(sodyi, _super); + function sodyi() { + _super.apply(this, arguments); + } + sodyi.prototype.saundersiae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.imberbis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.cansdalei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.Lawrencium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.catta = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.breviceps = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.transitionalis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.heptneri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + sodyi.prototype.bairdii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return sodyi; + })(quasiater.bobrinskoi); + petrophilus.sodyi = sodyi; +})(petrophilus || (petrophilus = {})); +var caurinus; +(function (caurinus) { + var megaphyllus = (function (_super) { + __extends(megaphyllus, _super); + function megaphyllus() { + _super.apply(this, arguments); + } + megaphyllus.prototype.montana = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.amatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.bucculentus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.lepida = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.graecus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.forsteri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.perotensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + megaphyllus.prototype.cirrhosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return megaphyllus; + })(imperfecta.lasiurus); + caurinus.megaphyllus = megaphyllus; +})(caurinus || (caurinus = {})); +var minutus; +(function (minutus) { + var portoricensis = (function () { + function portoricensis() { + } + portoricensis.prototype.relictus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + portoricensis.prototype.aequatorianus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + portoricensis.prototype.rhinogradoides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return portoricensis; + })(); + minutus.portoricensis = portoricensis; +})(minutus || (minutus = {})); +var lutreolus; +(function (lutreolus) { + var foina = (function () { + function foina() { + } + foina.prototype.tarfayensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.Promethium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.salinae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.kerri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.scotti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.camerunensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.affinis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.siebersi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.maquassiensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.layardi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.bishopi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.apodemoides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + foina.prototype.argentiventer = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return foina; + })(); + lutreolus.foina = foina; +})(lutreolus || (lutreolus = {})); +var lutreolus; +(function (lutreolus) { + var cor = (function (_super) { + __extends(cor, _super); + function cor() { + _super.apply(this, arguments); + } + cor.prototype.antinorii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.voi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.mussoi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.truncatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.achates = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.praedatrix = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.mzabi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.xanthinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.tapoatafa = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + cor.prototype.castroviejoi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return cor; + })(panglima.fundatus); + lutreolus.cor = cor; +})(lutreolus || (lutreolus = {})); +var howi; +(function (howi) { + var coludo = (function () { + function coludo() { + } + coludo.prototype.bernhardi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + coludo.prototype.isseli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return coludo; + })(); + howi.coludo = coludo; +})(howi || (howi = {})); +var argurus; +(function (argurus) { + var germaini = (function (_super) { + __extends(germaini, _super); + function germaini() { + _super.apply(this, arguments); + } + germaini.prototype.sharpei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + germaini.prototype.palmarum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return germaini; + })(gabriellae.amicus); + argurus.germaini = germaini; +})(argurus || (argurus = {})); +var sagitta; +(function (sagitta) { + var stolzmanni = (function () { + function stolzmanni() { + } + stolzmanni.prototype.riparius = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.dhofarensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.tricolor = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.gardneri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.walleri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.talpoides = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.pallipes = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.lagurus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.hipposideros = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.griselda = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + stolzmanni.prototype.florium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return stolzmanni; + })(); + sagitta.stolzmanni = stolzmanni; +})(sagitta || (sagitta = {})); +var dammermani; +(function (dammermani) { + var melanops = (function (_super) { + __extends(melanops, _super); + function melanops() { + _super.apply(this, arguments); + } + melanops.prototype.blarina = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.harwoodi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.ashaninka = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.wiedii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.godmani = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.condorensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.xerophila = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.laminatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.archeri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.hidalgo = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.unicolor = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.philippii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + melanops.prototype.bocagei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return melanops; + })(minutus.inez); + dammermani.melanops = melanops; +})(dammermani || (dammermani = {})); +var argurus; +(function (argurus) { + var peninsulae = (function (_super) { + __extends(peninsulae, _super); + function peninsulae() { + _super.apply(this, arguments); + } + peninsulae.prototype.aitkeni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.novaeangliae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.olallae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.anselli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.timminsi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.sordidus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.telfordi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + peninsulae.prototype.cavernarum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return peninsulae; + })(patas.uralensis); + argurus.peninsulae = peninsulae; +})(argurus || (argurus = {})); +var argurus; +(function (argurus) { + var netscheri = (function () { + function netscheri() { + } + netscheri.prototype.gravis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.ruschii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.tricuspidatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.fernandezi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.colletti = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.microbullatus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.eburneae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.tatei = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.millardi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.pruinosus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.delator = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.nyikae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + netscheri.prototype.ruemmleri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return netscheri; + })(); + argurus.netscheri = netscheri; +})(argurus || (argurus = {})); +var ruatanica; +(function (ruatanica) { + var Praseodymium = (function (_super) { + __extends(Praseodymium, _super); + function Praseodymium() { + _super.apply(this, arguments); + } + Praseodymium.prototype.clara = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.spectabilis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.kamensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.ruddi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.bartelsii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.yerbabuenae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.davidi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.pilirostris = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.catherinae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.frontata = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.Terbium = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.thomensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + Praseodymium.prototype.soricinus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return Praseodymium; + })(ruatanica.hector); + ruatanica.Praseodymium = Praseodymium; +})(ruatanica || (ruatanica = {})); +var caurinus; +(function (caurinus) { + var johorensis = (function (_super) { + __extends(johorensis, _super); + function johorensis() { + _super.apply(this, arguments); + } + johorensis.prototype.maini = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return johorensis; + })(lutreolus.punicus); + caurinus.johorensis = johorensis; +})(caurinus || (caurinus = {})); +var argurus; +(function (argurus) { + var luctuosa = (function () { + function luctuosa() { + } + luctuosa.prototype.loriae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return luctuosa; + })(); + argurus.luctuosa = luctuosa; +})(argurus || (argurus = {})); +var panamensis; +(function (panamensis) { + var setulosus = (function () { + function setulosus() { + } + setulosus.prototype.duthieae = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.guereza = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.buselaphus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.nuttalli = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.pelii = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.tunneyi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.lamula = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + setulosus.prototype.vampyrus = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return setulosus; + })(); + panamensis.setulosus = setulosus; +})(panamensis || (panamensis = {})); +var petrophilus; +(function (petrophilus) { + var rosalia = (function () { + function rosalia() { + } + rosalia.prototype.palmeri = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + rosalia.prototype.baeops = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + rosalia.prototype.ozensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + rosalia.prototype.creaghi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + rosalia.prototype.montivaga = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return rosalia; + })(); + petrophilus.rosalia = rosalia; +})(petrophilus || (petrophilus = {})); +var caurinus; +(function (caurinus) { + var psilurus = (function (_super) { + __extends(psilurus, _super); + function psilurus() { + _super.apply(this, arguments); + } + psilurus.prototype.socialis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + psilurus.prototype.lundi = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + psilurus.prototype.araeum = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + psilurus.prototype.calamianensis = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + psilurus.prototype.petersoni = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + psilurus.prototype.nitela = function () { + var _this = this; + var x; + (function () { + var y = _this; + }); + return x; + }; + return psilurus; + })(lutreolus.punicus); + caurinus.psilurus = psilurus; +})(caurinus || (caurinus = {})); + + +//// [resolvingClassDeclarationWhenInBaseTypeResolution.d.ts] diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt new file mode 100644 index 0000000000000..f97fc72413454 --- /dev/null +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/restArgAssignmentCompat.ts (1 errors) ==== + function f(...x: number[]) { + x.forEach((n, i) => void ('item ' + i + ' = ' + n)); + } + function g(x: number[], y: string) { } + + var n = g; + n = f; + ~ +!!! Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'number' is not assignable to type 'number[]': +!!! Property 'concat' is missing in type 'Number'. + n([4], 'foo'); + \ No newline at end of file diff --git a/tests/baselines/reference/restArgAssignmentCompat.js b/tests/baselines/reference/restArgAssignmentCompat.js new file mode 100644 index 0000000000000..a52cff7ec5c1d --- /dev/null +++ b/tests/baselines/reference/restArgAssignmentCompat.js @@ -0,0 +1,24 @@ +//// [restArgAssignmentCompat.ts] +function f(...x: number[]) { + x.forEach((n, i) => void ('item ' + i + ' = ' + n)); +} +function g(x: number[], y: string) { } + +var n = g; +n = f; +n([4], 'foo'); + + +//// [restArgAssignmentCompat.js] +function f() { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i - 0] = arguments[_i]; + } + x.forEach(function (n, i) { return void ('item ' + i + ' = ' + n); }); +} +function g(x, y) { +} +var n = g; +n = f; +n([4], 'foo'); diff --git a/tests/baselines/reference/restArgMissingName.errors.txt b/tests/baselines/reference/restArgMissingName.errors.txt new file mode 100644 index 0000000000000..4cf57191919f6 --- /dev/null +++ b/tests/baselines/reference/restArgMissingName.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/restArgMissingName.ts (1 errors) ==== + function sum (...) {} + ~ +!!! Identifier expected. + \ No newline at end of file diff --git a/tests/baselines/reference/restParamAsOptional.errors.txt b/tests/baselines/reference/restParamAsOptional.errors.txt new file mode 100644 index 0000000000000..2a7451a992c30 --- /dev/null +++ b/tests/baselines/reference/restParamAsOptional.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/restParamAsOptional.ts (2 errors) ==== + function f(...x?) { } + ~ +!!! A rest parameter cannot be optional. + function f2(...x = []) { } + ~ +!!! A rest parameter cannot have an initializer. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterAssignmentCompatibility.js b/tests/baselines/reference/restParameterAssignmentCompatibility.js new file mode 100644 index 0000000000000..6608d195f9f58 --- /dev/null +++ b/tests/baselines/reference/restParameterAssignmentCompatibility.js @@ -0,0 +1,59 @@ +//// [restParameterAssignmentCompatibility.ts] +class T { + m(...p3) { + + } +} + +class S { + m(p1, p2) { + + } +} + +var t: T; +var s: S; +// M is a non - specialized call or construct signature and S' contains a call or construct signature N where, +// the number of non-optional parameters in N is less than or equal to the total number of parameters in M, +t = s; // Should be valid (rest params correspond to an infinite expansion of parameters) + +class T1 { + m(p1?, p2?) { + + } +} +var t1: T1; +// When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. +t1 = s; // Similar to above, but optionality does not matter here. + +//// [restParameterAssignmentCompatibility.js] +var T = (function () { + function T() { + } + T.prototype.m = function () { + var p3 = []; + for (var _i = 0; _i < arguments.length; _i++) { + p3[_i - 0] = arguments[_i]; + } + }; + return T; +})(); +var S = (function () { + function S() { + } + S.prototype.m = function (p1, p2) { + }; + return S; +})(); +var t; +var s; +t = s; +var T1 = (function () { + function T1() { + } + T1.prototype.m = function (p1, p2) { + }; + return T1; +})(); +var t1; +t1 = s; diff --git a/tests/baselines/reference/restParameterNoTypeAnnotation.js b/tests/baselines/reference/restParameterNoTypeAnnotation.js new file mode 100644 index 0000000000000..95e092fdd4373 --- /dev/null +++ b/tests/baselines/reference/restParameterNoTypeAnnotation.js @@ -0,0 +1,16 @@ +//// [restParameterNoTypeAnnotation.ts] +function foo(...rest) { + var x: number = rest[0]; + return x; +} + + +//// [restParameterNoTypeAnnotation.js] +function foo() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i - 0] = arguments[_i]; + } + var x = rest[0]; + return x; +} diff --git a/tests/baselines/reference/restParameterNotLast.errors.txt b/tests/baselines/reference/restParameterNotLast.errors.txt new file mode 100644 index 0000000000000..049aa0c92faf2 --- /dev/null +++ b/tests/baselines/reference/restParameterNotLast.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/restParameterNotLast.ts (1 errors) ==== + function f(...x, y) { } + ~ +!!! A rest parameter must be last in a parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.errors.txt b/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.errors.txt new file mode 100644 index 0000000000000..6e9dfa7a9cdcc --- /dev/null +++ b/tests/baselines/reference/restParameterWithoutAnnotationIsAnyArray.errors.txt @@ -0,0 +1,33 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParameterWithoutAnnotationIsAnyArray.ts (3 errors) ==== + // Rest parameters without type annotations are 'any', errors only for the functions with 2 rest params + + function foo(...x) { } + var f = function foo(...x) { } + var f2 = (...x, ...y) => { } + ~ +!!! A rest parameter must be last in a parameter list. + + class C { + foo(...x) { } + } + + interface I { + (...x); + foo(...x, ...y); + ~ +!!! A rest parameter must be last in a parameter list. + } + + var a: { + (...x); + foo(...x); + } + + var b = { + foo(...x) { }, + a: function foo(...x, ...y) { }, + ~ +!!! A rest parameter must be last in a parameter list. + b: (...x) => { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/restParameters.js b/tests/baselines/reference/restParameters.js new file mode 100644 index 0000000000000..2e5b7bb4c928a --- /dev/null +++ b/tests/baselines/reference/restParameters.js @@ -0,0 +1,34 @@ +//// [restParameters.ts] +function f18(a?:string, ...b:number[]){} + +function f19(a?:string, b?:number, ...c:number[]){} + +function f20(a:string, b?:string, ...c:number[]){} + +function f21(a:string, b?:string, c?:number, ...d:number[]){} + +//// [restParameters.js] +function f18(a) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } +} +function f19(a, b) { + var c = []; + for (var _i = 2; _i < arguments.length; _i++) { + c[_i - 2] = arguments[_i]; + } +} +function f20(a, b) { + var c = []; + for (var _i = 2; _i < arguments.length; _i++) { + c[_i - 2] = arguments[_i]; + } +} +function f21(a, b, c) { + var d = []; + for (var _i = 3; _i < arguments.length; _i++) { + d[_i - 3] = arguments[_i]; + } +} diff --git a/tests/baselines/reference/restParametersOfNonArrayTypes.errors.txt b/tests/baselines/reference/restParametersOfNonArrayTypes.errors.txt new file mode 100644 index 0000000000000..9df8e4aebf580 --- /dev/null +++ b/tests/baselines/reference/restParametersOfNonArrayTypes.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes.ts (17 errors) ==== + // Rest parameters must be an array type if they have a type annotation, so all these are errors + + function foo(...x: string) { } + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f = function foo(...x: number) { } + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f2 = (...x: Date, ...y: boolean) => { } + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + + class C { + foo(...x: C) { } + ~~~~~~~ +!!! A rest parameter must be of an array type. + } + + interface I { + (...x: string); + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: number, ...y: number); + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var a: { + (...x: string); + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: string); + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var b = { + foo(...x: string) { }, + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + a: function foo(...x: number, ...y: Date) { }, + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~ +!!! A rest parameter must be of an array type. + b: (...x: string) => { } + ~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } \ No newline at end of file diff --git a/tests/baselines/reference/restParametersOfNonArrayTypes2.errors.txt b/tests/baselines/reference/restParametersOfNonArrayTypes2.errors.txt new file mode 100644 index 0000000000000..96009b1726b61 --- /dev/null +++ b/tests/baselines/reference/restParametersOfNonArrayTypes2.errors.txt @@ -0,0 +1,125 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersOfNonArrayTypes2.ts (34 errors) ==== + // Rest parameters must be an array type if they have a type annotation, + // user defined subtypes of array do not count, all of these are errors + + interface MyThing extends Array { } + interface MyThing2 extends Array { } + + function foo(...x: MyThing) { } + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f = function foo(...x: MyThing) { } + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f2 = (...x: MyThing, ...y: MyThing) => { } + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + + class C { + foo(...x: MyThing) { } + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + interface I { + (...x: MyThing); + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: MyThing, ...y: MyThing); + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var a: { + (...x: MyThing); + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: MyThing); + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var b = { + foo(...x: MyThing) { }, + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + a: function foo(...x: MyThing, ...y: MyThing) { }, + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + b: (...x: MyThing) => { } + ~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + + + + function foo2(...x: MyThing2) { } + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f3 = function foo(...x: MyThing2) { } + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + var f4 = (...x: MyThing2, ...y: MyThing2) => { } + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + + class C2 { + foo(...x: MyThing2) { } + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + interface I2 { + (...x: MyThing2); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: MyThing2, ...y: MyThing2); + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var a2: { + (...x: MyThing2); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + foo(...x: MyThing2); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } + + var b2 = { + foo(...x: MyThing2) { }, + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + a: function foo(...x: MyThing2, ...y: MyThing2) { }, + ~ +!!! A rest parameter must be last in a parameter list. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + b: (...x: MyThing2) => { } + ~~~~~~~~~~~~~~~~~~~~~~ +!!! A rest parameter must be of an array type. + } \ No newline at end of file diff --git a/tests/baselines/reference/restParametersWithArrayTypeAnnotations.errors.txt b/tests/baselines/reference/restParametersWithArrayTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..1c7a238e7e18a --- /dev/null +++ b/tests/baselines/reference/restParametersWithArrayTypeAnnotations.errors.txt @@ -0,0 +1,65 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/restParametersWithArrayTypeAnnotations.ts (6 errors) ==== + // Rest parameters must be an array type if they have a type annotation, errors only for the functions with 2 rest params + + function foo(...x: number[]) { } + var f = function foo(...x: number[]) { } + var f2 = (...x: number[], ...y: number[]) => { } + ~ +!!! A rest parameter must be last in a parameter list. + + class C { + foo(...x: number[]) { } + } + + interface I { + (...x: number[]); + foo(...x: number[], ...y: number[]); + ~ +!!! A rest parameter must be last in a parameter list. + } + + var a: { + (...x: number[]); + foo(...x: number[]); + } + + var b = { + foo(...x: number[]) { }, + a: function foo(...x: number[], ...y: number[]) { }, + ~ +!!! A rest parameter must be last in a parameter list. + b: (...x: number[]) => { } + } + + + + + function foo2(...x: Array) { } + var f3 = function foo(...x: Array) { } + var f4 = (...x: Array, ...y: Array) => { } + ~ +!!! A rest parameter must be last in a parameter list. + + class C2 { + foo(...x: Array) { } + } + + interface I2 { + (...x: Array); + foo(...x: Array, ...y: Array); + ~ +!!! A rest parameter must be last in a parameter list. + } + + var a2: { + (...x: Array); + foo(...x: Array); + } + + var b2 = { + foo(...x: Array) { }, + a: function foo(...x: Array, ...y: Array) { }, + ~ +!!! A rest parameter must be last in a parameter list. + b: (...x: Array) => { } + } \ No newline at end of file diff --git a/tests/baselines/reference/restParamsWithNonRestParams.errors.txt b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt new file mode 100644 index 0000000000000..f5a57b081496b --- /dev/null +++ b/tests/baselines/reference/restParamsWithNonRestParams.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/restParamsWithNonRestParams.ts (1 errors) ==== + function foo(...b:number[]){} + foo(); // ok + function foo2(a:string, ...b:number[]){} + foo2(); // should be an error + ~~~~~~ +!!! Supplied parameters do not match any signature of call target. + function foo3(a?:string, ...b:number[]){} + foo3(); // error but shouldn't be \ No newline at end of file diff --git a/tests/baselines/reference/restParamsWithNonRestParams.js b/tests/baselines/reference/restParamsWithNonRestParams.js new file mode 100644 index 0000000000000..c6efa14082933 --- /dev/null +++ b/tests/baselines/reference/restParamsWithNonRestParams.js @@ -0,0 +1,30 @@ +//// [restParamsWithNonRestParams.ts] +function foo(...b:number[]){} +foo(); // ok +function foo2(a:string, ...b:number[]){} +foo2(); // should be an error +function foo3(a?:string, ...b:number[]){} +foo3(); // error but shouldn't be + +//// [restParamsWithNonRestParams.js] +function foo() { + var b = []; + for (var _i = 0; _i < arguments.length; _i++) { + b[_i - 0] = arguments[_i]; + } +} +foo(); +function foo2(a) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } +} +foo2(); +function foo3(a) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } +} +foo3(); diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt new file mode 100644 index 0000000000000..6973bacecc063 --- /dev/null +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -0,0 +1,75 @@ +==== tests/cases/compiler/returnInConstructor1.ts (4 errors) ==== + class A { + foo() { } + constructor() { + return; + } + } + + class B { + foo() { } + constructor() { + return 1; // error + ~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class C { + foo() { } + constructor() { + return this; + } + } + + class D { + foo() { } + constructor() { + return "test"; // error + ~~~~~~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class E { + public foo: number; + constructor() { + return { foo: 1 }; + } + } + + class F { + public foo: string; + constructor() { + return { foo: 1 }; //error + ~~~~~~~~~~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class G { + private test: number; + public test1() { } + foo() { } + constructor() { + this.test = 2; + } + } + + class H extends F { + constructor() { + super(); + return new G(); //error + ~~~~~~~ +!!! Return type of constructor signature must be assignable to the instance type of the class + } + } + + class I extends G { + constructor() { + super(); + return new G(); + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js new file mode 100644 index 0000000000000..60ed4605fa2ef --- /dev/null +++ b/tests/baselines/reference/returnInConstructor1.js @@ -0,0 +1,145 @@ +//// [returnInConstructor1.ts] +class A { + foo() { } + constructor() { + return; + } +} + +class B { + foo() { } + constructor() { + return 1; // error + } +} + +class C { + foo() { } + constructor() { + return this; + } +} + +class D { + foo() { } + constructor() { + return "test"; // error + } +} + +class E { + public foo: number; + constructor() { + return { foo: 1 }; + } +} + +class F { + public foo: string; + constructor() { + return { foo: 1 }; //error + } +} + +class G { + private test: number; + public test1() { } + foo() { } + constructor() { + this.test = 2; + } +} + +class H extends F { + constructor() { + super(); + return new G(); //error + } +} + +class I extends G { + constructor() { + super(); + return new G(); + } +} + + + +//// [returnInConstructor1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + return; + } + A.prototype.foo = function () { + }; + return A; +})(); +var B = (function () { + function B() { + return 1; + } + B.prototype.foo = function () { + }; + return B; +})(); +var C = (function () { + function C() { + return this; + } + C.prototype.foo = function () { + }; + return C; +})(); +var D = (function () { + function D() { + return "test"; + } + D.prototype.foo = function () { + }; + return D; +})(); +var E = (function () { + function E() { + return { foo: 1 }; + } + return E; +})(); +var F = (function () { + function F() { + return { foo: 1 }; + } + return F; +})(); +var G = (function () { + function G() { + this.test = 2; + } + G.prototype.test1 = function () { + }; + G.prototype.foo = function () { + }; + return G; +})(); +var H = (function (_super) { + __extends(H, _super); + function H() { + _super.call(this); + return new G(); + } + return H; +})(F); +var I = (function (_super) { + __extends(I, _super); + function I() { + _super.call(this); + return new G(); + } + return I; +})(G); diff --git a/tests/baselines/reference/returnStatement1.js b/tests/baselines/reference/returnStatement1.js new file mode 100644 index 0000000000000..c4ccc3caddec2 --- /dev/null +++ b/tests/baselines/reference/returnStatement1.js @@ -0,0 +1,15 @@ +//// [returnStatement1.ts] +function f() { + return function (s) { + var x = s; + }; + ("harmless extra line"); +} + +//// [returnStatement1.js] +function f() { + return function (s) { + var x = s; + }; + ("harmless extra line"); +} diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js new file mode 100644 index 0000000000000..64665e46066b0 --- /dev/null +++ b/tests/baselines/reference/returnStatements.js @@ -0,0 +1,83 @@ +//// [returnStatements.ts] +// all the following should be valid +function fn1(): number { return 1; } +function fn2(): string { return ''; } +function fn3(): void { return undefined; } +function fn4(): void { return; } +function fn5(): boolean { return true; } +function fn6(): Date { return new Date(12); } +function fn7(): any { return null; } +function fn8(): any { return; } // OK, eq. to 'return undefined' + +interface I { id: number } +class C implements I { + id: number; + dispose() {} +} +class D extends C { + name: string; +} +function fn10(): I { return { id: 12 }; } + +function fn11(): I { return new C(); } +function fn12(): C { return new D(); } +function fn13(): C { return null; } + + +//// [returnStatements.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function fn1() { + return 1; +} +function fn2() { + return ''; +} +function fn3() { + return undefined; +} +function fn4() { + return; +} +function fn5() { + return true; +} +function fn6() { + return new Date(12); +} +function fn7() { + return null; +} +function fn8() { + return; +} +var C = (function () { + function C() { + } + C.prototype.dispose = function () { + }; + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + return D; +})(C); +function fn10() { + return { id: 12 }; +} +function fn11() { + return new C(); +} +function fn12() { + return new D(); +} +function fn13() { + return null; +} diff --git a/tests/baselines/reference/returnTypeParameter.errors.txt b/tests/baselines/reference/returnTypeParameter.errors.txt new file mode 100644 index 0000000000000..1490825c77a6c --- /dev/null +++ b/tests/baselines/reference/returnTypeParameter.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/returnTypeParameter.ts (1 errors) ==== + function f(a: T): T { } // error, no return statement + function f2(a: T): T { return T; } // bug was that this satisfied the return statement requirement + ~ +!!! Cannot find name 'T'. \ No newline at end of file diff --git a/tests/baselines/reference/returnTypeParameter.js b/tests/baselines/reference/returnTypeParameter.js new file mode 100644 index 0000000000000..21df0144a856c --- /dev/null +++ b/tests/baselines/reference/returnTypeParameter.js @@ -0,0 +1,10 @@ +//// [returnTypeParameter.ts] +function f(a: T): T { } // error, no return statement +function f2(a: T): T { return T; } // bug was that this satisfied the return statement requirement + +//// [returnTypeParameter.js] +function f(a) { +} +function f2(a) { + return T; +} diff --git a/tests/baselines/reference/returnTypeParameterWithModules.js b/tests/baselines/reference/returnTypeParameterWithModules.js new file mode 100644 index 0000000000000..2894774de013c --- /dev/null +++ b/tests/baselines/reference/returnTypeParameterWithModules.js @@ -0,0 +1,43 @@ +//// [returnTypeParameterWithModules.ts] +module M1 { + export function reduce(ar, f, e?): Array { + return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); + }; +}; +module M2 { + import A = M1 + export function compose() { + A.reduce(arguments, compose2); + }; + export function compose2(g: (x: B) => C, f: (x: D) => B): (x: D) => C { + return function (x) { return g(f(x)); } + }; +}; + +//// [returnTypeParameterWithModules.js] +var M1; +(function (M1) { + function reduce(ar, f, e) { + return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); + } + M1.reduce = reduce; + ; +})(M1 || (M1 = {})); +; +var M2; +(function (M2) { + var A = M1; + function compose() { + A.reduce(arguments, compose2); + } + M2.compose = compose; + ; + function compose2(g, f) { + return function (x) { + return g(f(x)); + }; + } + M2.compose2 = compose2; + ; +})(M2 || (M2 = {})); +; diff --git a/tests/baselines/reference/returnTypeTypeArguments.errors.txt b/tests/baselines/reference/returnTypeTypeArguments.errors.txt new file mode 100644 index 0000000000000..b9d5aa77af09e --- /dev/null +++ b/tests/baselines/reference/returnTypeTypeArguments.errors.txt @@ -0,0 +1,151 @@ +==== tests/cases/compiler/returnTypeTypeArguments.ts (37 errors) ==== + class One{ + value: T; + } + class Two{ + value: T; + id: U; + } + class Three{ + value: T; + id: U; + name: V; + } + + function A1(): One { return null; } + ~~~ +!!! Generic type 'One' requires 1 type argument(s). + function A2(): Two { return null; } + ~~~ +!!! Generic type 'Two' requires 2 type argument(s). + function A3(): Three { return null; } + ~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + + function B1(): Two { return null; } + ~~~~~~~~~~~ +!!! Generic type 'Two' requires 2 type argument(s). + function B2(): Three { return null; } + ~~~~~~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + function B3(): Three { return null; } + ~~~~~~~~~~~~~~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + + class C { + A1(): One { return null; } + ~~~ +!!! Generic type 'One' requires 1 type argument(s). + A2(): Two { return null; } + ~~~ +!!! Generic type 'Two' requires 2 type argument(s). + A3(): Three { return null; } + ~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + + B1(): Two { return null; } + ~~~~~~~~~~~ +!!! Generic type 'Two' requires 2 type argument(s). + B2(): Three { return null; } + ~~~~~~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + B3(): Three { return null; } + ~~~~~~~~~~~~~~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + } + + class D { + A2(): Two { return null; } + ~~~~~~ +!!! Generic type 'Two' requires 2 type argument(s). + A3(): Three { return null; } + ~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + + B1(): Two { return null; } + ~~~~~~ +!!! Generic type 'Two' requires 2 type argument(s). + B2(): Three { return null; } + ~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + B3(): Three { return null; } + ~~~~~~~~~~~~~~~~ +!!! Generic type 'Three' requires 3 type argument(s). + } + + interface I { + value: T; + } + + class Y + { + value: T; + } + + class X + { + p1: () => X; + ~ +!!! Generic type 'X' requires 1 type argument(s). + p2: { [idx: number]: X } + ~ +!!! Generic type 'X' requires 1 type argument(s). + p3: X[] + ~ +!!! Generic type 'X' requires 1 type argument(s). + p4: I + ~ +!!! Generic type 'X' requires 1 type argument(s). + p5: X + ~ +!!! Generic type 'X' requires 1 type argument(s). + p6: () => Y; + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p7: { [idx: number]: Y } + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p8: Y[] + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p9: I + ~ +!!! Generic type 'Y' requires 1 type argument(s). + pa: Y + ~ +!!! Generic type 'Y' requires 1 type argument(s). + } + + declare var a: { + p1: () => X; + ~ +!!! Generic type 'X' requires 1 type argument(s). + p2: { [idx: number]: X } + ~ +!!! Generic type 'X' requires 1 type argument(s). + p3: X[] + ~ +!!! Generic type 'X' requires 1 type argument(s). + p4: I + ~ +!!! Generic type 'X' requires 1 type argument(s). + p5: X + ~ +!!! Generic type 'X' requires 1 type argument(s). + p6: () => Y; + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p7: { [idx: number]: Y } + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p8: Y[] + ~ +!!! Generic type 'Y' requires 1 type argument(s). + p9: I + ~ +!!! Generic type 'Y' requires 1 type argument(s). + pa: Y + ~ +!!! Generic type 'Y' requires 1 type argument(s). + }; + \ No newline at end of file diff --git a/tests/baselines/reference/returnTypeTypeArguments.js b/tests/baselines/reference/returnTypeTypeArguments.js new file mode 100644 index 0000000000000..5be549d2f341b --- /dev/null +++ b/tests/baselines/reference/returnTypeTypeArguments.js @@ -0,0 +1,165 @@ +//// [returnTypeTypeArguments.ts] +class One{ + value: T; +} +class Two{ + value: T; + id: U; +} +class Three{ + value: T; + id: U; + name: V; +} + +function A1(): One { return null; } +function A2(): Two { return null; } +function A3(): Three { return null; } + +function B1(): Two { return null; } +function B2(): Three { return null; } +function B3(): Three { return null; } + +class C { + A1(): One { return null; } + A2(): Two { return null; } + A3(): Three { return null; } + + B1(): Two { return null; } + B2(): Three { return null; } + B3(): Three { return null; } +} + +class D { + A2(): Two { return null; } + A3(): Three { return null; } + + B1(): Two { return null; } + B2(): Three { return null; } + B3(): Three { return null; } +} + +interface I { + value: T; +} + +class Y +{ + value: T; +} + +class X +{ + p1: () => X; + p2: { [idx: number]: X } + p3: X[] + p4: I + p5: X + p6: () => Y; + p7: { [idx: number]: Y } + p8: Y[] + p9: I + pa: Y +} + +declare var a: { + p1: () => X; + p2: { [idx: number]: X } + p3: X[] + p4: I + p5: X + p6: () => Y; + p7: { [idx: number]: Y } + p8: Y[] + p9: I + pa: Y +}; + + +//// [returnTypeTypeArguments.js] +var One = (function () { + function One() { + } + return One; +})(); +var Two = (function () { + function Two() { + } + return Two; +})(); +var Three = (function () { + function Three() { + } + return Three; +})(); +function A1() { + return null; +} +function A2() { + return null; +} +function A3() { + return null; +} +function B1() { + return null; +} +function B2() { + return null; +} +function B3() { + return null; +} +var C = (function () { + function C() { + } + C.prototype.A1 = function () { + return null; + }; + C.prototype.A2 = function () { + return null; + }; + C.prototype.A3 = function () { + return null; + }; + C.prototype.B1 = function () { + return null; + }; + C.prototype.B2 = function () { + return null; + }; + C.prototype.B3 = function () { + return null; + }; + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.A2 = function () { + return null; + }; + D.prototype.A3 = function () { + return null; + }; + D.prototype.B1 = function () { + return null; + }; + D.prototype.B2 = function () { + return null; + }; + D.prototype.B3 = function () { + return null; + }; + return D; +})(); +var Y = (function () { + function Y() { + } + return Y; +})(); +var X = (function () { + function X() { + } + return X; +})(); diff --git a/tests/baselines/reference/returnValueInSetter.errors.txt b/tests/baselines/reference/returnValueInSetter.errors.txt new file mode 100644 index 0000000000000..d28f1d8d6298e --- /dev/null +++ b/tests/baselines/reference/returnValueInSetter.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/returnValueInSetter.ts (2 errors) ==== + class f { + set x(value) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return null; // Should be an error + ~~~~ +!!! Setters cannot return a value. + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/reuseInnerModuleMember.js b/tests/baselines/reference/reuseInnerModuleMember.js new file mode 100644 index 0000000000000..12d0aaf14caf8 --- /dev/null +++ b/tests/baselines/reference/reuseInnerModuleMember.js @@ -0,0 +1,23 @@ +//// [tests/cases/compiler/reuseInnerModuleMember.ts] //// + +//// [reuseInnerModuleMember_0.ts] +export module M { } + +//// [reuseInnerModuleMember_1.ts] +/// +declare module bar { + interface alpha { } +} + +import f = require('reuseInnerModuleMember_0'); +module bar { + var x: alpha; +} + + +//// [reuseInnerModuleMember_0.js] +//// [reuseInnerModuleMember_1.js] +var bar; +(function (bar) { + var x; +})(bar || (bar = {})); diff --git a/tests/baselines/reference/reverseInferenceInContextualInstantiation.js b/tests/baselines/reference/reverseInferenceInContextualInstantiation.js new file mode 100644 index 0000000000000..5e3856b242919 --- /dev/null +++ b/tests/baselines/reference/reverseInferenceInContextualInstantiation.js @@ -0,0 +1,12 @@ +//// [reverseInferenceInContextualInstantiation.ts] +function compare(a: T, b: T): number { return 0; } +var x: number[]; +x.sort(compare); // Error, but shouldn't be + + +//// [reverseInferenceInContextualInstantiation.js] +function compare(a, b) { + return 0; +} +var x; +x.sort(compare); diff --git a/tests/baselines/reference/reversedRecusiveTypeInstantiation.js b/tests/baselines/reference/reversedRecusiveTypeInstantiation.js new file mode 100644 index 0000000000000..c499238b92102 --- /dev/null +++ b/tests/baselines/reference/reversedRecusiveTypeInstantiation.js @@ -0,0 +1,15 @@ +//// [reversedRecusiveTypeInstantiation.ts] +interface A { + xPos1 : StringArgPos1 + yPos2 : NumberArgPos2 + zPos2Pos1 : A +} + +var a : A +a.zPos2Pos1.xPos1 = 1 + + + +//// [reversedRecusiveTypeInstantiation.js] +var a; +a.zPos2Pos1.xPos1 = 1; diff --git a/tests/baselines/reference/scanner10.1.1-8gs.errors.txt b/tests/baselines/reference/scanner10.1.1-8gs.errors.txt new file mode 100644 index 0000000000000..53fb3724e149e --- /dev/null +++ b/tests/baselines/reference/scanner10.1.1-8gs.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/scanner/ecmascript5/scanner10.1.1-8gs.ts (1 errors) ==== + /// Copyright (c) 2012 Ecma International. All rights reserved. + /// Ecma International makes this code available under the terms and conditions set + /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the + /// "Use Terms"). Any redistribution of this code must retain the above + /// copyright and this notice and otherwise comply with the Use Terms. + + /** + * @path ch10/10.1/10.1.1/10.1.1-8gs.js + * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code + * @noStrict + * @negative ^((?!NotEarlyError).)*$ + */ + + "use strict"; + "use strict"; + throw NotEarlyError; + ~~~~~~~~~~~~~ +!!! Cannot find name 'NotEarlyError'. + var public = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/scanner10.1.1-8gs.js b/tests/baselines/reference/scanner10.1.1-8gs.js new file mode 100644 index 0000000000000..85dada5e79309 --- /dev/null +++ b/tests/baselines/reference/scanner10.1.1-8gs.js @@ -0,0 +1,25 @@ +//// [scanner10.1.1-8gs.ts] +/// Copyright (c) 2012 Ecma International. All rights reserved. +/// Ecma International makes this code available under the terms and conditions set +/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +/// "Use Terms"). Any redistribution of this code must retain the above +/// copyright and this notice and otherwise comply with the Use Terms. + +/** + * @path ch10/10.1/10.1.1/10.1.1-8gs.js + * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code + * @noStrict + * @negative ^((?!NotEarlyError).)*$ + */ + +"use strict"; +"use strict"; +throw NotEarlyError; +var public = 1; + + +//// [scanner10.1.1-8gs.js] +"use strict"; +"use strict"; +throw NotEarlyError; +var public = 1; diff --git a/tests/baselines/reference/scannerAdditiveExpression1.errors.txt b/tests/baselines/reference/scannerAdditiveExpression1.errors.txt new file mode 100644 index 0000000000000..33794019cb7f8 --- /dev/null +++ b/tests/baselines/reference/scannerAdditiveExpression1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerAdditiveExpression1.ts (2 errors) ==== + m.index+1+m[0].length; + ~ +!!! Cannot find name 'm'. + ~ +!!! Cannot find name 'm'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerAdditiveExpression1.js b/tests/baselines/reference/scannerAdditiveExpression1.js new file mode 100644 index 0000000000000..cf0a8abd2292c --- /dev/null +++ b/tests/baselines/reference/scannerAdditiveExpression1.js @@ -0,0 +1,5 @@ +//// [scannerAdditiveExpression1.ts] +m.index+1+m[0].length; + +//// [scannerAdditiveExpression1.js] +m.index + 1 + m[0].length; diff --git a/tests/baselines/reference/scannerClass2.errors.txt b/tests/baselines/reference/scannerClass2.errors.txt new file mode 100644 index 0000000000000..f2721e764529f --- /dev/null +++ b/tests/baselines/reference/scannerClass2.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerClass2.ts (4 errors) ==== + + + export class LoggerAdapter implements ILogger { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ +!!! Cannot find name 'ILogger'. + constructor (public logger: ILogger) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ +!!! Cannot find name 'ILogger'. + this._information = this.logger.information(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! Property '_information' does not exist on type 'LoggerAdapter'. + } + ~~~~~~~~~ + } + ~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/scannerClass2.js b/tests/baselines/reference/scannerClass2.js new file mode 100644 index 0000000000000..88dd9919f9c40 --- /dev/null +++ b/tests/baselines/reference/scannerClass2.js @@ -0,0 +1,18 @@ +//// [scannerClass2.ts] + + + export class LoggerAdapter implements ILogger { + constructor (public logger: ILogger) { + this._information = this.logger.information(); + } + } + +//// [scannerClass2.js] +var LoggerAdapter = (function () { + function LoggerAdapter(logger) { + this.logger = logger; + this._information = this.logger.information(); + } + return LoggerAdapter; +})(); +exports.LoggerAdapter = LoggerAdapter; diff --git a/tests/baselines/reference/scannerES3NumericLiteral1.js b/tests/baselines/reference/scannerES3NumericLiteral1.js new file mode 100644 index 0000000000000..62ba5663fc440 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral1.js @@ -0,0 +1,5 @@ +//// [scannerES3NumericLiteral1.ts] +0 + +//// [scannerES3NumericLiteral1.js] +0; diff --git a/tests/baselines/reference/scannerES3NumericLiteral2.js b/tests/baselines/reference/scannerES3NumericLiteral2.js new file mode 100644 index 0000000000000..ddb237e30062c --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral2.js @@ -0,0 +1,5 @@ +//// [scannerES3NumericLiteral2.ts] +01 + +//// [scannerES3NumericLiteral2.js] +01; diff --git a/tests/baselines/reference/scannerES3NumericLiteral3.js b/tests/baselines/reference/scannerES3NumericLiteral3.js new file mode 100644 index 0000000000000..7ecb6c8d37747 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral3.js @@ -0,0 +1,5 @@ +//// [scannerES3NumericLiteral3.ts] +01.0 + +//// [scannerES3NumericLiteral3.js] +01.0; diff --git a/tests/baselines/reference/scannerES3NumericLiteral4.errors.txt b/tests/baselines/reference/scannerES3NumericLiteral4.errors.txt new file mode 100644 index 0000000000000..c053fda21b529 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral4.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral4.ts (1 errors) ==== + 1e + +!!! Digit expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerES3NumericLiteral5.js b/tests/baselines/reference/scannerES3NumericLiteral5.js new file mode 100644 index 0000000000000..3ef35476d8347 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral5.js @@ -0,0 +1,5 @@ +//// [scannerES3NumericLiteral5.ts] +1e0 + +//// [scannerES3NumericLiteral5.js] +1e0; diff --git a/tests/baselines/reference/scannerES3NumericLiteral6.errors.txt b/tests/baselines/reference/scannerES3NumericLiteral6.errors.txt new file mode 100644 index 0000000000000..0229679f24582 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral6.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral6.ts (1 errors) ==== + 1e+ + +!!! Digit expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerES3NumericLiteral7.js b/tests/baselines/reference/scannerES3NumericLiteral7.js new file mode 100644 index 0000000000000..32987d85a8433 --- /dev/null +++ b/tests/baselines/reference/scannerES3NumericLiteral7.js @@ -0,0 +1,5 @@ +//// [scannerES3NumericLiteral7.ts] +1e+0 + +//// [scannerES3NumericLiteral7.js] +1e+0; diff --git a/tests/baselines/reference/scannerEnum1.errors.txt b/tests/baselines/reference/scannerEnum1.errors.txt new file mode 100644 index 0000000000000..f513332f5f83f --- /dev/null +++ b/tests/baselines/reference/scannerEnum1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerEnum1.ts (1 errors) ==== + export enum CodeGenTarget { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ES3 = 0, + ~~~~~~~~~~~~~~~~ + ES5 = 1, + ~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/scannerEnum1.js b/tests/baselines/reference/scannerEnum1.js new file mode 100644 index 0000000000000..b503de2c2b0df --- /dev/null +++ b/tests/baselines/reference/scannerEnum1.js @@ -0,0 +1,12 @@ +//// [scannerEnum1.ts] + export enum CodeGenTarget { + ES3 = 0, + ES5 = 1, + } + +//// [scannerEnum1.js] +(function (CodeGenTarget) { + CodeGenTarget[CodeGenTarget["ES3"] = 0] = "ES3"; + CodeGenTarget[CodeGenTarget["ES5"] = 1] = "ES5"; +})(exports.CodeGenTarget || (exports.CodeGenTarget = {})); +var CodeGenTarget = exports.CodeGenTarget; diff --git a/tests/baselines/reference/scannerImportDeclaration1.errors.txt b/tests/baselines/reference/scannerImportDeclaration1.errors.txt new file mode 100644 index 0000000000000..4172ea53bdb8a --- /dev/null +++ b/tests/baselines/reference/scannerImportDeclaration1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerImportDeclaration1.ts (1 errors) ==== + import TypeScript = TypeScriptServices.TypeScript; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'TypeScriptServices'. \ No newline at end of file diff --git a/tests/baselines/reference/scannerImportDeclaration1.js b/tests/baselines/reference/scannerImportDeclaration1.js new file mode 100644 index 0000000000000..87f33f9d2c6c4 --- /dev/null +++ b/tests/baselines/reference/scannerImportDeclaration1.js @@ -0,0 +1,4 @@ +//// [scannerImportDeclaration1.ts] +import TypeScript = TypeScriptServices.TypeScript; + +//// [scannerImportDeclaration1.js] diff --git a/tests/baselines/reference/scannerNumericLiteral1.js b/tests/baselines/reference/scannerNumericLiteral1.js new file mode 100644 index 0000000000000..946259583eff3 --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral1.js @@ -0,0 +1,5 @@ +//// [scannerNumericLiteral1.ts] +0 + +//// [scannerNumericLiteral1.js] +0; diff --git a/tests/baselines/reference/scannerNumericLiteral2.js b/tests/baselines/reference/scannerNumericLiteral2.js new file mode 100644 index 0000000000000..382f1e6e4dffd --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral2.js @@ -0,0 +1,5 @@ +//// [scannerNumericLiteral2.ts] +01 + +//// [scannerNumericLiteral2.js] +01; diff --git a/tests/baselines/reference/scannerNumericLiteral3.js b/tests/baselines/reference/scannerNumericLiteral3.js new file mode 100644 index 0000000000000..382c0622ac22f --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral3.js @@ -0,0 +1,5 @@ +//// [scannerNumericLiteral3.ts] +01.0 + +//// [scannerNumericLiteral3.js] +01.0; diff --git a/tests/baselines/reference/scannerNumericLiteral4.errors.txt b/tests/baselines/reference/scannerNumericLiteral4.errors.txt new file mode 100644 index 0000000000000..cbcd5b93c5739 --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral4.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral4.ts (1 errors) ==== + 1e + +!!! Digit expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral5.js b/tests/baselines/reference/scannerNumericLiteral5.js new file mode 100644 index 0000000000000..7f36480e429d2 --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral5.js @@ -0,0 +1,5 @@ +//// [scannerNumericLiteral5.ts] +1e0 + +//// [scannerNumericLiteral5.js] +1e0; diff --git a/tests/baselines/reference/scannerNumericLiteral6.errors.txt b/tests/baselines/reference/scannerNumericLiteral6.errors.txt new file mode 100644 index 0000000000000..237fd9c2c140e --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral6.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral6.ts (1 errors) ==== + 1e+ + +!!! Digit expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral7.js b/tests/baselines/reference/scannerNumericLiteral7.js new file mode 100644 index 0000000000000..3021f8c6867c3 --- /dev/null +++ b/tests/baselines/reference/scannerNumericLiteral7.js @@ -0,0 +1,5 @@ +//// [scannerNumericLiteral7.ts] +1e+0 + +//// [scannerNumericLiteral7.js] +1e+0; diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt new file mode 100644 index 0000000000000..75967db8b6bdb --- /dev/null +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt @@ -0,0 +1,29 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts (2 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * NO-BREAK SPACE (U+00A0) between any two tokens is allowed + * + * @path ch07/7.2/S7.2_A1.5_T2.js + * @description Insert real NO-BREAK SPACE between tokens of var x=1 + */ + + //CHECK#1 + eval("\u00A0var x\u00A0= 1\u00A0"); + if (x !== 1) { + $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + + //CHECK#2 +  var x = 1 ; + if (x !== 1) { + $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.js b/tests/baselines/reference/scannerS7.2_A1.5_T2.js new file mode 100644 index 0000000000000..17b9ba93b1bc4 --- /dev/null +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.js @@ -0,0 +1,35 @@ +//// [scannerS7.2_A1.5_T2.ts] +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * NO-BREAK SPACE (U+00A0) between any two tokens is allowed + * + * @path ch07/7.2/S7.2_A1.5_T2.js + * @description Insert real NO-BREAK SPACE between tokens of var x=1 + */ + +//CHECK#1 +eval("\u00A0var x\u00A0= 1\u00A0"); +if (x !== 1) { + $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); +} + +//CHECK#2 + var x = 1 ; +if (x !== 1) { + $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); +} + + + + +//// [scannerS7.2_A1.5_T2.js] +eval("\u00A0var x\u00A0= 1\u00A0"); +if (x !== 1) { + $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); +} +var x = 1; +if (x !== 1) { + $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); +} diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt new file mode 100644 index 0000000000000..7dcb3df35644d --- /dev/null +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts (1 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * LINE FEED (U+000A) may occur between any two tokens + * + * @path ch07/7.3/S7.3_A1.1_T2.js + * @description Insert real LINE FEED between tokens of var x=1 + */ + + //CHECK#1 + var + x + = + 1; + if (x !== 1) { + $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.js b/tests/baselines/reference/scannerS7.3_A1.1_T2.js new file mode 100644 index 0000000000000..4cd94ccb32ca4 --- /dev/null +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.js @@ -0,0 +1,27 @@ +//// [scannerS7.3_A1.1_T2.ts] +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * LINE FEED (U+000A) may occur between any two tokens + * + * @path ch07/7.3/S7.3_A1.1_T2.js + * @description Insert real LINE FEED between tokens of var x=1 + */ + +//CHECK#1 +var +x += +1; +if (x !== 1) { + $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); +} + + + +//// [scannerS7.3_A1.1_T2.js] +var x = 1; +if (x !== 1) { + $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); +} diff --git a/tests/baselines/reference/scannerS7.4_A2_T2.js b/tests/baselines/reference/scannerS7.4_A2_T2.js new file mode 100644 index 0000000000000..ae5acbaece4a1 --- /dev/null +++ b/tests/baselines/reference/scannerS7.4_A2_T2.js @@ -0,0 +1,17 @@ +//// [scannerS7.4_A2_T2.ts] +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Correct interpretation of multi line comments + * + * @path ch07/7.4/S7.4_A2_T2.js + * @description Try use /*CHECK#1/. This is not closed multi line comment + * @negative + */ + +/*CHECK#1/ + + + +//// [scannerS7.4_A2_T2.js] diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt new file mode 100644 index 0000000000000..e679f1ec0ced4 --- /dev/null +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt @@ -0,0 +1,212 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts (33 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * Correct interpretation of RUSSIAN ALPHABET + * + * @path ch07/7.6/S7.6_A4.2_T1.js + * @description Check RUSSIAN CAPITAL ALPHABET + */ + + //CHECK#А-Я + var \u0410 = 1; + if (А !== 1) { + $ERROR('#А'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0411 = 1; + if (Б !== 1) { + $ERROR('#Б'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0412 = 1; + if (В !== 1) { + $ERROR('#В'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0413 = 1; + if (Г !== 1) { + $ERROR('#Г'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0414 = 1; + if (Д !== 1) { + $ERROR('#Д'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0415 = 1; + if (Е !== 1) { + $ERROR('#Е'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0416 = 1; + if (Ж !== 1) { + $ERROR('#Ж'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0417 = 1; + if (З !== 1) { + $ERROR('#З'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0418 = 1; + if (И !== 1) { + $ERROR('#И'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0419 = 1; + if (Й !== 1) { + $ERROR('#Й'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041A = 1; + if (К !== 1) { + $ERROR('#К'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041B = 1; + if (Л !== 1) { + $ERROR('#Л'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041C = 1; + if (М !== 1) { + $ERROR('#М'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041D = 1; + if (Н !== 1) { + $ERROR('#Н'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041E = 1; + if (О !== 1) { + $ERROR('#О'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u041F = 1; + if (П !== 1) { + $ERROR('#П'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0420 = 1; + if (Р !== 1) { + $ERROR('#Р'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0421 = 1; + if (С !== 1) { + $ERROR('#С'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0422 = 1; + if (Т !== 1) { + $ERROR('#Т'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0423 = 1; + if (У !== 1) { + $ERROR('#У'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0424 = 1; + if (Ф !== 1) { + $ERROR('#Ф'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0425 = 1; + if (Х !== 1) { + $ERROR('#Х'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0426 = 1; + if (Ц !== 1) { + $ERROR('#Ц'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0427 = 1; + if (Ч !== 1) { + $ERROR('#Ч'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0428 = 1; + if (Ш !== 1) { + $ERROR('#Ш'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0429 = 1; + if (Щ !== 1) { + $ERROR('#Щ'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042A = 1; + if (Ъ !== 1) { + $ERROR('#Ъ'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042B = 1; + if (Ы !== 1) { + $ERROR('#Ы'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042C = 1; + if (Ь !== 1) { + $ERROR('#Ь'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042D = 1; + if (Э !== 1) { + $ERROR('#Э'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042E = 1; + if (Ю !== 1) { + $ERROR('#Ю'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u042F = 1; + if (Я !== 1) { + $ERROR('#Я'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + var \u0401 = 1; + if (Ё !== 1) { + $ERROR('#Ё'); + ~~~~~~ +!!! Cannot find name '$ERROR'. + } + + \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.js b/tests/baselines/reference/scannerS7.6_A4.2_T1.js new file mode 100644 index 0000000000000..7890b709dcc70 --- /dev/null +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.js @@ -0,0 +1,280 @@ +//// [scannerS7.6_A4.2_T1.ts] +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Correct interpretation of RUSSIAN ALPHABET + * + * @path ch07/7.6/S7.6_A4.2_T1.js + * @description Check RUSSIAN CAPITAL ALPHABET + */ + +//CHECK#А-Я +var \u0410 = 1; +if (А !== 1) { + $ERROR('#А'); +} +var \u0411 = 1; +if (Б !== 1) { + $ERROR('#Б'); +} +var \u0412 = 1; +if (В !== 1) { + $ERROR('#В'); +} +var \u0413 = 1; +if (Г !== 1) { + $ERROR('#Г'); +} +var \u0414 = 1; +if (Д !== 1) { + $ERROR('#Д'); +} +var \u0415 = 1; +if (Е !== 1) { + $ERROR('#Е'); +} +var \u0416 = 1; +if (Ж !== 1) { + $ERROR('#Ж'); +} +var \u0417 = 1; +if (З !== 1) { + $ERROR('#З'); +} +var \u0418 = 1; +if (И !== 1) { + $ERROR('#И'); +} +var \u0419 = 1; +if (Й !== 1) { + $ERROR('#Й'); +} +var \u041A = 1; +if (К !== 1) { + $ERROR('#К'); +} +var \u041B = 1; +if (Л !== 1) { + $ERROR('#Л'); +} +var \u041C = 1; +if (М !== 1) { + $ERROR('#М'); +} +var \u041D = 1; +if (Н !== 1) { + $ERROR('#Н'); +} +var \u041E = 1; +if (О !== 1) { + $ERROR('#О'); +} +var \u041F = 1; +if (П !== 1) { + $ERROR('#П'); +} +var \u0420 = 1; +if (Р !== 1) { + $ERROR('#Р'); +} +var \u0421 = 1; +if (С !== 1) { + $ERROR('#С'); +} +var \u0422 = 1; +if (Т !== 1) { + $ERROR('#Т'); +} +var \u0423 = 1; +if (У !== 1) { + $ERROR('#У'); +} +var \u0424 = 1; +if (Ф !== 1) { + $ERROR('#Ф'); +} +var \u0425 = 1; +if (Х !== 1) { + $ERROR('#Х'); +} +var \u0426 = 1; +if (Ц !== 1) { + $ERROR('#Ц'); +} +var \u0427 = 1; +if (Ч !== 1) { + $ERROR('#Ч'); +} +var \u0428 = 1; +if (Ш !== 1) { + $ERROR('#Ш'); +} +var \u0429 = 1; +if (Щ !== 1) { + $ERROR('#Щ'); +} +var \u042A = 1; +if (Ъ !== 1) { + $ERROR('#Ъ'); +} +var \u042B = 1; +if (Ы !== 1) { + $ERROR('#Ы'); +} +var \u042C = 1; +if (Ь !== 1) { + $ERROR('#Ь'); +} +var \u042D = 1; +if (Э !== 1) { + $ERROR('#Э'); +} +var \u042E = 1; +if (Ю !== 1) { + $ERROR('#Ю'); +} +var \u042F = 1; +if (Я !== 1) { + $ERROR('#Я'); +} +var \u0401 = 1; +if (Ё !== 1) { + $ERROR('#Ё'); +} + + + +//// [scannerS7.6_A4.2_T1.js] +var \u0410 = 1; +if (А !== 1) { + $ERROR('#А'); +} +var \u0411 = 1; +if (Б !== 1) { + $ERROR('#Б'); +} +var \u0412 = 1; +if (В !== 1) { + $ERROR('#В'); +} +var \u0413 = 1; +if (Г !== 1) { + $ERROR('#Г'); +} +var \u0414 = 1; +if (Д !== 1) { + $ERROR('#Д'); +} +var \u0415 = 1; +if (Е !== 1) { + $ERROR('#Е'); +} +var \u0416 = 1; +if (Ж !== 1) { + $ERROR('#Ж'); +} +var \u0417 = 1; +if (З !== 1) { + $ERROR('#З'); +} +var \u0418 = 1; +if (И !== 1) { + $ERROR('#И'); +} +var \u0419 = 1; +if (Й !== 1) { + $ERROR('#Й'); +} +var \u041A = 1; +if (К !== 1) { + $ERROR('#К'); +} +var \u041B = 1; +if (Л !== 1) { + $ERROR('#Л'); +} +var \u041C = 1; +if (М !== 1) { + $ERROR('#М'); +} +var \u041D = 1; +if (Н !== 1) { + $ERROR('#Н'); +} +var \u041E = 1; +if (О !== 1) { + $ERROR('#О'); +} +var \u041F = 1; +if (П !== 1) { + $ERROR('#П'); +} +var \u0420 = 1; +if (Р !== 1) { + $ERROR('#Р'); +} +var \u0421 = 1; +if (С !== 1) { + $ERROR('#С'); +} +var \u0422 = 1; +if (Т !== 1) { + $ERROR('#Т'); +} +var \u0423 = 1; +if (У !== 1) { + $ERROR('#У'); +} +var \u0424 = 1; +if (Ф !== 1) { + $ERROR('#Ф'); +} +var \u0425 = 1; +if (Х !== 1) { + $ERROR('#Х'); +} +var \u0426 = 1; +if (Ц !== 1) { + $ERROR('#Ц'); +} +var \u0427 = 1; +if (Ч !== 1) { + $ERROR('#Ч'); +} +var \u0428 = 1; +if (Ш !== 1) { + $ERROR('#Ш'); +} +var \u0429 = 1; +if (Щ !== 1) { + $ERROR('#Щ'); +} +var \u042A = 1; +if (Ъ !== 1) { + $ERROR('#Ъ'); +} +var \u042B = 1; +if (Ы !== 1) { + $ERROR('#Ы'); +} +var \u042C = 1; +if (Ь !== 1) { + $ERROR('#Ь'); +} +var \u042D = 1; +if (Э !== 1) { + $ERROR('#Э'); +} +var \u042E = 1; +if (Ю !== 1) { + $ERROR('#Ю'); +} +var \u042F = 1; +if (Я !== 1) { + $ERROR('#Я'); +} +var \u0401 = 1; +if (Ё !== 1) { + $ERROR('#Ё'); +} diff --git a/tests/baselines/reference/scannerS7.8.3_A6.1_T1.errors.txt b/tests/baselines/reference/scannerS7.8.3_A6.1_T1.errors.txt new file mode 100644 index 0000000000000..2e4e7c12dcf27 --- /dev/null +++ b/tests/baselines/reference/scannerS7.8.3_A6.1_T1.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerS7.8.3_A6.1_T1.ts (1 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * HexIntegerLiteral :: 0(x/X) is incorrect + * + * @path ch07/7.8/7.8.3/S7.8.3_A6.1_T1.js + * @description Checking if execution of "0x" passes + * @negative + */ + + //CHECK#1 + 0x + +!!! Hexadecimal digit expected. + + \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.8.4_A7.1_T4.errors.txt b/tests/baselines/reference/scannerS7.8.4_A7.1_T4.errors.txt new file mode 100644 index 0000000000000..f1ae2aee34b17 --- /dev/null +++ b/tests/baselines/reference/scannerS7.8.4_A7.1_T4.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerS7.8.4_A7.1_T4.ts (1 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * EscapeSequence :: UnicodeEscapeSequence :: u HexDigit HexDigit HexDigit HexDigit + * + * @path ch07/7.8/7.8.4/S7.8.4_A7.1_T4.js + * @description UnicodeEscapeSequence :: u000G is incorrect + * @negative + */ + + //CHECK# + "\u000G" + +!!! Hexadecimal digit expected. + + \ No newline at end of file diff --git a/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.js b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.js new file mode 100644 index 0000000000000..cd00912067670 Binary files /dev/null and b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.js differ diff --git a/tests/baselines/reference/scannerStringLiterals.errors.txt b/tests/baselines/reference/scannerStringLiterals.errors.txt new file mode 100644 index 0000000000000..d48353f79784d --- /dev/null +++ b/tests/baselines/reference/scannerStringLiterals.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts (2 errors) ==== + "" + " " + "a" + "'" + '"' + "\"" + '\u2192\ ' + "Legal line continuation \ + " + "Should error because of newline. + +!!! Unterminated string constant. + "Should error because of end of file. + +!!! Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/scannerUnexpectedNullCharacter1.errors.txt b/tests/baselines/reference/scannerUnexpectedNullCharacter1.errors.txt new file mode 100644 index 0000000000000..da5abaf55040f Binary files /dev/null and b/tests/baselines/reference/scannerUnexpectedNullCharacter1.errors.txt differ diff --git a/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.js b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.js new file mode 100644 index 0000000000000..2abdfa89c4ef1 --- /dev/null +++ b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.js @@ -0,0 +1,5 @@ +//// [scannerUnicodeEscapeInKeyword1.ts] +\u0076ar x = "hello"; + +//// [scannerUnicodeEscapeInKeyword1.js] +var x = "hello"; diff --git a/tests/baselines/reference/scannertest1.errors.txt b/tests/baselines/reference/scannertest1.errors.txt new file mode 100644 index 0000000000000..24566c2e5ee51 --- /dev/null +++ b/tests/baselines/reference/scannertest1.errors.txt @@ -0,0 +1,57 @@ +==== tests/cases/conformance/scanner/ecmascript5/scannertest1.ts (16 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! File 'References.ts' not found. + + class CharacterInfo { + public static isDecimalDigit(c: number): boolean { + return c >= CharacterCodes._0 && c <= CharacterCodes._9; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + } + + public static isHexDigit(c: number): boolean { + return isDecimalDigit(c) || + ~~~~~~~~~~~~~~ +!!! Cannot find name 'isDecimalDigit'. + (c >= CharacterCodes.A && c <= CharacterCodes.F) || + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + (c >= CharacterCodes.a && c <= CharacterCodes.f); + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + } + + public static hexValue(c: number): number { + Debug.assert(isHexDigit(c)); + ~~~~~ +!!! Cannot find name 'Debug'. + ~~~~~~~~~~ +!!! Cannot find name 'isHexDigit'. + return isDecimalDigit(c) + ~~~~~~~~~~~~~~ +!!! Cannot find name 'isDecimalDigit'. + ? (c - CharacterCodes._0) + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + : (c >= CharacterCodes.A && c <= CharacterCodes.F) + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + ? c - CharacterCodes.A + 10 + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + : c - CharacterCodes.a + 10; + ~~~~~~~~~~~~~~ +!!! Cannot find name 'CharacterCodes'. + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt new file mode 100644 index 0000000000000..01c18641ff7b0 --- /dev/null +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts (2 errors) ==== + class C { private v; public p; static s; } + class D extends C { + public c() { + v = 1; + ~ +!!! Cannot find name 'v'. + this.p = 1; + s = 1; + ~ +!!! Cannot find name 's'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js new file mode 100644 index 0000000000000..23b6f2f7e50cc --- /dev/null +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -0,0 +1,34 @@ +//// [scopeCheckExtendedClassInsidePublicMethod2.ts] +class C { private v; public p; static s; } +class D extends C { + public c() { + v = 1; + this.p = 1; + s = 1; + } +} + +//// [scopeCheckExtendedClassInsidePublicMethod2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.prototype.c = function () { + v = 1; + this.p = 1; + s = 1; + }; + return D; +})(C); diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt new file mode 100644 index 0000000000000..b0529613ad777 --- /dev/null +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts (3 errors) ==== + class C { private v; public p; static s; } + class D extends C { + static c() { + v = 1; + ~ +!!! Cannot find name 'v'. + this.p = 1; + ~ +!!! Property 'p' does not exist on type 'typeof D'. + s = 1; + ~ +!!! Cannot find name 's'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js new file mode 100644 index 0000000000000..7e604118f5240 --- /dev/null +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -0,0 +1,34 @@ +//// [scopeCheckExtendedClassInsideStaticMethod1.ts] +class C { private v; public p; static s; } +class D extends C { + static c() { + v = 1; + this.p = 1; + s = 1; + } +} + +//// [scopeCheckExtendedClassInsideStaticMethod1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.apply(this, arguments); + } + D.c = function () { + v = 1; + this.p = 1; + s = 1; + }; + return D; +})(C); diff --git a/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt b/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt new file mode 100644 index 0000000000000..e5a9e4607f6d3 --- /dev/null +++ b/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/scopeCheckInsidePublicMethod1.ts (1 errors) ==== + class C { + static s; + public a() { + s = 1; // ERR + ~ +!!! Cannot find name 's'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckInsidePublicMethod1.js b/tests/baselines/reference/scopeCheckInsidePublicMethod1.js new file mode 100644 index 0000000000000..1d6bdffe61005 --- /dev/null +++ b/tests/baselines/reference/scopeCheckInsidePublicMethod1.js @@ -0,0 +1,17 @@ +//// [scopeCheckInsidePublicMethod1.ts] +class C { + static s; + public a() { + s = 1; // ERR + } +} + +//// [scopeCheckInsidePublicMethod1.js] +var C = (function () { + function C() { + } + C.prototype.a = function () { + s = 1; + }; + return C; +})(); diff --git a/tests/baselines/reference/scopeCheckInsideStaticMethod1.errors.txt b/tests/baselines/reference/scopeCheckInsideStaticMethod1.errors.txt new file mode 100644 index 0000000000000..729cbac9831ad --- /dev/null +++ b/tests/baselines/reference/scopeCheckInsideStaticMethod1.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/scopeCheckInsideStaticMethod1.ts (2 errors) ==== + class C { + private v; + public p; + static s; + static b() { + v = 1; // ERR + ~ +!!! Cannot find name 'v'. + C.s = 1; + this.p = 1; // ERR + ~ +!!! Property 'p' does not exist on type 'typeof C'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckInsideStaticMethod1.js new file mode 100644 index 0000000000000..26039b42d4534 --- /dev/null +++ b/tests/baselines/reference/scopeCheckInsideStaticMethod1.js @@ -0,0 +1,23 @@ +//// [scopeCheckInsideStaticMethod1.ts] +class C { + private v; + public p; + static s; + static b() { + v = 1; // ERR + C.s = 1; + this.p = 1; // ERR + } +} + +//// [scopeCheckInsideStaticMethod1.js] +var C = (function () { + function C() { + } + C.b = function () { + v = 1; + C.s = 1; + this.p = 1; + }; + return C; +})(); diff --git a/tests/baselines/reference/scopeResolutionIdentifiers.js b/tests/baselines/reference/scopeResolutionIdentifiers.js new file mode 100644 index 0000000000000..d0c91f6cd03e1 --- /dev/null +++ b/tests/baselines/reference/scopeResolutionIdentifiers.js @@ -0,0 +1,78 @@ +//// [scopeResolutionIdentifiers.ts] +// EveryType used in a nested scope of a different EveryType with the same name, type of the identifier is the one defined in the inner scope + +var s: string; +module M1 { + export var s: number; + var n = s; + var n: number; +} + +module M2 { + var s: number; + var n = s; + var n: number; +} + +function fn() { + var s: boolean; + var n = s; + var n: boolean; +} + +class C { + s: Date; + n = this.s; + x() { + var p = this.n; + var p: Date; + } +} + +module M3 { + var s: any; + module M4 { + var n = s; + var n: any; + } +} + + +//// [scopeResolutionIdentifiers.js] +var s; +var M1; +(function (M1) { + M1.s; + var n = M1.s; + var n; +})(M1 || (M1 = {})); +var M2; +(function (M2) { + var s; + var n = s; + var n; +})(M2 || (M2 = {})); +function fn() { + var s; + var n = s; + var n; +} +var C = (function () { + function C() { + this.n = this.s; + } + C.prototype.x = function () { + var p = this.n; + var p; + }; + return C; +})(); +var M3; +(function (M3) { + var s; + var M4; + (function (M4) { + var n = s; + var n; + })(M4 || (M4 = {})); +})(M3 || (M3 = {})); diff --git a/tests/baselines/reference/scopeTests.errors.txt b/tests/baselines/reference/scopeTests.errors.txt new file mode 100644 index 0000000000000..5c2d07247a3ce --- /dev/null +++ b/tests/baselines/reference/scopeTests.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/scopeTests.ts (1 errors) ==== + class C { private v; public p; static s; } + class D extends C { + ~ +!!! Class 'D' incorrectly extends base class 'C': +!!! Private property 'v' cannot be reimplemented. + public v: number; + public p: number + constructor() { + super() + this.v = 1; + this.p = 1; + C.s = 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js new file mode 100644 index 0000000000000..c21a821100ef7 --- /dev/null +++ b/tests/baselines/reference/scopeTests.js @@ -0,0 +1,35 @@ +//// [scopeTests.ts] +class C { private v; public p; static s; } +class D extends C { + public v: number; + public p: number + constructor() { + super() + this.v = 1; + this.p = 1; + C.s = 1; + } +} + +//// [scopeTests.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C = (function () { + function C() { + } + return C; +})(); +var D = (function (_super) { + __extends(D, _super); + function D() { + _super.call(this); + this.v = 1; + this.p = 1; + C.s = 1; + } + return D; +})(C); diff --git a/tests/baselines/reference/scopingInCatchBlocks.errors.txt b/tests/baselines/reference/scopingInCatchBlocks.errors.txt new file mode 100644 index 0000000000000..92c8390295b56 --- /dev/null +++ b/tests/baselines/reference/scopingInCatchBlocks.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/scopingInCatchBlocks.ts (1 errors) ==== + try { } catch(ex1) { + throw ex1; + } + + try { } catch(ex1) { } // should not error + + try { } catch(ex1) { } // should not error + + var x = ex1; // should error + ~~~ +!!! Cannot find name 'ex1'. + \ No newline at end of file diff --git a/tests/baselines/reference/scopingInCatchBlocks.js b/tests/baselines/reference/scopingInCatchBlocks.js new file mode 100644 index 0000000000000..9067a6b1ffdb5 --- /dev/null +++ b/tests/baselines/reference/scopingInCatchBlocks.js @@ -0,0 +1,27 @@ +//// [scopingInCatchBlocks.ts] +try { } catch(ex1) { + throw ex1; +} + +try { } catch(ex1) { } // should not error + +try { } catch(ex1) { } // should not error + +var x = ex1; // should error + + +//// [scopingInCatchBlocks.js] +try { +} +catch (ex1) { + throw ex1; +} +try { +} +catch (ex1) { +} +try { +} +catch (ex1) { +} +var x = ex1; diff --git a/tests/baselines/reference/selfInCallback.js b/tests/baselines/reference/selfInCallback.js new file mode 100644 index 0000000000000..85f16390f965c --- /dev/null +++ b/tests/baselines/reference/selfInCallback.js @@ -0,0 +1,25 @@ +//// [selfInCallback.ts] +class C { + public p1 = 0; + public callback(cb:()=>void) {cb();} + public doit() { + this.callback(()=>{this.p1+1}); + } +} + +//// [selfInCallback.js] +var C = (function () { + function C() { + this.p1 = 0; + } + C.prototype.callback = function (cb) { + cb(); + }; + C.prototype.doit = function () { + var _this = this; + this.callback(function () { + _this.p1 + 1; + }); + }; + return C; +})(); diff --git a/tests/baselines/reference/selfInLambdas.js b/tests/baselines/reference/selfInLambdas.js new file mode 100644 index 0000000000000..6b09cf2e227af --- /dev/null +++ b/tests/baselines/reference/selfInLambdas.js @@ -0,0 +1,76 @@ +//// [selfInLambdas.ts] +interface MouseEvent { + x: number; + y: number; +} + +declare var window: Window; +interface Window { + onmousemove: (ev: MouseEvent) => any; + +} +var o = { + + counter: 0, + + start: function() { + + window.onmousemove = () => { + this.counter++ + var f = () => this.counter; + + } + + } + +} + + + +class X { + private value = "value"; + + public foo() { + var outer= () => { + var x = this.value; + var inner = () => { + var y = this.value; + } + + inner(); + + }; + outer(); + } + +} + + +//// [selfInLambdas.js] +var o = { + counter: 0, + start: function () { + var _this = this; + window.onmousemove = function () { + _this.counter++; + var f = function () { return _this.counter; }; + }; + } +}; +var X = (function () { + function X() { + this.value = "value"; + } + X.prototype.foo = function () { + var _this = this; + var outer = function () { + var x = _this.value; + var inner = function () { + var y = _this.value; + }; + inner(); + }; + outer(); + }; + return X; +})(); diff --git a/tests/baselines/reference/selfRef.errors.txt b/tests/baselines/reference/selfRef.errors.txt new file mode 100644 index 0000000000000..5e41a516adfd3 --- /dev/null +++ b/tests/baselines/reference/selfRef.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/selfRef.ts (2 errors) ==== + module M + { + export class Test + { + private name = "hello"; + public setName = function(value: string): void { + (function () { + name=value; + ~~~~ +!!! Cannot find name 'name'. + })(); + } + public getName = function(): string { + return name; + ~~~~ +!!! Cannot find name 'name'. + } + } + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/selfRef.js b/tests/baselines/reference/selfRef.js new file mode 100644 index 0000000000000..171b1efa9779b --- /dev/null +++ b/tests/baselines/reference/selfRef.js @@ -0,0 +1,39 @@ +//// [selfRef.ts] +module M +{ + export class Test + { + private name = "hello"; + public setName = function(value: string): void { + (function () { + name=value; + })(); + } + public getName = function(): string { + return name; + } + } +} + + + + +//// [selfRef.js] +var M; +(function (M) { + var Test = (function () { + function Test() { + this.name = "hello"; + this.setName = function (value) { + (function () { + name = value; + })(); + }; + this.getName = function () { + return name; + }; + } + return Test; + })(); + M.Test = Test; +})(M || (M = {})); diff --git a/tests/baselines/reference/selfReferencesInFunctionParameters.errors.txt b/tests/baselines/reference/selfReferencesInFunctionParameters.errors.txt new file mode 100644 index 0000000000000..759470aaf1a06 --- /dev/null +++ b/tests/baselines/reference/selfReferencesInFunctionParameters.errors.txt @@ -0,0 +1,22 @@ +==== tests/cases/compiler/selfReferencesInFunctionParameters.ts (4 errors) ==== + function foo(x: number = x) { + ~ +!!! Parameter 'x' cannot be referenced in its initializer. + } + + function bar(x0 = "", x: number = x) { + ~ +!!! Parameter 'x' cannot be referenced in its initializer. + } + + class C { + constructor(x = 1, y = y) { + ~ +!!! Parameter 'y' cannot be referenced in its initializer. + } + + bar(a = "", b: string = b.toString()) { + ~ +!!! Parameter 'b' cannot be referenced in its initializer. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/selfReferencesInFunctionParameters.js b/tests/baselines/reference/selfReferencesInFunctionParameters.js new file mode 100644 index 0000000000000..c707fc0116b1c --- /dev/null +++ b/tests/baselines/reference/selfReferencesInFunctionParameters.js @@ -0,0 +1,34 @@ +//// [selfReferencesInFunctionParameters.ts] +function foo(x: number = x) { +} + +function bar(x0 = "", x: number = x) { +} + +class C { + constructor(x = 1, y = y) { + } + + bar(a = "", b: string = b.toString()) { + } +} + +//// [selfReferencesInFunctionParameters.js] +function foo(x) { + if (x === void 0) { x = x; } +} +function bar(x0, x) { + if (x0 === void 0) { x0 = ""; } + if (x === void 0) { x = x; } +} +var C = (function () { + function C(x, y) { + if (x === void 0) { x = 1; } + if (y === void 0) { y = y; } + } + C.prototype.bar = function (a, b) { + if (a === void 0) { a = ""; } + if (b === void 0) { b = b.toString(); } + }; + return C; +})(); diff --git a/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt b/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt new file mode 100644 index 0000000000000..acba0800e1ad8 --- /dev/null +++ b/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/semicolonsInModuleDeclarations.ts (1 errors) ==== + declare module ambiModule { + export interface i1 { }; + ~ +!!! Statements are not allowed in ambient contexts. + export interface i2 { } + } + + var n1: ambiModule.i1; + var n2: ambiModule.i2; + \ No newline at end of file diff --git a/tests/baselines/reference/separate1-1.errors.txt b/tests/baselines/reference/separate1-1.errors.txt new file mode 100644 index 0000000000000..be69f874490f1 --- /dev/null +++ b/tests/baselines/reference/separate1-1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/separate1-1.ts (1 errors) ==== + X.f(); + ~ +!!! Cannot find name 'X'. \ No newline at end of file diff --git a/tests/baselines/reference/separate1-1.js b/tests/baselines/reference/separate1-1.js new file mode 100644 index 0000000000000..a2147cc8beb24 --- /dev/null +++ b/tests/baselines/reference/separate1-1.js @@ -0,0 +1,5 @@ +//// [separate1-1.ts] +X.f(); + +//// [separate1-1.js] +X.f(); diff --git a/tests/baselines/reference/separate1-2.js b/tests/baselines/reference/separate1-2.js new file mode 100644 index 0000000000000..bda277467e828 --- /dev/null +++ b/tests/baselines/reference/separate1-2.js @@ -0,0 +1,12 @@ +//// [separate1-2.ts] +module X { + export function f() { } +} + +//// [separate1-2.js] +var X; +(function (X) { + function f() { + } + X.f = f; +})(X || (X = {})); diff --git a/tests/baselines/reference/setterBeforeGetter.errors.txt b/tests/baselines/reference/setterBeforeGetter.errors.txt new file mode 100644 index 0000000000000..95bf7f33457e9 --- /dev/null +++ b/tests/baselines/reference/setterBeforeGetter.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/setterBeforeGetter.ts (2 errors) ==== + class Foo { + + private _bar: { a: string; }; + // should not be an error to order them this way + set bar(thing: { a: string; }) { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + this._bar = thing; + } + get bar(): { a: string; } { + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this._bar; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/setterWithReturn.errors.txt b/tests/baselines/reference/setterWithReturn.errors.txt new file mode 100644 index 0000000000000..39bd7d2b28162 --- /dev/null +++ b/tests/baselines/reference/setterWithReturn.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/setterWithReturn.ts (3 errors) ==== + class C234 { + public set p1(arg1) { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + if (true) { + return arg1; + ~~~~ +!!! Setters cannot return a value. + } + else { + return 0; + ~ +!!! Setters cannot return a value. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/shadowPrivateMembers.errors.txt b/tests/baselines/reference/shadowPrivateMembers.errors.txt new file mode 100644 index 0000000000000..8b9bfffb912ca --- /dev/null +++ b/tests/baselines/reference/shadowPrivateMembers.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/shadowPrivateMembers.ts (1 errors) ==== + class base { private n() {} } + class derived extends base { private n() {} } + ~~~~~~~ +!!! Class 'derived' incorrectly extends base class 'base': +!!! Private property 'n' cannot be reimplemented. + \ No newline at end of file diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js new file mode 100644 index 0000000000000..3d7e3db7ef100 --- /dev/null +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -0,0 +1,28 @@ +//// [shadowPrivateMembers.ts] +class base { private n() {} } +class derived extends base { private n() {} } + + +//// [shadowPrivateMembers.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var base = (function () { + function base() { + } + base.prototype.n = function () { + }; + return base; +})(); +var derived = (function (_super) { + __extends(derived, _super); + function derived() { + _super.apply(this, arguments); + } + derived.prototype.n = function () { + }; + return derived; +})(base); diff --git a/tests/baselines/reference/shadowedInternalModule.errors.txt b/tests/baselines/reference/shadowedInternalModule.errors.txt new file mode 100644 index 0000000000000..c46bac9a0682f --- /dev/null +++ b/tests/baselines/reference/shadowedInternalModule.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/conformance/internalModules/importDeclarations/shadowedInternalModule.ts (1 errors) ==== + // all errors imported modules conflict with local variables + + module A { + export var Point = { x: 0, y: 0 } + export interface Point { + x: number; + y: number; + } + } + + module B { + var A = { x: 0, y: 0 }; + import Point = A; + } + + module X { + export module Y { + export interface Point{ + x: number; + y: number + } + } + + export class Y { + name: string; + } + } + + module Z { + import Y = X.Y; + ~~~~~~~~~~~~~~~ +!!! Import declaration conflicts with local declaration of 'Y' + + var Y = 12; + } \ No newline at end of file diff --git a/tests/baselines/reference/shadowedInternalModule.js b/tests/baselines/reference/shadowedInternalModule.js new file mode 100644 index 0000000000000..3c8a38e36f660 --- /dev/null +++ b/tests/baselines/reference/shadowedInternalModule.js @@ -0,0 +1,57 @@ +//// [shadowedInternalModule.ts] +// all errors imported modules conflict with local variables + +module A { + export var Point = { x: 0, y: 0 } + export interface Point { + x: number; + y: number; + } +} + +module B { + var A = { x: 0, y: 0 }; + import Point = A; +} + +module X { + export module Y { + export interface Point{ + x: number; + y: number + } + } + + export class Y { + name: string; + } +} + +module Z { + import Y = X.Y; + + var Y = 12; +} + +//// [shadowedInternalModule.js] +var A; +(function (A) { + A.Point = { x: 0, y: 0 }; +})(A || (A = {})); +var B; +(function (B) { + var A = { x: 0, y: 0 }; +})(B || (B = {})); +var X; +(function (X) { + var Y = (function () { + function Y() { + } + return Y; + })(); + X.Y = Y; +})(X || (X = {})); +var Z; +(function (Z) { + var Y = 12; +})(Z || (Z = {})); diff --git a/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js b/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js new file mode 100644 index 0000000000000..3d718e84e9533 --- /dev/null +++ b/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js @@ -0,0 +1,19 @@ +//// [sigantureIsSubTypeIfTheyAreIdentical.ts] +interface ICache { + get(key: string): T; +} +class CacheService implements ICache { // Should not error that property type of get are incomaptible + get(key: string): T { + return undefined; + } +} + +//// [sigantureIsSubTypeIfTheyAreIdentical.js] +var CacheService = (function () { + function CacheService() { + } + CacheService.prototype.get = function (key) { + return undefined; + }; + return CacheService; +})(); diff --git a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js new file mode 100644 index 0000000000000..fbf01bc167ae2 --- /dev/null +++ b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.js @@ -0,0 +1,6 @@ +//// [simpleArrowFunctionParameterReferencedInObjectLiteral1.ts] +[].map(() => [].map(p => ({ X: p }))); + + +//// [simpleArrowFunctionParameterReferencedInObjectLiteral1.js] +[].map(function () { return [].map(function (p) { return ({ X: p }); }); }); diff --git a/tests/baselines/reference/slashBeforeVariableDeclaration1.errors.txt b/tests/baselines/reference/slashBeforeVariableDeclaration1.errors.txt new file mode 100644 index 0000000000000..53a14b939141d --- /dev/null +++ b/tests/baselines/reference/slashBeforeVariableDeclaration1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/slashBeforeVariableDeclaration1.ts (1 errors) ==== + \ declare var v; + +!!! Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-Comment1.js b/tests/baselines/reference/sourceMap-Comment1.js new file mode 100644 index 0000000000000..38442d279aa44 --- /dev/null +++ b/tests/baselines/reference/sourceMap-Comment1.js @@ -0,0 +1,5 @@ +//// [sourceMap-Comment1.ts] +// Comment + +//// [sourceMap-Comment1.js] +//# sourceMappingURL=sourceMap-Comment1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-Comment1.js.map b/tests/baselines/reference/sourceMap-Comment1.js.map new file mode 100644 index 0000000000000..b87751ea97375 --- /dev/null +++ b/tests/baselines/reference/sourceMap-Comment1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-Comment1.js.map] +{"version":3,"file":"sourceMap-Comment1.js","sourceRoot":"","sources":["sourceMap-Comment1.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-Comment1.sourcemap.txt b/tests/baselines/reference/sourceMap-Comment1.sourcemap.txt new file mode 100644 index 0000000000000..cf774ed709396 --- /dev/null +++ b/tests/baselines/reference/sourceMap-Comment1.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: sourceMap-Comment1.js +mapUrl: sourceMap-Comment1.js.map +sourceRoot: +sources: sourceMap-Comment1.ts +=================================================================== +>>>//# sourceMappingURL=sourceMap-Comment1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-EmptyFile1.js b/tests/baselines/reference/sourceMap-EmptyFile1.js new file mode 100644 index 0000000000000..e03fb5db3d6c1 --- /dev/null +++ b/tests/baselines/reference/sourceMap-EmptyFile1.js @@ -0,0 +1,5 @@ +//// [sourceMap-EmptyFile1.ts] + + +//// [sourceMap-EmptyFile1.js] +//# sourceMappingURL=sourceMap-EmptyFile1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-EmptyFile1.js.map b/tests/baselines/reference/sourceMap-EmptyFile1.js.map new file mode 100644 index 0000000000000..bcbc560d3a175 --- /dev/null +++ b/tests/baselines/reference/sourceMap-EmptyFile1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-EmptyFile1.js.map] +{"version":3,"file":"sourceMap-EmptyFile1.js","sourceRoot":"","sources":["sourceMap-EmptyFile1.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-EmptyFile1.sourcemap.txt b/tests/baselines/reference/sourceMap-EmptyFile1.sourcemap.txt new file mode 100644 index 0000000000000..989f104b8b330 --- /dev/null +++ b/tests/baselines/reference/sourceMap-EmptyFile1.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: sourceMap-EmptyFile1.js +mapUrl: sourceMap-EmptyFile1.js.map +sourceRoot: +sources: sourceMap-EmptyFile1.ts +=================================================================== +>>>//# sourceMappingURL=sourceMap-EmptyFile1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js b/tests/baselines/reference/sourceMap-FileWithComments.js new file mode 100644 index 0000000000000..e077784625dc0 --- /dev/null +++ b/tests/baselines/reference/sourceMap-FileWithComments.js @@ -0,0 +1,62 @@ +//// [sourceMap-FileWithComments.ts] + +// Interface +interface IPoint { + getDist(): number; +} + +// Module +module Shapes { + + // Class + export class Point implements IPoint { + // Constructor + constructor(public x: number, public y: number) { } + + // Instance member + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + + // Static member + static origin = new Point(0, 0); + } + + // Variable comment after class + var a = 10; + + export function foo() { + } + + /** comment after function + * this is another comment + */ + var b = 10; +} + +/** Local Variable */ +var p: IPoint = new Shapes.Point(3, 4); +var dist = p.getDist(); + +//// [sourceMap-FileWithComments.js] +var Shapes; +(function (Shapes) { + var Point = (function () { + function Point(x, y) { + this.x = x; + this.y = y; + } + Point.prototype.getDist = function () { + return Math.sqrt(this.x * this.x + this.y * this.y); + }; + Point.origin = new Point(0, 0); + return Point; + })(); + Shapes.Point = Point; + var a = 10; + function foo() { + } + Shapes.foo = foo; + var b = 10; +})(Shapes || (Shapes = {})); +var p = new Shapes.Point(3, 4); +var dist = p.getDist(); +//# sourceMappingURL=sourceMap-FileWithComments.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js.map b/tests/baselines/reference/sourceMap-FileWithComments.js.map new file mode 100644 index 0000000000000..35bc5bf6ef738 --- /dev/null +++ b/tests/baselines/reference/sourceMap-FileWithComments.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-FileWithComments.js.map] +{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":["Shapes","Shapes.Point","Shapes.Point.constructor","Shapes.Point.getDist","Shapes.foo"],"mappings":"AAOA,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM,EAAC,CAAC;IAGXA,IAAaA,KAAKA;QAEdC,SAFSA,KAAKA,CAEKA,CAASA,EAASA,CAASA;YAA3BC,MAACA,GAADA,CAACA,CAAQA;YAASA,MAACA,GAADA,CAACA,CAAQA;QAAIA,CAACA;QAGnDD,uBAAOA,GAAPA;YAAYE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA;QAACA,CAACA;QAG3DF,YAAMA,GAAGA,IAAIA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACpCA,YAACA;IAADA,CAACA,AATDD,IASCA;IATYA,YAAKA,GAALA,KASZA,CAAAA;IAGDA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IAEXA,SAAgBA,GAAGA;IACnBI,CAACA;IADeJ,UAAGA,GAAHA,GACfA,CAAAA;IAKDA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;AACfA,CAACA,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAGD,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt new file mode 100644 index 0000000000000..e3238af171884 --- /dev/null +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -0,0 +1,574 @@ +=================================================================== +JsFile: sourceMap-FileWithComments.js +mapUrl: sourceMap-FileWithComments.js.map +sourceRoot: +sources: sourceMap-FileWithComments.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMap-FileWithComments.js +sourceFile:sourceMap-FileWithComments.ts +------------------------------------------------------------------- +>>>var Shapes; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + >// Interface + >interface IPoint { + > getDist(): number; + >} + > + >// Module + > +2 >module +3 > Shapes +4 > { + > + > // Class + > export class Point implements IPoint { + > // Constructor + > constructor(public x: number, public y: number) { } + > + > // Instance member + > getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + > + > // Static member + > static origin = new Point(0, 0); + > } + > + > // Variable comment after class + > var a = 10; + > + > export function foo() { + > } + > + > /** comment after function + > * this is another comment + > */ + > var b = 10; + > } +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 8) + SourceIndex(0) +3 >Emitted(1, 11) Source(8, 14) + SourceIndex(0) +4 >Emitted(1, 12) Source(32, 2) + SourceIndex(0) +--- +>>>(function (Shapes) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1-> +2 >module +3 > Shapes +4 > +5 > { +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(8, 8) + SourceIndex(0) +3 >Emitted(2, 18) Source(8, 14) + SourceIndex(0) +4 >Emitted(2, 20) Source(8, 15) + SourceIndex(0) +5 >Emitted(2, 21) Source(8, 16) + SourceIndex(0) +--- +>>> var Point = (function () { +1->^^^^ +2 > ^^^^ +3 > ^^^^^ +4 > ^^^^^^^^^^^^^^^^^^-> +1-> + > + > // Class + > +2 > export class +3 > Point +1->Emitted(3, 5) Source(11, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(3, 9) Source(11, 18) + SourceIndex(0) name (Shapes) +3 >Emitted(3, 14) Source(11, 23) + SourceIndex(0) name (Shapes) +--- +>>> function Point(x, y) { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^ +1-> implements IPoint { + > // Constructor + > +2 > +3 > Point +4 > implements IPoint { + > // Constructor + > constructor(public +5 > x: number +6 > , public +7 > y: number +1->Emitted(4, 9) Source(13, 9) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(4, 18) Source(11, 18) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(4, 23) Source(11, 23) + SourceIndex(0) name (Shapes.Point) +4 >Emitted(4, 24) Source(13, 28) + SourceIndex(0) name (Shapes.Point) +5 >Emitted(4, 25) Source(13, 37) + SourceIndex(0) name (Shapes.Point) +6 >Emitted(4, 27) Source(13, 46) + SourceIndex(0) name (Shapes.Point) +7 >Emitted(4, 28) Source(13, 55) + SourceIndex(0) name (Shapes.Point) +--- +>>> this.x = x; +1 >^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^-> +1 > +2 > x +3 > +4 > x +5 > : number +1 >Emitted(5, 13) Source(13, 28) + SourceIndex(0) name (Shapes.Point.constructor) +2 >Emitted(5, 19) Source(13, 29) + SourceIndex(0) name (Shapes.Point.constructor) +3 >Emitted(5, 22) Source(13, 28) + SourceIndex(0) name (Shapes.Point.constructor) +4 >Emitted(5, 23) Source(13, 29) + SourceIndex(0) name (Shapes.Point.constructor) +5 >Emitted(5, 24) Source(13, 37) + SourceIndex(0) name (Shapes.Point.constructor) +--- +>>> this.y = y; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^ +5 > ^ +1->, public +2 > y +3 > +4 > y +5 > : number +1->Emitted(6, 13) Source(13, 46) + SourceIndex(0) name (Shapes.Point.constructor) +2 >Emitted(6, 19) Source(13, 47) + SourceIndex(0) name (Shapes.Point.constructor) +3 >Emitted(6, 22) Source(13, 46) + SourceIndex(0) name (Shapes.Point.constructor) +4 >Emitted(6, 23) Source(13, 47) + SourceIndex(0) name (Shapes.Point.constructor) +5 >Emitted(6, 24) Source(13, 55) + SourceIndex(0) name (Shapes.Point.constructor) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { +2 > } +1 >Emitted(7, 9) Source(13, 59) + SourceIndex(0) name (Shapes.Point.constructor) +2 >Emitted(7, 10) Source(13, 60) + SourceIndex(0) name (Shapes.Point.constructor) +--- +>>> Point.prototype.getDist = function () { +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > // Instance member + > +2 > getDist +3 > +1->Emitted(8, 9) Source(16, 9) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(8, 32) Source(16, 16) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(8, 35) Source(16, 9) + SourceIndex(0) name (Shapes.Point) +--- +>>> return Math.sqrt(this.x * this.x + this.y * this.y); +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^^^^ +9 > ^ +10> ^ +11> ^^^ +12> ^^^^ +13> ^ +14> ^ +15> ^^^ +16> ^^^^ +17> ^ +18> ^ +19> ^^^ +20> ^^^^ +21> ^ +22> ^ +23> ^ +24> ^ +1->getDist() { +2 > return +3 > +4 > Math +5 > . +6 > sqrt +7 > ( +8 > this +9 > . +10> x +11> * +12> this +13> . +14> x +15> + +16> this +17> . +18> y +19> * +20> this +21> . +22> y +23> ) +24> ; +1->Emitted(9, 13) Source(16, 21) + SourceIndex(0) name (Shapes.Point.getDist) +2 >Emitted(9, 19) Source(16, 27) + SourceIndex(0) name (Shapes.Point.getDist) +3 >Emitted(9, 20) Source(16, 28) + SourceIndex(0) name (Shapes.Point.getDist) +4 >Emitted(9, 24) Source(16, 32) + SourceIndex(0) name (Shapes.Point.getDist) +5 >Emitted(9, 25) Source(16, 33) + SourceIndex(0) name (Shapes.Point.getDist) +6 >Emitted(9, 29) Source(16, 37) + SourceIndex(0) name (Shapes.Point.getDist) +7 >Emitted(9, 30) Source(16, 38) + SourceIndex(0) name (Shapes.Point.getDist) +8 >Emitted(9, 34) Source(16, 42) + SourceIndex(0) name (Shapes.Point.getDist) +9 >Emitted(9, 35) Source(16, 43) + SourceIndex(0) name (Shapes.Point.getDist) +10>Emitted(9, 36) Source(16, 44) + SourceIndex(0) name (Shapes.Point.getDist) +11>Emitted(9, 39) Source(16, 47) + SourceIndex(0) name (Shapes.Point.getDist) +12>Emitted(9, 43) Source(16, 51) + SourceIndex(0) name (Shapes.Point.getDist) +13>Emitted(9, 44) Source(16, 52) + SourceIndex(0) name (Shapes.Point.getDist) +14>Emitted(9, 45) Source(16, 53) + SourceIndex(0) name (Shapes.Point.getDist) +15>Emitted(9, 48) Source(16, 56) + SourceIndex(0) name (Shapes.Point.getDist) +16>Emitted(9, 52) Source(16, 60) + SourceIndex(0) name (Shapes.Point.getDist) +17>Emitted(9, 53) Source(16, 61) + SourceIndex(0) name (Shapes.Point.getDist) +18>Emitted(9, 54) Source(16, 62) + SourceIndex(0) name (Shapes.Point.getDist) +19>Emitted(9, 57) Source(16, 65) + SourceIndex(0) name (Shapes.Point.getDist) +20>Emitted(9, 61) Source(16, 69) + SourceIndex(0) name (Shapes.Point.getDist) +21>Emitted(9, 62) Source(16, 70) + SourceIndex(0) name (Shapes.Point.getDist) +22>Emitted(9, 63) Source(16, 71) + SourceIndex(0) name (Shapes.Point.getDist) +23>Emitted(9, 64) Source(16, 72) + SourceIndex(0) name (Shapes.Point.getDist) +24>Emitted(9, 65) Source(16, 73) + SourceIndex(0) name (Shapes.Point.getDist) +--- +>>> }; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(10, 9) Source(16, 74) + SourceIndex(0) name (Shapes.Point.getDist) +2 >Emitted(10, 10) Source(16, 75) + SourceIndex(0) name (Shapes.Point.getDist) +--- +>>> Point.origin = new Point(0, 0); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +1-> + > + > // Static member + > static +2 > origin +3 > = +4 > new +5 > Point +6 > ( +7 > 0 +8 > , +9 > 0 +10> ) +11> ; +1->Emitted(11, 9) Source(19, 16) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(11, 21) Source(19, 22) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(11, 24) Source(19, 25) + SourceIndex(0) name (Shapes.Point) +4 >Emitted(11, 28) Source(19, 29) + SourceIndex(0) name (Shapes.Point) +5 >Emitted(11, 33) Source(19, 34) + SourceIndex(0) name (Shapes.Point) +6 >Emitted(11, 34) Source(19, 35) + SourceIndex(0) name (Shapes.Point) +7 >Emitted(11, 35) Source(19, 36) + SourceIndex(0) name (Shapes.Point) +8 >Emitted(11, 37) Source(19, 38) + SourceIndex(0) name (Shapes.Point) +9 >Emitted(11, 38) Source(19, 39) + SourceIndex(0) name (Shapes.Point) +10>Emitted(11, 39) Source(19, 40) + SourceIndex(0) name (Shapes.Point) +11>Emitted(11, 40) Source(19, 41) + SourceIndex(0) name (Shapes.Point) +--- +>>> return Point; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^ +1 > + > +2 > } +1 >Emitted(12, 9) Source(20, 5) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(12, 21) Source(20, 6) + SourceIndex(0) name (Shapes.Point) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > export class Point implements IPoint { + > // Constructor + > constructor(public x: number, public y: number) { } + > + > // Instance member + > getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + > + > // Static member + > static origin = new Point(0, 0); + > } +1 >Emitted(13, 5) Source(20, 5) + SourceIndex(0) name (Shapes.Point) +2 >Emitted(13, 6) Source(20, 6) + SourceIndex(0) name (Shapes.Point) +3 >Emitted(13, 6) Source(11, 5) + SourceIndex(0) name (Shapes) +4 >Emitted(13, 10) Source(20, 6) + SourceIndex(0) name (Shapes) +--- +>>> Shapes.Point = Point; +1->^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> +2 > Point +3 > +4 > Point implements IPoint { + > // Constructor + > constructor(public x: number, public y: number) { } + > + > // Instance member + > getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + > + > // Static member + > static origin = new Point(0, 0); + > } +5 > +1->Emitted(14, 5) Source(11, 18) + SourceIndex(0) name (Shapes) +2 >Emitted(14, 17) Source(11, 23) + SourceIndex(0) name (Shapes) +3 >Emitted(14, 20) Source(11, 18) + SourceIndex(0) name (Shapes) +4 >Emitted(14, 25) Source(20, 6) + SourceIndex(0) name (Shapes) +5 >Emitted(14, 26) Source(20, 6) + SourceIndex(0) name (Shapes) +--- +>>> var a = 10; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^-> +1 > + > + > // Variable comment after class + > +2 > var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(15, 9) Source(23, 9) + SourceIndex(0) name (Shapes) +3 >Emitted(15, 10) Source(23, 10) + SourceIndex(0) name (Shapes) +4 >Emitted(15, 13) Source(23, 13) + SourceIndex(0) name (Shapes) +5 >Emitted(15, 15) Source(23, 15) + SourceIndex(0) name (Shapes) +6 >Emitted(15, 16) Source(23, 16) + SourceIndex(0) name (Shapes) +--- +>>> function foo() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^ +1-> + > + > +2 > export function +3 > foo +1->Emitted(16, 5) Source(25, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(16, 14) Source(25, 21) + SourceIndex(0) name (Shapes) +3 >Emitted(16, 17) Source(25, 24) + SourceIndex(0) name (Shapes) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 >() { + > +2 > } +1 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) name (Shapes.foo) +2 >Emitted(17, 6) Source(26, 6) + SourceIndex(0) name (Shapes.foo) +--- +>>> Shapes.foo = foo; +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^^ +5 > ^ +1-> +2 > foo +3 > +4 > foo() { + > } +5 > +1->Emitted(18, 5) Source(25, 21) + SourceIndex(0) name (Shapes) +2 >Emitted(18, 15) Source(25, 24) + SourceIndex(0) name (Shapes) +3 >Emitted(18, 18) Source(25, 21) + SourceIndex(0) name (Shapes) +4 >Emitted(18, 21) Source(26, 6) + SourceIndex(0) name (Shapes) +5 >Emitted(18, 22) Source(26, 6) + SourceIndex(0) name (Shapes) +--- +>>> var b = 10; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^-> +1 > + > + > /** comment after function + > * this is another comment + > */ + > +2 > var +3 > b +4 > = +5 > 10 +6 > ; +1 >Emitted(19, 5) Source(31, 5) + SourceIndex(0) name (Shapes) +2 >Emitted(19, 9) Source(31, 9) + SourceIndex(0) name (Shapes) +3 >Emitted(19, 10) Source(31, 10) + SourceIndex(0) name (Shapes) +4 >Emitted(19, 13) Source(31, 13) + SourceIndex(0) name (Shapes) +5 >Emitted(19, 15) Source(31, 15) + SourceIndex(0) name (Shapes) +6 >Emitted(19, 16) Source(31, 16) + SourceIndex(0) name (Shapes) +--- +>>>})(Shapes || (Shapes = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^^^ +5 > ^^^^^ +6 > ^^^^^^ +7 > ^^^^^^^^ +8 > ^^^^-> +1-> + > +2 >} +3 > +4 > Shapes +5 > +6 > Shapes +7 > { + > + > // Class + > export class Point implements IPoint { + > // Constructor + > constructor(public x: number, public y: number) { } + > + > // Instance member + > getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + > + > // Static member + > static origin = new Point(0, 0); + > } + > + > // Variable comment after class + > var a = 10; + > + > export function foo() { + > } + > + > /** comment after function + > * this is another comment + > */ + > var b = 10; + > } +1->Emitted(20, 1) Source(32, 1) + SourceIndex(0) name (Shapes) +2 >Emitted(20, 2) Source(32, 2) + SourceIndex(0) name (Shapes) +3 >Emitted(20, 4) Source(8, 8) + SourceIndex(0) +4 >Emitted(20, 10) Source(8, 14) + SourceIndex(0) +5 >Emitted(20, 15) Source(8, 8) + SourceIndex(0) +6 >Emitted(20, 21) Source(8, 14) + SourceIndex(0) +7 >Emitted(20, 29) Source(32, 2) + SourceIndex(0) +--- +>>>var p = new Shapes.Point(3, 4); +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^ +9 > ^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +1-> + > + >/** Local Variable */ + > +2 >var +3 > p +4 > : IPoint = +5 > new +6 > Shapes +7 > . +8 > Point +9 > ( +10> 3 +11> , +12> 4 +13> ) +14> ; +1->Emitted(21, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(35, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(35, 6) + SourceIndex(0) +4 >Emitted(21, 9) Source(35, 17) + SourceIndex(0) +5 >Emitted(21, 13) Source(35, 21) + SourceIndex(0) +6 >Emitted(21, 19) Source(35, 27) + SourceIndex(0) +7 >Emitted(21, 20) Source(35, 28) + SourceIndex(0) +8 >Emitted(21, 25) Source(35, 33) + SourceIndex(0) +9 >Emitted(21, 26) Source(35, 34) + SourceIndex(0) +10>Emitted(21, 27) Source(35, 35) + SourceIndex(0) +11>Emitted(21, 29) Source(35, 37) + SourceIndex(0) +12>Emitted(21, 30) Source(35, 38) + SourceIndex(0) +13>Emitted(21, 31) Source(35, 39) + SourceIndex(0) +14>Emitted(21, 32) Source(35, 40) + SourceIndex(0) +--- +>>>var dist = p.getDist(); +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > dist +4 > = +5 > p +6 > . +7 > getDist +8 > () +9 > ; +1 >Emitted(22, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(22, 9) Source(36, 9) + SourceIndex(0) +4 >Emitted(22, 12) Source(36, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(36, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(36, 14) + SourceIndex(0) +7 >Emitted(22, 21) Source(36, 21) + SourceIndex(0) +8 >Emitted(22, 23) Source(36, 23) + SourceIndex(0) +9 >Emitted(22, 24) Source(36, 24) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMap-FileWithComments.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js new file mode 100644 index 0000000000000..01d784be7f81e --- /dev/null +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js @@ -0,0 +1,8 @@ +//// [sourceMap-InterfacePrecedingVariableDeclaration1.ts] + +interface I {} +var x = 0; + +//// [sourceMap-InterfacePrecedingVariableDeclaration1.js] +var x = 0; +//# sourceMappingURL=sourceMap-InterfacePrecedingVariableDeclaration1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js.map b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js.map new file mode 100644 index 0000000000000..a83a47f887ac4 --- /dev/null +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-InterfacePrecedingVariableDeclaration1.js.map] +{"version":3,"file":"sourceMap-InterfacePrecedingVariableDeclaration1.js","sourceRoot":"","sources":["sourceMap-InterfacePrecedingVariableDeclaration1.ts"],"names":[],"mappings":"AAEA,IAAI,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.sourcemap.txt b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.sourcemap.txt new file mode 100644 index 0000000000000..f409fa206eaf6 --- /dev/null +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.sourcemap.txt @@ -0,0 +1,34 @@ +=================================================================== +JsFile: sourceMap-InterfacePrecedingVariableDeclaration1.js +mapUrl: sourceMap-InterfacePrecedingVariableDeclaration1.js.map +sourceRoot: +sources: sourceMap-InterfacePrecedingVariableDeclaration1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMap-InterfacePrecedingVariableDeclaration1.js +sourceFile:sourceMap-InterfacePrecedingVariableDeclaration1.ts +------------------------------------------------------------------- +>>>var x = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >interface I {} + > +2 >var +3 > x +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(3, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(3, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(3, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(3, 11) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMap-InterfacePrecedingVariableDeclaration1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-NewLine1.js b/tests/baselines/reference/sourceMap-NewLine1.js new file mode 100644 index 0000000000000..7f2bb6cd314cc --- /dev/null +++ b/tests/baselines/reference/sourceMap-NewLine1.js @@ -0,0 +1,6 @@ +//// [sourceMap-NewLine1.ts] + + + +//// [sourceMap-NewLine1.js] +//# sourceMappingURL=sourceMap-NewLine1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-NewLine1.js.map b/tests/baselines/reference/sourceMap-NewLine1.js.map new file mode 100644 index 0000000000000..1a7002d946922 --- /dev/null +++ b/tests/baselines/reference/sourceMap-NewLine1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-NewLine1.js.map] +{"version":3,"file":"sourceMap-NewLine1.js","sourceRoot":"","sources":["sourceMap-NewLine1.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-NewLine1.sourcemap.txt b/tests/baselines/reference/sourceMap-NewLine1.sourcemap.txt new file mode 100644 index 0000000000000..b6f7132dd2e4a --- /dev/null +++ b/tests/baselines/reference/sourceMap-NewLine1.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: sourceMap-NewLine1.js +mapUrl: sourceMap-NewLine1.js.map +sourceRoot: +sources: sourceMap-NewLine1.ts +=================================================================== +>>>//# sourceMappingURL=sourceMap-NewLine1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SemiColon1.js b/tests/baselines/reference/sourceMap-SemiColon1.js new file mode 100644 index 0000000000000..c3f87ec36ba4e --- /dev/null +++ b/tests/baselines/reference/sourceMap-SemiColon1.js @@ -0,0 +1,7 @@ +//// [sourceMap-SemiColon1.ts] +; + + +//// [sourceMap-SemiColon1.js] +; +//# sourceMappingURL=sourceMap-SemiColon1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SemiColon1.js.map b/tests/baselines/reference/sourceMap-SemiColon1.js.map new file mode 100644 index 0000000000000..cb7a4c9dc6ad6 --- /dev/null +++ b/tests/baselines/reference/sourceMap-SemiColon1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-SemiColon1.js.map] +{"version":3,"file":"sourceMap-SemiColon1.js","sourceRoot":"","sources":["sourceMap-SemiColon1.ts"],"names":[],"mappings":"AAAA,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SemiColon1.sourcemap.txt b/tests/baselines/reference/sourceMap-SemiColon1.sourcemap.txt new file mode 100644 index 0000000000000..9760839bb4b74 --- /dev/null +++ b/tests/baselines/reference/sourceMap-SemiColon1.sourcemap.txt @@ -0,0 +1,20 @@ +=================================================================== +JsFile: sourceMap-SemiColon1.js +mapUrl: sourceMap-SemiColon1.js.map +sourceRoot: +sources: sourceMap-SemiColon1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMap-SemiColon1.js +sourceFile:sourceMap-SemiColon1.ts +------------------------------------------------------------------- +>>>; +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 2) Source(1, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMap-SemiColon1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SingleSpace1.js b/tests/baselines/reference/sourceMap-SingleSpace1.js new file mode 100644 index 0000000000000..98b0399a36231 --- /dev/null +++ b/tests/baselines/reference/sourceMap-SingleSpace1.js @@ -0,0 +1,5 @@ +//// [sourceMap-SingleSpace1.ts] + + +//// [sourceMap-SingleSpace1.js] +//# sourceMappingURL=sourceMap-SingleSpace1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SingleSpace1.js.map b/tests/baselines/reference/sourceMap-SingleSpace1.js.map new file mode 100644 index 0000000000000..2769a2e75a64d --- /dev/null +++ b/tests/baselines/reference/sourceMap-SingleSpace1.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-SingleSpace1.js.map] +{"version":3,"file":"sourceMap-SingleSpace1.js","sourceRoot":"","sources":["sourceMap-SingleSpace1.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SingleSpace1.sourcemap.txt b/tests/baselines/reference/sourceMap-SingleSpace1.sourcemap.txt new file mode 100644 index 0000000000000..1fc769eb779c9 --- /dev/null +++ b/tests/baselines/reference/sourceMap-SingleSpace1.sourcemap.txt @@ -0,0 +1,7 @@ +=================================================================== +JsFile: sourceMap-SingleSpace1.js +mapUrl: sourceMap-SingleSpace1.js.map +sourceRoot: +sources: sourceMap-SingleSpace1.ts +=================================================================== +>>>//# sourceMappingURL=sourceMap-SingleSpace1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js new file mode 100644 index 0000000000000..8745facb3a628 --- /dev/null +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js @@ -0,0 +1,25 @@ +//// [sourceMap-StringLiteralWithNewLine.ts] + +interface Document { +} +interface Window { + document: Document; +} +declare var window: Window; + +module Foo { + var x = "test1"; + var y = "test 2\ +isn't this a lot of fun"; + var z = window.document; +} + +//// [sourceMap-StringLiteralWithNewLine.js] +var Foo; +(function (Foo) { + var x = "test1"; + var y = "test 2\ +isn't this a lot of fun"; + var z = window.document; +})(Foo || (Foo = {})); +//# sourceMappingURL=sourceMap-StringLiteralWithNewLine.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js.map b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js.map new file mode 100644 index 0000000000000..a590744eddf00 --- /dev/null +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.js.map @@ -0,0 +1,2 @@ +//// [sourceMap-StringLiteralWithNewLine.js.map] +{"version":3,"file":"sourceMap-StringLiteralWithNewLine.js","sourceRoot":"","sources":["sourceMap-StringLiteralWithNewLine.ts"],"names":["Foo"],"mappings":"AAQA,IAAO,GAAG,CAKT;AALD,WAAO,GAAG,EAAC,CAAC;IACRA,IAAIA,CAACA,GAAGA,OAAOA,CAACA;IAChBA,IAAIA,CAACA,GAAGA;wBACYA,CAACA;IACrBA,IAAIA,CAACA,GAAGA,MAAMA,CAACA,QAAQA,CAACA;AAC5BA,CAACA,EALM,GAAG,KAAH,GAAG,QAKT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.sourcemap.txt b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.sourcemap.txt new file mode 100644 index 0000000000000..864cf2647843d --- /dev/null +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.sourcemap.txt @@ -0,0 +1,161 @@ +=================================================================== +JsFile: sourceMap-StringLiteralWithNewLine.js +mapUrl: sourceMap-StringLiteralWithNewLine.js.map +sourceRoot: +sources: sourceMap-StringLiteralWithNewLine.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMap-StringLiteralWithNewLine.js +sourceFile:sourceMap-StringLiteralWithNewLine.ts +------------------------------------------------------------------- +>>>var Foo; +1 > +2 >^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + >interface Document { + >} + >interface Window { + > document: Document; + >} + >declare var window: Window; + > + > +2 >module +3 > Foo +4 > { + > var x = "test1"; + > var y = "test 2\ + > isn't this a lot of fun"; + > var z = window.document; + > } +1 >Emitted(1, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(9, 8) + SourceIndex(0) +3 >Emitted(1, 8) Source(9, 11) + SourceIndex(0) +4 >Emitted(1, 9) Source(14, 2) + SourceIndex(0) +--- +>>>(function (Foo) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^-> +1-> +2 >module +3 > Foo +4 > +5 > { +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(9, 8) + SourceIndex(0) +3 >Emitted(2, 15) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 17) Source(9, 12) + SourceIndex(0) +5 >Emitted(2, 18) Source(9, 13) + SourceIndex(0) +--- +>>> var x = "test1"; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +1-> + > +2 > var +3 > x +4 > = +5 > "test1" +6 > ; +1->Emitted(3, 5) Source(10, 5) + SourceIndex(0) name (Foo) +2 >Emitted(3, 9) Source(10, 9) + SourceIndex(0) name (Foo) +3 >Emitted(3, 10) Source(10, 10) + SourceIndex(0) name (Foo) +4 >Emitted(3, 13) Source(10, 13) + SourceIndex(0) name (Foo) +5 >Emitted(3, 20) Source(10, 20) + SourceIndex(0) name (Foo) +6 >Emitted(3, 21) Source(10, 21) + SourceIndex(0) name (Foo) +--- +>>> var y = "test 2\ +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^-> +1 > + > +2 > var +3 > y +4 > = +1 >Emitted(4, 5) Source(11, 5) + SourceIndex(0) name (Foo) +2 >Emitted(4, 9) Source(11, 9) + SourceIndex(0) name (Foo) +3 >Emitted(4, 10) Source(11, 10) + SourceIndex(0) name (Foo) +4 >Emitted(4, 13) Source(11, 13) + SourceIndex(0) name (Foo) +--- +>>>isn't this a lot of fun"; +1->^^^^^^^^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^-> +1->"test 2\ + >isn't this a lot of fun" +2 > ; +1->Emitted(5, 25) Source(12, 25) + SourceIndex(0) name (Foo) +2 >Emitted(5, 26) Source(12, 26) + SourceIndex(0) name (Foo) +--- +>>> var z = window.document; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^ +1-> + > +2 > var +3 > z +4 > = +5 > window +6 > . +7 > document +8 > ; +1->Emitted(6, 5) Source(13, 5) + SourceIndex(0) name (Foo) +2 >Emitted(6, 9) Source(13, 9) + SourceIndex(0) name (Foo) +3 >Emitted(6, 10) Source(13, 10) + SourceIndex(0) name (Foo) +4 >Emitted(6, 13) Source(13, 13) + SourceIndex(0) name (Foo) +5 >Emitted(6, 19) Source(13, 19) + SourceIndex(0) name (Foo) +6 >Emitted(6, 20) Source(13, 20) + SourceIndex(0) name (Foo) +7 >Emitted(6, 28) Source(13, 28) + SourceIndex(0) name (Foo) +8 >Emitted(6, 29) Source(13, 29) + SourceIndex(0) name (Foo) +--- +>>>})(Foo || (Foo = {})); +1 > +2 >^ +3 > ^^ +4 > ^^^ +5 > ^^^^^ +6 > ^^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +3 > +4 > Foo +5 > +6 > Foo +7 > { + > var x = "test1"; + > var y = "test 2\ + > isn't this a lot of fun"; + > var z = window.document; + > } +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) name (Foo) +2 >Emitted(7, 2) Source(14, 2) + SourceIndex(0) name (Foo) +3 >Emitted(7, 4) Source(9, 8) + SourceIndex(0) +4 >Emitted(7, 7) Source(9, 11) + SourceIndex(0) +5 >Emitted(7, 12) Source(9, 8) + SourceIndex(0) +6 >Emitted(7, 15) Source(9, 11) + SourceIndex(0) +7 >Emitted(7, 23) Source(14, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMap-StringLiteralWithNewLine.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.errors.txt b/tests/baselines/reference/sourceMapSample.errors.txt new file mode 100644 index 0000000000000..7409dcab48e7b --- /dev/null +++ b/tests/baselines/reference/sourceMapSample.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/sourceMapSample.ts (1 errors) ==== + module Foo.Bar { + "use strict"; + + class Greeter { + constructor(public greeting: string) { + } + + greet() { + return "

" + this.greeting + "

"; + } + } + + + function foo(greeting: string): Foo.Bar.Greeter { + ~~~~~~~~~~~~~~~ +!!! Module 'Foo.Bar' has no exported member 'Greeter'. + return new Greeter(greeting); + } + + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + + function foo2(greeting: string, ...restGreetings: string[]) { + var greeters: Greeter[] = []; + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + + return greeters; + } + + var b = foo2("Hello", "World", "!"); + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.js b/tests/baselines/reference/sourceMapSample.js new file mode 100644 index 0000000000000..aba0f804d794b --- /dev/null +++ b/tests/baselines/reference/sourceMapSample.js @@ -0,0 +1,76 @@ +//// [sourceMapSample.ts] +module Foo.Bar { + "use strict"; + + class Greeter { + constructor(public greeting: string) { + } + + greet() { + return "

" + this.greeting + "

"; + } + } + + + function foo(greeting: string): Foo.Bar.Greeter { + return new Greeter(greeting); + } + + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + + function foo2(greeting: string, ...restGreetings: string[]) { + var greeters: Greeter[] = []; + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + + return greeters; + } + + var b = foo2("Hello", "World", "!"); + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } +} + +//// [sourceMapSample.js] +var Foo; +(function (Foo) { + (function (Bar) { + "use strict"; + var Greeter = (function () { + function Greeter(greeting) { + this.greeting = greeting; + } + Greeter.prototype.greet = function () { + return "

" + this.greeting + "

"; + }; + return Greeter; + })(); + function foo(greeting) { + return new Greeter(greeting); + } + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + function foo2(greeting) { + var restGreetings = []; + for (var _i = 1; _i < arguments.length; _i++) { + restGreetings[_i - 1] = arguments[_i]; + } + var greeters = []; + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + return greeters; + } + var b = foo2("Hello", "World", "!"); + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } + })(Foo.Bar || (Foo.Bar = {})); + var Bar = Foo.Bar; +})(Foo || (Foo = {})); +//# sourceMappingURL=sourceMapSample.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.js.map b/tests/baselines/reference/sourceMapSample.js.map new file mode 100644 index 0000000000000..fb1c31a80b00d --- /dev/null +++ b/tests/baselines/reference/sourceMapSample.js.map @@ -0,0 +1,2 @@ +//// [sourceMapSample.js.map] +{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAACA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA,IAAMA,OAAOA;YACTC,SADEA,OAAOA,CACUA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,SAASA,GAAGA,CAACA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,SAASA,IAAIA,CAACA,QAAgBA;YAAEK,uBAA0BA;iBAA1BA,WAA0BA,CAA1BA,sBAA0BA,CAA1BA,IAA0BA;gBAA1BA,sCAA0BA;;YACtDA,IAAIA,QAAQA,GAAcA,EAAEA,CAACA;YAC7BA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAlCUD,OAAGA,KAAHA,OAAGA,QAkCbA;IAlCUA,IAAAA,GAAGA,GAAHA,OAkCVA,CAAAA;AAADA,CAACA,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.sourcemap.txt b/tests/baselines/reference/sourceMapSample.sourcemap.txt new file mode 100644 index 0000000000000..df82f084b6080 --- /dev/null +++ b/tests/baselines/reference/sourceMapSample.sourcemap.txt @@ -0,0 +1,969 @@ +=================================================================== +JsFile: sourceMapSample.js +mapUrl: sourceMapSample.js.map +sourceRoot: +sources: sourceMapSample.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapSample.js +sourceFile:sourceMapSample.ts +------------------------------------------------------------------- +>>>var Foo; +1 > +2 >^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > Foo +4 > .Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Foo.Bar.Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings: string[]) { + > var greeters: Greeter[] = []; + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 8) Source(1, 11) + SourceIndex(0) +4 >Emitted(1, 9) Source(35, 2) + SourceIndex(0) +--- +>>>(function (Foo) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^-> +1-> +2 >module +3 > Foo +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0) +3 >Emitted(2, 15) Source(1, 11) + SourceIndex(0) +--- +>>> (function (Bar) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^-> +1->. +2 > +3 > Bar +4 > +5 > { +1->Emitted(3, 5) Source(1, 12) + SourceIndex(0) name (Foo) +2 >Emitted(3, 16) Source(1, 12) + SourceIndex(0) name (Foo) +3 >Emitted(3, 19) Source(1, 15) + SourceIndex(0) name (Foo) +4 >Emitted(3, 21) Source(1, 16) + SourceIndex(0) name (Foo) +5 >Emitted(3, 22) Source(1, 17) + SourceIndex(0) name (Foo) +--- +>>> "use strict"; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 > "use strict" +3 > ; +1->Emitted(4, 9) Source(2, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(4, 21) Source(2, 17) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(4, 22) Source(2, 18) + SourceIndex(0) name (Foo.Bar) +--- +>>> var Greeter = (function () { +1->^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > class +3 > Greeter +1->Emitted(5, 9) Source(4, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(5, 13) Source(4, 11) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(5, 20) Source(4, 18) + SourceIndex(0) name (Foo.Bar) +--- +>>> function Greeter(greeting) { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^-> +1-> { + > +2 > +3 > Greeter +4 > { + > constructor(public +5 > greeting: string +1->Emitted(6, 13) Source(5, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(6, 22) Source(4, 11) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(6, 29) Source(4, 18) + SourceIndex(0) name (Foo.Bar.Greeter) +4 >Emitted(6, 30) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter) +5 >Emitted(6, 38) Source(5, 44) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> this.greeting = greeting; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^ +5 > ^ +1-> +2 > greeting +3 > +4 > greeting +5 > : string +1->Emitted(7, 17) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +2 >Emitted(7, 30) Source(5, 36) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +3 >Emitted(7, 33) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +4 >Emitted(7, 41) Source(5, 36) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +5 >Emitted(7, 42) Source(5, 44) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { + > +2 > } +1 >Emitted(8, 13) Source(6, 9) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +2 >Emitted(8, 14) Source(6, 10) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +--- +>>> Greeter.prototype.greet = function () { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > greet +3 > +1->Emitted(9, 13) Source(8, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(9, 36) Source(8, 14) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(9, 39) Source(8, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> return "

" + this.greeting + "

"; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^^^ +6 > ^^^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^^ +10> ^^^^^^^ +11> ^ +1->greet() { + > +2 > return +3 > +4 > "

" +5 > + +6 > this +7 > . +8 > greeting +9 > + +10> "

" +11> ; +1->Emitted(10, 17) Source(9, 13) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +2 >Emitted(10, 23) Source(9, 19) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +3 >Emitted(10, 24) Source(9, 20) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +4 >Emitted(10, 30) Source(9, 26) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +5 >Emitted(10, 33) Source(9, 29) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +6 >Emitted(10, 37) Source(9, 33) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +7 >Emitted(10, 38) Source(9, 34) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +8 >Emitted(10, 46) Source(9, 42) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +9 >Emitted(10, 49) Source(9, 45) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +10>Emitted(10, 56) Source(9, 52) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +11>Emitted(10, 57) Source(9, 53) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +--- +>>> }; +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(11, 13) Source(10, 9) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +2 >Emitted(11, 14) Source(10, 10) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +--- +>>> return Greeter; +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(12, 13) Source(11, 5) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(12, 27) Source(11, 6) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> })(); +1 >^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } +1 >Emitted(13, 9) Source(11, 5) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(13, 10) Source(11, 6) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(13, 10) Source(4, 5) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(13, 14) Source(11, 6) + SourceIndex(0) name (Foo.Bar) +--- +>>> function foo(greeting) { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^^^^^^^^^-> +1-> + > + > + > +2 > function +3 > foo +4 > ( +5 > greeting: string +1->Emitted(14, 9) Source(14, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(14, 18) Source(14, 14) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(14, 21) Source(14, 17) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(14, 22) Source(14, 18) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(14, 30) Source(14, 34) + SourceIndex(0) name (Foo.Bar) +--- +>>> return new Greeter(greeting); +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^ +9 > ^ +1->): Foo.Bar.Greeter { + > +2 > return +3 > +4 > new +5 > Greeter +6 > ( +7 > greeting +8 > ) +9 > ; +1->Emitted(15, 13) Source(15, 9) + SourceIndex(0) name (Foo.Bar.foo) +2 >Emitted(15, 19) Source(15, 15) + SourceIndex(0) name (Foo.Bar.foo) +3 >Emitted(15, 20) Source(15, 16) + SourceIndex(0) name (Foo.Bar.foo) +4 >Emitted(15, 24) Source(15, 20) + SourceIndex(0) name (Foo.Bar.foo) +5 >Emitted(15, 31) Source(15, 27) + SourceIndex(0) name (Foo.Bar.foo) +6 >Emitted(15, 32) Source(15, 28) + SourceIndex(0) name (Foo.Bar.foo) +7 >Emitted(15, 40) Source(15, 36) + SourceIndex(0) name (Foo.Bar.foo) +8 >Emitted(15, 41) Source(15, 37) + SourceIndex(0) name (Foo.Bar.foo) +9 >Emitted(15, 42) Source(15, 38) + SourceIndex(0) name (Foo.Bar.foo) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(16, 9) Source(16, 5) + SourceIndex(0) name (Foo.Bar.foo) +2 >Emitted(16, 10) Source(16, 6) + SourceIndex(0) name (Foo.Bar.foo) +--- +>>> var greeter = new Greeter("Hello, world!"); +1->^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^ +9 > ^ +10> ^ +1-> + > + > +2 > var +3 > greeter +4 > = +5 > new +6 > Greeter +7 > ( +8 > "Hello, world!" +9 > ) +10> ; +1->Emitted(17, 9) Source(18, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(17, 13) Source(18, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(17, 20) Source(18, 16) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(17, 23) Source(18, 19) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(17, 27) Source(18, 23) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(17, 34) Source(18, 30) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(17, 35) Source(18, 31) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(17, 50) Source(18, 46) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(17, 51) Source(18, 47) + SourceIndex(0) name (Foo.Bar) +10>Emitted(17, 52) Source(18, 48) + SourceIndex(0) name (Foo.Bar) +--- +>>> var str = greeter.greet(); +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^ +8 > ^^ +9 > ^ +1 > + > +2 > var +3 > str +4 > = +5 > greeter +6 > . +7 > greet +8 > () +9 > ; +1 >Emitted(18, 9) Source(19, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(18, 13) Source(19, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(18, 16) Source(19, 12) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(18, 19) Source(19, 15) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(18, 26) Source(19, 22) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(18, 27) Source(19, 23) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(18, 32) Source(19, 28) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(18, 34) Source(19, 30) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(18, 35) Source(19, 31) + SourceIndex(0) name (Foo.Bar) +--- +>>> function foo2(greeting) { +1 >^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^^-> +1 > + > + > +2 > function +3 > foo2 +4 > ( +5 > greeting: string +1 >Emitted(19, 9) Source(21, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(19, 18) Source(21, 14) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(19, 22) Source(21, 18) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(19, 23) Source(21, 19) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(19, 31) Source(21, 35) + SourceIndex(0) name (Foo.Bar) +--- +>>> var restGreetings = []; +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, +2 > ...restGreetings: string[] +1->Emitted(20, 13) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(20, 36) Source(21, 63) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> for (var _i = 1; _i < arguments.length; _i++) { +1->^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^ +1-> +2 > ...restGreetings: string[] +3 > +4 > ...restGreetings: string[] +5 > +6 > ...restGreetings: string[] +1->Emitted(21, 18) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(21, 29) Source(21, 63) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(21, 30) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(21, 52) Source(21, 63) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(21, 53) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(21, 57) Source(21, 63) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> restGreetings[_i - 1] = arguments[_i]; +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...restGreetings: string[] +1 >Emitted(22, 17) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(22, 55) Source(21, 63) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +>>> var greeters = []; +1 >^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^-> +1 >) { + > +2 > var +3 > greeters +4 > : Greeter[] = +5 > [] +6 > ; +1 >Emitted(24, 13) Source(22, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(24, 17) Source(22, 13) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(24, 25) Source(22, 21) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(24, 28) Source(22, 35) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(24, 30) Source(22, 37) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(24, 31) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> greeters[0] = new Greeter(greeting); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^^^^ +8 > ^^^^^^^ +9 > ^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^-> +1-> + > +2 > greeters +3 > [ +4 > 0 +5 > ] +6 > = +7 > new +8 > Greeter +9 > ( +10> greeting +11> ) +12> ; +1->Emitted(25, 13) Source(23, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(25, 21) Source(23, 17) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(25, 22) Source(23, 18) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(25, 23) Source(23, 19) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(25, 24) Source(23, 20) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(25, 27) Source(23, 23) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(25, 31) Source(23, 27) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(25, 38) Source(23, 34) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(25, 39) Source(23, 35) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(25, 47) Source(23, 43) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(25, 48) Source(23, 44) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(25, 49) Source(23, 45) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> for (var i = 0; i < restGreetings.length; i++) { +1->^^^^^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^^^^^^^^^^^^ +14> ^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +21> ^^-> +1-> + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> restGreetings +14> . +15> length +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(26, 13) Source(24, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(26, 16) Source(24, 12) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(26, 17) Source(24, 13) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(26, 18) Source(24, 14) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(26, 21) Source(24, 17) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(26, 22) Source(24, 18) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(26, 23) Source(24, 19) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(26, 26) Source(24, 22) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(26, 27) Source(24, 23) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(26, 29) Source(24, 25) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(26, 30) Source(24, 26) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(26, 33) Source(24, 29) + SourceIndex(0) name (Foo.Bar.foo2) +13>Emitted(26, 46) Source(24, 42) + SourceIndex(0) name (Foo.Bar.foo2) +14>Emitted(26, 47) Source(24, 43) + SourceIndex(0) name (Foo.Bar.foo2) +15>Emitted(26, 53) Source(24, 49) + SourceIndex(0) name (Foo.Bar.foo2) +16>Emitted(26, 55) Source(24, 51) + SourceIndex(0) name (Foo.Bar.foo2) +17>Emitted(26, 56) Source(24, 52) + SourceIndex(0) name (Foo.Bar.foo2) +18>Emitted(26, 58) Source(24, 54) + SourceIndex(0) name (Foo.Bar.foo2) +19>Emitted(26, 60) Source(24, 56) + SourceIndex(0) name (Foo.Bar.foo2) +20>Emitted(26, 61) Source(24, 57) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> greeters.push(new Greeter(restGreetings[i])); +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^ +7 > ^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +1-> + > +2 > greeters +3 > . +4 > push +5 > ( +6 > new +7 > Greeter +8 > ( +9 > restGreetings +10> [ +11> i +12> ] +13> ) +14> ) +15> ; +1->Emitted(27, 17) Source(25, 13) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(27, 25) Source(25, 21) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(27, 26) Source(25, 22) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(27, 30) Source(25, 26) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(27, 31) Source(25, 27) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(27, 35) Source(25, 31) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(27, 42) Source(25, 38) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(27, 43) Source(25, 39) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(27, 56) Source(25, 52) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(27, 57) Source(25, 53) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(27, 58) Source(25, 54) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(27, 59) Source(25, 55) + SourceIndex(0) name (Foo.Bar.foo2) +13>Emitted(27, 60) Source(25, 56) + SourceIndex(0) name (Foo.Bar.foo2) +14>Emitted(27, 61) Source(25, 57) + SourceIndex(0) name (Foo.Bar.foo2) +15>Emitted(27, 62) Source(25, 58) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(28, 13) Source(26, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(28, 14) Source(26, 10) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> return greeters; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^ +5 > ^ +1-> + > + > +2 > return +3 > +4 > greeters +5 > ; +1->Emitted(29, 13) Source(28, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(29, 19) Source(28, 15) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(29, 20) Source(28, 16) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(29, 28) Source(28, 24) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(29, 29) Source(28, 25) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(30, 9) Source(29, 5) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(30, 10) Source(29, 6) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> var b = foo2("Hello", "World", "!"); +1->^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^ +12> ^ +13> ^ +14> ^-> +1-> + > + > +2 > var +3 > b +4 > = +5 > foo2 +6 > ( +7 > "Hello" +8 > , +9 > "World" +10> , +11> "!" +12> ) +13> ; +1->Emitted(31, 9) Source(31, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(31, 13) Source(31, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(31, 14) Source(31, 10) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(31, 17) Source(31, 13) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(31, 21) Source(31, 17) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(31, 22) Source(31, 18) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(31, 29) Source(31, 25) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(31, 31) Source(31, 27) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(31, 38) Source(31, 34) + SourceIndex(0) name (Foo.Bar) +10>Emitted(31, 40) Source(31, 36) + SourceIndex(0) name (Foo.Bar) +11>Emitted(31, 43) Source(31, 39) + SourceIndex(0) name (Foo.Bar) +12>Emitted(31, 44) Source(31, 40) + SourceIndex(0) name (Foo.Bar) +13>Emitted(31, 45) Source(31, 41) + SourceIndex(0) name (Foo.Bar) +--- +>>> for (var j = 0; j < b.length; j++) { +1->^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > j +8 > = +9 > 0 +10> ; +11> j +12> < +13> b +14> . +15> length +16> ; +17> j +18> ++ +19> ) +20> { +1->Emitted(32, 9) Source(32, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(32, 12) Source(32, 8) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(32, 13) Source(32, 9) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(32, 14) Source(32, 10) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(32, 17) Source(32, 13) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(32, 18) Source(32, 14) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(32, 19) Source(32, 15) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(32, 22) Source(32, 18) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(32, 23) Source(32, 19) + SourceIndex(0) name (Foo.Bar) +10>Emitted(32, 25) Source(32, 21) + SourceIndex(0) name (Foo.Bar) +11>Emitted(32, 26) Source(32, 22) + SourceIndex(0) name (Foo.Bar) +12>Emitted(32, 29) Source(32, 25) + SourceIndex(0) name (Foo.Bar) +13>Emitted(32, 30) Source(32, 26) + SourceIndex(0) name (Foo.Bar) +14>Emitted(32, 31) Source(32, 27) + SourceIndex(0) name (Foo.Bar) +15>Emitted(32, 37) Source(32, 33) + SourceIndex(0) name (Foo.Bar) +16>Emitted(32, 39) Source(32, 35) + SourceIndex(0) name (Foo.Bar) +17>Emitted(32, 40) Source(32, 36) + SourceIndex(0) name (Foo.Bar) +18>Emitted(32, 42) Source(32, 38) + SourceIndex(0) name (Foo.Bar) +19>Emitted(32, 44) Source(32, 40) + SourceIndex(0) name (Foo.Bar) +20>Emitted(32, 45) Source(32, 41) + SourceIndex(0) name (Foo.Bar) +--- +>>> b[j].greet(); +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^^^^^ +8 > ^^ +9 > ^ +1 > + > +2 > b +3 > [ +4 > j +5 > ] +6 > . +7 > greet +8 > () +9 > ; +1 >Emitted(33, 13) Source(33, 9) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(33, 14) Source(33, 10) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(33, 15) Source(33, 11) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(33, 16) Source(33, 12) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(33, 17) Source(33, 13) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(33, 18) Source(33, 14) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(33, 23) Source(33, 19) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(33, 25) Source(33, 21) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(33, 26) Source(33, 22) + SourceIndex(0) name (Foo.Bar) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(34, 9) Source(34, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(34, 10) Source(34, 6) + SourceIndex(0) name (Foo.Bar) +--- +>>> })(Foo.Bar || (Foo.Bar = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^ +7 > ^^^^^^^^ +1-> + > +2 > } +3 > +4 > Bar +5 > +6 > Bar +7 > { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Foo.Bar.Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings: string[]) { + > var greeters: Greeter[] = []; + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1->Emitted(35, 5) Source(35, 1) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(35, 6) Source(35, 2) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(35, 8) Source(1, 12) + SourceIndex(0) name (Foo) +4 >Emitted(35, 15) Source(1, 15) + SourceIndex(0) name (Foo) +5 >Emitted(35, 20) Source(1, 12) + SourceIndex(0) name (Foo) +6 >Emitted(35, 27) Source(1, 15) + SourceIndex(0) name (Foo) +7 >Emitted(35, 35) Source(35, 2) + SourceIndex(0) name (Foo) +--- +>>> var Bar = Foo.Bar; +1 >^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^-> +1 > +2 > +3 > Bar +4 > +5 > Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Foo.Bar.Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings: string[]) { + > var greeters: Greeter[] = []; + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +6 > +1 >Emitted(36, 5) Source(1, 12) + SourceIndex(0) name (Foo) +2 >Emitted(36, 9) Source(1, 12) + SourceIndex(0) name (Foo) +3 >Emitted(36, 12) Source(1, 15) + SourceIndex(0) name (Foo) +4 >Emitted(36, 15) Source(1, 12) + SourceIndex(0) name (Foo) +5 >Emitted(36, 22) Source(35, 2) + SourceIndex(0) name (Foo) +6 >Emitted(36, 23) Source(35, 2) + SourceIndex(0) name (Foo) +--- +>>>})(Foo || (Foo = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^ +5 > ^^^^^ +6 > ^^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >} +3 > +4 > Foo +5 > +6 > Foo +7 > .Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Foo.Bar.Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings: string[]) { + > var greeters: Greeter[] = []; + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1->Emitted(37, 1) Source(35, 1) + SourceIndex(0) name (Foo) +2 >Emitted(37, 2) Source(35, 2) + SourceIndex(0) name (Foo) +3 >Emitted(37, 4) Source(1, 8) + SourceIndex(0) +4 >Emitted(37, 7) Source(1, 11) + SourceIndex(0) +5 >Emitted(37, 12) Source(1, 8) + SourceIndex(0) +6 >Emitted(37, 15) Source(1, 11) + SourceIndex(0) +7 >Emitted(37, 23) Source(35, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapSample.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClass.js b/tests/baselines/reference/sourceMapValidationClass.js new file mode 100644 index 0000000000000..196004282828a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClass.js @@ -0,0 +1,49 @@ +//// [sourceMapValidationClass.ts] +class Greeter { + constructor(public greeting: string, ...b: string[]) { + } + greet() { + return "

" + this.greeting + "

"; + } + private x: string; + private x1: number = 10; + private fn() { + return this.greeting; + } + get greetings() { + return this.greeting; + } + set greetings(greetings: string) { + this.greeting = greetings; + } +} + +//// [sourceMapValidationClass.js] +var Greeter = (function () { + function Greeter(greeting, b) { + var b = []; + for (var _i = 1; _i < arguments.length; _i++) { + b[_i - 1] = arguments[_i]; + } + this.greeting = greeting; + this.x1 = 10; + } + Greeter.prototype.greet = function () { + return "

" + this.greeting + "

"; + }; + Greeter.prototype.fn = function () { + return this.greeting; + }; + Object.defineProperty(Greeter.prototype, "greetings", { + get: function () { + return this.greeting; + }, + set: function (greetings) { + this.greeting = greetings; + }, + enumerable: true, + configurable: true + }); + return Greeter; +})(); +//# sourceMappingURL=sourceMapValidationClass.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClass.js.map b/tests/baselines/reference/sourceMapValidationClass.js.map new file mode 100644 index 0000000000000..06f20d160bf7f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClass.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationClass.js.map] +{"version":3,"file":"sourceMapValidationClass.js","sourceRoot":"","sources":["sourceMapValidationClass.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":"AAAA,IAAM,OAAO;IACTA,SADEA,OAAOA,CACUA,QAAgBA,EAAKA,CAAWA;QAAdC,WAAcA;aAAdA,WAAcA,CAAdA,sBAAcA,CAAdA,IAAcA;YAAdA,0BAAcA;;QAAhCA,aAAQA,GAARA,QAAQA,CAAQA;QAM3BA,OAAEA,GAAWA,EAAEA,CAACA;IALxBA,CAACA;IACDD,uBAAKA,GAALA;QACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAGOF,oBAAEA,GAAVA;QACIG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IACDH,sBAAIA,8BAASA;aAAbA;YACII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aACDJ,UAAcA,SAAiBA;YAC3BI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAHAJ;IAILA,cAACA;AAADA,CAACA,AAjBD,IAiBC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt new file mode 100644 index 0000000000000..a978a4dc3a3e2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt @@ -0,0 +1,394 @@ +=================================================================== +JsFile: sourceMapValidationClass.js +mapUrl: sourceMapValidationClass.js.map +sourceRoot: +sources: sourceMapValidationClass.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationClass.js +sourceFile:sourceMapValidationClass.ts +------------------------------------------------------------------- +>>>var Greeter = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >class +3 > Greeter +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 12) Source(1, 14) + SourceIndex(0) +--- +>>> function Greeter(greeting, b) { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +1-> { + > +2 > +3 > Greeter +4 > { + > constructor(public +5 > greeting: string +6 > , ... +7 > b: string[] +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(2, 21) Source(1, 14) + SourceIndex(0) name (Greeter) +4 >Emitted(2, 22) Source(2, 24) + SourceIndex(0) name (Greeter) +5 >Emitted(2, 30) Source(2, 40) + SourceIndex(0) name (Greeter) +6 >Emitted(2, 32) Source(2, 45) + SourceIndex(0) name (Greeter) +7 >Emitted(2, 33) Source(2, 56) + SourceIndex(0) name (Greeter) +--- +>>> var b = []; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > ...b: string[] +1 >Emitted(3, 9) Source(2, 42) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(3, 20) Source(2, 56) + SourceIndex(0) name (Greeter.constructor) +--- +>>> for (var _i = 1; _i < arguments.length; _i++) { +1->^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^ +1-> +2 > ...b: string[] +3 > +4 > ...b: string[] +5 > +6 > ...b: string[] +1->Emitted(4, 14) Source(2, 42) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(4, 25) Source(2, 56) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(4, 26) Source(2, 42) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(4, 48) Source(2, 56) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(4, 49) Source(2, 42) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(4, 53) Source(2, 56) + SourceIndex(0) name (Greeter.constructor) +--- +>>> b[_i - 1] = arguments[_i]; +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...b: string[] +1 >Emitted(5, 13) Source(2, 42) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(5, 39) Source(2, 56) + SourceIndex(0) name (Greeter.constructor) +--- +>>> } +>>> this.greeting = greeting; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^ +5 > ^ +1 > +2 > greeting +3 > +4 > greeting +5 > : string +1 >Emitted(7, 9) Source(2, 24) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(7, 22) Source(2, 32) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(7, 25) Source(2, 24) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(7, 33) Source(2, 32) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(7, 34) Source(2, 40) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.x1 = 10; +1 >^^^^^^^^ +2 > ^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +1 >, ...b: string[]) { + > } + > greet() { + > return "

" + this.greeting + "

"; + > } + > private x: string; + > private +2 > x1 +3 > : number = +4 > 10 +5 > ; +1 >Emitted(8, 9) Source(8, 13) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(8, 16) Source(8, 15) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(8, 19) Source(8, 26) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(8, 21) Source(8, 28) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(8, 22) Source(8, 29) + SourceIndex(0) name (Greeter.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +1 >Emitted(9, 5) Source(3, 5) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(9, 6) Source(3, 6) + SourceIndex(0) name (Greeter.constructor) +--- +>>> Greeter.prototype.greet = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > greet +3 > +1->Emitted(10, 5) Source(4, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(10, 28) Source(4, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(10, 31) Source(4, 5) + SourceIndex(0) name (Greeter) +--- +>>> return "

" + this.greeting + "

"; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^^^ +6 > ^^^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^^ +10> ^^^^^^^ +11> ^ +1->greet() { + > +2 > return +3 > +4 > "

" +5 > + +6 > this +7 > . +8 > greeting +9 > + +10> "

" +11> ; +1->Emitted(11, 9) Source(5, 9) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(11, 15) Source(5, 15) + SourceIndex(0) name (Greeter.greet) +3 >Emitted(11, 16) Source(5, 16) + SourceIndex(0) name (Greeter.greet) +4 >Emitted(11, 22) Source(5, 22) + SourceIndex(0) name (Greeter.greet) +5 >Emitted(11, 25) Source(5, 25) + SourceIndex(0) name (Greeter.greet) +6 >Emitted(11, 29) Source(5, 29) + SourceIndex(0) name (Greeter.greet) +7 >Emitted(11, 30) Source(5, 30) + SourceIndex(0) name (Greeter.greet) +8 >Emitted(11, 38) Source(5, 38) + SourceIndex(0) name (Greeter.greet) +9 >Emitted(11, 41) Source(5, 41) + SourceIndex(0) name (Greeter.greet) +10>Emitted(11, 48) Source(5, 48) + SourceIndex(0) name (Greeter.greet) +11>Emitted(11, 49) Source(5, 49) + SourceIndex(0) name (Greeter.greet) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(12, 5) Source(6, 5) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(12, 6) Source(6, 6) + SourceIndex(0) name (Greeter.greet) +--- +>>> Greeter.prototype.fn = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^-> +1-> + > private x: string; + > private x1: number = 10; + > private +2 > fn +3 > +1->Emitted(13, 5) Source(9, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(13, 25) Source(9, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(13, 28) Source(9, 5) + SourceIndex(0) name (Greeter) +--- +>>> return this.greeting; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +1->private fn() { + > +2 > return +3 > +4 > this +5 > . +6 > greeting +7 > ; +1->Emitted(14, 9) Source(10, 9) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(14, 15) Source(10, 15) + SourceIndex(0) name (Greeter.fn) +3 >Emitted(14, 16) Source(10, 16) + SourceIndex(0) name (Greeter.fn) +4 >Emitted(14, 20) Source(10, 20) + SourceIndex(0) name (Greeter.fn) +5 >Emitted(14, 21) Source(10, 21) + SourceIndex(0) name (Greeter.fn) +6 >Emitted(14, 29) Source(10, 29) + SourceIndex(0) name (Greeter.fn) +7 >Emitted(14, 30) Source(10, 30) + SourceIndex(0) name (Greeter.fn) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(15, 5) Source(11, 5) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(15, 6) Source(11, 6) + SourceIndex(0) name (Greeter.fn) +--- +>>> Object.defineProperty(Greeter.prototype, "greetings", { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> + > +2 > get +3 > greetings +1->Emitted(16, 5) Source(12, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(16, 27) Source(12, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(16, 57) Source(12, 18) + SourceIndex(0) name (Greeter) +--- +>>> get: function () { +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(17, 14) Source(12, 5) + SourceIndex(0) name (Greeter) +--- +>>> return this.greeting; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +1->get greetings() { + > +2 > return +3 > +4 > this +5 > . +6 > greeting +7 > ; +1->Emitted(18, 13) Source(13, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(18, 19) Source(13, 15) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(18, 20) Source(13, 16) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(18, 24) Source(13, 20) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(18, 25) Source(13, 21) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(18, 33) Source(13, 29) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(18, 34) Source(13, 30) + SourceIndex(0) name (Greeter.greetings) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(19, 9) Source(14, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(19, 10) Source(14, 6) + SourceIndex(0) name (Greeter.greetings) +--- +>>> set: function (greetings) { +1->^^^^^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^^^^^^^ +4 > ^^^^^^^-> +1-> + > +2 > set greetings( +3 > greetings: string +1->Emitted(20, 14) Source(15, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(20, 24) Source(15, 19) + SourceIndex(0) name (Greeter) +3 >Emitted(20, 33) Source(15, 36) + SourceIndex(0) name (Greeter) +--- +>>> this.greeting = greetings; +1->^^^^^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^ +5 > ^^^ +6 > ^^^^^^^^^ +7 > ^ +1->) { + > +2 > this +3 > . +4 > greeting +5 > = +6 > greetings +7 > ; +1->Emitted(21, 13) Source(16, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(21, 17) Source(16, 13) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(21, 18) Source(16, 14) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(21, 26) Source(16, 22) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(21, 29) Source(16, 25) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(21, 38) Source(16, 34) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(21, 39) Source(16, 35) + SourceIndex(0) name (Greeter.greetings) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(22, 9) Source(17, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(22, 10) Source(17, 6) + SourceIndex(0) name (Greeter.greetings) +--- +>>> enumerable: true, +>>> configurable: true +>>> }); +1->^^^^^^^ +2 > ^^^^^^^^^^^^^-> +1-> +1->Emitted(25, 8) Source(14, 6) + SourceIndex(0) name (Greeter) +--- +>>> return Greeter; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +1-> + > set greetings(greetings: string) { + > this.greeting = greetings; + > } + > +2 > } +1->Emitted(26, 5) Source(18, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(26, 19) Source(18, 2) + SourceIndex(0) name (Greeter) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class Greeter { + > constructor(public greeting: string, ...b: string[]) { + > } + > greet() { + > return "

" + this.greeting + "

"; + > } + > private x: string; + > private x1: number = 10; + > private fn() { + > return this.greeting; + > } + > get greetings() { + > return this.greeting; + > } + > set greetings(greetings: string) { + > this.greeting = greetings; + > } + > } +1 >Emitted(27, 1) Source(18, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(27, 2) Source(18, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(27, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(27, 6) Source(18, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationClass.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js new file mode 100644 index 0000000000000..149780baf087d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js @@ -0,0 +1,15 @@ +//// [sourceMapValidationClassWithDefaultConstructor.ts] +class Greeter { + public a = 10; + public nameA = "Ten"; +} + +//// [sourceMapValidationClassWithDefaultConstructor.js] +var Greeter = (function () { + function Greeter() { + this.a = 10; + this.nameA = "Ten"; + } + return Greeter; +})(); +//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructor.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js.map new file mode 100644 index 0000000000000..0ed561de56337 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationClassWithDefaultConstructor.js.map] +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructor.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructor.ts"],"names":["Greeter","Greeter.constructor"],"mappings":"AAAA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;QACFC,MAACA,GAAGA,EAAEA,CAACA;QACPA,UAAKA,GAAGA,KAAKA,CAACA;IACzBA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,IAGC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt new file mode 100644 index 0000000000000..57f9686f0629c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.sourcemap.txt @@ -0,0 +1,108 @@ +=================================================================== +JsFile: sourceMapValidationClassWithDefaultConstructor.js +mapUrl: sourceMapValidationClassWithDefaultConstructor.js.map +sourceRoot: +sources: sourceMapValidationClassWithDefaultConstructor.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructor.js +sourceFile:sourceMapValidationClassWithDefaultConstructor.ts +------------------------------------------------------------------- +>>>var Greeter = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 >class +3 > Greeter +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 12) Source(1, 14) + SourceIndex(0) +--- +>>> function Greeter() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^-> +1-> +2 > class +3 > Greeter +1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(2, 21) Source(1, 14) + SourceIndex(0) name (Greeter) +--- +>>> this.a = 10; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1-> { + > public +2 > a +3 > = +4 > 10 +5 > ; +1->Emitted(3, 9) Source(2, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(3, 15) Source(2, 13) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(3, 18) Source(2, 16) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(3, 20) Source(2, 18) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(3, 21) Source(2, 19) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.nameA = "Ten"; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> + > public +2 > nameA +3 > = +4 > "Ten" +5 > ; +1->Emitted(4, 9) Source(3, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(4, 19) Source(3, 17) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(4, 22) Source(3, 20) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(4, 27) Source(3, 25) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(4, 28) Source(3, 26) + SourceIndex(0) name (Greeter.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) name (Greeter.constructor) +--- +>>> return Greeter; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(6, 19) Source(4, 2) + SourceIndex(0) name (Greeter) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class Greeter { + > public a = 10; + > public nameA = "Ten"; + > } +1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(7, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructor.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js new file mode 100644 index 0000000000000..486cdd3963747 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js @@ -0,0 +1,16 @@ +//// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts] +class Greeter { + public a = 10; + public returnA = () => this.a; +} + +//// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js] +var Greeter = (function () { + function Greeter() { + var _this = this; + this.a = 10; + this.returnA = function () { return _this.a; }; + } + return Greeter; +})(); +//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map new file mode 100644 index 0000000000000..c06771070a812 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map] +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts"],"names":["Greeter","Greeter.constructor"],"mappings":"AAAA,IAAM,OAAO;IAAbA,SAAMA,OAAOA;QAAbC,iBAGCA;QAFUA,MAACA,GAAGA,EAAEA,CAACA;QACPA,YAAOA,GAAGA,cAAMA,OAAAA,KAAIA,CAACA,CAACA,EAANA,CAAMA,CAACA;IAClCA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,IAGC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt new file mode 100644 index 0000000000000..82a592e4bd2fa --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.sourcemap.txt @@ -0,0 +1,136 @@ +=================================================================== +JsFile: sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js +mapUrl: sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map +sourceRoot: +sources: sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js +sourceFile:sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.ts +------------------------------------------------------------------- +>>>var Greeter = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 >class +3 > Greeter +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 12) Source(1, 14) + SourceIndex(0) +--- +>>> function Greeter() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^-> +1-> +2 > class +3 > Greeter +1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(2, 21) Source(1, 14) + SourceIndex(0) name (Greeter) +--- +>>> var _this = this; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^ +1-> +2 > class Greeter { + > public a = 10; + > public returnA = () => this.a; + > } +1->Emitted(3, 9) Source(1, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(3, 26) Source(4, 2) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.a = 10; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > a +3 > = +4 > 10 +5 > ; +1 >Emitted(4, 9) Source(2, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(4, 15) Source(2, 13) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(4, 18) Source(2, 16) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(4, 20) Source(2, 18) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(4, 21) Source(2, 19) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.returnA = function () { return _this.a; }; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^^^^^^ +6 > ^^^^^ +7 > ^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +1-> + > public +2 > returnA +3 > = +4 > () => +5 > +6 > this +7 > . +8 > a +9 > +10> this.a +11> ; +1->Emitted(5, 9) Source(3, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(5, 21) Source(3, 19) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(5, 24) Source(3, 22) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(5, 38) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(5, 45) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(5, 50) Source(3, 32) + SourceIndex(0) name (Greeter.constructor) +7 >Emitted(5, 51) Source(3, 33) + SourceIndex(0) name (Greeter.constructor) +8 >Emitted(5, 52) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) +9 >Emitted(5, 54) Source(3, 28) + SourceIndex(0) name (Greeter.constructor) +10>Emitted(5, 55) Source(3, 34) + SourceIndex(0) name (Greeter.constructor) +11>Emitted(5, 56) Source(3, 35) + SourceIndex(0) name (Greeter.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(4, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) name (Greeter.constructor) +--- +>>> return Greeter; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(7, 5) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(7, 19) Source(4, 2) + SourceIndex(0) name (Greeter) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class Greeter { + > public a = 10; + > public returnA = () => this.a; + > } +1 >Emitted(8, 1) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(8, 2) Source(4, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(8, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js new file mode 100644 index 0000000000000..94d91cc03cb0e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -0,0 +1,31 @@ +//// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts] +class AbstractGreeter { +} + +class Greeter extends AbstractGreeter { + public a = 10; + public nameA = "Ten"; +} + +//// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AbstractGreeter = (function () { + function AbstractGreeter() { + } + return AbstractGreeter; +})(); +var Greeter = (function (_super) { + __extends(Greeter, _super); + function Greeter() { + _super.apply(this, arguments); + this.a = 10; + this.nameA = "Ten"; + } + return Greeter; +})(AbstractGreeter); +//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map new file mode 100644 index 0000000000000..d379fa629cad0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map] +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":["AbstractGreeter","AbstractGreeter.constructor","Greeter","Greeter.constructor"],"mappings":";;;;;;AAAA,IAAM,eAAe;IAArBA,SAAMA,eAAeA;IACrBC,CAACA;IAADD,sBAACA;AAADA,CAACA,AADD,IACC;AAED,IAAM,OAAO;IAASE,UAAhBA,OAAOA,UAAwBA;IAArCA,SAAMA,OAAOA;QAASC,8BAAeA;QAC1BA,MAACA,GAAGA,EAAEA,CAACA;QACPA,UAAKA,GAAGA,KAAKA,CAACA;IACzBA,CAACA;IAADD,cAACA;AAADA,CAACA,AAHD,EAAsB,eAAe,EAGpC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt new file mode 100644 index 0000000000000..010ad8ea1e1a7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -0,0 +1,202 @@ +=================================================================== +JsFile: sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +mapUrl: sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map +sourceRoot: +sources: sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts +------------------------------------------------------------------- +>>>var __extends = this.__extends || function (d, b) { +>>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; +>>> function __() { this.constructor = d; } +>>> __.prototype = b.prototype; +>>> d.prototype = new __(); +>>>}; +>>>var AbstractGreeter = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 >class +3 > AbstractGreeter +1 >Emitted(7, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(7, 20) Source(1, 22) + SourceIndex(0) +--- +>>> function AbstractGreeter() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^ +1-> +2 > class +3 > AbstractGreeter +1->Emitted(8, 5) Source(1, 1) + SourceIndex(0) name (AbstractGreeter) +2 >Emitted(8, 14) Source(1, 7) + SourceIndex(0) name (AbstractGreeter) +3 >Emitted(8, 29) Source(1, 22) + SourceIndex(0) name (AbstractGreeter) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { + > +2 > } +1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter.constructor) +2 >Emitted(9, 6) Source(2, 2) + SourceIndex(0) name (AbstractGreeter.constructor) +--- +>>> return AbstractGreeter; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > } +1->Emitted(10, 5) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) +2 >Emitted(10, 27) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class AbstractGreeter { + > } +1 >Emitted(11, 1) Source(2, 1) + SourceIndex(0) name (AbstractGreeter) +2 >Emitted(11, 2) Source(2, 2) + SourceIndex(0) name (AbstractGreeter) +3 >Emitted(11, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(11, 6) Source(2, 2) + SourceIndex(0) +--- +>>>var Greeter = (function (_super) { +1-> +2 >^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >class +3 > Greeter +1->Emitted(12, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(12, 12) Source(4, 14) + SourceIndex(0) +--- +>>> __extends(Greeter, _super); +1->^^^^ +2 > ^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^ +1-> extends +2 > +3 > Greeter +4 > extends AbstractGreeter +1->Emitted(13, 5) Source(4, 23) + SourceIndex(0) name (Greeter) +2 >Emitted(13, 15) Source(4, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(13, 22) Source(4, 14) + SourceIndex(0) name (Greeter) +4 >Emitted(13, 32) Source(4, 38) + SourceIndex(0) name (Greeter) +--- +>>> function Greeter() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1 > +2 > class +3 > Greeter +1 >Emitted(14, 5) Source(4, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(14, 14) Source(4, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(14, 21) Source(4, 14) + SourceIndex(0) name (Greeter) +--- +>>> _super.apply(this, arguments); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> extends +2 > AbstractGreeter +1->Emitted(15, 9) Source(4, 23) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(15, 39) Source(4, 38) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.a = 10; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1 > { + > public +2 > a +3 > = +4 > 10 +5 > ; +1 >Emitted(16, 9) Source(5, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(16, 15) Source(5, 13) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(16, 18) Source(5, 16) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(16, 20) Source(5, 18) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(16, 21) Source(5, 19) + SourceIndex(0) name (Greeter.constructor) +--- +>>> this.nameA = "Ten"; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^ +5 > ^ +1-> + > public +2 > nameA +3 > = +4 > "Ten" +5 > ; +1->Emitted(17, 9) Source(6, 12) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(17, 19) Source(6, 17) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(17, 22) Source(6, 20) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(17, 27) Source(6, 25) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(17, 28) Source(6, 26) + SourceIndex(0) name (Greeter.constructor) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(18, 5) Source(7, 1) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(18, 6) Source(7, 2) + SourceIndex(0) name (Greeter.constructor) +--- +>>> return Greeter; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > } +1->Emitted(19, 5) Source(7, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(19, 19) Source(7, 2) + SourceIndex(0) name (Greeter) +--- +>>>})(AbstractGreeter); +1-> +2 >^ +3 > +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >} +3 > +4 > class Greeter extends +5 > AbstractGreeter +6 > { + > public a = 10; + > public nameA = "Ten"; + > } +1->Emitted(20, 1) Source(7, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(20, 2) Source(7, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(20, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(20, 4) Source(4, 23) + SourceIndex(0) +5 >Emitted(20, 19) Source(4, 38) + SourceIndex(0) +6 >Emitted(20, 21) Source(7, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.js b/tests/baselines/reference/sourceMapValidationClasses.js new file mode 100644 index 0000000000000..ce8635c26ab74 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClasses.js @@ -0,0 +1,77 @@ +//// [sourceMapValidationClasses.ts] +module Foo.Bar { + "use strict"; + + class Greeter { + constructor(public greeting: string) { + } + + greet() { + return "

" + this.greeting + "

"; + } + } + + + function foo(greeting: string): Greeter { + return new Greeter(greeting); + } + + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + + function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + var greeters: Greeter[] = []; /* inline block comment */ + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + + return greeters; + } + + var b = foo2("Hello", "World", "!"); + // This is simple signle line comment + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } +} + +//// [sourceMapValidationClasses.js] +var Foo; +(function (Foo) { + (function (Bar) { + "use strict"; + var Greeter = (function () { + function Greeter(greeting) { + this.greeting = greeting; + } + Greeter.prototype.greet = function () { + return "

" + this.greeting + "

"; + }; + return Greeter; + })(); + function foo(greeting) { + return new Greeter(greeting); + } + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + function foo2(greeting) { + var restGreetings = []; + for (var _i = 1; _i < arguments.length; _i++) { + restGreetings[_i - 1] = arguments[_i]; + } + var greeters = []; + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + return greeters; + } + var b = foo2("Hello", "World", "!"); + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } + })(Foo.Bar || (Foo.Bar = {})); + var Bar = Foo.Bar; +})(Foo || (Foo = {})); +//# sourceMappingURL=sourceMapValidationClasses.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map new file mode 100644 index 0000000000000..c43b1d9ff22e2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationClasses.js.map] +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAACA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA,IAAMA,OAAOA;YACTC,SADEA,OAAOA,CACUA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,SAASA,GAAGA,CAACA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,SAASA,IAAIA,CAACA,QAAgBA;YAAEK,uBAA8CA;iBAA9CA,WAA8CA,CAA9CA,sBAA8CA,CAA9CA,IAA8CA;gBAA9CA,sCAA8CA;;YAC1EA,IAAIA,QAAQA,GAAcA,EAAEA,CAACA;YAC7BA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QAEpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAnCUD,OAAGA,KAAHA,OAAGA,QAmCbA;IAnCUA,IAAAA,GAAGA,GAAHA,OAmCVA,CAAAA;AAADA,CAACA,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt new file mode 100644 index 0000000000000..3b64907b01298 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -0,0 +1,974 @@ +=================================================================== +JsFile: sourceMapValidationClasses.js +mapUrl: sourceMapValidationClasses.js.map +sourceRoot: +sources: sourceMapValidationClasses.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationClasses.js +sourceFile:sourceMapValidationClasses.ts +------------------------------------------------------------------- +>>>var Foo; +1 > +2 >^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > Foo +4 > .Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 8) Source(1, 11) + SourceIndex(0) +4 >Emitted(1, 9) Source(36, 2) + SourceIndex(0) +--- +>>>(function (Foo) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^-> +1-> +2 >module +3 > Foo +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0) +3 >Emitted(2, 15) Source(1, 11) + SourceIndex(0) +--- +>>> (function (Bar) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^-> +1->. +2 > +3 > Bar +4 > +5 > { +1->Emitted(3, 5) Source(1, 12) + SourceIndex(0) name (Foo) +2 >Emitted(3, 16) Source(1, 12) + SourceIndex(0) name (Foo) +3 >Emitted(3, 19) Source(1, 15) + SourceIndex(0) name (Foo) +4 >Emitted(3, 21) Source(1, 16) + SourceIndex(0) name (Foo) +5 >Emitted(3, 22) Source(1, 17) + SourceIndex(0) name (Foo) +--- +>>> "use strict"; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 > "use strict" +3 > ; +1->Emitted(4, 9) Source(2, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(4, 21) Source(2, 17) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(4, 22) Source(2, 18) + SourceIndex(0) name (Foo.Bar) +--- +>>> var Greeter = (function () { +1->^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > class +3 > Greeter +1->Emitted(5, 9) Source(4, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(5, 13) Source(4, 11) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(5, 20) Source(4, 18) + SourceIndex(0) name (Foo.Bar) +--- +>>> function Greeter(greeting) { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^-> +1-> { + > +2 > +3 > Greeter +4 > { + > constructor(public +5 > greeting: string +1->Emitted(6, 13) Source(5, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(6, 22) Source(4, 11) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(6, 29) Source(4, 18) + SourceIndex(0) name (Foo.Bar.Greeter) +4 >Emitted(6, 30) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter) +5 >Emitted(6, 38) Source(5, 44) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> this.greeting = greeting; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^ +5 > ^ +1-> +2 > greeting +3 > +4 > greeting +5 > : string +1->Emitted(7, 17) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +2 >Emitted(7, 30) Source(5, 36) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +3 >Emitted(7, 33) Source(5, 28) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +4 >Emitted(7, 41) Source(5, 36) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +5 >Emitted(7, 42) Source(5, 44) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { + > +2 > } +1 >Emitted(8, 13) Source(6, 9) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +2 >Emitted(8, 14) Source(6, 10) + SourceIndex(0) name (Foo.Bar.Greeter.constructor) +--- +>>> Greeter.prototype.greet = function () { +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 > greet +3 > +1->Emitted(9, 13) Source(8, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(9, 36) Source(8, 14) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(9, 39) Source(8, 9) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> return "

" + this.greeting + "

"; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^^^ +6 > ^^^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^^ +10> ^^^^^^^ +11> ^ +1->greet() { + > +2 > return +3 > +4 > "

" +5 > + +6 > this +7 > . +8 > greeting +9 > + +10> "

" +11> ; +1->Emitted(10, 17) Source(9, 13) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +2 >Emitted(10, 23) Source(9, 19) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +3 >Emitted(10, 24) Source(9, 20) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +4 >Emitted(10, 30) Source(9, 26) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +5 >Emitted(10, 33) Source(9, 29) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +6 >Emitted(10, 37) Source(9, 33) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +7 >Emitted(10, 38) Source(9, 34) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +8 >Emitted(10, 46) Source(9, 42) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +9 >Emitted(10, 49) Source(9, 45) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +10>Emitted(10, 56) Source(9, 52) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +11>Emitted(10, 57) Source(9, 53) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +--- +>>> }; +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(11, 13) Source(10, 9) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +2 >Emitted(11, 14) Source(10, 10) + SourceIndex(0) name (Foo.Bar.Greeter.greet) +--- +>>> return Greeter; +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(12, 13) Source(11, 5) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(12, 27) Source(11, 6) + SourceIndex(0) name (Foo.Bar.Greeter) +--- +>>> })(); +1 >^^^^^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^-> +1 > +2 > } +3 > +4 > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } +1 >Emitted(13, 9) Source(11, 5) + SourceIndex(0) name (Foo.Bar.Greeter) +2 >Emitted(13, 10) Source(11, 6) + SourceIndex(0) name (Foo.Bar.Greeter) +3 >Emitted(13, 10) Source(4, 5) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(13, 14) Source(11, 6) + SourceIndex(0) name (Foo.Bar) +--- +>>> function foo(greeting) { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^^^^^^^^^-> +1-> + > + > + > +2 > function +3 > foo +4 > ( +5 > greeting: string +1->Emitted(14, 9) Source(14, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(14, 18) Source(14, 14) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(14, 21) Source(14, 17) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(14, 22) Source(14, 18) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(14, 30) Source(14, 34) + SourceIndex(0) name (Foo.Bar) +--- +>>> return new Greeter(greeting); +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^ +9 > ^ +1->): Greeter { + > +2 > return +3 > +4 > new +5 > Greeter +6 > ( +7 > greeting +8 > ) +9 > ; +1->Emitted(15, 13) Source(15, 9) + SourceIndex(0) name (Foo.Bar.foo) +2 >Emitted(15, 19) Source(15, 15) + SourceIndex(0) name (Foo.Bar.foo) +3 >Emitted(15, 20) Source(15, 16) + SourceIndex(0) name (Foo.Bar.foo) +4 >Emitted(15, 24) Source(15, 20) + SourceIndex(0) name (Foo.Bar.foo) +5 >Emitted(15, 31) Source(15, 27) + SourceIndex(0) name (Foo.Bar.foo) +6 >Emitted(15, 32) Source(15, 28) + SourceIndex(0) name (Foo.Bar.foo) +7 >Emitted(15, 40) Source(15, 36) + SourceIndex(0) name (Foo.Bar.foo) +8 >Emitted(15, 41) Source(15, 37) + SourceIndex(0) name (Foo.Bar.foo) +9 >Emitted(15, 42) Source(15, 38) + SourceIndex(0) name (Foo.Bar.foo) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(16, 9) Source(16, 5) + SourceIndex(0) name (Foo.Bar.foo) +2 >Emitted(16, 10) Source(16, 6) + SourceIndex(0) name (Foo.Bar.foo) +--- +>>> var greeter = new Greeter("Hello, world!"); +1->^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^ +9 > ^ +10> ^ +1-> + > + > +2 > var +3 > greeter +4 > = +5 > new +6 > Greeter +7 > ( +8 > "Hello, world!" +9 > ) +10> ; +1->Emitted(17, 9) Source(18, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(17, 13) Source(18, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(17, 20) Source(18, 16) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(17, 23) Source(18, 19) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(17, 27) Source(18, 23) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(17, 34) Source(18, 30) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(17, 35) Source(18, 31) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(17, 50) Source(18, 46) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(17, 51) Source(18, 47) + SourceIndex(0) name (Foo.Bar) +10>Emitted(17, 52) Source(18, 48) + SourceIndex(0) name (Foo.Bar) +--- +>>> var str = greeter.greet(); +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^ +8 > ^^ +9 > ^ +1 > + > +2 > var +3 > str +4 > = +5 > greeter +6 > . +7 > greet +8 > () +9 > ; +1 >Emitted(18, 9) Source(19, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(18, 13) Source(19, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(18, 16) Source(19, 12) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(18, 19) Source(19, 15) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(18, 26) Source(19, 22) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(18, 27) Source(19, 23) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(18, 32) Source(19, 28) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(18, 34) Source(19, 30) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(18, 35) Source(19, 31) + SourceIndex(0) name (Foo.Bar) +--- +>>> function foo2(greeting) { +1 >^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^^^^^-> +1 > + > + > +2 > function +3 > foo2 +4 > ( +5 > greeting: string +1 >Emitted(19, 9) Source(21, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(19, 18) Source(21, 14) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(19, 22) Source(21, 18) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(19, 23) Source(21, 19) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(19, 31) Source(21, 35) + SourceIndex(0) name (Foo.Bar) +--- +>>> var restGreetings = []; +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, +2 > ...restGreetings /* more greeting */: string[] +1->Emitted(20, 13) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(20, 36) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> for (var _i = 1; _i < arguments.length; _i++) { +1->^^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^ +1-> +2 > ...restGreetings /* more greeting */: string[] +3 > +4 > ...restGreetings /* more greeting */: string[] +5 > +6 > ...restGreetings /* more greeting */: string[] +1->Emitted(21, 18) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(21, 29) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(21, 30) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(21, 52) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(21, 53) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(21, 57) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> restGreetings[_i - 1] = arguments[_i]; +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...restGreetings /* more greeting */: string[] +1 >Emitted(22, 17) Source(21, 37) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(22, 55) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +>>> var greeters = []; +1 >^^^^^^^^^^^^ +2 > ^^^^ +3 > ^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^-> +1 >) { + > +2 > var +3 > greeters +4 > : Greeter[] = +5 > [] +6 > ; +1 >Emitted(24, 13) Source(22, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(24, 17) Source(22, 13) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(24, 25) Source(22, 21) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(24, 28) Source(22, 35) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(24, 30) Source(22, 37) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(24, 31) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> greeters[0] = new Greeter(greeting); +1->^^^^^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^^^^ +8 > ^^^^^^^ +9 > ^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^-> +1-> /* inline block comment */ + > +2 > greeters +3 > [ +4 > 0 +5 > ] +6 > = +7 > new +8 > Greeter +9 > ( +10> greeting +11> ) +12> ; +1->Emitted(25, 13) Source(23, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(25, 21) Source(23, 17) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(25, 22) Source(23, 18) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(25, 23) Source(23, 19) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(25, 24) Source(23, 20) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(25, 27) Source(23, 23) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(25, 31) Source(23, 27) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(25, 38) Source(23, 34) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(25, 39) Source(23, 35) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(25, 47) Source(23, 43) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(25, 48) Source(23, 44) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(25, 49) Source(23, 45) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> for (var i = 0; i < restGreetings.length; i++) { +1->^^^^^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^^^^^^^^^^^^ +14> ^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +21> ^^-> +1-> + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> restGreetings +14> . +15> length +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(26, 13) Source(24, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(26, 16) Source(24, 12) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(26, 17) Source(24, 13) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(26, 18) Source(24, 14) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(26, 21) Source(24, 17) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(26, 22) Source(24, 18) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(26, 23) Source(24, 19) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(26, 26) Source(24, 22) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(26, 27) Source(24, 23) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(26, 29) Source(24, 25) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(26, 30) Source(24, 26) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(26, 33) Source(24, 29) + SourceIndex(0) name (Foo.Bar.foo2) +13>Emitted(26, 46) Source(24, 42) + SourceIndex(0) name (Foo.Bar.foo2) +14>Emitted(26, 47) Source(24, 43) + SourceIndex(0) name (Foo.Bar.foo2) +15>Emitted(26, 53) Source(24, 49) + SourceIndex(0) name (Foo.Bar.foo2) +16>Emitted(26, 55) Source(24, 51) + SourceIndex(0) name (Foo.Bar.foo2) +17>Emitted(26, 56) Source(24, 52) + SourceIndex(0) name (Foo.Bar.foo2) +18>Emitted(26, 58) Source(24, 54) + SourceIndex(0) name (Foo.Bar.foo2) +19>Emitted(26, 60) Source(24, 56) + SourceIndex(0) name (Foo.Bar.foo2) +20>Emitted(26, 61) Source(24, 57) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> greeters.push(new Greeter(restGreetings[i])); +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^ +7 > ^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +1-> + > +2 > greeters +3 > . +4 > push +5 > ( +6 > new +7 > Greeter +8 > ( +9 > restGreetings +10> [ +11> i +12> ] +13> ) +14> ) +15> ; +1->Emitted(27, 17) Source(25, 13) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(27, 25) Source(25, 21) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(27, 26) Source(25, 22) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(27, 30) Source(25, 26) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(27, 31) Source(25, 27) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(27, 35) Source(25, 31) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(27, 42) Source(25, 38) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(27, 43) Source(25, 39) + SourceIndex(0) name (Foo.Bar.foo2) +9 >Emitted(27, 56) Source(25, 52) + SourceIndex(0) name (Foo.Bar.foo2) +10>Emitted(27, 57) Source(25, 53) + SourceIndex(0) name (Foo.Bar.foo2) +11>Emitted(27, 58) Source(25, 54) + SourceIndex(0) name (Foo.Bar.foo2) +12>Emitted(27, 59) Source(25, 55) + SourceIndex(0) name (Foo.Bar.foo2) +13>Emitted(27, 60) Source(25, 56) + SourceIndex(0) name (Foo.Bar.foo2) +14>Emitted(27, 61) Source(25, 57) + SourceIndex(0) name (Foo.Bar.foo2) +15>Emitted(27, 62) Source(25, 58) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(28, 13) Source(26, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(28, 14) Source(26, 10) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> return greeters; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^ +5 > ^ +1-> + > + > +2 > return +3 > +4 > greeters +5 > ; +1->Emitted(29, 13) Source(28, 9) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(29, 19) Source(28, 15) + SourceIndex(0) name (Foo.Bar.foo2) +3 >Emitted(29, 20) Source(28, 16) + SourceIndex(0) name (Foo.Bar.foo2) +4 >Emitted(29, 28) Source(28, 24) + SourceIndex(0) name (Foo.Bar.foo2) +5 >Emitted(29, 29) Source(28, 25) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(30, 9) Source(29, 5) + SourceIndex(0) name (Foo.Bar.foo2) +2 >Emitted(30, 10) Source(29, 6) + SourceIndex(0) name (Foo.Bar.foo2) +--- +>>> var b = foo2("Hello", "World", "!"); +1->^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^ +12> ^ +13> ^ +14> ^-> +1-> + > + > +2 > var +3 > b +4 > = +5 > foo2 +6 > ( +7 > "Hello" +8 > , +9 > "World" +10> , +11> "!" +12> ) +13> ; +1->Emitted(31, 9) Source(31, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(31, 13) Source(31, 9) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(31, 14) Source(31, 10) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(31, 17) Source(31, 13) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(31, 21) Source(31, 17) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(31, 22) Source(31, 18) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(31, 29) Source(31, 25) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(31, 31) Source(31, 27) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(31, 38) Source(31, 34) + SourceIndex(0) name (Foo.Bar) +10>Emitted(31, 40) Source(31, 36) + SourceIndex(0) name (Foo.Bar) +11>Emitted(31, 43) Source(31, 39) + SourceIndex(0) name (Foo.Bar) +12>Emitted(31, 44) Source(31, 40) + SourceIndex(0) name (Foo.Bar) +13>Emitted(31, 45) Source(31, 41) + SourceIndex(0) name (Foo.Bar) +--- +>>> for (var j = 0; j < b.length; j++) { +1->^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > // This is simple signle line comment + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > j +8 > = +9 > 0 +10> ; +11> j +12> < +13> b +14> . +15> length +16> ; +17> j +18> ++ +19> ) +20> { +1->Emitted(32, 9) Source(33, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(32, 12) Source(33, 8) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(32, 13) Source(33, 9) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(32, 14) Source(33, 10) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(32, 17) Source(33, 13) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(32, 18) Source(33, 14) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(32, 19) Source(33, 15) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(32, 22) Source(33, 18) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(32, 23) Source(33, 19) + SourceIndex(0) name (Foo.Bar) +10>Emitted(32, 25) Source(33, 21) + SourceIndex(0) name (Foo.Bar) +11>Emitted(32, 26) Source(33, 22) + SourceIndex(0) name (Foo.Bar) +12>Emitted(32, 29) Source(33, 25) + SourceIndex(0) name (Foo.Bar) +13>Emitted(32, 30) Source(33, 26) + SourceIndex(0) name (Foo.Bar) +14>Emitted(32, 31) Source(33, 27) + SourceIndex(0) name (Foo.Bar) +15>Emitted(32, 37) Source(33, 33) + SourceIndex(0) name (Foo.Bar) +16>Emitted(32, 39) Source(33, 35) + SourceIndex(0) name (Foo.Bar) +17>Emitted(32, 40) Source(33, 36) + SourceIndex(0) name (Foo.Bar) +18>Emitted(32, 42) Source(33, 38) + SourceIndex(0) name (Foo.Bar) +19>Emitted(32, 44) Source(33, 40) + SourceIndex(0) name (Foo.Bar) +20>Emitted(32, 45) Source(33, 41) + SourceIndex(0) name (Foo.Bar) +--- +>>> b[j].greet(); +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^^^^^ +8 > ^^ +9 > ^ +1 > + > +2 > b +3 > [ +4 > j +5 > ] +6 > . +7 > greet +8 > () +9 > ; +1 >Emitted(33, 13) Source(34, 9) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(33, 14) Source(34, 10) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(33, 15) Source(34, 11) + SourceIndex(0) name (Foo.Bar) +4 >Emitted(33, 16) Source(34, 12) + SourceIndex(0) name (Foo.Bar) +5 >Emitted(33, 17) Source(34, 13) + SourceIndex(0) name (Foo.Bar) +6 >Emitted(33, 18) Source(34, 14) + SourceIndex(0) name (Foo.Bar) +7 >Emitted(33, 23) Source(34, 19) + SourceIndex(0) name (Foo.Bar) +8 >Emitted(33, 25) Source(34, 21) + SourceIndex(0) name (Foo.Bar) +9 >Emitted(33, 26) Source(34, 22) + SourceIndex(0) name (Foo.Bar) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(34, 9) Source(35, 5) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(34, 10) Source(35, 6) + SourceIndex(0) name (Foo.Bar) +--- +>>> })(Foo.Bar || (Foo.Bar = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^ +7 > ^^^^^^^^ +1-> + > +2 > } +3 > +4 > Bar +5 > +6 > Bar +7 > { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1->Emitted(35, 5) Source(36, 1) + SourceIndex(0) name (Foo.Bar) +2 >Emitted(35, 6) Source(36, 2) + SourceIndex(0) name (Foo.Bar) +3 >Emitted(35, 8) Source(1, 12) + SourceIndex(0) name (Foo) +4 >Emitted(35, 15) Source(1, 15) + SourceIndex(0) name (Foo) +5 >Emitted(35, 20) Source(1, 12) + SourceIndex(0) name (Foo) +6 >Emitted(35, 27) Source(1, 15) + SourceIndex(0) name (Foo) +7 >Emitted(35, 35) Source(36, 2) + SourceIndex(0) name (Foo) +--- +>>> var Bar = Foo.Bar; +1 >^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^-> +1 > +2 > +3 > Bar +4 > +5 > Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +6 > +1 >Emitted(36, 5) Source(1, 12) + SourceIndex(0) name (Foo) +2 >Emitted(36, 9) Source(1, 12) + SourceIndex(0) name (Foo) +3 >Emitted(36, 12) Source(1, 15) + SourceIndex(0) name (Foo) +4 >Emitted(36, 15) Source(1, 12) + SourceIndex(0) name (Foo) +5 >Emitted(36, 22) Source(36, 2) + SourceIndex(0) name (Foo) +6 >Emitted(36, 23) Source(36, 2) + SourceIndex(0) name (Foo) +--- +>>>})(Foo || (Foo = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^ +5 > ^^^^^ +6 > ^^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 >} +3 > +4 > Foo +5 > +6 > Foo +7 > .Bar { + > "use strict"; + > + > class Greeter { + > constructor(public greeting: string) { + > } + > + > greet() { + > return "

" + this.greeting + "

"; + > } + > } + > + > + > function foo(greeting: string): Greeter { + > return new Greeter(greeting); + > } + > + > var greeter = new Greeter("Hello, world!"); + > var str = greeter.greet(); + > + > function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + > var greeters: Greeter[] = []; /* inline block comment */ + > greeters[0] = new Greeter(greeting); + > for (var i = 0; i < restGreetings.length; i++) { + > greeters.push(new Greeter(restGreetings[i])); + > } + > + > return greeters; + > } + > + > var b = foo2("Hello", "World", "!"); + > // This is simple signle line comment + > for (var j = 0; j < b.length; j++) { + > b[j].greet(); + > } + > } +1->Emitted(37, 1) Source(36, 1) + SourceIndex(0) name (Foo) +2 >Emitted(37, 2) Source(36, 2) + SourceIndex(0) name (Foo) +3 >Emitted(37, 4) Source(1, 8) + SourceIndex(0) +4 >Emitted(37, 7) Source(1, 11) + SourceIndex(0) +5 >Emitted(37, 12) Source(1, 8) + SourceIndex(0) +6 >Emitted(37, 15) Source(1, 11) + SourceIndex(0) +7 >Emitted(37, 23) Source(36, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationClasses.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDebugger.js b/tests/baselines/reference/sourceMapValidationDebugger.js new file mode 100644 index 0000000000000..4dbacd5a1532b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDebugger.js @@ -0,0 +1,6 @@ +//// [sourceMapValidationDebugger.ts] +debugger; + +//// [sourceMapValidationDebugger.js] +debugger; +//# sourceMappingURL=sourceMapValidationDebugger.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDebugger.js.map b/tests/baselines/reference/sourceMapValidationDebugger.js.map new file mode 100644 index 0000000000000..24f4554ac984b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDebugger.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDebugger.js.map] +{"version":3,"file":"sourceMapValidationDebugger.js","sourceRoot":"","sources":["sourceMapValidationDebugger.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDebugger.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDebugger.sourcemap.txt new file mode 100644 index 0000000000000..4999b8b6b609a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDebugger.sourcemap.txt @@ -0,0 +1,23 @@ +=================================================================== +JsFile: sourceMapValidationDebugger.js +mapUrl: sourceMapValidationDebugger.js.map +sourceRoot: +sources: sourceMapValidationDebugger.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDebugger.js +sourceFile:sourceMapValidationDebugger.ts +------------------------------------------------------------------- +>>>debugger; +1 > +2 >^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >debugger +3 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDebugger.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDo.js b/tests/baselines/reference/sourceMapValidationDo.js new file mode 100644 index 0000000000000..60e30ec877504 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDo.js @@ -0,0 +1,19 @@ +//// [sourceMapValidationDo.ts] +var i = 0; +do +{ + i++; +} while (i < 10); +do { + i++; +} while (i < 20); + +//// [sourceMapValidationDo.js] +var i = 0; +do { + i++; +} while (i < 10); +do { + i++; +} while (i < 20); +//# sourceMappingURL=sourceMapValidationDo.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDo.js.map b/tests/baselines/reference/sourceMapValidationDo.js.map new file mode 100644 index 0000000000000..4bb53f54b04ee --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDo.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDo.js.map] +{"version":3,"file":"sourceMapValidationDo.js","sourceRoot":"","sources":["sourceMapValidationDo.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,GACA,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE;AACjB,GAAG,CAAC;IACA,CAAC,EAAE,CAAC;AACR,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt new file mode 100644 index 0000000000000..5ce87662c69f4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt @@ -0,0 +1,139 @@ +=================================================================== +JsFile: sourceMapValidationDo.js +mapUrl: sourceMapValidationDo.js.map +sourceRoot: +sources: sourceMapValidationDo.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDo.js +sourceFile:sourceMapValidationDo.ts +------------------------------------------------------------------- +>>>var i = 0; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +1 > +2 >var +3 > i +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +--- +>>>do { +1 > +2 >^^^ +3 > ^ +4 > ^^^^^-> +1 > + > +2 >do + > +3 > { +1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 4) Source(3, 1) + SourceIndex(0) +3 >Emitted(2, 5) Source(3, 2) + SourceIndex(0) +--- +>>> i++; +1->^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(3, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(3, 8) Source(4, 8) + SourceIndex(0) +4 >Emitted(3, 9) Source(4, 9) + SourceIndex(0) +--- +>>>} while (i < 10); +1-> +2 >^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^^ +1-> + > +2 >} +3 > while ( +4 > i +5 > < +6 > 10 +7 > ); +1->Emitted(4, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(5, 2) + SourceIndex(0) +3 >Emitted(4, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(4, 11) Source(5, 11) + SourceIndex(0) +5 >Emitted(4, 14) Source(5, 14) + SourceIndex(0) +6 >Emitted(4, 16) Source(5, 16) + SourceIndex(0) +7 >Emitted(4, 18) Source(5, 18) + SourceIndex(0) +--- +>>>do { +1 > +2 >^^^ +3 > ^ +4 > ^^^^^-> +1 > + > +2 >do +3 > { +1 >Emitted(5, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(5, 4) Source(6, 4) + SourceIndex(0) +3 >Emitted(5, 5) Source(6, 5) + SourceIndex(0) +--- +>>> i++; +1->^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(6, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(7, 6) + SourceIndex(0) +3 >Emitted(6, 8) Source(7, 8) + SourceIndex(0) +4 >Emitted(6, 9) Source(7, 9) + SourceIndex(0) +--- +>>>} while (i < 20); +1-> +2 >^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >} +3 > while ( +4 > i +5 > < +6 > 20 +7 > ); +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(8, 2) + SourceIndex(0) +3 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +5 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +6 >Emitted(7, 16) Source(8, 16) + SourceIndex(0) +7 >Emitted(7, 18) Source(8, 18) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDo.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationEnums.errors.txt b/tests/baselines/reference/sourceMapValidationEnums.errors.txt new file mode 100644 index 0000000000000..7df3e12c027e2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationEnums.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/compiler/sourceMapValidationEnums.ts (1 errors) ==== + enum e { + x, + y, + x + ~ +!!! Duplicate identifier 'x'. + } + enum e2 { + x = 10, + y = 10, + z, + x2 + } + enum e3 { + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationEnums.js b/tests/baselines/reference/sourceMapValidationEnums.js new file mode 100644 index 0000000000000..49027a4bad27c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationEnums.js @@ -0,0 +1,33 @@ +//// [sourceMapValidationEnums.ts] +enum e { + x, + y, + x +} +enum e2 { + x = 10, + y = 10, + z, + x2 +} +enum e3 { +} + +//// [sourceMapValidationEnums.js] +var e; +(function (e) { + e[e["x"] = 0] = "x"; + e[e["y"] = 1] = "y"; + e[e["x"] = 2] = "x"; +})(e || (e = {})); +var e2; +(function (e2) { + e2[e2["x"] = 10] = "x"; + e2[e2["y"] = 10] = "y"; + e2[e2["z"] = 11] = "z"; + e2[e2["x2"] = 12] = "x2"; +})(e2 || (e2 = {})); +var e3; +(function (e3) { +})(e3 || (e3 = {})); +//# sourceMappingURL=sourceMapValidationEnums.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationEnums.js.map b/tests/baselines/reference/sourceMapValidationEnums.js.map new file mode 100644 index 0000000000000..721e0a3b48bb4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationEnums.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationEnums.js.map] +{"version":3,"file":"sourceMapValidationEnums.js","sourceRoot":"","sources":["sourceMapValidationEnums.ts"],"names":["e","e2","e3"],"mappings":"AAAA,IAAK,CAIJ;AAJD,WAAK,CAAC;IACFA,mBAACA;IACDA,mBAACA;IACDA,mBAACA;AACLA,CAACA,EAJI,CAAC,KAAD,CAAC,QAIL;AACD,IAAK,EAKJ;AALD,WAAK,EAAE;IACHC,aAAIA,EAAEA,OAAAA;IACNA,aAAIA,EAAEA,OAAAA;IACNA,sBAACA;IACDA,wBAAEA;AACNA,CAACA,EALI,EAAE,KAAF,EAAE,QAKN;AACD,IAAK,EACJ;AADD,WAAK,EAAE;AACPC,CAACA,EADI,EAAE,KAAF,EAAE,QACN"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationEnums.sourcemap.txt b/tests/baselines/reference/sourceMapValidationEnums.sourcemap.txt new file mode 100644 index 0000000000000..18148fc281b38 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationEnums.sourcemap.txt @@ -0,0 +1,258 @@ +=================================================================== +JsFile: sourceMapValidationEnums.js +mapUrl: sourceMapValidationEnums.js.map +sourceRoot: +sources: sourceMapValidationEnums.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationEnums.js +sourceFile:sourceMapValidationEnums.ts +------------------------------------------------------------------- +>>>var e; +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^-> +1 > +2 >enum +3 > e { + > x, + > y, + > x + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) +3 >Emitted(1, 6) Source(5, 2) + SourceIndex(0) +--- +>>>(function (e) { +1-> +2 >^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^-> +1-> +2 >enum +3 > e +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 7) + SourceIndex(0) +--- +>>> e[e["x"] = 0] = "x"; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1-> { + > +2 > x +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) name (e) +2 >Emitted(3, 24) Source(2, 6) + SourceIndex(0) name (e) +--- +>>> e[e["y"] = 1] = "y"; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1->, + > +2 > y +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) name (e) +2 >Emitted(4, 24) Source(3, 6) + SourceIndex(0) name (e) +--- +>>> e[e["x"] = 2] = "x"; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +1->, + > +2 > x +1->Emitted(5, 5) Source(4, 5) + SourceIndex(0) name (e) +2 >Emitted(5, 24) Source(4, 6) + SourceIndex(0) name (e) +--- +>>>})(e || (e = {})); +1 > +2 >^ +3 > ^^ +4 > ^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^ +1 > + > +2 >} +3 > +4 > e +5 > +6 > e +7 > { + > x, + > y, + > x + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) name (e) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) name (e) +3 >Emitted(6, 4) Source(1, 6) + SourceIndex(0) +4 >Emitted(6, 5) Source(1, 7) + SourceIndex(0) +5 >Emitted(6, 10) Source(1, 6) + SourceIndex(0) +6 >Emitted(6, 11) Source(1, 7) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 2) + SourceIndex(0) +--- +>>>var e2; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >enum +3 > e2 { + > x = 10, + > y = 10, + > z, + > x2 + > } +1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(6, 6) + SourceIndex(0) +3 >Emitted(7, 7) Source(11, 2) + SourceIndex(0) +--- +>>>(function (e2) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^-> +1-> +2 >enum +3 > e2 +1->Emitted(8, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(8, 12) Source(6, 6) + SourceIndex(0) +3 >Emitted(8, 14) Source(6, 8) + SourceIndex(0) +--- +>>> e2[e2["x"] = 10] = "x"; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^-> +1-> { + > +2 > x = +3 > 10 +4 > +1->Emitted(9, 5) Source(7, 5) + SourceIndex(0) name (e2) +2 >Emitted(9, 18) Source(7, 9) + SourceIndex(0) name (e2) +3 >Emitted(9, 20) Source(7, 11) + SourceIndex(0) name (e2) +4 >Emitted(9, 27) Source(7, 11) + SourceIndex(0) name (e2) +--- +>>> e2[e2["y"] = 10] = "y"; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^-> +1->, + > +2 > y = +3 > 10 +4 > +1->Emitted(10, 5) Source(8, 5) + SourceIndex(0) name (e2) +2 >Emitted(10, 18) Source(8, 9) + SourceIndex(0) name (e2) +3 >Emitted(10, 20) Source(8, 11) + SourceIndex(0) name (e2) +4 >Emitted(10, 27) Source(8, 11) + SourceIndex(0) name (e2) +--- +>>> e2[e2["z"] = 11] = "z"; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^-> +1->, + > +2 > z +1->Emitted(11, 5) Source(9, 5) + SourceIndex(0) name (e2) +2 >Emitted(11, 27) Source(9, 6) + SourceIndex(0) name (e2) +--- +>>> e2[e2["x2"] = 12] = "x2"; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1->, + > +2 > x2 +1->Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (e2) +2 >Emitted(12, 29) Source(10, 7) + SourceIndex(0) name (e2) +--- +>>>})(e2 || (e2 = {})); +1 > +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +1 > + > +2 >} +3 > +4 > e2 +5 > +6 > e2 +7 > { + > x = 10, + > y = 10, + > z, + > x2 + > } +1 >Emitted(13, 1) Source(11, 1) + SourceIndex(0) name (e2) +2 >Emitted(13, 2) Source(11, 2) + SourceIndex(0) name (e2) +3 >Emitted(13, 4) Source(6, 6) + SourceIndex(0) +4 >Emitted(13, 6) Source(6, 8) + SourceIndex(0) +5 >Emitted(13, 11) Source(6, 6) + SourceIndex(0) +6 >Emitted(13, 13) Source(6, 8) + SourceIndex(0) +7 >Emitted(13, 21) Source(11, 2) + SourceIndex(0) +--- +>>>var e3; +1 > +2 >^^^^ +3 > ^^ +4 > ^^^^^^^^^^^-> +1 > + > +2 >enum +3 > e3 { + > } +1 >Emitted(14, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(12, 6) + SourceIndex(0) +3 >Emitted(14, 7) Source(13, 2) + SourceIndex(0) +--- +>>>(function (e3) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> +2 >enum +3 > e3 +1->Emitted(15, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(15, 12) Source(12, 6) + SourceIndex(0) +3 >Emitted(15, 14) Source(12, 8) + SourceIndex(0) +--- +>>>})(e3 || (e3 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> { + > +2 >} +3 > +4 > e3 +5 > +6 > e3 +7 > { + > } +1->Emitted(16, 1) Source(13, 1) + SourceIndex(0) name (e3) +2 >Emitted(16, 2) Source(13, 2) + SourceIndex(0) name (e3) +3 >Emitted(16, 4) Source(12, 6) + SourceIndex(0) +4 >Emitted(16, 6) Source(12, 8) + SourceIndex(0) +5 >Emitted(16, 11) Source(12, 6) + SourceIndex(0) +6 >Emitted(16, 13) Source(12, 8) + SourceIndex(0) +7 >Emitted(16, 21) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationEnums.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignment.js b/tests/baselines/reference/sourceMapValidationExportAssignment.js new file mode 100644 index 0000000000000..a1b0c1e167a36 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignment.js @@ -0,0 +1,16 @@ +//// [sourceMapValidationExportAssignment.ts] +class a { + public c; +} +export = a; + +//// [sourceMapValidationExportAssignment.js] +define(["require", "exports"], function (require, exports) { + var a = (function () { + function a() { + } + return a; + })(); + return a; +}); +//# sourceMappingURL=sourceMapValidationExportAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignment.js.map b/tests/baselines/reference/sourceMapValidationExportAssignment.js.map new file mode 100644 index 0000000000000..c44a5e54c3b05 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignment.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationExportAssignment.js.map] +{"version":3,"file":"sourceMapValidationExportAssignment.js","sourceRoot":"","sources":["sourceMapValidationExportAssignment.ts"],"names":["a","a.constructor"],"mappings":";IAAA,IAAM,CAAC;QAAPA,SAAMA,CAACA;QAEPC,CAACA;QAADD,QAACA;IAADA,CAACA,AAFD,IAEC;IACU,AAAX,OAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt b/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt new file mode 100644 index 0000000000000..86dd911d5a835 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignment.sourcemap.txt @@ -0,0 +1,90 @@ +=================================================================== +JsFile: sourceMapValidationExportAssignment.js +mapUrl: sourceMapValidationExportAssignment.js.map +sourceRoot: +sources: sourceMapValidationExportAssignment.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationExportAssignment.js +sourceFile:sourceMapValidationExportAssignment.ts +------------------------------------------------------------------- +>>>define(["require", "exports"], function (require, exports) { +>>> var a = (function () { +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 > class +3 > a +1 >Emitted(2, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 7) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 8) + SourceIndex(0) +--- +>>> function a() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> +2 > class +3 > a +1->Emitted(3, 9) Source(1, 1) + SourceIndex(0) name (a) +2 >Emitted(3, 18) Source(1, 7) + SourceIndex(0) name (a) +3 >Emitted(3, 19) Source(1, 8) + SourceIndex(0) name (a) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { + > public c; + > +2 > } +1 >Emitted(4, 9) Source(3, 1) + SourceIndex(0) name (a.constructor) +2 >Emitted(4, 10) Source(3, 2) + SourceIndex(0) name (a.constructor) +--- +>>> return a; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) name (a) +2 >Emitted(5, 17) Source(3, 2) + SourceIndex(0) name (a) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^-> +1 > +2 > } +3 > +4 > class a { + > public c; + > } +1 >Emitted(6, 5) Source(3, 1) + SourceIndex(0) name (a) +2 >Emitted(6, 6) Source(3, 2) + SourceIndex(0) name (a) +3 >Emitted(6, 6) Source(1, 1) + SourceIndex(0) +4 >Emitted(6, 10) Source(3, 2) + SourceIndex(0) +--- +>>> return a; +1->^^^^ +2 > +3 > ^^^^^^^ +4 > ^ +5 > ^ +1-> + >export = a; +2 > +3 > export = +4 > a +5 > ; +1->Emitted(7, 5) Source(4, 12) + SourceIndex(0) +2 >Emitted(7, 5) Source(4, 1) + SourceIndex(0) +3 >Emitted(7, 12) Source(4, 10) + SourceIndex(0) +4 >Emitted(7, 13) Source(4, 11) + SourceIndex(0) +5 >Emitted(7, 14) Source(4, 12) + SourceIndex(0) +--- +>>>}); +>>>//# sourceMappingURL=sourceMapValidationExportAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js new file mode 100644 index 0000000000000..0a0b3feda5ff4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js @@ -0,0 +1,14 @@ +//// [sourceMapValidationExportAssignmentCommonjs.ts] +class a { + public c; +} +export = a; + +//// [sourceMapValidationExportAssignmentCommonjs.js] +var a = (function () { + function a() { + } + return a; +})(); +module.exports = a; +//# sourceMappingURL=sourceMapValidationExportAssignmentCommonjs.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js.map b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js.map new file mode 100644 index 0000000000000..18e89d374651c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationExportAssignmentCommonjs.js.map] +{"version":3,"file":"sourceMapValidationExportAssignmentCommonjs.js","sourceRoot":"","sources":["sourceMapValidationExportAssignmentCommonjs.ts"],"names":["a","a.constructor"],"mappings":"AAAA,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAEPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC;AACU,AAAX,iBAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt new file mode 100644 index 0000000000000..308e29c37a5d3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt @@ -0,0 +1,89 @@ +=================================================================== +JsFile: sourceMapValidationExportAssignmentCommonjs.js +mapUrl: sourceMapValidationExportAssignmentCommonjs.js.map +sourceRoot: +sources: sourceMapValidationExportAssignmentCommonjs.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationExportAssignmentCommonjs.js +sourceFile:sourceMapValidationExportAssignmentCommonjs.ts +------------------------------------------------------------------- +>>>var a = (function () { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 >class +3 > a +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0) +--- +>>> function a() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> +2 > class +3 > a +1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (a) +2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (a) +3 >Emitted(2, 15) Source(1, 8) + SourceIndex(0) name (a) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { + > public c; + > +2 > } +1 >Emitted(3, 5) Source(3, 1) + SourceIndex(0) name (a.constructor) +2 >Emitted(3, 6) Source(3, 2) + SourceIndex(0) name (a.constructor) +--- +>>> return a; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (a) +2 >Emitted(4, 13) Source(3, 2) + SourceIndex(0) name (a) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class a { + > public c; + > } +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) name (a) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) name (a) +3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(5, 6) Source(3, 2) + SourceIndex(0) +--- +>>>module.exports = a; +1-> +2 > +3 >^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >export = a; +2 > +3 >export = +4 > a +5 > ; +1->Emitted(6, 1) Source(4, 12) + SourceIndex(0) +2 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) +3 >Emitted(6, 18) Source(4, 10) + SourceIndex(0) +4 >Emitted(6, 19) Source(4, 11) + SourceIndex(0) +5 >Emitted(6, 20) Source(4, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationExportAssignmentCommonjs.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt new file mode 100644 index 0000000000000..d0cbec7099c3a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/sourceMapValidationFor.ts (2 errors) ==== + for (var i = 0; i < 10; i++) { + WScript.Echo("i: " + i); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } + for (i = 0; i < 10; i++) + { + WScript.Echo("i: " + i); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } + for (var j = 0; j < 10; ) { + j++; + if (j == 1) { + continue; + } + } + for (j = 0; j < 10;) + { + j++; + } + for (var k = 0;; k++) { + } + for (k = 0;; k++) + { + } + for (; k < 10; k++) { + } + for (;;) { + i++; + } + for (;;) + { + i++; + } + for (i = 0, j = 20; j < 20, i < 20; j++) { + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.js b/tests/baselines/reference/sourceMapValidationFor.js new file mode 100644 index 0000000000000..b85a92653de7d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFor.js @@ -0,0 +1,66 @@ +//// [sourceMapValidationFor.ts] +for (var i = 0; i < 10; i++) { + WScript.Echo("i: " + i); +} +for (i = 0; i < 10; i++) +{ + WScript.Echo("i: " + i); +} +for (var j = 0; j < 10; ) { + j++; + if (j == 1) { + continue; + } +} +for (j = 0; j < 10;) +{ + j++; +} +for (var k = 0;; k++) { +} +for (k = 0;; k++) +{ +} +for (; k < 10; k++) { +} +for (;;) { + i++; +} +for (;;) +{ + i++; +} +for (i = 0, j = 20; j < 20, i < 20; j++) { +} + +//// [sourceMapValidationFor.js] +for (var i = 0; i < 10; i++) { + WScript.Echo("i: " + i); +} +for (i = 0; i < 10; i++) { + WScript.Echo("i: " + i); +} +for (var j = 0; j < 10;) { + j++; + if (j == 1) { + continue; + } +} +for (j = 0; j < 10;) { + j++; +} +for (var k = 0;; k++) { +} +for (k = 0;; k++) { +} +for (; k < 10; k++) { +} +for (;;) { + i++; +} +for (;;) { + i++; +} +for (i = 0, j = 20; j < 20, i < 20; j++) { +} +//# sourceMappingURL=sourceMapValidationFor.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.js.map b/tests/baselines/reference/sourceMapValidationFor.js.map new file mode 100644 index 0000000000000..15d038297c759 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFor.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationFor.js.map] +{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt new file mode 100644 index 0000000000000..609f9548a6b45 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt @@ -0,0 +1,738 @@ +=================================================================== +JsFile: sourceMapValidationFor.js +mapUrl: sourceMapValidationFor.js.map +sourceRoot: +sources: sourceMapValidationFor.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationFor.js +sourceFile:sourceMapValidationFor.ts +------------------------------------------------------------------- +>>>for (var i = 0; i < 10; i++) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1 > +2 >for +3 > +4 > ( +5 > var +6 > +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 10 +14> ; +15> i +16> ++ +17> ) +18> { +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +9 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) +11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) +12>Emitted(1, 21) Source(1, 21) + SourceIndex(0) +13>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +14>Emitted(1, 25) Source(1, 25) + SourceIndex(0) +15>Emitted(1, 26) Source(1, 26) + SourceIndex(0) +16>Emitted(1, 28) Source(1, 28) + SourceIndex(0) +17>Emitted(1, 30) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 31) Source(1, 31) + SourceIndex(0) +--- +>>> WScript.Echo("i: " + i); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^^ +7 > ^^^ +8 > ^ +9 > ^ +10> ^ +1 > + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > "i: " +7 > + +8 > i +9 > ) +10> ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) +5 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) +6 >Emitted(2, 23) Source(2, 23) + SourceIndex(0) +7 >Emitted(2, 26) Source(2, 26) + SourceIndex(0) +8 >Emitted(2, 27) Source(2, 27) + SourceIndex(0) +9 >Emitted(2, 28) Source(2, 28) + SourceIndex(0) +10>Emitted(2, 29) Source(2, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +--- +>>>for (i = 0; i < 10; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^^ +12> ^^ +13> ^ +14> ^^ +15> ^^ +16> ^ +17> ^^^-> +1-> + > +2 >for +3 > +4 > ( +5 > i +6 > = +7 > 0 +8 > ; +9 > i +10> < +11> 10 +12> ; +13> i +14> ++ +15> ) + > +16> { +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) +3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +4 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +5 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +6 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) +7 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +8 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) +9 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +10>Emitted(4, 17) Source(4, 17) + SourceIndex(0) +11>Emitted(4, 19) Source(4, 19) + SourceIndex(0) +12>Emitted(4, 21) Source(4, 21) + SourceIndex(0) +13>Emitted(4, 22) Source(4, 22) + SourceIndex(0) +14>Emitted(4, 24) Source(4, 24) + SourceIndex(0) +15>Emitted(4, 26) Source(5, 1) + SourceIndex(0) +16>Emitted(4, 27) Source(5, 2) + SourceIndex(0) +--- +>>> WScript.Echo("i: " + i); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^^^^ +7 > ^^^ +8 > ^ +9 > ^ +10> ^ +1-> + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > "i: " +7 > + +8 > i +9 > ) +10> ; +1->Emitted(5, 5) Source(6, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(6, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(6, 13) + SourceIndex(0) +4 >Emitted(5, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(5, 18) Source(6, 18) + SourceIndex(0) +6 >Emitted(5, 23) Source(6, 23) + SourceIndex(0) +7 >Emitted(5, 26) Source(6, 26) + SourceIndex(0) +8 >Emitted(5, 27) Source(6, 27) + SourceIndex(0) +9 >Emitted(5, 28) Source(6, 28) + SourceIndex(0) +10>Emitted(5, 29) Source(6, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(7, 2) + SourceIndex(0) +--- +>>>for (var j = 0; j < 10;) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^ +14> ^^^ +15> ^ +1-> + > +2 >for +3 > +4 > ( +5 > var +6 > +7 > j +8 > = +9 > 0 +10> ; +11> j +12> < +13> 10 +14> ; ) +15> { +1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 4) Source(8, 4) + SourceIndex(0) +3 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) +4 >Emitted(7, 6) Source(8, 6) + SourceIndex(0) +5 >Emitted(7, 9) Source(8, 9) + SourceIndex(0) +6 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +7 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +8 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +9 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) +10>Emitted(7, 17) Source(8, 17) + SourceIndex(0) +11>Emitted(7, 18) Source(8, 18) + SourceIndex(0) +12>Emitted(7, 21) Source(8, 21) + SourceIndex(0) +13>Emitted(7, 23) Source(8, 23) + SourceIndex(0) +14>Emitted(7, 26) Source(8, 27) + SourceIndex(0) +15>Emitted(7, 27) Source(8, 28) + SourceIndex(0) +--- +>>> j++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + > +2 > j +3 > ++ +4 > ; +1 >Emitted(8, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(8, 6) Source(9, 6) + SourceIndex(0) +3 >Emitted(8, 8) Source(9, 8) + SourceIndex(0) +4 >Emitted(8, 9) Source(9, 9) + SourceIndex(0) +--- +>>> if (j == 1) { +1->^^^^ +2 > ^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^ +10> ^ +11> ^-> +1-> + > +2 > if +3 > +4 > ( +5 > j +6 > == +7 > 1 +8 > ) +9 > +10> { +1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) +2 >Emitted(9, 7) Source(10, 7) + SourceIndex(0) +3 >Emitted(9, 8) Source(10, 8) + SourceIndex(0) +4 >Emitted(9, 9) Source(10, 9) + SourceIndex(0) +5 >Emitted(9, 10) Source(10, 10) + SourceIndex(0) +6 >Emitted(9, 14) Source(10, 14) + SourceIndex(0) +7 >Emitted(9, 15) Source(10, 15) + SourceIndex(0) +8 >Emitted(9, 16) Source(10, 16) + SourceIndex(0) +9 >Emitted(9, 17) Source(10, 17) + SourceIndex(0) +10>Emitted(9, 18) Source(10, 18) + SourceIndex(0) +--- +>>> continue; +1->^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +1-> + > +2 > continue +3 > ; +1->Emitted(10, 9) Source(11, 9) + SourceIndex(0) +2 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) +3 >Emitted(10, 18) Source(11, 18) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(11, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(11, 6) Source(12, 6) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) +--- +>>>for (j = 0; j < 10;) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +1-> + > +2 >for +3 > +4 > ( +5 > j +6 > = +7 > 0 +8 > ; +9 > j +10> < +11> 10 +12> ;) + > +13> { +1->Emitted(13, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(14, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(14, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(14, 6) + SourceIndex(0) +5 >Emitted(13, 7) Source(14, 7) + SourceIndex(0) +6 >Emitted(13, 10) Source(14, 10) + SourceIndex(0) +7 >Emitted(13, 11) Source(14, 11) + SourceIndex(0) +8 >Emitted(13, 13) Source(14, 13) + SourceIndex(0) +9 >Emitted(13, 14) Source(14, 14) + SourceIndex(0) +10>Emitted(13, 17) Source(14, 17) + SourceIndex(0) +11>Emitted(13, 19) Source(14, 19) + SourceIndex(0) +12>Emitted(13, 22) Source(15, 1) + SourceIndex(0) +13>Emitted(13, 23) Source(15, 2) + SourceIndex(0) +--- +>>> j++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > j +3 > ++ +4 > ; +1 >Emitted(14, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(14, 6) Source(16, 6) + SourceIndex(0) +3 >Emitted(14, 8) Source(16, 8) + SourceIndex(0) +4 >Emitted(14, 9) Source(16, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(17, 2) + SourceIndex(0) +--- +>>>for (var k = 0;; k++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^^ +14> ^ +1-> + > +2 >for +3 > +4 > ( +5 > var +6 > +7 > k +8 > = +9 > 0 +10> ;; +11> k +12> ++ +13> ) +14> { +1->Emitted(16, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(18, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(18, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(18, 6) + SourceIndex(0) +5 >Emitted(16, 9) Source(18, 9) + SourceIndex(0) +6 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) +7 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) +8 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) +9 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) +10>Emitted(16, 18) Source(18, 18) + SourceIndex(0) +11>Emitted(16, 19) Source(18, 19) + SourceIndex(0) +12>Emitted(16, 21) Source(18, 21) + SourceIndex(0) +13>Emitted(16, 23) Source(18, 23) + SourceIndex(0) +14>Emitted(16, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(19, 2) + SourceIndex(0) +--- +>>>for (k = 0;; k++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^^ +12> ^ +1-> + > +2 >for +3 > +4 > ( +5 > k +6 > = +7 > 0 +8 > ;; +9 > k +10> ++ +11> ) + > +12> { +1->Emitted(18, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(20, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(20, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(20, 6) + SourceIndex(0) +5 >Emitted(18, 7) Source(20, 7) + SourceIndex(0) +6 >Emitted(18, 10) Source(20, 10) + SourceIndex(0) +7 >Emitted(18, 11) Source(20, 11) + SourceIndex(0) +8 >Emitted(18, 14) Source(20, 14) + SourceIndex(0) +9 >Emitted(18, 15) Source(20, 15) + SourceIndex(0) +10>Emitted(18, 17) Source(20, 17) + SourceIndex(0) +11>Emitted(18, 19) Source(21, 1) + SourceIndex(0) +12>Emitted(18, 20) Source(21, 2) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(19, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(19, 2) Source(22, 2) + SourceIndex(0) +--- +>>>for (; k < 10; k++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +1-> + > +2 >for +3 > +4 > ( +5 > ; +6 > k +7 > < +8 > 10 +9 > ; +10> k +11> ++ +12> ) +13> { +1->Emitted(20, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(23, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(23, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(23, 6) + SourceIndex(0) +5 >Emitted(20, 8) Source(23, 8) + SourceIndex(0) +6 >Emitted(20, 9) Source(23, 9) + SourceIndex(0) +7 >Emitted(20, 12) Source(23, 12) + SourceIndex(0) +8 >Emitted(20, 14) Source(23, 14) + SourceIndex(0) +9 >Emitted(20, 16) Source(23, 16) + SourceIndex(0) +10>Emitted(20, 17) Source(23, 17) + SourceIndex(0) +11>Emitted(20, 19) Source(23, 19) + SourceIndex(0) +12>Emitted(20, 21) Source(23, 21) + SourceIndex(0) +13>Emitted(20, 22) Source(23, 22) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(21, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(24, 2) + SourceIndex(0) +--- +>>>for (;;) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^ +1-> + > +2 >for +3 > +4 > ( +5 > ;;) +6 > { +1->Emitted(22, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(25, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(25, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(25, 6) + SourceIndex(0) +5 >Emitted(22, 10) Source(25, 10) + SourceIndex(0) +6 >Emitted(22, 11) Source(25, 11) + SourceIndex(0) +--- +>>> i++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > i +3 > ++ +4 > ; +1 >Emitted(23, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(23, 6) Source(26, 6) + SourceIndex(0) +3 >Emitted(23, 8) Source(26, 8) + SourceIndex(0) +4 >Emitted(23, 9) Source(26, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(24, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(24, 2) Source(27, 2) + SourceIndex(0) +--- +>>>for (;;) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^ +1-> + > +2 >for +3 > +4 > ( +5 > ;;) + > +6 > { +1->Emitted(25, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(28, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(28, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(28, 6) + SourceIndex(0) +5 >Emitted(25, 10) Source(29, 1) + SourceIndex(0) +6 >Emitted(25, 11) Source(29, 2) + SourceIndex(0) +--- +>>> i++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > i +3 > ++ +4 > ; +1 >Emitted(26, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(26, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(26, 8) Source(30, 8) + SourceIndex(0) +4 >Emitted(26, 9) Source(30, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (i = 0, j = 20; j < 20, i < 20; j++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^^ +12> ^^ +13> ^ +14> ^^^ +15> ^^ +16> ^^ +17> ^ +18> ^^^ +19> ^^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > i +6 > = +7 > 0 +8 > , +9 > j +10> = +11> 20 +12> ; +13> j +14> < +15> 20 +16> , +17> i +18> < +19> 20 +20> ; +21> j +22> ++ +23> ) +24> { +1->Emitted(28, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(32, 6) + SourceIndex(0) +5 >Emitted(28, 7) Source(32, 7) + SourceIndex(0) +6 >Emitted(28, 10) Source(32, 10) + SourceIndex(0) +7 >Emitted(28, 11) Source(32, 11) + SourceIndex(0) +8 >Emitted(28, 13) Source(32, 13) + SourceIndex(0) +9 >Emitted(28, 14) Source(32, 14) + SourceIndex(0) +10>Emitted(28, 17) Source(32, 17) + SourceIndex(0) +11>Emitted(28, 19) Source(32, 19) + SourceIndex(0) +12>Emitted(28, 21) Source(32, 21) + SourceIndex(0) +13>Emitted(28, 22) Source(32, 22) + SourceIndex(0) +14>Emitted(28, 25) Source(32, 25) + SourceIndex(0) +15>Emitted(28, 27) Source(32, 27) + SourceIndex(0) +16>Emitted(28, 29) Source(32, 29) + SourceIndex(0) +17>Emitted(28, 30) Source(32, 30) + SourceIndex(0) +18>Emitted(28, 33) Source(32, 33) + SourceIndex(0) +19>Emitted(28, 35) Source(32, 35) + SourceIndex(0) +20>Emitted(28, 37) Source(32, 37) + SourceIndex(0) +21>Emitted(28, 38) Source(32, 38) + SourceIndex(0) +22>Emitted(28, 40) Source(32, 40) + SourceIndex(0) +23>Emitted(28, 42) Source(32, 42) + SourceIndex(0) +24>Emitted(28, 43) Source(32, 43) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(33, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationFor.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.errors.txt b/tests/baselines/reference/sourceMapValidationForIn.errors.txt new file mode 100644 index 0000000000000..02dcd92f88543 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationForIn.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/sourceMapValidationForIn.ts (4 errors) ==== + for (var x in String) { + WScript.Echo(x); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } + for (x in String) { + WScript.Echo(x); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } + for (var x2 in String) + { + WScript.Echo(x2); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } + for (x in String) + { + WScript.Echo(x); + ~~~~~~~ +!!! Cannot find name 'WScript'. + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.js b/tests/baselines/reference/sourceMapValidationForIn.js new file mode 100644 index 0000000000000..2bfa9f9d132cc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationForIn.js @@ -0,0 +1,30 @@ +//// [sourceMapValidationForIn.ts] +for (var x in String) { + WScript.Echo(x); +} +for (x in String) { + WScript.Echo(x); +} +for (var x2 in String) +{ + WScript.Echo(x2); +} +for (x in String) +{ + WScript.Echo(x); +} + +//// [sourceMapValidationForIn.js] +for (var x in String) { + WScript.Echo(x); +} +for (x in String) { + WScript.Echo(x); +} +for (var x2 in String) { + WScript.Echo(x2); +} +for (x in String) { + WScript.Echo(x); +} +//# sourceMappingURL=sourceMapValidationForIn.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.js.map b/tests/baselines/reference/sourceMapValidationForIn.js.map new file mode 100644 index 0000000000000..2c12dd5cdc14f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationForIn.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationForIn.js.map] +{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt new file mode 100644 index 0000000000000..ae7e34c025cb1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt @@ -0,0 +1,306 @@ +=================================================================== +JsFile: sourceMapValidationForIn.js +mapUrl: sourceMapValidationForIn.js.map +sourceRoot: +sources: sourceMapValidationForIn.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationForIn.js +sourceFile:sourceMapValidationForIn.ts +------------------------------------------------------------------- +>>>for (var x in String) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +1 > +2 >for +3 > +4 > ( +5 > var +6 > +7 > x +8 > in +9 > String +10> ) +11> +12> { +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +9 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 22) Source(1, 22) + SourceIndex(0) +11>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +12>Emitted(1, 24) Source(1, 24) + SourceIndex(0) +--- +>>> WScript.Echo(x); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1 > + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > x +7 > ) +8 > ; +1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) +5 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) +6 >Emitted(2, 19) Source(2, 19) + SourceIndex(0) +7 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +--- +>>>for (x in String) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^-> +1-> + > +2 >for +3 > +4 > ( +5 > x +6 > in +7 > String +8 > ) +9 > +10> { +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) +3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +4 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +5 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +6 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +7 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) +8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) +9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) +10>Emitted(4, 20) Source(4, 20) + SourceIndex(0) +--- +>>> WScript.Echo(x); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > x +7 > ) +8 > ; +1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(5, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(5, 13) + SourceIndex(0) +4 >Emitted(5, 17) Source(5, 17) + SourceIndex(0) +5 >Emitted(5, 18) Source(5, 18) + SourceIndex(0) +6 >Emitted(5, 19) Source(5, 19) + SourceIndex(0) +7 >Emitted(5, 20) Source(5, 20) + SourceIndex(0) +8 >Emitted(5, 21) Source(5, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) +--- +>>>for (var x2 in String) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^^^^ +9 > ^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >for +3 > +4 > ( +5 > var +6 > +7 > x2 +8 > in +9 > String +10> ) +11> + > +12> { +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) +3 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +4 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) +5 >Emitted(7, 9) Source(7, 9) + SourceIndex(0) +6 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +7 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +8 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) +9 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) +10>Emitted(7, 23) Source(7, 23) + SourceIndex(0) +11>Emitted(7, 24) Source(8, 1) + SourceIndex(0) +12>Emitted(7, 25) Source(8, 2) + SourceIndex(0) +--- +>>> WScript.Echo(x2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^ +1 > + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > x2 +7 > ) +8 > ; +1 >Emitted(8, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(9, 13) + SourceIndex(0) +4 >Emitted(8, 17) Source(9, 17) + SourceIndex(0) +5 >Emitted(8, 18) Source(9, 18) + SourceIndex(0) +6 >Emitted(8, 20) Source(9, 20) + SourceIndex(0) +7 >Emitted(8, 21) Source(9, 21) + SourceIndex(0) +8 >Emitted(8, 22) Source(9, 22) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) +--- +>>>for (x in String) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^-> +1-> + > +2 >for +3 > +4 > ( +5 > x +6 > in +7 > String +8 > ) +9 > + > +10> { +1->Emitted(10, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(11, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(11, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(11, 6) + SourceIndex(0) +5 >Emitted(10, 7) Source(11, 7) + SourceIndex(0) +6 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) +7 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) +8 >Emitted(10, 18) Source(11, 18) + SourceIndex(0) +9 >Emitted(10, 19) Source(12, 1) + SourceIndex(0) +10>Emitted(10, 20) Source(12, 2) + SourceIndex(0) +--- +>>> WScript.Echo(x); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 > WScript +3 > . +4 > Echo +5 > ( +6 > x +7 > ) +8 > ; +1->Emitted(11, 5) Source(13, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(13, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(13, 13) + SourceIndex(0) +4 >Emitted(11, 17) Source(13, 17) + SourceIndex(0) +5 >Emitted(11, 18) Source(13, 18) + SourceIndex(0) +6 >Emitted(11, 19) Source(13, 19) + SourceIndex(0) +7 >Emitted(11, 20) Source(13, 20) + SourceIndex(0) +8 >Emitted(11, 21) Source(13, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(14, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationForIn.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js new file mode 100644 index 0000000000000..f215c5071e4c0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js @@ -0,0 +1,18 @@ +//// [sourceMapValidationFunctionExpressions.ts] +var greetings = 0; +var greet = (greeting: string): number => { + greetings++; + return greetings; +} +greet("Hello"); +var incrGreetings = () => greetings++; + +//// [sourceMapValidationFunctionExpressions.js] +var greetings = 0; +var greet = function (greeting) { + greetings++; + return greetings; +}; +greet("Hello"); +var incrGreetings = function () { return greetings++; }; +//# sourceMappingURL=sourceMapValidationFunctionExpressions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map new file mode 100644 index 0000000000000..0ab0bdac1469e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationFunctionExpressions.js.map] +{"version":3,"file":"sourceMapValidationFunctionExpressions.js","sourceRoot":"","sources":["sourceMapValidationFunctionExpressions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,KAAK,GAAG,UAAC,QAAgB;IACzB,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC,CAAA;AACD,KAAK,CAAC,OAAO,CAAC,CAAC;AACf,IAAI,aAAa,GAAG,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt new file mode 100644 index 0000000000000..722afe1f9d938 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt @@ -0,0 +1,159 @@ +=================================================================== +JsFile: sourceMapValidationFunctionExpressions.js +mapUrl: sourceMapValidationFunctionExpressions.js.map +sourceRoot: +sources: sourceMapValidationFunctionExpressions.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationFunctionExpressions.js +sourceFile:sourceMapValidationFunctionExpressions.ts +------------------------------------------------------------------- +>>>var greetings = 0; +1 > +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^-> +1 > +2 >var +3 > greetings +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +4 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) +5 >Emitted(1, 18) Source(1, 18) + SourceIndex(0) +6 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) +--- +>>>var greet = function (greeting) { +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^ +6 > ^^^^^^^^ +1-> + > +2 >var +3 > greet +4 > = +5 > ( +6 > greeting: string +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(2, 23) Source(2, 14) + SourceIndex(0) +6 >Emitted(2, 31) Source(2, 30) + SourceIndex(0) +--- +>>> greetings++; +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^-> +1 >): number => { + > +2 > greetings +3 > ++ +4 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) +3 >Emitted(3, 16) Source(3, 16) + SourceIndex(0) +4 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) +--- +>>> return greetings; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1-> + > +2 > return +3 > +4 > greetings +5 > ; +1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) +4 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +5 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1 > + > +2 >} +3 > +1 >Emitted(5, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(5, 2) + SourceIndex(0) +3 >Emitted(5, 3) Source(5, 2) + SourceIndex(0) +--- +>>>greet("Hello"); +1-> +2 >^^^^^ +3 > ^ +4 > ^^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >greet +3 > ( +4 > "Hello" +5 > ) +6 > ; +1->Emitted(6, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(6, 6) Source(6, 6) + SourceIndex(0) +3 >Emitted(6, 7) Source(6, 7) + SourceIndex(0) +4 >Emitted(6, 14) Source(6, 14) + SourceIndex(0) +5 >Emitted(6, 15) Source(6, 15) + SourceIndex(0) +6 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) +--- +>>>var incrGreetings = function () { return greetings++; }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^ +10> ^ +11> ^ +12> ^^^^^^^^^-> +1-> + > +2 >var +3 > incrGreetings +4 > = +5 > () => +6 > +7 > greetings +8 > ++ +9 > +10> greetings++ +11> ; +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 18) Source(7, 18) + SourceIndex(0) +4 >Emitted(7, 21) Source(7, 21) + SourceIndex(0) +5 >Emitted(7, 35) Source(7, 27) + SourceIndex(0) +6 >Emitted(7, 42) Source(7, 27) + SourceIndex(0) +7 >Emitted(7, 51) Source(7, 36) + SourceIndex(0) +8 >Emitted(7, 53) Source(7, 38) + SourceIndex(0) +9 >Emitted(7, 55) Source(7, 27) + SourceIndex(0) +10>Emitted(7, 56) Source(7, 38) + SourceIndex(0) +11>Emitted(7, 57) Source(7, 39) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationFunctionExpressions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js new file mode 100644 index 0000000000000..f76df7047eafa --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js @@ -0,0 +1,7 @@ +//// [sourceMapValidationFunctionPropertyAssignment.ts] +var x = { n() { } }; + +//// [sourceMapValidationFunctionPropertyAssignment.js] +var x = { n: function n() { +} }; +//# sourceMappingURL=sourceMapValidationFunctionPropertyAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map new file mode 100644 index 0000000000000..10c482a6ba275 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationFunctionPropertyAssignment.js.map] +{"version":3,"file":"sourceMapValidationFunctionPropertyAssignment.js","sourceRoot":"","sources":["sourceMapValidationFunctionPropertyAssignment.ts"],"names":["n"],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC,EAAD,SAAA,CAAC;AAAKA,CAACA,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt new file mode 100644 index 0000000000000..00ff4d13586b3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.sourcemap.txt @@ -0,0 +1,55 @@ +=================================================================== +JsFile: sourceMapValidationFunctionPropertyAssignment.js +mapUrl: sourceMapValidationFunctionPropertyAssignment.js.map +sourceRoot: +sources: sourceMapValidationFunctionPropertyAssignment.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationFunctionPropertyAssignment.js +sourceFile:sourceMapValidationFunctionPropertyAssignment.ts +------------------------------------------------------------------- +>>>var x = { n: function n() { +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^ +1 > +2 >var +3 > x +4 > = +5 > { +6 > n +7 > +8 > +9 > n +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +7 >Emitted(1, 14) Source(1, 11) + SourceIndex(0) +8 >Emitted(1, 23) Source(1, 11) + SourceIndex(0) +9 >Emitted(1, 24) Source(1, 12) + SourceIndex(0) +--- +>>>} }; +1 > +2 >^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >() { +2 >} +3 > } +4 > ; +1 >Emitted(2, 1) Source(1, 17) + SourceIndex(0) name (n) +2 >Emitted(2, 2) Source(1, 18) + SourceIndex(0) name (n) +3 >Emitted(2, 4) Source(1, 20) + SourceIndex(0) +4 >Emitted(2, 5) Source(1, 21) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationFunctionPropertyAssignment.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctions.js b/tests/baselines/reference/sourceMapValidationFunctions.js new file mode 100644 index 0000000000000..58222aa48c782 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctions.js @@ -0,0 +1,39 @@ +//// [sourceMapValidationFunctions.ts] +var greetings = 0; +function greet(greeting: string): number { + greetings++; + return greetings; +} +function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): number { + greetings++; + return greetings; +} +function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) +{ + return; +} + +//// [sourceMapValidationFunctions.js] +var greetings = 0; +function greet(greeting) { + greetings++; + return greetings; +} +function greet2(greeting, n, x) { + if (n === void 0) { n = 10; } + var restParams = []; + for (var _i = 3; _i < arguments.length; _i++) { + restParams[_i - 3] = arguments[_i]; + } + greetings++; + return greetings; +} +function foo(greeting, n, x) { + if (n === void 0) { n = 10; } + var restParams = []; + for (var _i = 3; _i < arguments.length; _i++) { + restParams[_i - 3] = arguments[_i]; + } + return; +} +//# sourceMappingURL=sourceMapValidationFunctions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctions.js.map b/tests/baselines/reference/sourceMapValidationFunctions.js.map new file mode 100644 index 0000000000000..c04ec524d2db5 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctions.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationFunctions.js.map] +{"version":3,"file":"sourceMapValidationFunctions.js","sourceRoot":"","sources":["sourceMapValidationFunctions.ts"],"names":["greet","greet2","foo"],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,SAAS,KAAK,CAAC,QAAgB;IAC3BA,SAASA,EAAEA,CAACA;IACZA,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA;AACD,SAAS,MAAM,CAAC,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlBC,iBAAMA,GAANA,MAAMA;IAAcA,oBAAuBA;SAAvBA,WAAuBA,CAAvBA,sBAAuBA,CAAvBA,IAAuBA;QAAvBA,mCAAuBA;;IACzEA,SAASA,EAAEA,CAACA;IACZA,MAAMA,CAACA,SAASA,CAACA;AACrBA,CAACA;AACD,SAAS,GAAG,CAAC,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlBC,iBAAMA,GAANA,MAAMA;IAAcA,oBAAuBA;SAAvBA,WAAuBA,CAAvBA,sBAAuBA,CAAvBA,IAAuBA;QAAvBA,mCAAuBA;;IAEtEA,MAAMA,CAACA;AACXA,CAACA"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt new file mode 100644 index 0000000000000..a9e43e404a747 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt @@ -0,0 +1,327 @@ +=================================================================== +JsFile: sourceMapValidationFunctions.js +mapUrl: sourceMapValidationFunctions.js.map +sourceRoot: +sources: sourceMapValidationFunctions.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationFunctions.js +sourceFile:sourceMapValidationFunctions.ts +------------------------------------------------------------------- +>>>var greetings = 0; +1 > +2 >^^^^ +3 > ^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^-> +1 > +2 >var +3 > greetings +4 > = +5 > 0 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +4 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) +5 >Emitted(1, 18) Source(1, 18) + SourceIndex(0) +6 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) +--- +>>>function greet(greeting) { +1-> +2 >^^^^^^^^^ +3 > ^^^^^ +4 > ^ +5 > ^^^^^^^^ +1-> + > +2 >function +3 > greet +4 > ( +5 > greeting: string +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +3 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) +4 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(2, 24) Source(2, 32) + SourceIndex(0) +--- +>>> greetings++; +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^-> +1 >): number { + > +2 > greetings +3 > ++ +4 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) name (greet) +2 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) name (greet) +3 >Emitted(3, 16) Source(3, 16) + SourceIndex(0) name (greet) +4 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (greet) +--- +>>> return greetings; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1-> + > +2 > return +3 > +4 > greetings +5 > ; +1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (greet) +2 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) name (greet) +3 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) name (greet) +4 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) name (greet) +5 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) name (greet) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(5, 1) + SourceIndex(0) name (greet) +2 >Emitted(5, 2) Source(5, 2) + SourceIndex(0) name (greet) +--- +>>>function greet2(greeting, n, x) { +1-> +2 >^^^^^^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^^-> +1-> + > +2 >function +3 > greet2 +4 > ( +5 > greeting: string +6 > , +7 > n = 10 +8 > , +9 > x?: string +1->Emitted(6, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(6, 10) Source(6, 10) + SourceIndex(0) +3 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(6, 17) Source(6, 17) + SourceIndex(0) +5 >Emitted(6, 25) Source(6, 33) + SourceIndex(0) +6 >Emitted(6, 27) Source(6, 35) + SourceIndex(0) +7 >Emitted(6, 28) Source(6, 41) + SourceIndex(0) +8 >Emitted(6, 30) Source(6, 43) + SourceIndex(0) +9 >Emitted(6, 31) Source(6, 53) + SourceIndex(0) +--- +>>> if (n === void 0) { n = 10; } +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^ +1-> +2 > n = 10 +3 > +4 > n = 10 +1->Emitted(7, 5) Source(6, 35) + SourceIndex(0) name (greet2) +2 >Emitted(7, 22) Source(6, 41) + SourceIndex(0) name (greet2) +3 >Emitted(7, 25) Source(6, 35) + SourceIndex(0) name (greet2) +4 >Emitted(7, 31) Source(6, 41) + SourceIndex(0) name (greet2) +--- +>>> var restParams = []; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >, x?: string, +2 > ...restParams: string[] +1 >Emitted(8, 5) Source(6, 55) + SourceIndex(0) name (greet2) +2 >Emitted(8, 25) Source(6, 78) + SourceIndex(0) name (greet2) +--- +>>> for (var _i = 3; _i < arguments.length; _i++) { +1->^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^ +1-> +2 > ...restParams: string[] +3 > +4 > ...restParams: string[] +5 > +6 > ...restParams: string[] +1->Emitted(9, 10) Source(6, 55) + SourceIndex(0) name (greet2) +2 >Emitted(9, 21) Source(6, 78) + SourceIndex(0) name (greet2) +3 >Emitted(9, 22) Source(6, 55) + SourceIndex(0) name (greet2) +4 >Emitted(9, 44) Source(6, 78) + SourceIndex(0) name (greet2) +5 >Emitted(9, 45) Source(6, 55) + SourceIndex(0) name (greet2) +6 >Emitted(9, 49) Source(6, 78) + SourceIndex(0) name (greet2) +--- +>>> restParams[_i - 3] = arguments[_i]; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...restParams: string[] +1 >Emitted(10, 9) Source(6, 55) + SourceIndex(0) name (greet2) +2 >Emitted(10, 44) Source(6, 78) + SourceIndex(0) name (greet2) +--- +>>> } +>>> greetings++; +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^-> +1 >): number { + > +2 > greetings +3 > ++ +4 > ; +1 >Emitted(12, 5) Source(7, 5) + SourceIndex(0) name (greet2) +2 >Emitted(12, 14) Source(7, 14) + SourceIndex(0) name (greet2) +3 >Emitted(12, 16) Source(7, 16) + SourceIndex(0) name (greet2) +4 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) name (greet2) +--- +>>> return greetings; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1-> + > +2 > return +3 > +4 > greetings +5 > ; +1->Emitted(13, 5) Source(8, 5) + SourceIndex(0) name (greet2) +2 >Emitted(13, 11) Source(8, 11) + SourceIndex(0) name (greet2) +3 >Emitted(13, 12) Source(8, 12) + SourceIndex(0) name (greet2) +4 >Emitted(13, 21) Source(8, 21) + SourceIndex(0) name (greet2) +5 >Emitted(13, 22) Source(8, 22) + SourceIndex(0) name (greet2) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(9, 1) + SourceIndex(0) name (greet2) +2 >Emitted(14, 2) Source(9, 2) + SourceIndex(0) name (greet2) +--- +>>>function foo(greeting, n, x) { +1-> +2 >^^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^^^^^-> +1-> + > +2 >function +3 > foo +4 > ( +5 > greeting: string +6 > , +7 > n = 10 +8 > , +9 > x?: string +1->Emitted(15, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(15, 10) Source(10, 10) + SourceIndex(0) +3 >Emitted(15, 13) Source(10, 13) + SourceIndex(0) +4 >Emitted(15, 14) Source(10, 14) + SourceIndex(0) +5 >Emitted(15, 22) Source(10, 30) + SourceIndex(0) +6 >Emitted(15, 24) Source(10, 32) + SourceIndex(0) +7 >Emitted(15, 25) Source(10, 38) + SourceIndex(0) +8 >Emitted(15, 27) Source(10, 40) + SourceIndex(0) +9 >Emitted(15, 28) Source(10, 50) + SourceIndex(0) +--- +>>> if (n === void 0) { n = 10; } +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^ +1-> +2 > n = 10 +3 > +4 > n = 10 +1->Emitted(16, 5) Source(10, 32) + SourceIndex(0) name (foo) +2 >Emitted(16, 22) Source(10, 38) + SourceIndex(0) name (foo) +3 >Emitted(16, 25) Source(10, 32) + SourceIndex(0) name (foo) +4 >Emitted(16, 31) Source(10, 38) + SourceIndex(0) name (foo) +--- +>>> var restParams = []; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >, x?: string, +2 > ...restParams: string[] +1 >Emitted(17, 5) Source(10, 52) + SourceIndex(0) name (foo) +2 >Emitted(17, 25) Source(10, 75) + SourceIndex(0) name (foo) +--- +>>> for (var _i = 3; _i < arguments.length; _i++) { +1->^^^^^^^^^ +2 > ^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^ +1-> +2 > ...restParams: string[] +3 > +4 > ...restParams: string[] +5 > +6 > ...restParams: string[] +1->Emitted(18, 10) Source(10, 52) + SourceIndex(0) name (foo) +2 >Emitted(18, 21) Source(10, 75) + SourceIndex(0) name (foo) +3 >Emitted(18, 22) Source(10, 52) + SourceIndex(0) name (foo) +4 >Emitted(18, 44) Source(10, 75) + SourceIndex(0) name (foo) +5 >Emitted(18, 45) Source(10, 52) + SourceIndex(0) name (foo) +6 >Emitted(18, 49) Source(10, 75) + SourceIndex(0) name (foo) +--- +>>> restParams[_i - 3] = arguments[_i]; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...restParams: string[] +1 >Emitted(19, 9) Source(10, 52) + SourceIndex(0) name (foo) +2 >Emitted(19, 44) Source(10, 75) + SourceIndex(0) name (foo) +--- +>>> } +>>> return; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +1 >) + >{ + > +2 > return +3 > ; +1 >Emitted(21, 5) Source(12, 5) + SourceIndex(0) name (foo) +2 >Emitted(21, 11) Source(12, 11) + SourceIndex(0) name (foo) +3 >Emitted(21, 12) Source(12, 12) + SourceIndex(0) name (foo) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(22, 1) Source(13, 1) + SourceIndex(0) name (foo) +2 >Emitted(22, 2) Source(13, 2) + SourceIndex(0) name (foo) +--- +>>>//# sourceMappingURL=sourceMapValidationFunctions.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationIfElse.js b/tests/baselines/reference/sourceMapValidationIfElse.js new file mode 100644 index 0000000000000..32d770832ed4c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationIfElse.js @@ -0,0 +1,39 @@ +//// [sourceMapValidationIfElse.ts] +var i = 10; +if (i == 10) { + i++; +} else +{ +} +if (i == 10) +{ + i++; +} +else if (i == 20) { + i--; +} else if (i == 30) { + i += 70; +} else { + i--; +} + +//// [sourceMapValidationIfElse.js] +var i = 10; +if (i == 10) { + i++; +} +else { +} +if (i == 10) { + i++; +} +else if (i == 20) { + i--; +} +else if (i == 30) { + i += 70; +} +else { + i--; +} +//# sourceMappingURL=sourceMapValidationIfElse.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationIfElse.js.map b/tests/baselines/reference/sourceMapValidationIfElse.js.map new file mode 100644 index 0000000000000..d0414b5c1a54b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationIfElse.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationIfElse.js.map] +{"version":3,"file":"sourceMapValidationIfElse.js","sourceRoot":"","sources":["sourceMapValidationIfElse.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACV,CAAC,EAAE,CAAC;AACR,CAAC;AAAC,IAAI,CACN,CAAC;AACD,CAAC;AACD,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CACZ,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACf,CAAC,EAAE,CAAC;AACR,CAAC;AAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjB,CAAC,IAAI,EAAE,CAAC;AACZ,CAAC;AAAC,IAAI,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt b/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt new file mode 100644 index 0000000000000..100f44400d3ac --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt @@ -0,0 +1,344 @@ +=================================================================== +JsFile: sourceMapValidationIfElse.js +mapUrl: sourceMapValidationIfElse.js.map +sourceRoot: +sources: sourceMapValidationIfElse.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationIfElse.js +sourceFile:sourceMapValidationIfElse.ts +------------------------------------------------------------------- +>>>var i = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^-> +1 > +2 >var +3 > i +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +--- +>>>if (i == 10) { +1-> +2 >^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^ +7 > ^^ +8 > ^ +9 > ^ +10> ^ +1-> + > +2 >if +3 > +4 > ( +5 > i +6 > == +7 > 10 +8 > ) +9 > +10> { +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 3) Source(2, 3) + SourceIndex(0) +3 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) +4 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +5 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) +6 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +7 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +8 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +9 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +10>Emitted(2, 15) Source(2, 15) + SourceIndex(0) +--- +>>> i++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > i +3 > ++ +4 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(3, 8) Source(3, 8) + SourceIndex(0) +4 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +1-> +2 >else +3 > + > +4 > { +1->Emitted(5, 1) Source(4, 3) + SourceIndex(0) +2 >Emitted(5, 5) Source(4, 7) + SourceIndex(0) +3 >Emitted(5, 6) Source(5, 1) + SourceIndex(0) +4 >Emitted(5, 7) Source(5, 2) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) +--- +>>>if (i == 10) { +1-> +2 >^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^ +7 > ^^ +8 > ^ +9 > ^ +10> ^ +1-> + > +2 >if +3 > +4 > ( +5 > i +6 > == +7 > 10 +8 > ) +9 > + > +10> { +1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(7, 3) Source(7, 3) + SourceIndex(0) +3 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) +4 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +5 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) +6 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +7 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +8 >Emitted(7, 13) Source(7, 13) + SourceIndex(0) +9 >Emitted(7, 14) Source(8, 1) + SourceIndex(0) +10>Emitted(7, 15) Source(8, 2) + SourceIndex(0) +--- +>>> i++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > i +3 > ++ +4 > ; +1 >Emitted(8, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(8, 6) Source(9, 6) + SourceIndex(0) +3 >Emitted(8, 8) Source(9, 8) + SourceIndex(0) +4 >Emitted(8, 9) Source(9, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) +--- +>>>else if (i == 20) { +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^^^^ +9 > ^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >else +3 > +4 > if +5 > +6 > ( +7 > i +8 > == +9 > 20 +10> ) +11> +12> { +1->Emitted(10, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(11, 6) + SourceIndex(0) +4 >Emitted(10, 8) Source(11, 8) + SourceIndex(0) +5 >Emitted(10, 9) Source(11, 9) + SourceIndex(0) +6 >Emitted(10, 10) Source(11, 10) + SourceIndex(0) +7 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) +8 >Emitted(10, 15) Source(11, 15) + SourceIndex(0) +9 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) +10>Emitted(10, 18) Source(11, 18) + SourceIndex(0) +11>Emitted(10, 19) Source(11, 19) + SourceIndex(0) +12>Emitted(10, 20) Source(11, 20) + SourceIndex(0) +--- +>>> i--; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > i +3 > -- +4 > ; +1 >Emitted(11, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(11, 6) Source(12, 6) + SourceIndex(0) +3 >Emitted(11, 8) Source(12, 8) + SourceIndex(0) +4 >Emitted(11, 9) Source(12, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) +--- +>>>else if (i == 30) { +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^^^^ +9 > ^^ +10> ^ +11> ^ +12> ^ +1-> +2 >else +3 > +4 > if +5 > +6 > ( +7 > i +8 > == +9 > 30 +10> ) +11> +12> { +1->Emitted(13, 1) Source(13, 3) + SourceIndex(0) +2 >Emitted(13, 5) Source(13, 7) + SourceIndex(0) +3 >Emitted(13, 6) Source(13, 8) + SourceIndex(0) +4 >Emitted(13, 8) Source(13, 10) + SourceIndex(0) +5 >Emitted(13, 9) Source(13, 11) + SourceIndex(0) +6 >Emitted(13, 10) Source(13, 12) + SourceIndex(0) +7 >Emitted(13, 11) Source(13, 13) + SourceIndex(0) +8 >Emitted(13, 15) Source(13, 17) + SourceIndex(0) +9 >Emitted(13, 17) Source(13, 19) + SourceIndex(0) +10>Emitted(13, 18) Source(13, 20) + SourceIndex(0) +11>Emitted(13, 19) Source(13, 21) + SourceIndex(0) +12>Emitted(13, 20) Source(13, 22) + SourceIndex(0) +--- +>>> i += 70; +1 >^^^^ +2 > ^ +3 > ^^^^ +4 > ^^ +5 > ^ +1 > + > +2 > i +3 > += +4 > 70 +5 > ; +1 >Emitted(14, 5) Source(14, 5) + SourceIndex(0) +2 >Emitted(14, 6) Source(14, 6) + SourceIndex(0) +3 >Emitted(14, 10) Source(14, 10) + SourceIndex(0) +4 >Emitted(14, 12) Source(14, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(14, 13) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(15, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^-> +1-> +2 >else +3 > +4 > { +1->Emitted(16, 1) Source(15, 3) + SourceIndex(0) +2 >Emitted(16, 5) Source(15, 7) + SourceIndex(0) +3 >Emitted(16, 6) Source(15, 8) + SourceIndex(0) +4 >Emitted(16, 7) Source(15, 9) + SourceIndex(0) +--- +>>> i--; +1->^^^^ +2 > ^ +3 > ^^ +4 > ^ +1-> + > +2 > i +3 > -- +4 > ; +1->Emitted(17, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(17, 6) Source(16, 6) + SourceIndex(0) +3 >Emitted(17, 8) Source(16, 8) + SourceIndex(0) +4 >Emitted(17, 9) Source(16, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(17, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationIfElse.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationImport.js b/tests/baselines/reference/sourceMapValidationImport.js new file mode 100644 index 0000000000000..171dd96271fd8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationImport.js @@ -0,0 +1,25 @@ +//// [sourceMapValidationImport.ts] +export module m { + export class c { + } +} +import a = m.c; +export import b = m.c; +var x = new a(); +var y = new b(); + +//// [sourceMapValidationImport.js] +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; +})(exports.m || (exports.m = {})); +var m = exports.m; +var a = m.c; +exports.b = m.c; +var x = new a(); +var y = new exports.b(); +//# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationImport.js.map b/tests/baselines/reference/sourceMapValidationImport.js.map new file mode 100644 index 0000000000000..9577b41df6110 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationImport.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationImport.js.map] +{"version":3,"file":"sourceMapValidationImport.js","sourceRoot":"","sources":["sourceMapValidationImport.ts"],"names":["m","m.c","m.c.constructor"],"mappings":"AAAA,WAAc,CAAC,EAAC,CAAC;IACbA,IAAaA,CAACA;QAAdC,SAAaA,CAACA;QACdC,CAACA;QAADD,QAACA;IAADA,CAACA,AADDD,IACCA;IADYA,GAACA,GAADA,CACZA,CAAAA;AACLA,CAACA,EAHa,SAAC,KAAD,SAAC,QAGd;AAHD,IAAc,CAAC,GAAD,SAGb,CAAA;AACD,IAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACD,SAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtB,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,IAAI,CAAC,GAAG,IAAI,SAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt b/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt new file mode 100644 index 0000000000000..be663d50750ad --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationImport.sourcemap.txt @@ -0,0 +1,265 @@ +=================================================================== +JsFile: sourceMapValidationImport.js +mapUrl: sourceMapValidationImport.js.map +sourceRoot: +sources: sourceMapValidationImport.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationImport.js +sourceFile:sourceMapValidationImport.ts +------------------------------------------------------------------- +>>>(function (m) { +1 > +2 >^^^^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^-> +1 > +2 >export module +3 > m +4 > +5 > { +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 12) Source(1, 15) + SourceIndex(0) +3 >Emitted(1, 13) Source(1, 16) + SourceIndex(0) +4 >Emitted(1, 15) Source(1, 17) + SourceIndex(0) +5 >Emitted(1, 16) Source(1, 18) + SourceIndex(0) +--- +>>> var c = (function () { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (m) +2 >Emitted(2, 9) Source(2, 18) + SourceIndex(0) name (m) +3 >Emitted(2, 10) Source(2, 19) + SourceIndex(0) name (m) +--- +>>> function c() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> +2 > export class +3 > c +1->Emitted(3, 9) Source(2, 5) + SourceIndex(0) name (m.c) +2 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) name (m.c) +3 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) name (m.c) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { + > +2 > } +1 >Emitted(4, 9) Source(3, 5) + SourceIndex(0) name (m.c.constructor) +2 >Emitted(4, 10) Source(3, 6) + SourceIndex(0) name (m.c.constructor) +--- +>>> return c; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 9) Source(3, 5) + SourceIndex(0) name (m.c) +2 >Emitted(5, 17) Source(3, 6) + SourceIndex(0) name (m.c) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^-> +1 > +2 > } +3 > +4 > export class c { + > } +1 >Emitted(6, 5) Source(3, 5) + SourceIndex(0) name (m.c) +2 >Emitted(6, 6) Source(3, 6) + SourceIndex(0) name (m.c) +3 >Emitted(6, 6) Source(2, 5) + SourceIndex(0) name (m) +4 >Emitted(6, 10) Source(3, 6) + SourceIndex(0) name (m) +--- +>>> m.c = c; +1->^^^^ +2 > ^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> +2 > c +3 > +4 > c { + > } +5 > +1->Emitted(7, 5) Source(2, 18) + SourceIndex(0) name (m) +2 >Emitted(7, 8) Source(2, 19) + SourceIndex(0) name (m) +3 >Emitted(7, 11) Source(2, 18) + SourceIndex(0) name (m) +4 >Emitted(7, 12) Source(3, 6) + SourceIndex(0) name (m) +5 >Emitted(7, 13) Source(3, 6) + SourceIndex(0) name (m) +--- +>>>})(exports.m || (exports.m = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^^^^^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > m +5 > +6 > m +7 > { + > export class c { + > } + > } +1->Emitted(8, 1) Source(4, 1) + SourceIndex(0) name (m) +2 >Emitted(8, 2) Source(4, 2) + SourceIndex(0) name (m) +3 >Emitted(8, 4) Source(1, 15) + SourceIndex(0) +4 >Emitted(8, 13) Source(1, 16) + SourceIndex(0) +5 >Emitted(8, 18) Source(1, 15) + SourceIndex(0) +6 >Emitted(8, 27) Source(1, 16) + SourceIndex(0) +7 >Emitted(8, 35) Source(4, 2) + SourceIndex(0) +--- +>>>var m = exports.m; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^^^^ +6 > ^ +1 > +2 >export module +3 > m +4 > +5 > m { + > export class c { + > } + > } +6 > +1 >Emitted(9, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(1, 15) + SourceIndex(0) +3 >Emitted(9, 6) Source(1, 16) + SourceIndex(0) +4 >Emitted(9, 9) Source(1, 15) + SourceIndex(0) +5 >Emitted(9, 18) Source(4, 2) + SourceIndex(0) +6 >Emitted(9, 19) Source(4, 2) + SourceIndex(0) +--- +>>>var a = m.c; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^-> +1 > + > +2 >import +3 > a +4 > = +5 > m +6 > . +7 > c +8 > ; +1 >Emitted(10, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(5, 8) + SourceIndex(0) +3 >Emitted(10, 6) Source(5, 9) + SourceIndex(0) +4 >Emitted(10, 9) Source(5, 12) + SourceIndex(0) +5 >Emitted(10, 10) Source(5, 13) + SourceIndex(0) +6 >Emitted(10, 11) Source(5, 14) + SourceIndex(0) +7 >Emitted(10, 12) Source(5, 15) + SourceIndex(0) +8 >Emitted(10, 13) Source(5, 16) + SourceIndex(0) +--- +>>>exports.b = m.c; +1-> +2 >^^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^-> +1-> + >export import +2 >b +3 > = +4 > m +5 > . +6 > c +7 > ; +1->Emitted(11, 1) Source(6, 15) + SourceIndex(0) +2 >Emitted(11, 10) Source(6, 16) + SourceIndex(0) +3 >Emitted(11, 13) Source(6, 19) + SourceIndex(0) +4 >Emitted(11, 14) Source(6, 20) + SourceIndex(0) +5 >Emitted(11, 15) Source(6, 21) + SourceIndex(0) +6 >Emitted(11, 16) Source(6, 22) + SourceIndex(0) +7 >Emitted(11, 17) Source(6, 23) + SourceIndex(0) +--- +>>>var x = new a(); +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^-> +1-> + > +2 >var +3 > x +4 > = +5 > new +6 > a +7 > () +8 > ; +1->Emitted(12, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(12, 6) Source(7, 6) + SourceIndex(0) +4 >Emitted(12, 9) Source(7, 9) + SourceIndex(0) +5 >Emitted(12, 13) Source(7, 13) + SourceIndex(0) +6 >Emitted(12, 14) Source(7, 14) + SourceIndex(0) +7 >Emitted(12, 16) Source(7, 16) + SourceIndex(0) +8 >Emitted(12, 17) Source(7, 17) + SourceIndex(0) +--- +>>>var y = new exports.b(); +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > y +4 > = +5 > new +6 > b +7 > () +8 > ; +1->Emitted(13, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(13, 6) Source(8, 6) + SourceIndex(0) +4 >Emitted(13, 9) Source(8, 9) + SourceIndex(0) +5 >Emitted(13, 13) Source(8, 13) + SourceIndex(0) +6 >Emitted(13, 22) Source(8, 14) + SourceIndex(0) +7 >Emitted(13, 24) Source(8, 16) + SourceIndex(0) +8 >Emitted(13, 25) Source(8, 17) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationImport.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js b/tests/baselines/reference/sourceMapValidationLabeled.js new file mode 100644 index 0000000000000..7aabc47ea4ea0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.js @@ -0,0 +1,7 @@ +//// [sourceMapValidationLabeled.ts] +x: +var b = 10; + +//// [sourceMapValidationLabeled.js] +x: var b = 10; +//# sourceMappingURL=sourceMapValidationLabeled.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.js.map b/tests/baselines/reference/sourceMapValidationLabeled.js.map new file mode 100644 index 0000000000000..d1219f9896ffb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationLabeled.js.map] +{"version":3,"file":"sourceMapValidationLabeled.js","sourceRoot":"","sources":["sourceMapValidationLabeled.ts"],"names":[],"mappings":"AAAA,CAAC,EACD,IAAI,CAAC,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt new file mode 100644 index 0000000000000..007208c78f95c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationLabeled.sourcemap.txt @@ -0,0 +1,39 @@ +=================================================================== +JsFile: sourceMapValidationLabeled.js +mapUrl: sourceMapValidationLabeled.js.map +sourceRoot: +sources: sourceMapValidationLabeled.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationLabeled.js +sourceFile:sourceMapValidationLabeled.ts +------------------------------------------------------------------- +>>>x: var b = 10; +1 > +2 >^ +3 > ^^ +4 > ^^^^ +5 > ^ +6 > ^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >x +3 > : + > +4 > var +5 > b +6 > = +7 > 10 +8 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 2) Source(1, 2) + SourceIndex(0) +3 >Emitted(1, 4) Source(2, 1) + SourceIndex(0) +4 >Emitted(1, 8) Source(2, 5) + SourceIndex(0) +5 >Emitted(1, 9) Source(2, 6) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 9) + SourceIndex(0) +7 >Emitted(1, 14) Source(2, 11) + SourceIndex(0) +8 >Emitted(1, 15) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationLabeled.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.js b/tests/baselines/reference/sourceMapValidationModule.js new file mode 100644 index 0000000000000..6375e45d445e6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationModule.js @@ -0,0 +1,33 @@ +//// [sourceMapValidationModule.ts] +module m2 { + var a = 10; + a++; +} +module m3 { + module m4 { + export var x = 30; + } + + export function foo() { + return m4.x; + } +} + +//// [sourceMapValidationModule.js] +var m2; +(function (m2) { + var a = 10; + a++; +})(m2 || (m2 = {})); +var m3; +(function (m3) { + var m4; + (function (m4) { + m4.x = 30; + })(m4 || (m4 = {})); + function foo() { + return m4.x; + } + m3.foo = foo; +})(m3 || (m3 = {})); +//# sourceMappingURL=sourceMapValidationModule.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.js.map b/tests/baselines/reference/sourceMapValidationModule.js.map new file mode 100644 index 0000000000000..c601c045cc744 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationModule.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationModule.js.map] +{"version":3,"file":"sourceMapValidationModule.js","sourceRoot":"","sources":["sourceMapValidationModule.ts"],"names":["m2","m3","m3.m4","m3.foo"],"mappings":"AAAA,IAAO,EAAE,CAGR;AAHD,WAAO,EAAE,EAAC,CAAC;IACPA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA,EAAEA,CAACA;AACRA,CAACA,EAHM,EAAE,KAAF,EAAE,QAGR;AACD,IAAO,EAAE,CAQR;AARD,WAAO,EAAE,EAAC,CAAC;IACPC,IAAOA,EAAEA,CAERA;IAFDA,WAAOA,EAAEA,EAACA,CAACA;QACIC,IAACA,GAAGA,EAAEA,CAACA;IACtBA,CAACA,EAFMD,EAAEA,KAAFA,EAAEA,QAERA;IAEDA,SAAgBA,GAAGA;QACfE,MAAMA,CAACA,EAAEA,CAACA,CAACA,CAACA;IAChBA,CAACA;IAFeF,MAAGA,GAAHA,GAEfA,CAAAA;AACLA,CAACA,EARM,EAAE,KAAF,EAAE,QAQR"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt b/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt new file mode 100644 index 0000000000000..f20aff9ad9721 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt @@ -0,0 +1,332 @@ +=================================================================== +JsFile: sourceMapValidationModule.js +mapUrl: sourceMapValidationModule.js.map +sourceRoot: +sources: sourceMapValidationModule.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationModule.js +sourceFile:sourceMapValidationModule.ts +------------------------------------------------------------------- +>>>var m2; +1 > +2 >^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > m2 +4 > { + > var a = 10; + > a++; + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 8) Source(4, 2) + SourceIndex(0) +--- +>>>(function (m2) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +1-> +2 >module +3 > m2 +4 > +5 > { +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0) +3 >Emitted(2, 14) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 16) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 17) Source(1, 12) + SourceIndex(0) +--- +>>> var a = 10; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1 > + > +2 > var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) name (m2) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) name (m2) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) name (m2) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) name (m2) +5 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) name (m2) +6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) name (m2) +--- +>>> a++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^-> +1 > + > +2 > a +3 > ++ +4 > ; +1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) name (m2) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) name (m2) +3 >Emitted(4, 8) Source(3, 8) + SourceIndex(0) name (m2) +4 >Emitted(4, 9) Source(3, 9) + SourceIndex(0) name (m2) +--- +>>>})(m2 || (m2 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > m2 +5 > +6 > m2 +7 > { + > var a = 10; + > a++; + > } +1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) name (m2) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) name (m2) +3 >Emitted(5, 4) Source(1, 8) + SourceIndex(0) +4 >Emitted(5, 6) Source(1, 10) + SourceIndex(0) +5 >Emitted(5, 11) Source(1, 8) + SourceIndex(0) +6 >Emitted(5, 13) Source(1, 10) + SourceIndex(0) +7 >Emitted(5, 21) Source(4, 2) + SourceIndex(0) +--- +>>>var m3; +1 > +2 >^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + > +2 >module +3 > m3 +4 > { + > module m4 { + > export var x = 30; + > } + > + > export function foo() { + > return m4.x; + > } + > } +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(5, 8) + SourceIndex(0) +3 >Emitted(6, 7) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 8) Source(13, 2) + SourceIndex(0) +--- +>>>(function (m3) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +1-> +2 >module +3 > m3 +4 > +5 > { +1->Emitted(7, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(7, 12) Source(5, 8) + SourceIndex(0) +3 >Emitted(7, 14) Source(5, 10) + SourceIndex(0) +4 >Emitted(7, 16) Source(5, 11) + SourceIndex(0) +5 >Emitted(7, 17) Source(5, 12) + SourceIndex(0) +--- +>>> var m4; +1 >^^^^ +2 > ^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + > +2 > module +3 > m4 +4 > { + > export var x = 30; + > } +1 >Emitted(8, 5) Source(6, 5) + SourceIndex(0) name (m3) +2 >Emitted(8, 9) Source(6, 12) + SourceIndex(0) name (m3) +3 >Emitted(8, 11) Source(6, 14) + SourceIndex(0) name (m3) +4 >Emitted(8, 12) Source(8, 6) + SourceIndex(0) name (m3) +--- +>>> (function (m4) { +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +1-> +2 > module +3 > m4 +4 > +5 > { +1->Emitted(9, 5) Source(6, 5) + SourceIndex(0) name (m3) +2 >Emitted(9, 16) Source(6, 12) + SourceIndex(0) name (m3) +3 >Emitted(9, 18) Source(6, 14) + SourceIndex(0) name (m3) +4 >Emitted(9, 20) Source(6, 15) + SourceIndex(0) name (m3) +5 >Emitted(9, 21) Source(6, 16) + SourceIndex(0) name (m3) +--- +>>> m4.x = 30; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^-> +1 > + > export var +2 > x +3 > = +4 > 30 +5 > ; +1 >Emitted(10, 9) Source(7, 20) + SourceIndex(0) name (m3.m4) +2 >Emitted(10, 13) Source(7, 21) + SourceIndex(0) name (m3.m4) +3 >Emitted(10, 16) Source(7, 24) + SourceIndex(0) name (m3.m4) +4 >Emitted(10, 18) Source(7, 26) + SourceIndex(0) name (m3.m4) +5 >Emitted(10, 19) Source(7, 27) + SourceIndex(0) name (m3.m4) +--- +>>> })(m4 || (m4 = {})); +1->^^^^ +2 > ^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +1-> + > +2 > } +3 > +4 > m4 +5 > +6 > m4 +7 > { + > export var x = 30; + > } +1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) name (m3.m4) +2 >Emitted(11, 6) Source(8, 6) + SourceIndex(0) name (m3.m4) +3 >Emitted(11, 8) Source(6, 12) + SourceIndex(0) name (m3) +4 >Emitted(11, 10) Source(6, 14) + SourceIndex(0) name (m3) +5 >Emitted(11, 15) Source(6, 12) + SourceIndex(0) name (m3) +6 >Emitted(11, 17) Source(6, 14) + SourceIndex(0) name (m3) +7 >Emitted(11, 25) Source(8, 6) + SourceIndex(0) name (m3) +--- +>>> function foo() { +1 >^^^^ +2 > ^^^^^^^^^ +3 > ^^^ +4 > ^^^^^-> +1 > + > + > +2 > export function +3 > foo +1 >Emitted(12, 5) Source(10, 5) + SourceIndex(0) name (m3) +2 >Emitted(12, 14) Source(10, 21) + SourceIndex(0) name (m3) +3 >Emitted(12, 17) Source(10, 24) + SourceIndex(0) name (m3) +--- +>>> return m4.x; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +1->() { + > +2 > return +3 > +4 > m4 +5 > . +6 > x +7 > ; +1->Emitted(13, 9) Source(11, 9) + SourceIndex(0) name (m3.foo) +2 >Emitted(13, 15) Source(11, 15) + SourceIndex(0) name (m3.foo) +3 >Emitted(13, 16) Source(11, 16) + SourceIndex(0) name (m3.foo) +4 >Emitted(13, 18) Source(11, 18) + SourceIndex(0) name (m3.foo) +5 >Emitted(13, 19) Source(11, 19) + SourceIndex(0) name (m3.foo) +6 >Emitted(13, 20) Source(11, 20) + SourceIndex(0) name (m3.foo) +7 >Emitted(13, 21) Source(11, 21) + SourceIndex(0) name (m3.foo) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(14, 5) Source(12, 5) + SourceIndex(0) name (m3.foo) +2 >Emitted(14, 6) Source(12, 6) + SourceIndex(0) name (m3.foo) +--- +>>> m3.foo = foo; +1->^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^^^ +5 > ^ +6 > ^^^^-> +1-> +2 > foo +3 > +4 > foo() { + > return m4.x; + > } +5 > +1->Emitted(15, 5) Source(10, 21) + SourceIndex(0) name (m3) +2 >Emitted(15, 11) Source(10, 24) + SourceIndex(0) name (m3) +3 >Emitted(15, 14) Source(10, 21) + SourceIndex(0) name (m3) +4 >Emitted(15, 17) Source(12, 6) + SourceIndex(0) name (m3) +5 >Emitted(15, 18) Source(12, 6) + SourceIndex(0) name (m3) +--- +>>>})(m3 || (m3 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >} +3 > +4 > m3 +5 > +6 > m3 +7 > { + > module m4 { + > export var x = 30; + > } + > + > export function foo() { + > return m4.x; + > } + > } +1->Emitted(16, 1) Source(13, 1) + SourceIndex(0) name (m3) +2 >Emitted(16, 2) Source(13, 2) + SourceIndex(0) name (m3) +3 >Emitted(16, 4) Source(5, 8) + SourceIndex(0) +4 >Emitted(16, 6) Source(5, 10) + SourceIndex(0) +5 >Emitted(16, 11) Source(5, 8) + SourceIndex(0) +6 >Emitted(16, 13) Source(5, 10) + SourceIndex(0) +7 >Emitted(16, 21) Source(13, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationModule.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.js b/tests/baselines/reference/sourceMapValidationStatements.js new file mode 100644 index 0000000000000..85a4dc3388987 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationStatements.js @@ -0,0 +1,175 @@ +//// [sourceMapValidationStatements.ts] +function f() { + var y; + var x = 0; + for (var i = 0; i < 10; i++) { + x += i; + x *= 0; + } + if (x > 17) { + x /= 9; + } else { + x += 10; + x++; + } + var a = [ + 1, + 2, + 3 + ]; + var obj = { + z: 1, + q: "hello" + }; + for (var j in a) { + obj.z = a[j]; + var v = 10; + } + try { + obj.q = "ohhh"; + } catch (e) { + if (obj.z < 10) { + obj.z = 12; + } else { + obj.q = "hmm"; + } + } + try { + throw new Error(); + } catch (e1) { + var b = e1; + } finally { + y = 70; + } + with (obj) { + i = 2; + z = 10; + } + switch (obj.z) { + case 0: { + x++; + break; + + } + case 1: { + x--; + break; + + } + default: { + x *= 2; + x = 50; + break; + + } + } + while (x < 10) { + x++; + } + do { + x--; + } while (x > 4) + x = y; + var z = (x == 1) ? x + 1 : x - 1; + (x == 1) ? x + 1 : x - 1; + x === 1; + x = z = 40; + eval("y"); + return; +} +var b = function () { + var x = 10; + x = x + 1; +}; +f(); + +//// [sourceMapValidationStatements.js] +function f() { + var y; + var x = 0; + for (var i = 0; i < 10; i++) { + x += i; + x *= 0; + } + if (x > 17) { + x /= 9; + } + else { + x += 10; + x++; + } + var a = [ + 1, + 2, + 3 + ]; + var obj = { + z: 1, + q: "hello" + }; + for (var j in a) { + obj.z = a[j]; + var v = 10; + } + try { + obj.q = "ohhh"; + } + catch (e) { + if (obj.z < 10) { + obj.z = 12; + } + else { + obj.q = "hmm"; + } + } + try { + throw new Error(); + } + catch (e1) { + var b = e1; + } + finally { + y = 70; + } + with (obj) { + i = 2; + z = 10; + } + switch (obj.z) { + case 0: + { + x++; + break; + } + case 1: + { + x--; + break; + } + default: + { + x *= 2; + x = 50; + break; + } + } + while (x < 10) { + x++; + } + do { + x--; + } while (x > 4); + x = y; + var z = (x == 1) ? x + 1 : x - 1; + (x == 1) ? x + 1 : x - 1; + x === 1; + x = z = 40; + eval("y"); + return; +} +var b = function () { + var x = 10; + x = x + 1; +}; +f(); +//# sourceMappingURL=sourceMapValidationStatements.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map new file mode 100644 index 0000000000000..a8ff3d46038ca --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationStatements.js.map] +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA,SAAS,CAAC;IACNA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAAA,CAACA;QACGA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAATA,CAACA;QACCA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAAA,CAACA;QACGA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAAVA,CAACA;QACCA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAACA,CAACA;QACCA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA;YAASA,CAACA;gBACNA,CAACA,IAAIA,CAACA,CAACA;gBACPA,CAACA,GAAGA,EAAEA,CAACA;gBACPA,KAAKA,CAACA;YAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt new file mode 100644 index 0000000000000..d997557cdfebe --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -0,0 +1,1546 @@ +=================================================================== +JsFile: sourceMapValidationStatements.js +mapUrl: sourceMapValidationStatements.js.map +sourceRoot: +sources: sourceMapValidationStatements.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationStatements.js +sourceFile:sourceMapValidationStatements.ts +------------------------------------------------------------------- +>>>function f() { +1 > +2 >^^^^^^^^^ +3 > ^ +4 > ^-> +1 > +2 >function +3 > f +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +--- +>>> var y; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^ +5 > ^^^^^-> +1->() { + > +2 > var +3 > y +4 > ; +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (f) +2 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) name (f) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) name (f) +4 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) name (f) +--- +>>> var x = 0; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > var +3 > x +4 > = +5 > 0 +6 > ; +1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) name (f) +2 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (f) +3 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) name (f) +4 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) name (f) +5 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) name (f) +6 >Emitted(3, 15) Source(3, 15) + SourceIndex(0) name (f) +--- +>>> for (var i = 0; i < 10; i++) { +1->^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 10 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (f) +2 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) name (f) +3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) name (f) +4 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) name (f) +5 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) name (f) +6 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) name (f) +7 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) name (f) +8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) name (f) +9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) name (f) +10>Emitted(4, 21) Source(4, 21) + SourceIndex(0) name (f) +11>Emitted(4, 22) Source(4, 22) + SourceIndex(0) name (f) +12>Emitted(4, 25) Source(4, 25) + SourceIndex(0) name (f) +13>Emitted(4, 27) Source(4, 27) + SourceIndex(0) name (f) +14>Emitted(4, 29) Source(4, 29) + SourceIndex(0) name (f) +15>Emitted(4, 30) Source(4, 30) + SourceIndex(0) name (f) +16>Emitted(4, 32) Source(4, 32) + SourceIndex(0) name (f) +17>Emitted(4, 34) Source(4, 34) + SourceIndex(0) name (f) +18>Emitted(4, 35) Source(4, 35) + SourceIndex(0) name (f) +--- +>>> x += i; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^-> +1 > + > +2 > x +3 > += +4 > i +5 > ; +1 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) name (f) +2 >Emitted(5, 10) Source(5, 10) + SourceIndex(0) name (f) +3 >Emitted(5, 14) Source(5, 14) + SourceIndex(0) name (f) +4 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) name (f) +5 >Emitted(5, 16) Source(5, 16) + SourceIndex(0) name (f) +--- +>>> x *= 0; +1->^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^ +5 > ^ +1-> + > +2 > x +3 > *= +4 > 0 +5 > ; +1->Emitted(6, 9) Source(6, 9) + SourceIndex(0) name (f) +2 >Emitted(6, 10) Source(6, 10) + SourceIndex(0) name (f) +3 >Emitted(6, 14) Source(6, 14) + SourceIndex(0) name (f) +4 >Emitted(6, 15) Source(6, 15) + SourceIndex(0) name (f) +5 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) name (f) +2 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) name (f) +--- +>>> if (x > 17) { +1->^^^^ +2 > ^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^^ +8 > ^ +9 > ^ +10> ^ +1-> + > +2 > if +3 > +4 > ( +5 > x +6 > > +7 > 17 +8 > ) +9 > +10> { +1->Emitted(8, 5) Source(8, 5) + SourceIndex(0) name (f) +2 >Emitted(8, 7) Source(8, 7) + SourceIndex(0) name (f) +3 >Emitted(8, 8) Source(8, 8) + SourceIndex(0) name (f) +4 >Emitted(8, 9) Source(8, 9) + SourceIndex(0) name (f) +5 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) name (f) +6 >Emitted(8, 13) Source(8, 13) + SourceIndex(0) name (f) +7 >Emitted(8, 15) Source(8, 15) + SourceIndex(0) name (f) +8 >Emitted(8, 16) Source(8, 16) + SourceIndex(0) name (f) +9 >Emitted(8, 17) Source(8, 17) + SourceIndex(0) name (f) +10>Emitted(8, 18) Source(8, 18) + SourceIndex(0) name (f) +--- +>>> x /= 9; +1 >^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^ +5 > ^ +1 > + > +2 > x +3 > /= +4 > 9 +5 > ; +1 >Emitted(9, 9) Source(9, 9) + SourceIndex(0) name (f) +2 >Emitted(9, 10) Source(9, 10) + SourceIndex(0) name (f) +3 >Emitted(9, 14) Source(9, 14) + SourceIndex(0) name (f) +4 >Emitted(9, 15) Source(9, 15) + SourceIndex(0) name (f) +5 >Emitted(9, 16) Source(9, 16) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^-> +1 > + > +2 > } +1 >Emitted(10, 5) Source(10, 5) + SourceIndex(0) name (f) +2 >Emitted(10, 6) Source(10, 6) + SourceIndex(0) name (f) +--- +>>> else { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^-> +1-> +2 > else +3 > +4 > { +1->Emitted(11, 5) Source(10, 7) + SourceIndex(0) name (f) +2 >Emitted(11, 9) Source(10, 11) + SourceIndex(0) name (f) +3 >Emitted(11, 10) Source(10, 12) + SourceIndex(0) name (f) +4 >Emitted(11, 11) Source(10, 13) + SourceIndex(0) name (f) +--- +>>> x += 10; +1->^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^^ +5 > ^ +1-> + > +2 > x +3 > += +4 > 10 +5 > ; +1->Emitted(12, 9) Source(11, 9) + SourceIndex(0) name (f) +2 >Emitted(12, 10) Source(11, 10) + SourceIndex(0) name (f) +3 >Emitted(12, 14) Source(11, 14) + SourceIndex(0) name (f) +4 >Emitted(12, 16) Source(11, 16) + SourceIndex(0) name (f) +5 >Emitted(12, 17) Source(11, 17) + SourceIndex(0) name (f) +--- +>>> x++; +1 >^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > x +3 > ++ +4 > ; +1 >Emitted(13, 9) Source(12, 9) + SourceIndex(0) name (f) +2 >Emitted(13, 10) Source(12, 10) + SourceIndex(0) name (f) +3 >Emitted(13, 12) Source(12, 12) + SourceIndex(0) name (f) +4 >Emitted(13, 13) Source(12, 13) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(14, 5) Source(13, 5) + SourceIndex(0) name (f) +2 >Emitted(14, 6) Source(13, 6) + SourceIndex(0) name (f) +--- +>>> var a = [ +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +1-> + > +2 > var +3 > a +4 > = +1->Emitted(15, 5) Source(14, 5) + SourceIndex(0) name (f) +2 >Emitted(15, 9) Source(14, 9) + SourceIndex(0) name (f) +3 >Emitted(15, 10) Source(14, 10) + SourceIndex(0) name (f) +4 >Emitted(15, 13) Source(14, 13) + SourceIndex(0) name (f) +--- +>>> 1, +1 >^^^^^^^^ +2 > ^ +3 > ^^-> +1 >[ + > +2 > 1 +1 >Emitted(16, 9) Source(15, 9) + SourceIndex(0) name (f) +2 >Emitted(16, 10) Source(15, 10) + SourceIndex(0) name (f) +--- +>>> 2, +1->^^^^^^^^ +2 > ^ +3 > ^-> +1->, + > +2 > 2 +1->Emitted(17, 9) Source(16, 9) + SourceIndex(0) name (f) +2 >Emitted(17, 10) Source(16, 10) + SourceIndex(0) name (f) +--- +>>> 3 +1->^^^^^^^^ +2 > ^ +1->, + > +2 > 3 +1->Emitted(18, 9) Source(17, 9) + SourceIndex(0) name (f) +2 >Emitted(18, 10) Source(17, 10) + SourceIndex(0) name (f) +--- +>>> ]; +1 >^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> +1 > + > ] +2 > ; +1 >Emitted(19, 6) Source(18, 6) + SourceIndex(0) name (f) +2 >Emitted(19, 7) Source(18, 7) + SourceIndex(0) name (f) +--- +>>> var obj = { +1->^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^^^ +1-> + > +2 > var +3 > obj +4 > = +1->Emitted(20, 5) Source(19, 5) + SourceIndex(0) name (f) +2 >Emitted(20, 9) Source(19, 9) + SourceIndex(0) name (f) +3 >Emitted(20, 12) Source(19, 12) + SourceIndex(0) name (f) +4 >Emitted(20, 15) Source(19, 15) + SourceIndex(0) name (f) +--- +>>> z: 1, +1 >^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^-> +1 >{ + > +2 > z +3 > : +4 > 1 +1 >Emitted(21, 9) Source(20, 9) + SourceIndex(0) name (f) +2 >Emitted(21, 10) Source(20, 10) + SourceIndex(0) name (f) +3 >Emitted(21, 12) Source(20, 12) + SourceIndex(0) name (f) +4 >Emitted(21, 13) Source(20, 13) + SourceIndex(0) name (f) +--- +>>> q: "hello" +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^^^^^^^ +1->, + > +2 > q +3 > : +4 > "hello" +1->Emitted(22, 9) Source(21, 9) + SourceIndex(0) name (f) +2 >Emitted(22, 10) Source(21, 10) + SourceIndex(0) name (f) +3 >Emitted(22, 12) Source(21, 12) + SourceIndex(0) name (f) +4 >Emitted(22, 19) Source(21, 19) + SourceIndex(0) name (f) +--- +>>> }; +1 >^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 > + > } +2 > ; +1 >Emitted(23, 6) Source(22, 6) + SourceIndex(0) name (f) +2 >Emitted(23, 7) Source(22, 7) + SourceIndex(0) name (f) +--- +>>> for (var j in a) { +1->^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +1-> + > +2 > for +3 > +4 > ( +5 > var +6 > +7 > j +8 > in +9 > a +10> ) +11> +12> { +1->Emitted(24, 5) Source(23, 5) + SourceIndex(0) name (f) +2 >Emitted(24, 8) Source(23, 8) + SourceIndex(0) name (f) +3 >Emitted(24, 9) Source(23, 9) + SourceIndex(0) name (f) +4 >Emitted(24, 10) Source(23, 10) + SourceIndex(0) name (f) +5 >Emitted(24, 13) Source(23, 13) + SourceIndex(0) name (f) +6 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) name (f) +7 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) name (f) +8 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) name (f) +9 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) name (f) +10>Emitted(24, 21) Source(23, 21) + SourceIndex(0) name (f) +11>Emitted(24, 22) Source(23, 22) + SourceIndex(0) name (f) +12>Emitted(24, 23) Source(23, 23) + SourceIndex(0) name (f) +--- +>>> obj.z = a[j]; +1 >^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^ +1 > + > +2 > obj +3 > . +4 > z +5 > = +6 > a +7 > [ +8 > j +9 > ] +10> ; +1 >Emitted(25, 9) Source(24, 9) + SourceIndex(0) name (f) +2 >Emitted(25, 12) Source(24, 12) + SourceIndex(0) name (f) +3 >Emitted(25, 13) Source(24, 13) + SourceIndex(0) name (f) +4 >Emitted(25, 14) Source(24, 14) + SourceIndex(0) name (f) +5 >Emitted(25, 17) Source(24, 17) + SourceIndex(0) name (f) +6 >Emitted(25, 18) Source(24, 18) + SourceIndex(0) name (f) +7 >Emitted(25, 19) Source(24, 19) + SourceIndex(0) name (f) +8 >Emitted(25, 20) Source(24, 20) + SourceIndex(0) name (f) +9 >Emitted(25, 21) Source(24, 21) + SourceIndex(0) name (f) +10>Emitted(25, 22) Source(24, 22) + SourceIndex(0) name (f) +--- +>>> var v = 10; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1 > + > +2 > var +3 > v +4 > = +5 > 10 +6 > ; +1 >Emitted(26, 9) Source(25, 9) + SourceIndex(0) name (f) +2 >Emitted(26, 13) Source(25, 13) + SourceIndex(0) name (f) +3 >Emitted(26, 14) Source(25, 14) + SourceIndex(0) name (f) +4 >Emitted(26, 17) Source(25, 17) + SourceIndex(0) name (f) +5 >Emitted(26, 19) Source(25, 19) + SourceIndex(0) name (f) +6 >Emitted(26, 20) Source(25, 20) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^-> +1 > + > +2 > } +1 >Emitted(27, 5) Source(26, 5) + SourceIndex(0) name (f) +2 >Emitted(27, 6) Source(26, 6) + SourceIndex(0) name (f) +--- +>>> try { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^-> +1-> + > +2 > +3 > t +1->Emitted(28, 5) Source(27, 5) + SourceIndex(0) name (f) +2 >Emitted(28, 9) Source(27, 5) + SourceIndex(0) name (f) +3 >Emitted(28, 10) Source(27, 6) + SourceIndex(0) name (f) +--- +>>> obj.q = "ohhh"; +1->^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^^^^^^ +7 > ^ +1->ry { + > +2 > obj +3 > . +4 > q +5 > = +6 > "ohhh" +7 > ; +1->Emitted(29, 9) Source(28, 9) + SourceIndex(0) name (f) +2 >Emitted(29, 12) Source(28, 12) + SourceIndex(0) name (f) +3 >Emitted(29, 13) Source(28, 13) + SourceIndex(0) name (f) +4 >Emitted(29, 14) Source(28, 14) + SourceIndex(0) name (f) +5 >Emitted(29, 17) Source(28, 17) + SourceIndex(0) name (f) +6 >Emitted(29, 23) Source(28, 23) + SourceIndex(0) name (f) +7 >Emitted(29, 24) Source(28, 24) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(30, 5) Source(29, 5) + SourceIndex(0) name (f) +2 >Emitted(30, 6) Source(29, 7) + SourceIndex(0) name (f) +--- +>>> catch (e) { +1->^^^^ +2 > ^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^-> +1-> +2 > catch +3 > +4 > ( +5 > e +6 > ) +7 > +8 > c +1->Emitted(31, 5) Source(29, 7) + SourceIndex(0) name (f) +2 >Emitted(31, 10) Source(29, 12) + SourceIndex(0) name (f) +3 >Emitted(31, 11) Source(29, 13) + SourceIndex(0) name (f) +4 >Emitted(31, 12) Source(29, 14) + SourceIndex(0) name (f) +5 >Emitted(31, 13) Source(29, 15) + SourceIndex(0) name (f) +6 >Emitted(31, 14) Source(29, 16) + SourceIndex(0) name (f) +7 >Emitted(31, 15) Source(29, 7) + SourceIndex(0) name (f) +8 >Emitted(31, 16) Source(29, 8) + SourceIndex(0) name (f) +--- +>>> if (obj.z < 10) { +1->^^^^^^^^ +2 > ^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^ +9 > ^^ +10> ^ +11> ^ +12> ^ +1->atch (e) { + > +2 > if +3 > +4 > ( +5 > obj +6 > . +7 > z +8 > < +9 > 10 +10> ) +11> +12> { +1->Emitted(32, 9) Source(30, 9) + SourceIndex(0) name (f) +2 >Emitted(32, 11) Source(30, 11) + SourceIndex(0) name (f) +3 >Emitted(32, 12) Source(30, 12) + SourceIndex(0) name (f) +4 >Emitted(32, 13) Source(30, 13) + SourceIndex(0) name (f) +5 >Emitted(32, 16) Source(30, 16) + SourceIndex(0) name (f) +6 >Emitted(32, 17) Source(30, 17) + SourceIndex(0) name (f) +7 >Emitted(32, 18) Source(30, 18) + SourceIndex(0) name (f) +8 >Emitted(32, 21) Source(30, 21) + SourceIndex(0) name (f) +9 >Emitted(32, 23) Source(30, 23) + SourceIndex(0) name (f) +10>Emitted(32, 24) Source(30, 24) + SourceIndex(0) name (f) +11>Emitted(32, 25) Source(30, 25) + SourceIndex(0) name (f) +12>Emitted(32, 26) Source(30, 26) + SourceIndex(0) name (f) +--- +>>> obj.z = 12; +1 >^^^^^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1 > + > +2 > obj +3 > . +4 > z +5 > = +6 > 12 +7 > ; +1 >Emitted(33, 13) Source(31, 13) + SourceIndex(0) name (f) +2 >Emitted(33, 16) Source(31, 16) + SourceIndex(0) name (f) +3 >Emitted(33, 17) Source(31, 17) + SourceIndex(0) name (f) +4 >Emitted(33, 18) Source(31, 18) + SourceIndex(0) name (f) +5 >Emitted(33, 21) Source(31, 21) + SourceIndex(0) name (f) +6 >Emitted(33, 23) Source(31, 23) + SourceIndex(0) name (f) +7 >Emitted(33, 24) Source(31, 24) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^-> +1 > + > +2 > } +1 >Emitted(34, 9) Source(32, 9) + SourceIndex(0) name (f) +2 >Emitted(34, 10) Source(32, 10) + SourceIndex(0) name (f) +--- +>>> else { +1->^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^-> +1-> +2 > else +3 > +4 > { +1->Emitted(35, 9) Source(32, 11) + SourceIndex(0) name (f) +2 >Emitted(35, 13) Source(32, 15) + SourceIndex(0) name (f) +3 >Emitted(35, 14) Source(32, 16) + SourceIndex(0) name (f) +4 >Emitted(35, 15) Source(32, 17) + SourceIndex(0) name (f) +--- +>>> obj.q = "hmm"; +1->^^^^^^^^^^^^ +2 > ^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^^^^^ +7 > ^ +1-> + > +2 > obj +3 > . +4 > q +5 > = +6 > "hmm" +7 > ; +1->Emitted(36, 13) Source(33, 13) + SourceIndex(0) name (f) +2 >Emitted(36, 16) Source(33, 16) + SourceIndex(0) name (f) +3 >Emitted(36, 17) Source(33, 17) + SourceIndex(0) name (f) +4 >Emitted(36, 18) Source(33, 18) + SourceIndex(0) name (f) +5 >Emitted(36, 21) Source(33, 21) + SourceIndex(0) name (f) +6 >Emitted(36, 26) Source(33, 26) + SourceIndex(0) name (f) +7 >Emitted(36, 27) Source(33, 27) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(37, 9) Source(34, 9) + SourceIndex(0) name (f) +2 >Emitted(37, 10) Source(34, 10) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^-> +1 > + > +2 > } +1 >Emitted(38, 5) Source(35, 5) + SourceIndex(0) name (f) +2 >Emitted(38, 6) Source(35, 6) + SourceIndex(0) name (f) +--- +>>> try { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 > +3 > t +1->Emitted(39, 5) Source(36, 5) + SourceIndex(0) name (f) +2 >Emitted(39, 9) Source(36, 5) + SourceIndex(0) name (f) +3 >Emitted(39, 10) Source(36, 6) + SourceIndex(0) name (f) +--- +>>> throw new Error(); +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^ +6 > ^ +1->ry { + > +2 > throw +3 > new +4 > Error +5 > () +6 > ; +1->Emitted(40, 9) Source(37, 9) + SourceIndex(0) name (f) +2 >Emitted(40, 15) Source(37, 15) + SourceIndex(0) name (f) +3 >Emitted(40, 19) Source(37, 19) + SourceIndex(0) name (f) +4 >Emitted(40, 24) Source(37, 24) + SourceIndex(0) name (f) +5 >Emitted(40, 26) Source(37, 26) + SourceIndex(0) name (f) +6 >Emitted(40, 27) Source(37, 27) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(41, 5) Source(38, 5) + SourceIndex(0) name (f) +2 >Emitted(41, 6) Source(38, 7) + SourceIndex(0) name (f) +--- +>>> catch (e1) { +1->^^^^ +2 > ^^^^^ +3 > ^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^-> +1-> +2 > catch +3 > +4 > ( +5 > e1 +6 > ) +7 > +8 > c +1->Emitted(42, 5) Source(38, 7) + SourceIndex(0) name (f) +2 >Emitted(42, 10) Source(38, 12) + SourceIndex(0) name (f) +3 >Emitted(42, 11) Source(38, 13) + SourceIndex(0) name (f) +4 >Emitted(42, 12) Source(38, 14) + SourceIndex(0) name (f) +5 >Emitted(42, 14) Source(38, 16) + SourceIndex(0) name (f) +6 >Emitted(42, 15) Source(38, 17) + SourceIndex(0) name (f) +7 >Emitted(42, 16) Source(38, 7) + SourceIndex(0) name (f) +8 >Emitted(42, 17) Source(38, 8) + SourceIndex(0) name (f) +--- +>>> var b = e1; +1->^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1->atch (e1) { + > +2 > var +3 > b +4 > = +5 > e1 +6 > ; +1->Emitted(43, 9) Source(39, 9) + SourceIndex(0) name (f) +2 >Emitted(43, 13) Source(39, 13) + SourceIndex(0) name (f) +3 >Emitted(43, 14) Source(39, 14) + SourceIndex(0) name (f) +4 >Emitted(43, 17) Source(39, 17) + SourceIndex(0) name (f) +5 >Emitted(43, 19) Source(39, 19) + SourceIndex(0) name (f) +6 >Emitted(43, 20) Source(39, 20) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(44, 5) Source(40, 5) + SourceIndex(0) name (f) +2 >Emitted(44, 6) Source(40, 6) + SourceIndex(0) name (f) +--- +>>> finally { +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^-> +1-> +2 > f +1->Emitted(45, 13) Source(40, 7) + SourceIndex(0) name (f) +2 >Emitted(45, 14) Source(40, 8) + SourceIndex(0) name (f) +--- +>>> y = 70; +1->^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ +1->inally { + > +2 > y +3 > = +4 > 70 +5 > ; +1->Emitted(46, 9) Source(41, 9) + SourceIndex(0) name (f) +2 >Emitted(46, 10) Source(41, 10) + SourceIndex(0) name (f) +3 >Emitted(46, 13) Source(41, 13) + SourceIndex(0) name (f) +4 >Emitted(46, 15) Source(41, 15) + SourceIndex(0) name (f) +5 >Emitted(46, 16) Source(41, 16) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(47, 5) Source(42, 5) + SourceIndex(0) name (f) +2 >Emitted(47, 6) Source(42, 6) + SourceIndex(0) name (f) +--- +>>> with (obj) { +1->^^^^ +2 > ^^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +1-> + > +2 > with ( +3 > obj +4 > ) +5 > { +1->Emitted(48, 5) Source(43, 5) + SourceIndex(0) name (f) +2 >Emitted(48, 11) Source(43, 11) + SourceIndex(0) name (f) +3 >Emitted(48, 14) Source(43, 14) + SourceIndex(0) name (f) +4 >Emitted(48, 16) Source(43, 16) + SourceIndex(0) name (f) +5 >Emitted(48, 17) Source(43, 17) + SourceIndex(0) name (f) +--- +>>> i = 2; +1 >^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^-> +1 > + > +2 > i +3 > = +4 > 2 +5 > ; +1 >Emitted(49, 9) Source(44, 9) + SourceIndex(0) name (f) +2 >Emitted(49, 10) Source(44, 10) + SourceIndex(0) name (f) +3 >Emitted(49, 13) Source(44, 13) + SourceIndex(0) name (f) +4 >Emitted(49, 14) Source(44, 14) + SourceIndex(0) name (f) +5 >Emitted(49, 15) Source(44, 15) + SourceIndex(0) name (f) +--- +>>> z = 10; +1->^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ +1-> + > +2 > z +3 > = +4 > 10 +5 > ; +1->Emitted(50, 9) Source(45, 9) + SourceIndex(0) name (f) +2 >Emitted(50, 10) Source(45, 10) + SourceIndex(0) name (f) +3 >Emitted(50, 13) Source(45, 13) + SourceIndex(0) name (f) +4 >Emitted(50, 15) Source(45, 15) + SourceIndex(0) name (f) +5 >Emitted(50, 16) Source(45, 16) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(51, 5) Source(46, 5) + SourceIndex(0) name (f) +2 >Emitted(51, 6) Source(46, 6) + SourceIndex(0) name (f) +--- +>>> switch (obj.z) { +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^ +1-> + > +2 > switch +3 > +4 > ( +5 > obj +6 > . +7 > z +8 > ) +9 > +10> { +1->Emitted(52, 5) Source(47, 5) + SourceIndex(0) name (f) +2 >Emitted(52, 11) Source(47, 11) + SourceIndex(0) name (f) +3 >Emitted(52, 12) Source(47, 12) + SourceIndex(0) name (f) +4 >Emitted(52, 13) Source(47, 13) + SourceIndex(0) name (f) +5 >Emitted(52, 16) Source(47, 16) + SourceIndex(0) name (f) +6 >Emitted(52, 17) Source(47, 17) + SourceIndex(0) name (f) +7 >Emitted(52, 18) Source(47, 18) + SourceIndex(0) name (f) +8 >Emitted(52, 19) Source(47, 19) + SourceIndex(0) name (f) +9 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) name (f) +10>Emitted(52, 21) Source(47, 21) + SourceIndex(0) name (f) +--- +>>> case 0: +1 >^^^^^^^^ +2 > ^^^^^ +3 > ^ +1 > + > +2 > case +3 > 0 +1 >Emitted(53, 9) Source(48, 9) + SourceIndex(0) name (f) +2 >Emitted(53, 14) Source(48, 14) + SourceIndex(0) name (f) +3 >Emitted(53, 15) Source(48, 15) + SourceIndex(0) name (f) +--- +>>> { +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^-> +1 >: +2 > { +1 >Emitted(54, 13) Source(48, 17) + SourceIndex(0) name (f) +2 >Emitted(54, 14) Source(48, 18) + SourceIndex(0) name (f) +--- +>>> x++; +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1-> + > +2 > x +3 > ++ +4 > ; +1->Emitted(55, 17) Source(49, 13) + SourceIndex(0) name (f) +2 >Emitted(55, 18) Source(49, 14) + SourceIndex(0) name (f) +3 >Emitted(55, 20) Source(49, 16) + SourceIndex(0) name (f) +4 >Emitted(55, 21) Source(49, 17) + SourceIndex(0) name (f) +--- +>>> break; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(56, 17) Source(50, 13) + SourceIndex(0) name (f) +2 >Emitted(56, 22) Source(50, 18) + SourceIndex(0) name (f) +3 >Emitted(56, 23) Source(50, 19) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^-> +1 > + > + > +2 > } +1 >Emitted(57, 13) Source(52, 9) + SourceIndex(0) name (f) +2 >Emitted(57, 14) Source(52, 10) + SourceIndex(0) name (f) +--- +>>> case 1: +1->^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > case +3 > 1 +1->Emitted(58, 9) Source(53, 9) + SourceIndex(0) name (f) +2 >Emitted(58, 14) Source(53, 14) + SourceIndex(0) name (f) +3 >Emitted(58, 15) Source(53, 15) + SourceIndex(0) name (f) +--- +>>> { +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^-> +1 >: +2 > { +1 >Emitted(59, 13) Source(53, 17) + SourceIndex(0) name (f) +2 >Emitted(59, 14) Source(53, 18) + SourceIndex(0) name (f) +--- +>>> x--; +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1-> + > +2 > x +3 > -- +4 > ; +1->Emitted(60, 17) Source(54, 13) + SourceIndex(0) name (f) +2 >Emitted(60, 18) Source(54, 14) + SourceIndex(0) name (f) +3 >Emitted(60, 20) Source(54, 16) + SourceIndex(0) name (f) +4 >Emitted(60, 21) Source(54, 17) + SourceIndex(0) name (f) +--- +>>> break; +1->^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(61, 17) Source(55, 13) + SourceIndex(0) name (f) +2 >Emitted(61, 22) Source(55, 18) + SourceIndex(0) name (f) +3 >Emitted(61, 23) Source(55, 19) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +3 > ^^^^-> +1 > + > + > +2 > } +1 >Emitted(62, 13) Source(57, 9) + SourceIndex(0) name (f) +2 >Emitted(62, 14) Source(57, 10) + SourceIndex(0) name (f) +--- +>>> default: +1->^^^^^^^^ +2 > ^^^^^^-> +1-> + > +1->Emitted(63, 9) Source(58, 9) + SourceIndex(0) name (f) +--- +>>> { +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^-> +1->default: +2 > { +1->Emitted(64, 13) Source(58, 18) + SourceIndex(0) name (f) +2 >Emitted(64, 14) Source(58, 19) + SourceIndex(0) name (f) +--- +>>> x *= 2; +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^-> +1-> + > +2 > x +3 > *= +4 > 2 +5 > ; +1->Emitted(65, 17) Source(59, 13) + SourceIndex(0) name (f) +2 >Emitted(65, 18) Source(59, 14) + SourceIndex(0) name (f) +3 >Emitted(65, 22) Source(59, 18) + SourceIndex(0) name (f) +4 >Emitted(65, 23) Source(59, 19) + SourceIndex(0) name (f) +5 >Emitted(65, 24) Source(59, 20) + SourceIndex(0) name (f) +--- +>>> x = 50; +1->^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ +1-> + > +2 > x +3 > = +4 > 50 +5 > ; +1->Emitted(66, 17) Source(60, 13) + SourceIndex(0) name (f) +2 >Emitted(66, 18) Source(60, 14) + SourceIndex(0) name (f) +3 >Emitted(66, 21) Source(60, 17) + SourceIndex(0) name (f) +4 >Emitted(66, 23) Source(60, 19) + SourceIndex(0) name (f) +5 >Emitted(66, 24) Source(60, 20) + SourceIndex(0) name (f) +--- +>>> break; +1 >^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ +1 > + > +2 > break +3 > ; +1 >Emitted(67, 17) Source(61, 13) + SourceIndex(0) name (f) +2 >Emitted(67, 22) Source(61, 18) + SourceIndex(0) name (f) +3 >Emitted(67, 23) Source(61, 19) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^^^^^^^^^ +2 > ^ +1 > + > + > +2 > } +1 >Emitted(68, 13) Source(63, 9) + SourceIndex(0) name (f) +2 >Emitted(68, 14) Source(63, 10) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(69, 5) Source(64, 5) + SourceIndex(0) name (f) +2 >Emitted(69, 6) Source(64, 6) + SourceIndex(0) name (f) +--- +>>> while (x < 10) { +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > +2 > while ( +3 > x +4 > < +5 > 10 +6 > ) +7 > { +1->Emitted(70, 5) Source(65, 5) + SourceIndex(0) name (f) +2 >Emitted(70, 12) Source(65, 12) + SourceIndex(0) name (f) +3 >Emitted(70, 13) Source(65, 13) + SourceIndex(0) name (f) +4 >Emitted(70, 16) Source(65, 16) + SourceIndex(0) name (f) +5 >Emitted(70, 18) Source(65, 18) + SourceIndex(0) name (f) +6 >Emitted(70, 20) Source(65, 20) + SourceIndex(0) name (f) +7 >Emitted(70, 21) Source(65, 21) + SourceIndex(0) name (f) +--- +>>> x++; +1 >^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > x +3 > ++ +4 > ; +1 >Emitted(71, 9) Source(66, 9) + SourceIndex(0) name (f) +2 >Emitted(71, 10) Source(66, 10) + SourceIndex(0) name (f) +3 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) name (f) +4 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) name (f) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^-> +1 > + > +2 > } +1 >Emitted(72, 5) Source(67, 5) + SourceIndex(0) name (f) +2 >Emitted(72, 6) Source(67, 6) + SourceIndex(0) name (f) +--- +>>> do { +1->^^^^ +2 > ^^^ +3 > ^ +4 > ^^^^^-> +1-> + > +2 > do +3 > { +1->Emitted(73, 5) Source(68, 5) + SourceIndex(0) name (f) +2 >Emitted(73, 8) Source(68, 8) + SourceIndex(0) name (f) +3 >Emitted(73, 9) Source(68, 9) + SourceIndex(0) name (f) +--- +>>> x--; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^-> +1-> + > +2 > x +3 > -- +4 > ; +1->Emitted(74, 9) Source(69, 9) + SourceIndex(0) name (f) +2 >Emitted(74, 10) Source(69, 10) + SourceIndex(0) name (f) +3 >Emitted(74, 12) Source(69, 12) + SourceIndex(0) name (f) +4 >Emitted(74, 13) Source(69, 13) + SourceIndex(0) name (f) +--- +>>> } while (x > 4); +1->^^^^ +2 > ^ +3 > ^^^^^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +1-> + > +2 > } +3 > while ( +4 > x +5 > > +6 > 4 +7 > ) +1->Emitted(75, 5) Source(70, 5) + SourceIndex(0) name (f) +2 >Emitted(75, 6) Source(70, 6) + SourceIndex(0) name (f) +3 >Emitted(75, 14) Source(70, 14) + SourceIndex(0) name (f) +4 >Emitted(75, 15) Source(70, 15) + SourceIndex(0) name (f) +5 >Emitted(75, 18) Source(70, 18) + SourceIndex(0) name (f) +6 >Emitted(75, 19) Source(70, 19) + SourceIndex(0) name (f) +7 >Emitted(75, 21) Source(70, 20) + SourceIndex(0) name (f) +--- +>>> x = y; +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > x +3 > = +4 > y +5 > ; +1 >Emitted(76, 5) Source(71, 5) + SourceIndex(0) name (f) +2 >Emitted(76, 6) Source(71, 6) + SourceIndex(0) name (f) +3 >Emitted(76, 9) Source(71, 9) + SourceIndex(0) name (f) +4 >Emitted(76, 10) Source(71, 10) + SourceIndex(0) name (f) +5 >Emitted(76, 11) Source(71, 11) + SourceIndex(0) name (f) +--- +>>> var z = (x == 1) ? x + 1 : x - 1; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^^ +17> ^ +18> ^ +1-> + > +2 > var +3 > z +4 > = +5 > ( +6 > x +7 > == +8 > 1 +9 > ) +10> ? +11> x +12> + +13> 1 +14> : +15> x +16> - +17> 1 +18> ; +1->Emitted(77, 5) Source(72, 5) + SourceIndex(0) name (f) +2 >Emitted(77, 9) Source(72, 9) + SourceIndex(0) name (f) +3 >Emitted(77, 10) Source(72, 10) + SourceIndex(0) name (f) +4 >Emitted(77, 13) Source(72, 13) + SourceIndex(0) name (f) +5 >Emitted(77, 14) Source(72, 14) + SourceIndex(0) name (f) +6 >Emitted(77, 15) Source(72, 15) + SourceIndex(0) name (f) +7 >Emitted(77, 19) Source(72, 19) + SourceIndex(0) name (f) +8 >Emitted(77, 20) Source(72, 20) + SourceIndex(0) name (f) +9 >Emitted(77, 21) Source(72, 21) + SourceIndex(0) name (f) +10>Emitted(77, 24) Source(72, 24) + SourceIndex(0) name (f) +11>Emitted(77, 25) Source(72, 25) + SourceIndex(0) name (f) +12>Emitted(77, 28) Source(72, 28) + SourceIndex(0) name (f) +13>Emitted(77, 29) Source(72, 29) + SourceIndex(0) name (f) +14>Emitted(77, 32) Source(72, 32) + SourceIndex(0) name (f) +15>Emitted(77, 33) Source(72, 33) + SourceIndex(0) name (f) +16>Emitted(77, 36) Source(72, 36) + SourceIndex(0) name (f) +17>Emitted(77, 37) Source(72, 37) + SourceIndex(0) name (f) +18>Emitted(77, 38) Source(72, 38) + SourceIndex(0) name (f) +--- +>>> (x == 1) ? x + 1 : x - 1; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^^ +12> ^ +13> ^^^ +14> ^ +15> ^ +1 > + > +2 > ( +3 > x +4 > == +5 > 1 +6 > ) +7 > ? +8 > x +9 > + +10> 1 +11> : +12> x +13> - +14> 1 +15> ; +1 >Emitted(78, 5) Source(73, 5) + SourceIndex(0) name (f) +2 >Emitted(78, 6) Source(73, 6) + SourceIndex(0) name (f) +3 >Emitted(78, 7) Source(73, 7) + SourceIndex(0) name (f) +4 >Emitted(78, 11) Source(73, 11) + SourceIndex(0) name (f) +5 >Emitted(78, 12) Source(73, 12) + SourceIndex(0) name (f) +6 >Emitted(78, 13) Source(73, 13) + SourceIndex(0) name (f) +7 >Emitted(78, 16) Source(73, 16) + SourceIndex(0) name (f) +8 >Emitted(78, 17) Source(73, 17) + SourceIndex(0) name (f) +9 >Emitted(78, 20) Source(73, 20) + SourceIndex(0) name (f) +10>Emitted(78, 21) Source(73, 21) + SourceIndex(0) name (f) +11>Emitted(78, 24) Source(73, 24) + SourceIndex(0) name (f) +12>Emitted(78, 25) Source(73, 25) + SourceIndex(0) name (f) +13>Emitted(78, 28) Source(73, 28) + SourceIndex(0) name (f) +14>Emitted(78, 29) Source(73, 29) + SourceIndex(0) name (f) +15>Emitted(78, 30) Source(73, 30) + SourceIndex(0) name (f) +--- +>>> x === 1; +1 >^^^^ +2 > ^ +3 > ^^^^^ +4 > ^ +5 > ^ +6 > ^^^^-> +1 > + > +2 > x +3 > === +4 > 1 +5 > ; +1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) name (f) +2 >Emitted(79, 6) Source(74, 6) + SourceIndex(0) name (f) +3 >Emitted(79, 11) Source(74, 11) + SourceIndex(0) name (f) +4 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) name (f) +5 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) name (f) +--- +>>> x = z = 40; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1-> + > +2 > x +3 > = +4 > z +5 > = +6 > 40 +7 > ; +1->Emitted(80, 5) Source(75, 5) + SourceIndex(0) name (f) +2 >Emitted(80, 6) Source(75, 6) + SourceIndex(0) name (f) +3 >Emitted(80, 9) Source(75, 9) + SourceIndex(0) name (f) +4 >Emitted(80, 10) Source(75, 10) + SourceIndex(0) name (f) +5 >Emitted(80, 13) Source(75, 13) + SourceIndex(0) name (f) +6 >Emitted(80, 15) Source(75, 15) + SourceIndex(0) name (f) +7 >Emitted(80, 16) Source(75, 16) + SourceIndex(0) name (f) +--- +>>> eval("y"); +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +1 > + > +2 > eval +3 > ( +4 > "y" +5 > ) +6 > ; +1 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) name (f) +2 >Emitted(81, 9) Source(76, 9) + SourceIndex(0) name (f) +3 >Emitted(81, 10) Source(76, 10) + SourceIndex(0) name (f) +4 >Emitted(81, 13) Source(76, 13) + SourceIndex(0) name (f) +5 >Emitted(81, 14) Source(76, 14) + SourceIndex(0) name (f) +6 >Emitted(81, 15) Source(76, 15) + SourceIndex(0) name (f) +--- +>>> return; +1 >^^^^ +2 > ^^^^^^ +3 > ^ +1 > + > +2 > return +3 > ; +1 >Emitted(82, 5) Source(77, 5) + SourceIndex(0) name (f) +2 >Emitted(82, 11) Source(77, 11) + SourceIndex(0) name (f) +3 >Emitted(82, 12) Source(77, 12) + SourceIndex(0) name (f) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(83, 1) Source(78, 1) + SourceIndex(0) name (f) +2 >Emitted(83, 2) Source(78, 2) + SourceIndex(0) name (f) +--- +>>>var b = function () { +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^^^-> +1-> + > +2 >var +3 > b +4 > = +1->Emitted(84, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(84, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(84, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(84, 9) Source(79, 9) + SourceIndex(0) +--- +>>> var x = 10; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1->function () { + > +2 > var +3 > x +4 > = +5 > 10 +6 > ; +1->Emitted(85, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(85, 9) Source(80, 9) + SourceIndex(0) +3 >Emitted(85, 10) Source(80, 10) + SourceIndex(0) +4 >Emitted(85, 13) Source(80, 13) + SourceIndex(0) +5 >Emitted(85, 15) Source(80, 15) + SourceIndex(0) +6 >Emitted(85, 16) Source(80, 16) + SourceIndex(0) +--- +>>> x = x + 1; +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +1 > + > +2 > x +3 > = +4 > x +5 > + +6 > 1 +7 > ; +1 >Emitted(86, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(86, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(86, 9) Source(81, 9) + SourceIndex(0) +4 >Emitted(86, 10) Source(81, 10) + SourceIndex(0) +5 >Emitted(86, 13) Source(81, 13) + SourceIndex(0) +6 >Emitted(86, 14) Source(81, 14) + SourceIndex(0) +7 >Emitted(86, 15) Source(81, 15) + SourceIndex(0) +--- +>>>}; +1 > +2 >^ +3 > ^ +4 > ^^^-> +1 > + > +2 >} +3 > ; +1 >Emitted(87, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(87, 2) Source(82, 2) + SourceIndex(0) +3 >Emitted(87, 3) Source(82, 3) + SourceIndex(0) +--- +>>>f(); +1-> +2 >^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >f +3 > () +4 > ; +1->Emitted(88, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(88, 2) Source(83, 2) + SourceIndex(0) +3 >Emitted(88, 4) Source(83, 4) + SourceIndex(0) +4 >Emitted(88, 5) Source(83, 5) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationStatements.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationSwitch.js b/tests/baselines/reference/sourceMapValidationSwitch.js new file mode 100644 index 0000000000000..031eda6a37e0a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationSwitch.js @@ -0,0 +1,59 @@ +//// [sourceMapValidationSwitch.ts] +var x = 10; +switch (x) { + case 5: + x++; + break; + case 10: + { + x--; + break; + } + default: + x = x *10; +} +switch (x) +{ + case 5: + x++; + break; + case 10: + { + x--; + break; + } + default: + { + x = x * 10; + } +} + +//// [sourceMapValidationSwitch.js] +var x = 10; +switch (x) { + case 5: + x++; + break; + case 10: + { + x--; + break; + } + default: + x = x * 10; +} +switch (x) { + case 5: + x++; + break; + case 10: + { + x--; + break; + } + default: + { + x = x * 10; + } +} +//# sourceMappingURL=sourceMapValidationSwitch.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationSwitch.js.map b/tests/baselines/reference/sourceMapValidationSwitch.js.map new file mode 100644 index 0000000000000..fcaa1a45cc5b4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationSwitch.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationSwitch.js.map] +{"version":3,"file":"sourceMapValidationSwitch.js","sourceRoot":"","sources":["sourceMapValidationSwitch.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACR,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,KAAK,CAAC;IACV,KAAK,EAAE;QACH,CAAC;YACG,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QACV,CAAC;IACL;QACI,CAAC,GAAG,CAAC,GAAE,EAAE,CAAC;AAClB,CAAC;AACD,MAAM,CAAC,CAAC,CAAC,CAAC,CACV,CAAC;IACG,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,KAAK,CAAC;IACV,KAAK,EAAE;QACH,CAAC;YACG,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QACV,CAAC;IACL;QACI,CAAC;YACG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt b/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt new file mode 100644 index 0000000000000..4caa189efefb1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt @@ -0,0 +1,390 @@ +=================================================================== +JsFile: sourceMapValidationSwitch.js +mapUrl: sourceMapValidationSwitch.js.map +sourceRoot: +sources: sourceMapValidationSwitch.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationSwitch.js +sourceFile:sourceMapValidationSwitch.ts +------------------------------------------------------------------- +>>>var x = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^-> +1 > +2 >var +3 > x +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +--- +>>>switch (x) { +1-> +2 >^^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 >switch +3 > +4 > ( +5 > x +6 > ) +7 > +8 > { +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) +4 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +6 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) +7 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +8 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +--- +>>> case 5: +1 >^^^^ +2 > ^^^^^ +3 > ^ +4 > ^^^-> +1 > + > +2 > case +3 > 5 +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +3 >Emitted(3, 11) Source(3, 11) + SourceIndex(0) +--- +>>> x++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1->: + > +2 > x +3 > ++ +4 > ; +1->Emitted(4, 9) Source(4, 9) + SourceIndex(0) +2 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) +3 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) +4 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) +--- +>>> break; +1->^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(5, 9) Source(5, 9) + SourceIndex(0) +2 >Emitted(5, 14) Source(5, 14) + SourceIndex(0) +3 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) +--- +>>> case 10: +1 >^^^^ +2 > ^^^^^ +3 > ^^ +1 > + > +2 > case +3 > 10 +1 >Emitted(6, 5) Source(6, 5) + SourceIndex(0) +2 >Emitted(6, 10) Source(6, 10) + SourceIndex(0) +3 >Emitted(6, 12) Source(6, 12) + SourceIndex(0) +--- +>>> { +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^-> +1 >: + > +2 > { +1 >Emitted(7, 9) Source(7, 9) + SourceIndex(0) +2 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +--- +>>> x--; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1-> + > +2 > x +3 > -- +4 > ; +1->Emitted(8, 13) Source(8, 13) + SourceIndex(0) +2 >Emitted(8, 14) Source(8, 14) + SourceIndex(0) +3 >Emitted(8, 16) Source(8, 16) + SourceIndex(0) +4 >Emitted(8, 17) Source(8, 17) + SourceIndex(0) +--- +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(9, 13) Source(9, 13) + SourceIndex(0) +2 >Emitted(9, 18) Source(9, 18) + SourceIndex(0) +3 >Emitted(9, 19) Source(9, 19) + SourceIndex(0) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^-> +1 > + > +2 > } +1 >Emitted(10, 9) Source(10, 9) + SourceIndex(0) +2 >Emitted(10, 10) Source(10, 10) + SourceIndex(0) +--- +>>> default: +1->^^^^ +2 > ^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(11, 5) Source(11, 5) + SourceIndex(0) +--- +>>> x = x * 10; +1->^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1->default: + > +2 > x +3 > = +4 > x +5 > * +6 > 10 +7 > ; +1->Emitted(12, 9) Source(12, 9) + SourceIndex(0) +2 >Emitted(12, 10) Source(12, 10) + SourceIndex(0) +3 >Emitted(12, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(12, 14) Source(12, 14) + SourceIndex(0) +5 >Emitted(12, 17) Source(12, 16) + SourceIndex(0) +6 >Emitted(12, 19) Source(12, 18) + SourceIndex(0) +7 >Emitted(12, 20) Source(12, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(13, 2) + SourceIndex(0) +--- +>>>switch (x) { +1-> +2 >^^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> + > +2 >switch +3 > +4 > ( +5 > x +6 > ) +7 > + > +8 > { +1->Emitted(14, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(14, 7) Source(14, 7) + SourceIndex(0) +3 >Emitted(14, 8) Source(14, 8) + SourceIndex(0) +4 >Emitted(14, 9) Source(14, 9) + SourceIndex(0) +5 >Emitted(14, 10) Source(14, 10) + SourceIndex(0) +6 >Emitted(14, 11) Source(14, 11) + SourceIndex(0) +7 >Emitted(14, 12) Source(15, 1) + SourceIndex(0) +8 >Emitted(14, 13) Source(15, 2) + SourceIndex(0) +--- +>>> case 5: +1 >^^^^ +2 > ^^^^^ +3 > ^ +4 > ^^^-> +1 > + > +2 > case +3 > 5 +1 >Emitted(15, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(15, 10) Source(16, 10) + SourceIndex(0) +3 >Emitted(15, 11) Source(16, 11) + SourceIndex(0) +--- +>>> x++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1->: + > +2 > x +3 > ++ +4 > ; +1->Emitted(16, 9) Source(17, 9) + SourceIndex(0) +2 >Emitted(16, 10) Source(17, 10) + SourceIndex(0) +3 >Emitted(16, 12) Source(17, 12) + SourceIndex(0) +4 >Emitted(16, 13) Source(17, 13) + SourceIndex(0) +--- +>>> break; +1->^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(17, 9) Source(18, 9) + SourceIndex(0) +2 >Emitted(17, 14) Source(18, 14) + SourceIndex(0) +3 >Emitted(17, 15) Source(18, 15) + SourceIndex(0) +--- +>>> case 10: +1 >^^^^ +2 > ^^^^^ +3 > ^^ +1 > + > +2 > case +3 > 10 +1 >Emitted(18, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(18, 10) Source(19, 10) + SourceIndex(0) +3 >Emitted(18, 12) Source(19, 12) + SourceIndex(0) +--- +>>> { +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^-> +1 >: + > +2 > { +1 >Emitted(19, 9) Source(20, 9) + SourceIndex(0) +2 >Emitted(19, 10) Source(20, 10) + SourceIndex(0) +--- +>>> x--; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^-> +1-> + > +2 > x +3 > -- +4 > ; +1->Emitted(20, 13) Source(21, 13) + SourceIndex(0) +2 >Emitted(20, 14) Source(21, 14) + SourceIndex(0) +3 >Emitted(20, 16) Source(21, 16) + SourceIndex(0) +4 >Emitted(20, 17) Source(21, 17) + SourceIndex(0) +--- +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ +1-> + > +2 > break +3 > ; +1->Emitted(21, 13) Source(22, 13) + SourceIndex(0) +2 >Emitted(21, 18) Source(22, 18) + SourceIndex(0) +3 >Emitted(21, 19) Source(22, 19) + SourceIndex(0) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^-> +1 > + > +2 > } +1 >Emitted(22, 9) Source(23, 9) + SourceIndex(0) +2 >Emitted(22, 10) Source(23, 10) + SourceIndex(0) +--- +>>> default: +1->^^^^ +2 > ^^^^^^-> +1-> + > +1->Emitted(23, 5) Source(24, 5) + SourceIndex(0) +--- +>>> { +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^-> +1->default: + > +2 > { +1->Emitted(24, 9) Source(25, 9) + SourceIndex(0) +2 >Emitted(24, 10) Source(25, 10) + SourceIndex(0) +--- +>>> x = x * 10; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1-> + > +2 > x +3 > = +4 > x +5 > * +6 > 10 +7 > ; +1->Emitted(25, 13) Source(26, 13) + SourceIndex(0) +2 >Emitted(25, 14) Source(26, 14) + SourceIndex(0) +3 >Emitted(25, 17) Source(26, 17) + SourceIndex(0) +4 >Emitted(25, 18) Source(26, 18) + SourceIndex(0) +5 >Emitted(25, 21) Source(26, 21) + SourceIndex(0) +6 >Emitted(25, 23) Source(26, 23) + SourceIndex(0) +7 >Emitted(25, 24) Source(26, 24) + SourceIndex(0) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(26, 9) Source(27, 9) + SourceIndex(0) +2 >Emitted(26, 10) Source(27, 10) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(28, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationSwitch.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.js b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js new file mode 100644 index 0000000000000..eb5f6566af207 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js @@ -0,0 +1,45 @@ +//// [sourceMapValidationTryCatchFinally.ts] +var x = 10; +try { + x = x + 1; +} catch (e) { + x = x - 1; +} finally { + x = x * 10; +} +try +{ + x = x + 1; + throw new Error(); +} +catch (e) +{ + x = x - 1; +} +finally +{ + x = x * 10; +} + +//// [sourceMapValidationTryCatchFinally.js] +var x = 10; +try { + x = x + 1; +} +catch (e) { + x = x - 1; +} +finally { + x = x * 10; +} +try { + x = x + 1; + throw new Error(); +} +catch (e) { + x = x - 1; +} +finally { + x = x * 10; +} +//# sourceMappingURL=sourceMapValidationTryCatchFinally.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map new file mode 100644 index 0000000000000..24b7b84a3d0ff --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationTryCatchFinally.js.map] +{"version":3,"file":"sourceMapValidationTryCatchFinally.js","sourceRoot":"","sources":["sourceMapValidationTryCatchFinally.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,IAAA,CAAC;IACG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAE;AAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAT,CAAC;IACC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;QAAC,CAAC;IACC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACf,CAAC;AACD,IAAA,CAAC;IAEG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,IAAI,KAAK,EAAE,CAAC;AACtB,CACA;AAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAT,CAAC;IAEG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;QACD,CAAC;IAEG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt b/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt new file mode 100644 index 0000000000000..aa0b846ece8fb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt @@ -0,0 +1,360 @@ +=================================================================== +JsFile: sourceMapValidationTryCatchFinally.js +mapUrl: sourceMapValidationTryCatchFinally.js.map +sourceRoot: +sources: sourceMapValidationTryCatchFinally.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationTryCatchFinally.js +sourceFile:sourceMapValidationTryCatchFinally.ts +------------------------------------------------------------------- +>>>var x = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1 > +2 >var +3 > x +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +--- +>>>try { +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^-> +1 > + > +2 > +3 > t +1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 1) + SourceIndex(0) +3 >Emitted(2, 6) Source(2, 2) + SourceIndex(0) +--- +>>> x = x + 1; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +1->ry { + > +2 > x +3 > = +4 > x +5 > + +6 > 1 +7 > ; +1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) +5 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) +6 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) +7 >Emitted(3, 15) Source(3, 15) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(4, 3) + SourceIndex(0) +--- +>>>catch (e) { +1-> +2 >^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^-> +1-> +2 >catch +3 > +4 > ( +5 > e +6 > ) +7 > +8 > c +1->Emitted(5, 1) Source(4, 3) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 8) + SourceIndex(0) +3 >Emitted(5, 7) Source(4, 9) + SourceIndex(0) +4 >Emitted(5, 8) Source(4, 10) + SourceIndex(0) +5 >Emitted(5, 9) Source(4, 11) + SourceIndex(0) +6 >Emitted(5, 10) Source(4, 12) + SourceIndex(0) +7 >Emitted(5, 11) Source(4, 3) + SourceIndex(0) +8 >Emitted(5, 12) Source(4, 4) + SourceIndex(0) +--- +>>> x = x - 1; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +1->atch (e) { + > +2 > x +3 > = +4 > x +5 > - +6 > 1 +7 > ; +1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(5, 6) + SourceIndex(0) +3 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +4 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +5 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +6 >Emitted(6, 14) Source(5, 14) + SourceIndex(0) +7 >Emitted(6, 15) Source(5, 15) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) +--- +>>>finally { +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^-> +1-> +2 > f +1->Emitted(8, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(8, 10) Source(6, 4) + SourceIndex(0) +--- +>>> x = x * 10; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1->inally { + > +2 > x +3 > = +4 > x +5 > * +6 > 10 +7 > ; +1->Emitted(9, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(9, 6) Source(7, 6) + SourceIndex(0) +3 >Emitted(9, 9) Source(7, 9) + SourceIndex(0) +4 >Emitted(9, 10) Source(7, 10) + SourceIndex(0) +5 >Emitted(9, 13) Source(7, 13) + SourceIndex(0) +6 >Emitted(9, 15) Source(7, 15) + SourceIndex(0) +7 >Emitted(9, 16) Source(7, 16) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(8, 2) + SourceIndex(0) +--- +>>>try { +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^^^^^-> +1-> + > +2 > +3 > t +1->Emitted(11, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) +3 >Emitted(11, 6) Source(9, 2) + SourceIndex(0) +--- +>>> x = x + 1; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^-> +1->ry + >{ + > +2 > x +3 > = +4 > x +5 > + +6 > 1 +7 > ; +1->Emitted(12, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(12, 6) Source(11, 6) + SourceIndex(0) +3 >Emitted(12, 9) Source(11, 9) + SourceIndex(0) +4 >Emitted(12, 10) Source(11, 10) + SourceIndex(0) +5 >Emitted(12, 13) Source(11, 13) + SourceIndex(0) +6 >Emitted(12, 14) Source(11, 14) + SourceIndex(0) +7 >Emitted(12, 15) Source(11, 15) + SourceIndex(0) +--- +>>> throw new Error(); +1->^^^^ +2 > ^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^ +6 > ^ +1-> + > +2 > throw +3 > new +4 > Error +5 > () +6 > ; +1->Emitted(13, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(13, 11) Source(12, 11) + SourceIndex(0) +3 >Emitted(13, 15) Source(12, 15) + SourceIndex(0) +4 >Emitted(13, 20) Source(12, 20) + SourceIndex(0) +5 >Emitted(13, 22) Source(12, 22) + SourceIndex(0) +6 >Emitted(13, 23) Source(12, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^-> +1 > + > +2 >} + > +1 >Emitted(14, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(14, 1) + SourceIndex(0) +--- +>>>catch (e) { +1-> +2 >^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^-> +1-> +2 >catch +3 > +4 > ( +5 > e +6 > ) +7 > +8 > c +1->Emitted(15, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(15, 6) Source(14, 6) + SourceIndex(0) +3 >Emitted(15, 7) Source(14, 7) + SourceIndex(0) +4 >Emitted(15, 8) Source(14, 8) + SourceIndex(0) +5 >Emitted(15, 9) Source(14, 9) + SourceIndex(0) +6 >Emitted(15, 10) Source(14, 10) + SourceIndex(0) +7 >Emitted(15, 11) Source(14, 1) + SourceIndex(0) +8 >Emitted(15, 12) Source(14, 2) + SourceIndex(0) +--- +>>> x = x - 1; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +1->atch (e) + >{ + > +2 > x +3 > = +4 > x +5 > - +6 > 1 +7 > ; +1->Emitted(16, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(16, 6) Source(16, 6) + SourceIndex(0) +3 >Emitted(16, 9) Source(16, 9) + SourceIndex(0) +4 >Emitted(16, 10) Source(16, 10) + SourceIndex(0) +5 >Emitted(16, 13) Source(16, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(16, 14) + SourceIndex(0) +7 >Emitted(16, 15) Source(16, 15) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(17, 2) + SourceIndex(0) +--- +>>>finally { +1->^^^^^^^^ +2 > ^ +3 > ^^^^^^^-> +1-> + > +2 > f +1->Emitted(18, 9) Source(18, 1) + SourceIndex(0) +2 >Emitted(18, 10) Source(18, 2) + SourceIndex(0) +--- +>>> x = x * 10; +1->^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^^ +6 > ^^ +7 > ^ +1->inally + >{ + > +2 > x +3 > = +4 > x +5 > * +6 > 10 +7 > ; +1->Emitted(19, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(19, 6) Source(20, 6) + SourceIndex(0) +3 >Emitted(19, 9) Source(20, 9) + SourceIndex(0) +4 >Emitted(19, 10) Source(20, 10) + SourceIndex(0) +5 >Emitted(19, 13) Source(20, 13) + SourceIndex(0) +6 >Emitted(19, 15) Source(20, 15) + SourceIndex(0) +7 >Emitted(19, 16) Source(20, 16) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(21, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationTryCatchFinally.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationVariables.js b/tests/baselines/reference/sourceMapValidationVariables.js new file mode 100644 index 0000000000000..58099dc4dfa10 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationVariables.js @@ -0,0 +1,12 @@ +//// [sourceMapValidationVariables.ts] +var a = 10; +var b; +var c = 10, d, e; +var c2, d2 = 10; + +//// [sourceMapValidationVariables.js] +var a = 10; +var b; +var c = 10, d, e; +var c2, d2 = 10; +//# sourceMappingURL=sourceMapValidationVariables.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationVariables.js.map b/tests/baselines/reference/sourceMapValidationVariables.js.map new file mode 100644 index 0000000000000..ad1abdfbf985e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationVariables.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationVariables.js.map] +{"version":3,"file":"sourceMapValidationVariables.js","sourceRoot":"","sources":["sourceMapValidationVariables.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,IAAI,CAAC,CAAC;AACN,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AACjB,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationVariables.sourcemap.txt b/tests/baselines/reference/sourceMapValidationVariables.sourcemap.txt new file mode 100644 index 0000000000000..c9a49494d2c82 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationVariables.sourcemap.txt @@ -0,0 +1,108 @@ +=================================================================== +JsFile: sourceMapValidationVariables.js +mapUrl: sourceMapValidationVariables.js.map +sourceRoot: +sources: sourceMapValidationVariables.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationVariables.js +sourceFile:sourceMapValidationVariables.ts +------------------------------------------------------------------- +>>>var a = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +1 > +2 >var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +--- +>>>var b; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^-> +1 > + > +2 >var +3 > b +4 > ; +1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +--- +>>>var c = 10, d, e; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +1-> + > +2 >var +3 > c +4 > = +5 > 10 +6 > , +7 > d +8 > , +9 > e +10> ; +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) +4 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +5 >Emitted(3, 11) Source(3, 11) + SourceIndex(0) +6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) +7 >Emitted(3, 14) Source(3, 14) + SourceIndex(0) +8 >Emitted(3, 16) Source(3, 16) + SourceIndex(0) +9 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) +10>Emitted(3, 18) Source(3, 18) + SourceIndex(0) +--- +>>>var c2, d2 = 10; +1 > +2 >^^^^ +3 > ^^ +4 > ^^ +5 > ^^ +6 > ^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > c2 +4 > , +5 > d2 +6 > = +7 > 10 +8 > ; +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +4 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) +5 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +6 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +7 >Emitted(4, 16) Source(4, 16) + SourceIndex(0) +8 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationVariables.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWhile.js b/tests/baselines/reference/sourceMapValidationWhile.js new file mode 100644 index 0000000000000..44431c8a3999b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWhile.js @@ -0,0 +1,19 @@ +//// [sourceMapValidationWhile.ts] +var a = 10; +while (a == 10) { + a++; +} +while (a == 10) +{ + a++; +} + +//// [sourceMapValidationWhile.js] +var a = 10; +while (a == 10) { + a++; +} +while (a == 10) { + a++; +} +//# sourceMappingURL=sourceMapValidationWhile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWhile.js.map b/tests/baselines/reference/sourceMapValidationWhile.js.map new file mode 100644 index 0000000000000..a3b977c79d4d1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWhile.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationWhile.js.map] +{"version":3,"file":"sourceMapValidationWhile.js","sourceRoot":"","sources":["sourceMapValidationWhile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;IACb,CAAC,EAAE,CAAC;AACR,CAAC;AACD,OAAO,CAAC,IAAI,EAAE,EACd,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt new file mode 100644 index 0000000000000..df653c57e8349 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt @@ -0,0 +1,131 @@ +=================================================================== +JsFile: sourceMapValidationWhile.js +mapUrl: sourceMapValidationWhile.js.map +sourceRoot: +sources: sourceMapValidationWhile.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationWhile.js +sourceFile:sourceMapValidationWhile.ts +------------------------------------------------------------------- +>>>var a = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^-> +1 > +2 >var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) +--- +>>>while (a == 10) { +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > +2 >while ( +3 > a +4 > == +5 > 10 +6 > ) +7 > { +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) +3 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) +4 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) +6 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) +7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) +--- +>>> a++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > a +3 > ++ +4 > ; +1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(3, 8) Source(3, 8) + SourceIndex(0) +4 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) +--- +>>>while (a == 10) { +1-> +2 >^^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ +7 > ^ +1-> + > +2 >while ( +3 > a +4 > == +5 > 10 +6 > ) + > +7 > { +1->Emitted(5, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(5, 8) Source(5, 8) + SourceIndex(0) +3 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) +4 >Emitted(5, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) +6 >Emitted(5, 17) Source(6, 1) + SourceIndex(0) +7 >Emitted(5, 18) Source(6, 2) + SourceIndex(0) +--- +>>> a++; +1 >^^^^ +2 > ^ +3 > ^^ +4 > ^ +1 > + > +2 > a +3 > ++ +4 > ; +1 >Emitted(6, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(7, 6) + SourceIndex(0) +3 >Emitted(6, 8) Source(7, 8) + SourceIndex(0) +4 >Emitted(6, 9) Source(7, 9) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(7, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(8, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationWhile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.js b/tests/baselines/reference/sourceMapValidationWithComments.js new file mode 100644 index 0000000000000..1c64d4e2a03c0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWithComments.js @@ -0,0 +1,43 @@ +//// [sourceMapValidationWithComments.ts] +class DebugClass { + + public static debugFunc() { + + // Start Debugger Test Code + var i = 0; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + // End Debugger Test Code + + + return true; + } +} + +//// [sourceMapValidationWithComments.js] +var DebugClass = (function () { + function DebugClass() { + } + DebugClass.debugFunc = function () { + var i = 0; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + return true; + }; + return DebugClass; +})(); +//# sourceMappingURL=sourceMapValidationWithComments.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.js.map b/tests/baselines/reference/sourceMapValidationWithComments.js.map new file mode 100644 index 0000000000000..290c68a00b3a5 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWithComments.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationWithComments.js.map] +{"version":3,"file":"sourceMapValidationWithComments.js","sourceRoot":"","sources":["sourceMapValidationWithComments.ts"],"names":["DebugClass","DebugClass.constructor","DebugClass.debugFunc"],"mappings":"AAAA,IAAM,UAAU;IAAhBA,SAAMA,UAAUA;IAoBhBC,CAACA;IAlBiBD,oBAASA,GAAvBA;QAGIE,IAAIA,CAACA,GAAGA,CAACA,CAACA;QACVA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,CAACA;QAIJA,MAAMA,CAACA,IAAIA,CAACA;IAChBA,CAACA;IACLF,iBAACA;AAADA,CAACA,AApBD,IAoBC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt new file mode 100644 index 0000000000000..68fe38161b9da --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt @@ -0,0 +1,316 @@ +=================================================================== +JsFile: sourceMapValidationWithComments.js +mapUrl: sourceMapValidationWithComments.js.map +sourceRoot: +sources: sourceMapValidationWithComments.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationWithComments.js +sourceFile:sourceMapValidationWithComments.ts +------------------------------------------------------------------- +>>>var DebugClass = (function () { +1 > +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^^^^^^^^^^^^-> +1 > +2 >class +3 > DebugClass +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 15) Source(1, 17) + SourceIndex(0) +--- +>>> function DebugClass() { +1->^^^^ +2 > ^^^^^^^^^ +3 > ^^^^^^^^^^ +1-> +2 > class +3 > DebugClass +1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (DebugClass) +2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (DebugClass) +3 >Emitted(2, 24) Source(1, 17) + SourceIndex(0) name (DebugClass) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { + > + > public static debugFunc() { + > + > // Start Debugger Test Code + > var i = 0; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > // End Debugger Test Code + > + > + > return true; + > } + > +2 > } +1 >Emitted(3, 5) Source(21, 1) + SourceIndex(0) name (DebugClass.constructor) +2 >Emitted(3, 6) Source(21, 2) + SourceIndex(0) name (DebugClass.constructor) +--- +>>> DebugClass.debugFunc = function () { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^^ +1-> +2 > debugFunc +3 > +1->Emitted(4, 5) Source(3, 19) + SourceIndex(0) name (DebugClass) +2 >Emitted(4, 25) Source(3, 28) + SourceIndex(0) name (DebugClass) +3 >Emitted(4, 28) Source(3, 5) + SourceIndex(0) name (DebugClass) +--- +>>> var i = 0; +1 >^^^^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +1 >public static debugFunc() { + > + > // Start Debugger Test Code + > +2 > var +3 > i +4 > = +5 > 0 +6 > ; +1 >Emitted(5, 9) Source(6, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(5, 13) Source(6, 13) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(5, 14) Source(6, 14) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(5, 17) Source(6, 17) + SourceIndex(0) name (DebugClass.debugFunc) +5 >Emitted(5, 18) Source(6, 18) + SourceIndex(0) name (DebugClass.debugFunc) +6 >Emitted(5, 19) Source(6, 19) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1 >^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1 > + > +2 > i +3 > ++ +4 > ; +1 >Emitted(6, 9) Source(7, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(6, 10) Source(7, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(6, 12) Source(7, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(6, 13) Source(7, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(7, 9) Source(8, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(7, 12) Source(8, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(7, 13) Source(8, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(8, 9) Source(9, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(8, 13) Source(9, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(9, 9) Source(10, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(9, 10) Source(10, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(9, 12) Source(10, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(9, 13) Source(10, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(10, 9) Source(11, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(10, 10) Source(11, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(10, 12) Source(11, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(10, 13) Source(11, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(11, 9) Source(12, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(11, 10) Source(12, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(11, 12) Source(12, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(11, 13) Source(12, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(12, 9) Source(13, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(12, 10) Source(13, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(12, 12) Source(13, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(12, 13) Source(13, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(13, 9) Source(14, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(13, 10) Source(14, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(13, 12) Source(14, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(13, 13) Source(14, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> i++; +1->^^^^^^^^ +2 > ^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^-> +1-> + > +2 > i +3 > ++ +4 > ; +1->Emitted(14, 9) Source(15, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(14, 10) Source(15, 10) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(14, 12) Source(15, 12) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(14, 13) Source(15, 13) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> return true; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +1-> + > // End Debugger Test Code + > + > + > +2 > return +3 > +4 > true +5 > ; +1->Emitted(15, 9) Source(19, 9) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(15, 15) Source(19, 15) + SourceIndex(0) name (DebugClass.debugFunc) +3 >Emitted(15, 16) Source(19, 16) + SourceIndex(0) name (DebugClass.debugFunc) +4 >Emitted(15, 20) Source(19, 20) + SourceIndex(0) name (DebugClass.debugFunc) +5 >Emitted(15, 21) Source(19, 21) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> }; +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) name (DebugClass.debugFunc) +2 >Emitted(16, 6) Source(20, 6) + SourceIndex(0) name (DebugClass.debugFunc) +--- +>>> return DebugClass; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +1-> + > +2 > } +1->Emitted(17, 5) Source(21, 1) + SourceIndex(0) name (DebugClass) +2 >Emitted(17, 22) Source(21, 2) + SourceIndex(0) name (DebugClass) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class DebugClass { + > + > public static debugFunc() { + > + > // Start Debugger Test Code + > var i = 0; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > i++; + > // End Debugger Test Code + > + > + > return true; + > } + > } +1 >Emitted(18, 1) Source(21, 1) + SourceIndex(0) name (DebugClass) +2 >Emitted(18, 2) Source(21, 2) + SourceIndex(0) name (DebugClass) +3 >Emitted(18, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(18, 6) Source(21, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationWithComments.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.js b/tests/baselines/reference/sourcemapValidationDuplicateNames.js new file mode 100644 index 0000000000000..5fe519acc5b87 --- /dev/null +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.js @@ -0,0 +1,26 @@ +//// [sourcemapValidationDuplicateNames.ts] +module m1 { + var x = 10; + export class c { + } +} +module m1 { + var b = new m1.c(); +} + +//// [sourcemapValidationDuplicateNames.js] +var m1; +(function (m1) { + var x = 10; + var c = (function () { + function c() { + } + return c; + })(); + m1.c = c; +})(m1 || (m1 = {})); +var m1; +(function (m1) { + var b = new m1.c(); +})(m1 || (m1 = {})); +//# sourceMappingURL=sourcemapValidationDuplicateNames.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map b/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map new file mode 100644 index 0000000000000..69e580b762998 --- /dev/null +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.js.map @@ -0,0 +1,2 @@ +//// [sourcemapValidationDuplicateNames.js.map] +{"version":3,"file":"sourcemapValidationDuplicateNames.js","sourceRoot":"","sources":["sourcemapValidationDuplicateNames.ts"],"names":["m1","m1.c","m1.c.constructor"],"mappings":"AAAA,IAAO,EAAE,CAIR;AAJD,WAAO,EAAE,EAAC,CAAC;IACPA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAaA,CAACA;QAAdC,SAAaA,CAACA;QACdC,CAACA;QAADD,QAACA;IAADA,CAACA,AADDD,IACCA;IADYA,IAACA,GAADA,CACZA,CAAAA;AACLA,CAACA,EAJM,EAAE,KAAF,EAAE,QAIR;AACD,IAAO,EAAE,CAER;AAFD,WAAO,EAAE,EAAC,CAAC;IACPA,IAAIA,CAACA,GAAGA,IAAIA,EAAEA,CAACA,CAACA,EAAEA,CAACA;AACvBA,CAACA,EAFM,EAAE,KAAF,EAAE,QAER"} \ No newline at end of file diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt new file mode 100644 index 0000000000000..805658a0bd707 --- /dev/null +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.sourcemap.txt @@ -0,0 +1,270 @@ +=================================================================== +JsFile: sourcemapValidationDuplicateNames.js +mapUrl: sourcemapValidationDuplicateNames.js.map +sourceRoot: +sources: sourcemapValidationDuplicateNames.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourcemapValidationDuplicateNames.js +sourceFile:sourcemapValidationDuplicateNames.ts +------------------------------------------------------------------- +>>>var m1; +1 > +2 >^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > +2 >module +3 > m1 +4 > { + > var x = 10; + > export class c { + > } + > } +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 7) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 8) Source(5, 2) + SourceIndex(0) +--- +>>>(function (m1) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +1-> +2 >module +3 > m1 +4 > +5 > { +1->Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 12) Source(1, 8) + SourceIndex(0) +3 >Emitted(2, 14) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 16) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 17) Source(1, 12) + SourceIndex(0) +--- +>>> var x = 10; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^-> +1 > + > +2 > var +3 > x +4 > = +5 > 10 +6 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) name (m1) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) name (m1) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) name (m1) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) name (m1) +5 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) name (m1) +6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) name (m1) +--- +>>> var c = (function () { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^-> +1-> + > +2 > export class +3 > c +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) name (m1) +2 >Emitted(4, 9) Source(3, 18) + SourceIndex(0) name (m1) +3 >Emitted(4, 10) Source(3, 19) + SourceIndex(0) name (m1) +--- +>>> function c() { +1->^^^^^^^^ +2 > ^^^^^^^^^ +3 > ^ +1-> +2 > export class +3 > c +1->Emitted(5, 9) Source(3, 5) + SourceIndex(0) name (m1.c) +2 >Emitted(5, 18) Source(3, 18) + SourceIndex(0) name (m1.c) +3 >Emitted(5, 19) Source(3, 19) + SourceIndex(0) name (m1.c) +--- +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1 > { + > +2 > } +1 >Emitted(6, 9) Source(4, 5) + SourceIndex(0) name (m1.c.constructor) +2 >Emitted(6, 10) Source(4, 6) + SourceIndex(0) name (m1.c.constructor) +--- +>>> return c; +1->^^^^^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(7, 9) Source(4, 5) + SourceIndex(0) name (m1.c) +2 >Emitted(7, 17) Source(4, 6) + SourceIndex(0) name (m1.c) +--- +>>> })(); +1 >^^^^ +2 > ^ +3 > +4 > ^^^^ +5 > ^^^^^-> +1 > +2 > } +3 > +4 > export class c { + > } +1 >Emitted(8, 5) Source(4, 5) + SourceIndex(0) name (m1.c) +2 >Emitted(8, 6) Source(4, 6) + SourceIndex(0) name (m1.c) +3 >Emitted(8, 6) Source(3, 5) + SourceIndex(0) name (m1) +4 >Emitted(8, 10) Source(4, 6) + SourceIndex(0) name (m1) +--- +>>> m1.c = c; +1->^^^^ +2 > ^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^-> +1-> +2 > c +3 > +4 > c { + > } +5 > +1->Emitted(9, 5) Source(3, 18) + SourceIndex(0) name (m1) +2 >Emitted(9, 9) Source(3, 19) + SourceIndex(0) name (m1) +3 >Emitted(9, 12) Source(3, 18) + SourceIndex(0) name (m1) +4 >Emitted(9, 13) Source(4, 6) + SourceIndex(0) name (m1) +5 >Emitted(9, 14) Source(4, 6) + SourceIndex(0) name (m1) +--- +>>>})(m1 || (m1 = {})); +1-> +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > m1 +5 > +6 > m1 +7 > { + > var x = 10; + > export class c { + > } + > } +1->Emitted(10, 1) Source(5, 1) + SourceIndex(0) name (m1) +2 >Emitted(10, 2) Source(5, 2) + SourceIndex(0) name (m1) +3 >Emitted(10, 4) Source(1, 8) + SourceIndex(0) +4 >Emitted(10, 6) Source(1, 10) + SourceIndex(0) +5 >Emitted(10, 11) Source(1, 8) + SourceIndex(0) +6 >Emitted(10, 13) Source(1, 10) + SourceIndex(0) +7 >Emitted(10, 21) Source(5, 2) + SourceIndex(0) +--- +>>>var m1; +1 > +2 >^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + > +2 >module +3 > m1 +4 > { + > var b = new m1.c(); + > } +1 >Emitted(11, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(6, 8) + SourceIndex(0) +3 >Emitted(11, 7) Source(6, 10) + SourceIndex(0) +4 >Emitted(11, 8) Source(8, 2) + SourceIndex(0) +--- +>>>(function (m1) { +1-> +2 >^^^^^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^-> +1-> +2 >module +3 > m1 +4 > +5 > { +1->Emitted(12, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(12, 12) Source(6, 8) + SourceIndex(0) +3 >Emitted(12, 14) Source(6, 10) + SourceIndex(0) +4 >Emitted(12, 16) Source(6, 11) + SourceIndex(0) +5 >Emitted(12, 17) Source(6, 12) + SourceIndex(0) +--- +>>> var b = new m1.c(); +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^ +6 > ^^ +7 > ^ +8 > ^ +9 > ^^ +10> ^ +1-> + > +2 > var +3 > b +4 > = +5 > new +6 > m1 +7 > . +8 > c +9 > () +10> ; +1->Emitted(13, 5) Source(7, 5) + SourceIndex(0) name (m1) +2 >Emitted(13, 9) Source(7, 9) + SourceIndex(0) name (m1) +3 >Emitted(13, 10) Source(7, 10) + SourceIndex(0) name (m1) +4 >Emitted(13, 13) Source(7, 13) + SourceIndex(0) name (m1) +5 >Emitted(13, 17) Source(7, 17) + SourceIndex(0) name (m1) +6 >Emitted(13, 19) Source(7, 19) + SourceIndex(0) name (m1) +7 >Emitted(13, 20) Source(7, 20) + SourceIndex(0) name (m1) +8 >Emitted(13, 21) Source(7, 21) + SourceIndex(0) name (m1) +9 >Emitted(13, 23) Source(7, 23) + SourceIndex(0) name (m1) +10>Emitted(13, 24) Source(7, 24) + SourceIndex(0) name (m1) +--- +>>>})(m1 || (m1 = {})); +1 > +2 >^ +3 > ^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +3 > +4 > m1 +5 > +6 > m1 +7 > { + > var b = new m1.c(); + > } +1 >Emitted(14, 1) Source(8, 1) + SourceIndex(0) name (m1) +2 >Emitted(14, 2) Source(8, 2) + SourceIndex(0) name (m1) +3 >Emitted(14, 4) Source(6, 8) + SourceIndex(0) +4 >Emitted(14, 6) Source(6, 10) + SourceIndex(0) +5 >Emitted(14, 11) Source(6, 8) + SourceIndex(0) +6 >Emitted(14, 13) Source(6, 10) + SourceIndex(0) +7 >Emitted(14, 21) Source(8, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourcemapValidationDuplicateNames.js.map \ No newline at end of file diff --git a/tests/baselines/reference/specializationError.js b/tests/baselines/reference/specializationError.js new file mode 100644 index 0000000000000..944afc1142478 --- /dev/null +++ b/tests/baselines/reference/specializationError.js @@ -0,0 +1,13 @@ +//// [specializationError.ts] +interface Promise { + then(value: T): void; +} + +interface Bar { + bar(value: "Menu"): Promise; + bar(value: string, element: string): Promise; + bar(value: string): Promise; +} + + +//// [specializationError.js] diff --git a/tests/baselines/reference/specializationOfExportedClass.js b/tests/baselines/reference/specializationOfExportedClass.js new file mode 100644 index 0000000000000..75ec00b73042a --- /dev/null +++ b/tests/baselines/reference/specializationOfExportedClass.js @@ -0,0 +1,21 @@ +//// [specializationOfExportedClass.ts] +module M { + +export class C { } + +} + +var x = new M.C(); + + +//// [specializationOfExportedClass.js] +var M; +(function (M) { + var C = (function () { + function C() { + } + return C; + })(); + M.C = C; +})(M || (M = {})); +var x = new M.C(); diff --git a/tests/baselines/reference/specializationsShouldNotAffectEachOther.js b/tests/baselines/reference/specializationsShouldNotAffectEachOther.js new file mode 100644 index 0000000000000..d56e093868431 --- /dev/null +++ b/tests/baselines/reference/specializationsShouldNotAffectEachOther.js @@ -0,0 +1,33 @@ +//// [specializationsShouldNotAffectEachOther.ts] + +interface Series { + data: string[]; +} + +var series: Series; + + +function foo() { + + var seriesExtent = (series) => null; + + var series2: number[]; + + series2.map(seriesExtent); + return null; +} + + +var keyExtent2: any[] = series.data.map(function (d: string) { return d; }); + +//// [specializationsShouldNotAffectEachOther.js] +var series; +function foo() { + var seriesExtent = function (series) { return null; }; + var series2; + series2.map(seriesExtent); + return null; +} +var keyExtent2 = series.data.map(function (d) { + return d; +}); diff --git a/tests/baselines/reference/specializeVarArgs1.js b/tests/baselines/reference/specializeVarArgs1.js new file mode 100644 index 0000000000000..3eac6daa61fb8 --- /dev/null +++ b/tests/baselines/reference/specializeVarArgs1.js @@ -0,0 +1,30 @@ +//// [specializeVarArgs1.ts] +interface Observable{ } + + + +interface ObservableArray extends Observable + +{ + + push(...values: T[]); + +} + + + +function observableArray(): ObservableArray { return null;} + + + +var a = observableArray(); + +a.push('Some Value'); + + +//// [specializeVarArgs1.js] +function observableArray() { + return null; +} +var a = observableArray(); +a.push('Some Value'); diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js new file mode 100644 index 0000000000000..d20793629a236 --- /dev/null +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -0,0 +1,47 @@ +//// [specializedInheritedConstructors1.ts] +interface ViewOptions { + model: TModel; +} + +class View { + constructor(options: ViewOptions) { } + model: TModel; +} + +class Model { } +class MyView extends View { } + +var m: ViewOptions = { model: new Model() }; +var aView = new View({ model: new Model() }); +var aView2 = new View(m); +var myView = new MyView(m); // was error + + +//// [specializedInheritedConstructors1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var View = (function () { + function View(options) { + } + return View; +})(); +var Model = (function () { + function Model() { + } + return Model; +})(); +var MyView = (function (_super) { + __extends(MyView, _super); + function MyView() { + _super.apply(this, arguments); + } + return MyView; +})(View); +var m = { model: new Model() }; +var aView = new View({ model: new Model() }); +var aView2 = new View(m); +var myView = new MyView(m); diff --git a/tests/baselines/reference/specializedLambdaTypeArguments.js b/tests/baselines/reference/specializedLambdaTypeArguments.js new file mode 100644 index 0000000000000..393b4f9e8c355 --- /dev/null +++ b/tests/baselines/reference/specializedLambdaTypeArguments.js @@ -0,0 +1,15 @@ +//// [specializedLambdaTypeArguments.ts] +class X
{ + prop: X< () => Tany >; +} +var a: X; + + + +//// [specializedLambdaTypeArguments.js] +var X = (function () { + function X() { + } + return X; +})(); +var a; diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.errors.txt b/tests/baselines/reference/specializedOverloadWithRestParameters.errors.txt new file mode 100644 index 0000000000000..c03f8a97aed78 --- /dev/null +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/specializedOverloadWithRestParameters.ts (2 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + function f(tagName: 'span', ...args): Derived1; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f(tagName: number, ...args): Base; + function f(tagName: any): Base { + return null; + } + function g(tagName: 'span', arg): Derived1; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function g(tagName: number, arg): Base; + function g(tagName: any): Base { + return null; + } \ No newline at end of file diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js new file mode 100644 index 0000000000000..56bf07f6fdf49 --- /dev/null +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -0,0 +1,43 @@ +//// [specializedOverloadWithRestParameters.ts] +class Base { foo() { } } +class Derived1 extends Base { bar() { } } +function f(tagName: 'span', ...args): Derived1; // error +function f(tagName: number, ...args): Base; +function f(tagName: any): Base { + return null; +} +function g(tagName: 'span', arg): Derived1; // error +function g(tagName: number, arg): Base; +function g(tagName: any): Base { + return null; +} + +//// [specializedOverloadWithRestParameters.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + }; + return Base; +})(); +var Derived1 = (function (_super) { + __extends(Derived1, _super); + function Derived1() { + _super.apply(this, arguments); + } + Derived1.prototype.bar = function () { + }; + return Derived1; +})(Base); +function f(tagName) { + return null; +} +function g(tagName) { + return null; +} diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt new file mode 100644 index 0000000000000..c8d76791807f8 --- /dev/null +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -0,0 +1,15 @@ +==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (3 errors) ==== + function x3(a: number, cb: (x: number) => number); + function x3(a: string, cb: (x: number) => number); + function x3(a: any, cb: (x: number) => number) { + cb(a); + } + // both are errors + x3(1, (x: string) => 1); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + x3(1, (x: 'hm') => 1); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js new file mode 100644 index 0000000000000..3ea4e3ba9bb5d --- /dev/null +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.js @@ -0,0 +1,16 @@ +//// [specializedSignatureAsCallbackParameter1.ts] +function x3(a: number, cb: (x: number) => number); +function x3(a: string, cb: (x: number) => number); +function x3(a: any, cb: (x: number) => number) { + cb(a); +} +// both are errors +x3(1, (x: string) => 1); +x3(1, (x: 'hm') => 1); + +//// [specializedSignatureAsCallbackParameter1.js] +function x3(a, cb) { + cb(a); +} +x3(1, function (x) { return 1; }); +x3(1, function (x) { return 1; }); diff --git a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.errors.txt b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.errors.txt new file mode 100644 index 0000000000000..04bd569c063a6 --- /dev/null +++ b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.errors.txt @@ -0,0 +1,91 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts (12 errors) ==== + // Specialized signatures must be a subtype of a non-specialized signature + // All the below should be errors + + function foo(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function foo(x: number) { } + + class C { + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: number); + foo(x: any) { } + } + + class C2 { + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: T); + foo(x: any) { } + } + + class C3 { + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: T); + foo(x: any) { } + } + + interface I { + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: number); + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: number); + } + + interface I2 { + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: T); + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: T); + } + + interface I3 { + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: T); + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: T); + } + + var a: { + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: number); + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: number); + } + + var a2: { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); + } + + var a3: { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); + } + \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js new file mode 100644 index 0000000000000..c84badf23f2db --- /dev/null +++ b/tests/baselines/reference/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js @@ -0,0 +1,95 @@ +//// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts] +// Specialized signatures must be a subtype of a non-specialized signature +// All the below should be errors + +function foo(x: 'a'); +function foo(x: number) { } + +class C { + foo(x: 'a'); + foo(x: number); + foo(x: any) { } +} + +class C2 { + foo(x: 'a'); + foo(x: T); + foo(x: any) { } +} + +class C3 { + foo(x: 'a'); + foo(x: T); + foo(x: any) { } +} + +interface I { + (x: 'a'); + (x: number); + foo(x: 'a'); + foo(x: number); +} + +interface I2 { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); +} + +interface I3 { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); +} + +var a: { + (x: 'a'); + (x: number); + foo(x: 'a'); + foo(x: number); +} + +var a2: { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); +} + +var a3: { + (x: 'a'); + (x: T); + foo(x: 'a'); + foo(x: T); +} + + +//// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js] +function foo(x) { +} +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function (x) { + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + C3.prototype.foo = function (x) { + }; + return C3; +})(); +var a; +var a2; +var a3; diff --git a/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js new file mode 100644 index 0000000000000..509cc4629b43a --- /dev/null +++ b/tests/baselines/reference/specializedSignatureIsSubtypeOfNonSpecializedSignature.js @@ -0,0 +1,110 @@ +//// [specializedSignatureIsSubtypeOfNonSpecializedSignature.ts] +// Specialized signatures must be a subtype of a non-specialized signature +// All the below should not be errors + +function foo(x: 'a'); +function foo(x: string); +function foo(x: any) { } + +class C { + foo(x: 'a'); + foo(x: string); + foo(x: any) { } +} + +class C2 { + foo(x: 'a'); + foo(x: string); + foo(x: T); + foo(x: any) { } +} + +class C3 { + foo(x: 'a'); + foo(x: string); + foo(x: T); + foo(x: any) { } +} + +interface I { + (x: 'a'); + (x: number); + (x: string); + foo(x: 'a'); + foo(x: string); + foo(x: number); +} + +interface I2 { + (x: 'a'); + (x: T); + (x: string); + foo(x: 'a'); + foo(x: string); + foo(x: T); +} + +interface I3 { + (x: 'a'); + (x: string); + (x: T); + foo(x: 'a'); + foo(x: string); + foo(x: T); +} + +var a: { + (x: string); + (x: 'a'); + (x: number); + foo(x: string); + foo(x: 'a'); + foo(x: number); +} + +var a2: { + (x: 'a'); + (x: string); + (x: T); + foo(x: string); + foo(x: 'a'); + foo(x: T); +} + +var a3: { + (x: 'a'); + (x: T); + (x: string); + foo(x: string); + foo(x: 'a'); + foo(x: T); +} + + +//// [specializedSignatureIsSubtypeOfNonSpecializedSignature.js] +function foo(x) { +} +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function (x) { + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + C3.prototype.foo = function (x) { + }; + return C3; +})(); +var a; +var a2; +var a3; diff --git a/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.errors.txt b/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.errors.txt new file mode 100644 index 0000000000000..efe7d0b646db4 --- /dev/null +++ b/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/specializedSignatureOverloadReturnTypeWithIndexers.ts (1 errors) ==== + interface A { + f(p: string): { [p: string]: string; }; + f(p: "spec"): { [p: string]: any; } // Should be ok + } + interface B { + f(p: string): { [p: number]: string; }; + f(p: "spec"): { [p: string]: any; } // Should be ok + } + interface C { + f(p: string): { [p: number]: string; }; + f(p: "spec"): { [p: number]: any; } // Should be ok + } + interface D { + f(p: string): { [p: string]: string; }; + f(p: "spec"): { [p: number]: any; } // Should be error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } \ No newline at end of file diff --git a/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.js b/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.js new file mode 100644 index 0000000000000..6b90cf8fd0a6e --- /dev/null +++ b/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.js @@ -0,0 +1,19 @@ +//// [specializedSignatureOverloadReturnTypeWithIndexers.ts] +interface A { + f(p: string): { [p: string]: string; }; + f(p: "spec"): { [p: string]: any; } // Should be ok +} +interface B { + f(p: string): { [p: number]: string; }; + f(p: "spec"): { [p: string]: any; } // Should be ok +} +interface C { + f(p: string): { [p: number]: string; }; + f(p: "spec"): { [p: number]: any; } // Should be ok +} +interface D { + f(p: string): { [p: string]: string; }; + f(p: "spec"): { [p: number]: any; } // Should be error +} + +//// [specializedSignatureOverloadReturnTypeWithIndexers.js] diff --git a/tests/baselines/reference/staticAndMemberFunctions.js b/tests/baselines/reference/staticAndMemberFunctions.js new file mode 100644 index 0000000000000..0d1d9e81900ce --- /dev/null +++ b/tests/baselines/reference/staticAndMemberFunctions.js @@ -0,0 +1,16 @@ +//// [staticAndMemberFunctions.ts] +class T { + static x() { } + public y() { } +} + +//// [staticAndMemberFunctions.js] +var T = (function () { + function T() { + } + T.x = function () { + }; + T.prototype.y = function () { + }; + return T; +})(); diff --git a/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js new file mode 100644 index 0000000000000..ccfbcc856024c --- /dev/null +++ b/tests/baselines/reference/staticAndNonStaticPropertiesSameName.js @@ -0,0 +1,19 @@ +//// [staticAndNonStaticPropertiesSameName.ts] +class C { + x: number; + static x: number; + + f() { } + static f() { } +} + +//// [staticAndNonStaticPropertiesSameName.js] +var C = (function () { + function C() { + } + C.prototype.f = function () { + }; + C.f = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/staticClassMemberError.errors.txt b/tests/baselines/reference/staticClassMemberError.errors.txt new file mode 100644 index 0000000000000..6f981054bafbb --- /dev/null +++ b/tests/baselines/reference/staticClassMemberError.errors.txt @@ -0,0 +1,19 @@ +==== tests/cases/compiler/staticClassMemberError.ts (3 errors) ==== + class C { + static s; + public a() { + s = 1; + ~ +!!! Cannot find name 's'. + } + } + + // just want to make sure this one doesn't crash the compiler + function Foo(); + ~~~~~~~~~~~~~~~ +!!! Function implementation expected. + class Foo { + ~~~ +!!! Duplicate identifier 'Foo'. + static bar; + } \ No newline at end of file diff --git a/tests/baselines/reference/staticClassMemberError.js b/tests/baselines/reference/staticClassMemberError.js new file mode 100644 index 0000000000000..e33cf2f270432 --- /dev/null +++ b/tests/baselines/reference/staticClassMemberError.js @@ -0,0 +1,28 @@ +//// [staticClassMemberError.ts] +class C { + static s; + public a() { + s = 1; + } +} + +// just want to make sure this one doesn't crash the compiler +function Foo(); +class Foo { + static bar; +} + +//// [staticClassMemberError.js] +var C = (function () { + function C() { + } + C.prototype.a = function () { + s = 1; + }; + return C; +})(); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); diff --git a/tests/baselines/reference/staticClassProps.errors.txt b/tests/baselines/reference/staticClassProps.errors.txt new file mode 100644 index 0000000000000..4de975ce1beac --- /dev/null +++ b/tests/baselines/reference/staticClassProps.errors.txt @@ -0,0 +1,13 @@ +==== tests/cases/compiler/staticClassProps.ts (2 errors) ==== + class C + { + public foo() { + static z = 1; + ~~~~~~ +!!! Statement expected. + } + } + ~ +!!! Declaration or statement expected. + + \ No newline at end of file diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js new file mode 100644 index 0000000000000..af5780d96cf70 --- /dev/null +++ b/tests/baselines/reference/staticFactory1.js @@ -0,0 +1,45 @@ +//// [staticFactory1.ts] +class Base { + foo() { return 1; } + static create() { + return new this(); + } +} + +class Derived extends Base { + foo() { return 2; } +} +var d = Derived.create(); + +d.foo(); + +//// [staticFactory1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Base = (function () { + function Base() { + } + Base.prototype.foo = function () { + return 1; + }; + Base.create = function () { + return new this(); + }; + return Base; +})(); +var Derived = (function (_super) { + __extends(Derived, _super); + function Derived() { + _super.apply(this, arguments); + } + Derived.prototype.foo = function () { + return 2; + }; + return Derived; +})(Base); +var d = Derived.create(); +d.foo(); diff --git a/tests/baselines/reference/staticGetter1.errors.txt b/tests/baselines/reference/staticGetter1.errors.txt new file mode 100644 index 0000000000000..7ce59d915c84d --- /dev/null +++ b/tests/baselines/reference/staticGetter1.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/staticGetter1.ts (1 errors) ==== + // once caused stack overflow + class C { + static get x() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticGetter2.js b/tests/baselines/reference/staticGetter2.js new file mode 100644 index 0000000000000..561d38d641a71 --- /dev/null +++ b/tests/baselines/reference/staticGetter2.js @@ -0,0 +1,19 @@ +//// [staticGetter2.ts] +// once caused stack overflow +class C { + static x() { + var r = this; + return this; + } +} + +//// [staticGetter2.js] +var C = (function () { + function C() { + } + C.x = function () { + var r = this; + return this; + }; + return C; +})(); diff --git a/tests/baselines/reference/staticGetterAndSetter.errors.txt b/tests/baselines/reference/staticGetterAndSetter.errors.txt new file mode 100644 index 0000000000000..61bcb6eccbfa1 --- /dev/null +++ b/tests/baselines/reference/staticGetterAndSetter.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/staticGetterAndSetter.ts (2 errors) ==== + class Foo { + static get Foo():number { return 0; } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set Foo(n: number) {} + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticIndexer.errors.txt b/tests/baselines/reference/staticIndexer.errors.txt new file mode 100644 index 0000000000000..8cf2db5894241 --- /dev/null +++ b/tests/baselines/reference/staticIndexer.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/staticIndexer.ts (1 errors) ==== + class C { + static [s: string]: number; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticIndexers.errors.txt b/tests/baselines/reference/staticIndexers.errors.txt new file mode 100644 index 0000000000000..86c71565d4c2d --- /dev/null +++ b/tests/baselines/reference/staticIndexers.errors.txt @@ -0,0 +1,20 @@ +==== tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts (3 errors) ==== + // static indexers not allowed + + class C { + static [x: string]: string; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class D { + static [x: number]: string; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } + + class E { + static [x: string]: T; + ~~~~~~ +!!! Modifiers not permitted on index signature members. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js new file mode 100644 index 0000000000000..a73c074749948 --- /dev/null +++ b/tests/baselines/reference/staticInheritance.js @@ -0,0 +1,38 @@ +//// [staticInheritance.ts] +function doThing(x: { n: string }) { } +class A { + static n: string; + p = doThing(A); // OK +} +class B extends A { + p1 = doThing(A); // OK + p2 = doThing(B); // OK +} +doThing(B); //OK + + +//// [staticInheritance.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +function doThing(x) { +} +var A = (function () { + function A() { + this.p = doThing(A); + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + this.p1 = doThing(A); + this.p2 = doThing(B); + } + return B; +})(A); +doThing(B); diff --git a/tests/baselines/reference/staticInstanceResolution.js b/tests/baselines/reference/staticInstanceResolution.js new file mode 100644 index 0000000000000..de4e9bc9f0ad1 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution.js @@ -0,0 +1,29 @@ +//// [staticInstanceResolution.ts] +class Comment { + + public getDocCommentText() + { + + } + + static getDocCommentText(comments: Comment[]) + { + comments[0].getDocCommentText(); + var c: Comment; + c.getDocCommentText(); + } +} + +//// [staticInstanceResolution.js] +var Comment = (function () { + function Comment() { + } + Comment.prototype.getDocCommentText = function () { + }; + Comment.getDocCommentText = function (comments) { + comments[0].getDocCommentText(); + var c; + c.getDocCommentText(); + }; + return Comment; +})(); diff --git a/tests/baselines/reference/staticInstanceResolution2.js b/tests/baselines/reference/staticInstanceResolution2.js new file mode 100644 index 0000000000000..07d5dd376df85 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution2.js @@ -0,0 +1,26 @@ +//// [staticInstanceResolution2.ts] +class A { } +A.hasOwnProperty('foo'); + +class B { + constructor() { } +} +B.hasOwnProperty('foo'); + + + + + +//// [staticInstanceResolution2.js] +var A = (function () { + function A() { + } + return A; +})(); +A.hasOwnProperty('foo'); +var B = (function () { + function B() { + } + return B; +})(); +B.hasOwnProperty('foo'); diff --git a/tests/baselines/reference/staticInstanceResolution3.js b/tests/baselines/reference/staticInstanceResolution3.js new file mode 100644 index 0000000000000..16d9527a19333 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution3.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/staticInstanceResolution3.ts] //// + +//// [staticInstanceResolution3_0.ts] +export class Promise { + static timeout(delay: number): Promise { + return null; + } +} + +//// [staticInstanceResolution3_1.ts] +/// +import WinJS = require('staticInstanceResolution3_0'); +WinJS.Promise.timeout(10); + +//// [staticInstanceResolution3_0.js] +var Promise = (function () { + function Promise() { + } + Promise.timeout = function (delay) { + return null; + }; + return Promise; +})(); +exports.Promise = Promise; +//// [staticInstanceResolution3_1.js] +var WinJS = require('staticInstanceResolution3_0'); +WinJS.Promise.timeout(10); diff --git a/tests/baselines/reference/staticInstanceResolution4.errors.txt b/tests/baselines/reference/staticInstanceResolution4.errors.txt new file mode 100644 index 0000000000000..de0b2930fa320 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution4.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/staticInstanceResolution4.ts (1 errors) ==== + class A { + public foo() {} + } + + A.foo(); + ~~~ +!!! Property 'foo' does not exist on type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/staticInstanceResolution4.js b/tests/baselines/reference/staticInstanceResolution4.js new file mode 100644 index 0000000000000..6e81d67dc0079 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution4.js @@ -0,0 +1,16 @@ +//// [staticInstanceResolution4.ts] +class A { + public foo() {} +} + +A.foo(); + +//// [staticInstanceResolution4.js] +var A = (function () { + function A() { + } + A.prototype.foo = function () { + }; + return A; +})(); +A.foo(); diff --git a/tests/baselines/reference/staticInstanceResolution5.errors.txt b/tests/baselines/reference/staticInstanceResolution5.errors.txt new file mode 100644 index 0000000000000..b1d5acf235cc0 --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution5.errors.txt @@ -0,0 +1,17 @@ +==== tests/cases/compiler/staticInstanceResolution5_1.ts (1 errors) ==== + import WinJS = require('staticInstanceResolution5_0.ts'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find external module 'staticInstanceResolution5_0.ts'. + + // these 3 should be errors + var x = (w1: WinJS) => { }; + var y = function (w2: WinJS) { } + function z(w3: WinJS) { } + +==== tests/cases/compiler/staticInstanceResolution5_0.ts (0 errors) ==== + export class Promise { + static timeout(delay: number): Promise { + return null; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticInstanceResolution5.js b/tests/baselines/reference/staticInstanceResolution5.js new file mode 100644 index 0000000000000..45a4fb726ab7b --- /dev/null +++ b/tests/baselines/reference/staticInstanceResolution5.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/staticInstanceResolution5.ts] //// + +//// [staticInstanceResolution5_0.ts] +export class Promise { + static timeout(delay: number): Promise { + return null; + } +} + +//// [staticInstanceResolution5_1.ts] +import WinJS = require('staticInstanceResolution5_0.ts'); + +// these 3 should be errors +var x = (w1: WinJS) => { }; +var y = function (w2: WinJS) { } +function z(w3: WinJS) { } + + +//// [staticInstanceResolution5_1.js] +define(["require", "exports"], function (require, exports) { + var x = function (w1) { + }; + var y = function (w2) { + }; + function z(w3) { + } +}); diff --git a/tests/baselines/reference/staticInterfaceAssignmentCompat.js b/tests/baselines/reference/staticInterfaceAssignmentCompat.js new file mode 100644 index 0000000000000..b955474eb574e --- /dev/null +++ b/tests/baselines/reference/staticInterfaceAssignmentCompat.js @@ -0,0 +1,24 @@ +//// [staticInterfaceAssignmentCompat.ts] +class Shape { + static create(): Shape { + return new Shape(); + } +} + +interface ShapeFactory { + create(): Shape; +} + +var x: ShapeFactory = Shape; + + +//// [staticInterfaceAssignmentCompat.js] +var Shape = (function () { + function Shape() { + } + Shape.create = function () { + return new Shape(); + }; + return Shape; +})(); +var x = Shape; diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js new file mode 100644 index 0000000000000..a4bbc3947cd66 --- /dev/null +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -0,0 +1,34 @@ +//// [staticMemberAccessOffDerivedType1.ts] +class SomeBase { + static GetNumber() { + return 2; + } +} +class P extends SomeBase { + static SomeNumber = P.GetNumber(); +} + + +//// [staticMemberAccessOffDerivedType1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SomeBase = (function () { + function SomeBase() { + } + SomeBase.GetNumber = function () { + return 2; + }; + return SomeBase; +})(); +var P = (function (_super) { + __extends(P, _super); + function P() { + _super.apply(this, arguments); + } + P.SomeNumber = P.GetNumber(); + return P; +})(SomeBase); diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt new file mode 100644 index 0000000000000..427b91e5174cb --- /dev/null +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -0,0 +1,16 @@ +==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts (1 errors) ==== + class C { + static foo() { + C.foo = () => { } + } + + static bar(x: number): number { + C.bar = () => { } // error + ~~~~~ +!!! Type '() => void' is not assignable to type '(x: number) => number': +!!! Type 'void' is not assignable to type 'number'. + C.bar = (x) => x; // ok + C.bar = (x: number) => 1; // ok + return 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js new file mode 100644 index 0000000000000..7f06aa0b9f195 --- /dev/null +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js @@ -0,0 +1,31 @@ +//// [staticMemberAssignsToConstructorFunctionMembers.ts] +class C { + static foo() { + C.foo = () => { } + } + + static bar(x: number): number { + C.bar = () => { } // error + C.bar = (x) => x; // ok + C.bar = (x: number) => 1; // ok + return 1; + } +} + +//// [staticMemberAssignsToConstructorFunctionMembers.js] +var C = (function () { + function C() { + } + C.foo = function () { + C.foo = function () { + }; + }; + C.bar = function (x) { + C.bar = function () { + }; + C.bar = function (x) { return x; }; + C.bar = function (x) { return 1; }; + return 1; + }; + return C; +})(); diff --git a/tests/baselines/reference/staticMemberExportAccess.errors.txt b/tests/baselines/reference/staticMemberExportAccess.errors.txt new file mode 100644 index 0000000000000..142b8caced3dc --- /dev/null +++ b/tests/baselines/reference/staticMemberExportAccess.errors.txt @@ -0,0 +1,27 @@ +==== tests/cases/compiler/staticMemberExportAccess.ts (3 errors) ==== + class Sammy { + foo() { return "hi"; } + static bar() { + return -1; + } + } + module Sammy { + export var x = 1; + } + interface JQueryStatic { + sammy: Sammy; // class instance + } + var $: JQueryStatic; + var instanceOfClassSammy: Sammy = new $.sammy(); // should be error + ~~~~~~~~~~~~~ +!!! Cannot use 'new' with an expression whose type lacks a call or construct signature. + var r1 = instanceOfClassSammy.foo(); // r1 is string + var r2 = $.sammy.foo(); + var r3 = $.sammy.bar(); // error + ~~~ +!!! Property 'bar' does not exist on type 'Sammy'. + var r4 = $.sammy.x; // error + ~ +!!! Property 'x' does not exist on type 'Sammy'. + + Sammy.bar(); \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberExportAccess.js b/tests/baselines/reference/staticMemberExportAccess.js new file mode 100644 index 0000000000000..5c3700bcf41de --- /dev/null +++ b/tests/baselines/reference/staticMemberExportAccess.js @@ -0,0 +1,45 @@ +//// [staticMemberExportAccess.ts] +class Sammy { + foo() { return "hi"; } + static bar() { + return -1; + } +} +module Sammy { + export var x = 1; +} +interface JQueryStatic { + sammy: Sammy; // class instance +} +var $: JQueryStatic; +var instanceOfClassSammy: Sammy = new $.sammy(); // should be error +var r1 = instanceOfClassSammy.foo(); // r1 is string +var r2 = $.sammy.foo(); +var r3 = $.sammy.bar(); // error +var r4 = $.sammy.x; // error + +Sammy.bar(); + +//// [staticMemberExportAccess.js] +var Sammy = (function () { + function Sammy() { + } + Sammy.prototype.foo = function () { + return "hi"; + }; + Sammy.bar = function () { + return -1; + }; + return Sammy; +})(); +var Sammy; +(function (Sammy) { + Sammy.x = 1; +})(Sammy || (Sammy = {})); +var $; +var instanceOfClassSammy = new $.sammy(); +var r1 = instanceOfClassSammy.foo(); +var r2 = $.sammy.foo(); +var r3 = $.sammy.bar(); +var r4 = $.sammy.x; +Sammy.bar(); diff --git a/tests/baselines/reference/staticMemberInitialization.js b/tests/baselines/reference/staticMemberInitialization.js new file mode 100644 index 0000000000000..1e919b4f99399 --- /dev/null +++ b/tests/baselines/reference/staticMemberInitialization.js @@ -0,0 +1,17 @@ +//// [staticMemberInitialization.ts] +class C { + static x = 1; +} + +var c = new C(); +var r = C.x; + +//// [staticMemberInitialization.js] +var C = (function () { + function C() { + } + C.x = 1; + return C; +})(); +var c = new C(); +var r = C.x; diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt new file mode 100644 index 0000000000000..5440b075902c2 --- /dev/null +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt @@ -0,0 +1,38 @@ +==== tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts (4 errors) ==== + interface A { + name(); + } + class B { + public name() { } + } + class C { + public static name() { } + } + + var a: A = new B(); + a = new C(); // error name is missing + ~ +!!! Type 'C' is not assignable to type 'A': +!!! Property 'name' is missing in type 'C'. + a = B; // error name is missing + ~ +!!! Type 'typeof B' is not assignable to type 'A': +!!! Property 'name' is missing in type 'typeof B'. + a = C; + + var b: B = new C(); // error name is missing + ~~~~~~~~~~~~~~ +!!! Type 'C' is not assignable to type 'B': +!!! Property 'name' is missing in type 'C'. + b = B; // error name is missing + ~ +!!! Type 'typeof B' is not assignable to type 'B': +!!! Property 'name' is missing in type 'typeof B'. + b = C; + b = a; + + var c: C = new B(); + c = B; + c = C; + c = a; + \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js new file mode 100644 index 0000000000000..85e575f74a90e --- /dev/null +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js @@ -0,0 +1,54 @@ +//// [staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts] +interface A { + name(); +} +class B { + public name() { } +} +class C { + public static name() { } +} + +var a: A = new B(); +a = new C(); // error name is missing +a = B; // error name is missing +a = C; + +var b: B = new C(); // error name is missing +b = B; // error name is missing +b = C; +b = a; + +var c: C = new B(); +c = B; +c = C; +c = a; + + +//// [staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js] +var B = (function () { + function B() { + } + B.prototype.name = function () { + }; + return B; +})(); +var C = (function () { + function C() { + } + C.name = function () { + }; + return C; +})(); +var a = new B(); +a = new C(); +a = B; +a = C; +var b = new C(); +b = B; +b = C; +b = a; +var c = new B(); +c = B; +c = C; +c = a; diff --git a/tests/baselines/reference/staticMemberWithStringAndNumberNames.js b/tests/baselines/reference/staticMemberWithStringAndNumberNames.js new file mode 100644 index 0000000000000..2f48aba4f950e --- /dev/null +++ b/tests/baselines/reference/staticMemberWithStringAndNumberNames.js @@ -0,0 +1,28 @@ +//// [staticMemberWithStringAndNumberNames.ts] +class C { + static "foo" = 0; + static 0 = 1; + + x = C['foo']; + x2 = C['0']; + x3 = C[0]; + + static s = C['foo']; + static s2 = C['0']; + static s3 = C[0]; +} + +//// [staticMemberWithStringAndNumberNames.js] +var C = (function () { + function C() { + this.x = C['foo']; + this.x2 = C['0']; + this.x3 = C[0]; + } + C["foo"] = 0; + C[0] = 1; + C.s = C['foo']; + C.s2 = C['0']; + C.s3 = C[0]; + return C; +})(); diff --git a/tests/baselines/reference/staticMembersUsingClassTypeParameter.errors.txt b/tests/baselines/reference/staticMembersUsingClassTypeParameter.errors.txt new file mode 100644 index 0000000000000..92530c0c5f110 --- /dev/null +++ b/tests/baselines/reference/staticMembersUsingClassTypeParameter.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/conformance/types/typeParameters/typeParameterLists/staticMembersUsingClassTypeParameter.ts (6 errors) ==== + // BUG 745747 + class C { + static x: T; + ~ +!!! Static members cannot reference class type parameters. + static f(x: T) {} + ~ +!!! Static members cannot reference class type parameters. + } + + class C2 { + static x: U; + ~ +!!! Static members cannot reference class type parameters. + static f(x: U) { } + ~ +!!! Static members cannot reference class type parameters. + } + + class C3 { + static x: T; + ~ +!!! Static members cannot reference class type parameters. + static f(x: T) { } + ~ +!!! Static members cannot reference class type parameters. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticMembersUsingClassTypeParameter.js b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js new file mode 100644 index 0000000000000..74a23158bd25e --- /dev/null +++ b/tests/baselines/reference/staticMembersUsingClassTypeParameter.js @@ -0,0 +1,39 @@ +//// [staticMembersUsingClassTypeParameter.ts] +// BUG 745747 +class C { + static x: T; + static f(x: T) {} +} + +class C2 { + static x: U; + static f(x: U) { } +} + +class C3 { + static x: T; + static f(x: T) { } +} + +//// [staticMembersUsingClassTypeParameter.js] +var C = (function () { + function C() { + } + C.f = function (x) { + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + C2.f = function (x) { + }; + return C2; +})(); +var C3 = (function () { + function C3() { + } + C3.f = function (x) { + }; + return C3; +})(); diff --git a/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt b/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt new file mode 100644 index 0000000000000..0b1e1497c6c79 --- /dev/null +++ b/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt @@ -0,0 +1,23 @@ +==== tests/cases/compiler/staticMethodReferencingTypeArgument1.ts (3 errors) ==== + module Editor { + export class List { + next: List; + prev: List; + + constructor(public isHead: boolean, public data: T) { + } + + static MakeHead(): List { + ~ +!!! Static members cannot reference class type parameters. + var entry: List = new List(true, null); // can't access T here + ~ +!!! Static members cannot reference class type parameters. + ~ +!!! Static members cannot reference class type parameters. + entry.prev = entry; + entry.next = entry; + return entry; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/staticMethodReferencingTypeArgument1.js b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js new file mode 100644 index 0000000000000..e9ff32877ad4c --- /dev/null +++ b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js @@ -0,0 +1,36 @@ +//// [staticMethodReferencingTypeArgument1.ts] +module Editor { + export class List { + next: List; + prev: List; + + constructor(public isHead: boolean, public data: T) { + } + + static MakeHead(): List { + var entry: List = new List(true, null); // can't access T here + entry.prev = entry; + entry.next = entry; + return entry; + } + } +} + +//// [staticMethodReferencingTypeArgument1.js] +var Editor; +(function (Editor) { + var List = (function () { + function List(isHead, data) { + this.isHead = isHead; + this.data = data; + } + List.MakeHead = function () { + var entry = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + }; + return List; + })(); + Editor.List = List; +})(Editor || (Editor = {})); diff --git a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.errors.txt b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.errors.txt new file mode 100644 index 0000000000000..cd5e521b0422b --- /dev/null +++ b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/staticMethodsReferencingClassTypeParameters.ts (1 errors) ==== + class C { + static s(p: T) { return p; } + ~ +!!! Static members cannot reference class type parameters. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js new file mode 100644 index 0000000000000..499e16ec58113 --- /dev/null +++ b/tests/baselines/reference/staticMethodsReferencingClassTypeParameters.js @@ -0,0 +1,14 @@ +//// [staticMethodsReferencingClassTypeParameters.ts] +class C { + static s(p: T) { return p; } +} + +//// [staticMethodsReferencingClassTypeParameters.js] +var C = (function () { + function C() { + } + C.s = function (p) { + return p; + }; + return C; +})(); diff --git a/tests/baselines/reference/staticModifierAlreadySeen.errors.txt b/tests/baselines/reference/staticModifierAlreadySeen.errors.txt new file mode 100644 index 0000000000000..fe983332931b2 --- /dev/null +++ b/tests/baselines/reference/staticModifierAlreadySeen.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/staticModifierAlreadySeen.ts (2 errors) ==== + class C { + static static foo = 1; + ~~~~~~ +!!! 'static' modifier already seen. + public static static bar() { } + ~~~~~~ +!!! 'static' modifier already seen. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticMustPrecedePublic.errors.txt b/tests/baselines/reference/staticMustPrecedePublic.errors.txt new file mode 100644 index 0000000000000..93207a41f2dc2 --- /dev/null +++ b/tests/baselines/reference/staticMustPrecedePublic.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/staticMustPrecedePublic.ts (2 errors) ==== + class Outer { + static public intI: number; + ~~~~~~ +!!! 'public' modifier must precede 'static' modifier. + static private stringF: string; + ~~~~~~~ +!!! 'private' modifier must precede 'static' modifier. + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticOffOfInstance1.errors.txt b/tests/baselines/reference/staticOffOfInstance1.errors.txt new file mode 100644 index 0000000000000..5316891510285 --- /dev/null +++ b/tests/baselines/reference/staticOffOfInstance1.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/staticOffOfInstance1.ts (1 errors) ==== + class List { + public Blah() { + this.Foo(); + ~~~ +!!! Property 'Foo' does not exist on type 'List'. + } + public static Foo() {} + } \ No newline at end of file diff --git a/tests/baselines/reference/staticOffOfInstance1.js b/tests/baselines/reference/staticOffOfInstance1.js new file mode 100644 index 0000000000000..41b7cd895bb46 --- /dev/null +++ b/tests/baselines/reference/staticOffOfInstance1.js @@ -0,0 +1,19 @@ +//// [staticOffOfInstance1.ts] +class List { + public Blah() { + this.Foo(); + } + public static Foo() {} +} + +//// [staticOffOfInstance1.js] +var List = (function () { + function List() { + } + List.prototype.Blah = function () { + this.Foo(); + }; + List.Foo = function () { + }; + return List; +})(); diff --git a/tests/baselines/reference/staticOffOfInstance2.errors.txt b/tests/baselines/reference/staticOffOfInstance2.errors.txt new file mode 100644 index 0000000000000..c557f44867db2 --- /dev/null +++ b/tests/baselines/reference/staticOffOfInstance2.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/staticOffOfInstance2.ts (1 errors) ==== + class List { + public Blah() { + this.Foo(); // no error + ~~~ +!!! Property 'Foo' does not exist on type 'List'. + List.Foo(); + } + public static Foo() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticOffOfInstance2.js b/tests/baselines/reference/staticOffOfInstance2.js new file mode 100644 index 0000000000000..6f2fd280a4643 --- /dev/null +++ b/tests/baselines/reference/staticOffOfInstance2.js @@ -0,0 +1,22 @@ +//// [staticOffOfInstance2.ts] +class List { + public Blah() { + this.Foo(); // no error + List.Foo(); + } + public static Foo() { } +} + + +//// [staticOffOfInstance2.js] +var List = (function () { + function List() { + } + List.prototype.Blah = function () { + this.Foo(); + List.Foo(); + }; + List.Foo = function () { + }; + return List; +})(); diff --git a/tests/baselines/reference/staticPropSuper.errors.txt b/tests/baselines/reference/staticPropSuper.errors.txt new file mode 100644 index 0000000000000..e4f205013fd15 --- /dev/null +++ b/tests/baselines/reference/staticPropSuper.errors.txt @@ -0,0 +1,48 @@ +==== tests/cases/compiler/staticPropSuper.ts (3 errors) ==== + class A { + } + + class B extends A { + public static s: number = 9; + + constructor() { + var x = 1; // should not error + super(); + } + } + + class C extends A { + public p: number = 10; + + constructor() { + ~~~~~~~~~~~~~~~ + var x = 1; // should error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class D extends A { + private p: number = 11; + + constructor() { + ~~~~~~~~~~~~~~~ + var x = 1; // should error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } + + class E extends A { + p: number = 12; + + constructor() { + ~~~~~~~~~~~~~~~ + var x = 1; // should error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Constructors for derived classes must contain a 'super' call. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js new file mode 100644 index 0000000000000..b1fc30e9387ee --- /dev/null +++ b/tests/baselines/reference/staticPropSuper.js @@ -0,0 +1,82 @@ +//// [staticPropSuper.ts] +class A { +} + +class B extends A { + public static s: number = 9; + + constructor() { + var x = 1; // should not error + super(); + } +} + +class C extends A { + public p: number = 10; + + constructor() { + var x = 1; // should error + } +} + +class D extends A { + private p: number = 11; + + constructor() { + var x = 1; // should error + } +} + +class E extends A { + p: number = 12; + + constructor() { + var x = 1; // should error + } +} + +//// [staticPropSuper.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + var x = 1; + _super.call(this); + } + B.s = 9; + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + this.p = 10; + var x = 1; + } + return C; +})(A); +var D = (function (_super) { + __extends(D, _super); + function D() { + this.p = 11; + var x = 1; + } + return D; +})(A); +var E = (function (_super) { + __extends(E, _super); + function E() { + this.p = 12; + var x = 1; + } + return E; +})(A); diff --git a/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js new file mode 100644 index 0000000000000..0308805cd7bda --- /dev/null +++ b/tests/baselines/reference/staticPropertyAndFunctionWithSameName.js @@ -0,0 +1,24 @@ +//// [staticPropertyAndFunctionWithSameName.ts] +class C { + static f: number; + f: number; +} + +class D { + static f: number; + f() { } +} + +//// [staticPropertyAndFunctionWithSameName.js] +var C = (function () { + function C() { + } + return C; +})(); +var D = (function () { + function D() { + } + D.prototype.f = function () { + }; + return D; +})(); diff --git a/tests/baselines/reference/staticPropertyNotInClassType.errors.txt b/tests/baselines/reference/staticPropertyNotInClassType.errors.txt new file mode 100644 index 0000000000000..09ca4df80641f --- /dev/null +++ b/tests/baselines/reference/staticPropertyNotInClassType.errors.txt @@ -0,0 +1,62 @@ +==== tests/cases/conformance/classes/members/classTypes/staticPropertyNotInClassType.ts (11 errors) ==== + module NonGeneric { + class C { + fn() { return this; } + static get x() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set x(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + constructor(public a: number, private b: number) { } + static foo: string; // not reflected in class type + } + + module C { + export var bar = ''; // not reflected in class type + } + + var c = new C(1, 2); + var r = c.fn(); + var r4 = c.foo; // error + ~~~ +!!! Property 'foo' does not exist on type 'C'. + var r5 = c.bar; // error + ~~~ +!!! Property 'bar' does not exist on type 'C'. + var r6 = c.x; // error + ~ +!!! Property 'x' does not exist on type 'C'. + } + + module Generic { + class C { + fn() { return this; } + static get x() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + static set x(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + constructor(public a: T, private b: U) { } + static foo: T; // not reflected in class type + ~ +!!! Static members cannot reference class type parameters. + } + + module C { + export var bar = ''; // not reflected in class type + } + + var c = new C(1, ''); + var r = c.fn(); + var r4 = c.foo; // error + ~~~ +!!! Property 'foo' does not exist on type 'C'. + var r5 = c.bar; // error + ~~~ +!!! Property 'bar' does not exist on type 'C'. + var r6 = c.x; // error + ~ +!!! Property 'x' does not exist on type 'C'. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticPrototypeProperty.errors.txt b/tests/baselines/reference/staticPrototypeProperty.errors.txt new file mode 100644 index 0000000000000..14908f06e1c0b --- /dev/null +++ b/tests/baselines/reference/staticPrototypeProperty.errors.txt @@ -0,0 +1,12 @@ +==== tests/cases/compiler/staticPrototypeProperty.ts (2 errors) ==== + class C { + static prototype() { } + ~~~~~~~~~ +!!! Duplicate identifier 'prototype'. + } + + class C2 { + static prototype; + ~~~~~~~~~ +!!! Duplicate identifier 'prototype'. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticPrototypeProperty.js b/tests/baselines/reference/staticPrototypeProperty.js new file mode 100644 index 0000000000000..cfd81bedeecf4 --- /dev/null +++ b/tests/baselines/reference/staticPrototypeProperty.js @@ -0,0 +1,22 @@ +//// [staticPrototypeProperty.ts] +class C { + static prototype() { } +} + +class C2 { + static prototype; +} + +//// [staticPrototypeProperty.js] +var C = (function () { + function C() { + } + C.prototype = function () { + }; + return C; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); diff --git a/tests/baselines/reference/staticPrototypePropertyOnClass.js b/tests/baselines/reference/staticPrototypePropertyOnClass.js new file mode 100644 index 0000000000000..0782c47ee2880 --- /dev/null +++ b/tests/baselines/reference/staticPrototypePropertyOnClass.js @@ -0,0 +1,45 @@ +//// [staticPrototypePropertyOnClass.ts] +class c1 { +} +class c2 { +} +class c3 { + constructor() { + } +} +class c4 { + constructor(param: string); + constructor(param: number); + constructor(param: any) { + } +} +var a = c1; +var b = c2; +var c = c3; +var d = c4; + +//// [staticPrototypePropertyOnClass.js] +var c1 = (function () { + function c1() { + } + return c1; +})(); +var c2 = (function () { + function c2() { + } + return c2; +})(); +var c3 = (function () { + function c3() { + } + return c3; +})(); +var c4 = (function () { + function c4(param) { + } + return c4; +})(); +var a = c1; +var b = c2; +var c = c3; +var d = c4; diff --git a/tests/baselines/reference/staticVisibility.errors.txt b/tests/baselines/reference/staticVisibility.errors.txt new file mode 100644 index 0000000000000..50d741267e218 --- /dev/null +++ b/tests/baselines/reference/staticVisibility.errors.txt @@ -0,0 +1,52 @@ +==== tests/cases/compiler/staticVisibility.ts (7 errors) ==== + + class C1 { + + p: any; + static s: any; + + constructor() { + var v = 0; + + s = 1; // should be error + ~ +!!! Cannot find name 's'. + C1.s = 1; // should be ok + + b(); // should be error + ~ +!!! Cannot find name 'b'. + C1.b(); // should be ok + } + + static b() { + v = 1; // should be error + ~ +!!! Cannot find name 'v'. + this.p = 0; // should be error + ~ +!!! Property 'p' does not exist on type 'typeof C1'. + C1.s = 1; // should be ok + } + } + + class C2 { + + barback:string = ""; + + + + + static get Bar() {return "bar";} // ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + static set Bar(bar:string) {barback = bar;} // not ok + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~ +!!! Cannot find name 'barback'. + + } + + \ No newline at end of file diff --git a/tests/baselines/reference/statics.errors.txt b/tests/baselines/reference/statics.errors.txt new file mode 100644 index 0000000000000..dc9db000e5a27 --- /dev/null +++ b/tests/baselines/reference/statics.errors.txt @@ -0,0 +1,36 @@ +==== tests/cases/compiler/statics.ts (2 errors) ==== + module M { + export class C { + x: number; + constructor(public c1: number, public c2: number, c3: number) { + this.x = C.y+this.c1+this.c2+c3; + this.g = (v:number) => C.f(this.x+C.y+v+this.c1+this.c2+C.pub); + ~ +!!! Property 'g' does not exist on type 'C'. + } + + static priv=2; + static pub=3; + static y=C.priv; + static f(n:number) { + return "wow: "+(n+C.y+C.pub+C.priv); + + } + } + var c=C.y; + export function f() { + var result=""; + result+=(c); + result+=(new C(0,1,2).x); + result+=(C.f(10)); + result+=(new C(5,10,20).g(C.y)); + ~ +!!! Property 'g' does not exist on type 'C'. + return result; + } + } + + M.f(); + + + \ No newline at end of file diff --git a/tests/baselines/reference/statics.js b/tests/baselines/reference/statics.js new file mode 100644 index 0000000000000..4266725bec6d7 --- /dev/null +++ b/tests/baselines/reference/statics.js @@ -0,0 +1,65 @@ +//// [statics.ts] +module M { + export class C { + x: number; + constructor(public c1: number, public c2: number, c3: number) { + this.x = C.y+this.c1+this.c2+c3; + this.g = (v:number) => C.f(this.x+C.y+v+this.c1+this.c2+C.pub); + } + + static priv=2; + static pub=3; + static y=C.priv; + static f(n:number) { + return "wow: "+(n+C.y+C.pub+C.priv); + + } + } + var c=C.y; + export function f() { + var result=""; + result+=(c); + result+=(new C(0,1,2).x); + result+=(C.f(10)); + result+=(new C(5,10,20).g(C.y)); + return result; + } +} + +M.f(); + + + + +//// [statics.js] +var M; +(function (M) { + var C = (function () { + function C(c1, c2, c3) { + this.c1 = c1; + this.c2 = c2; + var _this = this; + this.x = C.y + this.c1 + this.c2 + c3; + this.g = function (v) { return C.f(_this.x + C.y + v + _this.c1 + _this.c2 + C.pub); }; + } + C.f = function (n) { + return "wow: " + (n + C.y + C.pub + C.priv); + }; + C.priv = 2; + C.pub = 3; + C.y = C.priv; + return C; + })(); + M.C = C; + var c = C.y; + function f() { + var result = ""; + result += (c); + result += (new C(0, 1, 2).x); + result += (C.f(10)); + result += (new C(5, 10, 20).g(C.y)); + return result; + } + M.f = f; +})(M || (M = {})); +M.f(); diff --git a/tests/baselines/reference/staticsInAFunction.errors.txt b/tests/baselines/reference/staticsInAFunction.errors.txt new file mode 100644 index 0000000000000..774f78c370093 --- /dev/null +++ b/tests/baselines/reference/staticsInAFunction.errors.txt @@ -0,0 +1,35 @@ +==== tests/cases/compiler/staticsInAFunction.ts (14 errors) ==== + function boo{ + ~ +!!! '(' expected. + static test() + ~~~~~~ +!!! Statement expected. + ~~~~ +!!! Cannot find name 'test'. + static test(name:string) + ~~~~~~ +!!! Statement expected. + ~ +!!! ',' expected. + ~~~~ +!!! Cannot find name 'test'. + ~~~~ +!!! Cannot find name 'name'. + ~~~~~~ +!!! Cannot find name 'string'. + static test(name?:any){} + ~~~~~~ +!!! Statement expected. + ~ +!!! Expression expected. + ~ +!!! ';' expected. + ~~~~ +!!! Cannot find name 'test'. + ~~~~ +!!! Cannot find name 'name'. + ~~~ +!!! Cannot find name 'any'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/staticsInConstructorBodies.errors.txt b/tests/baselines/reference/staticsInConstructorBodies.errors.txt new file mode 100644 index 0000000000000..ea120e050fee3 --- /dev/null +++ b/tests/baselines/reference/staticsInConstructorBodies.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/staticsInConstructorBodies.ts (2 errors) ==== + class C { + constructor() { + static p1 = 0; // ERROR + ~~~~~~ +!!! Statement expected. + static m1() {} // ERROR + } + } + ~ +!!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt b/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt new file mode 100644 index 0000000000000..14c4e90716202 --- /dev/null +++ b/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/staticsNotInScopeInClodule.ts (1 errors) ==== + class Clod { + static x = 10; + } + + module Clod { + var p = x; // x isn't in scope here + ~ +!!! Cannot find name 'x'. + } \ No newline at end of file diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.js b/tests/baselines/reference/staticsNotInScopeInClodule.js new file mode 100644 index 0000000000000..63c8ee16f6686 --- /dev/null +++ b/tests/baselines/reference/staticsNotInScopeInClodule.js @@ -0,0 +1,20 @@ +//// [staticsNotInScopeInClodule.ts] +class Clod { + static x = 10; +} + +module Clod { + var p = x; // x isn't in scope here +} + +//// [staticsNotInScopeInClodule.js] +var Clod = (function () { + function Clod() { + } + Clod.x = 10; + return Clod; +})(); +var Clod; +(function (Clod) { + var p = x; +})(Clod || (Clod = {})); diff --git a/tests/baselines/reference/stradac.js b/tests/baselines/reference/stradac.js new file mode 100644 index 0000000000000..a00b4a4fcb987 --- /dev/null +++ b/tests/baselines/reference/stradac.js @@ -0,0 +1,19 @@ +//// [stradac.ts] +var x = 10; + +// C++-style comment + +/* + C-Style comment + */ + + +function foo() { + x++; +} + +//// [stradac.js] +var x = 10; +function foo() { + x++; +} diff --git a/tests/baselines/reference/strictMode1.js b/tests/baselines/reference/strictMode1.js new file mode 100644 index 0000000000000..14bba3aa4a31c --- /dev/null +++ b/tests/baselines/reference/strictMode1.js @@ -0,0 +1,25 @@ +//// [strictMode1.ts] +"use strict"; +class A {} +class B extends A {} + +//// [strictMode1.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +"use strict"; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); diff --git a/tests/baselines/reference/strictMode2.js b/tests/baselines/reference/strictMode2.js new file mode 100644 index 0000000000000..4331b1ef52c73 --- /dev/null +++ b/tests/baselines/reference/strictMode2.js @@ -0,0 +1,13 @@ +//// [strictMode2.ts] +"use strict"; + +function foo() { + + return 30; +} + +//// [strictMode2.js] +"use strict"; +function foo() { + return 30; +} diff --git a/tests/baselines/reference/strictMode3.js b/tests/baselines/reference/strictMode3.js new file mode 100644 index 0000000000000..39d55dffd141e --- /dev/null +++ b/tests/baselines/reference/strictMode3.js @@ -0,0 +1,36 @@ +//// [strictMode3.ts] +"use strict"; + +class A { +} + +class B extends A { +} + +function foo() { + return this.window; +} + +//// [strictMode3.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +"use strict"; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +})(A); +function foo() { + return this.window; +} diff --git a/tests/baselines/reference/strictMode4.js b/tests/baselines/reference/strictMode4.js new file mode 100644 index 0000000000000..b7bf798b34fc1 --- /dev/null +++ b/tests/baselines/reference/strictMode4.js @@ -0,0 +1,14 @@ +//// [strictMode4.ts] +"use strict"; + +class A { +} + + +//// [strictMode4.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +})(); diff --git a/tests/baselines/reference/strictModeInConstructor.errors.txt b/tests/baselines/reference/strictModeInConstructor.errors.txt new file mode 100644 index 0000000000000..5f1a408543768 --- /dev/null +++ b/tests/baselines/reference/strictModeInConstructor.errors.txt @@ -0,0 +1,72 @@ +==== tests/cases/compiler/strictModeInConstructor.ts (2 errors) ==== + class A { + } + + + + class B extends A { + public s: number = 9; + + constructor () { + ~~~~~~~~~~~~~~~~ + "use strict"; // No error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + super(); + ~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class C extends A { + public s: number = 9; + + constructor () { + super(); // No error + "use strict"; + } + } + + class D extends A { + public s: number = 9; + + constructor () { + ~~~~~~~~~~~~~~~~ + var x = 1; // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + super(); + ~~~~~~~~~~~~~~~~ + "use strict"; + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. + } + + class Bs extends A { + public static s: number = 9; + + constructor () { + "use strict"; // No error + super(); + } + } + + class Cs extends A { + public static s: number = 9; + + constructor () { + super(); // No error + "use strict"; + } + } + + class Ds extends A { + public static s: number = 9; + + constructor () { + var x = 1; // no Error + super(); + "use strict"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js new file mode 100644 index 0000000000000..2128cbfc17357 --- /dev/null +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -0,0 +1,130 @@ +//// [strictModeInConstructor.ts] +class A { +} + + + +class B extends A { + public s: number = 9; + + constructor () { + "use strict"; // No error + super(); + } +} + +class C extends A { + public s: number = 9; + + constructor () { + super(); // No error + "use strict"; + } +} + +class D extends A { + public s: number = 9; + + constructor () { + var x = 1; // Error + super(); + "use strict"; + } +} + +class Bs extends A { + public static s: number = 9; + + constructor () { + "use strict"; // No error + super(); + } +} + +class Cs extends A { + public static s: number = 9; + + constructor () { + super(); // No error + "use strict"; + } +} + +class Ds extends A { + public static s: number = 9; + + constructor () { + var x = 1; // no Error + super(); + "use strict"; + } +} + +//// [strictModeInConstructor.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + this.s = 9; + "use strict"; + _super.call(this); + } + return B; +})(A); +var C = (function (_super) { + __extends(C, _super); + function C() { + _super.call(this); + this.s = 9; + "use strict"; + } + return C; +})(A); +var D = (function (_super) { + __extends(D, _super); + function D() { + this.s = 9; + var x = 1; + _super.call(this); + "use strict"; + } + return D; +})(A); +var Bs = (function (_super) { + __extends(Bs, _super); + function Bs() { + "use strict"; + _super.call(this); + } + Bs.s = 9; + return Bs; +})(A); +var Cs = (function (_super) { + __extends(Cs, _super); + function Cs() { + _super.call(this); + "use strict"; + } + Cs.s = 9; + return Cs; +})(A); +var Ds = (function (_super) { + __extends(Ds, _super); + function Ds() { + var x = 1; + _super.call(this); + "use strict"; + } + Ds.s = 9; + return Ds; +})(A); diff --git a/tests/baselines/reference/stringHasStringValuedNumericIndexer.js b/tests/baselines/reference/stringHasStringValuedNumericIndexer.js new file mode 100644 index 0000000000000..0ebc77a87419b --- /dev/null +++ b/tests/baselines/reference/stringHasStringValuedNumericIndexer.js @@ -0,0 +1,5 @@ +//// [stringHasStringValuedNumericIndexer.ts] +var str: string = ""[0]; + +//// [stringHasStringValuedNumericIndexer.js] +var str = ""[0]; diff --git a/tests/baselines/reference/stringIndexerAndConstructor.errors.txt b/tests/baselines/reference/stringIndexerAndConstructor.errors.txt new file mode 100644 index 0000000000000..dc782e166d5c7 --- /dev/null +++ b/tests/baselines/reference/stringIndexerAndConstructor.errors.txt @@ -0,0 +1,18 @@ +==== tests/cases/compiler/stringIndexerAndConstructor.ts (2 errors) ==== + class C { + [s: string]: number; + constructor() { } + static v() { } + } + + interface I { + [s: string]: number; + (): boolean; + new (): boolean; + "": string; + ~~~~~~~~~~~ +!!! Property '""' of type 'string' is not assignable to string index type 'number'. + d: string; + ~~~~~~~~~~ +!!! Property 'd' of type 'string' is not assignable to string index type 'number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAndConstructor.js b/tests/baselines/reference/stringIndexerAndConstructor.js new file mode 100644 index 0000000000000..6d4cc3747c03b --- /dev/null +++ b/tests/baselines/reference/stringIndexerAndConstructor.js @@ -0,0 +1,23 @@ +//// [stringIndexerAndConstructor.ts] +class C { + [s: string]: number; + constructor() { } + static v() { } +} + +interface I { + [s: string]: number; + (): boolean; + new (): boolean; + "": string; + d: string; +} + +//// [stringIndexerAndConstructor.js] +var C = (function () { + function C() { + } + C.v = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/stringIndexerAndConstructor1.errors.txt b/tests/baselines/reference/stringIndexerAndConstructor1.errors.txt new file mode 100644 index 0000000000000..11295a9b66aa9 --- /dev/null +++ b/tests/baselines/reference/stringIndexerAndConstructor1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/stringIndexerAndConstructor1.ts (1 errors) ==== + interface I { + [s: string]: number; + "": string; + ~~~~~~~~~~~ +!!! Property '""' of type 'string' is not assignable to string index type 'number'. + } \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAndConstructor1.js b/tests/baselines/reference/stringIndexerAndConstructor1.js new file mode 100644 index 0000000000000..4242219f4d94f --- /dev/null +++ b/tests/baselines/reference/stringIndexerAndConstructor1.js @@ -0,0 +1,7 @@ +//// [stringIndexerAndConstructor1.ts] +interface I { + [s: string]: number; + "": string; +} + +//// [stringIndexerAndConstructor1.js] diff --git a/tests/baselines/reference/stringIndexerAssignments1.errors.txt b/tests/baselines/reference/stringIndexerAssignments1.errors.txt new file mode 100644 index 0000000000000..b91a452e65453 --- /dev/null +++ b/tests/baselines/reference/stringIndexerAssignments1.errors.txt @@ -0,0 +1,14 @@ +==== tests/cases/compiler/stringIndexerAssignments1.ts (2 errors) ==== + var x: { [index: string]: string; one: string; }; + var a: { one: string; }; + var b: { one: number; two: string; }; + x = a; + ~ +!!! Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }': +!!! Index signature is missing in type '{ one: string; }'. + x = b; // error + ~ +!!! Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments1.js b/tests/baselines/reference/stringIndexerAssignments1.js new file mode 100644 index 0000000000000..20b76a0ede328 --- /dev/null +++ b/tests/baselines/reference/stringIndexerAssignments1.js @@ -0,0 +1,14 @@ +//// [stringIndexerAssignments1.ts] +var x: { [index: string]: string; one: string; }; +var a: { one: string; }; +var b: { one: number; two: string; }; +x = a; +x = b; // error + + +//// [stringIndexerAssignments1.js] +var x; +var a; +var b; +x = a; +x = b; diff --git a/tests/baselines/reference/stringIndexerAssignments2.errors.txt b/tests/baselines/reference/stringIndexerAssignments2.errors.txt new file mode 100644 index 0000000000000..0c56076b8774f --- /dev/null +++ b/tests/baselines/reference/stringIndexerAssignments2.errors.txt @@ -0,0 +1,28 @@ +==== tests/cases/compiler/stringIndexerAssignments2.ts (2 errors) ==== + class C1 { + [index: string]: string + one: string; + } + + class C2 { + one: string; + } + + class C3 { + one: number; + two: string; + } + + var x: C1; + var a: C2; + var b: C3; + + x = a; + ~ +!!! Type 'C2' is not assignable to type 'C1': +!!! Index signature is missing in type 'C2'. + x = b; + ~ +!!! Type 'C3' is not assignable to type 'C1': +!!! Types of property 'one' are incompatible: +!!! Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments2.js b/tests/baselines/reference/stringIndexerAssignments2.js new file mode 100644 index 0000000000000..8f909cc720624 --- /dev/null +++ b/tests/baselines/reference/stringIndexerAssignments2.js @@ -0,0 +1,43 @@ +//// [stringIndexerAssignments2.ts] +class C1 { + [index: string]: string + one: string; +} + +class C2 { + one: string; +} + +class C3 { + one: number; + two: string; +} + +var x: C1; +var a: C2; +var b: C3; + +x = a; +x = b; + +//// [stringIndexerAssignments2.js] +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var C3 = (function () { + function C3() { + } + return C3; +})(); +var x; +var a; +var b; +x = a; +x = b; diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt new file mode 100644 index 0000000000000..d2f2b73772dd6 --- /dev/null +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -0,0 +1,175 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts (27 errors) ==== + // String indexer types constrain the types of named properties in their containing type + + interface MyString extends String { + foo: number; + } + + class C { + [x: string]: string; + + constructor() { } // ok + + a: string; // ok + b: number; // error + ~~~~~~~~~~ +!!! Property 'b' of type 'number' is not assignable to string index type 'string'. + c: () => {} // error + ~~~~~~~~~~~ +!!! Property 'c' of type '() => {}' is not assignable to string index type 'string'. + "d": string; // ok + "e": number; // error + ~~~~~~~~~~~~ +!!! Property '"e"' of type 'number' is not assignable to string index type 'string'. + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to string index type 'string'. + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to string index type 'string'. + f: MyString; // error + ~~~~~~~~~~~~ +!!! Property 'f' of type 'MyString' is not assignable to string index type 'string'. + + get X() { // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return ''; + } + set X(v) { } // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + + foo() { // error + ~~~~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ +!!! Property 'foo' of type '() => string' is not assignable to string index type 'string'. + + static sa: number; // ok + static sb: string; // ok + + static foo() { } // ok + static get X() { // ok + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return 1; + } + } + + interface I { + [x: string]: string; + + a: string; // ok + b: number; // error + ~~~~~~~~~~ +!!! Property 'b' of type 'number' is not assignable to string index type 'string'. + c: () => {} // error + ~~~~~~~~~~~ +!!! Property 'c' of type '() => {}' is not assignable to string index type 'string'. + "d": string; // ok + "e": number; // error + ~~~~~~~~~~~~ +!!! Property '"e"' of type 'number' is not assignable to string index type 'string'. + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to string index type 'string'. + (): string; // ok + (x): number // ok + foo(): string; // error + ~~~~~~~~~~~~~~ +!!! Property 'foo' of type '() => string' is not assignable to string index type 'string'. + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to string index type 'string'. + f: MyString; // error + ~~~~~~~~~~~~ +!!! Property 'f' of type 'MyString' is not assignable to string index type 'string'. + } + + var a: { + [x: string]: string; + + a: string; // ok + b: number; // error + ~~~~~~~~~~ +!!! Property 'b' of type 'number' is not assignable to string index type 'string'. + c: () => {} // error + ~~~~~~~~~~~ +!!! Property 'c' of type '() => {}' is not assignable to string index type 'string'. + "d": string; // ok + "e": number; // error + ~~~~~~~~~~~~ +!!! Property '"e"' of type 'number' is not assignable to string index type 'string'. + 1.0: string; // ok + 2.0: number; // error + ~~~~~~~~~~~~ +!!! Property '2.0' of type 'number' is not assignable to string index type 'string'. + (): string; // ok + (x): number // ok + foo(): string; // error + ~~~~~~~~~~~~~~ +!!! Property 'foo' of type '() => string' is not assignable to string index type 'string'. + "3.0": string; // ok + "4.0": number; // error + ~~~~~~~~~~~~~~ +!!! Property '"4.0"' of type 'number' is not assignable to string index type 'string'. + f: MyString; // error + ~~~~~~~~~~~~ +!!! Property 'f' of type 'MyString' is not assignable to string index type 'string'. + } + + // error + var b: { [x: string]: string; } = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + a: '', + ~~~~~~~~~~ + b: 1, + ~~~~~~~~~~ + c: () => { }, + ~~~~~~~~~~~~~~~~~~ + "d": '', + ~~~~~~~~~~~~~ + "e": 1, + ~~~~~~~~~~~~ + 1.0: '', + ~~~~~~~~~~~~ + 2.0: 1, + ~~~~~~~~~~~~ + "3.0": '', + ~~~~~~~~~~~~~~~ + "4.0": 1, + ~~~~~~~~~~~~~~ + f: null, + ~~~~~~~~~~~~~~~~~~~~~~~ + + + get X() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + set X(v) { }, + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~~~~~~~~ + foo() { + ~~~~~~~~~~~~ + return ''; + ~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + } + ~ +!!! Type '{ [x: string]: {}; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }': +!!! Index signatures are incompatible: +!!! Type '{}' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt new file mode 100644 index 0000000000000..2b58ffe875652 --- /dev/null +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt @@ -0,0 +1,60 @@ +==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts (7 errors) ==== + // String indexer providing a constraint of a user defined type + + class A { + foo(): string { return ''; } + } + + class B extends A { + bar(): string { return ''; } + } + + class Foo { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + ~~~~~~~~~~ +!!! Property 'c' of type 'number' is not assignable to string index type 'A'. + d: string; // error + ~~~~~~~~~~ +!!! Property 'd' of type 'string' is not assignable to string index type 'A'. + } + + interface Foo2 { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + ~~~~~~~~~~ +!!! Property 'c' of type 'number' is not assignable to string index type 'A'. + d: string; // error + ~~~~~~~~~~ +!!! Property 'd' of type 'string' is not assignable to string index type 'A'. + } + + var a: { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + ~~~~~~~~~~ +!!! Property 'c' of type 'number' is not assignable to string index type 'A'. + d: string; // error + ~~~~~~~~~~ +!!! Property 'd' of type 'string' is not assignable to string index type 'A'. + }; + + // error + var b: { [x: string]: A } = { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + a: A, + ~~~~~~~~~ + b: B + ~~~~~~~~ + } + ~ +!!! Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }': +!!! Index signatures are incompatible: +!!! Type 'typeof A' is not assignable to type 'A': +!!! Property 'foo' is missing in type 'typeof A'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js new file mode 100644 index 0000000000000..d49fd7c1fe4f0 --- /dev/null +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -0,0 +1,76 @@ +//// [stringIndexerConstrainsPropertyDeclarations2.ts] +// String indexer providing a constraint of a user defined type + +class A { + foo(): string { return ''; } +} + +class B extends A { + bar(): string { return ''; } +} + +class Foo { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + d: string; // error +} + +interface Foo2 { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + d: string; // error +} + +var a: { + [x: string]: A; + a: A; // ok + b: B; // ok + c: number; // error + d: string; // error +}; + +// error +var b: { [x: string]: A } = { + a: A, + b: B +} + +//// [stringIndexerConstrainsPropertyDeclarations2.js] +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var A = (function () { + function A() { + } + A.prototype.foo = function () { + return ''; + }; + return A; +})(); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + B.prototype.bar = function () { + return ''; + }; + return B; +})(A); +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +var a; +var b = { + a: A, + b: B +}; diff --git a/tests/baselines/reference/stringIndexingResults.js b/tests/baselines/reference/stringIndexingResults.js new file mode 100644 index 0000000000000..a6e00d92ec2aa --- /dev/null +++ b/tests/baselines/reference/stringIndexingResults.js @@ -0,0 +1,60 @@ +//// [stringIndexingResults.ts] +class C { + [x: string]: string; + y = ''; +} + +var c: C; +var r1 = c['y']; +var r2 = c['a']; +var r3 = c[1]; + +interface I { + [x: string]: string; + y: string; +} + +var i: I +var r4 = i['y']; +var r5 = i['a']; +var r6 = i[1]; + +var a: { + [x: string]: string; + y: string; +} + +var r7 = a['y']; +var r8 = a['a']; +var r9 = a[1]; + +var b: { [x: string]: string } = { y: '' } + +var r10 = b['y']; +var r11 = b['a']; +var r12 = b[1]; + + +//// [stringIndexingResults.js] +var C = (function () { + function C() { + this.y = ''; + } + return C; +})(); +var c; +var r1 = c['y']; +var r2 = c['a']; +var r3 = c[1]; +var i; +var r4 = i['y']; +var r5 = i['a']; +var r6 = i[1]; +var a; +var r7 = a['y']; +var r8 = a['a']; +var r9 = a[1]; +var b = { y: '' }; +var r10 = b['y']; +var r11 = b['a']; +var r12 = b[1]; diff --git a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js new file mode 100644 index 0000000000000..1ae4c9db619ba --- /dev/null +++ b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.js @@ -0,0 +1,14 @@ +//// [stringLiteralObjectLiteralDeclaration1.ts] +module m1 { + export var n = { 'foo bar': 4 }; +} + + +//// [stringLiteralObjectLiteralDeclaration1.js] +var m1; +(function (m1) { + m1.n = { 'foo bar': 4 }; +})(m1 || (m1 = {})); + + +//// [stringLiteralObjectLiteralDeclaration1.d.ts] diff --git a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js new file mode 100644 index 0000000000000..99ed3fb320ad1 --- /dev/null +++ b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.js @@ -0,0 +1,10 @@ +//// [stringLiteralPropertyNameWithLineContinuation1.ts] +var x = {'text\ +':'hello'} +x.text = "bar" + + +//// [stringLiteralPropertyNameWithLineContinuation1.js] +var x = { 'text\ +': 'hello' }; +x.text = "bar"; diff --git a/tests/baselines/reference/stringLiteralType.errors.txt b/tests/baselines/reference/stringLiteralType.errors.txt new file mode 100644 index 0000000000000..206f2d6008461 --- /dev/null +++ b/tests/baselines/reference/stringLiteralType.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/conformance/types/primitives/stringLiteral/stringLiteralType.ts (1 errors) ==== + var x: 'hi'; + ~~~~ +!!! Type expected. + + function f(x: 'hi'); + function f(x: string); + function f(x: any) { + } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt new file mode 100644 index 0000000000000..6ace352d97411 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt @@ -0,0 +1,126 @@ +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts (13 errors) ==== + // string literal types are subtypes of string, any + + // ok + function f1(x: 'a'); + function f1(x: string); + function f1(x: string) { } + + // ok + function f2(x: 'a'); + function f2(x: any); + function f2(x: any) { } + + // errors + function f3(x: 'a'); + function f3(x: Object); + function f3(x: any) { } + + function f4(x: 'a'); + function f4(x: {}); + function f4(x: any) { } + + function f5(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f5(x: number); + function f5(x: any) { } + + function f6(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f6(x: boolean); + function f6(x: any) { } + + function f7(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f7(x: Date); + function f7(x: any) { } + + function f8(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f8(x: RegExp); + function f8(x: any) { } + + function f9(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f9(x: () => {}); + function f9(x: any) { } + + class C implements String { + toString(): string { return null; } + charAt(pos: number): string { return null; } + charCodeAt(index: number): number { return null; } + concat(...strings: string[]): string { return null; } + indexOf(searchString: string, position?: number): number { return null; } + lastIndexOf(searchString: string, position?: number): number { return null; } + localeCompare(that: string): number { return null; } + match(regexp: any): string[] { return null; } + replace(searchValue: any, replaceValue: any): string { return null; } + search(regexp: any): number { return null; } + slice(start?: number, end?: number): string { return null; } + split(separator: any, limit?: number): string[] { return null; } + substring(start: number, end?: number): string { return null; } + toLowerCase(): string { return null; } + toLocaleLowerCase(): string { return null; } + toUpperCase(): string { return null; } + toLocaleUpperCase(): string { return null; } + trim(): string { return null; } + length: number; + substr(from: number, length?: number): string { return null; } + [index: number]: string; + } + + // BUG 831846 + function f10(x: 'a'); + function f10(x: C); + function f10(x: any) { } + + interface I extends String { + foo: string; + } + + // BUG 831846 + function f11(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f11(x: I); + function f11(x: any) { } + + function f12(x: 'a'); + function f12(x: T); + function f12(x: any) { } + + function f13(x: 'a'); + function f13(x: T); + function f13(x: any) { } + + enum E { A } + function f14(x: 'a'); + ~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + function f14(x: E); + function f14(x: any) { } + + function f15(x: 'a'); + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + function f15(x: U); + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + function f15(x: any) { } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + + function f16(x: 'a'); + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + function f16(x: U); + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + function f16(x: any) { } + ~~~~~~~~~~~ +!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js new file mode 100644 index 0000000000000..b1a7717ba61db --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.js @@ -0,0 +1,204 @@ +//// [stringLiteralTypeIsSubtypeOfString.ts] +// string literal types are subtypes of string, any + +// ok +function f1(x: 'a'); +function f1(x: string); +function f1(x: string) { } + +// ok +function f2(x: 'a'); +function f2(x: any); +function f2(x: any) { } + +// errors +function f3(x: 'a'); +function f3(x: Object); +function f3(x: any) { } + +function f4(x: 'a'); +function f4(x: {}); +function f4(x: any) { } + +function f5(x: 'a'); +function f5(x: number); +function f5(x: any) { } + +function f6(x: 'a'); +function f6(x: boolean); +function f6(x: any) { } + +function f7(x: 'a'); +function f7(x: Date); +function f7(x: any) { } + +function f8(x: 'a'); +function f8(x: RegExp); +function f8(x: any) { } + +function f9(x: 'a'); +function f9(x: () => {}); +function f9(x: any) { } + +class C implements String { + toString(): string { return null; } + charAt(pos: number): string { return null; } + charCodeAt(index: number): number { return null; } + concat(...strings: string[]): string { return null; } + indexOf(searchString: string, position?: number): number { return null; } + lastIndexOf(searchString: string, position?: number): number { return null; } + localeCompare(that: string): number { return null; } + match(regexp: any): string[] { return null; } + replace(searchValue: any, replaceValue: any): string { return null; } + search(regexp: any): number { return null; } + slice(start?: number, end?: number): string { return null; } + split(separator: any, limit?: number): string[] { return null; } + substring(start: number, end?: number): string { return null; } + toLowerCase(): string { return null; } + toLocaleLowerCase(): string { return null; } + toUpperCase(): string { return null; } + toLocaleUpperCase(): string { return null; } + trim(): string { return null; } + length: number; + substr(from: number, length?: number): string { return null; } + [index: number]: string; +} + +// BUG 831846 +function f10(x: 'a'); +function f10(x: C); +function f10(x: any) { } + +interface I extends String { + foo: string; +} + +// BUG 831846 +function f11(x: 'a'); +function f11(x: I); +function f11(x: any) { } + +function f12(x: 'a'); +function f12(x: T); +function f12(x: any) { } + +function f13(x: 'a'); +function f13(x: T); +function f13(x: any) { } + +enum E { A } +function f14(x: 'a'); +function f14(x: E); +function f14(x: any) { } + +function f15(x: 'a'); +function f15(x: U); +function f15(x: any) { } + +function f16(x: 'a'); +function f16(x: U); +function f16(x: any) { } + +//// [stringLiteralTypeIsSubtypeOfString.js] +function f1(x) { +} +function f2(x) { +} +function f3(x) { +} +function f4(x) { +} +function f5(x) { +} +function f6(x) { +} +function f7(x) { +} +function f8(x) { +} +function f9(x) { +} +var C = (function () { + function C() { + } + C.prototype.toString = function () { + return null; + }; + C.prototype.charAt = function (pos) { + return null; + }; + C.prototype.charCodeAt = function (index) { + return null; + }; + C.prototype.concat = function () { + var strings = []; + for (var _i = 0; _i < arguments.length; _i++) { + strings[_i - 0] = arguments[_i]; + } + return null; + }; + C.prototype.indexOf = function (searchString, position) { + return null; + }; + C.prototype.lastIndexOf = function (searchString, position) { + return null; + }; + C.prototype.localeCompare = function (that) { + return null; + }; + C.prototype.match = function (regexp) { + return null; + }; + C.prototype.replace = function (searchValue, replaceValue) { + return null; + }; + C.prototype.search = function (regexp) { + return null; + }; + C.prototype.slice = function (start, end) { + return null; + }; + C.prototype.split = function (separator, limit) { + return null; + }; + C.prototype.substring = function (start, end) { + return null; + }; + C.prototype.toLowerCase = function () { + return null; + }; + C.prototype.toLocaleLowerCase = function () { + return null; + }; + C.prototype.toUpperCase = function () { + return null; + }; + C.prototype.toLocaleUpperCase = function () { + return null; + }; + C.prototype.trim = function () { + return null; + }; + C.prototype.substr = function (from, length) { + return null; + }; + return C; +})(); +function f10(x) { +} +function f11(x) { +} +function f12(x) { +} +function f13(x) { +} +var E; +(function (E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +function f14(x) { +} +function f15(x) { +} +function f16(x) { +} diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.errors.txt b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.errors.txt new file mode 100644 index 0000000000000..9fd37a2e2d0d5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.errors.txt @@ -0,0 +1,49 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.ts (11 errors) ==== + // String literal types are only valid in overload signatures + + function foo(x: 'hi') { } + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + var f = function foo(x: 'hi') { } + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + var f2 = (x: 'hi', y: 'hi') => { } + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + + class C { + foo(x: 'hi') { } + ~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + } + + interface I { + (x: 'hi'); + ~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'hi', y: 'hi'); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + var a: { + (x: 'hi'); + ~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'hi'); + ~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + var b = { + foo(x: 'hi') { }, + ~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + a: function foo(x: 'hi', y: 'hi') { }, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + b: (x: 'hi') => { } + ~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + } + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js new file mode 100644 index 0000000000000..ec546b4aa6adc --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures.js @@ -0,0 +1,51 @@ +//// [stringLiteralTypesInImplementationSignatures.ts] +// String literal types are only valid in overload signatures + +function foo(x: 'hi') { } +var f = function foo(x: 'hi') { } +var f2 = (x: 'hi', y: 'hi') => { } + +class C { + foo(x: 'hi') { } +} + +interface I { + (x: 'hi'); + foo(x: 'hi', y: 'hi'); +} + +var a: { + (x: 'hi'); + foo(x: 'hi'); +} + +var b = { + foo(x: 'hi') { }, + a: function foo(x: 'hi', y: 'hi') { }, + b: (x: 'hi') => { } +} + + +//// [stringLiteralTypesInImplementationSignatures.js] +function foo(x) { +} +var f = function foo(x) { +}; +var f2 = function (x, y) { +}; +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var a; +var b = { + foo: function foo(x) { + }, + a: function foo(x, y) { + }, + b: function (x) { + } +}; diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.errors.txt b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.errors.txt new file mode 100644 index 0000000000000..983357f6fe876 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.errors.txt @@ -0,0 +1,54 @@ +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures2.ts (12 errors) ==== + // String literal types are only valid in overload signatures + + function foo(x: any); + function foo(x: 'hi') { } + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + + class C { + foo(x: string); + foo(x: 'hi') { } + ~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + } + + interface I { + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: 'hi'); + ~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'a', y: 'a'); + ~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'hi', y: 'hi'); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + var a: { + (x: 'hi'); + ~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + (x: 'a'); + ~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'hi'); + ~~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + foo(x: 'a'); + ~~~~~~~~~~~~ +!!! Specialized overload signature is not assignable to any non-specialized signature. + } + + var b = { + foo(x: 'hi') { }, + ~~~~~~~~~~~~~~~~ +!!! A signature with an implementation cannot use a string literal type. + foo(x: 'a') { }, + ~~~ +!!! Duplicate identifier 'foo'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js new file mode 100644 index 0000000000000..b178a8ac4db36 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInImplementationSignatures2.js @@ -0,0 +1,48 @@ +//// [stringLiteralTypesInImplementationSignatures2.ts] +// String literal types are only valid in overload signatures + +function foo(x: any); +function foo(x: 'hi') { } + +class C { + foo(x: string); + foo(x: 'hi') { } +} + +interface I { + (x: 'a'); + (x: 'hi'); + foo(x: 'a', y: 'a'); + foo(x: 'hi', y: 'hi'); +} + +var a: { + (x: 'hi'); + (x: 'a'); + foo(x: 'hi'); + foo(x: 'a'); +} + +var b = { + foo(x: 'hi') { }, + foo(x: 'a') { }, +} + + +//// [stringLiteralTypesInImplementationSignatures2.js] +function foo(x) { +} +var C = (function () { + function C() { + } + C.prototype.foo = function (x) { + }; + return C; +})(); +var a; +var b = { + foo: function foo(x) { + }, + foo: function foo(x) { + } +}; diff --git a/tests/baselines/reference/stringLiteralsErrors.errors.txt b/tests/baselines/reference/stringLiteralsErrors.errors.txt new file mode 100644 index 0000000000000..168a2564ab024 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsErrors.errors.txt @@ -0,0 +1,63 @@ +==== tests/cases/compiler/stringLiteralsErrors.ts (17 errors) ==== + // Srtings missing line terminator + var es1 = "line 1 + +!!! Unterminated string constant. + "; + +!!! Unterminated string constant. + var es2 = 'line 1 + +!!! Unterminated string constant. + '; + +!!! Unterminated string constant. + + // Space after backslash + var es3 = 'line 1\ + +!!! Unterminated string constant. + '; + +!!! Unterminated string constant. + var es4 = 'line 1\ + +!!! Unterminated string constant. + '; + +!!! Unterminated string constant. + + // Unterminated strings + var es5 = "unterminated + +!!! Unterminated string constant. + var es6 = 'unterminated + +!!! Unterminated string constant. + + // wrong terminator + var es7 = "unterminated ' + +!!! Unterminated string constant. + var es8 = 'unterminated " + +!!! Unterminated string constant. + + // wrong unicode sequences + var es9 = "\u00"; + +!!! Hexadecimal digit expected. + var es10 = "\u00GG"; + +!!! Hexadecimal digit expected. + var es11 = "\x0"; + +!!! Hexadecimal digit expected. + var es12 = "\xmm"; + +!!! Hexadecimal digit expected. + + // End of file + var es13 = " + +!!! Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/stringNamedPropertyAccess.js b/tests/baselines/reference/stringNamedPropertyAccess.js new file mode 100644 index 0000000000000..cdc8603a0e704 --- /dev/null +++ b/tests/baselines/reference/stringNamedPropertyAccess.js @@ -0,0 +1,42 @@ +//// [stringNamedPropertyAccess.ts] +class C { + "a b": number; + static "c d": number; +} +var c: C; +var r1 = c["a b"]; +var r1b = C['c d']; + +interface I { + "a b": number; +} +var i: I; +var r2 = i["a b"]; + +var a: { + "a b": number; +} +var r3 = a["a b"]; + +var b = { + "a b": 1 +} +var r4 = b["a b"]; + +//// [stringNamedPropertyAccess.js] +var C = (function () { + function C() { + } + return C; +})(); +var c; +var r1 = c["a b"]; +var r1b = C['c d']; +var i; +var r2 = i["a b"]; +var a; +var r3 = a["a b"]; +var b = { + "a b": 1 +}; +var r4 = b["a b"]; diff --git a/tests/baselines/reference/stringNamedPropertyDuplicates.errors.txt b/tests/baselines/reference/stringNamedPropertyDuplicates.errors.txt new file mode 100644 index 0000000000000..fe10ee31cd894 --- /dev/null +++ b/tests/baselines/reference/stringNamedPropertyDuplicates.errors.txt @@ -0,0 +1,34 @@ +==== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/stringNamedPropertyDuplicates.ts (6 errors) ==== + class C { + "a b": number; + "a b": number; + ~~~~~ +!!! Duplicate identifier '"a b"'. + static "c d": number; + static "c d": number; + ~~~~~ +!!! Duplicate identifier '"c d"'. + } + + interface I { + "a b": number; + "a b": number; + ~~~~~ +!!! Duplicate identifier '"a b"'. + } + + var a: { + "a b": number; + "a b": number; + ~~~~~ +!!! Duplicate identifier '"a b"'. + } + + var b = { + "a b": 1 + "a b": 1 + ~~~~~ +!!! ',' expected. + ~~~~~ +!!! Duplicate identifier '"a b"'. + } \ No newline at end of file diff --git a/tests/baselines/reference/stringPropCodeGen.js b/tests/baselines/reference/stringPropCodeGen.js new file mode 100644 index 0000000000000..46e1a6eb9203c --- /dev/null +++ b/tests/baselines/reference/stringPropCodeGen.js @@ -0,0 +1,23 @@ +//// [stringPropCodeGen.ts] +var a = { + + "foo" : function() { }, + "bar" : 5 + +}; + + + +a.foo(); + +a.bar.toString(); + + +//// [stringPropCodeGen.js] +var a = { + "foo": function () { + }, + "bar": 5 +}; +a.foo(); +a.bar.toString(); diff --git a/tests/baselines/reference/stringPropertyAccess.js b/tests/baselines/reference/stringPropertyAccess.js new file mode 100644 index 0000000000000..0030a488a846e --- /dev/null +++ b/tests/baselines/reference/stringPropertyAccess.js @@ -0,0 +1,14 @@ +//// [stringPropertyAccess.ts] +var x = ''; +var a = x.charAt(0); +var b = x.hasOwnProperty('charAt'); + +var c = x['charAt'](0); +var e = x['hasOwnProperty']('toFixed'); + +//// [stringPropertyAccess.js] +var x = ''; +var a = x.charAt(0); +var b = x.hasOwnProperty('charAt'); +var c = x['charAt'](0); +var e = x['hasOwnProperty']('toFixed'); diff --git a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt new file mode 100644 index 0000000000000..084f797274e6c --- /dev/null +++ b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts (1 errors) ==== + var x = ''; + var d = x['charAt']('invalid'); // error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/stringPropertyAccessWithError.js b/tests/baselines/reference/stringPropertyAccessWithError.js new file mode 100644 index 0000000000000..3b507ceb7f9e0 --- /dev/null +++ b/tests/baselines/reference/stringPropertyAccessWithError.js @@ -0,0 +1,7 @@ +//// [stringPropertyAccessWithError.ts] +var x = ''; +var d = x['charAt']('invalid'); // error + +//// [stringPropertyAccessWithError.js] +var x = ''; +var d = x['charAt']('invalid'); diff --git a/tests/baselines/reference/structural1.js b/tests/baselines/reference/structural1.js new file mode 100644 index 0000000000000..73b033a525c24 --- /dev/null +++ b/tests/baselines/reference/structural1.js @@ -0,0 +1,22 @@ +//// [structural1.ts] +module M { + export interface I { + salt:number; + pepper:number; + } + + export function f(i:I) { + } + + f({salt:2,pepper:0}); +} + + +//// [structural1.js] +var M; +(function (M) { + function f(i) { + } + M.f = f; + f({ salt: 2, pepper: 0 }); +})(M || (M = {})); diff --git a/tests/baselines/reference/structuralTypeInDeclareFileForModule.js b/tests/baselines/reference/structuralTypeInDeclareFileForModule.js new file mode 100644 index 0000000000000..334f32477f16a --- /dev/null +++ b/tests/baselines/reference/structuralTypeInDeclareFileForModule.js @@ -0,0 +1,14 @@ +//// [structuralTypeInDeclareFileForModule.ts] + +module M { export var x; } +var m = M; + +//// [structuralTypeInDeclareFileForModule.js] +var M; +(function (M) { + M.x; +})(M || (M = {})); +var m = M; + + +//// [structuralTypeInDeclareFileForModule.d.ts] diff --git a/tests/baselines/reference/styleOptions.js b/tests/baselines/reference/styleOptions.js new file mode 100644 index 0000000000000..f17ce9a71ebd9 --- /dev/null +++ b/tests/baselines/reference/styleOptions.js @@ -0,0 +1,13 @@ +//// [styleOptions.ts] +///"); + + export interface BaselineOptions { + LineEndingSensitive?: boolean; + } + + function localPath(filename: string) { + if (global.runners[0].testType === 'prototyping') { + return Harness.userSpecifiedroot + 'tests/baselines/prototyping/local/' + filename; + } + else { + return Harness.userSpecifiedroot + 'tests/baselines/local/' + filename; + } + } + + function referencePath(filename: string) { + if (global.runners[0].testType === 'prototyping') { + return Harness.userSpecifiedroot + 'tests/baselines/prototyping/reference/' + filename; + } + else { + return Harness.userSpecifiedroot + 'tests/baselines/reference/' + filename; + } + } + + export function reset() { + if (IO.fileExists(reportFilename)) { + IO.deleteFile(reportFilename); + } + } + + function prepareBaselineReport(): string { + var reportContent = htmlLeader; + // Delete the baseline-report.html file if needed + if (IO.fileExists(reportFilename)) { + reportContent = IO.readFile(reportFilename); + reportContent = reportContent.replace(htmlTrailer, ''); + } else { + reportContent = htmlLeader; + } + return reportContent; + } + + function generateActual(actualFilename: string, generateContent: () => string): string { + // Create folders if needed + IO.createDirectory(IO.dirName(IO.dirName(actualFilename))); + IO.createDirectory(IO.dirName(actualFilename)); + + // Delete the actual file in case it fails + if (IO.fileExists(actualFilename)) { + IO.deleteFile(actualFilename); + } + + var actual = generateContent(); + + if (actual === undefined) { + throw new Error('The generated content was "undefined". Return "null" if no baselining is required."'); + } + + // Store the content in the 'local' folder so we + // can accept it later (manually) + if (actual !== null) { + IO.writeFile(actualFilename, actual); + } + + return actual; + } + + function compareToBaseline(actual: string, relativeFilename: string, opts: BaselineOptions) { + // actual is now either undefined (the generator had an error), null (no file requested), + // or some real output of the function + if (actual === undefined) { + // Nothing to do + return; + } + + var refFilename = referencePath(relativeFilename); + + if (actual === null) { + actual = ''; + } + + var expected = ''; + if (IO.fileExists(refFilename)) { + expected = IO.readFile(refFilename); + } + + var lineEndingSensitive = opts && opts.LineEndingSensitive; + + if (!lineEndingSensitive) { + expected = expected.replace(/\r\n?/g, '\n') + actual = actual.replace(/\r\n?/g, '\n') + } + + return { expected: expected, actual: actual }; + } + + function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { + if (expected != actual) { + // Overwrite & issue error + var errMsg = 'The baseline file ' + relativeFilename + ' has changed. Please refer to baseline-report.html and '; + errMsg += 'either fix the regression (if unintended) or run nmake baseline-accept (if intended).' + + var refFilename = referencePath(relativeFilename); + + // Append diff to the report + var diff = new Diff.StringDiff(expected, actual); + var header = '

' + descriptionForDescribe + '

'; + header += '

Left file: ' + actualFilename + '; Right file: ' + refFilename + '

'; + var trailer = '
'; + + var reportContentSoFar = prepareBaselineReport(); + reportContentSoFar = reportContentSoFar + header + '
' + diff.mergedHtml + '
' + trailer + htmlTrailer; + IO.writeFile(reportFilename, reportContentSoFar); + + throw new Error(errMsg); + } + } + + export function runBaseline( + descriptionForDescribe: string, + relativeFilename: string, + generateContent: () => string, + runImmediately? = false, + opts?: BaselineOptions) { + + var actual = undefined; + var actualFilename = localPath(relativeFilename); + + if (runImmediately) { + var actual = generateActual(actualFilename, generateContent); + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + } else { + describe(descriptionForDescribe, () => { + var actual: string; + + it('Can generate the content without error', () => { + actual = generateActual(actualFilename, generateContent); + }); + + it('Matches the baseline file', () => { + var comparison = compareToBaseline(actual, relativeFilename, opts); + writeComparison(comparison.expected, comparison.actual, relativeFilename, actualFilename, descriptionForDescribe); + }); + }); + } + } + } + + var currentRun = new Run(); + + global.describe = describe; + global.run = run; + global.it = it; + global.assert = Harness.Assert; +} diff --git a/tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts b/tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts new file mode 100644 index 0000000000000..6446eeae0faa0 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts @@ -0,0 +1,740 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/// + + +module Formatting { + export class Indenter implements ILineIndenationResolver { + + private indentationBag: IndentationBag; + private scriptBlockBeginLineNumber: number; + private offsetIndentationDeltas: Dictionary_int_int; + + constructor( + public logger: TypeScript.ILogger, + public tree: ParseTree, + public snapshot: ITextSnapshot, + public languageHostIndentation: string, + public editorOptions: Services.EditorOptions, + public firstToken: TokenSpan, + public smartIndent: boolean) { + + this.indentationBag = new IndentationBag(this.snapshot); + this.scriptBlockBeginLineNumber = -1; + this.offsetIndentationDeltas = new Dictionary_int_int(); // text offset -> indentation delta + + // by default the root (program) has zero indendation + this.tree.Root.SetIndentationOverride(""); + + this.ApplyScriptBlockIndentation(this.languageHostIndentation, this.tree); + this.FillInheritedIndentation(this.tree); + + } + + public GetIndentationEdits(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo { + if (this.logger.information()) { + this.logger.log("GetIndentationEdits(" + + "t1=[" + token.Span.startPosition() + "," + token.Span.endPosition()+ "], " + + "t2=[" + (nextToken == null ? "null" : (nextToken.Span.startPosition() + "," + nextToken.Span.endPosition())) + "]" + + ")"); + } + + var result = this.GetIndentationEditsWorker(token, nextToken, node, sameLineIndent); + + if (this.logger.information()) { + for (var i = 0; i < result.count() ; i++) { + var edit = result.get(i); + this.logger.log("edit: minChar=" + edit.position + ", limChar=" + (edit.position + edit.length) + ", text=\"" + TypeScript.stringToLiteral(edit.replaceWith, 30) + "\""); + } + } + + return result; + } + + public GetIndentationEditsWorker(token: TokenSpan, nextToken: TokenSpan, node: ParseNode, sameLineIndent: boolean): List_TextEditInfo { + var result = new List_TextEditInfo(); + var indentationInfo: IndentationInfo = null; + + // This handles the case: + // return ( + // function() { + // }) + // The given function's node indicates that the function starts directly after "return (". + // In this case, we adjust the span to point to the function keyword. + // The same applies to objects and arrays. + // The reason this is done inside the Indenter is because it only affects indentation behavior. + // It's also done in ParseTree when we traverse up the tree because we don't have the + // tokens for nodes outside the span we are formatting. + this.AdjustStartOffsetIfNeeded(token, node); + + // Don't adjust indentation on the same line of a script block + if (this.scriptBlockBeginLineNumber == token.lineNumber()) { + return result; + } + + // Don't indent multi-line strings + if (!sameLineIndent && this.IsMultiLineString(token)) { + return result; + } + + // Special cases for the tokens that don't show up in the tree, such as curly braces and comments + indentationInfo = this.GetSpecialCaseIndentation(token, node); + if (indentationInfo == null) { + //// For anything else + + // Get the indentation level only from the node that starts on the same offset as the token + // otherwise the token is not meant to be indented + while (!node.CanIndent() && node.Parent != null && token.Span.span.start() == node.Parent.AuthorNode.Details.StartOffset) + node = node.Parent; + + if (node.CanIndent() && token.Span.span.start() == node.AuthorNode.Details.StartOffset) { + indentationInfo = node.GetEffectiveIndentation(this); + } + else { + //// Special cases for anything else that is not in the tree and should be indented + + // check for label (identifier followed by a colon) + if (token.Token == AuthorTokenKind.atkIdentifier && nextToken != null && nextToken.Token == AuthorTokenKind.atkColon) { + // This will make the label on the same level as the surrounding function/block + // ex: + // { + // statement; + // label: + // statement; + // } + indentationInfo = node.GetEffectiveChildrenIndentation(this); + } + else { + //// Move the token the same indentation-delta that moved its indentable parent + //// For example: + //// var a, + //// b; + //// The declaration 'b' would remain under 'a' even if 'var' got indented. + indentationInfo = this.ApplyIndentationDeltaFromParent(token, node); + } + } + } + + // Get the indent edit from the indentation info + if (indentationInfo != null) { + var edit = this.GetIndentEdit(indentationInfo, token.Span.startPosition(), sameLineIndent); + if (edit != null) { + this.RegisterIndentation(edit, sameLineIndent); + + result.add(edit); + + // multi-line comments, apply delta indentation to all the other lines + if (token.Token == AuthorTokenKind.atkComment) { + var commentEdits = this.GetCommentIndentationEdits(token); + commentEdits.foreach((item) => { + result.add(item); + }); + } + } + } + + return result; + } + + private GetCommentIndentationEdits(token: TokenSpan): List_TextEditInfo { + var result = new List_TextEditInfo(); + + if (token.Token != AuthorTokenKind.atkComment) + return result; + + var commentLastLineNumber = this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()); + if (token.lineNumber() == commentLastLineNumber) + return result; + + var commentFirstLineIndentationDelta = this.GetIndentationDelta(token.Span.startPosition(), null); + if (commentFirstLineIndentationDelta != undefined) { + for (var line = token.lineNumber() + 1; line <= commentLastLineNumber; line++) { + var lineStartPosition = this.snapshot.GetLineFromLineNumber(line).startPosition(); + var lineIndent = this.GetLineIndentationForOffset(lineStartPosition); + + var commentIndentationInfo = this.ApplyIndentationDelta2(lineIndent, commentFirstLineIndentationDelta); + if (commentIndentationInfo != null) { + var tokenStartPosition = lineStartPosition + lineIndent.length; + var commentIndentationEdit = this.GetIndentEdit(commentIndentationInfo, tokenStartPosition, false); + if (commentIndentationEdit != null) { + result.add(commentIndentationEdit); + } + } + } + } + + return result; + } + + static GetIndentSizeFromIndentText(indentText: string, editorOptions: Services.EditorOptions): number { + return GetIndentSizeFromText(indentText, editorOptions, /*includeNonIndentChars:*/ false); + } + + static GetIndentSizeFromText(text: string, editorOptions: Services.EditorOptions, includeNonIndentChars: boolean): number { + var indentSize = 0; + + for (var i = 0; i < text.length; i++) { + var c = text.charAt(i); + + if (c == '\t') + indentSize = (indentSize + editorOptions.TabSize) - (indentSize % editorOptions.TabSize); + else if (c == ' ') + indentSize += 1; + else { + if (includeNonIndentChars) + indentSize += 1; + else + break; + } + } + + return indentSize; + } + + private GetSpecialCaseIndentation(token: TokenSpan, node: ParseNode): IndentationInfo { + var indentationInfo: IndentationInfo = null; + + switch (token.Token) { + case AuthorTokenKind.atkLCurly: // { is not part of the tree + indentationInfo = this.GetSpecialCaseIndentationForLCurly(node); + return indentationInfo; + + case AuthorTokenKind.atkElse: // else is not part of the tree + case AuthorTokenKind.atkRBrack: // ] is not part of the tree + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + + case AuthorTokenKind.atkRCurly: // } is not part of the tree + // if '}' is for a body-block, get indentation based on its parent. + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkBlock && node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneBody) + node = node.Parent; + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + + case AuthorTokenKind.atkWhile: // while (in do-while) is not part of the tree + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkDoWhile) { + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + } + + return null; + + case AuthorTokenKind.atkSColon: + return this.GetSpecialCaseIndentationForSemicolon(token, node); + + case AuthorTokenKind.atkComment: + return this.GetSpecialCaseIndentationForComment(token, node); + + default: + return indentationInfo; + } + } + + private GetSpecialCaseIndentationForLCurly(node: ParseNode): IndentationInfo { + var indentationInfo: IndentationInfo = null; + + if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl || + node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneThen || node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneElse) { + // flushed with the node (function & if) + indentationInfo = node.GetNodeStartLineIndentation(this); + return indentationInfo; + } + else if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkObject && !node.CanIndent()) { + // if the open curly belongs to a non-indented object, do nothing here. + return null; + } + + // effective identation of the block + indentationInfo = node.GetEffectiveIndentation(this); + return indentationInfo; + } + + private GetSpecialCaseIndentationForSemicolon(token: TokenSpan, node: ParseNode): IndentationInfo { + var indentationInfo: IndentationInfo = null; + + if (this.smartIndent) { + indentationInfo = node.GetEffectiveChildrenIndentation(this); + return indentationInfo; + } + else { + // Indent all semicolons except the ones that belong to the for statement parts (initalizer, condition, itnrement) + if (node.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkFor) { + // The passed node is actually either the program or the list because semicolon doesn't belong + // to any statement in the tree, though the statement extends up to the semicolon position. + // To find the correct statement, we look for the adjacent node on the left of the semicolon. + var semiColonStartSpan = new Span(token.Span.startPosition(), 0); + node = ParseTree.FindCommonParentNode(semiColonStartSpan, semiColonStartSpan, node); + indentationInfo = node.GetEffectiveChildrenIndentation(this); + return indentationInfo; + } + } + + return null; + } + + private GetSpecialCaseIndentationForComment(token: TokenSpan, node: ParseNode): IndentationInfo { + var indentationInfo: IndentationInfo = null; + + // Only indent line comment and the first line of block comment + var twoCharSpan = token.Span.Intersection(new Span(token.Span.startPosition(), 2)); + if (twoCharSpan != null && (twoCharSpan.GetText() == "//" || twoCharSpan.GetText() == "/*")) { + while (node.ChildrenIndentationDelta == null && node.Parent != null) + node = node.Parent; + + if (this.CanIndentComment(token, node)) { + indentationInfo = node.GetEffectiveChildrenIndentationForComment(this); + } + else { + indentationInfo = this.ApplyIndentationDeltaFromParent(token, node); + } + } + + return indentationInfo; + } + + private CanIndentComment(token: TokenSpan, node: ParseNode): boolean { + switch (node.AuthorNode.Details.Kind) { + case AuthorParseNodeKind.apnkProg: + case AuthorParseNodeKind.apnkBlock: + case AuthorParseNodeKind.apnkSwitch: + case AuthorParseNodeKind.apnkCase: + case AuthorParseNodeKind.apnkDefaultCase: + case AuthorParseNodeKind.apnkIf: + case AuthorParseNodeKind.apnkFor: + case AuthorParseNodeKind.apnkForIn: + case AuthorParseNodeKind.apnkWhile: + case AuthorParseNodeKind.apnkWith: + case AuthorParseNodeKind.apnkDoWhile: + case AuthorParseNodeKind.apnkObject: + return true; + + case AuthorParseNodeKind.apnkFncDecl: + // Comments before arguments are not indented. + // This code doesn't cover the cases of comment after the last argument or + // when there are no arguments. Though this is okay since the only case we care about is: + // function foo(/* test */ a, + // /* test */ b) + var result = true; + var children = ParseNodeExtensions.FindChildrenWithEdge(node, AuthorParseNodeEdge.apneArgument); + children.foreach((argumentNode) => { + if (token.Span.startPosition() < argumentNode.AuthorNode.Details.StartOffset) + result = false; + }); + + return result; + } + + return false; + } + + private ApplyScriptBlockIndentation(languageHostIndentation: string, tree: ParseTree): void + { + if (languageHostIndentation == null || tree.StartNodeSelf == null) + return; + + var scriptBlockIndentation = this.ApplyIndentationLevel(languageHostIndentation, 1); + + //TypeScript: Projection snapshots not supported + + // Disconnect the sibling node if it belongs to a different script block + //IProjectionSnapshot projectionSnapshot = this.snapshot as IProjectionSnapshot; + //if (projectionSnapshot != null) + //{ + // // Get script block spans. + // foreach (SnapshotSpan sourceSpan in projectionSnapshot.GetSourceSpans()) + // { + // // Map the spans to the JavaScript buffer. + // ReadOnlyCollection spans = projectionSnapshot.MapFromSourceSnapshot(sourceSpan); + + // Debug.Assert(spans.Count == 1, string.Format(CultureInfo.InvariantCulture, "Unexpected span count of {0}.", spans.Count)); + + // if (spans.Count > 0) + // { + // Span span = spans.First(); + + // // If the "self" node is the first root-level node in a script block, then remove the start node. + // if (span.Contains(tree.StartNodethis.AuthorNode.Details.StartOffset)) + // { + // this.scriptBlockBeginLineNumber = projectionSnapshot.GetLineNumberFromPosition(span.Start); + + // if (tree.StartNodePreviousSibling.HasValue) + // { + // int siblingStartOffset = tree.StartNodePreviousSibling.Value.Details.StartOffset; + + // // Don't consider sibling in these cases: + // // 1. The sibling belongs to another script block + // // 2. The sibling is on the same line of the script block + // if (!span.Contains(siblingStartOffset) || projectionSnapshot.GetLineNumberFromPosition(siblingStartOffset) == this.scriptBlockBeginLineNumber) + // { + // tree.StartNodePreviousSibling = null; + // } + // } + + // break; + // } + // } + // } + //} + + // The root is the program. + tree.Root.SetIndentationOverride(scriptBlockIndentation); + } + + private GetIndentEdit(indentInfo: IndentationInfo, tokenStartPosition: number, sameLineIndent: boolean): TextEditInfo { + var indentText = this.ApplyIndentationLevel(indentInfo.Prefix, indentInfo.Level); + + if (sameLineIndent) { + return new TextEditInfo(tokenStartPosition, 0, indentText); + } + else { + var snapshotLine = this.snapshot.GetLineFromPosition(tokenStartPosition); + var currentIndentSpan = new Span(snapshotLine.startPosition(), tokenStartPosition - snapshotLine.startPosition()); + var currentIndentText = this.snapshot.GetText(currentIndentSpan); + + if (currentIndentText !== indentText) { + if (this.logger.debug()) { + // Verify that currentIndentText is all whitespaces + for (var i = 0, len = currentIndentText.length; i < len; i++) { + var c = currentIndentText.charCodeAt(i); + if (!StringUtils.IsWhiteSpace(c)) { + Debug.Fail("Formatting error: Will remove user code when indenting the line: " + snapshotLine.getText()); + break; + } + } + } + return new TextEditInfo(currentIndentSpan.start(), currentIndentSpan.length(), indentText); + } + } + + return null; + } + + private ApplyIndentationLevel(existingIndentation: string, level: number): string { + var indentSize = this.editorOptions.IndentSize; + var tabSize = this.editorOptions.TabSize; + var convertTabsToSpaces = this.editorOptions.ConvertTabsToSpaces; + + if (level < 0) { + if (StringUtils.IsNullOrEmpty(existingIndentation)) + return ""; + + var totalIndent = 0; + StringUtils.foreach(existingIndentation, (c) => { + if (c == '\t') + totalIndent += tabSize; + else + totalIndent++; + }); + + totalIndent += level * indentSize; + if (totalIndent < 0) + return ""; + else + return this.GetIndentString(null, totalIndent, tabSize, convertTabsToSpaces); + } + + var totalIndentSize = level * indentSize; + return this.GetIndentString(existingIndentation, totalIndentSize, tabSize, convertTabsToSpaces); + } + + private GetIndentString(prefix: string, totalIndentSize: number, tabSize: number, convertTabsToSpaces: boolean): string { + var tabString = convertTabsToSpaces ? StringUtils.create(' ', tabSize) : "\t"; + + var text = ""; + if (!StringUtils.IsNullOrEmpty(prefix)) + text += prefix; + + var pos = 0; + + // fill first with tabs + while (pos <= totalIndentSize - tabSize) { + text += tabString; + pos += tabSize; + } + + // fill the reminder with spaces + while (pos < totalIndentSize) { + text += ' '; + pos++; + } + + return text; + } + + private ApplyIndentationDeltaFromParent(token: TokenSpan, node: ParseNode): IndentationInfo { + var indentationInfo: IndentationInfo = null; + + var indentableParent = node; + while (indentableParent != null && !indentableParent.CanIndent()) + indentableParent = indentableParent.Parent; + + if (indentableParent != null && indentableParent.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkProg) { + var parentIndentationDeltaSize = this.GetIndentationDelta(indentableParent.AuthorNode.Details.StartOffset, token.Span.startPosition()); + if (parentIndentationDeltaSize !== undefined) { + indentationInfo = this.ApplyIndentationDelta1(token.Span.startPosition(), parentIndentationDeltaSize); + } + } + + return indentationInfo; + } + + private ApplyIndentationDelta1(tokenStartPosition: number, delta: number): IndentationInfo { + // Get current indentation + var snapshotLine = this.snapshot.GetLineFromPosition(tokenStartPosition); + var currentIndentSpan = new Span(snapshotLine.startPosition(), tokenStartPosition - snapshotLine.startPosition()); + var currentIndent = this.snapshot.GetText(currentIndentSpan); + + // Calculate new indentation from current-indentation and delta + return this.ApplyIndentationDelta2(currentIndent, delta); + } + + private ApplyIndentationDelta2(currentIndent: string, delta: number): IndentationInfo { + if (delta == 0) + return null; + + var currentIndentSize = Indenter.GetIndentSizeFromIndentText(currentIndent, this.editorOptions); + + var newIndentSize = currentIndentSize + delta; + if (newIndentSize < 0) { + newIndentSize = 0; + } + + var newIndent = this.GetIndentString(null, newIndentSize, this.editorOptions.TabSize, this.editorOptions.ConvertTabsToSpaces); + if (newIndent != null) { + return new IndentationInfo(newIndent, 0); + } + + return null; + } + + private GetIndentationDelta(tokenStartPosition: number, childTokenStartPosition: number/*?*/): number/*?*/ { + Debug.Assert(childTokenStartPosition !== undefined, "Error: caller must pass 'null' for undefined position"); + + var indentationDeltaSize = this.offsetIndentationDeltas.GetValue(tokenStartPosition); + if (indentationDeltaSize === null) { + var indentEditInfo = this.indentationBag.FindIndent(tokenStartPosition); + + // No recorded indentation, return null + if (indentEditInfo == null) + return null; + + var origIndentText = this.snapshot.GetText(new Span(indentEditInfo.OrigIndentPosition, indentEditInfo.OrigIndentLength())); + var newIndentText = indentEditInfo.Indentation(); + + var origIndentSize = Indenter.GetIndentSizeFromText(origIndentText, this.editorOptions, /*includeNonIndentChars*/true); + var newIndentSize = Indenter.GetIndentSizeFromIndentText(newIndentText, this.editorOptions); + + // Check the child's position whether it's before the parent position + // if so indent the child based on the first token on the line as opposed to the parent position + // + // Example of relative to parent (not line), relative indentation should be "4 (newIndentSize) - 9 (indentSize up to for) = -5" + // + // if (1) { for (i = 0; i < 10; => if (1) { + // i++) { for (i = 0; i < 10; + // i++) { + // + // Example of relative to line, relative indentation should be "4 (newIndentSize) - 0 (indentSize up to if) = 4" + // + // if (1) { for (i = 0; i < 10; => if (1) { + // i++) { for (i = 0; i < 10; + // i++) { + if (childTokenStartPosition !== null) { + var childTokenLineStartPosition = this.snapshot.GetLineFromPosition(childTokenStartPosition).startPosition(); + var childIndentText = this.snapshot.GetText(new Span(childTokenLineStartPosition, childTokenStartPosition - childTokenLineStartPosition)); + + var childIndentSize = Indenter.GetIndentSizeFromIndentText(childIndentText, this.editorOptions); + + if (childIndentSize < origIndentSize) + origIndentSize = Indenter.GetIndentSizeFromIndentText(origIndentText, this.editorOptions); + } + + indentationDeltaSize = newIndentSize - origIndentSize; + this.offsetIndentationDeltas.Add(tokenStartPosition, indentationDeltaSize); + } + + return indentationDeltaSize; + } + + private FillInheritedIndentation(tree: ParseTree): void + { + var offset = -1; + var indentNode: ParseNode = null; + + if (tree.StartNodeSelf != null) { + if (!this.smartIndent && tree.StartNodePreviousSibling !== null && tree.StartNodeSelf.AuthorNode.Label == 0 && tree.StartNodePreviousSibling.Label == 0) { + indentNode = tree.StartNodeSelf; + offset = tree.StartNodePreviousSibling.Details.StartOffset; + + // In case the sibling node is on the same line of a parent node, ex: + // case 1: a++; + // break; + // In this example, the sibling of break is a++ but a++ is on the same line of its parent. + var lineNum = this.snapshot.GetLineNumberFromPosition(offset); + var node = indentNode; + while (node.Parent != null && this.snapshot.GetLineNumberFromPosition(node.Parent.AuthorNode.Details.StartOffset) == lineNum) { + node = node.Parent; + if (node.CanIndent()) { + indentNode = node; + indentNode.IndentationDelta = 0; + } + } + } + else { + var parent: ParseNode; + + // Otherwise base on parent indentation. + if (this.smartIndent) { + // in smartIndent the self node is the parent node since it's the closest node to the new line + // ... unless in case if the startNodeSelf represents the firstToken then we need to choose its parent + parent = tree.StartNodeSelf; + while (parent != null && parent.AuthorNode.Details.StartOffset == this.firstToken.Span.startPosition()) + parent = parent.Parent; + } + else { + // Get the parent that is really on a different line from the self node + var startNodeLineNumber = this.snapshot.GetLineNumberFromPosition(tree.StartNodeSelf.AuthorNode.Details.StartOffset); + parent = tree.StartNodeSelf.Parent; + while (parent != null && + startNodeLineNumber == this.snapshot.GetLineNumberFromPosition(parent.AuthorNode.Details.StartOffset)) { + parent = parent.Parent; + } + } + + // The parent node to take its indentation is the first parent that has indentation. + while (parent != null && !parent.CanIndent()) { + parent = parent.Parent; + } + + // Skip Program since it has no indentation + if (parent != null && parent.AuthorNode.Details.Kind != AuthorParseNodeKind.apnkProg) { + offset = parent.AuthorNode.Details.StartOffset; + indentNode = parent; + } + } + } + + if (indentNode != null) { + var indentOverride = this.GetLineIndentationForOffset(offset); + + // Set the indentation on all the siblings to be the same as indentNode + if (!this.smartIndent && tree.StartNodePreviousSibling !== null && indentNode.Parent != null) { + ParseNodeExtensions.GetChildren(indentNode.Parent).foreach((sibling) => { + if (sibling !== indentNode) { + if (sibling.CanIndent()) + sibling.SetIndentationOverride(indentOverride); + } + }); + } + + // Set the indent override string on the indent node and on every parent (on different line) after adjusting the indent by the negative delta + var lastDelta = 0; + var lastLine = this.snapshot.GetLineNumberFromPosition(indentNode.AuthorNode.Details.StartOffset); + do { + var currentLine = this.snapshot.GetLineNumberFromPosition(indentNode.AuthorNode.Details.StartOffset); + if (lastLine != currentLine) { + lastLine = currentLine; + indentOverride = this.ApplyIndentationLevel(indentOverride, -lastDelta); + lastDelta = 0; + } + + if (indentNode.CanIndent()) { + indentNode.SetIndentationOverride(indentOverride); + lastDelta = indentNode.IndentationDelta; + } + + indentNode = indentNode.Parent; + } + while (indentNode != null); + } + } + + public GetLineIndentationForOffset(offset: number): string { + var indentationEdit: IndentationEditInfo; + + // First check if we already have indentation info in our indentation bag + indentationEdit = this.indentationBag.FindIndent(offset); + if (indentationEdit != null) { + return indentationEdit.Indentation(); + } + else { + // Otherwise, use the indentation from the textBuffer + var line = this.snapshot.GetLineFromPosition(offset); + var lineText = line.getText(); + var index = 0; + + while (index < lineText.length && (lineText.charAt(index) == ' ' || lineText.charAt(index) == '\t')) { + ++index; + } + + return lineText.substr(0, index); + } + } + + private RegisterIndentation(indent: TextEditInfo, sameLineIndent: boolean): void + { + var indentationInfo: IndentationEditInfo = null; + + if (sameLineIndent) { + // Consider the original indentation from the beginning of the line up to the indent position (or really the token position) + var lineStartPosition = this.snapshot.GetLineFromPosition(indent.Position).startPosition(); + var lineIndentLength = indent.Position - lineStartPosition; + + indentationInfo = IndentationEditInfo.create2(indent.Position, indent.ReplaceWith, lineStartPosition, lineIndentLength); + } + else { + indentationInfo = new IndentationEditInfo(indent); + } + + this.indentationBag.AddIndent(indentationInfo); + } + + public RegisterIndentation2(position: number, indent: string): void + { + this.RegisterIndentation(new TextEditInfo(position, 0, indent), false); + } + + private AdjustStartOffsetIfNeeded(token: TokenSpan, node: ParseNode): void + { + if (token == null) + return; + + var updateStartOffset = false; + + switch (token.Token) { + case AuthorTokenKind.atkFunction: + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkFncDecl; + break; + + case AuthorTokenKind.atkLCurly: + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkObject; + break; + + case AuthorTokenKind.atkLBrack: + updateStartOffset = node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkArray; + break; + } + + if (updateStartOffset) { + ParseNodeExtensions.SetNodeSpan(node, token.Span.startPosition(), node.AuthorNode.Details.EndOffset); + } + } + + private IsMultiLineString(token: TokenSpan): boolean { + return token.tokenID === TypeScript.TokenID.StringLiteral && + this.snapshot.GetLineNumberFromPosition(token.Span.endPosition()) > this.snapshot.GetLineNumberFromPosition(token.Span.startPosition()); + } + } +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts new file mode 100644 index 0000000000000..3183bebe93a43 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509534.ts @@ -0,0 +1,11 @@ +"use strict"; +var config = require("../config"); +module.exports.route = function (server) { + + // General Login Page + server.get(config.env.siteRoot + "/auth/login", function (req, res, next) { + + // TODO Should render login page that shows auth options + req.redirect("/auth/live"); + }); +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts new file mode 100644 index 0000000000000..bfb48ee0e303b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts @@ -0,0 +1,3 @@ +export class Logger { + public +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts new file mode 100644 index 0000000000000..bfb48ee0e303b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts @@ -0,0 +1,3 @@ +export class Logger { + public +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts new file mode 100644 index 0000000000000..ca1a460120445 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts @@ -0,0 +1,5 @@ +"use strict"; + +export class Logger { + public +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts new file mode 100644 index 0000000000000..eda90337f7931 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509618.ts @@ -0,0 +1,3 @@ +declare module ambiModule { + interface i1 { }; +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts new file mode 100644 index 0000000000000..65a4bf7522e2c --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509630.ts @@ -0,0 +1,5 @@ +class Type { + public examples = [ // typing here +} +class Any extends Type { +} diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts new file mode 100644 index 0000000000000..f5d3bf6c1614b --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509667.ts @@ -0,0 +1,11 @@ +class Foo { + f1() { + if (this. + } + + f2() { + } + + f3() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts new file mode 100644 index 0000000000000..3ac3b438ff838 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts @@ -0,0 +1,4 @@ +class Foo3 { + // Doesn't work, but should + constructor (public ...args: string[]) { } +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts new file mode 100644 index 0000000000000..6ce01b247b0ae --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509669.ts @@ -0,0 +1,3 @@ +function foo():any { + return ():void {}; +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509677.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509677.ts new file mode 100644 index 0000000000000..46106e2ddc9df --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509677.ts @@ -0,0 +1 @@ +var n: { y: string }; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts new file mode 100644 index 0000000000000..522307d188347 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509693.ts @@ -0,0 +1 @@ +if (!module.exports) module.exports = ""; \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts new file mode 100644 index 0000000000000..f33abc85b5308 --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509698.ts @@ -0,0 +1,4 @@ +/// + + + + + + \ No newline at end of file diff --git a/tests/cases/unittests/services/getCompletionsAtPosition.ts b/tests/cases/unittests/services/getCompletionsAtPosition.ts new file mode 100644 index 0000000000000..aa3e771919f47 --- /dev/null +++ b/tests/cases/unittests/services/getCompletionsAtPosition.ts @@ -0,0 +1,220 @@ +/// + +debugger; + +describe('getCompletionsAtPosition', function () { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts'; + var fileName3 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts'; + var fileName4 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts'; + var fileName5 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts'; + var fileName6 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts'; + var fileName7 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts'; + var fileName8 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts'; + var fileName9 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts'; + var fileName10 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts'; + var fileNameBugFixes = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts'; + + typescriptLS.addFile(fileName); + typescriptLS.addFile(fileName2); + typescriptLS.addFile(fileName3); + typescriptLS.addFile(fileName4); + typescriptLS.addFile(fileName5); + typescriptLS.addFile(fileName6); + typescriptLS.addFile(fileName7); + typescriptLS.addFile(fileName8); + typescriptLS.addFile(fileName9); + typescriptLS.addFile(fileName10); + typescriptLS.addFile(fileNameBugFixes); + + var ls = typescriptLS.getLanguageService(); + + // + // line and column are 1-based + // + function lineColToPosition(fileName: string, line: number, col: number): number { + var script = ls.languageService.getScriptAST(fileName); + assert.notNull(script); + + var lineMap = script.locationInfo.lineMap; + + assert.is(line >= 1); + assert.is(col >= 1); + assert.is(line <= lineMap.length); + var offset = lineMap[line - 1] + (col - 1); + + assert.is(offset < script.limChar); + return offset; + } + + // + // line and column are 1-based + // + function getCompletionList(fileName, line, column, isMemberCompletion) { + var position = lineColToPosition(fileName, line, column); + return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); + } + + describe("test cases for completion list", function () { + + //it("contains a private variable defined in a module", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName, 45, false); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "testing" && x.type == "string"); + //}); + + //it("'this.' member completion for class containing privates", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName, 85, true); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "privMeth" && x.type == "() => void"); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); + //}); + + //it("member completion for class containing privates, outside of class scope", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName, 203, true); + + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); + //}); + + //it("member completion for module-exported class containing privates, outside of class and module scopes", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName, 343, true); + // assert.notNull(result); + // assert.notNull(result.entries); + // assert.equal(true, result.isMemberCompletion); + // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pub" && x.type == "number"); + + //}); + + //it("member completion for dotted typeref works", function () { + // assert.equal(125, lineColToPosition(fileName2, 12, 11)); + // var result = getCompletionList(fileName2, 12, 11, true); + // assert.notEqual(null, result); + // assert.notEqual(null, result.entries); + // assert.equal(true, result.isMemberCompletion); + // assert.equal(2, result.entries.length); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Blah"; }); + //}); + + // Negative Cases + it("doesnt return anything from a comment-1", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), true); + assert.equal(result.isMemberCompletion, true); + assert.equal(result.entries.length, 0); + }); + + it("doesnt return anything from a comment-2", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), false); + assert.equal(result.isMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + it("doesnt return anything from a comment-3", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), true); + assert.equal(result.isMemberCompletion, true); + assert.equal(result.entries.length, 0); + }); + + it("doesnt return anything from a comment-4", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), false); + assert.equal(result.isMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + it("checks for completion in comment", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 1, 4), false); + assert.equal(result.isMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + /* + it("checks for completion in var decl", function() { + var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 2, 5), false); + assert.equal(result.wasMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + + it("checks for completion in class decl", function() { + var result = ls.languageService.getCompletionsAtPosition(fileName4, lineColToPosition(fileName4, 1, 7), false); + assert.equal(result.wasMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + + it("checks for completion in module decl", function() { + var result = ls.languageService.getCompletionsAtPosition(fileName5, lineColToPosition(fileName5, 1, 7), false); + assert.equal(result.wasMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + it("checks for completion in interface decl", function() { + var result = ls.languageService.getCompletionsAtPosition(fileName6, lineColToPosition(fileName6, 1, 11), false); + assert.equal(result.wasMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + + + it("checks for completion in function decl", function() { + var result = ls.languageService.getCompletionsAtPosition(fileName7, lineColToPosition(fileName7, 1, 10), false); + assert.equal(result.wasMemberCompletion, false); + assert.equal(result.entries.length, 0); + }); + */ + + it("checks for completion after single dot", function () { + var result = ls.languageService.getCompletionsAtPosition(fileName8, lineColToPosition(fileName8, 1, 1), true); + assert.equal(result.isMemberCompletion, true); + assert.equal(result.entries.length, 0); + }); + + //it("checks for completion at declaration of parameter type", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 9, 17), false); + // assert.equal(result.isMemberCompletion, false); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); + //}); + + //it("checks for completion after class extends", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 5, 30), false); + // assert.equal(result.isMemberCompletion, false); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bleah"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Foo"; }); + //}); + + //it("checks for completion at reference to function parameter", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileName10, lineColToPosition(fileName10, 4, 31), true); + // assert.equal(result.isMemberCompletion, true); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charAt"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charCodeAt"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "length"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "concat"; }); + //}); + + //it("checks for completion at enum", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 7, 22), true); + // assert.equal(result.isMemberCompletion, true); + // assert.equal(result.entries.length, 2); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); + //}); + + //it("checks for completion at imported enum", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 10, 9), true); + // assert.equal(result.isMemberCompletion, true); + // assert.equal(result.entries.length, 2); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); + //}); + + //it("checks for completion inside target typed function", function () { + // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 15, 40), false); + // assert.equal(result.isMemberCompletion, false); + // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "elem" && item.type === "string"; }); + //}); + }); +}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts new file mode 100644 index 0000000000000..e79de7230814b --- /dev/null +++ b/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts @@ -0,0 +1,55 @@ +/// + +describe('getCompletionsAtPositionAfterEdits', function () { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts'; + var fileName2 = 'otherScript.ts'; + + typescriptLS.addFile(fileName); + typescriptLS.addScript(fileName2, typescriptLS.getScriptContent(1)); + + var ls = typescriptLS.getLanguageService(); + + // + // line and column are 1-based + // + function getCompletionList(fileName: string, position: number, isMemberCompletion: boolean): Services.CompletionInfo { + return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); + } + + function typeCharacters(fileName: string, line: number, column: number, text: string): number { + var pos = typescriptLS.lineColToPosition(fileName, line, column); + for (var i = 0; i < text.length; i++) { + typescriptLS.editScript(fileName, pos, pos, text.charAt(i)); + pos++; + } + return pos; + } + + describe("test cases for completion list after edits inside source file", function () { + + it("verify function arguments are available after edits at end of function", function () { + // Apply edit + var pos = typescriptLS.lineColToPosition(fileName, 5, 13); + var text = "this.children = ch"; + typescriptLS.editScript(fileName, pos, pos, text); + var result = getCompletionList(fileName, pos + text.length - 2 /*ch*/, false); + var entry = result.entries.filter(x => x.name == "children"); + assert.notNull(entry); + assert.equal(1, entry.length); + }); + + it("verify function arguments are available after edits at end of function after multiple edits", function () { + // Apply edit + var text = "this.children = ch"; + var pos = typeCharacters(fileName2, 5, 13, text); + var result = getCompletionList(fileName2, pos - 2 /*ch*/, false); + var entry = result.entries.filter(x => x.name == "children"); + assert.notNull(entry); + assert.equal(1, entry.length); + }); + }); +}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts new file mode 100644 index 0000000000000..4e1a35b81c291 --- /dev/null +++ b/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts @@ -0,0 +1,100 @@ +///// + +//describe('getCompletionsAtPositionObjectLiterals', function () { +// var typescriptls = new Harness.TypeScriptLS(); + +// typescriptls.addDefaultLibrary(); + +// var fileNameObjectLiterals = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts'; + +// typescriptls.addFile(fileNameObjectLiterals); + +// var ls = typescriptls.getLanguageService(); + +// // +// // line and column are 1-based +// // +// function getCompletionList(fileName: string, line: number, column: number, isMemberCompletion: boolean): Services.CompletionInfo { +// var position = typescriptls.lineColToPosition(fileName, line, column); +// return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); +// } + +// function assertIsMemberCompletions(result: Services.CompletionInfo) { +// assert.notNull(result); +// assert.is(result.isMemberCompletion, "isMemberCompletion should be set"); +// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); +// assert.is(result.entries.length == 2, "Completion should contain only 2 members of object literal"); +// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "x1" && x.type == "number"); +// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "y1" && x.type == "number"); +// } + +// function assertIsGlobalCompletions(result: Services.CompletionInfo) { +// assert.notNull(result); +// assert.is(!result.isMemberCompletion, "isMemberCompletion should be not be set"); +// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); +// assert.is(result.entries.length >= 10, "Completion should be global completion set"); +// } + +// function assertIsNoCompletions(result: Services.CompletionInfo) { +// assert.notNull(result); +// assert.is(result.entries.length == 0, "Completion should be empty (i.e. no completion)"); +// } + +// describe("test cases for completion list inside object literals", function () { +// it("Literal member completion inside empty literal", function () { +// var result = getCompletionList(fileNameObjectLiterals, 8, 9, false); +// assertIsMemberCompletions(result); +// }); + +// it("Literal member completion for 2nd member name", function () { +// var result = getCompletionList(fileNameObjectLiterals, 13, 9, false); +// assertIsMemberCompletions(result); +// }); + +// it("Literal member completion at existing member name location", function () { +// var result = getCompletionList(fileNameObjectLiterals, 17, 9, false); +// assertIsMemberCompletions(result); +// }); + +// it("Literal member completion after existing member name location", function () { +// var result = getCompletionList(fileNameObjectLiterals, 17, 12, false); +// assertIsMemberCompletions(result); +// }); + +// }); + +// describe("test cases for global completion list inside object literals", function () { +// it("Literal member completion after member name with empty member expression and missing colon", function () { +// var result = getCompletionList(fileNameObjectLiterals, 27, 13, false); +// assertIsGlobalCompletions(result); + +// var result = getCompletionList(fileNameObjectLiterals, 28, 5, false); +// assertIsGlobalCompletions(result); +// }); + +// it("Literal member completion after member name with empty member expression", function () { +// var result = getCompletionList(fileNameObjectLiterals, 31, 13, false); +// assertIsGlobalCompletions(result); + +// var result = getCompletionList(fileNameObjectLiterals, 31, 22, false); +// assertIsGlobalCompletions(result); +// }); + +// it("No completion on '{' location", function () { +// var result = getCompletionList(fileNameObjectLiterals, 7, 23, false); +// assertIsGlobalCompletions(result); +// }); +// }); + +// describe("test cases for no completion list inside object literals", function () { +// it("No completion on comments (1)", function () { +// var result = getCompletionList(fileNameObjectLiterals, 8, 12, false); +// assertIsNoCompletions(result); +// }); + +// it("No completion on comments (2)", function () { +// var result = getCompletionList(fileNameObjectLiterals, 8, 18, false); +// assertIsNoCompletions(result); +// }); +// }); +//}); diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts b/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts new file mode 100644 index 0000000000000..d9291ed821f5a --- /dev/null +++ b/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts @@ -0,0 +1,193 @@ +/// + +describe('getDefinitionPositionAtPosition', function() { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts'; + var fileName3 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts'; + + typescriptLS.addFile(fileName); + typescriptLS.addFile(fileName2); + typescriptLS.addFile(fileName3); + + var ls = typescriptLS.getLanguageService(); + + function lineToOffset(line: number, col = 0, sFile?) { + var script: TypeScript.Script; + if (sFile) { + if (sFile === 1){ + script = ls.languageService.getScriptAST(fileName); + } else if (sFile === 2) { + script = ls.languageService.getScriptAST(fileName2); + } else if (sFile === 3){ + script = ls.languageService.getScriptAST(fileName3); + } + } + else { + script = ls.languageService.getScriptAST(fileName); + } + return script.locationInfo.lineMap[line - 1] + col; + } + + function definitionAtPos(line: number, col: number) { + var result = ls.getDefinitionAtPosition(fileName, lineToOffset(line, col)); + if (result.substr(0,9) === "##ERROR##") { + return null; + } + var parts = result.split('\t'); + var defScriptIndex = parts[0]; + var defPosition = parts[1]; + return { index : defScriptIndex, pos : defPosition } + } + + function verifyDefinition(indexAndPos: {index: string; pos: string;}, line: number, col: number, fileNum: number) { + if (indexAndPos.index !== fileNum.toString()) { + throw new Error("Expected file index to be " + fileNum + " but it was " + indexAndPos.index + " instead."); + } + if (indexAndPos.pos!== lineToOffset(line, col, fileNum).toString()) { + throw new Error("Expected offset to be " + lineToOffset(line, col, fileNum).toString() + " but it was " + indexAndPos.pos + " instead."); + } + } + + describe('GoTo Definition', function() { + /* + LOCAL + */ + + it("A variable that is defined in the same file", function() { + var indexAndPos = definitionAtPos(8, 0); + verifyDefinition(indexAndPos, 2, 0, 1); + }); + + it("A function that is defined in the same file", function() { + var indexAndPos = definitionAtPos(9, 0); + verifyDefinition(indexAndPos, 3, 0, 1); + }); + + it("A class that is defined in the same file", function() { + var indexAndPos = definitionAtPos(10, 16); + verifyDefinition(indexAndPos, 4, 0, 1); + }); + + it("An interface that is defined in the same file", function() { + var indexAndPos = definitionAtPos(11, 26); + verifyDefinition(indexAndPos, 5, 0, 1); + }); + + it("A module that is defined in the same file", function() { + var indexAndPos = definitionAtPos(12, 15); + verifyDefinition(indexAndPos, 6, 0, 1); + }); + + /* + REMOTE + */ + + it("A variable that is defined in a remote file", function() { + var indexAndPos = definitionAtPos(14, 0); + verifyDefinition(indexAndPos, 2, 0, 2); + }); + + it("A function that is defined in a remote file", function() { + var indexAndPos = definitionAtPos(15, 0); + verifyDefinition(indexAndPos, 3, 0, 2); + }); + + it("A class that is defined in a remote file", function() { + var indexAndPos = definitionAtPos(16, 19); + verifyDefinition(indexAndPos, 4, 0, 2); + }); + + it("An interface that is defined in a remote file", function() { + var indexAndPos = definitionAtPos(17, 29); + verifyDefinition(indexAndPos, 5, 0, 2); + }); + + it("A module that is defined in a remote file", function() { + var indexAndPos = definitionAtPos(18, 18); + verifyDefinition(indexAndPos, 6, 0, 2); + }); + + /* + REMOTE -> REMOTE + */ + + it("A variable that is defined in a remote file that is referenced from a remote file", function() { + var indexAndPos = definitionAtPos(20, 0); + verifyDefinition(indexAndPos, 1, 0, 3); + }); + + it("A function that is defined in a remote file that is referenced from a remote file", function() { + var indexAndPos = definitionAtPos(21, 0); + verifyDefinition(indexAndPos, 2, 0, 3); + }); + + it("A class that is defined in a remote file that is referenced from a remote file", function() { + var indexAndPos = definitionAtPos(22, 19); + verifyDefinition(indexAndPos, 3, 0, 3); + }); + + it("An interface that is defined in a remote file that is referenced from a remote file", function() { + var indexAndPos = definitionAtPos(23, 29); + verifyDefinition(indexAndPos, 4, 0, 3); + }); + + it("A module that is defined in a remote file that is referenced from a remote file", function() { + var indexAndPos = definitionAtPos(24, 18); + verifyDefinition(indexAndPos, 5, 0, 3); + }); + + /* + Others + */ + + it("A shadowed variable inside a module", function() { + var indexAndPos = definitionAtPos(29, 6); + verifyDefinition(indexAndPos, 28, 4, 1); + }); + + it("A function being overloaded on global - 1", function() { + var indexAndPos = definitionAtPos(32, 9); + verifyDefinition(indexAndPos, 34, 0, 1); + }); + + it("A function being overloaded on global - 2", function() { + var indexAndPos = definitionAtPos(36, 0); + verifyDefinition(indexAndPos, 34, 0, 1); + }); + + it("Constructor being overloaded in class", function() { + var indexAndPos = definitionAtPos(40, 4); + verifyDefinition(indexAndPos, 42, 4, 1); + }); + + it("A function being overloaded in class - 1", function() { + var indexAndPos = definitionAtPos(52, 11); + verifyDefinition(indexAndPos, 54, 4, 1); + }); + + it("A static function being overloaded in class - 1", function() { + var indexAndPos = definitionAtPos(50, 11); + verifyDefinition(indexAndPos, 51, 4, 1); + }); + + it("Calling a static function of a class", function() { + var indexAndPos = definitionAtPos(63, 19); + verifyDefinition(indexAndPos, 51, 4, 1); + }); + + it("A class implementing an interface", function() { + var indexAndPos = definitionAtPos(83, 24); + verifyDefinition(indexAndPos, 78, 0, 1); + }); + + it("An ambient variable", function() { + var indexAndPos = definitionAtPos(91, 0); + verifyDefinition(indexAndPos, 89, 0, 1); + }); + }); +}); + diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts b/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts new file mode 100644 index 0000000000000..ca22c326aab8b --- /dev/null +++ b/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts @@ -0,0 +1,29 @@ +/// + +describe('getDefinitionPositionAtPositionPartialInterface', function() { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts'; + + typescriptLS.addFile(fileName); + typescriptLS.addFile(fileName2); + + var ls = typescriptLS.getLanguageService() + function definitionAtPos(fileName:string, line: number, col: number) { + return ls.languageService.getDefinitionAtPosition(fileName, typescriptLS.lineColToPosition(fileName, line, col)); + } + + describe('GoTo Definition', function() { + it("returns the location of the first part of a partial interface", function() { + var def = definitionAtPos(fileName2, 8, 13); + assert.notNull(def); + assert.equal(def.unitIndex, 1); + assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).line + 1, 2); + assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).col + 1, 5); + }); + }); +}); + diff --git a/tests/cases/unittests/services/getFormattingEditsForRange.ts b/tests/cases/unittests/services/getFormattingEditsForRange.ts new file mode 100644 index 0000000000000..b369ba4374b9e --- /dev/null +++ b/tests/cases/unittests/services/getFormattingEditsForRange.ts @@ -0,0 +1,88 @@ +/// + +describe('getFormattingEditsForRange', function() { + // + // Verify that formatting the typescript file "sourceFileName" results in the + // baseline file "baselineFileName". + // + function getFormattingEditsForRange(sourceFileName: string) { + var baselineFileName = "tests/cases/unittests/services/testCode/formatting/" + sourceFileName + "BaseLine.ts"; + sourceFileName = "tests/cases/unittests/services/testCode/formatting/" + sourceFileName + ".ts"; + + var typescriptLS = new Harness.TypeScriptLS(); + typescriptLS.addDefaultLibrary(); + typescriptLS.addFile(sourceFileName); + + var ls = typescriptLS.getLanguageService(); + var script = ls.languageService.getScriptAST(sourceFileName); + assert.notNull(script); + + var edits = ls.languageService.getFormattingEditsForRange(sourceFileName, 0, script.limChar, new Services.FormatCodeOptions()); + typescriptLS.checkEdits(sourceFileName, baselineFileName, edits); + } + + describe('test cases for formatting engine', function() { + it("formats typescript constructs properly", function() { + getFormattingEditsForRange('typescriptConstructs'); + }); + it("formats document ready function properly", function() { + getFormattingEditsForRange('documentReadyFunction'); + }); + it("formats on closing bracket properly", function() { + getFormattingEditsForRange('onClosingBracket'); + }); + it("formats various javascript constructs", function() { + getFormattingEditsForRange('various'); + }); + it("formats main javascript program", function() { + getFormattingEditsForRange('main'); + }); + it("formats on semicolon properly", function() { + getFormattingEditsForRange('onSemiColon'); + }); + it("formats enum with trailling tab characters properly", function() { + getFormattingEditsForRange('tabAfterCloseCurly'); + }); + it("formats object literal", function() { + getFormattingEditsForRange('objectLiteral'); + }); + it("formats with statements", function() { + getFormattingEditsForRange('withStatement'); + }); + it("formats ':' and '?' in parameters", function() { + getFormattingEditsForRange('colonAndQMark'); + }); + it("formats 'import' declaration", function() { + getFormattingEditsForRange('importDeclaration'); + }); + it("formats exported class with implicit module", function() { + //TODO: this is to force generation of implicit module in AST + var svGenTarget = TypeScript.moduleGenTarget; + try { + TypeScript.moduleGenTarget = TypeScript.ModuleGenTarget.Asynchronous; + getFormattingEditsForRange('implicitModule'); + } + finally { + TypeScript.moduleGenTarget = svGenTarget; + } + }); + it("formats constructor statements correctelly", function() { + getFormattingEditsForRange('spaceAfterConstructor'); + }); + it("formats classes and interfaces correctelly", function() { + getFormattingEditsForRange('classes'); + }); + it("formats modules correctly", function() { + getFormattingEditsForRange('modules'); + }); + it("formats fat arrow expressions correctelly", function() { + getFormattingEditsForRange('fatArrowFunctions'); + }); + it("formats empty object/interface literals correctelly", function() { + getFormattingEditsForRange('emptyInterfaceLiteral'); + }); + it("formats variable declaration lists", function() { + getFormattingEditsForRange('formatVariableDeclarationList'); + }); + }); +}); diff --git a/tests/cases/unittests/services/getImplementorsAtPosition.ts b/tests/cases/unittests/services/getImplementorsAtPosition.ts new file mode 100644 index 0000000000000..748e1f6f1f930 --- /dev/null +++ b/tests/cases/unittests/services/getImplementorsAtPosition.ts @@ -0,0 +1,73 @@ +/// + +describe('getImplementorsAtPosition', function () { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts'; + + typescriptLS.addFile(fileName); + + var ls = typescriptLS.getLanguageService(); + + + function getImplementorsAtPos(fileName:string, line: number, col: number): Services.ReferenceEntry[] { + var pos = typescriptLS.lineColToPosition(fileName, line, col); + + return ls.languageService.getImplementorsAtPosition(fileName, pos); + } + + describe('Get Implementors At Position Simple Tests', function () { + it("Find derived class from base class", function() { + var result = getImplementorsAtPos(fileName, 2, 12); + assert.notNull(result); + assert.equal(2, result.length); + }); + + it("Should not find base class from derived class", function() { + var result = getImplementorsAtPos(fileName, 6, 12); + assert.notNull(result); + assert.equal(1, result.length); + }); + + it("Find derived interface from base interface", function() { + var result = getImplementorsAtPos(fileName, 13, 16); + assert.notNull(result); + assert.equal(2, result.length); + }); + + it("Should not find base interface from derived interface", function() { + var result = getImplementorsAtPos(fileName, 16, 16); + assert.notNull(result); + assert.equal(1, result.length); + }); + + it("Find dervied class from base interface", function() { + var result = getImplementorsAtPos(fileName, 22, 16); + assert.notNull(result); + assert.equal(2, result.length); + }); + + it("Should not find base interface from derived class", function() { + var result = getImplementorsAtPos(fileName, 25, 12); + assert.notNull(result); + assert.equal(1, result.length); + }); + }); + + describe('Get Implementors At Position Complex Tests', function () { + it("Find derived classes and interfaces from top level interface", function() { + var result = getImplementorsAtPos(fileName, 32, 17); + assert.notNull(result); + assert.equal(6, result.length); + }); + + it("Find derived classes and interfaces from middle interface", function() { + var result = getImplementorsAtPos(fileName, 41, 18); + assert.notNull(result); + assert.equal(4, result.length); + }); + }); +}); + diff --git a/tests/cases/unittests/services/getReferencesAtPosition.ts b/tests/cases/unittests/services/getReferencesAtPosition.ts new file mode 100644 index 0000000000000..1f3645c204632 --- /dev/null +++ b/tests/cases/unittests/services/getReferencesAtPosition.ts @@ -0,0 +1,188 @@ +/// + +debugger; + +describe('getReferencesAtPosition', function() { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName1 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts'; + var fileName3 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts'; + var fileName4 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts'; + + typescriptLS.addFile(fileName1); + typescriptLS.addFile(fileName2); + typescriptLS.addFile(fileName3); + typescriptLS.addFile(fileName4); + + var ls = typescriptLS.getLanguageService(); + + // Returns the offset corresponding to the line + column given + function lineToOffset(line: number, col = 0, fileName?: string = fileName1) { + var script: TypeScript.Script = ls.languageService.getScriptAST(fileName); + return script.locationInfo.lineMap[line - 1] + col; + } + + describe("local get references", function() { + + it("finds references to comment", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(2, 25)); + assert.equal(1, result.split("\n").length); + }); + + it("find references to type", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 15)); + var count = 0; + // Filter out the lib.d.ts + var items = result.split("\n"); + for (var i = 0; i < items.length; i++) { + if (items[i].split(" ")[0] !== "0") { + count++; + } + } + assert.equal(10, count); + }); + + it("find references to a variable declared in global", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 4)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to a variable declared in a class", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(8, 8)); + assert.equal(3, result.split("\n").length); + }); + + it("find references to static variable declared in a class", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(6, 16)); + assert.equal(7, result.split("\n").length); + }); + + it("find references to a variable declared in a function", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(22, 8)); + assert.equal(3, result.split("\n").length); + }); + + it("find references to a class parameter", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(15, 17)); + assert.equal(2, result.split("\n").length); + }); + + it("find references to a function parameter", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(20, 14)); + assert.equal(3, result.split("\n").length); + }); + + it("find references to a function argument", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(66, 8)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to a class argument", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(65, 29)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to illegal assignment", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(75, 0)); + assert.equal(8, result.split("\n").length); + }); + + it("find references to unresolved symbol", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(76, 0)); + assert.equal(1, result.split("\n").length); + }); + + it("find references to no context", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(77, 0)); + assert.equal(1, result.split("\n").length); + }); + + it("find references to shadowed function parameter", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(79, 20)); + assert.equal(4, result.split("\n").length); + }); + + it("find reference misses function parameter", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(115, 11)); + assert.equal(3, result.split("\n").length); + }); + }); + + describe("remote get references", function() { + it("find references to a variable declared in global", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(96, 0)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to a type", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(87, 23)); + assert.equal(9, result.split("\n").length); + }); + + it("find references to a function argument", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(91, 19)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to a class argument", function() { + var result = ls.getReferencesAtPosition(fileName1, lineToOffset(90, 43)); + assert.equal(12, result.split("\n").length); + }); + + it("find references to a variable declared in a class", function() { + var result = ls.getReferencesAtPosition(fileName2, lineToOffset(5, 8, fileName2)); + assert.equal(3, result.split("\n").length); + }); + + it("find references to static variable declared in a class", function() { + var result = ls.getReferencesAtPosition(fileName2, lineToOffset(6, 11, fileName2)); + assert.equal(7, result.split("\n").length); + }); + }); + + describe("get references for overrides", function() { + it("find references to a field declared in a base class", function() { + var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(62, 11, fileName3)); + assert.equal(3, result.length); + }); + + it("find references to a field declared in a base interface", function() { + var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(65, 11, fileName3)); + assert.equal(3, result.length); + }); + + it("find references to a field declared in a chain of base class and interfaces", function() { + var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(68, 11, fileName3)); + assert.equal(6, result.length); + }); + }); + + describe("get references for statics with same names as members", function() { + it("find references to a member method with the same name as a static", function() { + /* public foo(): void */ + var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(7, 21, fileName4)); + assert.equal(3, result.length); + }); + + it("find references to a static method with the same name as a member", function() { + /* public static foo(): void */ + var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(9, 28, fileName4)); + assert.equal(2, result.length); + }); + + it("find references to a member property with the same name as a static", function() { + /* bar: Foo */ + var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(4, 14, fileName4)); + assert.equal(3, result.length); + }); + + it("find references to a static property with the same name as a member", function() { + /* static bar: Foo */ + var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(5, 21, fileName4)); + assert.equal(2, result.length); + }); + }); +}); diff --git a/tests/cases/unittests/services/getReferencesAtPosition2.ts b/tests/cases/unittests/services/getReferencesAtPosition2.ts new file mode 100644 index 0000000000000..4a0eb2ab1ac1e --- /dev/null +++ b/tests/cases/unittests/services/getReferencesAtPosition2.ts @@ -0,0 +1,235 @@ +/// + +function testFileForReferenceHighlighting(filename: string, expectedMissingCount ?= 0, expectedExtraCount ?= 0) { + describe( + 'The file ' + filename + ' has ' + expectedMissingCount + ' missing reference highlights and ' + expectedExtraCount + ' extra reference highlights', + function(filename: string, expectedMissingCount: number, expectedExtraCount: number) { + return function() { + validateReferencesFile(filename, expectedMissingCount, expectedExtraCount); + } + }(filename, expectedMissingCount, expectedExtraCount) + ); +} + +function validateReferencesFile(filename: string, expectedMissingCount: number, expectedExtraCount: number) { + var __typescriptLS = new Harness.TypeScriptLS(); + + // Read the input file and split it apart into sub-files + var testFile = IO.readFile(filename); + var testFileParts = splitFile(testFile); + + var testFileNames: string[] = []; + var testFileContents: string[] = []; + + // For each sub-file, add it to the project and collect its spans + var spans: Span[] = []; + var caretPositions: Span[] = []; + var i; + for(i = 0; i < testFileParts.length; i++) { + var partSpans: Span[] = []; + var partCarets: Span[] = []; + var transformedCode = extractCodeSpans(testFileParts[i], partSpans, partCarets); + + partSpans.forEach(function(sp) { + sp.fileIndex = i; + spans.push(sp); + }); + + partCarets.forEach(function(sp) { + sp.fileIndex = i; + caretPositions.push(sp); + }); + + var tempFilename = 'tempFile' + i + '.ts'; + testFileNames.push(tempFilename); + testFileContents.push(transformedCode); + __typescriptLS.addScript(tempFilename , transformedCode); + } + + // Be sure to do this last so file indices don't get off-by-n'd by the default library + __typescriptLS.addDefaultLibrary(); + testFileContents.push(Harness.Compiler.libText); + + // If there's no caret position, someone screwed up the test authoring + if(caretPositions.length === 0) { + throw new Error('No caret positions in ' + filename + ' - did you forget to add some?'); + } + + var __ls = __typescriptLS.getLanguageService(); + + for(var caretIndex = 0; caretIndex < caretPositions.length; caretIndex++) { + var caret = caretPositions[caretIndex]; + describe('Returns the correct references at caret position = ' + caret, function() { + var references = __ls.getReferencesAtPosition(testFileNames[caret.fileIndex], caret.start); + var referencesList = Span.fromReferenceLines(references); + referencesList.forEach(function(rf) { rf.getContent(testFileContents); }); + + var diff = diffLists(spans, referencesList, function(s1, s2) { return s1.equals(s2); }); + if(expectedExtraCount === 0) { + it('Has no extra highlights', function() { + assert.equal('', diff.extraItems.join(', ')); + }); + } else { + it('Has ' + expectedExtraCount + ' extra highlights', function() { + assert.equal(expectedExtraCount, diff.extraItems.length); + }); + } + + if(expectedMissingCount === 0) { + it('Has no missing highlights', function() { + assert.equal('', diff.missingItems.join(', ')); + }); + } else { + it('Has ' + expectedMissingCount + ' missing highlights', function() { + assert.equal(expectedMissingCount, diff.missingItems.length); + }); + } + }); + } +} + +interface ListDiffResult { + areIdentical: boolean; + extraItems: any[]; + missingItems: any[]; +} + +function diffLists(expected: any[], actual: any[], equals: (expct: any, actl: any) => boolean) : ListDiffResult { + var result = { areIdentical: false, extraItems: actual.slice(0), missingItems: expected.slice(0) }; + + var i, j; + for(i = 0; i < result.extraItems.length; i++) { + for(j = 0; j < result.missingItems.length; j++) { + if(equals(result.missingItems[j], result.extraItems[i])) { + result.extraItems.splice(i, 1); + result.missingItems.splice(j, 1); + i--; + break; + } + } + } + + result.areIdentical = result.extraItems.length === 0 && result.missingItems.length === 0; + return result; +} + +class Span { + constructor (public start: number, public length: number, public content: string) { } + + public fileIndex: number = null; + + public getContent(fileContents: string[]) { + this.content = fileContents[this.fileIndex].substr(this.start, this.length); + } + + static fromReferenceLine(line: string): Span { + var parts = line.split(' '); + var fileNumber = parseInt(parts[0]); + var start = parseInt(parts[1]); + var end = parseInt(parts[2]); + + var result = new Span(start, end - start, ""); + result.fileIndex = fileNumber; + return result; + } + + static fromReferenceLines(lines: string): Span[] { + var result: Span[] = []; + lines.split('\n').forEach(function(ln: string) { + if(ln) { + result.push(fromReferenceLine(ln)); + } + }); + return result; + } + + public toString(): string { + return '[File = ' + this.fileIndex + ', Start = ' + this.start + ', Length = ' + this.length + ', Content = "' + this.content + '"]'; + } + + public equals(other: Span) { + if(!other) return false; + // Don't check 'content' as that won't be populated in all cases (it's only for diagnostic purposes) + return other.start === this.start && + other.length === this.length && + other.fileIndex === this.fileIndex; + } +} + +function splitFile(contents: string): string[] { + var delimiterChar = '='; + var delimiterStr = delimiterChar + delimiterChar + delimiterChar + delimiterChar; + + var result: string[] = []; + + while(true) { + var delimIndex = contents.indexOf(delimiterStr); + if(delimIndex === -1) { + result.push(contents); + break; + } else { + result.push(contents.substr(0, delimIndex - 1)); + while(contents.charAt(delimIndex) === delimiterChar) { + delimIndex++; + } + contents = contents.substr(delimIndex); + } + } + + return result; +} + +function extractCodeSpans(code: string, outputSpans: Span[], caretPositions: Span[]): string { + var startTag = '[|'; + var endTag = '|]'; + var caretMarker = '^^'; + var result = code; + while(true) { + var caretIndex = result.indexOf(caretMarker); + var tagStartIndex = result.indexOf(startTag); + if(tagStartIndex === -1 && caretIndex === -1) break; // No more matches + + if(tagStartIndex != -1 && ((tagStartIndex < caretIndex) || (caretIndex === -1))) { + // Tag series is first + var tagEndIndex = result.indexOf(endTag, tagStartIndex + tagStartIndex.length); + if(tagEndIndex === -1) throw new Error('Unbalanced ' + startTag + '/' + endTag + ' pairs - expected to find a ' + startTag); + + var interiorStart = tagStartIndex + startTag.length; + var content = result.substr(interiorStart, tagEndIndex - interiorStart); + var contentCaretIndex = content.indexOf(caretMarker); + // Need to handle the case where there are caret[s] inside the tag markers + while(contentCaretIndex != -1) { + caretPositions.push(new Span(contentCaretIndex + tagStartIndex, 0, '')); + content = content.substring(0, contentCaretIndex) + content.substring(contentCaretIndex + caretMarker.length); + contentCaretIndex = content.indexOf(caretMarker); + } + + outputSpans.push(new Span(tagStartIndex, content.length, content)); + result = result.substr(0, tagStartIndex) + content + result.substr(tagEndIndex + endTag.length); + } else { + // Cursor marker is first + caretPositions.push(new Span(caretIndex, 0, '')); + result = result.substr(0, caretIndex) + result.substr(caretIndex + caretMarker.length); + } + } + + return result; +} + +var refFile = function(fn) { return Harness.userSpecifiedroot + 'tests/cases/unittests/services/testCode/references/' + fn; }; + +testFileForReferenceHighlighting(refFile('classLocal.ts')); + +testFileForReferenceHighlighting(refFile('classParameter.ts')); + +testFileForReferenceHighlighting(refFile('comment.ts')); + +testFileForReferenceHighlighting(refFile('functionOverloads.ts')); +testFileForReferenceHighlighting(refFile('functionParameter.ts')); + +testFileForReferenceHighlighting(refFile('illegalAssignment1.ts')); +testFileForReferenceHighlighting(refFile('illegalAssignment2.ts')); + +testFileForReferenceHighlighting(refFile('noContext.ts')); +testFileForReferenceHighlighting(refFile('referenceToClass.ts')); +testFileForReferenceHighlighting(refFile('static.ts')); diff --git a/tests/cases/unittests/services/getScriptLexicalStructure.ts b/tests/cases/unittests/services/getScriptLexicalStructure.ts new file mode 100644 index 0000000000000..a9a449d6bf069 --- /dev/null +++ b/tests/cases/unittests/services/getScriptLexicalStructure.ts @@ -0,0 +1,904 @@ +/// +describe('getScriptLexicalStructure', function () { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts'; + + typescriptLS.addFile(fileName); + + var __ls = typescriptLS.getLanguageService(); + + + function getScriptLexicalStructure(fileName: string): Services.NavigateToItem[] { + return __ls.languageService.getScriptLexicalStructure(fileName); + } + + describe('Get script lexical structure', function () { + it("Cover all kinds of structure elements", function () { + var result = getScriptLexicalStructure(fileName); + + // Note: This baseline can be easily regenerated by taking the output of the test + // resulting from the call to "assert.equal" below. + var baseline = +[ + { + "name": "Bar", + "kind": "module", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 0, + "limChar": 1501, + "containerName": "", + "containerKind": "" + }, + { + "name": "x", + "kind": "var", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 47, + "limChar": 61, + "containerName": "Bar", + "containerKind": "module" + }, + { + "name": "f", + "kind": "function", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 92, + "limChar": 114, + "containerName": "Bar", + "containerKind": "module" + }, + { + "name": "IFoo", + "kind": "interface", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 139, + "limChar": 411, + "containerName": "Bar", + "containerKind": "module" + }, + { + "name": "()", + "kind": "call", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 165, + "limChar": 183, + "containerName": "Bar.IFoo", + "containerKind": "interface" + }, + { + "name": "new()", + "kind": "construct", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 212, + "limChar": 225, + "containerName": "Bar.IFoo", + "containerKind": "interface" + }, + { + "name": "[]", + "kind": "index", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 264, + "limChar": 284, + "containerName": "Bar.IFoo", + "containerKind": "interface" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 312, + "limChar": 324, + "containerName": "Bar.IFoo", + "containerKind": "interface" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 363, + "limChar": 375, + "containerName": "Bar.IFoo", + "containerKind": "interface" + }, + { + "name": "Blah", + "kind": "enum", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 419, + "limChar": 491, + "containerName": "Bar", + "containerKind": "module" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 440, + "limChar": 447, + "containerName": "Bar.Blah", + "containerKind": "enum" + }, + { + "name": "Bar", + "kind": "class", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 499, + "limChar": 1498, + "containerName": "Bar", + "containerKind": "module" + }, + { + "name": "constructor", + "kind": "constructor", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 520, + "limChar": 556, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "barVar", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 532, + "limChar": 551, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "barProp", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 597, + "limChar": 620, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "barPropFunc", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 672, + "limChar": 702, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "getter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 747, + "limChar": 775, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "setter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 822, + "limChar": 844, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "barPropP", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 899, + "limChar": 924, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "barPropFuncP", + "kind": "method", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 974, + "limChar": 1006, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "getter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1049, + "limChar": 1079, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "setter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1124, + "limChar": 1148, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1201, + "limChar": 1220, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1276, + "limChar": 1298, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "getter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1351, + "limChar": 1378, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "setter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1426, + "limChar": 1447, + "containerName": "Bar.Bar", + "containerKind": "class" + }, + { + "name": "Bar2", + "kind": "module", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1505, + "limChar": 3051, + "containerName": "", + "containerKind": "" + }, + { + "name": "x", + "kind": "var", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1560, + "limChar": 1581, + "containerName": "Bar2", + "containerKind": "module" + }, + { + "name": "f", + "kind": "function", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1613, + "limChar": 1642, + "containerName": "Bar2", + "containerKind": "module" + }, + { + "name": "IFoo", + "kind": "interface", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1668, + "limChar": 1947, + "containerName": "Bar2", + "containerKind": "module" + }, + { + "name": "()", + "kind": "call", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1701, + "limChar": 1719, + "containerName": "Bar2.IFoo", + "containerKind": "interface" + }, + { + "name": "new()", + "kind": "construct", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1748, + "limChar": 1761, + "containerName": "Bar2.IFoo", + "containerKind": "interface" + }, + { + "name": "[]", + "kind": "index", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1800, + "limChar": 1820, + "containerName": "Bar2.IFoo", + "containerKind": "interface" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1848, + "limChar": 1860, + "containerName": "Bar2.IFoo", + "containerKind": "interface" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1899, + "limChar": 1911, + "containerName": "Bar2.IFoo", + "containerKind": "interface" + }, + { + "name": "Blah", + "kind": "enum", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1955, + "limChar": 2034, + "containerName": "Bar2", + "containerKind": "module" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 1983, + "limChar": 1990, + "containerName": "Bar2.Blah", + "containerKind": "enum" + }, + { + "name": "Bar", + "kind": "class", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2042, + "limChar": 3048, + "containerName": "Bar2", + "containerKind": "module" + }, + { + "name": "constructor", + "kind": "constructor", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2070, + "limChar": 2106, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "barVar", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2082, + "limChar": 2101, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "barProp", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2147, + "limChar": 2170, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "barPropFunc", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2222, + "limChar": 2252, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "getter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2297, + "limChar": 2325, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "setter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2372, + "limChar": 2394, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "barPropP", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2449, + "limChar": 2474, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "barPropFuncP", + "kind": "method", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2524, + "limChar": 2556, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "getter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2599, + "limChar": 2629, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "setter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2674, + "limChar": 2698, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2751, + "limChar": 2770, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2826, + "limChar": 2848, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "getter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2901, + "limChar": 2928, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "setter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 2976, + "limChar": 2997, + "containerName": "Bar2.Bar", + "containerKind": "class" + }, + { + "name": "Bar3", + "kind": "module", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3057, + "limChar": 3083, + "containerName": "", + "containerKind": "" + }, + { + "name": "Bar4", + "kind": "module", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3087, + "limChar": 4611, + "containerName": "", + "containerKind": "" + }, + { + "name": "x", + "kind": "var", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3134, + "limChar": 3156, + "containerName": "Bar4", + "containerKind": "module" + }, + { + "name": "f", + "kind": "function", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3179, + "limChar": 3206, + "containerName": "Bar4", + "containerKind": "module" + }, + { + "name": "IFoo", + "kind": "interface", + "kindModifiers": "", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3226, + "limChar": 3506, + "containerName": "Bar4", + "containerKind": "module" + }, + { + "name": "()", + "kind": "call", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3260, + "limChar": 3278, + "containerName": "Bar4.IFoo", + "containerKind": "interface" + }, + { + "name": "new()", + "kind": "construct", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3307, + "limChar": 3320, + "containerName": "Bar4.IFoo", + "containerKind": "interface" + }, + { + "name": "[]", + "kind": "index", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3359, + "limChar": 3379, + "containerName": "Bar4.IFoo", + "containerKind": "interface" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3407, + "limChar": 3419, + "containerName": "Bar4.IFoo", + "containerKind": "interface" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3458, + "limChar": 3470, + "containerName": "Bar4.IFoo", + "containerKind": "interface" + }, + { + "name": "Blah", + "kind": "enum", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3514, + "limChar": 3594, + "containerName": "Bar4", + "containerKind": "module" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "export", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3543, + "limChar": 3550, + "containerName": "Bar4.Blah", + "containerKind": "enum" + }, + { + "name": "Bar", + "kind": "class", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3602, + "limChar": 4608, + "containerName": "Bar4", + "containerKind": "module" + }, + { + "name": "constructor", + "kind": "constructor", + "kindModifiers": "declare", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3631, + "limChar": 3665, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "barVar", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3644, + "limChar": 3663, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "barProp", + "kind": "property", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3707, + "limChar": 3730, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "barPropFunc", + "kind": "method", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3782, + "limChar": 3809, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "getter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3857, + "limChar": 3882, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "prop1", + "kind": "setter", + "kindModifiers": "public", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 3932, + "limChar": 3951, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "barPropP", + "kind": "property", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4009, + "limChar": 4034, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "barPropFuncP", + "kind": "method", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4084, + "limChar": 4113, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "getter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4159, + "limChar": 4186, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "prop1P", + "kind": "setter", + "kindModifiers": "private", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4234, + "limChar": 4255, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "foo", + "kind": "property", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4311, + "limChar": 4330, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "bar", + "kind": "method", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4386, + "limChar": 4405, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "getter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4461, + "limChar": 4485, + "containerName": "Bar4.Bar", + "containerKind": "class" + }, + { + "name": "foo2", + "kind": "setter", + "kindModifiers": "public,static", + "matchKind": "exact", + "unitIndex": 1, + "minChar": 4536, + "limChar": 4554, + "containerName": "Bar4.Bar", + "containerKind": "class" + } +]; + var baselineText = JSON.stringify(baseline, null, " "); + var resultText = JSON.stringify(result, null, " "); + assert.notNull(result); + assert.equal(79, result.length); + assert.equal(baselineText, resultText); + }); + }); +}); + diff --git a/tests/cases/unittests/services/getSignatureAtPosition.ts b/tests/cases/unittests/services/getSignatureAtPosition.ts new file mode 100644 index 0000000000000..72bbf8ba6574d --- /dev/null +++ b/tests/cases/unittests/services/getSignatureAtPosition.ts @@ -0,0 +1,493 @@ +/// + +describe('getSignatureAtPosition', function () { + var mytypescriptLS = new Harness.TypeScriptLS(); + + mytypescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts'; + + mytypescriptLS.addFile(fileName); + mytypescriptLS.addFile(fileName2); + + var myls = mytypescriptLS.getLanguageService(); + + function singatureAtPos(line: number, col: number): Services.SignatureInfo { + return myls.languageService.getSignatureAtPosition(fileName, mytypescriptLS.lineColToPosition(fileName, line, col)); + } + + function singatureAtPos2(line: number, col: number): Services.SignatureInfo { + return myls.languageService.getSignatureAtPosition(fileName2, mytypescriptLS.lineColToPosition(fileName2, line, col)); + } + + describe('Get signatures from position', function () { + it("Comment", function () { + var result = singatureAtPos(1, 4); + assert.equal(null, result); + }); + + it("No Context", function () { + var result = singatureAtPos(2, 1); + assert.equal(null, result); + }); + + it("Construct expression", function () { + var result = singatureAtPos(3, 23); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("sampleCls", formal.name); + assert.equal(1, formal.signatureGroup.length); + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("str", formal.signatureGroup[0].parameters[0].name); + assert.equal("string", formal.signatureGroup[0].parameters[0].type); + assert.equal("num", formal.signatureGroup[0].parameters[1].name); + assert.equal("number", formal.signatureGroup[0].parameters[1].type); + assert.equal("sampleCls", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 22), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 29), actual.closeParenLimChar); + assert.equal(2, actual.parameters.length); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 23), actual.parameters[0].minChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 25), actual.parameters[0].limChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 27), actual.parameters[1].minChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 28), actual.parameters[1].limChar); + + assert.equal(0, result.activeFormal); + }); + + it("Wrong context", function () { + var result = singatureAtPos(4, 11); + assert.equal(null, result); + }); + + it("Call expression", function () { + var result = singatureAtPos(7, 8); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("fnTest", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("str", formal.signatureGroup[0].parameters[0].name); + assert.equal("string", formal.signatureGroup[0].parameters[0].type); + assert.equal("num", formal.signatureGroup[0].parameters[1].name); + assert.equal("number", formal.signatureGroup[0].parameters[1].type); + assert.equal("void", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 7), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 9), actual.closeParenLimChar); + assert.equal(0, actual.parameters.length); + + assert.equal(-1, result.activeFormal); + }); + + it("Overloaded function", function () { + var result = singatureAtPos(11, 12); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("fnOverload", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(0, formal.signatureGroup[0].parameters.length); + assert.equal("any", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("test", formal.signatureGroup[1].parameters[0].name); + assert.equal("string", formal.signatureGroup[1].parameters[0].type); + assert.equal("any", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 11), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 13), actual.closeParenLimChar); + assert.equal(0, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Overloaded function 2", function () { + var result = singatureAtPos(12, 12); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("fnOverload", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(0, formal.signatureGroup[0].parameters.length); + assert.equal("any", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("test", formal.signatureGroup[1].parameters[0].name); + assert.equal("string", formal.signatureGroup[1].parameters[0].type); + assert.equal("any", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 11), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 15), actual.closeParenLimChar); + assert.equal(1, actual.parameters.length); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 12), actual.parameters[0].minChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 14), actual.parameters[0].limChar); + + assert.equal(1, result.activeFormal); + }); + + it("Overloaded construct - before open paren", function () { + var result = singatureAtPos(15, 24); + assert.equal(null, result); + }); + + it("Overloaded construct - after close paren", function () { + var result = singatureAtPos(15, 26); + assert.equal(null, result); + }); + + it("Overloaded construct", function () { + var result = singatureAtPos(15, 25); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("clsOverload", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(0, formal.signatureGroup[0].parameters.length); + assert.equal("clsOverload", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("test", formal.signatureGroup[1].parameters[0].name); + assert.equal("string", formal.signatureGroup[1].parameters[0].type); + assert.equal("clsOverload", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 24), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 26), actual.closeParenLimChar); + + assert.equal(0, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Overloaded construct: call second overload", function () { + var result = singatureAtPos(16, 25); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("clsOverload", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(0, formal.signatureGroup[0].parameters.length); + assert.equal("clsOverload", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("test", formal.signatureGroup[1].parameters[0].name); + assert.equal("string", formal.signatureGroup[1].parameters[0].type); + assert.equal("clsOverload", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 24), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 28), actual.closeParenLimChar); + + assert.equal(1, actual.parameters.length); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 25), actual.parameters[0].minChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 27), actual.parameters[0].limChar); + + assert.equal(1, result.activeFormal); + }); + + it("Incomplete call (with statements after the incomple call)", function () { + var result = singatureAtPos(31, 14); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("f1", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(0, formal.signatureGroup[0].parameters.length); + assert.equal("void", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 31, 13), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); + + assert.equal(1, actual.parameters.length); + + assert.equal(-1, result.activeFormal); + }); + + it("Incomplete call 2 (inside another incomplete call)", function () { + var result = singatureAtPos(32, 14); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("f2", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(1, formal.signatureGroup[0].parameters.length); + assert.equal("n", formal.signatureGroup[0].parameters[0].name); + assert.equal("number", formal.signatureGroup[0].parameters[0].type); + assert.equal("void", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 32, 13), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); + + assert.equal(2, actual.parameters.length); + + assert.equal(-1, result.activeFormal); + }); + + it("Incomplete call 3 (close curly after incomplete call)", function () { + var result = singatureAtPos(33, 14); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("f3", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("n", formal.signatureGroup[0].parameters[0].name); + assert.equal("number", formal.signatureGroup[0].parameters[0].type); + assert.equal("s", formal.signatureGroup[0].parameters[1].name); + assert.equal("string", formal.signatureGroup[0].parameters[1].type); + assert.equal("void", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 33, 13), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); + + assert.equal(2, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Calling off a parameter function", function () { + var result = singatureAtPos(44, 22); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("callback", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("a", formal.signatureGroup[0].parameters[0].name); + assert.equal("number", formal.signatureGroup[0].parameters[0].type); + assert.equal("b", formal.signatureGroup[0].parameters[1].name); + assert.equal("string", formal.signatureGroup[0].parameters[1].type); + assert.equal("string", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 21), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 28), actual.closeParenLimChar); + + assert.equal(2, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Calling off a returned function", function () { + var result = singatureAtPos(53, 15); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("a", formal.signatureGroup[0].parameters[0].name); + assert.equal("number", formal.signatureGroup[0].parameters[0].type); + assert.equal("b", formal.signatureGroup[0].parameters[1].name); + assert.equal("string", formal.signatureGroup[0].parameters[1].type); + assert.equal("string", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 14), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 21), actual.closeParenLimChar); + + assert.equal(2, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Calling off a object literal property function", function () { + var result = singatureAtPos(58, 9); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("f", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("a", formal.signatureGroup[0].parameters[0].name); + assert.equal("number", formal.signatureGroup[0].parameters[0].type); + assert.equal("b", formal.signatureGroup[0].parameters[1].name); + assert.equal("string", formal.signatureGroup[0].parameters[1].type); + assert.equal("string", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 8), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 15), actual.closeParenLimChar); + + assert.equal(2, actual.parameters.length); + + assert.equal(0, result.activeFormal); + }); + + it("Calling off super constructor", function() { + var result = singatureAtPos(69, 19); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("base", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(1, formal.signatureGroup[0].parameters.length); + assert.equal("s", formal.signatureGroup[0].parameters[0].name); + assert.equal("string", formal.signatureGroup[0].parameters[0].type); + assert.equal("base", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("n", formal.signatureGroup[1].parameters[0].name); + assert.equal("number", formal.signatureGroup[1].parameters[0].type); + assert.equal("base", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 18), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 22), actual.closeParenLimChar); + + assert.equal(1, actual.parameters.length); + assert.equal(0, result.activeFormal); + }); + + it("Calling off super of super constructor", function() { + var result = singatureAtPos(79, 19); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("B2", formal.name); + assert.equal(2, formal.signatureGroup.length); + + assert.equal(1, formal.signatureGroup[0].parameters.length); + assert.equal("s", formal.signatureGroup[0].parameters[0].name); + assert.equal("string", formal.signatureGroup[0].parameters[0].type); + assert.equal("B2", formal.signatureGroup[0].returnType); + + assert.equal(1, formal.signatureGroup[1].parameters.length); + assert.equal("n", formal.signatureGroup[1].parameters[0].name); + assert.equal("number", formal.signatureGroup[1].parameters[0].type); + assert.equal("B2", formal.signatureGroup[1].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 18), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 22), actual.closeParenLimChar); + + assert.equal(1, actual.parameters.length); + assert.equal(0, result.activeFormal); + }); + }); + + describe('Get signatures at EOF', function () { + it("Function signature at EOF", function () { + var result = singatureAtPos2(5, 5); + assert.notNull(result); + + var formal = result.formal; + assert.notNull(formal); + + assert.equal(false, formal.isNew); + assert.equal("Foo", formal.name); + assert.equal(1, formal.signatureGroup.length); + + assert.equal(2, formal.signatureGroup[0].parameters.length); + assert.equal("arg1", formal.signatureGroup[0].parameters[0].name); + assert.equal("string", formal.signatureGroup[0].parameters[0].type); + assert.equal("arg2", formal.signatureGroup[0].parameters[1].name); + assert.equal("string", formal.signatureGroup[0].parameters[1].type); + assert.equal("void", formal.signatureGroup[0].returnType); + + var actual = result.actual; + assert.notNull(actual); + + assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 4), actual.openParenMinChar); + assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 5), actual.closeParenLimChar); + assert.equal(0, actual.currentParameter); + + assert.equal(1, actual.parameters.length); + + assert.equal(-1, result.activeFormal); + }); + }); +}); \ No newline at end of file diff --git a/tests/cases/unittests/services/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/getSmartIndentAtLineNumber.ts new file mode 100644 index 0000000000000..52e7982bd4a59 --- /dev/null +++ b/tests/cases/unittests/services/getSmartIndentAtLineNumber.ts @@ -0,0 +1,410 @@ +/// + +describe('getSmartIndentAtLineNumber', function() { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts'; + var fileName3 = 'tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts'; + + typescriptLS.addFile(fileName); + typescriptLS.addFile(fileName2); + typescriptLS.addFile(fileName3); + + var ls = typescriptLS.getLanguageService(); + + // + // line is 1-based + // + function getSmartIndent(fileName: string, line: number): number { + assert.is(line >= 1); + var options = new Services.EditorOptions(); + var position = typescriptLS.lineColToPosition(fileName, line, 1); + return ls.languageService.getSmartIndentAtLineNumber(fileName, position, options); + } + + describe("test cases for smart indent", function() { + + it("smart indent inside module", function() { + var result = getSmartIndent(fileName, 2); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside class", function() { + var result = getSmartIndent(fileName, 4); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after property in class", function() { + var result = getSmartIndent(fileName, 6); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent inside method in class ", function() { + var result = getSmartIndent(fileName, 9); + + assert.notNull(result); + assert.equal(12, result); + }); + + it("smart indent after after method in class", function() { + var result = getSmartIndent(fileName, 12); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after class", function() { + var result = getSmartIndent(fileName, 17); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent in interface", function() { + var result = getSmartIndent(fileName, 19); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after property in interface", function() { + var result = getSmartIndent(fileName, 21); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after method in interface", function() { + var result = getSmartIndent(fileName, 23); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after interface", function() { + var result = getSmartIndent(fileName, 25); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent in nested module", function() { + var result = getSmartIndent(fileName, 27); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after function in nested module", function() { + var result = getSmartIndent(fileName, 30); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after variable in nested module", function() { + var result = getSmartIndent(fileName, 32); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after nested module", function() { + var result = getSmartIndent(fileName, 34); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent in enum", function() { + var result = getSmartIndent(fileName, 36); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after variable in enum", function() { + var result = getSmartIndent(fileName, 38); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after 2nd variable in enum", function() { + var result = getSmartIndent(fileName, 40); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after enum", function() { + var result = getSmartIndent(fileName, 42); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent after module", function() { + var result = getSmartIndent(fileName, 44); + + assert.notNull(result); + assert.equal(0, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent after an aligned function argument", function() { + var result = getSmartIndent(fileName, 47); + + assert.notNull(result); + assert.equal(13, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent inside a 'for' statement", function() { + var result = getSmartIndent(fileName, 53); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after a 'for' statement", function() { + var result = getSmartIndent(fileName, 55); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside a 'for in' statement", function() { + var result = getSmartIndent(fileName, 57); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after a 'for in' statement", function() { + var result = getSmartIndent(fileName, 59); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside a 'with' statement", function() { + var result = getSmartIndent(fileName, 61); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after a 'with' statement", function() { + var result = getSmartIndent(fileName, 63); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside a 'switch' statement", function() { + var result = getSmartIndent(fileName, 65); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after a 'switch' statement", function() { + var result = getSmartIndent(fileName, 67); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside a 'break' statement", function() { + var result = getSmartIndent(fileName, 69); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after a 'break' statement", function() { + var result = getSmartIndent(fileName, 71); + + assert.notNull(result); + assert.equal(12, result); + }); + + it("smart indent after a 'break' statement", function() { + var result = getSmartIndent(fileName, 73); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after last 'switch' statement", function() { + var result = getSmartIndent(fileName, 75); + + assert.notNull(result); + assert.equal(4, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent before 'try' in 'try/catch' statement", function() { + var result = getSmartIndent(fileName, 79); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent insde 'try' in 'try/catch' statement", function() { + var result = getSmartIndent(fileName, 81); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent before 'catch' in 'try/catch' statement", function() { + var result = getSmartIndent(fileName, 83); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside 'catch' in 'try/catch' statement", function() { + var result = getSmartIndent(fileName, 85); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after 'catch' in 'try/catch' statement", function() { + var result = getSmartIndent(fileName, 87); + + assert.notNull(result); + assert.equal(4, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent before 'try' in 'try/finally' statement", function() { + var result = getSmartIndent(fileName, 92); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent insde 'try' in 'try/finally' statement", function() { + var result = getSmartIndent(fileName, 94); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent before 'finally' in 'try/finally' statement", function() { + var result = getSmartIndent(fileName, 96); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside 'finally' in 'try/finally' statement", function() { + var result = getSmartIndent(fileName, 98); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after 'finally' in 'try/finally' statement", function() { + var result = getSmartIndent(fileName, 100); + + assert.notNull(result); + assert.equal(4, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent before 'try' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 104); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent insde 'try' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 106); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent before 'catch' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 108); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside 'catch' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 110); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent before 'finally' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 112); + + assert.notNull(result); + assert.equal(4, result); + }); + + it("smart indent inside 'finally' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 114); + + assert.notNull(result); + assert.equal(8, result); + }); + + it("smart indent after 'finally' in 'try/catch/finally' statement", function() { + var result = getSmartIndent(fileName, 116); + + assert.notNull(result); + assert.equal(4, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent inside a block inside case", function() { + var result = getSmartIndent(fileName, 127); + + assert.notNull(result); + assert.equal(20, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent works for a non terminated argument list at the end of a file", function() { + var result = getSmartIndent(fileName2, 8); + + assert.notNull(result); + assert.equal(4, result); + }); + + /////////////////////////////////////////////////////////////////////// + + it("smart indent works for a non terminated if statement at the end of a file", function() { + var result = getSmartIndent(fileName3, 7); + + assert.notNull(result); + assert.equal(4, result); + }); + }); +}); diff --git a/tests/cases/unittests/services/importedJavaScriptFormatting.ts b/tests/cases/unittests/services/importedJavaScriptFormatting.ts new file mode 100644 index 0000000000000..2fcb997767840 --- /dev/null +++ b/tests/cases/unittests/services/importedJavaScriptFormatting.ts @@ -0,0 +1,212 @@ +/// +/// + +interface DocumentTestJson { + input: string; + rules: string[]; + span: { start: number; length: number; }; + expected: string; +} + +interface FormatOperationTestJson { + input: string; + operations: { + operation: string; + point: { position: number; }; + span: { start: number; length: number; }; + }[]; + expected: string; +} + +function markupCodeForHtml(code: string) { + var formatted = code.replace(/'); + var escaped = encodeURIComponent(code).replace(/'/g, '%27'); + + return formatted + '
Copy'; +} + +describe('importedJavaScriptFormatting - formatting rules', function() { + var documentTests: DocumentTestJson[] = eval('[' + IO.readFile(Harness.userSpecifiedroot + 'tests/cases/unittests/services/documentFormattingTests.json').contents() + ']'); + + var outputFile = 'diff-1.html'; + IO.writeFile(outputFile, IO.readFile(Harness.userSpecifiedroot + 'tests/cases/unittests/services/formatDiffTemplate.html').contents(), false); + + var checkTest = function(test: DocumentTestJson) { + var filename = 'temp.ts'; + var typescriptLS = new Harness.TypeScriptLS(); + typescriptLS.addScript(filename, test.input); + + var ls = typescriptLS.getLanguageService().languageService; + + var unsupportedRules = []; + var ruleMap = { + 'SpaceAfterSemicolonInFor': 'InsertSpaceAfterSemicolonInForStatements', + 'SpaceAfterComma': 'InsertSpaceAfterCommaDelimiter', + 'NewLineBeforeOpenCurlyInControl': 'PlaceOpenBraceOnNewLineForControlBlocks', + 'NewLineBeforeOpenCurlyInFunction': 'PlaceOpenBraceOnNewLineForFunctions' + }; + + var options = new Services.FormatCodeOptions(); + if (test.rules.indexOf('SpaceBeforeBinaryOperator') >= 0 && test.rules.indexOf('SpaceAfterBinaryOperator') >= 0) { + test.rules.splice(test.rules.indexOf('SpaceBeforeBinaryOperator'), 1); + test.rules.splice(test.rules.indexOf('SpaceAfterBinaryOperator'), 1); + options.InsertSpaceBeforeAndAfterBinaryOperators = true; + } + + test.rules.forEach(ruleName => { + if (options[ruleName] !== undefined) { + // The options struct has a matching property, just set it directly + options[ruleName] = true; + } else { + if (ruleMap[ruleName] !== undefined) { + // We have a remapping of this name, use that instead + options[ruleMap[ruleName]] = true; + } else { + if (ruleName.indexOf('No') === 0) { + // This is a 'NoFoo', set 'Foo' to false + options[ruleMap[ruleName.substr(2)]] = false; + } else { + // ?? + IO.printLine('Unsupported rule name ' + ruleName); + return; + } + } + } + }); + + var edits = ls.getFormattingEditsForRange(filename, test.span.start, test.span.start + test.span.length, options); + + var output = typescriptLS.applyEdits(test.input, edits); + + // Normalize line endings + output = output.replace(/\r\n/g, '\n'); + test.expected = test.expected.replace(/\r\n/g, '\n'); + + if (output != test.expected) { + var outputHtml = ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += '
InputOutputExpected
' + markupCodeForHtml(test.input) + '' + markupCodeForHtml(output) + '' + markupCodeForHtml(test.expected) + '
Format from character ' + test.span.start + ' to ' + (test.span.start + test.span.length) + ' with rules: ' + test.rules.join(', ') + '
'; // test-table + + IO.writeFile(outputFile, IO.readFile(outputFile).contents() + outputHtml, false); + + // TODO: Uncomment when things are working + // throw new Error("Formatting failed - refer to diff-1.html"); + } + } + + var i = 0; + + for (var i = 0; i < documentTests.length; i++) { + var test = documentTests[i]; + + var msg = 'formats the code (index ' + i + ') from ' + test.span.start + ' to ' + (test.span.start + test.span.length) + ' with rules = [' + test.rules.join(', ') + '] correctly'; + it(msg, function(t) { + return function() { + checkTest(t); + } + }(test)); + } +}); + +describe('importedJavaScriptFormatting - formatting operations', function() { + var outputFile = 'diff-2.html'; + IO.writeFile(outputFile, IO.readFile(Harness.userSpecifiedroot + 'tests/cases/unittests/services/formatDiffTemplate.html').contents(), false); + + var checkTest = function(test: FormatOperationTestJson) { + var filename = 'temp.ts'; + var typescriptLS = new Harness.TypeScriptLS(); + typescriptLS.addScript(filename, test.input); + + var ls = typescriptLS.getLanguageService(); + + var operationsText = ''; + + var markedUpInput = test.input; + var output = test.input; + + for (var i = 0; i < test.operations.length; i++) { + var options = new Services.FormatCodeOptions(); + var op = test.operations[i]; + var edits: Services.TextEdit[]; + + if (op.operation === 'CloseBrace') { + edits = ls.languageService.getFormattingEditsAfterKeystroke(filename, op.point.position, '}', options); + operationsText += 'Format for } at position ' + op.point.position.toString(); + markedUpInput = markedUpInput.substring(0, op.point.position) + '✪' + markedUpInput.substring(op.point.position); + } else if (op.operation === 'Enter') { + edits = ls.languageService.getFormattingEditsAfterKeystroke(filename, op.point.position, '\n', options); + operationsText += 'Format for [enter] at position ' + op.point.position.toString(); + markedUpInput = markedUpInput.substring(0, op.point.position) + '✪' + markedUpInput.substring(op.point.position); + } else if (op.operation === 'Semicolon') { + edits = ls.languageService.getFormattingEditsAfterKeystroke(filename, op.point.position, ';', options); + operationsText += 'Format for ; at position ' + op.point.position.toString(); + markedUpInput = markedUpInput.substring(0, op.point.position) + '✪' + markedUpInput.substring(op.point.position); + } else if (op.operation === 'Document') { + edits = ls.languageService.getFormattingEditsForRange(filename, 0, output.length, options); + operationsText += 'Format Document'; + } else if (op.operation === 'Selection') { + edits = ls.languageService.getFormattingEditsForRange(filename, op.span.start, op.span.start + op.span.length, options); + operationsText += 'Format selection from ' + op.span.start + ', length = ' + op.span.length; + } else if (op.operation === 'Paste') { + edits = ls.languageService.getFormattingEditsForRange(filename, op.span.start, op.span.start + op.span.length, options); + operationsText += 'Format pasted content from ' + op.span.start + ', length = ' + op.span.length; + } else { + throw new Error('Unknown operation: ' + op.operation); + } + + output = typescriptLS.applyEdits(test.input, edits); + typescriptLS.updateScript(filename, output); + } + + // Normalize line endings + output = output.replace(/\r\n/g, '\n'); + test.expected = test.expected.replace(/\r\n/g, '\n'); + + var outputHtml = ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += ''; + outputHtml += '
InputOutputExpected
' + markupCodeForHtml(markedUpInput) + '' + markupCodeForHtml(output) + '' + markupCodeForHtml(test.expected) + '
' + operationsText + '
'; // test-table + + if (test.expected == output) { + // Pass + } else { + IO.writeFile(outputFile, IO.readFile(outputFile).contents() + outputHtml, false); + // TODO: Uncomment when things are working + // throw new Error('Format test failed - refer to ' + outputFile); + } + } + + var operationsTests: FormatOperationTestJson[] = eval('[' + IO.readFile(Harness.userSpecifiedroot + 'tests/cases/unittests/services/ruleFormattingTests.json').contents() + ']'); + for (var i = 0; i < operationsTests.length; i++) { + var test = operationsTests[i]; + + var msg = 'formats the text correctly, line = ' + i; + it(msg, function(t) { + return function() { + checkTest(t); + } + }(test)); + } +}); + diff --git a/tests/cases/unittests/services/incrementalParser.ts b/tests/cases/unittests/services/incrementalParser.ts new file mode 100644 index 0000000000000..2cb20b0c9f21d --- /dev/null +++ b/tests/cases/unittests/services/incrementalParser.ts @@ -0,0 +1,103 @@ +/// + +module IncrementalParserTest { + export class State { + private fileName: string; + private typescriptLS: Harness.TypeScriptLS; + private ls: Services.ILanguageServiceShim; + private logger: TypeScript.BufferedLogger; + private parser: TypeScript.IncrementalParser; + private script: TypeScript.Script; + private newSourceText: TypeScript.IScriptSnapshot; + + public applyEditInRange(fileName, startLine, startCol, endLine, endCol, newText) { + this.initFileName(fileName); + + var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); + if (result === null) { + var sep = "\r\n | "; + throw new Error("Incremental parser should not have bailed out:" + sep + this.logger.logContents.join(sep)); + } + + this.assertTreesAreEqual(result); + } + + public assertBailout(fileName, startLine, startCol, endLine, endCol, newText) { + this.initFileName(fileName); + var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); + assert.is(result == null, "Incremental parser should have bailed out"); + } + + private applyIncrementalParser(startLine, startCol, endLine, endCol, newText): TypeScript.UpdateUnitResult { + var fileName = this.fileName; + var offset1 = this.typescriptLS.lineColToPosition(fileName, startLine, startCol); + var offset2 = this.typescriptLS.lineColToPosition(fileName, endLine, endCol); + var textEdit = new Services.TextEdit(offset1, offset2, newText); + var newContent = this.typescriptLS.applyEdits(this.typescriptLS.getScriptContent(1), [textEdit]); + this.newSourceText = new TypeScript.StringScriptSnapshot(newContent); + + var result = this.parser.attemptIncrementalUpdateUnit(this.script, fileName, this.newSourceText, + new TypeScript.TextChangeRange(TypeScript.TextSpan.fromBounds(offset1, offset2), newText.length)); + return result; + } + + private initFileName(fileName: string) { + this.fileName = fileName; + this.typescriptLS = this.createLS(fileName); + this.ls = this.typescriptLS.getLanguageService(); + this.logger = new TypeScript.BufferedLogger(); + this.parser = new TypeScript.IncrementalParser(this.logger); + this.script = this.ls.languageService.getScriptAST(fileName); + assert.notNull(this.script); + } + + private assertTreesAreEqual(result: TypeScript.UpdateUnitResult) { + assert.notNull(result); + this.parser.mergeTrees(result); + + var finalScript = result.script1; + var nonIncrementalScript = this.typescriptLS.parseSourceText(this.fileName, this.newSourceText); + + var logger1 = new TypeScript.BufferedLogger(); + var astLogger1 = new TypeScript.AstLogger(logger1); + astLogger1.logScript(finalScript); + + var logger2 = new TypeScript.BufferedLogger(); + var astLogger2 = new TypeScript.AstLogger(logger2); + astLogger2.logScript(nonIncrementalScript); + + var log1 = logger1.logContents.join("\r\n"); + var log2 = logger2.logContents.join("\r\n"); + + assert.noDiff(log1, log2); + } + + private createLS(fileName: string): Harness.TypeScriptLS { + var typescriptLS = new Harness.TypeScriptLS(); + typescriptLS.addDefaultLibrary(); + typescriptLS.addFile(fileName); + return typescriptLS; + } + } +} + +describe('incrementalParser tests', function () { + var fileName = 'tests/cases/unittests/services/testCode/incrementalParser.ts'; + var fileName2 = 'tests/cases/unittests/services/testCode/incrementalParser2.ts'; + + + describe('Incremental edits to unit', function () { + it("Simple delete inside a function should be incremental", function () { + new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 39, ""); + }); + it("Simple insert inside a function should be incremental", function () { + new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 6, "test-test-test"); + }); + }); + + describe('Bail out tests', function () { + it("Adding semicolon at end of interface function should force bailout", function () { + new IncrementalParserTest.State().assertBailout(fileName2, 4, 16, 4, 16, ";"); + }); + }); +}); \ No newline at end of file diff --git a/tests/cases/unittests/services/overridesCollector.ts b/tests/cases/unittests/services/overridesCollector.ts new file mode 100644 index 0000000000000..13251f5df6667 --- /dev/null +++ b/tests/cases/unittests/services/overridesCollector.ts @@ -0,0 +1,82 @@ +/// + +describe('overridesCollector', function () { + var typescriptLS = new Harness.TypeScriptLS(); + + typescriptLS.addDefaultLibrary(); + + var fileName = 'tests/cases/unittests/services/testCode/overridesCollector.ts'; + + typescriptLS.addFile(fileName); + + var ls = typescriptLS.getLanguageService(); + + + function getOverridesAtPos(fileName:string, line: number, col: number): Services.SymbolSet { + var pos = typescriptLS.lineColToPosition(fileName, line, col); + + var script = ls.languageService.getScriptAST(fileName); + assert.notNull(script); + + var sym = ls.languageService.getSymbolAtPosition(script, pos); + assert.notNull(sym); + + var symbolTree = ls.languageService.getSymbolTree(); + assert.notNull(symbolTree); + + var collector = new Services.OverridesCollector(symbolTree); + return collector.findMemberOverrides(sym); + } + + describe('Overrides Collector Simple Tests', function () { + it("Find method override from base class", function() { + var result = getOverridesAtPos(fileName, 3, 17); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + + it("Find method override from derived class", function() { + var result = getOverridesAtPos(fileName, 7, 17); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + + it("Find method override from derived interface", function() { + var result = getOverridesAtPos(fileName, 17, 10); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + + it("Find method override from base interface", function() { + var result = getOverridesAtPos(fileName, 14, 10); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + + it("Find interface method override from derived class", function() { + var result = getOverridesAtPos(fileName, 26, 17); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + + it("Find interface method override from base interface", function() { + var result = getOverridesAtPos(fileName, 23, 11); + assert.notNull(result); + assert.equal(2, result.getAll().length); + }); + }); + describe('Overrides Collector Complex Tests', function () { + it("Find field override in deep hierarchy", function() { + var result = getOverridesAtPos(fileName, 42, 12); + assert.notNull(result); + assert.equal(5, result.getAll().length); + }); + + it("Find method override in deep hierarchy", function() { + var result = getOverridesAtPos(fileName, 46, 13); + assert.notNull(result); + assert.equal(3, result.getAll().length); + }); + }); +}); + diff --git a/tests/cases/unittests/services/ruleFormattingTests.json b/tests/cases/unittests/services/ruleFormattingTests.json new file mode 100644 index 0000000000000..8f330156f616b --- /dev/null +++ b/tests/cases/unittests/services/ruleFormattingTests.json @@ -0,0 +1,284 @@ +{ input: "function a() {\r\nvar b = 0;//}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 31 } } ], expected: "function a() {\r\nvar b = 0;//}\r\n}" }, +{ input: "function foo() {\n do {\n } while (y < 10)\n\n}", operations: [ { operation: "Enter", point: { position: 50 } } ], expected: "function foo() {\n do {\n } while (y < 10)\n\n}" }, +{ input: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\r\n}\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 87 } } ], expected: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\r\n }\r\n\r\n}" }, +{ input: "function a() {\r\n return (\r\n {\r\n x: 0\r\n }\r\n}", operations: [ { operation: "CloseBrace", point: { position: 76 } } ], expected: "function a() {\r\n return (\r\n {\r\n x: 0\r\n }\r\n}" }, +{ input: " if ( a[\";\"])\r\nb++;", operations: [ { operation: "Semicolon", point: { position: 10 } } ], expected: " if ( a[\";\"])\r\nb++;" }, +{ input: "(function () {\r\n a({\r\n b: 0\r\n });\r\n\r\n})();", operations: [ { operation: "Enter", point: { position: 48 } } ], expected: "(function () {\r\n a({\r\n b: 0\r\n });\r\n\r\n})();" }, +{ input: "var obj={a:{b:2,c:{d:{e:{\r\n}}}}}", operations: [ { operation: "Enter", point: { position: 27 } } ], expected: "var obj = {\n a: {\n b: 2, c: {\n d: {\n e: {\r\n }\n }\n }\n }\n}" }, +{ input: "if(1)if(1)if(1)if(1)x+=2;", operations: [ { operation: "Semicolon", point: { position: 25 } } ], expected: "if (1) if (1) if (1) if (1) x += 2;" }, +{ input: "\r\nvar webclass = [\r\n { 'student':\r\n { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' }\r\n }\r\n]", operations: [ { operation: "Document" } ], expected: "\r\nvar webclass = [\r\n {\n 'student':\r\n { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' }\r\n }\r\n]" }, +{ input: "function f(x){ return x }\nwhile (f(true))\n y++;\n", operations: [ { operation: "Enter", point: { position: 51 } } ], expected: "function f(x){ return x }\nwhile (f(true))\n y++;\n" }, +{ input: "throw e;", operations: [ { operation: "Document" } ], expected: "throw e;" }, +{ input: "x = {\n a: 1,\n b: 1\n +\n // test\n 2\n}", operations: [ { operation: "Document" } ], expected: "x = {\n a: 1,\n b: 1\n +\n // test\n 2\n}" }, +{ input: "return 1;", operations: [ { operation: "Document" } ], expected: "return 1;" }, +{ input: "var x = [\n 1,\n 2,\n 3\n]", operations: [ { operation: "Document" } ], expected: "var x = [\n 1,\n 2,\n 3\n]" }, +{ input: "switch \r\n( a ){\r\n case 1:x+=2; break\r\n case 2:{\r\n }\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 9 } } ], expected: "switch\r\n(a) {\r\n case 1:x+=2; break\r\n case 2:{\r\n }\r\n}\r\n" }, +{ input: "if (a)\r\ntest;\r\nelse\r\nif (b)\r\ntest;\r\n", operations: [ { operation: "Enter", point: { position: 36 } } ], expected: "if (a)\r\ntest;\r\nelse\r\nif (b)\r\n test;\r\n" }, +{ input: "do{\r\ndo{\r\ndo{\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)", operations: [ { operation: "CloseBrace", point: { position: 16 } } ], expected: "do{\r\ndo{\r\n do {\r\n } while (a !== b)\r\n}while(a!==b)\r\n}while(a!==b)" }, +{ input: "label1:\r\nvar a;\r\nvar b;", operations: [ { operation: "Document" } ], expected: "label1:\r\n var a;\r\nvar b;" }, +{ input: "\r\nfunction a() {\r\nfunction test() // test\r\n{\r\nif (test) // test\r\n{\r\n}\r\n}\r\n}", operations: [ { operation: "Document" } ], expected: "\r\nfunction a() {\r\n function test() // test\r\n {\r\n if (test) // test\r\n {\r\n }\r\n }\r\n}" }, +{ input: "var obj = {\r\na:{\r\nb:2,c:{\r\nd: {\r\ne: function f() {\r\nreturn obj.a.c.d.e() +f();\r\n}\r\n}\r\n}\r\n}\r\n};", operations: [ { operation: "Semicolon", point: { position: 94 } } ], expected: "var obj = {\r\n a: {\r\n b: 2, c: {\r\n d: {\r\n e: function f() {\r\n return obj.a.c.d.e() + f();\r\n }\r\n }\r\n }\r\n }\r\n};" }, +{ input: "function f() {\r\n do{\r\nx++ }\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "function f() {\r\n do{\r\n x++\n }\r\n\r\n}" }, +{ input: "function foo (a, b, c)", operations: [ { operation: "Document" } ], expected: "function foo(a, b, c)" }, +{ input: "{ var b;\n}", operations: [ { operation: "Document" } ], expected: "{\n var b;\n}" }, +{ input: "var z = {\na: 1};", operations: [ { operation: "Document" } ], expected: "var z = {\n a: 1\n};" }, +{ input: "for (var i = 0; i < 10; i++)\n { var a\n}", operations: [ { operation: "Document" } ], expected: "for (var i = 0; i < 10; i++) {\n var a\n}" }, +{ input: "if (1)\n {\nvar a }", operations: [ { operation: "Document" } ], expected: "if (1) {\n var a\n}" }, +{ input: "while (1)\n { var a\n}", operations: [ { operation: "Document" } ], expected: "while (1) {\n var a\n}" }, +{ input: "do\n { var a\n} while (1)", operations: [ { operation: "Document" } ], expected: "do {\n var a\n} while (1)" }, +{ input: "for (var a in b)\n { var a\n}", operations: [ { operation: "Document" } ], expected: "for (var a in b) {\n var a\n}" }, +{ input: "with (x)\n { var a\n}", operations: [ { operation: "Document" } ], expected: "with (x) {\n var a\n}" }, +{ input: "try\n { var a\n} \ncatch (e)\n { var a\n} \nfinally\n {\n}", operations: [ { operation: "Document" } ], expected: "try {\n var a\n}\ncatch (e) {\n var a\n}\nfinally {\n}" }, +{ input: "switch (x)\n { case 1: { var a }\n}", operations: [ { operation: "Document" } ], expected: "switch (x) {\n case 1: { var a }\n}" }, +{ input: "function f()\n { var x\n}", operations: [ { operation: "Document" } ], expected: "function f() {\n var x\n}" }, +{ input: "if(1)if(1)if(1)if(1){x+=2\r\n}", operations: [ { operation: "CloseBrace", point: { position: 28 } } ], expected: "if (1) if (1) if (1) if (1) {\n x += 2\r\n}" }, +{ input: "switch (a){\r\n case 1: x += 2;\r\n case 2 : \r\n for (var i=0;i<10;i++)\r\ni --;\r\n}\r\n", operations: [ { operation: "Semicolon", point: { position: 84 } } ], expected: "switch (a){\r\n case 1: x += 2;\r\n case 2 : \r\n for (var i = 0; i < 10; i++)\r\n i--;\r\n}\r\n" }, +{ input: "do{for(var i=0;i<10;i++)i-=2}while(1!==1);", operations: [ { operation: "Semicolon", point: { position: 42 } } ], expected: "do { for (var i = 0; i < 10; i++) i -= 2 } while (1 !== 1);" }, +{ input: "for(var i=0;i<10;i++){for(var j=0;j<10;j++)\r\n{j-=i}}", operations: [ { operation: "Enter", point: { position: 45 } } ], expected: "for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10; j++)\r\n { j -= i }\n}" }, +{ input: "function f() {\r\nstring='string\\r\n line2' + 'other part'}", operations: [ { operation: "CloseBrace", point: { position: 63 } } ], expected: "function f() {\r\n string = 'string\\r\n line2' + 'other part'\n}" }, +{ input: "x =\r\n function ()\r\n{\r\n var a\r\n}", operations: [ { operation: "Document" } ], expected: "x =\r\n function () {\r\n var a\r\n }" }, +{ input: "if (a instanceof b) { }", operations: [ { operation: "Document" } ], expected: "if (a instanceof b) { }" }, +{ input: "do a++; while (0)", operations: [ { operation: "Document" } ], expected: "do a++; while (0)" }, +{ input: "foo\r\n(1, 2, 3)", operations: [ { operation: "Document" } ], expected: "foo\r\n(1, 2, 3)" }, +{ input: "if(1) //comment\r\n{\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "if (1) //comment\r\n{\r\n}\r\n" }, +{ input: "var x =\n [\n1\n]", operations: [ { operation: "Document" } ], expected: "var x =\n [\n1\n ]" }, +{ input: "\r\n{\r\n function f() {\r\n var s = 1\r\n }\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 59 } } ], expected: "\r\n{\r\n function f() {\r\n var s = 1\r\n }\r\n\r\n}" }, +{ input: "\r\ndefine(null,\r\n function test() {\r\nvar a;\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\ndefine(null,\r\n function test() {\r\n var a;\r\n }\r\n" }, +{ input: "x = [\r\n 1,\r\n\r\n]", operations: [ { operation: "Enter", point: { position: 15 } } ], expected: "x = [\r\n 1,\r\n\r\n]" }, +{ input: "var x =\n {\na: 1\n}", operations: [ { operation: "Document" } ], expected: "var x =\n {\n a: 1\n }" }, +{ input: "for(var i=0;i<10;i++){for(var j=0;j<10;j++){j-=i}}", operations: [ { operation: "CloseBrace", point: { position: 50 } } ], expected: "for (var i = 0; i < 10; i++) { for (var j = 0; j < 10; j++) { j -= i } }" }, +{ input: "function f()\n{\n for (a in b)\n a++;\n}", operations: [ { operation: "Semicolon", point: { position: 40 } } ], expected: "function f()\n{\n for (a in b)\n a++;\n}" }, +{ input: "if(x!=1^y===2) \r\nx+=2\r\n", operations: [ { operation: "Enter", point: { position: 25 } } ], expected: "if(x!=1^y===2) \r\n x += 2\r\n" }, +{ input: "if (1)\r\n if (1)\r\n x++\r\n else\r\n if (1)\r\n x--\r\nelse\r\n x+=2\r\n", operations: [ { operation: "Enter", point: { position: 81 } } ], expected: "if (1)\r\n if (1)\r\n x++\r\n else\r\n if (1)\r\n x--\r\n else\r\n x += 2\r\n" }, +{ input: "switch (a){\r\ncase 1 : x+=2 ; break;\r\n case 2:{\r\n }\r\n}\r\n", operations: [ { operation: "Semicolon", point: { position: 44 } } ], expected: "switch (a){\r\n case 1: x += 2; break;\r\n case 2:{\r\n }\r\n}\r\n" }, +{ input: "{ { {\r\n{\r\ntest\r\n}\r\n}\r\n}\r\n}", operations: [ { operation: "Selection", span: { start: 7, length: 19 } } ], expected: "{ { {\r\n {\r\n test\r\n }\r\n}\r\n}\r\n}" }, +{ input: "do {\r\n do {\r\n do {\r\n }while(a!==b)\r\n\r\n} while (a !== b)\r\n} while (a !== b)", operations: [ { operation: "Enter", point: { position: 55 } } ], expected: "do {\r\n do {\r\n do {\r\n }while(a!==b)\r\n\r\n } while (a !== b)\r\n} while (a !== b)" }, +{ input: "\r\nswitch (t) {\r\n case 1:\r\n{\r\ntest\r\n}\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\nswitch (t) {\r\n case 1:\r\n {\r\n test\r\n }\r\n}\r\n" }, +{ input: "if (true) {\r\n \r\n}", operations: [ { operation: "Document" } ], expected: "if (true) {\r\n\r\n}" }, +{ input: "for(var j=0;j<10;j++)\r\nj-=i;", operations: [ { operation: "Semicolon", point: { position: 28 } } ], expected: "for (var j = 0; j < 10; j++)\r\n j -= i;" }, +{ input: "function a() {\r\n function b() {\r\n //\r\n\r\n }\r\n}", operations: [ { operation: "Enter", point: { position: 48 } } ], expected: "function a() {\r\n function b() {\r\n //\r\n\r\n }\r\n}" }, +{ input: "if(1)if(1)if(1)if(1)x+=2\r\n", operations: [ { operation: "Enter", point: { position: 26 } } ], expected: "if (1) if (1) if (1) if (1) x += 2\r\n" }, +{ input: "do{do{do{}while(a!==b)}while(a!==b)}while(a!==b)\r\n", operations: [ { operation: "Enter", point: { position: 50 } } ], expected: "do { do { do { } while (a !== b) } while (a !== b) } while (a !== b)\r\n" }, +{ input: "foo(\r\n)", operations: [ { operation: "Document" } ], expected: "foo(\r\n)" }, +{ input: "function f() {\r\n'use strict';\r\n}", operations: [ { operation: "Semicolon", point: { position: 29 } } ], expected: "function f() {\r\n 'use strict';\r\n}" }, +{ input: "var x = function() {\n//comment\nreturn 1;\n}", operations: [ { operation: "Document" } ], expected: "var x = function () {\n //comment\n return 1;\n}" }, +{ input: " function foo4() {\r\n function foo5() {\r\n function foo6() {\r\n test1\r\n }\r\n test2\r\n }\r\n }", operations: [ { operation: "Selection", span: { start: 62, length: 120 } } ], expected: " function foo4() {\r\n function foo5() {\r\n function foo6() {\r\n test1\r\n }\r\n test2\r\n }\r\n }" }, +{ input: "do{\r\ndo{\r\ndo{\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)", operations: [ { operation: "CloseBrace", point: { position: 46 } } ], expected: "do {\r\n do {\r\n do {\r\n } while (a !== b)\r\n } while (a !== b)\r\n} while (a !== b)" }, +{ input: "if (true)\n// test\n test;", operations: [ { operation: "Document" } ], expected: "if (true)\n // test\n test;" }, +{ input: "function test() {\r\n return (\r\n function test() {\r\n test;\r\n }\r\n );\r\n}", operations: [ { operation: "Document" } ], expected: "function test() {\r\n return (\r\n function test() {\r\n test;\r\n }\r\n );\r\n}" }, +{ input: "for(var i=0;i<10;i++){\r\nfor(var j=0;j<10;j++){\r\nj-=i\r\n}}", operations: [ { operation: "CloseBrace", point: { position: 56 } } ], expected: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\r\n }\n}" }, +{ input: " var a = 0 ;", operations: [ { operation: "Semicolon", point: { position: 14 } } ], expected: "var a = 0;" }, +{ input: "var obj={a:{b:2,c:{d:\r\n{e:{}}}}}", operations: [ { operation: "Enter", point: { position: 23 } } ], expected: "var obj = {\n a: {\n b: 2, c: {\n d:\r\n { e: {} }\n }\n }\n}" }, +{ input: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n}finally {\r\nx+=2\r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 74 } } ], expected: "function foo() {\r\n try {\r\n x += 2\r\n }\r\n catch (e) {\r\n x += 2\r\n } finally {\r\n x += 2\r\n }\r\n}" }, +{ input: "var obj = {\r\na: {\r\nb: 2, c: {\r\nd: {\r\ne: function f() {\r\nreturn obj.a.c.d.e() + f();\r\n}\r\n}\r\n}\r\n}}", operations: [ { operation: "CloseBrace", point: { position: 96 } } ], expected: "var obj = {\r\n a: {\r\n b: 2, c: {\r\n d: {\r\n e: function f() {\r\n return obj.a.c.d.e() + f();\r\n }\r\n }\r\n }\r\n }\n}" }, +{ input: "if (x!=1^y===2){ x+=2}", operations: [ { operation: "CloseBrace", point: { position: 24 } } ], expected: "if (x != 1 ^ y === 2) { x += 2 }" }, +{ input: "function test() {\r\n var a;\r\n label:\r\n for (; ;)\r\n\r\n", operations: [ { operation: "Enter", point: { position: 58 } } ], expected: "function test() {\r\n var a;\r\n label:\r\n for (; ;)\r\n\r\n" }, +{ input: "for(var i=0;i<10;i++){for(var j=0;j<10;j++){\r\nj-=i}}", operations: [ { operation: "Enter", point: { position: 46 } } ], expected: "for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10; j++) {\r\n j -= i\n }\n}" }, +{ input: "do {\r\n for (var i = 0; i < 10; i++)\r\n i -= 2\r\n }\r\nwhile (1 !== 1)", operations: [ { operation: "Enter", point: { position: 67 } } ], expected: "do {\r\n for (var i = 0; i < 10; i++)\r\n i -= 2\r\n}\r\nwhile (1 !== 1)" }, +{ input: "{\r\n try {\r\n } catch (e) {\r\n }\r\n}", operations: [ { operation: "Document" } ], expected: "{\r\n try {\r\n } catch (e) {\r\n }\r\n}" }, +{ input: "{ { {\r\n{\r\n}\r\n}\r\n}\r\n}", operations: [ { operation: "Selection", span: { start: 7, length: 13 } } ], expected: "{ { {\r\n {\r\n }\r\n}\r\n}\r\n}" }, +{ input: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) {\r\nj -= i}}\r\n", operations: [ { operation: "Enter", point: { position: 78 } } ], expected: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\n }\n}\r\n" }, +{ input: "var a = {\r\n}", operations: [ { operation: "Document" } ], expected: "var a = {\r\n}" }, +{ input: "\r\n switch ( a ) {\r\n case 1: x+=2;\r\n case 2:{\r\n }\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 2 } } ], expected: "\r\nswitch (a) {\r\n case 1: x+=2;\r\n case 2:{\r\n }\r\n}\r\n" }, +{ input: "function a() {\r\nvar b = 0;//;\r\n}", operations: [ { operation: "Semicolon", point: { position: 31 } } ], expected: "function a() {\r\nvar b = 0;//;\r\n}" }, +{ input: "for (a in b) { }", operations: [ { operation: "Document" } ], expected: "for (a in b) { }" }, +{ input: "\r\n{\r\nfunction test(/* test */ a,\r\n /* test */ b\r\n /* test */) {\r\n// test\r\n}\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\n{\r\n function test(/* test */ a,\r\n /* test */ b\r\n /* test */) {\r\n // test\r\n }\r\n}\r\n" }, +{ input: " //\r\n", operations: [ { operation: "Enter", point: { position: 8 } } ], expected: "//\r\n" }, +{ input: " if ( a[\"}\"])\r\nb++;", operations: [ { operation: "CloseBrace", point: { position: 10 } } ], expected: " if ( a[\"}\"])\r\nb++;" }, +{ input: "$ ( document ) . ready ( function ( ) { \n alert ( \"i am ready\" ) ;\n } );", operations: [ { operation: "Semicolon", point: { position: 138 } } ], expected: "$(document).ready(function () {\n alert(\"i am ready\");\n});" }, +{ input: "function f() {\r\nvar s=\"string\";\r\n}", operations: [ { operation: "Semicolon", point: { position: 31 } } ], expected: "function f() {\r\n var s = \"string\";\r\n}" }, +{ input: "do{for(var i=0;i<10;i++)i-=2\r\n}while(1!==1)", operations: [ { operation: "Enter", point: { position: 30 } } ], expected: "do {\n for (var i = 0; i < 10; i++) i -= 2\r\n} while (1 !== 1)" }, +{ input: "do{\r\ndo{\r\n\r\ndo{\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)", operations: [ { operation: "Enter", point: { position: 12 } } ], expected: "do{\r\ndo{\r\n\r\n do {\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)" }, +{ input: "for(var i=0;i<10;i++){for(var j=0;j<10;j++){j-=i}}", operations: [ { operation: "CloseBrace", point: { position: 49 } } ], expected: "for (var i = 0; i < 10; i++) { for (var j = 0; j < 10; j++) { j -= i }}" }, +{ input: "var obj = {\r\na: {\r\nb: 2, c: {\r\nd: {\r\ne: function f() {\r\nreturn obj.a.c.d.e() + f();\r\n}\r\n}\r\n } \r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 99 } } ], expected: "var obj = {\r\na: {\r\n b: 2, c: {\r\n d: {\r\n e: function f() {\r\n return obj.a.c.d.e() + f();\r\n }\r\n }\r\n }\r\n}\r\n}" }, +{ input: "var a = 0 ;var b=0;var c = 0 ;", operations: [ { operation: "Paste", span: { start: 13, length: 7 } } ], expected: "var a = 0; var b = 0; var c = 0;" }, +{ input: "function a()\r\n{\r\n}", operations: [ { operation: "Enter", point: { position: 14 } } ], expected: "function a()\r\n{\r\n}" }, +{ input: " function test() { function foo() { function foo3() { function foo4() { function foo5() { function foo6()\r\n{\r\ntest\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}", operations: [ { operation: "Selection", span: { start: 110, length: 25 } } ], expected: " function test() { function foo() { function foo3() { function foo4() { function foo5() { function foo6()\r\n {\r\n test\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }" }, +{ input: " \r\nfunction a() { \r\n return; \r\n} \r\n ", operations: [ { operation: "Document" } ], expected: "\r\nfunction a() {\r\n return;\r\n}\r\n" }, +{ input: "foo(\r\n1, 2, 3)", operations: [ { operation: "Document" } ], expected: "foo(\r\n1, 2, 3)" }, +{ input: "function Init() {\r\n var a = [[1, 2],\r\n [3, 4],\r\n\r\n ];\r\n}", operations: [ { operation: "Enter", point: { position: 63 } } ], expected: "function Init() {\r\n var a = [[1, 2],\r\n [3, 4],\r\n\r\n ];\r\n}" }, +{ input: "\r\n //function start\r\n function abc() { }\r\n //function end\r\n", operations: [ { operation: "Document" } ], expected: "\r\n//function start\r\nfunction abc() { }\r\n//function end\r\n" }, +{ input: "for(var i=0;i<10;i++){\r\n for (var j = 0; j < 10; j++) {\r\nj-=i\r\n\r\n}\r\n}", operations: [ { operation: "Enter", point: { position: 66 } } ], expected: "for(var i=0;i<10;i++){\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\r\n\r\n}\r\n}" }, +{ input: "// JScript source code\r\nfunction adder(a, b) {\r\n ///Adds two numbers \r\n return a + b;\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 94 } } ], expected: "// JScript source code\r\nfunction adder(a, b) {\r\n ///Adds two numbers \r\n return a + b;\r\n}\r\n" }, +{ input: "x = {\r\n a: function() {\r\n},\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "x = {\r\n a: function() {\r\n },\r\n\r\n}" }, +{ input: "if(1)\r\n if(1)\r\n x++\r\n else\r\n if(1)\r\n x+=2\r\n else\r\nx+=2\r\n", operations: [ { operation: "Enter", point: { position: 94 } } ], expected: "if(1)\r\n if(1)\r\n x++\r\n else\r\n if(1)\r\n x+=2\r\n else\r\n x += 2\r\n" }, +{ input: "for (a in b) {\nx++;}\n", operations: [ { operation: "Enter", point: { position: 21 } } ], expected: "for (a in b) {\n x++;\n}\n" }, +{ input: "if(1)if(1)if(1)if(1){x+=2}", operations: [ { operation: "CloseBrace", point: { position: 26 } } ], expected: "if (1) if (1) if (1) if (1) { x += 2 }" }, +{ input: "if (x!=1^y===2){ x+=2\r\n}", operations: [ { operation: "CloseBrace", point: { position: 26 } } ], expected: "if (x != 1 ^ y === 2) {\n x += 2\r\n}" }, +{ input: "var d = new Date ()", operations: [ { operation: "Document" } ], expected: "var d = new Date()" }, +{ input: "do {\r\n} while (1 == 10);", operations: [ { operation: "Document" } ], expected: "do {\r\n} while (1 == 10);" }, +{ input: "string='string+=2';", operations: [ { operation: "Semicolon", point: { position: 19 } } ], expected: "string = 'string+=2';" }, +{ input: "function foo() {\r\n try {\r\n }\r\ncatch(e){\r\n } finally {\r\n }\r\n}", operations: [ { operation: "Enter", point: { position: 48 } } ], expected: "function foo() {\r\n try {\r\n }\r\n catch (e) {\r\n } finally {\r\n }\r\n}" }, +{ input: "try // comment\r\n{\r\n}\r\ncatch (e) // comment\r\n{\r\n}\r\nfinally // comment\r\n{\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "try // comment\r\n{\r\n}\r\ncatch (e) // comment\r\n{\r\n}\r\nfinally // comment\r\n{\r\n}\r\n" }, +{ input: "function f() {\r\n /**/ var x;\r\n}", operations: [ { operation: "Semicolon", point: { position: 39 } } ], expected: "function f() {\r\n /**/ var x;\r\n}" }, +{ input: "if (a)\r\ntest;\r\nelse if (b)\r\ntest;", operations: [ { operation: "Document" } ], expected: "if (a)\r\n test;\r\nelse if (b)\r\n test;" }, +{ input: "foo(1, 2, 3\r\n)", operations: [ { operation: "Document" } ], expected: "foo(1, 2, 3\r\n)" }, +{ input: "\r\nswitch (a){\r\n case 1: x++;\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\nswitch (a) {\r\n case 1: x++;\r\n}\r\n" }, +{ input: "x = {\r\n a: function () {\r\n\r\n }\r\n}", operations: [ { operation: "Enter", point: { position: 39 } } ], expected: "x = {\r\n a: function () {\r\n\r\n }\r\n}" }, +{ input: "switch (a) {\n case 1: b++;\n break;\n\n default: a++;\n break;\n}", operations: [ { operation: "Enter", point: { position: 45 } } ], expected: "switch (a) {\n case 1: b++;\n break;\n\n default: a++;\n break;\n}" }, +{ input: "string='string+=2;'", operations: [ { operation: "Semicolon", point: { position: 18 } } ], expected: "string='string+=2;'" }, +{ input: "function test() {\r\n function foo() {\r\n var a;\r\n// some\r\ncomment\r\n", operations: [ { operation: "Enter", point: { position: 66 } } ], expected: "function test() {\r\n function foo() {\r\n var a;\r\n // some\r\n comment\r\n" }, +{ input: "switch ( a ) {\r\n case 1: x+=2;\r\n case 2:{for(var i=0;i<10;i++){ \r\nx+=2;}\r\n }\r\n}", operations: [ { operation: "CloseBrace", point: { position: 89 } } ], expected: "switch (a) {\r\n case 1: x += 2;\r\n case 2: {\n for (var i = 0; i < 10; i++) {\r\n x += 2;\n }\r\n }\r\n}" }, +{ input: "do{\r\nfor(var i=0;i<10;i++)\r\ni-=2;\r\n}while(1!==1)", operations: [ { operation: "Semicolon", point: { position: 33 } } ], expected: "do{\r\n for (var i = 0; i < 10; i++)\r\n i -= 2;\r\n}while(1!==1)" }, +{ input: "\r\nfunction foo() {\r\n try{ } catch (e) { } finally { }\r\n\r\n\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 63 } } ], expected: "\r\nfunction foo() {\r\n try { } catch (e) { } finally { }\r\n\r\n\r\n}\r\n" }, +{ input: "do{for(var i=0;i<10;i++)\r\ni-=2}while(1!==1)", operations: [ { operation: "Enter", point: { position: 26 } } ], expected: "do {\n for (var i = 0; i < 10; i++)\r\n i -= 2\n} while (1 !== 1)" }, +{ input: "\r\n fun(\r\n {\r\n a: 1\r\n });\r\n", operations: [ { operation: "Document" } ], expected: "\r\nfun(\r\n {\r\n a: 1\r\n });\r\n" }, +{ input: "function f () //comment\r\n{\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "function f() //comment\r\n{\r\n}\r\n" }, +{ input: "function a(b) {\r\n var c = 0;\r\n if (b != null) {\r\n for (d in b) {\r\n }\r\n }\r\n}", operations: [ { operation: "CloseBrace", point: { position: 94 } } ], expected: "function a(b) {\r\n var c = 0;\r\n if (b != null) {\r\n for (d in b) {\r\n }\r\n }\r\n}" }, +{ input: "switch (a) {\r\n case 1:\r\n\r\n break;\r\n}", operations: [ { operation: "Enter", point: { position: 34 } } ], expected: "switch (a) {\r\n case 1:\r\n\r\n break;\r\n}" }, +{ input: " \r\n do{\r\n for(var i=0;i<10;i++)\r\n i -= 2\r\n}\r\nwhile (1 !== 1)", operations: [ { operation: "Enter", point: { position: 5 } } ], expected: "\r\ndo {\r\n for(var i=0;i<10;i++)\r\n i -= 2\r\n}\r\nwhile (1 !== 1)" }, +{ input: "function test() {\r\n label1:\r\nvar a\r\n\r\n var b;\r\n}", operations: [ { operation: "Enter", point: { position: 39 } } ], expected: "function test() {\r\n label1:\r\n var a\r\n\r\n var b;\r\n}" }, +{ input: "var x = {\n//comment\na: 1\n}", operations: [ { operation: "Document" } ], expected: "var x = {\n //comment\n a: 1\n}" }, +{ input: "for(var i=0;i<10;i++){\r\n\r\nfor(var j=0;j<10;j++){\r\nj-=i\r\n}\r\n}", operations: [ { operation: "Enter", point: { position: 26 } } ], expected: "for(var i=0;i<10;i++){\r\n\r\n for (var j = 0; j < 10; j++) {\r\nj-=i\r\n}\r\n}" }, +{ input: "if (true) {\r\n//\r\n} else if (false) {\r\n//\r\n} else\r\n if (true)\r\n//", operations: [ { operation: "Document" } ], expected: "if (true) {\r\n //\r\n} else if (false) {\r\n //\r\n} else\r\n if (true)\r\n //" }, +{ input: "x = [\n 1,\n 1\n +\n // test\n 2\n]", operations: [ { operation: "Document" } ], expected: "x = [\n 1,\n 1\n +\n // test\n 2\n]" }, +{ input: "var x =\n function() {\nreturn 1;\n}", operations: [ { operation: "Document" } ], expected: "var x =\n function () {\n return 1;\n }" }, +{ input: "function f() {\n var x }", operations: [ { operation: "Document" } ], expected: "function f() {\n var x\n}" }, +{ input: "switch (a) {\r\n case 1: b++;\r\n break ;\r\n\r\n default: a++;\r\n break;\r\n}", operations: [ { operation: "Enter", point: { position: 46 } } ], expected: "switch (a) {\r\n case 1: b++;\r\n break;\r\n\r\n default: a++;\r\n break;\r\n}" }, +{ input: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n} finally {\r\nx+=2\r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 32 } } ], expected: "function foo() {\r\n try {\r\n x += 2\r\n }\r\ncatch( e){\r\nx+=2\r\n} finally {\r\nx+=2\r\n}\r\n}" }, +{ input: "function f(a, b\n , c){\n}", operations: [ { operation: "CloseBrace", point: { position: 39 } } ], expected: "function f(a, b\n , c) {\n}" }, +{ input: "function add(a, b) { return a + b}", operations: [ { operation: "Document" } ], expected: "function add(a, b) { return a + b }" }, +{ input: "var a = 0 ;\r\n", operations: [ { operation: "Enter", point: { position: 15 } } ], expected: "var a = 0;\r\n" }, +{ input: "var a = function (b) {\r\nb = 0;\r\n}", operations: [ { operation: "CloseBrace", point: { position: 33 } } ], expected: "var a = function (b) {\r\n b = 0;\r\n}" }, +{ input: "\r\nif (\r\n test) {\r\n a;\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\nif (\r\n test) {\r\n a;\r\n}\r\n" }, +{ input: " var a = 0 ;\r\n var b = { } ;\r\n var c = false ;", operations: [ { operation: "Selection", span: { start: 18, length: 34 } } ], expected: " var a = 0 ;\r\n var b = {};\r\n var c = false ;" }, +{ input: "function a() {\r\n return (\r\n function () {\r\n return 0;\r\n }\r\n}", operations: [ { operation: "CloseBrace", point: { position: 93 } } ], expected: "function a() {\r\n return (\r\n function () {\r\n return 0;\r\n }\r\n}" }, +{ input: "function test() {\r\n label1:\r\n a();\r\n b()\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 59 } } ], expected: "function test() {\r\n label1:\r\n a();\r\n b()\r\n\r\n}" }, +{ input: "(function () {\r\n a({\r\n b: 0\r\n });\r\n})();", operations: [ { operation: "Document" } ], expected: "(function () {\r\n a({\r\n b: 0\r\n });\r\n})();" }, +{ input: "function a() {\r\n /**/ }", operations: [ { operation: "Document" } ], expected: "function a() {\r\n /**/\n}" }, +{ input: "for (var i = 0; i < 10; i++) {\r\n for (var j=0;j<10;j++) {\r\nj=i;\r\n }\r\n}", operations: [ { operation: "Semicolon", point: { position: 64 } } ], expected: "for (var i = 0; i < 10; i++) {\r\n for (var j=0;j<10;j++) {\r\n j = i;\r\n }\r\n}" }, +{ input: "function f() {\r\n var x; /*\r\n */ var y = 2;\r\n}", operations: [ { operation: "Document" } ], expected: "function f() {\r\n var x; /*\r\n */ var y = 2;\r\n}" }, +{ input: "foo (1, 2, 3)", operations: [ { operation: "Document" } ], expected: "foo(1, 2, 3)" }, +{ input: "if (typeof a == null);", operations: [ { operation: "Document" } ], expected: "if (typeof a == null);" }, +{ input: "function f() {\r\n var x = \"\\r\n \"; var y = 2;\r\n}", operations: [ { operation: "Document" } ], expected: "function f() {\r\n var x = \"\\r\n \"; var y = 2;\r\n}" }, +{ input: "void x;", operations: [ { operation: "Document" } ], expected: "void x;" }, +{ input: "function f() {\r\n string='string'\r\n }\r\n", operations: [ { operation: "Enter", point: { position: 44 } } ], expected: "function f() {\r\n string='string'\r\n}\r\n" }, +{ input: "do{\r\nfor(var i=0;i<10;i++)\r\ni-=2\r\n}while(1!==1);", operations: [ { operation: "Semicolon", point: { position: 48 } } ], expected: "do {\r\n for (var i = 0; i < 10; i++)\r\n i -= 2\r\n} while (1 !== 1);" }, +{ input: "function test() {\r\n return (\r\n {\r\n a: 1\r\n }\r\n );\r\n}", operations: [ { operation: "Document" } ], expected: "function test() {\r\n return (\r\n {\r\n a: 1\r\n }\r\n );\r\n}" }, +{ input: "for(var i=0;i<10;i++)\r\n{for(var j=0;j<10;j++){j-=i}}", operations: [ { operation: "Enter", point: { position: 23 } } ], expected: "for (var i = 0; i < 10; i++)\r\n{ for (var j = 0; j < 10; j++) { j -= i } }" }, +{ input: "for(var i=0;i<10;i++){\r\nfor(var j=0;j<10;j++){j-=i}}", operations: [ { operation: "Enter", point: { position: 24 } } ], expected: "for (var i = 0; i < 10; i++) {\r\n for (var j = 0; j < 10; j++) { j -= i }\n}" }, +{ input: "do{\r\nfor(var i=0;i<10;i++)\r\ni-=2\r\n}while(1!==1)\r\n", operations: [ { operation: "Enter", point: { position: 49 } } ], expected: "do{\r\nfor(var i=0;i<10;i++)\r\ni-=2\r\n} while (1 !== 1)\r\n" }, +{ input: "if(1===1\r\n&& 2===2)x+=2", operations: [ { operation: "Enter", point: { position: 10 } } ], expected: "if (1 === 1\r\n&& 2 === 2) x += 2" }, +{ input: "\r\n{\r\n\r\n/* test\r\n test2\r\n test3 */\r\nvar a,\r\n // test\r\n // test\r\n b;\r\n\r\nx = {\r\na: 1 +\r\n // test\r\n /* test\r\n test2 */\r\n 2\r\n}\r\n\r\na(1,\r\n 2). // test\r\n test(); /* test */\r\n\r\n/* test\r\n test2\r\n test3 */\r\nfunction foo(a, b,\r\n /* test\r\n test2\r\n test3 */\r\n c) {\r\n}\r\n\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\n{\r\n\r\n /* test\r\n test2\r\n test3 */\r\n var a,\r\n // test\r\n // test\r\n b;\r\n\r\n x = {\r\n a: 1 +\r\n // test\r\n /* test\r\n test2 */\r\n 2\r\n }\r\n\r\n a(1,\r\n 2). // test\r\n test(); /* test */\r\n\r\n /* test\r\n test2\r\n test3 */\r\n function foo(a, b,\r\n /* test\r\n test2\r\n test3 */\r\n c) {\r\n }\r\n\r\n}\r\n" }, +{ input: "\r\n for (var i = 0; i < 10\r\n ; i--) {\r\n test\r\n ;\r\n }\r\n", operations: [ { operation: "Document" } ], expected: "\r\nfor (var i = 0; i < 10\r\n ; i--) {\r\n test\r\n ;\r\n}\r\n" }, +{ input: "if (1)\r\n x++;\r\nelse if (1)\r\n x--;", operations: [ { operation: "Document" } ], expected: "if (1)\r\n x++;\r\nelse if (1)\r\n x--;" }, +{ input: "x = {\n get foo () {\n },\n set foo (val) {\n }\n};", operations: [ { operation: "Document" } ], expected: "x = {\n get foo() {\n },\n set foo(val) {\n }\n};" }, +{ input: "function foo\r\n(a, b, c) {\r\n}", operations: [ { operation: "Document" } ], expected: "function foo\r\n(a, b, c) {\r\n}" }, +{ input: "switch ( a ) {\r\n case 1: x+=2;\r\n case 2:{for(var i=0;i<10;i++){ \r\nx+=2;\r\n }}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 80 } } ], expected: "switch ( a ) {\r\n case 1: x+=2;\r\n case 2: {\n for (var i = 0; i < 10; i++) {\r\n x += 2;\r\n }\n }\r\n}" }, +{ input: "function f() {\r\n'use strict'}", operations: [ { operation: "CloseBrace", point: { position: 29 } } ], expected: "function f() {\r\n 'use strict'\n}" }, +{ input: "foo(1\r\n, 2, 3)", operations: [ { operation: "Document" } ], expected: "foo(1\r\n, 2, 3)" }, +{ input: "do{\r\ndo\r\n{\r\ndo{\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)", operations: [ { operation: "Enter", point: { position: 9 } } ], expected: "do{\r\n do\r\n {\r\ndo{\r\n}while(a!==b)\r\n}while(a!==b)\r\n}while(a!==b)" }, +{ input: "function Sum(a,b,c) {\r\n for(i=0,j=1,k=0,fib=1;i<5;i++,fib=j+k,k=j,j=fib) {\r\n var sparseArray = [1,,,,5]\r\n }\r\n}", operations: [ { operation: "Selection", span: { start: 49, length: 3 } } ], expected: "function Sum(a,b,c) {\r\n for (i = 0, j = 1, k = 0, fib = 1; i < 5; i++, fib = j + k, k = j, j = fib) {\r\n var sparseArray = [1,,,,5]\r\n }\r\n}" }, +{ input: "function a() {\r\n function b() {\r\n\r\n }\r\n}", operations: [ { operation: "Document" } ], expected: "function a() {\r\n function b() {\r\n\r\n }\r\n}" }, +{ input: "", operations: [ { operation: "Document" } ], expected: "" }, +{ input: "function a() {\r\nvar b=\"c\"\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 27 } } ], expected: "function a() {\r\n var b = \"c\"\r\n\r\n}" }, +{ input: " if ( a[\"\r\n\"])\r\nb++;", operations: [ { operation: "Enter", point: { position: 11 } } ], expected: "if ( a[\"\r\n\"])\r\nb++;" }, +{ input: "/* \r\n \r\n*/ ", operations: [ { operation: "Document" } ], expected: "/* \r\n \r\n*/" }, +{ input: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n}finally {\r\nx+=2\r\n}\r\n};", operations: [ { operation: "Semicolon", point: { position: 75 } } ], expected: "function foo() {\r\n try {\r\n x += 2\r\n }\r\n catch (e) {\r\n x += 2\r\n } finally {\r\n x += 2\r\n }\r\n};" }, +{ input: "if (1) if (1) a++;", operations: [ { operation: "Document" } ], expected: "if (1) if (1) a++;" }, +{ input: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n}finally {\r\nx+=2\r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 53 } } ], expected: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\n catch (e) {\r\n x += 2\r\n }finally {\r\nx+=2\r\n}\r\n}" }, +{ input: "function f() {\r\n'use strict'\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 30 } } ], expected: "function f() {\r\n 'use strict'\r\n\r\n}" }, +{ input: " \r\n ", operations: [ { operation: "Document" } ], expected: " \r\n " }, +{ input: "{ var b; }", operations: [ { operation: "Document" } ], expected: "{ var b; }" }, +{ input: "var z = {a: 1};", operations: [ { operation: "Document" } ], expected: "var z = { a: 1 };" }, +{ input: "var z =\n {a: 1};", operations: [ { operation: "Document" } ], expected: "var z =\n { a: 1 };" }, +{ input: "for (var i = 0; i < 10; i++) { var a }", operations: [ { operation: "Document" } ], expected: "for (var i = 0; i < 10; i++) { var a }" }, +{ input: "for (var i = 0; i < 10; i++)\n { var a }", operations: [ { operation: "Document" } ], expected: "for (var i = 0; i < 10; i++)\n{ var a }" }, +{ input: "if (1) { var a }", operations: [ { operation: "Document" } ], expected: "if (1) { var a }" }, +{ input: "if (1)\n { var a }", operations: [ { operation: "Document" } ], expected: "if (1)\n{ var a }" }, +{ input: "while (1) { var a }", operations: [ { operation: "Document" } ], expected: "while (1) { var a }" }, +{ input: "while (1)\n { var a }", operations: [ { operation: "Document" } ], expected: "while (1)\n{ var a }" }, +{ input: "do { var a } while (1)", operations: [ { operation: "Document" } ], expected: "do { var a } while (1)" }, +{ input: "do\n { var a }\n while (1)", operations: [ { operation: "Document" } ], expected: "do\n{ var a }\nwhile (1)" }, +{ input: "for (var a in b) { var a }", operations: [ { operation: "Document" } ], expected: "for (var a in b) { var a }" }, +{ input: "for (var a in b)\n { var a }", operations: [ { operation: "Document" } ], expected: "for (var a in b)\n{ var a }" }, +{ input: "with (x) { var a }", operations: [ { operation: "Document" } ], expected: "with (x) { var a }" }, +{ input: "with (x)\n { var a }", operations: [ { operation: "Document" } ], expected: "with (x)\n{ var a }" }, +{ input: "try { var a } \ncatch (e) { var a } \nfinally { }", operations: [ { operation: "Document" } ], expected: "try { var a }\ncatch (e) { var a }\nfinally { }" }, +{ input: "try\n { var a } \ncatch (e)\n { var a } \nfinally\n { }", operations: [ { operation: "Document" } ], expected: "try\n{ var a }\ncatch (e)\n{ var a }\nfinally\n{ }" }, +{ input: "switch (x) { case 1: { var a } }", operations: [ { operation: "Document" } ], expected: "switch (x) { case 1: { var a } }" }, +{ input: "switch (x)\n { case 1: { var a } }", operations: [ { operation: "Document" } ], expected: "switch (x)\n{ case 1: { var a } }" }, +{ input: "function f() { var x }", operations: [ { operation: "Document" } ], expected: "function f() { var x }" }, +{ input: "function f()\n\n { var x }", operations: [ { operation: "Document" } ], expected: "function f()\n\n{ var x }" }, +{ input: "function test() {\r\nlabel1:\r\nvar a;\r\nvar b;\r\n}", operations: [ { operation: "Document" } ], expected: "function test() {\r\n label1:\r\n var a;\r\n var b;\r\n}" }, +{ input: "{\n x =\nfunction () {\n };\n}", operations: [ { operation: "Document" } ], expected: "{\n x =\nfunction () {\n};\n}" }, +{ input: "switch (a){\r\n case 1: x+=2;\r\ncase 2 : { \r\nx+=2}\r\n}", operations: [ { operation: "Enter", point: { position: 49 } } ], expected: "switch (a){\r\n case 1: x+=2;\r\n case 2: {\r\n x += 2\n }\r\n}" }, +{ input: " // ;", operations: [ { operation: "Semicolon", point: { position: 7 } } ], expected: " // ;" }, +{ input: "// JScript source code\r\nfunction adder(a, b) {\r\n ///Adds two numbers \r\n return a + b;\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 115 } } ], expected: "// JScript source code\r\nfunction adder(a, b) {\r\n ///Adds two numbers \r\n return a + b;\r\n}\r\n" }, +{ input: "function foo4() {\r\n test;\r\n for (; ;) {\r\n test\r\n }\r\n}", operations: [ { operation: "Selection", span: { start: 46, length: 33 } } ], expected: "function foo4() {\r\n test;\r\n for (; ;) {\r\n test\r\n }\r\n}" }, +{ input: "if (a in b) { }", operations: [ { operation: "Document" } ], expected: "if (a in b) { }" }, +{ input: "\r\nfunction f() {\r\nlabel0:\r\nfor (var i = 0; i < 10; i++) {\r\nlabel1: {\r\nfor (var i = 0; i < 10; i++)\r\nx = 2;\r\nlabel2:\r\nfor (var i = 0; i < 10; i++) {\r\nbreak label2\r\n}\r\n}\r\n}\r\n}", operations: [ { operation: "Document" } ], expected: "\r\nfunction f() {\r\n label0:\r\n for (var i = 0; i < 10; i++) {\r\n label1: {\r\n for (var i = 0; i < 10; i++)\r\n x = 2;\r\n label2:\r\n for (var i = 0; i < 10; i++) {\r\n break label2\r\n }\r\n }\r\n }\r\n}" }, +{ input: "function f() {\r\nstring='string'}", operations: [ { operation: "CloseBrace", point: { position: 32 } } ], expected: "function f() {\r\n string = 'string'\n}" }, +{ input: "\r\nfunction a() {\r\nfunction test() /* test */\r\n{\r\nif (test) /* test */\r\n{\r\n}\r\n}\r\n}", operations: [ { operation: "Document" } ], expected: "\r\nfunction a() {\r\n function test() /* test */ {\r\n if (test) /* test */ {\r\n }\r\n }\r\n}" }, +{ input: "that = {\r\n method: function () {\r\n return this.datum;\r\n } , \r\n\r\n datum: 0\r\n};", operations: [ { operation: "Enter", point: { position: 98 } } ], expected: "that = {\r\n method: function () {\r\n return this.datum;\r\n },\r\n\r\n datum: 0\r\n};" }, +{ input: "for (; ;)\n// test\n test;", operations: [ { operation: "Document" } ], expected: "for (; ;)\n // test\n test;" }, +{ input: "(function () {\r\n a({\r\n b: 0\r\n });\r\n\r\n})();", operations: [ { operation: "Enter", point: { position: 50 } } ], expected: "(function () {\r\n a({\r\n b: 0\r\n });\r\n\r\n})();" }, +{ input: "var f = function () {\n mycanvas.onmousedown = function () {\n };\n\n}", operations: [ { operation: "Enter", point: { position: 70 } } ], expected: "var f = function () {\n mycanvas.onmousedown = function () {\n };\n\n}" }, +{ input: "var obj={a:{b:2,c:{d:{e:{}}}}};", operations: [ { operation: "Semicolon", point: { position: 31 } } ], expected: "var obj = { a: { b: 2, c: { d: { e: {} } } } };" }, +{ input: "if (1)\r\n x++;\r\nelse x--;", operations: [ { operation: "Document" } ], expected: "if (1)\r\n x++;\r\nelse x--;" }, +{ input: "do{\r\nfor(var i=0;i<10;i++)i-=2}while(1!==1)", operations: [ { operation: "Enter", point: { position: 5 } } ], expected: "do {\r\n for (var i = 0; i < 10; i++) i -= 2\n} while (1 !== 1)" }, +{ input: "switch (a){\r\n case 1,2,3:\r\n break;\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "switch (a) {\r\n case 1, 2, 3:\r\n break;\r\n}\r\n" }, +{ input: " foo(function (file) {\r\n return 0\r\n })\r\n .then(function (doc) {\r\n return 1\r\n });", operations: [ { operation: "Document" } ], expected: "foo(function (file) {\r\n return 0\r\n})\r\n .then(function (doc) {\r\n return 1\r\n });" }, +{ input: "var a = 1;\nvar f = function () {\n var b = 2;\n}\n", operations: [ { operation: "Enter", point: { position: 50 } } ], expected: "var a = 1;\nvar f = function () {\n var b = 2;\n}\n" }, +{ input: "do{for(var i=0;i<10;i++)i-=2}\r\nwhile(1!==1)", operations: [ { operation: "Enter", point: { position: 31 } } ], expected: "do { for (var i = 0; i < 10; i++) i -= 2 }\r\nwhile (1 !== 1)" }, +{ input: " function a( b,c ) \r\n {\r\n var d=0 ;\r\n }", operations: [ { operation: "Document" } ], expected: "function a(b, c) {\r\n var d = 0;\r\n}" }, +{ input: "function f() {\r\n /*\r\n */ var x\r\n\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 59 } } ], expected: "function f() {\r\n /*\r\n */ var x\r\n\r\n\r\n}" }, +{ input: "if (x!=1^y===2) x+=2\r\n", operations: [ { operation: "Enter", point: { position: 24 } } ], expected: "if (x != 1 ^ y === 2) x += 2\r\n" }, +{ input: "function f() {\n }", operations: [ { operation: "Enter", point: { position: 15 } } ], expected: "function f() {\n}" }, +{ input: "function test() {\r\n try { }\r\n catch (e) { }\r\n finally\r\n}", operations: [ { operation: "Document" } ], expected: "function test() {\r\n try { }\r\n catch (e) { }\r\n finally\r\n }" }, +{ input: "a = [\n // test\n foo(\n // test\n 1),\n 2\n];", operations: [ { operation: "Document" } ], expected: "a = [\n // test\n foo(\n // test\n 1),\n 2\n];" }, +{ input: "if (x!=1^y===2) x+=2;", operations: [ { operation: "Semicolon", point: { position: 23 } } ], expected: "if (x != 1 ^ y === 2) x += 2;" }, +{ input: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n}finally {\r\nx+=2\r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 71 } } ], expected: "function foo() {\r\ntry {\r\nx+=2\r\n}\r\ncatch( e){\r\nx+=2\r\n} finally {\r\n x += 2\r\n}\r\n}" }, +{ input: "switch (a) {\n case 1: b++;\n break;\n\n default: a++;\n break;\n}", operations: [ { operation: "Enter", point: { position: 46 } } ], expected: "switch (a) {\n case 1: b++;\n break;\n\n default: a++;\n break;\n}" }, +{ input: "function test() { }\r\n", operations: [ { operation: "Enter", point: { position: 27 } } ], expected: "function test() { }\r\n" }, +{ input: "delete x;", operations: [ { operation: "Document" } ], expected: "delete x;" }, +{ input: "\r\n{\r\n\r\nvar a,\r\n b;\r\n\r\nx = {\r\na: 1 +\r\n 2\r\n}\r\n\r\na(1,\r\n 2).\r\n test();\r\n\r\nfunction foo(a, b,\r\n c) {\r\n}\r\n\r\nfor (i = 0;\r\n i < 1;\r\n i++) {\r\n}\r\n\r\nfor (a\r\n in b) {\r\n}\r\n\r\nwhile (i +\r\n 2) {\r\n}\r\n\r\nswitch (i +\r\n 2) {\r\n\r\n case 1 +\r\n 3:\r\n break;\r\n}\r\n\r\ntry {\r\n}\r\ncatch (\r\n e) {\r\n}\r\n\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\n{\r\n\r\n var a,\r\n b;\r\n\r\n x = {\r\n a: 1 +\r\n 2\r\n }\r\n\r\n a(1,\r\n 2).\r\n test();\r\n\r\n function foo(a, b,\r\n c) {\r\n }\r\n\r\n for (i = 0;\r\n i < 1;\r\n i++) {\r\n }\r\n\r\n for (a\r\n in b) {\r\n }\r\n\r\n while (i +\r\n 2) {\r\n }\r\n\r\n switch (i +\r\n 2) {\r\n\r\n case 1 +\r\n 3:\r\n break;\r\n }\r\n\r\n try {\r\n }\r\n catch (\r\n e) {\r\n }\r\n\r\n}\r\n" }, +{ input: "function f() {\r\n do{\r\nx++ }\r\n}", operations: [ { operation: "CloseBrace", point: { position: 30 } } ], expected: "function f() {\r\n do {\r\n x++\n }\r\n}" }, +{ input: "do\r\n{for(var i=0;i<10;i++)i-=2}while(1!==1)", operations: [ { operation: "Enter", point: { position: 4 } } ], expected: "do\r\n{ for (var i = 0; i < 10; i++) i -= 2 } while (1 !== 1)" }, +{ input: "switch (a){\r\n case 1 :\r\n x+=2\r\n case 2:{\r\n }\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 28 } } ], expected: "switch (a){\r\n case 1:\r\n x += 2\r\n case 2:{\r\n }\r\n}\r\n" }, +{ input: "var x = [\n //comment\n 1,\n 2,\n 3\n]", operations: [ { operation: "Document" } ], expected: "var x = [\n //comment\n 1,\n 2,\n 3\n]" }, +{ input: "switch (a){\r\n case 1: x += 2;\r\n\r\ncase 1 : x+=2;\r\n}\r\n", operations: [ { operation: "Enter", point: { position: 36 } } ], expected: "switch (a){\r\n case 1: x += 2;\r\n\r\n case 1: x += 2;\r\n}\r\n" }, +{ input: " foo(function (file) {\r\n return 0\r\n }).then(function (doc) {\r\n return 1\r\n });", operations: [ { operation: "Document" } ], expected: "foo(function (file) {\r\n return 0\r\n}).then(function (doc) {\r\n return 1\r\n});" }, +{ input: "function f() {\r\nvar s=1 /**/;\r\n}", operations: [ { operation: "Semicolon", point: { position: 30 } } ], expected: "function f() {\r\n var s = 1 /**/;\r\n}" }, +{ input: "switch (a){\r\n case 1: x+=2;\r\n case 2:{\r\n }\r\n \r\n}", operations: [ { operation: "Enter", point: { position: 61 } } ], expected: "switch (a){\r\n case 1: x+=2;\r\n case 2:{\r\n }\r\n\r\n}" }, +{ input: "if(1)\r\nif(1)\r\nx++\r\nelse\r\nif(1)\r\nx+=2\r\nelse\r\nx+=2\r\n\r\n\r\n\r\n;", operations: [ { operation: "Semicolon", point: { position: 57 } } ], expected: "if (1)\r\n if (1)\r\n x++\r\n else\r\n if (1)\r\n x += 2\r\n else\r\n x += 2\r\n\r\n\r\n\r\n;" }, +{ input: "function a() {\r\nvar b = 0;//\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "function a() {\r\n var b = 0;//\r\n\r\n}" }, +{ input: "if (a)\r\ntest;\r\nelse\r\nif (b)\r\ntest;", operations: [ { operation: "Document" } ], expected: "if (a)\r\n test;\r\nelse\r\n if (b)\r\n test;" }, +{ input: "for(var j=0;j<10;j++)j-=i;", operations: [ { operation: "Semicolon", point: { position: 26 } } ], expected: "for (var j = 0; j < 10; j++) j -= i;" }, +{ input: "if(1)\r\nif(1)\r\nx++\r\nelse\r\nif(1)\r\nx+=2\r\nelse\r\nx+=2;", operations: [ { operation: "Semicolon", point: { position: 49 } } ], expected: "if (1)\r\n if (1)\r\n x++\r\n else\r\n if (1)\r\n x += 2\r\n else\r\n x += 2;" }, +{ input: "function test() {\r\n var a\r\n }", operations: [ { operation: "Document" } ], expected: "function test() {\r\n var a\r\n}" }, +{ input: "if (1) {\r\n} else { }", operations: [ { operation: "Document" } ], expected: "if (1) {\r\n} else { }" }, +{ input: "function f() {\r\n /*\r\n\r\n */\r\n}", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "function f() {\r\n /*\r\n\r\n */\r\n}" }, +{ input: "if (x!=1^y===2) \r\n x+=2", operations: [ { operation: "Enter", point: { position: 18 } } ], expected: "if (x != 1 ^ y === 2)\r\n x += 2" }, +{ input: "for (a in b) {\n for (c in d) {\n for (e in f) {\n for (q in w) {}}}}\n", operations: [ { operation: "Enter", point: { position: 88 } } ], expected: "for (a in b) {\n for (c in d) {\n for (e in f) {\n for (q in w) { }\n }\n }\n}\n" }, +{ input: "a=a+\nb+\n c+\n d +\ne +\nm+f;", operations: [ { operation: "Semicolon", point: { position: 100 } } ], expected: "a = a +\nb +\n c +\n d +\ne +\nm + f;" }, +{ input: "x = {\r\n get a() {\r\n\r\n }\r\n}", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "x = {\r\n get a() {\r\n\r\n }\r\n}" }, +{ input: "if(1)\r\n;", operations: [ { operation: "Enter", point: { position: 7 } } ], expected: "if (1)\r\n ;" }, +{ input: "function test() {\r\n return (\r\n [\r\n 1\r\n ]\r\n );\r\n}", operations: [ { operation: "Document" } ], expected: "function test() {\r\n return (\r\n [\r\n 1\r\n ]\r\n );\r\n}" }, +{ input: "string='string+=2\\r\n'", operations: [ { operation: "Enter", point: { position: 20 } } ], expected: "string = 'string+=2\\r\n'" }, +{ input: "if(1)\r\nif(1)\r\nx++\r\nelse\r\n{if(1)\r\nx+=2\r\nelse\r\nx+=2}", operations: [ { operation: "CloseBrace", point: { position: 50 } } ], expected: "if(1)\r\n if (1)\r\n x++\r\n else {\n if (1)\r\n x += 2\r\n else\r\n x += 2\n }" }, +{ input: " function test() { function foo() { function foo3() { function foo4() { function foo5() { function foo6()\r\n{\r\n}\r\n}\r\n}\r\n}\r\n}\r\n}", operations: [ { operation: "Selection", span: { start: 110, length: 19 } } ], expected: " function test() { function foo() { function foo3() { function foo4() { function foo5() { function foo6()\r\n {\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }" }, +{ input: "switch (a){\r\n case 1: x+=2;\r\n case 2 : { x+=2;}\r\n}\r\n", operations: [ { operation: "Semicolon", point: { position: 53 } } ], expected: "switch (a){\r\n case 1: x+=2;\r\n case 2: { x += 2;}\r\n}\r\n" }, +{ input: "// ", operations: [ { operation: "Document" } ], expected: "// " }, +{ input: "for(var i=0;\r\ni<10;i++){for(var j=0;j<10;j++){j-=i}}", operations: [ { operation: "Enter", point: { position: 14 } } ], expected: "for (var i = 0;\r\ni < 10; i++) { for (var j = 0; j < 10; j++) { j -= i } }" }, +{ input: "if (a) if (b) if (c) if (d)\r\ntest;", operations: [ { operation: "Document" } ], expected: "if (a) if (b) if (c) if (d)\r\n test;" }, +{ input: "do{for(var i=0;i<10;i++)i-=2}while(1!==1)", operations: [ { operation: "Semicolon", point: { position: 15 } } ], expected: "do { for (var i = 0;i<10;i++)i-=2}while(1!==1)" }, +{ input: "$ ( '#TextBox1' ) . unbind ( ) ;", operations: [ { operation: "Document" } ], expected: "$('#TextBox1').unbind();" }, +{ input: "do{do{do{}while(a!==b)}while(a!==b)}while(a!==b);", operations: [ { operation: "Semicolon", point: { position: 49 } } ], expected: "do { do { do { } while (a !== b) } while (a !== b) } while (a !== b);" }, +{ input: "do{for(var i=0;i<10;i++)i-=2;}while(1!==1)", operations: [ { operation: "Semicolon", point: { position: 29 } } ], expected: "do { for (var i = 0; i < 10; i++) i -= 2;}while(1!==1)" }, +{ input: "for(var i=0;i<10;i++){\r\nfor(var j=0;j<10;j++){\r\nj-=i\r\n}\r\n}", operations: [ { operation: "CloseBrace", point: { position: 55 } } ], expected: "for(var i=0;i<10;i++){\r\n for (var j = 0; j < 10; j++) {\r\n j -= i\r\n }\r\n}" }, +{ input: "function a() {\r\nfunction b() {\r\nfunction c() {\r\n}}}", operations: [ { operation: "CloseBrace", point: { position: 51 } } ], expected: "function a() {\r\n function b() {\r\n function c() {\r\n }\n }\n}" }, +{ input: " do do do do\r\n test;\r\n while (0)\r\n while (0)\r\n while (0)\r\n while (0)", operations: [ { operation: "Document" } ], expected: "do do do do\r\n test;\r\nwhile (0)\r\nwhile (0)\r\nwhile (0)\r\nwhile (0)" }, +{ input: "/**/ ", operations: [ { operation: "Document" } ], expected: "/**/" }, +{ input: "function a()\n{ var a\n}", operations: [ { operation: "Enter", point: { position: 21 } } ], expected: "function a()\n{\n var a\n}" }, +{ input: "for(var i=0;i<10;i++){for(var j=0;j<10;\r\nj++){j-=i}}", operations: [ { operation: "Enter", point: { position: 41 } } ], expected: "for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10;\r\n j++) { j -= i }\n}" }, +{ input: "function a() {\r\n if (true) {\r\n }\r\n\r\n}", operations: [ { operation: "Enter", point: { position: 40 } } ], expected: "function a() {\r\n if (true) {\r\n }\r\n\r\n}" }, +{ input: "string='string+=2'\r\n", operations: [ { operation: "Enter", point: { position: 20 } } ], expected: "string = 'string+=2'\r\n" }, +{ input: "for (a in b) {\r\nx++;}\r\n", operations: [ { operation: "Enter", point: { position: 23 } } ], expected: "for (a in b) {\r\n x++;\n}\r\n" }, +{ input: "var obj={a:{b:2,c:{\r\nd:{e:{}}}}}", operations: [ { operation: "Enter", point: { position: 21 } } ], expected: "var obj = {\n a: {\n b: 2, c: {\r\n d: { e: {} }\n }\n }\n}" }, +{ input: "\r\n// test\r\n\r\n{\r\n// test\r\n}\r\n\r\nfunction foo() {\r\n// test\r\n\r\nswitch (a) {\r\n// test\r\ncase 1:\r\n// test\r\ndefault:\r\n// test\r\n}\r\n\r\nif (false)\r\n// test\r\nifblock;\r\n\r\nif (false) {\r\n//test\r\n}\r\n\r\nif (false) test;\r\nelse\r\n// test\r\ntest;\r\n\r\nif (false) test;\r\nelse {\r\n// test\r\ntest;\r\n}\r\n\r\nfor (; ;)\r\n// test\r\ntest;\r\n\r\nfor (; ;) {\r\n// test\r\nforblock;\r\n}\r\n\r\nfor (a in b)\r\n// test\r\ntest;\r\n\r\nfor (a in b) {\r\n// test\r\ntest\r\n}\r\n\r\nwhile (false)\r\n// test\r\ntest;\r\n\r\nwhile (false) {\r\n// test\r\ntest;\r\n}\r\n\r\nwith (a) {\r\n// test\r\n}\r\n\r\ndo\r\n// test\r\ntestl\r\nwhile (false)\r\n\r\ndo {\r\n// test\r\ntest;\r\n} while (false)\r\n\r\ntry {\r\n// test\r\n} catch (e) {\r\n// test\r\n} finally {\r\n// test\r\n}\r\n\r\n(function () {\r\nvar a = function () {\r\nreturn 1;\r\n},\r\n// This is a comment inline with a multiline statement\r\nb = 2,\r\nc = 3;\r\n})();\r\n\r\n\r\nvar a = {\r\n// test\r\nx: 1,\r\ny: 2 +\r\n// test\r\n3 +\r\n4,\r\n}\r\n\r\n\r\nvar a,\r\n// test\r\nb;\r\n\r\nvar a = [\r\n// test\r\n1,\r\n2,\r\n3\r\n];\r\n\r\na = 1 +\r\n// test\r\n2;\r\n\r\n}\r\n", operations: [ { operation: "Document" } ], expected: "\r\n// test\r\n\r\n{\r\n // test\r\n}\r\n\r\nfunction foo() {\r\n // test\r\n\r\n switch (a) {\r\n // test\r\n case 1:\r\n // test\r\n default:\r\n // test\r\n }\r\n\r\n if (false)\r\n // test\r\n ifblock;\r\n\r\n if (false) {\r\n //test\r\n }\r\n\r\n if (false) test;\r\n else\r\n // test\r\n test;\r\n\r\n if (false) test;\r\n else {\r\n // test\r\n test;\r\n }\r\n\r\n for (; ;)\r\n // test\r\n test;\r\n\r\n for (; ;) {\r\n // test\r\n forblock;\r\n }\r\n\r\n for (a in b)\r\n // test\r\n test;\r\n\r\n for (a in b) {\r\n // test\r\n test\r\n }\r\n\r\n while (false)\r\n // test\r\n test;\r\n\r\n while (false) {\r\n // test\r\n test;\r\n }\r\n\r\n with (a) {\r\n // test\r\n }\r\n\r\n do\r\n // test\r\n testl\r\n while (false)\r\n\r\n do {\r\n // test\r\n test;\r\n } while (false)\r\n\r\n try {\r\n // test\r\n } catch (e) {\r\n // test\r\n } finally {\r\n // test\r\n }\r\n\r\n (function () {\r\n var a = function () {\r\n return 1;\r\n },\r\n // This is a comment inline with a multiline statement\r\n b = 2,\r\n c = 3;\r\n })();\r\n\r\n\r\n var a = {\r\n // test\r\n x: 1,\r\n y: 2 +\r\n // test\r\n 3 +\r\n 4,\r\n }\r\n\r\n\r\n var a,\r\n // test\r\n b;\r\n\r\n var a = [\r\n // test\r\n 1,\r\n 2,\r\n 3\r\n ];\r\n\r\n a = 1 +\r\n // test\r\n 2;\r\n\r\n}\r\n" }, +{ input: " \r\n /* \r\n\r\n a \r\n a\r\n a \r\n a \r\na \r\n \r\n\r\n */ \r\n ", operations: [ { operation: "Document" } ], expected: "\r\n/* \r\n\r\n a \r\n a\r\n a \r\na \r\na \r\n\r\n\r\n*/\r\n" }, +{ input: "string='{string +=2}'", operations: [ { operation: "CloseBrace", point: { position: 20 } } ], expected: "string='{string +=2}'" }, +{ input: "var obj={a:{b:2,c:{d:{e:{}}}}}\r\n", operations: [ { operation: "Enter", point: { position: 32 } } ], expected: "var obj = { a: { b: 2, c: { d: { e: {} } } } }\r\n" }, +{ input: "string='string\\r\n line2'+'other part'\r\n", operations: [ { operation: "Enter", point: { position: 47 } } ], expected: "string='string\\r\n line2' + 'other part'\r\n" }, +{ input: " switch( a)\r\n{case 1 :x+=2 ;break\r\n case 2:{\r\n }\r\n}", operations: [ { operation: "Enter", point: { position: 13 } } ], expected: "switch (a)\r\n{\n case 1: x += 2; break\r\n case 2:{\r\n }\r\n}" } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/classes.ts b/tests/cases/unittests/services/testCode/formatting/classes.ts new file mode 100644 index 0000000000000..e779f69810f04 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/classes.ts @@ -0,0 +1,79 @@ + class a { + constructor ( n : number ) ; + constructor ( s : string ) ; + constructor ( ns : any ) { + + } + + public pgF ( ) { } ; + + public pv ; + public get d ( ) { + return 30 ; + } + public set d ( ) { + } + + public static get p2 ( ) { + return { x : 30 , y : 40 } ; + } + + private static d2 ( ) { + } + private static get p3 ( ) { + return "string" ; + } + private pv3 ; + + private foo ( n : number ) : string ; + private foo ( s : string ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } +} + + class b extends a { +} + + class m1b { + +} + + interface m1ib { + + } + class c extends m1b { +} + + class ib2 implements m1ib { +} + + declare class aAmbient { + constructor ( n : number ) ; + constructor ( s : string ) ; + public pgF ( ) : void ; + public pv ; + public d : number ; + static p2 : { x : number ; y : number ; } ; + static d2 ( ) ; + static p3 ; + private pv3 ; + private foo ( s ) ; +} + + class d { + private foo ( n : number ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; +} + + class e { + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; + private foo ( n : number ) : string ; +} + diff --git a/tests/cases/unittests/services/testCode/formatting/classesBaseline.ts b/tests/cases/unittests/services/testCode/formatting/classesBaseline.ts new file mode 100644 index 0000000000000..e7e69b44125c4 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/classesBaseline.ts @@ -0,0 +1,79 @@ +class a { + constructor(n: number); + constructor(s: string); + constructor(ns: any) { + + } + + public pgF() { }; + + public pv; + public get d() { + return 30; + } + public set d() { + } + + public static get p2() { + return { x: 30, y: 40 }; + } + + private static d2() { + } + private static get p3() { + return "string"; + } + private pv3; + + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } +} + +class b extends a { +} + +class m1b { + +} + +interface m1ib { + +} +class c extends m1b { +} + +class ib2 implements m1ib { +} + +declare class aAmbient { + constructor(n: number); + constructor(s: string); + public pgF(): void; + public pv; + public d: number; + static p2: { x: number; y: number; }; + static d2(); + static p3; + private pv3; + private foo(s); +} + +class d { + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; +} + +class e { + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + private foo(n: number): string; +} + diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts b/tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts new file mode 100644 index 0000000000000..5562e14204602 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts @@ -0,0 +1,4 @@ +class foo { + constructor (n?: number, m? = 5, o?: string = "") { } + x:number = 1?2:3; +} diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts b/tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts new file mode 100644 index 0000000000000..52bbe56251d49 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts @@ -0,0 +1,4 @@ +class foo { + constructor(n?: number, m? = 5, o?: string = "") { } + x: number = 1 ? 2 : 3; +} diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts b/tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts new file mode 100644 index 0000000000000..35daa4d895c7d --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts @@ -0,0 +1,3 @@ +$ ( document ) . ready ( function ( ) { + alert ( 'i am ready' ) ; + } ); \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts b/tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts new file mode 100644 index 0000000000000..838ef682207a9 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts @@ -0,0 +1,3 @@ +$(document).ready(function() { + alert('i am ready'); +}); \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlock.ts b/tests/cases/unittests/services/testCode/formatting/emptyBlock.ts new file mode 100644 index 0000000000000..9e26dfeeb6e64 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/emptyBlock.ts @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts b/tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts new file mode 100644 index 0000000000000..6f31cf5a2e622 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts @@ -0,0 +1 @@ +{ } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts b/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts new file mode 100644 index 0000000000000..1feec453d03ca --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts @@ -0,0 +1,10 @@ + function foo ( x : { } ) { } + +foo ( { } ) ; + + + + interface bar { + x : { } ; + y : ( ) => { } ; + } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts b/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts new file mode 100644 index 0000000000000..04f3c0bc9b92f --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts @@ -0,0 +1,10 @@ +function foo(x: {}) { } + +foo({}); + + + +interface bar { + x: {}; + y: () => {}; +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts b/tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts new file mode 100644 index 0000000000000..ebbf54557fa23 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts @@ -0,0 +1,112 @@ +// valid + ( ) => 1 ; + ( arg ) => 2 ; + arg => 2 ; + ( arg = 1 ) => 3 ; + ( arg ? ) => 4 ; + ( arg : number ) => 5 ; + ( arg : number = 0 ) => 6 ; + ( arg ? : number ) => 7 ; + ( ... arg : number [ ] ) => 8 ; + ( arg1 , arg2 ) => 12 ; + ( arg1 = 1 , arg2 =3 ) => 13 ; + ( arg1 ? , arg2 ? ) => 14 ; + ( arg1 : number , arg2 : number ) => 15 ; + ( arg1 : number = 0 , arg2 : number = 1 ) => 16 ; + ( arg1 ? : number , arg2 ? : number ) => 17 ; + ( arg1 , ... arg2 : number [ ] ) => 18 ; + ( arg1 , arg2 ? : number ) => 19 ; + +// in paren + ( ( ) => 21 ) ; + ( ( arg ) => 22 ) ; + ( ( arg = 1 ) => 23 ) ; + ( ( arg ? ) => 24 ) ; + ( ( arg : number ) => 25 ) ; + ( ( arg : number = 0 ) => 26 ) ; + ( ( arg ? : number ) => 27 ) ; + ( ( ... arg : number [ ] ) => 28 ) ; + +// in multiple paren + ( ( ( ( ( arg ) => { return 32 ; } ) ) ) ) ; + +// in ternary exression + false ? ( ) => 41 : null ; + false ? ( arg ) => 42 : null ; + false ? ( arg = 1 ) => 43 : null ; + false ? ( arg ? ) => 44 : null ; + false ? ( arg : number ) => 45 : null ; + false ? ( arg ? : number ) => 46 : null ; + false ? ( arg ? : number = 0 ) => 47 : null ; + false ? ( ... arg : number [ ] ) => 48 : null ; + +// in ternary exression within paren + false ? ( ( ) => 51 ) : null ; + false ? ( ( arg ) => 52 ) : null ; + false ? ( ( arg = 1 ) => 53 ) : null ; + false ? ( ( arg ? ) => 54 ) : null ; + false ? ( ( arg : number ) => 55 ) : null ; + false ? ( ( arg ? : number ) => 56 ) : null ; + false ? ( ( arg ? : number = 0 ) => 57 ) : null ; + false ? ( ( ... arg : number [ ] ) => 58 ) : null ; + +// ternary exression's else clause + false ? null : ( ) => 61 ; + false ? null : ( arg ) => 62 ; + false ? null : ( arg = 1 ) => 63 ; + false ? null : ( arg ? ) => 64 ; + false ? null : ( arg : number ) => 65 ; + false ? null : ( arg ? : number ) => 66 ; + false ? null : ( arg ? : number = 0 ) => 67 ; + false ? null : ( ... arg : number [ ] ) => 68 ; + + +// nested ternary expressions + ( a ? ) => { return a ; } ? ( b ? ) => { return b ; } : ( c ? ) => { return c ; } ; + +//multiple levels + ( a ? ) => { return a ; } ? ( b ) => ( c ) => 81 : ( c ) => ( d ) => 82 ; + + +// In Expressions + ( ( arg ) => 90 ) instanceof Function ; + ( ( arg = 1 ) => 91 ) instanceof Function ; + ( ( arg ? ) => 92 ) instanceof Function ; + ( ( arg : number ) => 93 ) instanceof Function ; + ( ( arg : number = 1 ) => 94 ) instanceof Function ; + ( ( arg ? : number ) => 95 ) instanceof Function ; + ( ( ... arg : number [ ] ) => 96 ) instanceof Function ; + +'' + ( arg ) => 100 ; + ( ( arg ) => 0 ) + '' + ( arg ) => 101 ; + ( ( arg = 1 ) => 0 ) + '' + ( arg = 2 ) => 102 ; + ( ( arg ? ) => 0 ) + '' + ( arg ? ) => 103 ; + ( ( arg : number ) => 0 ) + '' + ( arg : number ) => 104 ; + ( ( arg : number = 1 ) => 0 ) + '' + ( arg : number = 2 ) => 105 ; + ( ( arg ? : number = 1 ) => 0 ) + '' + ( arg ? : number = 2 ) => 106 ; + ( ( ... arg : number [ ] ) => 0 ) + '' + ( ... arg : number [ ] ) => 107 ; + ( ( arg1 , arg2 ? ) => 0 ) + '' + ( arg1 , arg2 ? ) => 108 ; + ( ( arg1 , ... arg2 : number [ ] ) => 0 ) + '' + ( arg1 , ... arg2 : number [ ] ) => 108 ; + + +// Function Parameters +function foo ( ... arg : any [ ] ) { } + +foo ( + ( a ) => 110 , + ( ( a ) => 111 ) , + ( a ) => { + return 112 ; + } , + ( a ? ) => 113 , + ( a , b ? ) => 114 , + ( a : number ) => 115 , + ( a : number = 0 ) => 116 , + ( a = 0 ) => 117 , + ( a ? : number = 0 ) => 118 , + ( a ? , b ? : number = 0 ) => 118 , + ( ... a : number [ ] ) => 119 , + ( a , b ? = 0 , ... c : number [ ] ) => 120 , + ( a ) => ( b ) => ( c ) => 121 , + false ? ( a ) => 0 : ( b ) => 122 + ) ; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts b/tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts new file mode 100644 index 0000000000000..7a1ef86f5afda --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts @@ -0,0 +1,112 @@ +// valid +() => 1; +(arg) => 2; +arg => 2; +(arg = 1) => 3; +(arg?) => 4; +(arg: number) => 5; +(arg: number = 0) => 6; +(arg?: number) => 7; +(...arg: number[]) => 8; +(arg1, arg2) => 12; +(arg1 = 1, arg2 = 3) => 13; +(arg1?, arg2?) => 14; +(arg1: number, arg2: number) => 15; +(arg1: number = 0, arg2: number = 1) => 16; +(arg1?: number, arg2?: number) => 17; +(arg1, ...arg2: number[]) => 18; +(arg1, arg2?: number) => 19; + +// in paren +(() => 21); +((arg) => 22); +((arg = 1) => 23); +((arg?) => 24); +((arg: number) => 25); +((arg: number = 0) => 26); +((arg?: number) => 27); +((...arg: number[]) => 28); + +// in multiple paren +(((((arg) => { return 32; })))); + +// in ternary exression +false ? () => 41 : null; +false ? (arg) => 42 : null; +false ? (arg = 1) => 43 : null; +false ? (arg?) => 44 : null; +false ? (arg: number) => 45 : null; +false ? (arg?: number) => 46 : null; +false ? (arg?: number = 0) => 47 : null; +false ? (...arg: number[]) => 48 : null; + +// in ternary exression within paren +false ? (() => 51) : null; +false ? ((arg) => 52) : null; +false ? ((arg = 1) => 53) : null; +false ? ((arg?) => 54) : null; +false ? ((arg: number) => 55) : null; +false ? ((arg?: number) => 56) : null; +false ? ((arg?: number = 0) => 57) : null; +false ? ((...arg: number[]) => 58) : null; + +// ternary exression's else clause +false ? null : () => 61; +false ? null : (arg) => 62; +false ? null : (arg = 1) => 63; +false ? null : (arg?) => 64; +false ? null : (arg: number) => 65; +false ? null : (arg?: number) => 66; +false ? null : (arg?: number = 0) => 67; +false ? null : (...arg: number[]) => 68; + + +// nested ternary expressions +(a?) => { return a; } ? (b?) => { return b; } : (c?) => { return c; }; + +//multiple levels +(a?) => { return a; } ? (b) => (c) => 81 : (c) => (d) => 82; + + +// In Expressions +((arg) => 90) instanceof Function; +((arg = 1) => 91) instanceof Function; +((arg?) => 92) instanceof Function; +((arg: number) => 93) instanceof Function; +((arg: number = 1) => 94) instanceof Function; +((arg?: number) => 95) instanceof Function; +((...arg: number[]) => 96) instanceof Function; + +'' + (arg) => 100; +((arg) => 0) + '' + (arg) => 101; +((arg = 1) => 0) + '' + (arg = 2) => 102; +((arg?) => 0) + '' + (arg?) => 103; +((arg: number) => 0) + '' + (arg: number) => 104; +((arg: number = 1) => 0) + '' + (arg: number = 2) => 105; +((arg?: number = 1) => 0) + '' + (arg?: number = 2) => 106; +((...arg: number[]) => 0) + '' + (...arg: number[]) => 107; +((arg1, arg2?) => 0) + '' + (arg1, arg2?) => 108; +((arg1, ...arg2: number[]) => 0) + '' + (arg1, ...arg2: number[]) => 108; + + +// Function Parameters +function foo(...arg: any[]) { } + +foo( + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a?) => 113, + (a, b?) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + (a?, b?: number = 0) => 118, + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + (a) => (b) => (c) => 121, + false ? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts b/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts new file mode 100644 index 0000000000000..314cd416a81b8 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts @@ -0,0 +1,2 @@ +if(false){debugger;} + if ( false ) { debugger ; } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts b/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts new file mode 100644 index 0000000000000..c03acf91ecf89 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts @@ -0,0 +1,2 @@ +if (false) { debugger; } +if (false) { debugger; } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts b/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts new file mode 100644 index 0000000000000..956309d2c4d0c --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts @@ -0,0 +1,13 @@ +var fun1 = function ( ) { + var x = 'foo' , + z = 'bar' ; + return x ; +}, + +fun2 = ( function ( f ) { + var fun = function ( ) { + console . log ( f ( ) ) ; + }, + x = 'Foo' ; + return fun ; +} ( fun1 ) ) ; diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts b/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts new file mode 100644 index 0000000000000..f1d32283fd732 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts @@ -0,0 +1,13 @@ +var fun1 = function() { + var x = 'foo', + z = 'bar'; + return x; +}, + +fun2 = (function(f) { + var fun = function() { + console.log(f()); + }, + x = 'Foo'; + return fun; +} (fun1)); diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModule.ts b/tests/cases/unittests/services/testCode/formatting/implicitModule.ts new file mode 100644 index 0000000000000..352a252593b12 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/implicitModule.ts @@ -0,0 +1,3 @@ + export class A { + + } diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts b/tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts new file mode 100644 index 0000000000000..df93540466ff9 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts @@ -0,0 +1,3 @@ +export class A { + +} diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclaration.ts b/tests/cases/unittests/services/testCode/formatting/importDeclaration.ts new file mode 100644 index 0000000000000..afd010fe8b7e0 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/importDeclaration.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2=Foo; diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts b/tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts new file mode 100644 index 0000000000000..d0a4e190d9516 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2 = Foo; diff --git a/tests/cases/unittests/services/testCode/formatting/main.ts b/tests/cases/unittests/services/testCode/formatting/main.ts new file mode 100644 index 0000000000000..7640013af8b0e --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/main.ts @@ -0,0 +1,95 @@ + +var a;var c , b;var $d +var $e +var f +a++;b++; + +function f ( ) { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m (a[b[c][d]])]; + break; + + switch ( variable){ + case 1: abc += 425; +break; +case 404 : a [x--/2]%=3 ; + break ; + case vari : v[--x ] *=++y*( m + n / k[z]); + for (a in b){ + for (a = 0; a < 10; ++a) { + a++;--a; + if (a == b) { + a++;b--; + } +else +if (a == c){ +++a; +(--c)+=d; +$c = $a + --$b; +} +if (a == b) +if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--;++b; +a++ + } + } + } + for (x in y) { +m-=m; +k=1+2+3+4; +} +} + break; + + } + } + var a ={b:function(){}}; + return {a:1,b:2} +} + +var z = 1; + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) +for (k = 0; k < 10; ++k) { +z++; +} + +for (k = 0; k < 10; k += 2) { +z++; +} + + $(document).ready (); + + + function pageLoad() { + $('#TextBox1' ) . unbind ( ) ; +$('#TextBox1' ) . datepicker ( ) ; +} + + function pageLoad ( ) { + var webclass=[ + { 'student' : + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + } , +{ 'student': +{'id':'2','name':'Adam Davidson','legacySkill':'Cobol,MainFrame'} +} , + { 'student': +{ 'id':'3','name':'Charles Boyer' ,'legacySkill':'HTML, XML'} +} + ]; + +$create(Sys.UI.DataView,{data:webclass},null,null,$get('SList')); + +} + +$( document ).ready(function(){ +alert('hello'); + } ) ; diff --git a/tests/cases/unittests/services/testCode/formatting/mainBaseline.ts b/tests/cases/unittests/services/testCode/formatting/mainBaseline.ts new file mode 100644 index 0000000000000..30756f547cafe --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/mainBaseline.ts @@ -0,0 +1,98 @@ + +var a; var c, b; var $d +var $e +var f +a++; b++; + +function f() { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m(a[b[c][d]])]; + break; + + switch (variable) { + case 1: abc += 425; + break; + case 404: a[x-- / 2] %= 3; + break; + case vari: v[--x] *= ++y * (m + n / k[z]); + for (a in b) { + for (a = 0; a < 10; ++a) { + a++; --a; + if (a == b) { + a++; b--; + } + else + if (a == c) { + ++a; + (--c) += d; + $c = $a + --$b; + } + if (a == b) + if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--; ++b; + a++ + } + } + } + for (x in y) { + m -= m; + k = 1 + 2 + 3 + 4; + } + } + break; + + } + } + var a = { b: function() { } }; + return { a: 1, b: 2 } +} + +var z = 1; +for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + for (k = 0; k < 10; ++k) { + z++; + } + +for (k = 0; k < 10; k += 2) { + z++; +} + +$(document).ready(); + + +function pageLoad() { + $('#TextBox1').unbind(); + $('#TextBox1').datepicker(); +} + +function pageLoad() { + var webclass = [ + { + 'student': + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + }, +{ + 'student': + { 'id': '2', 'name': 'Adam Davidson', 'legacySkill': 'Cobol,MainFrame' } +}, + { + 'student': + { 'id': '3', 'name': 'Charles Boyer', 'legacySkill': 'HTML, XML' } + } + ]; + + $create(Sys.UI.DataView, { data: webclass }, null, null, $get('SList')); + +} + +$(document).ready(function() { + alert('hello'); +}); diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts b/tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts new file mode 100644 index 0000000000000..3030a36630a69 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts @@ -0,0 +1,3 @@ + module Foo { + export module A . B . C { } + } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts b/tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts new file mode 100644 index 0000000000000..0013b367dcfc3 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts @@ -0,0 +1,3 @@ +module Foo { + export module A.B.C { } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/modules.ts b/tests/cases/unittests/services/testCode/formatting/modules.ts new file mode 100644 index 0000000000000..5ce0d19b632f1 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/modules.ts @@ -0,0 +1,76 @@ + module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + + module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + + class c extends mod1.b { +} + + class ib2 implements mod1.ib { +} + + declare export module "m4" { + export class d { + } ; + var x : d ; + export function foo ( ) : d ; +} + + import m4 = module ( "m4" ) ; + export var x4 = m4.x ; + export var d4 = m4.d ; + export var f4 = m4.foo ( ) ; + + export module m1 { + declare export module "m2" { + export class d { + } ; + var x: d ; + export function foo ( ) : d ; + } + import m2 = module ( "m2" ) ; + import m3 = module ( "m4" ) ; + + export var x2 = m2.x ; + export var d2 = m2.d ; + export var f2 = m2.foo ( ) ; + + export var x3 = m3.x ; + export var d3 = m3.d ; + export var f3 = m3.foo ( ) ; +} + + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; + + export module m5 { + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; +} + diff --git a/tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts b/tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts new file mode 100644 index 0000000000000..e6f62024fe600 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts @@ -0,0 +1,76 @@ +module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + +module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + +class c extends mod1.b { +} + +class ib2 implements mod1.ib { +} + +declare export module "m4" { + export class d { + }; + var x: d; + export function foo(): d; +} + +import m4 = module("m4"); +export var x4 = m4.x; +export var d4 = m4.d; +export var f4 = m4.foo(); + +export module m1 { + declare export module "m2" { + export class d { + }; + var x: d; + export function foo(): d; + } + import m2 = module("m2"); + import m3 = module("m4"); + + export var x2 = m2.x; + export var d2 = m2.d; + export var f2 = m2.foo(); + + export var x3 = m3.x; + export var d3 = m3.d; + export var f3 = m3.foo(); +} + +export var x2 = m1.m2.x; +export var d2 = m1.m2.d; +export var f2 = m1.m2.foo(); + +export var x3 = m1.m3.x; +export var d3 = m1.m3.d; +export var f3 = m1.m3.foo(); + +export module m5 { + export var x2 = m1.m2.x; + export var d2 = m1.m2.d; + export var f2 = m1.m2.foo(); + + export var x3 = m1.m3.x; + export var d3 = m1.m3.d; + export var f3 = m1.m3.foo(); +} + diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteral.ts b/tests/cases/unittests/services/testCode/formatting/objectLiteral.ts new file mode 100644 index 0000000000000..dbecc4d4fec82 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/objectLiteral.ts @@ -0,0 +1,27 @@ +var x = {foo: 1, +bar: "tt", +boo: 1 + 5}; + +var x2 = {foo: 1, +bar: "tt",boo:1+5}; + +function Foo() { +var typeICalc = { +clear: { +"()": [1, 2, 3] +} +} +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: +3, + 'bar': + { a: 1, b : 2} +}; + +var x={ }; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts b/tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts new file mode 100644 index 0000000000000..3a7fa63d9274f --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts @@ -0,0 +1,31 @@ +var x = { + foo: 1, + bar: "tt", + boo: 1 + 5 +}; + +var x2 = { + foo: 1, + bar: "tt", boo: 1 + 5 +}; + +function Foo() { + var typeICalc = { + clear: { + "()": [1, 2, 3] + } + } +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: + 3, + 'bar': + { a: 1, b: 2 } +}; + +var x = {}; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts b/tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts new file mode 100644 index 0000000000000..0161f04308d4c --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts @@ -0,0 +1,32 @@ +function f( ) { +var x = 3; + var z = 2 ; + a = z ++ - 2 * x ; + for ( ; ; ) { + a+=(g +g)*a%t; + b -- ; +} + + switch ( a ) + { + case 1 : { + a ++ ; + b--; + if(a===a) + return; + else + { + for(a in b) + if(a!=a) + { + for(a in b) + { +a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts b/tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts new file mode 100644 index 0000000000000..051a4ebd13a26 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts @@ -0,0 +1,28 @@ +function f() { + var x = 3; + var z = 2; + a = z++ - 2 * x; + for (; ;) { + a += (g + g) * a % t; + b--; + } + + switch (a) { + case 1: { + a++; + b--; + if (a === a) + return; + else { + for (a in b) + if (a != a) { + for (a in b) { + a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColon.ts b/tests/cases/unittests/services/testCode/formatting/onSemiColon.ts new file mode 100644 index 0000000000000..3b5b5456a6fd7 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/onSemiColon.ts @@ -0,0 +1 @@ +var a=b+c^d-e*++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts b/tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts new file mode 100644 index 0000000000000..2ba96e4f88a8c --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts @@ -0,0 +1 @@ +var a = b + c ^ d - e * ++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts b/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts new file mode 100644 index 0000000000000..7d98d5a8f43b4 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts @@ -0,0 +1 @@ +class test { constructor () { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts b/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts new file mode 100644 index 0000000000000..bc124d41baf38 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts @@ -0,0 +1 @@ +class test { constructor() { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts b/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts new file mode 100644 index 0000000000000..ec093e0e376b3 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts @@ -0,0 +1,10 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob + { + Blah=1, Bleah=2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts b/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts new file mode 100644 index 0000000000000..d0a3db2d51a66 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts @@ -0,0 +1,9 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob { + Blah = 1, Bleah = 2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts b/tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts new file mode 100644 index 0000000000000..43ef3710ef13a --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts @@ -0,0 +1,65 @@ + module MyModule + { + module A.B.C { +module F { +} + } +interface Blah +{ +boo: string; +} + + class Foo + { + +} + +class Foo2 { +public foo():number { +return 5 * 6; +} +public foo2() { +if (1 === 2) + + +{ +var y : number= 76; +return y; +} + + while (2 == 3) { + if ( y == null ) { + +} + } +} + +public foo3() { +if (1 === 2) + +//comment preventing line merging +{ +var y = 76; +return y; +} + +} + } + } + +function foo(a:number, b:number):number +{ +return 0; +} + +function bar(a:number, b:number) :number[] { +return []; +} + +module BugFix3 { +declare var f: { + (): any; + (x: number): string; + foo: number; +}; +} diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts b/tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts new file mode 100644 index 0000000000000..929334e4730ba --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts @@ -0,0 +1,58 @@ +module MyModule { + module A.B.C { + module F { + } + } + interface Blah { + boo: string; + } + + class Foo { + + } + + class Foo2 { + public foo(): number { + return 5 * 6; + } + public foo2() { + if (1 === 2) { + var y: number = 76; + return y; + } + + while (2 == 3) { + if (y == null) { + + } + } + } + + public foo3() { + if (1 === 2) + + //comment preventing line merging + { + var y = 76; + return y; + } + + } + } +} + +function foo(a: number, b: number): number { + return 0; +} + +function bar(a: number, b: number): number[] { + return []; +} + +module BugFix3 { + declare var f: { + (): any; + (x: number): string; + foo: number; + }; +} diff --git a/tests/cases/unittests/services/testCode/formatting/various.ts b/tests/cases/unittests/services/testCode/formatting/various.ts new file mode 100644 index 0000000000000..bd814c2348e2f --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/various.ts @@ -0,0 +1,17 @@ +function f(a,b,c,d){ +for(var i=0;i<10;i++){ +var a=0; +var b=a+a+a*a%a/2-1; +b+=a; +++b; +f(a,b,c,d); +if(1===1){ +var m=function(e,f){ +return e^f; +} +} +} +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/variousBaseline.ts b/tests/cases/unittests/services/testCode/formatting/variousBaseline.ts new file mode 100644 index 0000000000000..a4b5ceeb1c2de --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/variousBaseline.ts @@ -0,0 +1,17 @@ +function f(a, b, c, d) { + for (var i = 0; i < 10; i++) { + var a = 0; + var b = a + a + a * a % a / 2 - 1; + b += a; + ++b; + f(a, b, c, d); + if (1 === 1) { + var m = function(e, f) { + return e ^ f; + } + } + } +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/formatting/withStatement.ts b/tests/cases/unittests/services/testCode/formatting/withStatement.ts new file mode 100644 index 0000000000000..66ec4bf546fb0 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/withStatement.ts @@ -0,0 +1,9 @@ +with (foo.bar) + + { + + } + +with (bar.blah) +{ +} diff --git a/tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts b/tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts new file mode 100644 index 0000000000000..f81378d7f8271 --- /dev/null +++ b/tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts @@ -0,0 +1,6 @@ +with (foo.bar) { + +} + +with (bar.blah) { +} diff --git a/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts b/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts new file mode 100644 index 0000000000000..92be52aa94717 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts @@ -0,0 +1,27 @@ +module Foo { + class Bar { + private f() { + var a:any[] = [[1, 2], [3, 4], 5]; + return ((1 + 1)); + } + + private f2() { + if(true) { }{ }; + } + } +} + + +// { } +// ( ) +// [ ] +// < > + +class TemplateTest { + public foo(a, b) { + return a; + } + public bar(a, b) { + return a < b || a > b; + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts new file mode 100644 index 0000000000000..41e46ea062879 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts @@ -0,0 +1,23 @@ +module Foo { var testing = ""; test } + +class C1 { + public pubMeth() {this.} // test on 'this.' + private privMeth() {} + public pubProp = 0; + private privProp = 0; +} + +var f = new C1(); +f. // test on F. +module M { + export class C { public pub = 0; private priv = 1; } + export var V = 0; +} + + +var c = new M.C(); + +c. // test on c. + +//Test for comment +//c. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts new file mode 100644 index 0000000000000..478027ee2ca39 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts @@ -0,0 +1,5 @@ +module Test10 +{ + var x: string[] = []; + x.forEach(function(y) { y. }); +} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts new file mode 100644 index 0000000000000..9cad47b6d6e0f --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts @@ -0,0 +1,12 @@ +module Foo { + export class Bar { + + } + + + export module Blah { + + } +} + +var x:Foo. diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts new file mode 100644 index 0000000000000..d1416fad86f7f --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts @@ -0,0 +1,2 @@ +// +var \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts new file mode 100644 index 0000000000000..56150d400691a --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts @@ -0,0 +1,4 @@ +class +{ + +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts new file mode 100644 index 0000000000000..a5a89ed024d34 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts @@ -0,0 +1,3 @@ +module +{ +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts new file mode 100644 index 0000000000000..29a9a9d3b14ce --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts @@ -0,0 +1 @@ +interface \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts new file mode 100644 index 0000000000000..fe6292bfdbb6c --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts @@ -0,0 +1 @@ +function \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts new file mode 100644 index 0000000000000..5109df29b7384 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts new file mode 100644 index 0000000000000..37369dc33fb32 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts @@ -0,0 +1,10 @@ +module Bar +{ + export class Bleah { + } + export class Foo extends Bleah { + } +} + +function Blah(x:Bar.Bleah) { +} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts new file mode 100644 index 0000000000000..9cc47b34ee62e --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts @@ -0,0 +1,8 @@ +module Test1 { + class Person { + children: string[]; + constructor (public name:string, children:string[]) { + + } + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts new file mode 100644 index 0000000000000..08d056b6b6ea6 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts @@ -0,0 +1,16 @@ +module BugFixes { + enum Foo { + bar, + baz + } + + var f: Foo = Foo./*here*/; + + import foo f = Foo; + foo./*here*/; +} + +module BugFix2 { + interface iFace { (event: string); } + var foo: iFace = function (elem) { /*here*/ } +} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts new file mode 100644 index 0000000000000..d127a8a34bd07 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts @@ -0,0 +1,33 @@ +module ObjectLiterals { + interface MyPoint { + x1: number; + y1: number; + } + + var p1: MyPoint = { + /*here*/ + }; + + var p2: MyPoint = { + x1: 5, + /*here*/ + }; + + var p3: MyPoint = { + x1 /*here*/ + }; + + var p4: MyPoint = { + x1: 5, + y1 /*here*/ : 6 + }; + + // Negative cases (global completion) + var n4: MyPoint = { + x1: /*here*/ + }; + + var n2: MyPoint = { + x1: /*here*/, + }; +} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts new file mode 100644 index 0000000000000..5228083a6675e --- /dev/null +++ b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts @@ -0,0 +1,91 @@ +/// +var locVar; +function locFn() { } +class locCls { } +interface locInt{ } +module locMod{ export var foo = 1;} + +locVar = 1; +locFn(); +var foo = new locCls(); +class fooCls implements locInt { } +var fooVar = locMod.foo; + +remVar = 1; +remFn(); +var remfoo = new remCls(); +class remfooCls implements remInt { } +var remfooVar = remMod.foo; + +rem2Var = 1; +rem2Fn(); +var rem2foo = new rem2Cls(); +class rem2fooCls implements rem2Int { } +var rem2fooVar = rem2Mod.foo; + +var shdVar = "foo"; +module shdModule { + var shdVar; + shdVar = 1; +} + +function fnOverload( ); +function fnOverload(foo: string); +function fnOverload(foo: any) { }; + +fnOverload(); +fnOverload("test"); + +class clsOverload { + constructor (); + constructor (foo: string); + constructor (foo: any) { } +}; + +var clsOverloadVar = new clsOverload(); +clsOverloadVar = new clsOverload("test"); + +class clsInOverload { + static fnOverload( ); + static fnOverload(foo: string); + static fnOverload(foo: any) { }; + public fnOverload():any; + public fnOverload(foo: string); + public fnOverload(foo: any) { return "foo" }; + public fnOverload1():any; + public fnOverload1(foo: string); + public fnOverload1(foo: any) { return "foo" }; + + constructor () { } +} + +clsInOverload.fnOverload(); +clsInOverload.fnOverload("test"); + +var clsInOverloadVar = new clsInOverload(); +var foo3 = clsInOverloadVar.fnOverload(); +foo3 = clsInOverloadVar.fnOverload("test"); + +function fnInOverload() { + static fnOverload():any; + static fnOverload(foo: string); + static fnOverload(foo: any){ return "foo" }; +} + +fnInOverload.fnOverload(); +fnInOverload.fnOverload("test"); + +interface sInt { + sVar: number; + sFn: () => void; +} + +class iClass implements sInt { + public sVar = 1; + public sFn() { + } +} + +declare var ambientVar; + +ambientVar = 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts new file mode 100644 index 0000000000000..ebee920b98400 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts @@ -0,0 +1,6 @@ +/// +var remVar; +function remFn() { } +class remCls { } +interface remInt{ } +module remMod{ export var foo;} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts new file mode 100644 index 0000000000000..23005628529fc --- /dev/null +++ b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts @@ -0,0 +1,5 @@ +var rem2Var; +function rem2Fn() { } +class rem2Cls { } +interface rem2Int{ } +module rem2Mod{ export var foo; } diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts new file mode 100644 index 0000000000000..f251b2c5b0a74 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts @@ -0,0 +1,5 @@ +module A { + export interface IA { + y: string; + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts new file mode 100644 index 0000000000000..39a1e7fbf4671 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts @@ -0,0 +1,9 @@ +/// + +module A { + export interface IA { + x: number; + } + + var x: IA; +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts b/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts new file mode 100644 index 0000000000000..1791e1395f490 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts @@ -0,0 +1,57 @@ +module SimpleClassTest { + class Foo { + public foo(): void { + } + } + class Bar extends Foo { + public foo(): void { + } + } +} + +module SimpleInterfaceTest { + interface IFoo { + foo(): void; + } + interface IBar extends IFoo { + foo(): void; + } +} + +module SimpleClassInterfaceTest { + interface IFoo { + foo(): void; + } + class Bar implements IFoo { + public foo(): void { + } + } +} + +module Test { + interface IBase { + field: string; + method(): void; + } + + interface IBlah extends IBase { + field: string; + } + + interface IBlah2 extends IBlah { + field: string; + } + + interface IDerived extends IBlah2 { + method(): void; + } + + class Bar implements IDerived { + public field: string; + public method(): void { } + } + + class BarBlah extends Bar { + public field: string; + } +} diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts new file mode 100644 index 0000000000000..4014f4388095b --- /dev/null +++ b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts @@ -0,0 +1,117 @@ +/// +// Comment Refence Test: globalVar +var globalVar: number = 2; + +class fooCls { + static clsSVar = 1; + //Declare + clsVar = 1; + + constructor (public clsParam: number) { + //Increments + globalVar++; + this.clsVar++; + fooCls.clsSVar++; + this.clsParam++; + modTest.modVar++; + } +} + +function foo(x: number) { + //Declare + var fnVar = 1; + + //Increments + fooCls.clsSVar++; + globalVar++; + modTest.modVar++; + fnVar++; + + //Return + return x++; +} + +module modTest { + //Declare + export var modVar:number; + + //Increments + globalVar++; + fooCls.clsSVar++; + modVar++; + + class testCls { + static boo = foo; + } + + function testFn(){ + static boo = foo; + + //Increments + globalVar++; + fooCls.clsSVar++; + modVar++; + } + + module testMod { + var boo = foo; + } +} + +//Type test +var clsTest: fooCls; + +//Arguments +clsTest = new fooCls(globalVar); +foo(globalVar); + +//Increments +fooCls.clsSVar++; +modTest.modVar++; +globalVar = globalVar + globalVar; + +//ETC - Other cases +globalVar = 3; +foo = foo + 1; +err = err++; + +//Shadowed fn Parameter +function shdw(globalVar: number) { + //Increments + globalVar++; + return globalVar; +} + +//Remotes +//Type test +var remoteclsTest: remotefooCls; + +//Arguments +remoteclsTest = new remotefooCls(remoteglobalVar); +remotefoo(remoteglobalVar); + +//Increments +remotefooCls.remoteclsSVar++; +remotemodTest.remotemodVar++; +remoteglobalVar = remoteglobalVar + remoteglobalVar; + +//ETC - Other cases +remoteglobalVar = 3; + +//Find References misses method param +var + + + + array = ["f", "o", "o"]; + +array.forEach( + + +function(str) { + + + + return str + " "; + +}); diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts new file mode 100644 index 0000000000000..67aa438a639c6 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts @@ -0,0 +1,59 @@ +var remoteglobalVar: number = 2; + +class remotefooCls { + //Declare + remoteclsVar = 1; + static remoteclsSVar = 1; + + constructor (public remoteclsParam: number) { + //Increments + remoteglobalVar++; + this.remoteclsVar++; + remotefooCls.remoteclsSVar++; + this.remoteclsParam++; + remotemodTest.remotemodVar++; + } +} + +function remotefoo(remotex: number) { + //Declare + var remotefnVar = 1; + + //Increments + remotefooCls.remoteclsSVar++; + remoteglobalVar++; + remotemodTest.remotemodVar++; + remotefnVar++; + + //Return + return remotex++; +} + +module remotemodTest { + //Declare + export var remotemodVar:number; + + //Increments + remoteglobalVar++; + remotefooCls.remoteclsSVar++; + remotemodVar++; + + class remotetestCls { + static remoteboo = remotefoo; + } + + function remotetestFn(){ + static remoteboo = remotefoo; + + //Increments + remoteglobalVar++; + remotefooCls.remoteclsSVar++; + remotemodVar++; + } + + module remotetestMod { + var remoteboo = remotefoo; + } +} + + diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts new file mode 100644 index 0000000000000..4dd668b29b1ed --- /dev/null +++ b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts @@ -0,0 +1,70 @@ +module FindRef3 { + module SimpleClassTest { + export class Foo { + public foo(): void { + } + } + export class Bar extends Foo { + public foo(): void { + } + } + } + + module SimpleInterfaceTest { + export interface IFoo { + foo(): void; + } + export interface IBar extends IFoo { + foo(): void; + } + } + + module SimpleClassInterfaceTest { + export interface IFoo { + foo(): void; + } + export class Bar implements IFoo { + public foo(): void { + } + } + } + + module Test { + export interface IBase { + field: string; + method(): void; + } + + export interface IBlah extends IBase { + field: string; + } + + export interface IBlah2 extends IBlah { + field: string; + } + + export interface IDerived extends IBlah2 { + method(): void; + } + + export class Bar implements IDerived { + public field: string; + public method(): void { } + } + + export class BarBlah extends Bar { + public field: string; + } + } + + function test() { + var x = new SimpleClassTest.Bar(); + x.foo(); + + var y: SimpleInterfaceTest.IBar = null; + y.foo(); + + var z = new Test.BarBlah(); + z.field = ""; + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts new file mode 100644 index 0000000000000..4f705e721e8d7 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts @@ -0,0 +1,28 @@ +module FindRef4 { + module MixedStaticsClassTest { + export class Foo { + bar: Foo; + static bar: Foo; + + public foo(): void { + } + public static foo(): void { + } + } + } + + function test() { + // instance function + var x = new MixedStaticsClassTest.Foo(); + x.foo(); + x.bar; + + var y = new MixedStaticsClassTest.Foo(); + y.foo(); + y.bar; + + // static function + MixedStaticsClassTest.Foo.foo(); + MixedStaticsClassTest.Foo.bar; + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts b/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts new file mode 100644 index 0000000000000..afac9249cc00b --- /dev/null +++ b/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts @@ -0,0 +1,112 @@ +module Bar { // Module + var x: number; // Variable + function f(): void { } // Function + + interface IFoo { + (i: number): IFoo; // CallSignature + new (): IFoo; // ConstructSignature + [i: number]: number; // IndexSignature + foo: number; // PropertySignature + bar(): void; // FunctionSignature + } + + enum Blah { + foo = 2 // EnumMemberDeclaration + } + + class Bar { + constructor(private barVar: Bar) { } // ConstructorImplementation + + public barProp: number; // MemberVariableDeclaration + public barPropFunc(): void { } // MemberFunctionDeclaration + public get prop1(): void { } // MemberAccessorDeclaration + public set prop1() { } // MemberAccessorDeclaration + + private barPropP: number; // MemberVariableDeclaration + private barPropFuncP(): void { } // MemberFunctionDeclaration + private get prop1P(): void { } // MemberAccessorDeclaration + private set prop1P() { } // MemberAccessorDeclaration + + static foo: number; // StaticVariableDeclaration + static bar(): void { } // StaticFunctionDeclaration + static get foo2(): void { } // StaticAccessorDeclaration + static set foo2() { } // StaticAccessorDeclaration + } +} + +module Bar2 { // Module + export var x: number; // Variable + export function f(): void { } // Function + + export interface IFoo { + (i: number): IFoo; // CallSignature + new (): IFoo; // ConstructSignature + [i: number]: number; // IndexSignature + foo: number; // PropertySignature + bar(): void; // FunctionSignature + } + + export enum Blah { + foo = 2 // EnumMemberDeclaration + } + + export class Bar { + constructor(private barVar: Bar) { } // ConstructorImplementation + + public barProp: number; // MemberVariableDeclaration + public barPropFunc(): void { } // MemberFunctionDeclaration + public get prop1(): void { } // MemberAccessorDeclaration + public set prop1() { } // MemberAccessorDeclaration + + private barPropP: number; // MemberVariableDeclaration + private barPropFuncP(): void { } // MemberFunctionDeclaration + private get prop1P(): void { } // MemberAccessorDeclaration + private set prop1P() { } // MemberAccessorDeclaration + + static foo: number; // StaticVariableDeclaration + static bar(): void { } // StaticFunctionDeclaration + static get foo2(): void { } // StaticAccessorDeclaration + static set foo2() { } // StaticAccessorDeclaration + } +} + + +declare module Bar3 { + +} + +module Bar4 { // Module + declare var x: number; // Variable + declare function f(): void; // Function + + declare interface IFoo { + (i: number): IFoo; // CallSignature + new (): IFoo; // ConstructSignature + [i: number]: number; // IndexSignature + foo: number; // PropertySignature + bar(): void; // FunctionSignature + } + + declare enum Blah { + foo = 2 // EnumMemberDeclaration + } + + declare class Bar { + constructor (private barVar: Bar); // ConstructorImplementation + + public barProp: number; // MemberVariableDeclaration + public barPropFunc(): void; // MemberFunctionDeclaration + public get prop1(): void; // MemberAccessorDeclaration + public set prop1(); // MemberAccessorDeclaration + + private barPropP: number; // MemberVariableDeclaration + private barPropFuncP(): void; // MemberFunctionDeclaration + private get prop1P(): void; // MemberAccessorDeclaration + private set prop1P(); // MemberAccessorDeclaration + + static foo: number; // StaticVariableDeclaration + static bar(): void; // StaticFunctionDeclaration + static get foo2(): void; // StaticAccessorDeclaration + static set foo2(); // StaticAccessorDeclaration + } +} diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts new file mode 100644 index 0000000000000..882216cb88daf --- /dev/null +++ b/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts @@ -0,0 +1,85 @@ +//Comment +class sampleCls { constructor (str: string, num: number) { } } +var x = new sampleCls("", 5); // new() test +sampleCls(); // negative test + +function fnTest(str: string, num: number) { } +fnTest(); // simple function test + +function fnOverload(); +function fnOverload(test: string); function fnOverload(test: string) { } +fnOverload() +fnOverload("") + +class clsOverload { constructor (); constructor (test: string); constructor (test?: string) { } } +var x = new clsOverload(); +var x = new clsOverload(""); + +module SimpleTests { + module CallExpressions { + class Foo { + public f1() { } + public f2(n: number) { } + public f3(n: number, s: string) { } + + } + + var x = new Foo(); + x.f1(); + x.f2(5); + x.f3(5, ""); + x.f1( + x.f2(5, + x.f3(5, + } + + module NewExpressions { + + } +} + +module OverloadTests { + module CallExpressions { + function foo(callback: (a: number, b: string) => string) { + callback(5, ""); + } + } +} + +module AnonymousFunctionTest { + var x2 = function (n: number, s: string): (a: number, b: string) => string { + return null; + } + x2(5, "")(1, ""); +} + +module ObjectLiteralTest { + var x = { n: 5, s: "", f: (a: number, b: string) => "" }; + x.f(4, ""); +} + +module SuperCallTest { + class base { + constructor(s: string); + constructor(n: number); + constructor(a: any) { } + } + class A extends base { + constructor() { + super(""); + } + } + + class B extends base { + } + class B2 extends B { + } + class B3 extends B2 { + constructor() { + super(""); + } + } + +} + + diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts new file mode 100644 index 0000000000000..562fd566ce23c --- /dev/null +++ b/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts @@ -0,0 +1,5 @@ +function Foo(arg1: string, arg2: string) { + +} + +Foo( \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts new file mode 100644 index 0000000000000..2649484f46584 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts @@ -0,0 +1,132 @@ +module Foo { + + class Bar { + + private foo:string = ""; + + private f() { + var a:any[] = [[1, 2], [3, 4], 5]; + + return ((1 + 1)); + } + + private f2() { + if(true) { }{ }; + } + } + + interface Foo { + + x:number; + + foo():number; + + } + + module Foo2 { + + function f() { + } + + var x: number; + + } + + enum Foo3 { + + val1, + + val2, + + } + +} + +function foo(bar, + blah, + +); + + +function test() { + for (var i = 0; i < 10; i++) { + + } + + for (var e in foo.bar) { + + } + + with (foo.bar) { + + } + + switch(foo.bar) { + + } + + switch (foo.bar) { + + case 1: + + break; + + } + +} + +function tryCatch() { + + try { + + } + + catch(err) { + + } + +} + + +function tryFinally() { + + try { + + } + + finally { + + } + +} + +function tryCatchFinally() { + + try { + + } + + catch(err) { + + } + + finally { + + } + +} + + +module SwitchTest { + var a = 3; + + if (a == 5) { + switch (a) { + case 1: + if (a == 5) { + + } + break; + } + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts new file mode 100644 index 0000000000000..d4ab3136565a5 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts @@ -0,0 +1,8 @@ +// +// Note: Do not add more tests at the end of this file, as +// the purpose of this test is to verity smart indent +// works for unterminated function arguments at the end of a file. +// + +function foo(a, + diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts new file mode 100644 index 0000000000000..8122651914be8 --- /dev/null +++ b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts @@ -0,0 +1,6 @@ +// +// Note: Do not add more tests at the end of this file, as +// the purpose of this test is to verity smart indent +// works for unterminated if statements at the end of a file. +// +if (true) diff --git a/tests/cases/unittests/services/testCode/incrementalParser.ts b/tests/cases/unittests/services/testCode/incrementalParser.ts new file mode 100644 index 0000000000000..f5290476b808c --- /dev/null +++ b/tests/cases/unittests/services/testCode/incrementalParser.ts @@ -0,0 +1,24 @@ +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds +// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds + +function tryCatchFinally() { + addsdfsdafsdafsdfdsfdsfsfsaafdsddfsdaf; + try { + + } + + catch(err) { + + } + + finally { + + } + +} + diff --git a/tests/cases/unittests/services/testCode/incrementalParser2.ts b/tests/cases/unittests/services/testCode/incrementalParser2.ts new file mode 100644 index 0000000000000..86ec00ebd6568 --- /dev/null +++ b/tests/cases/unittests/services/testCode/incrementalParser2.ts @@ -0,0 +1,5 @@ +interface bah { + (y: number); + x: number; + (z: string) +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/overridesCollector.ts b/tests/cases/unittests/services/testCode/overridesCollector.ts new file mode 100644 index 0000000000000..1791e1395f490 --- /dev/null +++ b/tests/cases/unittests/services/testCode/overridesCollector.ts @@ -0,0 +1,57 @@ +module SimpleClassTest { + class Foo { + public foo(): void { + } + } + class Bar extends Foo { + public foo(): void { + } + } +} + +module SimpleInterfaceTest { + interface IFoo { + foo(): void; + } + interface IBar extends IFoo { + foo(): void; + } +} + +module SimpleClassInterfaceTest { + interface IFoo { + foo(): void; + } + class Bar implements IFoo { + public foo(): void { + } + } +} + +module Test { + interface IBase { + field: string; + method(): void; + } + + interface IBlah extends IBase { + field: string; + } + + interface IBlah2 extends IBlah { + field: string; + } + + interface IDerived extends IBlah2 { + method(): void; + } + + class Bar implements IDerived { + public field: string; + public method(): void { } + } + + class BarBlah extends Bar { + public field: string; + } +} diff --git a/tests/cases/unittests/services/testCode/references/classLocal.ts b/tests/cases/unittests/services/testCode/references/classLocal.ts new file mode 100644 index 0000000000000..34eda48baee78 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/classLocal.ts @@ -0,0 +1,19 @@ +// Local inside a class + +var n = 14; + +class foo { + private ^^[|n|] = 0; + + public bar() { + this.[|n|] = 9; + } + + constructor() { + this.[|n|]^^ = 4; + } + + public bar2() { + var n = 12; + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/classParameter.ts b/tests/cases/unittests/services/testCode/references/classParameter.ts new file mode 100644 index 0000000000000..fad418de765a1 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/classParameter.ts @@ -0,0 +1,18 @@ +// Reference to a class parameter + +var p = 2; + +class p { } + +class foo { + constructor (public p: any) { + } + + public f(p) { + this.^^[|p|] = p; + } + +} + +var n = new foo(undefined); +n.^^[|p|] = null; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/comment.ts b/tests/cases/unittests/services/testCode/references/comment.ts new file mode 100644 index 0000000000000..e6b8edaa0158c --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/comment.ts @@ -0,0 +1,4 @@ +// References to ^^foo or b^^ar +/* in comments should not find fo^^o or bar^^ */ +class foo { } +var bar = 0; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionOverloads.ts b/tests/cases/unittests/services/testCode/references/functionOverloads.ts new file mode 100644 index 0000000000000..d382f8818fac2 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/functionOverloads.ts @@ -0,0 +1,6 @@ +// function overloads should be highlighted together + +function [|^^foo|](x: string); +function [|^^foo|](x: string, y: number) { + [|^^foo|]('', 43); +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionParameter.ts b/tests/cases/unittests/services/testCode/references/functionParameter.ts new file mode 100644 index 0000000000000..67f63c35e7271 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/functionParameter.ts @@ -0,0 +1,7 @@ +var x; +var n; + +function n(x: number, [|n|]^^: number) { + ^^[|n|] = 32; + x = [|n|]; +} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/globals.ts b/tests/cases/unittests/services/testCode/references/globals.ts new file mode 100644 index 0000000000000..1ebef4e885e0f --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/globals.ts @@ -0,0 +1,23 @@ +// Global variable reference + +var ^^global = 2; + +class foo { + constructor (public global) { } + public f(global) { } + public f2(global) { } +} + +class bar { + constructor () { + var n = [|global|]; + + var f = new foo(''); + f.global = ''; + } +} + +var k = [|global|]; + +================ +var m = [|global|]; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts new file mode 100644 index 0000000000000..d1837f12555cd --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts @@ -0,0 +1,2 @@ +// Neither should cause highlighting to occur +f^^oo = fo^^o; diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts new file mode 100644 index 0000000000000..7ea1545517e02 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts @@ -0,0 +1,4 @@ +// Should still highlight even though it's invalid assignment +var ^^[|foo|] = function() { }; + +[|fo^^o|] = [|f^^oo|] + 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/noContext.ts b/tests/cases/unittests/services/testCode/references/noContext.ts new file mode 100644 index 0000000000000..fd1ef87c7834e --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/noContext.ts @@ -0,0 +1,20 @@ +module modTest { + //Declare + export var modVar:number; + ^^ + + //Increments + modVar++; + + class testCls{ + ^^ + } + + function testFn(){ + //Increments + modVar++; + } ^^ +^^ + module testMod { + } +} diff --git a/tests/cases/unittests/services/testCode/references/referenceToClass.ts b/tests/cases/unittests/services/testCode/references/referenceToClass.ts new file mode 100644 index 0000000000000..28c6ca509db4f --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/referenceToClass.ts @@ -0,0 +1,17 @@ +// Class references should work across file and not find local variables +class [|foo|]^^ { + public n: ^^[|foo|]; + public foo: number; +} + +class bar { + public n: [|f^^o^^o|]; + public k = new [|foo|](); +} + +module mod { + var k: [|foo|] = null; +} + +=================== +var k: ^^[|foo|]; diff --git a/tests/cases/unittests/services/testCode/references/static.ts b/tests/cases/unittests/services/testCode/references/static.ts new file mode 100644 index 0000000000000..68fa11cd4a506 --- /dev/null +++ b/tests/cases/unittests/services/testCode/references/static.ts @@ -0,0 +1,28 @@ +// reference a class static + +var n = 43; + +class foo { + static [|n|] = ''; + + public bar() { + foo.^^[|n|] = "'"; + if(foo.[|n|]) { + var x = foo.[|n|]; + } + } +} + +class foo2 { + private x = foo.[|n|]^^; + constructor() { + foo.^^[|n|] = x; + } + + function b(n) { + n = foo.[|n|]; + } +} + +================= +var q = foo.[|n|]; \ No newline at end of file diff --git a/tests/perfsys.ts b/tests/perfsys.ts new file mode 100644 index 0000000000000..251f4f56fb26c --- /dev/null +++ b/tests/perfsys.ts @@ -0,0 +1,106 @@ +/// +module perftest { + + interface IOLog { + resolvePath: ts.Map; + fileNames: string[]; + } + + export interface IO { + getOut(): string; + getErr(): string; + } + + export var readFile = sys.readFile; + var writeFile = sys.writeFile; + export var write = sys.write; + export var writeErr = sys.writeErr; + var resolvePath = sys.resolvePath; + export var getExecutingFilePath = sys.getExecutingFilePath; + export var getCurrentDirectory = sys.getCurrentDirectory; + + var args = sys.args; + + // augment sys so first ts.executeCommandLine call will be finish silently + sys.writeErr = (s: string) => { }; + sys.args = [] + + export function restoreSys() { + sys.args = args; + sys.writeErr = writeErr; + } + + export function hasLogIOFlag() { + return args.length > 2 && args[0] === "--logio"; + } + + export function getArgsWithoutLogIOFlag() { + return args.slice(2); + } + + export function getArgsWithoutIOLogFile() { + return args.slice(1); + } + + var resolvePathLog: ts.Map = {}; + + export function interceptIO() { + sys.resolvePath = (s) => { + var result = resolvePath(s); + resolvePathLog[s] = result; + return result; + }; + } + + export function writeIOLog(fileNames: string[]) { + var path = args[1]; + var log: IOLog = { + fileNames: fileNames, + resolvePath: resolvePathLog + }; + + writeFile(path, JSON.stringify(log)); + } + + export function prepare(): IO { + var log = JSON.parse(readFile(args[0])); + + var files: ts.Map = {}; + log.fileNames.forEach(f => { files[f] = readFile(f); }) + + sys.createDirectory = (s: string) => { }; + sys.directoryExists = (s: string) => true; + sys.fileExists = (s: string) => true; + + var currentDirectory = sys.getCurrentDirectory(); + sys.getCurrentDirectory = () => currentDirectory; + + var executingFilePath = sys.getExecutingFilePath(); + sys.getExecutingFilePath = () => executingFilePath; + + sys.readFile = (s: string) => { + return files[s]; + } + + sys.resolvePath = (s: string) => { + var path = log.resolvePath[s]; + if (!path) { + throw new Error("Unexpected path '" + s + "'"); + } + return path + } + + sys.writeFile = (path: string, data: string) => { }; + + var out: string = ""; + var err: string = ""; + + sys.write = (s: string) => { out += s; }; + sys.writeErr = (s: string) => { err += s; }; + + return { + getOut: () => out, + getErr: () => err + }; + } +} diff --git a/tests/perftc.ts b/tests/perftc.ts new file mode 100644 index 0000000000000..b5f99f536d411 --- /dev/null +++ b/tests/perftc.ts @@ -0,0 +1,30 @@ +/// +/// + +// resolve all files used in this compilation +if (perftest.hasLogIOFlag()) { + perftest.interceptIO(); + + var compilerHost: ts.CompilerHost = { + getSourceFile: (s, v) => { + var content = perftest.readFile(s); + return content !== undefined ? ts.createSourceFile(s, content, v) : undefined; + }, + getDefaultLibFilename: () => ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(perftest.getExecutingFilePath())), "lib.d.ts"), + writeFile: (f: string, content: string) => { throw new Error("Unexpected operation: writeFile"); }, + getCurrentDirectory: () => perftest.getCurrentDirectory(), + getCanonicalFileName: getCanonicalFileName, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + }; + + var commandLine = ts.parseCommandLine(perftest.getArgsWithoutLogIOFlag()); + var program = ts.createProgram(commandLine.filenames, commandLine.options, compilerHost); + var fileNames = program.getSourceFiles().map(f => f.filename); + perftest.writeIOLog(fileNames); +} +else { + var io = perftest.prepare(); + ts.executeCommandLine(perftest.getArgsWithoutIOLogFile()); + perftest.write(io.getOut()); + perftest.writeErr(io.getErr()); +} diff --git a/tests/test.bat b/tests/test.bat new file mode 100644 index 0000000000000..4517d99f3c818 --- /dev/null +++ b/tests/test.bat @@ -0,0 +1,13 @@ +@echo off +setlocal +set LF=^ + + +for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a" + +setlocal enableDelayedExpansion +echo "START" +echo "asdf!CR!asdf" +echo "AASDF!LF!ASDF" +echo "END" +findstr /S /R /M /C:"[^!CR!]!LF!" * diff --git a/tests/webTestResults.html b/tests/webTestResults.html new file mode 100644 index 0000000000000..2993681934eb5 --- /dev/null +++ b/tests/webTestResults.html @@ -0,0 +1,34 @@ + + + + Mocha Tests + + + +
+
+ + +
+ +
+ +
+ + + + + + + + \ No newline at end of file diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts new file mode 100644 index 0000000000000..b01754c8e56fd --- /dev/null +++ b/tests/webTestServer.ts @@ -0,0 +1,282 @@ +/// + +import http = require("http"); +import fs = require("fs"); +import path = require("path"); +import url = require("url"); +import child_process = require("child_process"); + +/// Command line processing /// + +if (process.argv[2] == '--help') { + console.log('Runs a node server on port 8888 by default, looking for tests folder in the current directory\n'); + console.log('Syntax: node nodeServer.js [port] [typescriptEnlistmentDirectory] [tests] [--browser] [--verbose]\n'); + console.log('Examples: \n\tnode nodeServer.js 8888 .'); + console.log('\tnode nodeServer.js 3000 D:/src/typescript/public --verbose IE'); +} + +function switchToForwardSlashes(path: string) { + return path.replace(/\\/g, "/").replace(/\/\//g, '/'); +} + +var defaultPort = 8888; +var port = process.argv[2] || defaultPort; +var rootDir = switchToForwardSlashes(__dirname + '/../'); + +var browser: string; +if (process.argv[3]) { + browser = process.argv[3]; + if (browser !== 'chrome' && browser !== 'IE') { + console.log('Invalid command line arguments. Got ' + browser + ' but expected chrome, IE or nothing.'); + } +} + +var grep = process.argv[4]; + +var verbose = false; +if (process.argv[5] == '--verbose') { + verbose = true; +} else if (process.argv[5] && process.argv[5] !== '--verbose') { + console.log('Invalid command line arguments. Got ' + process.argv[5] + ' but expected --verbose or nothing.'); +} + +/// Utils /// +function log(msg: string) { + if (verbose) { + console.log(msg); + } +} + +// Copied from the compiler sources +function dir(path: string, spec?: string, options?: any) { + options = options || <{ recursive?: boolean; }>{}; + + function filesInFolder(folder: string): string[] { + var folder = switchToForwardSlashes(folder); + var paths: string[] = []; + + try { + var files = fs.readdirSync(folder); + for (var i = 0; i < files.length; i++) { + var stat = fs.statSync(folder + "/" + files[i]); + if (options.recursive && stat.isDirectory()) { + paths = paths.concat(filesInFolder(folder + "/" + files[i])); + } else if (stat.isFile() && (!spec || files[i].match(spec))) { + var relativePath = folder.substring(folder.indexOf('/typescript/') + 12); + paths.push(relativePath + "/" + files[i]); + } + } + } catch (err) { + // Skip folders that are inaccessible + } + return paths; + } + + return filesInFolder(path); +} + +// fs.rmdirSync won't delete directories with files in it +function deleteFolderRecursive(path: string) { + if (fs.existsSync(path)) { + fs.readdirSync(path).forEach(function (file, index) { + var curPath = path + "/" + file; + if (fs.statSync(curPath).isDirectory()) { // recurse + deleteFolderRecursive(curPath); + } else { // delete file + fs.unlinkSync(curPath); + } + }); + fs.rmdirSync(path); + } +}; + +function writeFile(path: string, data: any, opts: { recursive: boolean }) { + try { + fs.writeFileSync(path, data); + } catch (e) { + // assume file was written to a directory that exists, if not, start recursively creating them as necessary + var parts = switchToForwardSlashes(path).split('/'); + for (var i = 0; i < parts.length; i++) { + var subDir = parts.slice(0, i).join('/'); + if (!fs.existsSync(subDir)) { + fs.mkdir(subDir); + } + } + fs.writeFileSync(path, data); + } +} + +/// Request Handling /// + +function handleResolutionRequest(filePath: string, res: http.ServerResponse) { + var resolvedPath = path.resolve(filePath, ''); + resolvedPath = resolvedPath.substring(resolvedPath.indexOf('tests')); + resolvedPath = switchToForwardSlashes(resolvedPath); + send('success', res, resolvedPath); + return; +} + +function send(result: "fail", res: http.ServerResponse, contents: string, contentType?: string): void; +function send(result: "success", res: http.ServerResponse, contents: string, contentType?: string): void; +function send(result: "unknown", res: http.ServerResponse, contents: string, contentType?: string): void; +function send(result: string, res: http.ServerResponse, contents: string, contentType?: string): void +function send(result: string, res: http.ServerResponse, contents: string, contentType = "binary"): void { + var responseCode = result === "success" ? 200 : result === "fail" ? 500 : result === 'unknown' ? 404 : parseInt(result); + res.writeHead(responseCode, { "Content-Type": contentType }); + res.end(contents); + return; +} + +// Reads the data from a post request and passes it to the given callback +function processPost(req: http.ServerRequest, res: http.ServerResponse, callback: (data: string) => any): void { + var queryData = ""; + if (typeof callback !== 'function') return null; + + if (req.method == 'POST') { + req.on('data', function (data: string) { + queryData += data; + if (queryData.length > 1e8) { + queryData = ""; + send("413", res, null); + console.log("ERROR: destroying connection"); + req.connection.destroy(); + } + }); + + req.on('end', function () { + //res.post = url.parse(req.url).query; + callback(queryData); + }); + + } else { + send("405", res, null); + } +} + +enum RequestType { + GetFile, + GetDir, + ResolveFile, + WriteFile, + DeleteFile, + WriteDir, + DeleteDir, + AppendFile, + Unknown +} + +function getRequestOperation(req: http.ServerRequest, filename: string) { + if (req.method === 'GET' && req.url.indexOf('?') === -1) { + if (req.url.indexOf('.') !== -1) return RequestType.GetFile; + else return RequestType.GetDir; + } + else { + var queryData: any = url.parse(req.url, true).query; + if (req.method === 'GET' && queryData.resolve !== undefined) return RequestType.ResolveFile + // mocha uses ?grep= query string as equivalent to the --grep command line option used to filter tests + if (req.method === 'GET' && queryData.grep !== undefined) return RequestType.GetFile + if (req.method === 'POST' && queryData.action) { + var path = req.url.substr(0, req.url.lastIndexOf('?')); + var isFile = path.substring(path.lastIndexOf('/')).indexOf('.') !== -1; + switch (queryData.action.toUpperCase()) { + case 'WRITE': + return isFile ? RequestType.WriteFile : RequestType.WriteDir; + case 'DELETE': + return isFile ? RequestType.DeleteFile : RequestType.DeleteDir; + case 'APPEND': + return isFile ? RequestType.AppendFile : RequestType.Unknown; + } + } + return RequestType.Unknown + } + return RequestType.Unknown +} + +function handleRequestOperation(req: http.ServerRequest, res: http.ServerResponse, operation: RequestType, reqPath: string) { + switch (operation) { + case RequestType.GetDir: + var filesInFolder = dir(reqPath, "", { recursive: true }); + send('success', res, filesInFolder.join(',')); + break; + case RequestType.GetFile: + fs.readFile(reqPath, function (err, file) { + var ext = reqPath.substr(reqPath.lastIndexOf('.')); + var contentType = 'binary'; + if (ext === '.js') contentType = 'text/javascript' + else if (ext === '.css') contentType = 'text/javascript' + else if (ext === '.html') contentType = 'text/html' + err + ? send('fail', res, err.message, contentType) + : send('success', res, (file), contentType); + }); + break; + case RequestType.ResolveFile: + var resolveRequest = req.url.match(/(.*)\?resolve/); + handleResolutionRequest(resolveRequest[1], res); + break; + case RequestType.WriteFile: + processPost(req, res, (data) => { + writeFile(reqPath, data, { recursive: true }); + }); + send('success', res, null); + break; + case RequestType.WriteDir: + fs.mkdirSync(reqPath); + send('success', res, null); + break; + case RequestType.DeleteFile: + fs.unlinkSync(reqPath); + send('success', res, null); + break; + case RequestType.DeleteDir: + fs.rmdirSync(reqPath); + send('success', res, null); + break; + case RequestType.AppendFile: + processPost(req, res, (data) => { + fs.appendFileSync(reqPath, data); + }); + send('success', res, null); + break; + case RequestType.Unknown: + default: + send('unknown', res, null); + break; + } +} + +console.log("Static file server running at\n => http://localhost:" + port + "/\nCTRL + C to shutdown"); + +http.createServer(function (req: http.ServerRequest, res: http.ServerResponse) { + log(req.method + ' ' + req.url); + var uri = url.parse(req.url).pathname + var reqPath = path.join(process.cwd(), uri); + var operation = getRequestOperation(req, reqPath); + handleRequestOperation(req, res, operation, reqPath); +}).listen(8888); + +var browserPath: string; +if ((browser && browser === 'chrome')) { + var defaultChromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; + if (fs.existsSync(defaultChromePath)) { + browserPath = defaultChromePath; + } else { + browserPath = browser; + } +} else { + var defaultIEPath = 'C:/Program Files/Internet Explorer/iexplore.exe'; + if (fs.existsSync(defaultIEPath)) { + browserPath = defaultIEPath; + } else { + browserPath = browser; + } +} + +console.log('Using browser: ' + browserPath); + +var queryString = grep ? "?grep=" + grep : ''; +child_process.spawn(browserPath, ['http://localhost:' + port + '/tests/webTestResults.html' + queryString], (err: Error, stdout: any, stderr: any) => { + console.log("ERR: " + err.message); + console.log("STDOUT: " + stdout.toString()); + console.log("STDERR: " + stderr.toString()); +}); \ No newline at end of file diff --git a/tests/webhost/webhost.html b/tests/webhost/webhost.html new file mode 100644 index 0000000000000..8d67918732bec --- /dev/null +++ b/tests/webhost/webhost.html @@ -0,0 +1,87 @@ + + + WebTSC + + + + + + + +
+ +
+
+

Command line:

+ +

Output:

+ +
+
+ +
+
+
+ + \ No newline at end of file diff --git a/tests/webhost/webtsc.ts b/tests/webhost/webtsc.ts new file mode 100644 index 0000000000000..80b0cfc33badd --- /dev/null +++ b/tests/webhost/webtsc.ts @@ -0,0 +1,81 @@ +/// + +module TypeScript.WebTsc { + + declare var RealActiveXObject: { new (s: string): any }; + + function getWScriptSystem(): System { + var fso = new RealActiveXObject("Scripting.FileSystemObject"); + var args: string[] = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + return { + args: args, + newLine: "\r\n", + write(s: string): void { + WScript.StdOut.Write(s); + }, + writeErr(s: string): void { + WScript.StdErr.Write(s); + }, + readFile(fileName: string): string { + try { + var f = fso.OpenTextFile(fileName, 1); + var s: string = f.ReadAll(); + // TODO: Properly handle byte order marks + if (s.length >= 3 && s.charCodeAt(0) === 0xEF && s.charCodeAt(1) === 0xBB && s.charCodeAt(2) === 0xBF) s = s.slice(3); + f.Close(); + } + catch (e) { + } + return s; + }, + writeFile(fileName: string, data: string): void { + var f = fso.CreateTextFile(fileName, true); + f.Write(data); + f.Close(); + }, + resolvePath(path: string): string { + return fso.GetAbsolutePathName(path); + }, + fileExists(path: string): boolean { + return fso.FileExists(path); + }, + directoryExists(path: string) { + return fso.FolderExists(path); + }, + createDirectory(directoryName: string) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath() { + return WScript.ScriptFullName; + }, + getCurrentDirectory() { + return ""; + }, + getMemoryUsage() { + return 0; + }, + exit(exitCode?: number): void { + WScript.Quit(exitCode); + }, + useCaseSensitiveFileNames: false + }; + } + + export function prepareCompiler(currentDir: string, stdOut: ITextWriter, stdErr: ITextWriter) { + var shell = new RealActiveXObject("WScript.Shell"); + shell.CurrentDirectory = currentDir; + WScript.ScriptFullName = currentDir + "\\tc.js"; + WScript.StdOut = stdOut; + WScript.StdErr = stdErr; + sys = getWScriptSystem(); + + return function (commandLine: string) { + ts.executeCommandLine(commandLine.split(" ")); + } + } +} diff --git a/tests/webhost/wscript.js b/tests/webhost/wscript.js new file mode 100644 index 0000000000000..8cacfd4eb7d66 --- /dev/null +++ b/tests/webhost/wscript.js @@ -0,0 +1,22 @@ +var RealActiveXObject = ActiveXObject + +var WScript; +(function (WScript) { + WScript.Arguments = []; + WScript.Echo = function (str) { }; + WScript.StdErr = { + Write: function() {} + } + WScript.StdOut = { + Write: function () { }, + WriteLine: function () { } + } + + WScript.Quit = function (exitCode) { } +})(WScript || (WScript = {})); + +var ActiveXObject = (function () { + function ActiveXObject(name) { + } + return ActiveXObject; +})();